Commit 57d20fdc authored by cellee's avatar cellee

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

parent f0aec099
...@@ -164,8 +164,12 @@ const Facility = (props: any) => { ...@@ -164,8 +164,12 @@ const Facility = (props: any) => {
let imgs: any = []; // 小设施图片 -- 用作提交 let imgs: any = []; // 小设施图片 -- 用作提交
let name = []; // 小设施名称 -- 用作判断重名 let name = []; // 小设施名称 -- 用作判断重名
for (let i in FacilitysList) { for (let i in FacilitysList) {
// 设施名称不能为空
if (FacilitysList[i].name == '') {
message.error('Facility name cannot be empty!');
return false;
}
name.push(FacilitysList[i].name); name.push(FacilitysList[i].name);
imgs[ imgs[
i i
] = `${FacilitysList[i].name}&${FacilitysList[i].fileList[0].name}&${FacilitysList[i].fileList[0].uid}`; ] = `${FacilitysList[i].name}&${FacilitysList[i].fileList[0].name}&${FacilitysList[i].fileList[0].uid}`;
......
...@@ -82,7 +82,7 @@ const FacilityTow = (props: any) => { ...@@ -82,7 +82,7 @@ const FacilityTow = (props: any) => {
return n1.id - n2.id; return n1.id - n2.id;
}); });
} else { } else {
history.push('/CommunityManagement/FacilityBookings'); history.go(-1);
} }
}, [DataSave]); }, [DataSave]);
...@@ -181,6 +181,12 @@ const FacilityTow = (props: any) => { ...@@ -181,6 +181,12 @@ const FacilityTow = (props: any) => {
let name = []; // 小设施名称 -- 用作判断重名 let name = []; // 小设施名称 -- 用作判断重名
for (let i in FacilitysList) { for (let i in FacilitysList) {
// 设施名称不能为空
if (FacilitysList[i].name == '') {
message.error('Facility name cannot be empty!');
return false;
}
name.push(FacilitysList[i].name); name.push(FacilitysList[i].name);
imgs[ imgs[
i i
...@@ -281,230 +287,244 @@ const FacilityTow = (props: any) => { ...@@ -281,230 +287,244 @@ const FacilityTow = (props: any) => {
); );
return ( return (
<div style={{ padding: 16 }}> <>
{/* 头部组件v1.2 */} {DataSave ? (
<TitleBack title={PATHNAME} url={getUrlLast(location.pathname) + '?Facility=true'} /> <div style={{ padding: 16 }}>
{/* 头部组件v1.2 */}
{/* 设施切换 */} <TitleBack title={PATHNAME} url={getUrlLast(location.pathname) + '?Facility=true'} />
<div className={'FacilityName'}> {/* 设施切换 */}
<label>Community :</label> {DataSave ? DataSave.community : ''}
</div> <div className={'FacilityName'}>
<label>Community :</label> {DataSave ? DataSave.community : ''}
<Tabs </div>
defaultActiveKey="0"
tabPosition="top" <Tabs
onTabClick={(key) => onTabClicks(key)} defaultActiveKey="0"
tabBarExtraContent={facilityDetail ? operations : ''} tabPosition="top"
> onTabClick={(key) => onTabClicks(key)}
{DataSave tabBarExtraContent={facilityDetail ? operations : ''}
? DataSave.facilities.map((i: any) => <TabPane tab={`${i.name}`} key={i.id}></TabPane>)
: ''}
</Tabs>
{/* 设施内容 */}
<Spin spinning={load}>
<div className={'base basediy'}>
<Form
ref={formRef}
form={form}
name="basic"
onFinish={onFinish}
validateMessages={validateMessages}
labelAlign="right"
> >
{/* 设施名称 以及费用 */} {DataSave
<Input.Group> ? DataSave.facilities.map((i: any) => (
<Form.Item label="Facility Classification" name="facilityName" rules={NewFaci[1]}> <TabPane tab={`${i.name}`} key={i.id}></TabPane>
<Input ))
placeholder="Facility Classification" : ''}
disabled={facilityDetail} </Tabs>
maxLength={30}
/> {/* 设施内容 */}
</Form.Item> <Spin spinning={load}>
<span className="divIconMoney">Fee($):</span> <div className={'base basediy'}>
<Form.Item label="" name="communityManagerFee"> <Form
<InputNumber ref={formRef}
prefix="$" form={form}
placeholder="00.00" name="basic"
disabled={facilityDetail} onFinish={onFinish}
min={0} validateMessages={validateMessages}
max={999} labelAlign="right"
step={0.01}
style={{ width: '120px' }}
/>
</Form.Item>
<span className="divIconMoney">Deposit:</span>
<Form.Item label="" name="communityMargin">
<InputNumber
prefix="$"
placeholder="00.00"
disabled={facilityDetail}
min={0}
max={999}
step={0.01}
style={{ width: '120px' }}
/>
</Form.Item>
</Input.Group>
<hr></hr>
{/* 设施品类上传 */}
<Form.Item
label="Facilities"
className="flex required"
style={{ marginBottom: 0, minHeight: 134 }}
>
<Facilitys
disabled={facilityDetail}
updata={{
// userToken: token,
imageType: 'categoriesImageName',
extends: ctyName,
}}
></Facilitys>
</Form.Item>
{/* 设施详情上传 */}
<Form.Item
name="categoriesDetailsImageName"
label="Facility Pictures"
rules={NewFaci[4]}
>
<PictureOptionsRow
over={facilityDetail}
data={{
// userToken: token,
imageType: 'categoriesDetailsImageName',
extends: ctyName,
}}
limitNums={99}
imgs={fileList}
/>
</Form.Item>
{/* 时间 */}
<Form.Item label="Opening Hours" className="required">
<Form.Item name="Time" noStyle>
<RangePicker
minuteStep={60}
format="HH:mm"
onChange={(time: any, timeString: any) => {
onChanges(time, timeString);
}}
allowClear={false}
disabled={facilityDetail}
/>
</Form.Item>
</Form.Item>
<hr></hr>
{/* ------------- */}
<p className="diyp">Booking Rules : </p>
{/* 预约设置 */}
<Input.Group>
<Form.Item name="cancelReservationDay" label="Early Cancellation" rules={NewFaci[5]}>
<Input
onKeyUp={keyup.bind(this, 'cancelReservationDay')}
disabled={facilityDetail}
// prefix="Advance"
suffix="Day(s) In Advance"
style={{ width: 160, textAlign: 'center' }}
placeholder="0"
maxLength={2}
/>
</Form.Item>
<Form.Item
label="No Deposit To Cancel Reservation"
name="nomarginCancelReservationDay"
rules={NewFaci[6]}
> >
<Input {/* 设施名称 以及费用 */}
onKeyUp={keyup.bind(this, 'nomarginCancelReservationDay')} <Input.Group>
disabled={facilityDetail} <Form.Item label="Facility Classification" name="facilityName" rules={NewFaci[1]}>
// prefix="Advance" <Input
suffix="Day(s) In Advance" placeholder="Facility Classification"
style={{ width: 160, textAlign: 'center' }} disabled={facilityDetail}
placeholder="0" maxLength={30}
maxLength={2} />
/> </Form.Item>
</Form.Item> <span className="divIconMoney">Fee($):</span>
<Form.Item label="Booking" name="canReservationDay" rules={NewFaci[7]}> <Form.Item label="" name="communityManagerFee">
<Input <InputNumber
onKeyUp={keyup.bind(this, 'canReservationDay')} prefix="$"
placeholder="0" placeholder="00.00"
style={{ width: 160, textAlign: 'center' }} disabled={facilityDetail}
disabled={facilityDetail} min={0}
// prefix="Advance" max={999}
suffix="Day(s) In Advance" step={0.01}
maxLength={2} style={{ width: '120px' }}
/> />
</Form.Item> </Form.Item>
</Input.Group> <span className="divIconMoney">Deposit:</span>
<Form.Item label="" name="communityMargin">
{/* 设置次数 */} <InputNumber
<Input.Group> prefix="$"
<Form.Item label="Booking Quotas" rules={NewFaci[8]}> placeholder="00.00"
<Select disabled={facilityDetail}
placeholder="Cycle" min={0}
allowClear max={999}
style={{ width: 120 }} step={0.01}
disabled={facilityDetail} style={{ width: '120px' }}
value={Cycle} />
onChange={handleChange} </Form.Item>
</Input.Group>
<hr></hr>
{/* 设施品类上传 */}
<Form.Item
label="Facilities"
className="flex required"
style={{ marginBottom: 0, minHeight: 134 }}
> >
<Option value="1">Week</Option> <Facilitys
<Option value="2">Month</Option> disabled={facilityDetail}
<Option value="3">Year</Option> updata={{
</Select> // userToken: token,
</Form.Item> imageType: 'categoriesImageName',
<Form.Item name="canReservationNum" rules={NewFaci[9]}> extends: ctyName,
<Input }}
onKeyUp={keyup.bind(this, 'canReservationNum')} ></Facilitys>
placeholder="Second" </Form.Item>
style={{ width: 120 }}
disabled={facilityDetail} {/* 设施详情上传 */}
defaultValue={0} <Form.Item
suffix="Time(s)" name="categoriesDetailsImageName"
/> label="Facility Pictures"
</Form.Item> rules={NewFaci[4]}
</Input.Group> >
<PictureOptionsRow
<hr></hr> over={facilityDetail}
data={{
<> // userToken: token,
<Button type="primary" htmlType="submit" loading={load} disabled={facilityDetail}> imageType: 'categoriesDetailsImageName',
Submit extends: ctyName,
</Button> }}
</> limitNums={99}
</Form> imgs={fileList}
/>
</Form.Item>
{/* 时间 */}
<Form.Item label="Opening Hours" className="required">
<Form.Item name="Time" noStyle>
<RangePicker
minuteStep={60}
format="HH:mm"
onChange={(time: any, timeString: any) => {
onChanges(time, timeString);
}}
allowClear={false}
disabled={facilityDetail}
/>
</Form.Item>
</Form.Item>
<hr></hr>
{/* ------------- */}
<p className="diyp">Booking Rules : </p>
{/* 预约设置 */}
<Input.Group>
<Form.Item
name="cancelReservationDay"
label="Early Cancellation"
rules={NewFaci[5]}
>
<Input
onKeyUp={keyup.bind(this, 'cancelReservationDay')}
disabled={facilityDetail}
// prefix="Advance"
suffix="Day(s) In Advance"
style={{ width: 160, textAlign: 'center' }}
placeholder="0"
maxLength={2}
/>
</Form.Item>
<Form.Item
label="No Deposit To Cancel Reservation"
name="nomarginCancelReservationDay"
rules={NewFaci[6]}
>
<Input
onKeyUp={keyup.bind(this, 'nomarginCancelReservationDay')}
disabled={facilityDetail}
// prefix="Advance"
suffix="Day(s) In Advance"
style={{ width: 160, textAlign: 'center' }}
placeholder="0"
maxLength={2}
/>
</Form.Item>
<Form.Item label="Booking" name="canReservationDay" rules={NewFaci[7]}>
<Input
onKeyUp={keyup.bind(this, 'canReservationDay')}
placeholder="0"
style={{ width: 160, textAlign: 'center' }}
disabled={facilityDetail}
// prefix="Advance"
suffix="Day(s) In Advance"
maxLength={2}
/>
</Form.Item>
</Input.Group>
{/* 设置次数 */}
<Input.Group>
<Form.Item label="Booking Quotas" rules={NewFaci[8]}>
<Select
placeholder="Cycle"
allowClear
style={{ width: 120 }}
disabled={facilityDetail}
value={Cycle}
onChange={handleChange}
>
<Option value="1">Week</Option>
<Option value="2">Month</Option>
<Option value="3">Year</Option>
</Select>
</Form.Item>
<Form.Item name="canReservationNum" rules={NewFaci[9]}>
<Input
onKeyUp={keyup.bind(this, 'canReservationNum')}
placeholder="Second"
style={{ width: 120 }}
disabled={facilityDetail}
defaultValue={0}
suffix="Time(s)"
/>
</Form.Item>
</Input.Group>
<hr></hr>
<>
<Button type="primary" htmlType="submit" loading={load} disabled={facilityDetail}>
Submit
</Button>
</>
</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> </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