Commit f0aec099 authored by cellee's avatar cellee

设施详情状态判断

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 018f0c76
......@@ -22,9 +22,8 @@ const BookingDetail = (props: any) => {
// 已预约时间段
let arr = DataSave.subscribeTime.split(',');
setExtractTime(`${arr[0]} To ${arr[arr.length - 1]}`);
if (DataSave.managerFeeStatus != 0) {
// if (DataSave.managerFeeStatus != 0) {}
RA(2, { accountCategoriesId: DataSave.id });
}
} else {
history.push('/CommunityManagement/FacilityBookings');
}
......@@ -120,6 +119,26 @@ const BookingDetail = (props: any) => {
setModalVisible(false);
};
// 条件判断
function pd(a: any, b: any) {
if (a == b) {
return true;
} else {
return false;
}
}
// 状态
let status = DataSave.status; // 预约设施状态
let feeStatus = DataSave.feeStatus; //费用状态
// let subFeeStatus = DataSave.subFeeStatus; // 排序状态
// let marginFeeStatus = DataSave.marginFeeStatus; //押金状态
// let managerFeeStatus = DataSave.managerFeeStatus; //管理费状态
// 退费条件
let term1 = pd(status, 2) && pd(feeStatus, 1);
let term2 = pd(status, 3) && pd(feeStatus, 2);
let term3 = pd(status, 4) && pd(feeStatus, 2);
return (
<>
{DataSave && DataSaveDetail ? (
......@@ -167,15 +186,7 @@ const BookingDetail = (props: any) => {
DataSave.status != 3 &&
DataSave.status != 5) ? ( */}
{(DataSave &&
DataSaveDetail &&
DataSave.managerFeeStatus == 1 &&
DataSaveDetail.backMarginFee == 0 &&
DataSaveDetail.marginFee > 0) ||
(DataSaveDetail.managerFee == 0 &&
DataSaveDetail.marginFee > 0 &&
DataSave.status != 3 &&
DataSave.status != 5) ? (
{DataSave && DataSaveDetail && (term1 || term2 || term3) ? (
<>
<Form
ref={formRef}
......
import React, { useState, useEffect, useRef } from 'react';
import { Tabs, Spin, Input, InputNumber, Button, Form, Select, message, TimePicker } from 'antd';
import {
Tabs,
Spin,
Input,
InputNumber,
Button,
Form,
Select,
message,
TimePicker,
Modal,
} from 'antd';
import { connect, history } from 'umi';
import { PoweroffOutlined } from '@ant-design/icons';
const { Option } = Select;
const { RangePicker } = TimePicker;
const { TabPane } = Tabs;
......@@ -37,6 +50,8 @@ const FacilityTow = (props: any) => {
const [Cycle, setCycle] = useState(null as any); // 周期下拉
const [Facilityid, setFacilityId] = useState(null as any); // 周期下拉
const [isModalVisible, setIsModalVisible] = useState(false); // 关闭弹出框
const formRef = useRef(null as any);
const [form] = Form.useForm(); // 表单标识
const module = 'FacilityBookings';
......@@ -67,7 +82,7 @@ const FacilityTow = (props: any) => {
return n1.id - n2.id;
});
} else {
//返回列表
history.push('/CommunityManagement/FacilityBookings');
}
}, [DataSave]);
......@@ -241,6 +256,30 @@ const FacilityTow = (props: any) => {
});
};
// 打开关闭框
const showModal = () => {
setIsModalVisible(true);
};
// 确认删除
const handleOk = () => {
// setIsModalVisible(false);
message.info('In function development');
};
// 关闭关闭框
const handleCancel = () => {
setIsModalVisible(false);
};
// 关闭按钮
const operations = (
<Button type="primary" danger onClick={showModal}>
<PoweroffOutlined />
Close The Selected Facility
</Button>
);
return (
<div style={{ padding: 16 }}>
{/* 头部组件v1.2 */}
......@@ -252,7 +291,12 @@ const FacilityTow = (props: any) => {
<label>Community :</label> {DataSave ? DataSave.community : ''}
</div>
<Tabs defaultActiveKey="0" tabPosition="top" onTabClick={(key) => onTabClicks(key)}>
<Tabs
defaultActiveKey="0"
tabPosition="top"
onTabClick={(key) => onTabClicks(key)}
tabBarExtraContent={facilityDetail ? operations : ''}
>
{DataSave
? DataSave.facilities.map((i: any) => <TabPane tab={`${i.name}`} key={i.id}></TabPane>)
: ''}
......@@ -439,6 +483,27 @@ const FacilityTow = (props: any) => {
</Form>
</div>
</Spin>
<Modal
title="Close Facility"
visible={isModalVisible}
onOk={handleOk}
okText={'Confirm'}
cancelText={'Cancel'}
onCancel={handleCancel}
centered
confirmLoading={load}
>
<p>
Closing of facilities :{' '}
<span style={{ color: '#f00' }}>
{DataSaveDetail && DataSaveDetail.facilities && DataSaveDetail.facilities.facilityName
? DataSaveDetail.facilities.facilityName
: ''}{' '}
</span>
?
</p>
</Modal>
</div>
);
};
......
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