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) => {
let imgs: any = []; // 小设施图片 -- 用作提交
let name = []; // 小设施名称 -- 用作判断重名
for (let i in FacilitysList) {
// 设施名称不能为空
if (FacilitysList[i].name == '') {
message.error('Facility name cannot be empty!');
return false;
}
name.push(FacilitysList[i].name);
imgs[
i
] = `${FacilitysList[i].name}&${FacilitysList[i].fileList[0].name}&${FacilitysList[i].fileList[0].uid}`;
......
......@@ -82,7 +82,7 @@ const FacilityTow = (props: any) => {
return n1.id - n2.id;
});
} else {
history.push('/CommunityManagement/FacilityBookings');
history.go(-1);
}
}, [DataSave]);
......@@ -181,6 +181,12 @@ const FacilityTow = (props: any) => {
let name = []; // 小设施名称 -- 用作判断重名
for (let i in FacilitysList) {
// 设施名称不能为空
if (FacilitysList[i].name == '') {
message.error('Facility name cannot be empty!');
return false;
}
name.push(FacilitysList[i].name);
imgs[
i
......@@ -281,230 +287,244 @@ const FacilityTow = (props: any) => {
);
return (
<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>
<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>)
: ''}
</Tabs>
{/* 设施内容 */}
<Spin spinning={load}>
<div className={'base basediy'}>
<Form
ref={formRef}
form={form}
name="basic"
onFinish={onFinish}
validateMessages={validateMessages}
labelAlign="right"
<>
{DataSave ? (
<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>
<Tabs
defaultActiveKey="0"
tabPosition="top"
onTabClick={(key) => onTabClicks(key)}
tabBarExtraContent={facilityDetail ? operations : ''}
>
{/* 设施名称 以及费用 */}
<Input.Group>
<Form.Item label="Facility Classification" name="facilityName" rules={NewFaci[1]}>
<Input
placeholder="Facility Classification"
disabled={facilityDetail}
maxLength={30}
/>
</Form.Item>
<span className="divIconMoney">Fee($):</span>
<Form.Item label="" name="communityManagerFee">
<InputNumber
prefix="$"
placeholder="00.00"
disabled={facilityDetail}
min={0}
max={999}
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]}
{DataSave
? 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"
>
<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}
{/* 设施名称 以及费用 */}
<Input.Group>
<Form.Item label="Facility Classification" name="facilityName" rules={NewFaci[1]}>
<Input
placeholder="Facility Classification"
disabled={facilityDetail}
maxLength={30}
/>
</Form.Item>
<span className="divIconMoney">Fee($):</span>
<Form.Item label="" name="communityManagerFee">
<InputNumber
prefix="$"
placeholder="00.00"
disabled={facilityDetail}
min={0}
max={999}
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 }}
>
<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>
<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')}
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>
</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