Commit 13c6e474 authored by cellee's avatar cellee

设施限制

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 489fc3c6
...@@ -72,19 +72,6 @@ const Facilitys = (props: any) => { ...@@ -72,19 +72,6 @@ const Facilitys = (props: any) => {
// 存储到mode里面去 // 存储到mode里面去
dispatch({ type: module + '/genxin', list }); dispatch({ type: module + '/genxin', list });
// 当前页面也要刷新
// let list = fileList;
// setFileList(list); // 注意 不能直接赋值 因为使用完全绑定需要全部更新
// setFileList(list);
// let list: any = [...fileList, ...info.fileList];
// setFileList(list);
// 将图片信息提交给state
// let data = { val: info.file.name, key: keys };
// dispatch({ type: module + '/retImgsList', data });
// 结束
} else if (info.file.status === 'error') { } else if (info.file.status === 'error') {
message.error(`${info.file.name} file upload failed.`); message.error(`${info.file.name} file upload failed.`);
} }
...@@ -130,6 +117,17 @@ const Facilitys = (props: any) => { ...@@ -130,6 +117,17 @@ const Facilitys = (props: any) => {
dispatch({ type: module + '/genxin', list }); dispatch({ type: module + '/genxin', list });
}; };
// 删除图片
const deleteImgs = (key: any, id: any) => {
let list = FacilitysList;
list[key].name = '';
list[key].fileList = [];
// 存储到mode里面去
dispatch({ type: module + '/genxin', list });
};
// 新增按钮 // 新增按钮
const uploadButton = ( const uploadButton = (
<div> <div>
...@@ -162,7 +160,7 @@ const Facilitys = (props: any) => { ...@@ -162,7 +160,7 @@ const Facilitys = (props: any) => {
disabled={disabled} // 禁止 disabled={disabled} // 禁止
onPreview={handlePreview} // 预览 onPreview={handlePreview} // 预览
onRemove={() => { onRemove={() => {
deleteImg(index, item.id); deleteImgs(index, item.id);
}} //移除 }} //移除
> >
{FacilitysList[index].fileList.length > 0 ? null : uploadButton} {FacilitysList[index].fileList.length > 0 ? null : uploadButton}
...@@ -180,7 +178,7 @@ const Facilitys = (props: any) => { ...@@ -180,7 +178,7 @@ const Facilitys = (props: any) => {
id={index} id={index}
onChange={(e: any) => monitor(e, index)} onChange={(e: any) => monitor(e, index)}
value={FacilitysList[index].name} value={FacilitysList[index].name}
disabled={FacilitysList[index].disabled} disabled={FacilitysList[index].disabled || disabled}
/> />
</Form.Item> </Form.Item>
<div className={'over'}> <div className={'over'}>
......
...@@ -37,7 +37,6 @@ const SearchOptionsTow = (porps: any) => { ...@@ -37,7 +37,6 @@ 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"
......
...@@ -10,9 +10,8 @@ import { connect } from 'umi'; ...@@ -10,9 +10,8 @@ import { connect } from 'umi';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
import TextArea from 'antd/lib/input/TextArea'; import TextArea from 'antd/lib/input/TextArea';
import { getUrlLast } from '../../../utils/string';
const BookingDetail = (props: any) => { const BookingDetail = (props: any) => {
const { dispatch, location, DataSave, history, DataSaveDetail, token, load } = props; const { dispatch, DataSave, history, DataSaveDetail, token, load } = props;
const RA = (index: any, values: any) => { const RA = (index: any, values: any) => {
dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }); dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } });
...@@ -22,8 +21,6 @@ const BookingDetail = (props: any) => { ...@@ -22,8 +21,6 @@ const BookingDetail = (props: any) => {
if (DataSave != null) { if (DataSave != null) {
// 已预约时间段 // 已预约时间段
let arr = DataSave.subscribeTime.split(','); let arr = DataSave.subscribeTime.split(',');
console.log(arr[0]);
console.log(arr[arr.length - 1]);
setExtractTime(`${arr[0]} To ${arr[arr.length - 1]}`); setExtractTime(`${arr[0]} To ${arr[arr.length - 1]}`);
if (DataSave.managerFeeStatus != 0) { if (DataSave.managerFeeStatus != 0) {
RA(2, { accountCategoriesId: DataSave.id }); RA(2, { accountCategoriesId: DataSave.id });
...@@ -165,11 +162,12 @@ const BookingDetail = (props: any) => { ...@@ -165,11 +162,12 @@ const BookingDetail = (props: any) => {
<hr /> <hr />
{/* 已交押金且未产生退费且不是免费的 */} {/* 已交押金且未产生退费且不是免费的 */}
{DataSave && {(DataSave &&
DataSaveDetail && DataSaveDetail &&
DataSave.managerFeeStatus == 1 && DataSave.managerFeeStatus == 1 &&
DataSaveDetail.backMarginFee == 0 && DataSaveDetail.backMarginFee == 0 &&
DataSaveDetail.managerFee > 0 ? ( DataSaveDetail.managerFee > 0) ||
(DataSave.managerFee == 0 && DataSave.marginFee > 0 && DataSave.status != 3) ? (
<> <>
<Form <Form
ref={formRef} ref={formRef}
...@@ -190,28 +188,33 @@ const BookingDetail = (props: any) => { ...@@ -190,28 +188,33 @@ const BookingDetail = (props: any) => {
<Radio value={1} style={radioStyle}> <Radio value={1} style={radioStyle}>
Full Refund Full Refund
</Radio> </Radio>
<Radio value={2} style={radioStyle}>
Partial Refund {DataSave.status == '2' || DataSave.status == '4' ? (
{backFeeFlag ? ( ''
<> ) : (
<InputNumber <Radio value={2} style={radioStyle}>
placeholder="00.00" Partial Refund
min={0} {backFeeFlag ? (
max={ <>
( <InputNumber
parseInt(DataSaveDetail.marginFee) + placeholder="00.00"
parseInt(DataSaveDetail.managerFee) min={0}
).toFixed(2) as any max={
} (
maxLength={6} parseInt(DataSaveDetail.marginFee) +
step={0.01} parseInt(DataSaveDetail.managerFee)
prefix="$" ).toFixed(2) as any
onChange={getBackMarginFee} }
style={{ width: 80, marginLeft: 10 }} maxLength={6}
/> step={0.01}
</> prefix="$"
) : null} onChange={getBackMarginFee}
</Radio> style={{ width: 80, marginLeft: 10 }}
/>
</>
) : null}
</Radio>
)}
</Radio.Group> </Radio.Group>
{backFeeFlag ? ( {backFeeFlag ? (
......
...@@ -21,8 +21,6 @@ import { validateMessages } from '@/utils/params'; ...@@ -21,8 +21,6 @@ import { validateMessages } from '@/utils/params';
const module = 'FacilityBookings'; const module = 'FacilityBookings';
import moment from 'moment'; import moment from 'moment';
import OnTime from '@/components/OnTime/OnTime';
const Facility = (props: any) => { const Facility = (props: any) => {
const { dispatch, location, token, sourceData, DataSave, Result, load, FacilitysList } = props; const { dispatch, location, token, sourceData, DataSave, Result, load, FacilitysList } = props;
...@@ -479,10 +477,7 @@ const Facility = (props: any) => { ...@@ -479,10 +477,7 @@ const Facility = (props: any) => {
</Input.Group> </Input.Group>
<hr></hr> <hr></hr>
{/* <Row gutter={32} style={{ marginTop: 28 }}>
<Col>Appointment Period</Col>
<Col><TimeSelect putSubmit={TimeSelectRef} defaultValue={timeExtend} disabled={facilityDetail}/></Col>
</Row> */}
{facilityDetail ? ( {facilityDetail ? (
<> <>
{imgOpen ? ( {imgOpen ? (
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Input, Tabs, Pagination, Space, Button, message } from 'antd'; import { Tabs, Pagination, Space, Button, message } from 'antd';
const { TabPane } = Tabs; const { TabPane } = Tabs;
import { Link, useIntl, connect, Dispatch, history } from 'umi'; import { useIntl, connect, history } from 'umi';
import { objectColumns } from '../../../utils/string'; import { objectColumns } from '../../../utils/string';
import { timestampToTime } from '../../../utils/time';
import TitleSearch from '../../../components/TitleSearch/TitleSearch'; import TitleSearch from '../../../components/TitleSearch/TitleSearch';
// const managerFeeStatusDes= ["未交", "已交", "已退"] // const managerFeeStatusDes= ["未交", "已交", "已退"]
...@@ -27,8 +26,6 @@ import { PlusOutlined } from '@ant-design/icons'; ...@@ -27,8 +26,6 @@ import { PlusOutlined } from '@ant-design/icons';
import moment from 'moment'; import moment from 'moment';
const FacilityBookings = (props: any) => { const FacilityBookings = (props: any) => {
const { formatMessage } = useIntl();
const { const {
dispatch, dispatch,
location, location,
...@@ -316,7 +313,7 @@ const FacilityBookings = (props: any) => { ...@@ -316,7 +313,7 @@ const FacilityBookings = (props: any) => {
<TitleSearch <TitleSearch
status={[ status={[
{ {
name: ['status', 'Order status'], name: ['status', 'Booking status'],
data: [ data: [
[0, 'All'], [0, 'All'],
[1, 'Applied'], [1, 'Applied'],
......
...@@ -70,54 +70,60 @@ const FacilityTow = (props: any) => { ...@@ -70,54 +70,60 @@ const FacilityTow = (props: any) => {
// 点击设施获取到的设施列表 // 点击设施获取到的设施列表
useEffect(() => { useEffect(() => {
if (DataSaveDetail) { if (DataSaveDetail !== null) {
let { categories, facilities } = DataSaveDetail; let { categories, facilities } = DataSaveDetail;
console.log(categories);
// 设施A、设施B小图 // 设施A、设施B小图
let list: any = categories.map((item: any, index: any) => { let list: any = categories
let sam = { ? categories.map((item: any, index: any) => {
id: index, let sam = {
name: item.categoriesName, id: index,
fileList: [ name: item.categoriesName,
{ fileList: [
uid: item.id, {
name: item.categoriesImageName, uid: item.id,
status: 'done', name: item.categoriesImageName,
url: item.categoriesImageUrl, status: 'done',
}, url: item.categoriesImageUrl,
], },
}; ],
// 设施图片列表默认值 };
form.setFieldsValue({ // 设施图片列表默认值
['shebei_' + index]: item.categoriesName, form.setFieldsValue({
}); ['shebei_' + index]: item.categoriesName,
return sam; });
}); return sam;
})
: [];
dispatch({ type: module + '/genxin', list }); dispatch({ type: module + '/genxin', list });
// 设施总图片 // 设施总图片
let fileListImg: any = []; let fileListImg: any = [];
facilities.facilitiesImageList.map((item: any, index: any) => {
let sam = {
uid: index,
name: item.facilitiesImageName,
status: 'done',
url: item.facilitiesImageUrl,
};
fileListImg.push(sam);
});
setFileList([...fileListImg]); if (facilities) {
facilities.facilitiesImageList.map((item: any, index: any) => {
let sam = {
uid: index,
name: item.facilitiesImageName,
status: 'done',
url: item.facilitiesImageUrl,
};
fileListImg.push(sam);
});
// 设置表单默认值 // 设置表单默认值
formRef.current.setFieldsValue(facilities); formRef.current.setFieldsValue(facilities);
// 周期 // 周期
setCycle(facilities.periodType + ''); setCycle(facilities.periodType + '');
// 时间 // 时间
let time = facilities.reservationQuantumTime.split(','); let time = facilities.reservationQuantumTime.split(',');
formRef.current.setFieldsValue({ formRef.current.setFieldsValue({
Time: [moment(time[0], 'HH:mm'), moment(time[1], 'HH:mm')], Time: [moment(time[0], 'HH:mm'), moment(time[1], 'HH:mm')],
}); });
}
setFileList([...fileListImg]);
} }
}, [DataSaveDetail]); }, [DataSaveDetail]);
......
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