Commit fc0bc1b4 authored by cellee's avatar cellee

Signed-off-by: cellee <893264950@qq.com>

parent a9b87c90
/*
* @Author: your name
* @Date: 2020-12-02 09:42:49
* @LastEditTime: 2021-01-22 18:16:44
* @LastEditors: your name
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\components\SearchOptions\SearchOptionsTow.tsx
*/
import React from 'react'; import React from 'react';
import { Select } from 'antd'; import { Select } from 'antd';
const { Option } = Select; const { Option } = Select;
...@@ -37,6 +45,7 @@ const SearchOptionsTow = (porps: any) => { ...@@ -37,6 +45,7 @@ const SearchOptionsTow = (porps: any) => {
) : ( ) : (
<Select <Select
showSearch showSearch
allowClear
style={{ width: 200 }} style={{ width: 200 }}
placeholder="Community Name" placeholder="Community Name"
optionFilterProp="children" optionFilterProp="children"
......
...@@ -108,18 +108,18 @@ export default { ...@@ -108,18 +108,18 @@ export default {
// // window.location.href = '/500'; // // window.location.href = '/500';
// } // }
if (resp.error_code != "0000") { if (resp.error_code != "0000") {
var Result = null // var Result = null
switch (playload.index) { // switch (playload.index) {
case 1: // case 1:
// message.error("Could't not found the facility!") // // message.error("Could't not found the facility!")
Result ={index:playload.index,msg:"Could't not found the facility!"}; // Result ={index:playload.index,msg:"Could't not found the facility!"};
yield put({ type: 'returnResult', Result }); // yield put({ type: 'returnResult', Result });
break; // break;
case 11: // case 11:
Result ={index:playload.index,msg:resp.error_msg}; // Result ={index:playload.index,msg:resp.error_msg};
yield put({ type: 'returnResult', Result }); // yield put({ type: 'returnResult', Result });
break; // break;
} // }
message.error(`${resp.error_code}:${resp.error_msg}`); message.error(`${resp.error_code}:${resp.error_msg}`);
} }
else { else {
......
...@@ -188,7 +188,9 @@ const Account = (props: any) => { ...@@ -188,7 +188,9 @@ const Account = (props: any) => {
// 表头单搜索 // 表头单搜索
const onFinishContract = (value: any) => { const onFinishContract = (value: any) => {
if (value.tosUserName || value.creatorName) { if (value.tosAccountName || value.creatorName) {
const userInfo = JSON.parse(localStorage.getItem('userInfo') || '[]');
value.creatorId = userInfo.userModel.id;
let t = { ...term, ...value }; let t = { ...term, ...value };
delete t.pageNum; // 搜索的时候 删除页码 delete t.pageNum; // 搜索的时候 删除页码
...@@ -234,7 +236,7 @@ const Account = (props: any) => { ...@@ -234,7 +236,7 @@ const Account = (props: any) => {
name="contract" name="contract"
onFinish={onFinishContract} onFinish={onFinishContract}
> >
<Form.Item name="tosUserName"> <Form.Item name="tosAccountName">
<Input allowClear placeholder="Account Name" /> <Input allowClear placeholder="Account Name" />
</Form.Item> </Form.Item>
<Form.Item name="creatorName"> <Form.Item name="creatorName">
......
...@@ -390,7 +390,7 @@ const Account = (props: any) => { ...@@ -390,7 +390,7 @@ const Account = (props: any) => {
<Descriptions column={{ xs: 1, sm: 1, md: 2, xl: 3 }}> <Descriptions column={{ xs: 1, sm: 1, md: 2, xl: 3 }}>
<Descriptions.Item> <Descriptions.Item>
<Form.Item name="tosUserName" label="Account ID" rules={AccountTip[0] as any}> <Form.Item name="tosUserName" label="Account ID" rules={AccountTip[0] as any}>
<Input placeholder="Login Account" className="input" /> <Input placeholder="Login Account" className="input" disabled />
</Form.Item> </Form.Item>
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item> <Descriptions.Item>
......
...@@ -69,7 +69,7 @@ const CellLists = (props: any) => { ...@@ -69,7 +69,7 @@ const CellLists = (props: any) => {
], ],
]); ]);
const { dispatch, loading, curString, village, Init } = props; const { dispatch, loading, village, Init } = props;
const [term, setTerm] = useState({ communityNameList: Init.CommunityList, pageNum: 1 } as any); // 拉取数据的条件存储 const [term, setTerm] = useState({ communityNameList: Init.CommunityList, pageNum: 1 } as any); // 拉取数据的条件存储
...@@ -78,13 +78,13 @@ const CellLists = (props: any) => { ...@@ -78,13 +78,13 @@ const CellLists = (props: any) => {
useEffect(() => { useEffect(() => {
if (village == null) { if (village == null) {
const obj = { const obj = {
communityNameList: Init.CommunityList, communityNameList: Init.CommunityList ? Init.CommunityList : [],
pageNum: 1, pageNum: 1,
}; };
setTerm(obj); setTerm(obj);
RA(48, obj, module, dispatch); RA(48, obj, module, dispatch);
} }
}, [village]); }, [village, Init]);
// 清除操作之前的数据 // 清除操作之前的数据
const emptys = (data: any, url: any) => { const emptys = (data: any, url: any) => {
......
...@@ -59,6 +59,9 @@ const Bookings = (props: any) => { ...@@ -59,6 +59,9 @@ const Bookings = (props: any) => {
const [value, setValue] = React.useState(1); const [value, setValue] = React.useState(1);
const [dateTime, setdateTime] = React.useState(true); //是否选择了日期,不选择不给输入楼栋, 要用来查找
const [Time, setTime] = React.useState(null as any); // 选择的日期
// 表单标识 // 表单标识
const [form] = Form.useForm(); const [form] = Form.useForm();
...@@ -125,6 +128,7 @@ const Bookings = (props: any) => { ...@@ -125,6 +128,7 @@ const Bookings = (props: any) => {
buildNumber: `BLK ${Unit.buildNumber}`, buildNumber: `BLK ${Unit.buildNumber}`,
floorNumber: Unit.floorNumber, floorNumber: Unit.floorNumber,
roomNumber: Unit.roomNumber, roomNumber: Unit.roomNumber,
subscribeDate: Time,
}); });
} }
}, [Unit]); }, [Unit]);
...@@ -243,6 +247,8 @@ const Bookings = (props: any) => { ...@@ -243,6 +247,8 @@ const Bookings = (props: any) => {
} }
}); });
}); });
setdateTime(true); // 输入框禁止
}; };
// 选择小区名字发起请求 // 选择小区名字发起请求
...@@ -253,10 +259,13 @@ const Bookings = (props: any) => { ...@@ -253,10 +259,13 @@ const Bookings = (props: any) => {
setCurString({ setCurString({
communityManagerFee: null, communityManagerFee: null,
}); });
setResultTime(null);
RA(1, { userToken: token, communityName: values }); RA(1, { userToken: token, communityName: values });
setLoading(true); setResultTime(null);
setProhibit(true); setProhibit(true);
setdateTime(true); // 输入框禁止
if (values !== '') {
setLoading(true);
}
}; };
// 设置之前日期不能选择 // 设置之前日期不能选择
...@@ -273,6 +282,21 @@ const Bookings = (props: any) => { ...@@ -273,6 +282,21 @@ const Bookings = (props: any) => {
}; };
RA(50, data); RA(50, data);
setTime(moment(value).format('YYYY-MM-DD'));
// 判断有没有楼栋
if (Unit.buildNumber && Unit.floorNumber && Unit.roomNumber) {
RA(58, {
facilitiesId: curString.facilitiesId,
communityName: comminityValues,
buildNumber: `BLK ${Unit.buildNumber}`,
floorNumber: Unit.floorNumber,
roomNumber: Unit.roomNumber,
subscribeDate: moment(value).format('YYYY-MM-DD'),
});
}
setdateTime(false); // 输入框打开
}; };
// 鼠标移走 // 鼠标移走
...@@ -372,6 +396,37 @@ const Bookings = (props: any) => { ...@@ -372,6 +396,37 @@ const Bookings = (props: any) => {
</Form.Item> </Form.Item>
</div> </div>
</div> </div>
<div className={styles.line}></div>
<div className="box5 required">
<div className={styles.box5item1}>Booking Schedule : </div>
<div className={styles.box5item2}>
<Row gutter={8}>
<Col>
<Form.Item name="subscribeDate" rules={BookingsTip[5]}>
<DatePicker
placeholder="Select Date"
disabledDate={disabledDate}
onChange={confirmData}
disabled={prohibit}
/>
</Form.Item>
</Col>
<Col>
<Form.Item label="Reserve Time" name="Time" noStyle>
<OnTime
disabled={prohibit}
limit={curString.categoriesOpenTime} // 设施默认禁止时间段
inhibitTime={result} // 选择日期后的禁止时间
onChanges={onChanges}
/>
</Form.Item>
</Col>
</Row>
</div>
</div>
<div className={styles.line}></div> <div className={styles.line}></div>
<div className="box4 required" style={{ marginBottom: 25 }}> <div className="box4 required" style={{ marginBottom: 25 }}>
...@@ -384,7 +439,7 @@ const Bookings = (props: any) => { ...@@ -384,7 +439,7 @@ const Bookings = (props: any) => {
<Input <Input
placeholder="Blk" placeholder="Blk"
style={{ width: 80 }} style={{ width: 80 }}
disabled={prohibit} disabled={prohibit || dateTime}
maxLength={10} maxLength={10}
onBlur={onBlur} onBlur={onBlur}
/> />
...@@ -394,7 +449,7 @@ const Bookings = (props: any) => { ...@@ -394,7 +449,7 @@ const Bookings = (props: any) => {
<Input <Input
placeholder="Floor" placeholder="Floor"
style={{ width: 80 }} style={{ width: 80 }}
disabled={prohibit} disabled={prohibit || dateTime}
maxLength={10} maxLength={10}
onBlur={onBlur} onBlur={onBlur}
/> />
...@@ -404,7 +459,7 @@ const Bookings = (props: any) => { ...@@ -404,7 +459,7 @@ const Bookings = (props: any) => {
<Input <Input
placeholder="Room" placeholder="Room"
style={{ width: 80 }} style={{ width: 80 }}
disabled={prohibit} disabled={prohibit || dateTime}
onBlur={onBlur} onBlur={onBlur}
/> />
</Form.Item> </Form.Item>
...@@ -418,7 +473,7 @@ const Bookings = (props: any) => { ...@@ -418,7 +473,7 @@ const Bookings = (props: any) => {
<Input <Input
style={{ width: 200 }} style={{ width: 200 }}
placeholder="Name Of Subscriber" placeholder="Name Of Subscriber"
disabled={prohibit} disabled={prohibit || dateTime}
maxLength={30} maxLength={30}
onBlur={onBlurName} onBlur={onBlurName}
/> />
...@@ -430,41 +485,12 @@ const Bookings = (props: any) => { ...@@ -430,41 +485,12 @@ const Bookings = (props: any) => {
<Input <Input
style={{ width: 200 }} style={{ width: 200 }}
placeholder="Contact Information" placeholder="Contact Information"
disabled={prohibit} disabled={prohibit || dateTime}
maxLength={11} maxLength={11}
/> />
</Form.Item> </Form.Item>
</div> </div>
</div> </div>
<div className={styles.line}></div>
<div className="box5 required">
<div className={styles.box5item1}>Booking Schedule : </div>
<div className={styles.box5item2}>
<Row gutter={8}>
<Col>
<Form.Item name="subscribeDate" rules={BookingsTip[5]}>
<DatePicker
placeholder="Select Date"
disabledDate={disabledDate}
onChange={confirmData}
disabled={prohibit}
/>
</Form.Item>
</Col>
<Col>
<Form.Item label="Reserve Time" name="Time" noStyle>
<OnTime
disabled={prohibit}
limit={curString.categoriesOpenTime} // 设施默认禁止时间段
inhibitTime={result} // 选择日期后的禁止时间
onChanges={onChanges}
/>
</Form.Item>
</Col>
</Row>
</div>
</div>
{curString.communityManagerFee != null && Data3 ? ( {curString.communityManagerFee != null && Data3 ? (
<> <>
...@@ -523,10 +549,10 @@ const Bookings = (props: any) => { ...@@ -523,10 +549,10 @@ const Bookings = (props: any) => {
function mapStateToProps(state: any) { function mapStateToProps(state: any) {
const { Data3, Result, DataSave, resultTime, Remaining } = state.FacilityBookings; const { Data3, Result, DataSave, resultTime, Remaining } = state.FacilityBookings;
const load = const load = state.loading.models.FacilityBookings
typeof state.loading.models.FacilityBookings == 'undefined' ? state.loading.models.FacilityBookings
? true : false;
: state.loading.models.FacilityBookings;
const { token } = state.login; const { token } = state.login;
return { return {
Data3, Data3,
......
...@@ -200,8 +200,12 @@ const Facility = (props: any) => { ...@@ -200,8 +200,12 @@ const Facility = (props: any) => {
values.categoriesOpenTime = `${moment(values.Time[0]).format('HH:mm')}-${moment( values.categoriesOpenTime = `${moment(values.Time[0]).format('HH:mm')}-${moment(
values.Time[1], values.Time[1],
).format('HH:mm')}`; // 预约时间段 二开需要 ).format('HH:mm')}`; // 预约时间段 二开需要
values.communityManagerFee = values.communityManagerFee ? values.communityManagerFee : '0.00'; // 价格押金没有为0 values.communityManagerFee = values.communityManagerFee
values.communityMargin = values.communityMargin ? values.communityMargin : '0.00'; // 价格押金没有为0 ? parseFloat(values.communityManagerFee).toFixed(2)
: '0.00'; // 价格押金没有为0
values.communityMargin = values.communityMargin
? parseFloat(values.communityMargin).toFixed(2)
: '0.00'; // 价格押金没有为0
values.periodType = Cycle; values.periodType = Cycle;
delete values.picList; delete values.picList;
......
...@@ -465,13 +465,11 @@ const FacilityBookings = (props: any) => { ...@@ -465,13 +465,11 @@ const FacilityBookings = (props: any) => {
}; };
function mapStateToProps(state: any) { function mapStateToProps(state: any) {
// console.log(state);
const { Data, Data2, DataSave, curString, Result } = state.FacilityBookings; const { Data, Data2, DataSave, curString, Result } = state.FacilityBookings;
const { token } = state.login; const { token } = state.login;
const loading = const loading = state.loading.models.FacilityBookings
typeof state.loading.models.FacilityBookings == 'undefined' ? state.loading.models.FacilityBookings
? true : false;
: state.loading.models.FacilityBookings;
const { CommunityList } = state.Init; // 小区列表 const { CommunityList } = state.Init; // 小区列表
return { return {
......
...@@ -177,7 +177,7 @@ const FacilityTow = (props: any) => { ...@@ -177,7 +177,7 @@ const FacilityTow = (props: any) => {
// 提交 // 提交
const onFinish = (values: any) => { const onFinish = (values: any) => {
// console.log(FacilitysList); console.log(values);
// 先判断是否填写完整 // 先判断是否填写完整
for (let j in FacilitysList) { for (let j in FacilitysList) {
if (FacilitysList[j].fileList.length == 0) { if (FacilitysList[j].fileList.length == 0) {
...@@ -230,8 +230,12 @@ const FacilityTow = (props: any) => { ...@@ -230,8 +230,12 @@ const FacilityTow = (props: any) => {
values.categoriesOpenTime = `${moment(values.Time[0]).format('HH:mm')}-${moment( values.categoriesOpenTime = `${moment(values.Time[0]).format('HH:mm')}-${moment(
values.Time[1], values.Time[1],
).format('HH:mm')}`; // 预约时间段 二开需要 ).format('HH:mm')}`; // 预约时间段 二开需要
values.communityManagerFee = values.communityManagerFee ? values.communityManagerFee : '0.00'; // 价格押金没有为0 values.communityManagerFee = values.communityManagerFee
values.communityMargin = values.communityMargin ? values.communityMargin : '0.00'; // 价格押金没有为0 ? parseFloat(values.communityManagerFee).toFixed(2)
: '0.00'; // 价格押金没有为0
values.communityMargin = values.communityMargin
? parseFloat(values.communityMargin).toFixed(2)
: '0.00'; // 价格押金没有为0
values.communityName = DataSave.community; values.communityName = DataSave.community;
values.periodType = Cycle; values.periodType = Cycle;
values.id = Facilityid; values.id = Facilityid;
...@@ -240,6 +244,7 @@ const FacilityTow = (props: any) => { ...@@ -240,6 +244,7 @@ const FacilityTow = (props: any) => {
delete values.endTime; delete values.endTime;
delete values.picList; delete values.picList;
delete values.Time; delete values.Time;
RA(17, values); RA(17, values);
} }
}; };
......
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