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 { connect } from 'dva';
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 './celllist.less';
......@@ -20,28 +20,45 @@ const Detail = (props: any) => {
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(() => {
if (DataSave) {
// 返回列表
RA(32, { id: DataSave.id }, module, dispatch);
} else {
// 返回列表
history.push('/CommunityManagement/CellList');
}
}, [1]);
useEffect(() => {
if (detailData == null) {
// 返回列表
history.push('/CommunityManagement/CellList');
}
}, [detailData]);
useEffect(() => {
if (overCom != null) {
message.success(`Community Deleted Successfully`);
// 然后在清空删除成功数据
dispatch({ type: module + '/comRemove' });
// message.success(`Community Deleted Successfully`);
// 提示用户下载
setModelExcel(true); //状态
console.log(overCom);
// 储存本次返回的结果
setModelResult(overCom);
// 在删除搜索小区
let a = detailData.rows.residentialName; // 当前删除小区
let c = CommunityList.filter((item: any) => item != a); // 过滤掉
dispatch({ type: 'Init/delCommunityget', playload: { Result: c } });
// 跳转
history.push('/CommunityManagement/CellList');
// 最后清空删除成功的数据
dispatch({ type: module + '/comRemove' });
}
}, [overCom]);
......@@ -50,14 +67,16 @@ const Detail = (props: any) => {
{ label: 'Online Payment', value: '0', disabled: true },
{ label: 'Offline Payment', value: '1', disabled: true },
];
// 关闭提示框
const [ModelFee, setModelFee] = useState(false);
// 返回
const goToReturn = () => {
// console.log(fileList)
history.go(-1);
};
const goback = () => {
// 跳转
history.push('/CommunityManagement/CellList');
};
// 复制
const copy = (msg: string, tip: string = 'Copy Success') => {
......@@ -110,9 +129,10 @@ const Detail = (props: any) => {
return (
<>
{!ModelExcel ? (
<Spin spinning={loading}>
{detailData.rows ? (
<div className="form">
<div className="form" style={{ width: '100%', minHeight: '20vh' }}>
<h3>
<EyeOutlined />
&nbsp;Community Details
......@@ -147,7 +167,12 @@ const Detail = (props: any) => {
<div className="code">
<li>Community Activation Code</li>
<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} />
</div>
......@@ -289,8 +314,8 @@ const Detail = (props: any) => {
confirmLoading={loading}
>
<p className="capi">
Close the community will delete <span style={{ color: 'red' }}> all owners </span>in
the community .
Close the community will delete <span style={{ color: 'red' }}> all owners </span>
in the community .
</p>
<p className="capi">please operate carefully!</p>
</Modal>
......@@ -299,6 +324,31 @@ const Detail = (props: any) => {
''
)}
</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 {
border-radius: 3px;
background: #fff;
box-shadow: 0 1px 1px #ccc;
overflow: auto;
h3 {
margin-bottom: 30px;
position: relative;
......
......@@ -128,8 +128,8 @@ const BookingDetail = (props: any) => {
}
}
// 状态
let status = DataSave.status; // 预约设施状态
let feeStatus = DataSave.feeStatus; //费用状态
let status = DataSave ? DataSave.status : 0; // 预约设施状态
let feeStatus = DataSave ? DataSave.feeStatus : 0; //费用状态
// let subFeeStatus = DataSave.subFeeStatus; // 排序状态
// let marginFeeStatus = DataSave.marginFeeStatus; //押金状态
// let managerFeeStatus = DataSave.managerFeeStatus; //管理费状态
......
......@@ -222,13 +222,13 @@ const FacilityBookings = (props: any) => {
}, [CommunityList]);
const CallBackTitleSearch = (comment: any) => {
if (curString.tab == 1) {
// 没有选小区就不让他提交
if (comment.communityName && comment.communityName.length == 0) {
message.info('Please Select A Community !');
return;
}
if (curString.tab == 1) {
if (comment.communityName != null || comment.key != null || comment.status != null) {
var tmp = curString;
tmp.subscribeDate = comment.key;
......@@ -253,14 +253,19 @@ const FacilityBookings = (props: any) => {
});
}
} 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;
tmp.communityNameList2 = comment.communityName;
tmp.communityNameList2 = comment.communityName2;
tmp.facilityName = comment.facilityName;
tmp.curPage = 1;
QA(tmp);
RA(8, {
communityNameList: comment.communityName,
communityNameList: comment.communityName2,
facilityName: comment.facilityName,
pageNum: '1',
});
......@@ -362,7 +367,7 @@ const FacilityBookings = (props: any) => {
<TitleSearch
listkey={['facilityName']}
list={['Facility name']}
community={'communityName'}
community={'communityName2'}
checklist={curString.communityNameList2 ? curString.communityNameList2 : []}
onSubmit={CallBackTitleSearch}
/>
......
/*
* @Author: your name
* @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
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\params.ts
......@@ -94,4 +94,5 @@ export const requestList = [
['/tos/bug/feedback/list', '59 获取用户反馈列表', {}],
['/tos/community/facilities/get/detail', '60 获取小区设施详情', {}],
['/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