Commit e52152da authored by cellee's avatar cellee

关闭小区下载预约设施表格费用

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent b77e036d
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { LeftOutlined, EyeOutlined, PoweroffOutlined } from '@ant-design/icons'; import { LeftOutlined, EyeOutlined, PoweroffOutlined } from '@ant-design/icons';
import { Modal, Input, Button, Spin, Checkbox, Image, message, Divider } from 'antd'; import { Modal, Input, Button, Spin, Checkbox, Image, message, Divider, Result } from 'antd';
import { history } from 'umi'; import { history } from 'umi';
// 样式 // 样式
import './celllist.less'; import './celllist.less';
...@@ -20,28 +20,45 @@ const Detail = (props: any) => { ...@@ -20,28 +20,45 @@ const Detail = (props: any) => {
const { detailData, DataSave, dispatch, loading, overCom, user, CommunityList } = props; const { detailData, DataSave, dispatch, loading, overCom, user, CommunityList } = props;
// 关闭提示框
const [ModelFee, setModelFee] = useState(false);
// 关闭小区后提示下载小区的预约设施表格
const [ModelExcel, setModelExcel] = useState(false);
const [ModelResult, setModelResult] = useState(null as any);
useEffect(() => { useEffect(() => {
if (DataSave) { if (DataSave) {
// 返回列表
RA(32, { id: DataSave.id }, module, dispatch); RA(32, { id: DataSave.id }, module, dispatch);
} else { } else {
// 返回列表
history.push('/CommunityManagement/CellList'); history.push('/CommunityManagement/CellList');
} }
}, [1]); }, [1]);
useEffect(() => {
if (detailData == null) {
// 返回列表
history.push('/CommunityManagement/CellList');
}
}, [detailData]);
useEffect(() => { useEffect(() => {
if (overCom != null) { if (overCom != null) {
message.success(`Community Deleted Successfully`); // message.success(`Community Deleted Successfully`);
// 然后在清空删除成功数据
dispatch({ type: module + '/comRemove' }); // 提示用户下载
setModelExcel(true); //状态
console.log(overCom);
// 储存本次返回的结果
setModelResult(overCom);
// 在删除搜索小区 // 在删除搜索小区
let a = detailData.rows.residentialName; // 当前删除小区 let a = detailData.rows.residentialName; // 当前删除小区
let c = CommunityList.filter((item: any) => item != a); // 过滤掉 let c = CommunityList.filter((item: any) => item != a); // 过滤掉
dispatch({ type: 'Init/delCommunityget', playload: { Result: c } }); dispatch({ type: 'Init/delCommunityget', playload: { Result: c } });
// 跳转 // 最后清空删除成功的数据
history.push('/CommunityManagement/CellList'); dispatch({ type: module + '/comRemove' });
} }
}, [overCom]); }, [overCom]);
...@@ -50,14 +67,16 @@ const Detail = (props: any) => { ...@@ -50,14 +67,16 @@ const Detail = (props: any) => {
{ label: 'Online Payment', value: '0', disabled: true }, { label: 'Online Payment', value: '0', disabled: true },
{ label: 'Offline Payment', value: '1', disabled: true }, { label: 'Offline Payment', value: '1', disabled: true },
]; ];
// 关闭提示框
const [ModelFee, setModelFee] = useState(false);
// 返回 // 返回
const goToReturn = () => { const goToReturn = () => {
// console.log(fileList) // console.log(fileList)
history.go(-1); history.go(-1);
}; };
const goback = () => {
// 跳转
history.push('/CommunityManagement/CellList');
};
// 复制 // 复制
const copy = (msg: string, tip: string = 'Copy Success') => { const copy = (msg: string, tip: string = 'Copy Success') => {
...@@ -110,9 +129,10 @@ const Detail = (props: any) => { ...@@ -110,9 +129,10 @@ const Detail = (props: any) => {
return ( return (
<> <>
{!ModelExcel ? (
<Spin spinning={loading}> <Spin spinning={loading}>
{detailData.rows ? ( {detailData.rows ? (
<div className="form"> <div className="form" style={{ width: '100%', minHeight: '20vh' }}>
<h3> <h3>
<EyeOutlined /> <EyeOutlined />
&nbsp;Community Details &nbsp;Community Details
...@@ -147,7 +167,12 @@ const Detail = (props: any) => { ...@@ -147,7 +167,12 @@ const Detail = (props: any) => {
<div className="code"> <div className="code">
<li>Community Activation Code</li> <li>Community Activation Code</li>
<div <div
style={{ width: 122, height: 122, border: '1px solid #f0f0f0', margin: '0 auto' }} style={{
width: 122,
height: 122,
border: '1px solid #f0f0f0',
margin: '0 auto',
}}
> >
<Image width={120} src={detailData.visitorUrl} /> <Image width={120} src={detailData.visitorUrl} />
</div> </div>
...@@ -289,8 +314,8 @@ const Detail = (props: any) => { ...@@ -289,8 +314,8 @@ const Detail = (props: any) => {
confirmLoading={loading} confirmLoading={loading}
> >
<p className="capi"> <p className="capi">
Close the community will delete <span style={{ color: 'red' }}> all owners </span>in Close the community will delete <span style={{ color: 'red' }}> all owners </span>
the community . in the community .
</p> </p>
<p className="capi">please operate carefully!</p> <p className="capi">please operate carefully!</p>
</Modal> </Modal>
...@@ -299,6 +324,31 @@ const Detail = (props: any) => { ...@@ -299,6 +324,31 @@ const Detail = (props: any) => {
'' ''
)} )}
</Spin> </Spin>
) : (
// '关闭小区后的下载预约费用列表或者返回'
<Result
status="success"
title="Community Deleted Successfully!"
subTitle="There is booking facility information of transaction in the current community, please select download."
extra={[
ModelResult && ModelResult.downloadExcelUrl ? (
<Button type="primary" key="console">
<a
style={{ display: 'block', height: '100%' }}
href={`${ModelResult.downloadExcelUrl}`}
>
Download
</a>
</Button>
) : (
''
),
<Button key="buy" onClick={goback}>
Back to list
</Button>,
]}
/>
)}
</> </>
); );
}; };
......
...@@ -19,6 +19,7 @@ li { ...@@ -19,6 +19,7 @@ li {
border-radius: 3px; border-radius: 3px;
background: #fff; background: #fff;
box-shadow: 0 1px 1px #ccc; box-shadow: 0 1px 1px #ccc;
overflow: auto;
h3 { h3 {
margin-bottom: 30px; margin-bottom: 30px;
position: relative; position: relative;
......
...@@ -128,8 +128,8 @@ const BookingDetail = (props: any) => { ...@@ -128,8 +128,8 @@ const BookingDetail = (props: any) => {
} }
} }
// 状态 // 状态
let status = DataSave.status; // 预约设施状态 let status = DataSave ? DataSave.status : 0; // 预约设施状态
let feeStatus = DataSave.feeStatus; //费用状态 let feeStatus = DataSave ? DataSave.feeStatus : 0; //费用状态
// let subFeeStatus = DataSave.subFeeStatus; // 排序状态 // let subFeeStatus = DataSave.subFeeStatus; // 排序状态
// let marginFeeStatus = DataSave.marginFeeStatus; //押金状态 // let marginFeeStatus = DataSave.marginFeeStatus; //押金状态
// let managerFeeStatus = DataSave.managerFeeStatus; //管理费状态 // let managerFeeStatus = DataSave.managerFeeStatus; //管理费状态
......
...@@ -222,13 +222,13 @@ const FacilityBookings = (props: any) => { ...@@ -222,13 +222,13 @@ const FacilityBookings = (props: any) => {
}, [CommunityList]); }, [CommunityList]);
const CallBackTitleSearch = (comment: any) => { const CallBackTitleSearch = (comment: any) => {
if (curString.tab == 1) {
// 没有选小区就不让他提交 // 没有选小区就不让他提交
if (comment.communityName && comment.communityName.length == 0) { if (comment.communityName && comment.communityName.length == 0) {
message.info('Please Select A Community !'); message.info('Please Select A Community !');
return; return;
} }
if (curString.tab == 1) {
if (comment.communityName != null || comment.key != null || comment.status != null) { if (comment.communityName != null || comment.key != null || comment.status != null) {
var tmp = curString; var tmp = curString;
tmp.subscribeDate = comment.key; tmp.subscribeDate = comment.key;
...@@ -253,14 +253,19 @@ const FacilityBookings = (props: any) => { ...@@ -253,14 +253,19 @@ const FacilityBookings = (props: any) => {
}); });
} }
} else { } else {
if (comment.communityName != null || comment.facilityName != null) { // 没有选小区就不让他提交
if (comment.communityName2 && comment.communityName2.length == 0) {
message.info('Please Select A Community !');
return;
}
if (comment.communityName2 != null || comment.facilityName != null) {
var tmp = curString; var tmp = curString;
tmp.communityNameList2 = comment.communityName; tmp.communityNameList2 = comment.communityName2;
tmp.facilityName = comment.facilityName; tmp.facilityName = comment.facilityName;
tmp.curPage = 1; tmp.curPage = 1;
QA(tmp); QA(tmp);
RA(8, { RA(8, {
communityNameList: comment.communityName, communityNameList: comment.communityName2,
facilityName: comment.facilityName, facilityName: comment.facilityName,
pageNum: '1', pageNum: '1',
}); });
...@@ -362,7 +367,7 @@ const FacilityBookings = (props: any) => { ...@@ -362,7 +367,7 @@ const FacilityBookings = (props: any) => {
<TitleSearch <TitleSearch
listkey={['facilityName']} listkey={['facilityName']}
list={['Facility name']} list={['Facility name']}
community={'communityName'} community={'communityName2'}
checklist={curString.communityNameList2 ? curString.communityNameList2 : []} checklist={curString.communityNameList2 ? curString.communityNameList2 : []}
onSubmit={CallBackTitleSearch} onSubmit={CallBackTitleSearch}
/> />
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-11-19 20:34:18 * @Date: 2020-11-19 20:34:18
* @LastEditTime: 2021-01-27 14:48:03 * @LastEditTime: 2021-01-28 15:34:25
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\params.ts * @FilePath: \tostumi\src\utils\params.ts
...@@ -94,4 +94,5 @@ export const requestList = [ ...@@ -94,4 +94,5 @@ export const requestList = [
['/tos/bug/feedback/list', '59 获取用户反馈列表', {}], ['/tos/bug/feedback/list', '59 获取用户反馈列表', {}],
['/tos/community/facilities/get/detail', '60 获取小区设施详情', {}], ['/tos/community/facilities/get/detail', '60 获取小区设施详情', {}],
['/tos/bookingService/delete', '61 设施删除', {}], ['/tos/bookingService/delete', '61 设施删除', {}],
['/tos/community/download/excel', '62 关闭小区后获取当前小区预约需要退费的表格', {}],
]; ];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment