Commit 5d88c0e2 authored by cellee's avatar cellee

预约时间在用户已预约做限制,修复预约提示时间报错,文案更改,优化其他页面加载

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 70457ec7
...@@ -6,10 +6,43 @@ import moment from 'moment'; ...@@ -6,10 +6,43 @@ import moment from 'moment';
const OnTime = (porps: any) => { const OnTime = (porps: any) => {
// placeholder 默认显示 disabled 是否禁止 // placeholder 默认显示 disabled 是否禁止
// openSelect 选中函数 limit 限制时间 type 类型 时开始还是结束 1 就是结束 结尾是59 // openSelect 选中函数 limit 限制时间 type 类型 时开始还是结束 1 就是结束 结尾是59
// defaultValue 默认时间 // defaultValue 默认时间 inhibitTime 禁止选择时间
let { placeholder, disabled, openSelect, limit, type, defaultValue } = porps; let { placeholder, disabled, openSelect, limit, type, defaultValue, inhibitTime } = porps;
const [imgOpen, setImgOpen] = useState(null as any); const [imgOpen, setImgOpen] = useState(null as any);
// 已经预约时间禁止
const [Scheduled, setScheduled] = useState(null as any);
// 禁止选择时间
useEffect(() => {
if (inhibitTime != null) {
let arrs = '' as any;
inhibitTime.forEach((element: any) => {
let strArr = cutOut(element);
arrs = arrs + strArr;
});
let confirm = [...new Set(arrs.substr(0, arrs.length - 1).split(','))];
console.log(confirm);
let newConfirm = [] as any;
confirm.forEach((element: any) => {
return newConfirm.push(parseInt(element));
});
console.log(newConfirm);
setScheduled(newConfirm);
}
}, [inhibitTime]);
// 时间截取
function cutOut(str: any) {
var one = str.indexOf(':');
let str1 = parseInt(str.substring(0, one));
let str2 = parseInt(str.match(/-(\S*):/)[1]);
let arr = '';
for (let i = str1; i <= str2; i++) {
arr = `${arr}${i},`;
}
return arr;
}
useEffect(() => { useEffect(() => {
if (defaultValue != null) { if (defaultValue != null) {
...@@ -52,6 +85,10 @@ const OnTime = (porps: any) => { ...@@ -52,6 +85,10 @@ const OnTime = (porps: any) => {
parseInt(item) >= parseInt(openTime.slice(0, 2)) && parseInt(item) >= parseInt(openTime.slice(0, 2)) &&
parseInt(item) <= parseInt(openTime.slice(6, 8)) parseInt(item) <= parseInt(openTime.slice(6, 8))
) { ) {
if (Scheduled && Scheduled.indexOf(parseInt(item)) != -1) {
// 如果存在有预约的时间 且在数组里面,就禁止选择
return true;
}
return false; return false;
} else { } else {
return true; return true;
......
...@@ -122,7 +122,7 @@ export default { ...@@ -122,7 +122,7 @@ export default {
yield put({ type: 'returnResult', Result }); yield put({ type: 'returnResult', Result });
break; break;
case 11: case 11:
Result ={index:playload.index,msg:"Information Wrong!"}; Result ={index:playload.index,msg:resp.error_msg};
yield put({ type: 'returnResult', Result }); yield put({ type: 'returnResult', Result });
break; break;
} }
......
...@@ -16,13 +16,12 @@ import { ...@@ -16,13 +16,12 @@ import {
} from 'antd'; } from 'antd';
// 样式 // 样式
import './celllist.less'; import './celllist.less';
import { RA, ResultClear } from '@/utils/method'; import { RA } from '@/utils/method';
import { history } from 'umi'; import { history } from 'umi';
import { village } from '@/utils/tip'; import { village } from '@/utils/tip';
import moment from 'moment'; import moment from 'moment';
import { getNumber } from '@/utils/string'; // 正则 import { getNumber } from '@/utils/string'; // 正则
import imgs from '@/assets/logo_icon_bg.png';
import FileViewer from 'react-file-viewer'; import FileViewer from 'react-file-viewer';
import PDF from 'react-pdf-js'; import PDF from 'react-pdf-js';
...@@ -35,16 +34,10 @@ interface objc {} ...@@ -35,16 +34,10 @@ interface objc {}
const Adds = (props: any) => { const Adds = (props: any) => {
const module = 'CellList'; const module = 'CellList';
const { Data, dispatch, loading, Result, imgUrl } = props; const { Data, dispatch, loading, imgUrl } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
//物业费选择
const plainOptions = [
{ label: 'Online Payment', value: '0', disabled: true },
{ label: 'Offline Payment', value: '1' },
];
const [PropertyFee, setPropertyFee] = useState(['1']); // 表单物业费提交值 const [PropertyFee, setPropertyFee] = useState(['1']); // 表单物业费提交值
const [loubaUpload, setLouba] = useState([] as any); // 楼巴上传列表 const [loubaUpload, setLouba] = useState([] as any); // 楼巴上传列表
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { import { LeftOutlined, EyeOutlined, PoweroffOutlined } from '@ant-design/icons';
LeftOutlined, import { Modal, Input, Button, Spin, Checkbox, Image, message, Divider } from 'antd';
EyeOutlined,
PoweroffOutlined,
SnippetsOutlined,
ApiTwoTone,
} from '@ant-design/icons';
import { Modal, Input, Button, Spin, Checkbox, Image, message, Divider, Avatar } from 'antd';
import { history } from 'umi'; import { history } from 'umi';
// 样式 // 样式
import './celllist.less'; import './celllist.less';
import { RA } from '@/utils/method'; import { RA } from '@/utils/method';
import img from '@/assets/logo_icon_color.png';
import imgs from '@/assets/logo_icon_bg.png'; import imgs from '@/assets/logo_icon_bg.png';
import hfor from '@/assets/h5.png'; import hfor from '@/assets/h5.png';
import PreView from '@/components/PreView'; import PreView from '@/components/PreView';
import moment from 'moment';
import Axios from 'axios'; import Axios from 'axios';
import fileDownload from 'js-file-download'; import fileDownload from 'js-file-download';
...@@ -28,7 +19,7 @@ import fileDownload from 'js-file-download'; ...@@ -28,7 +19,7 @@ import fileDownload from 'js-file-download';
const Detail = (props: any) => { const Detail = (props: any) => {
const module = 'CellList'; const module = 'CellList';
const { detailData, DataSave, dispatch, loading, imgUrl, overCom } = props; const { detailData, DataSave, dispatch, loading, overCom } = props;
useEffect(() => { useEffect(() => {
if (DataSave) { if (DataSave) {
...@@ -39,14 +30,6 @@ const Detail = (props: any) => { ...@@ -39,14 +30,6 @@ const Detail = (props: any) => {
} }
}, [1]); }, [1]);
// 下载
// useEffect(() => {
// if (imgUrl != null) {
// // console.log('变化了'); 开始下载
// openDows(imgUrl.url, imgUrl.name);
// }
// }, [imgUrl]);
useEffect(() => { useEffect(() => {
if (overCom != null) { if (overCom != null) {
message.success(`Community Deleted Successfully`); message.success(`Community Deleted Successfully`);
......
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Input, Tabs, message, Form, Button, DatePicker, Spin } from 'antd'; import { Input, Form, Button, DatePicker, Spin } from 'antd';
const { TabPane } = Tabs;
import { connect, history } from 'umi'; import { connect, history } from 'umi';
import { RA, SA } from '@/utils/method'; import { RA } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack'; import TitleBack from '@/components/TitleBack/TitleBack';
// import FileUpload from '@/components/FileUpload/FileUpload'; // import FileUpload from '@/components/FileUpload/FileUpload';
import { validateMessages } from '@/utils/params'; import { validateMessages } from '@/utils/params';
import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow'; import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow';
import TextArea from 'antd/lib/input/TextArea'; import TextArea from 'antd/lib/input/TextArea';
import SelectCommunity from '@/components/SelectCommunity';
// import Line from '@/components/Line/Line';
// import TimeComfirm from '@/components/TimeComfirm/TimeComfirm';
import imgs from '@/assets/logo_icon_bg.png';
import './ann.less'; import './ann.less';
import { Notice } from '@/utils/tip'; import { Notice } from '@/utils/tip';
import { getCookie } from '@/utils/method';
import moment from 'moment'; import moment from 'moment';
import ShowOptions from '@/components/ShowOptions/index'; import ShowOptions from '@/components/ShowOptions/index';
...@@ -24,14 +17,11 @@ import ShowOptions from '@/components/ShowOptions/index'; ...@@ -24,14 +17,11 @@ import ShowOptions from '@/components/ShowOptions/index';
const module = 'CommunityAnnouncement'; const module = 'CommunityAnnouncement';
const Add = (props: any) => { const Add = (props: any) => {
const { dispatch, Result, loading, DataSave, ImgSrc } = props; const { dispatch, loading, DataSave, ImgSrc } = props;
const formRef = useRef(null); const formRef = useRef(null);
const [form] = Form.useForm(); const [form] = Form.useForm();
const [ImageSrc, setImageSrc] = useState([] as any); // 图片显示地址 const [ImageSrc, setImageSrc] = useState([] as any); // 图片显示地址
const [ImageName, setImageName] = useState([] as any); // 全部图片名称
const [timeT, settimeT] = useState(true); // 结束时间是否禁止选择
const [timeOver, settimeOver] = useState(1); // 结束时间禁止天数
// 监听传递过来的值 // 监听传递过来的值
useEffect(() => { useEffect(() => {
...@@ -54,11 +44,6 @@ const Add = (props: any) => { ...@@ -54,11 +44,6 @@ const Add = (props: any) => {
fileName: DataSave.noticImageName, fileName: DataSave.noticImageName,
}; };
RA(47, msg, module, dispatch); RA(47, msg, module, dispatch);
// 解除结束时间不可选
settimeT(false);
// 图片名
setImageName(DataSave.noticImageName);
} }
}, [DataSave]); }, [DataSave]);
......
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import styles from './css/index.less'; import styles from './css/index.less';
import './css/index.less'; import './css/index.less';
import { import { InputNumber, Descriptions, Spin, Form, Radio, Modal, Button, message } from 'antd';
InputNumber,
Descriptions,
Spin,
Space,
Form,
Radio,
Modal,
Row,
Col,
Button,
message,
} from 'antd';
import moment from 'moment'; import moment from 'moment';
import { Link, useIntl, connect, Dispatch } from 'umi'; import { connect } from 'umi';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
import Line from '../../../components/Line/Line';
import { timestampToTime3 } from '../../../utils/time';
import TextArea from 'antd/lib/input/TextArea'; import TextArea from 'antd/lib/input/TextArea';
import { getUrlLast } from '../../../utils/string'; import { getUrlLast } from '../../../utils/string';
import { merge } from 'lodash';
const BookingDetail = (props: any) => { const BookingDetail = (props: any) => {
const { dispatch, location, DataSave, DataSaveDetail, token, load } = props; const { dispatch, location, DataSave, history, DataSaveDetail, token, load } = props;
console.log(DataSave);
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 } });
}; };
useEffect(() => { useEffect(() => {
if (DataSave != null && DataSave.managerFeeStatus != 0) { if (DataSave != null) {
// 已预约时间段
let arr = DataSave.subscribeTime.split(',');
let time1 = parseInt(moment(arr[0], 'HH:mm').format('hh'));
let time2 = parseInt(moment(arr[arr.length - 1], 'HH:mm').format('hh'));
let Time = '';
for (let i = time1; i <= time2; i++) {
Time = `${Time}${i}:00,`;
}
setExtractTime(Time);
if (DataSave.managerFeeStatus != 0) {
RA(2, { accountCategoriesId: DataSave.id }); RA(2, { accountCategoriesId: DataSave.id });
} }
} else {
history.push('/CommunityManagement/FacilityBookings');
}
}, [DataSave]); }, [DataSave]);
// const statusDes = ["全部", "已申请", "已预订", "已使用", "已取消", "已完成"] // const statusDes = ["全部", "已申请", "已预订", "已使用", "已取消", "已完成"]
...@@ -48,6 +45,7 @@ const BookingDetail = (props: any) => { ...@@ -48,6 +45,7 @@ const BookingDetail = (props: any) => {
const [modalItem, setModalIteme] = useState({ title: '', tab: 1 }); const [modalItem, setModalIteme] = useState({ title: '', tab: 1 });
const [backFeeFlag, setBackFeeFlag] = useState(false); // 部分退费 与 全部退费 const [backFeeFlag, setBackFeeFlag] = useState(false); // 部分退费 与 全部退费
const [curbackFee, setCurBackFee] = useState(0); const [curbackFee, setCurBackFee] = useState(0);
const [ExtractTime, setExtractTime] = useState(null as any); // 已预约时间段
// 设置默认全款退费 // 设置默认全款退费
useEffect(() => { useEffect(() => {
...@@ -85,7 +83,6 @@ const BookingDetail = (props: any) => { ...@@ -85,7 +83,6 @@ const BookingDetail = (props: any) => {
marginFee: DataSaveDetail.marginFee.toString(), marginFee: DataSaveDetail.marginFee.toString(),
}; };
console.log(RAVAL);
RA(3, RAVAL); RA(3, RAVAL);
} }
}; };
...@@ -159,7 +156,7 @@ const BookingDetail = (props: any) => { ...@@ -159,7 +156,7 @@ const BookingDetail = (props: any) => {
{DataSave.facilityTitle} {DataSave.facilityTitle}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="Booking Time"> <Descriptions.Item label="Booking Time">
{DataSave.subscribeDate} {DataSave.subscribeTime} {DataSave.subscribeDate} {ExtractTime}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="User Name">{DataSave.accountName}</Descriptions.Item> <Descriptions.Item label="User Name">{DataSave.accountName}</Descriptions.Item>
<Descriptions.Item label="Contact Number">{DataSave.accountPhone}</Descriptions.Item> <Descriptions.Item label="Contact Number">{DataSave.accountPhone}</Descriptions.Item>
......
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import styles from './css/Bookings.less'; import styles from './css/Bookings.less';
import './css/Bookings.less'; import './css/Bookings.less';
import { import { Spin, Input, DatePicker, Button, Form, Radio, Row, Col, message } from 'antd';
Spin,
Input,
DatePicker,
Button,
Form,
Radio,
TimePicker,
Row,
Col,
message,
Select,
} from 'antd';
const { RangePicker } = TimePicker;
import { DollarOutlined, ClockCircleOutlined } from '@ant-design/icons'; import { DollarOutlined, ClockCircleOutlined } from '@ant-design/icons';
...@@ -24,7 +11,6 @@ import TitleBack from '../../../components/TitleBack/TitleBack'; ...@@ -24,7 +11,6 @@ import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { numberToString } from '../../../utils/string'; import { numberToString } from '../../../utils/string';
import { checkData, checkInput } from '@/utils/method';
import { validateMessages } from '@/utils/params'; import { validateMessages } from '@/utils/params';
// 日期 // 日期
...@@ -62,15 +48,13 @@ const Bookings = (props: any) => { ...@@ -62,15 +48,13 @@ const Bookings = (props: any) => {
const formRef = useRef(null as any); const formRef = useRef(null as any);
const [prohibit, setProhibit] = useState(true); // 输入框是否不可选 const [prohibit, setProhibit] = useState(true); // 输入框是否不可选
const [result, setResultTime] = useState(resultTime); // 已预约时间段 const [result, setResultTime] = useState(null as any); // 已预约时间段
const [soltTime, setSoltTime] = useState(['', '']); // 已选时间 const [soltTime, setSoltTime] = useState(['', '']); // 已选时间
const [bookTime, setBookTime] = useState(1); // 默认延后预订时间 const [bookTime, setBookTime] = useState(1); // 默认延后预订时间
useEffect(() => { useEffect(() => {
if (DataSave != null) { if (DataSave != null) {
console.log('页面进入参数');
console.log(DataSave);
setComminityValues(DataSave.communityName); setComminityValues(DataSave.communityName);
RA(1, { userToken: token, communityName: DataSave.communityName, facilitieId: DataSave.id }); RA(1, { userToken: token, communityName: DataSave.communityName, facilitieId: DataSave.id });
} }
...@@ -82,7 +66,6 @@ const Bookings = (props: any) => { ...@@ -82,7 +66,6 @@ const Bookings = (props: any) => {
useEffect(() => { useEffect(() => {
if (Result != null) { if (Result != null) {
console.log(Result);
message.error(Result.msg); message.error(Result.msg);
if (Result.index == 1) { if (Result.index == 1) {
IA(); IA();
...@@ -92,7 +75,6 @@ const Bookings = (props: any) => { ...@@ -92,7 +75,6 @@ const Bookings = (props: any) => {
} }
}, [Result]); }, [Result]);
console.log(Data3);
// 选择小区监听是不是有值 // 选择小区监听是不是有值
useEffect(() => { useEffect(() => {
setLoading(false); setLoading(false);
...@@ -145,11 +127,6 @@ const Bookings = (props: any) => { ...@@ -145,11 +127,6 @@ const Bookings = (props: any) => {
message.error('Please Fill In The Contact Information Correctly!'); message.error('Please Fill In The Contact Information Correctly!');
return false; return false;
} }
// tmp.categoriesId = null
// tmp.facilitiesId = null
// tmp.communityName = null
// tmp.communityManagerFee = null
// tmp.communityMargin=null
if (value.categoriesName != null) { if (value.categoriesName != null) {
tmp.categoriesId = value.categoriesName.categoriesId; tmp.categoriesId = value.categoriesName.categoriesId;
tmp.facilitiesId = value.categoriesName.facilitiesId; tmp.facilitiesId = value.categoriesName.facilitiesId;
...@@ -169,26 +146,21 @@ const Bookings = (props: any) => { ...@@ -169,26 +146,21 @@ const Bookings = (props: any) => {
} }
if (tmp.accountName.length < 2) { if (tmp.accountName.length < 2) {
message.error('User Name Should be limit 2~30!', 3); message.error('User Name Should be limit 2~30!', 3);
} else if (
soltTime &&
moment(soltTime[0], 'HH:mm').format('hh') > moment(soltTime[1], 'HH:mm').format('hh')
) {
// 判断选的时间 是不是结束时间小于开始时间
message.error('Appointment time range error');
} else { } else {
tmp.reservedTimeList = soltTime; // 预约时间 tmp.reservedTimeList = soltTime; // 预约时间
RA(11, tmp); RA(11, tmp);
//还差检测
// if (checkParam(tmp)) {
// console.log(tmp);
// RA(11, tmp);
// } else {
// message.error('Error,Please Finish It,Not Empty!', 3);
// }
} }
// console.log(checkParam(tmp))
// console.log(comminityValues)
// console.log(tmp)
}; };
// 选择设施 // 选择设施
const RadioChoose = (e: any) => { const RadioChoose = (e: any) => {
Data3.map((item: any, index: any) => { Data3.map((item: any, index: any) => {
item.categorieList.map((thing: any, i: any) => { item.categorieList.map((thing: any, i: any) => {
console.log(thing);
if (thing.categoriesId == e.target.value.categoriesId) { if (thing.categoriesId == e.target.value.categoriesId) {
setCurString({ setCurString({
communityManagerFee: parseInt(item.communityManagerFee).toFixed(2), communityManagerFee: parseInt(item.communityManagerFee).toFixed(2),
...@@ -202,8 +174,6 @@ const Bookings = (props: any) => { ...@@ -202,8 +174,6 @@ const Bookings = (props: any) => {
setProhibit(false); setProhibit(false);
// 赋值给延后天数 // 赋值给延后天数
setBookTime(-item.canReservationDay + 1); setBookTime(-item.canReservationDay + 1);
// console.log(item.communityManagerFee)
// console.log(item.communityMargin)
} }
}); });
}); });
...@@ -390,6 +360,7 @@ const Bookings = (props: any) => { ...@@ -390,6 +360,7 @@ const Bookings = (props: any) => {
limit={curString.categoriesOpenTime} limit={curString.categoriesOpenTime}
openSelect={startTimes} openSelect={startTimes}
type={0} type={0}
inhibitTime={result}
/> />
</Form.Item> </Form.Item>
<span className="diyspan"> </span> <span className="diyspan"> </span>
...@@ -472,7 +443,6 @@ function mapStateToProps(state: any) { ...@@ -472,7 +443,6 @@ function mapStateToProps(state: any) {
typeof state.loading.models.FacilityBookings == 'undefined' typeof state.loading.models.FacilityBookings == 'undefined'
? true ? true
: state.loading.models.FacilityBookings; : state.loading.models.FacilityBookings;
console.log(Data3);
const { token } = state.login; const { token } = state.login;
return { return {
Data3, Data3,
......
...@@ -17,11 +17,9 @@ const managerFeeStatusDes = ['Not paid', 'Paid', 'Returned']; ...@@ -17,11 +17,9 @@ const managerFeeStatusDes = ['Not paid', 'Paid', 'Returned'];
const marginFeeStatusDes = ['Not paid', 'Paid', 'Not Returned', 'Returned part', 'Returned all']; const marginFeeStatusDes = ['Not paid', 'Paid', 'Not Returned', 'Returned part', 'Returned all'];
const statusDes = ['All', 'Applied', 'Reserved', 'Used', 'Cancelled', 'Completed']; const statusDes = ['All', 'Applied', 'Reserved', 'Used', 'Cancelled', 'Completed'];
import { getUrlLastParams } from '../../../utils/string';
import './css/index.less'; import './css/index.less';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import { PlusOutlined, ClockCircleOutlined, ClearOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import moment from 'moment'; import moment from 'moment';
......
...@@ -17,9 +17,6 @@ const module = 'VisitorRecord'; ...@@ -17,9 +17,6 @@ const module = 'VisitorRecord';
const VisitorRecord = (props: any) => { const VisitorRecord = (props: any) => {
const { dispatch, Data, DataSave, loading } = props; const { dispatch, Data, DataSave, loading } = props;
useEffect(() => {
RA(26, { inviterAddress: '', visitorCommunity: '' }, module, dispatch);
}, [1]);
const TosVisitorRecordGet = (values: any) => { const TosVisitorRecordGet = (values: any) => {
dispatch({ type: 'tosVisitorRecord/get', playload: values }); dispatch({ type: 'tosVisitorRecord/get', playload: values });
}; };
...@@ -30,6 +27,8 @@ const VisitorRecord = (props: any) => { ...@@ -30,6 +27,8 @@ const VisitorRecord = (props: any) => {
Data.forEach((item: any) => { Data.forEach((item: any) => {
item.showTime = moment(item.updateTime).format('YYYY-MM-DD'); item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
}); });
} else {
RA(26, { inviterAddress: '', visitorCommunity: '' }, module, dispatch);
} }
}, [Data]); }, [Data]);
...@@ -140,6 +139,7 @@ const VisitorRecord = (props: any) => { ...@@ -140,6 +139,7 @@ const VisitorRecord = (props: any) => {
// 刷新 // 刷新
const onReset = () => { const onReset = () => {
SA(DataSave, module, dispatch); SA(DataSave, module, dispatch);
RA(26, { inviterAddress: '', visitorCommunity: '' }, module, dispatch);
}; };
// 去掉null undefined 无效字段 // 去掉null undefined 无效字段
......
...@@ -17,9 +17,6 @@ const module = 'VisitorRecord'; ...@@ -17,9 +17,6 @@ const module = 'VisitorRecord';
const VisitorRecord = (props: any) => { const VisitorRecord = (props: any) => {
const { dispatch, Data, DataSave, loading } = props; const { dispatch, Data, DataSave, loading } = props;
useEffect(() => {
RA(26, { inviterAddress: '', visitorCommunity: '' }, module, dispatch);
}, [1]);
const TosVisitorRecordGet = (values: any) => { const TosVisitorRecordGet = (values: any) => {
dispatch({ type: 'tosVisitorRecord/get', playload: values }); dispatch({ type: 'tosVisitorRecord/get', playload: values });
}; };
...@@ -30,6 +27,8 @@ const VisitorRecord = (props: any) => { ...@@ -30,6 +27,8 @@ const VisitorRecord = (props: any) => {
Data.forEach((item: any) => { Data.forEach((item: any) => {
item.showTime = moment(item.updateTime).format('YYYY-MM-DD'); item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
}); });
} else {
RA(26, { inviterAddress: '', visitorCommunity: '' }, module, dispatch);
} }
}, [Data]); }, [Data]);
...@@ -140,6 +139,7 @@ const VisitorRecord = (props: any) => { ...@@ -140,6 +139,7 @@ const VisitorRecord = (props: any) => {
// 刷新 // 刷新
const onReset = () => { const onReset = () => {
SA(DataSave, module, dispatch); SA(DataSave, module, dispatch);
RA(26, { inviterAddress: '', visitorCommunity: '' }, module, dispatch);
}; };
// 去掉null undefined 无效字段 // 去掉null undefined 无效字段
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Space, Button, message, Pagination, Form, Input, Tooltip } from 'antd'; import { Space, Button, message, Pagination, Form, Input, Tooltip } from 'antd';
import { connect, history, Loading } from 'umi'; import { connect, history } from 'umi';
import { PlusOutlined, SearchOutlined, ClearOutlined } from '@ant-design/icons'; import { PlusOutlined, SearchOutlined, ClearOutlined } from '@ant-design/icons';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import moment from 'moment'; import moment from 'moment';
import styles from './ContractContent.less'; import styles from './ContractContent.less';
import { RA } from '@/services/tos';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
const Contract = (props: any) => { const Contract = (props: any) => {
const { location, dispatch, Contract, loading } = props; const { location, dispatch, Contract, loading } = props;
const { Data, DataSave, DataSaveDetail, Result } = Contract; const { Data } = Contract;
// 把请求装在一个地方 // 把请求装在一个地方
const RA = (index: any, values: any) => { const RA = (index: any, values: any) => {
dispatch({ type: 'Contract/RA', playload: { index: index, body: values } }); dispatch({ type: 'Contract/RA', playload: { index: index, body: values } });
}; };
function requst(payload: any) {
dispatch({ type: 'Contract/getList', payload: payload });
}
// 数据 // 数据
useEffect(() => { useEffect(() => {
if (Data == null) { if (Data == null) {
......
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './ContractContent.less'; import styles from './ContractContent.less';
import { import { Input, Form, message, Upload, DatePicker, Pagination, Modal, Spin, Image } from 'antd';
Input, import { LeftOutlined } from '@ant-design/icons';
Form, import { connect, history } from 'umi';
message,
Upload,
Button,
DatePicker,
Pagination,
Modal,
Spin,
Image,
} from 'antd';
import { PlusOutlined, LeftOutlined } from '@ant-design/icons';
import { Link, useIntl, connect, history, Loading } from 'umi';
import { RA } from '@/services/tos';
import LINE from '../../components/Line/Line'; import LINE from '../../components/Line/Line';
import TextArea from 'antd/lib/input/TextArea'; import TextArea from 'antd/lib/input/TextArea';
...@@ -23,15 +10,11 @@ import TextArea from 'antd/lib/input/TextArea'; ...@@ -23,15 +10,11 @@ import TextArea from 'antd/lib/input/TextArea';
import PDF from 'react-pdf-js'; import PDF from 'react-pdf-js';
import moment from 'moment'; import moment from 'moment';
import './ContractContent.less'; import './ContractContent.less';
// 配置英文
import 'moment/locale/en-au';
import locale from 'antd/es/date-picker/locale/en_US';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
import { tipList } from '@/utils/tip'; import { tipList } from '@/utils/tip';
import FileViewer from 'react-file-viewer'; import FileViewer from 'react-file-viewer';
import { stringSplit } from '@/utils/string';
const ContractContent = (props: any) => { const ContractContent = (props: any) => {
const { Contract, dispatch, FileImg, loading } = props; const { Contract, dispatch, FileImg, loading } = props;
...@@ -341,7 +324,6 @@ const ContractContent = (props: any) => { ...@@ -341,7 +324,6 @@ const ContractContent = (props: any) => {
rules={[{ required: true, message: `${tipList[5]}` }]} rules={[{ required: true, message: `${tipList[5]}` }]}
> >
<RangePicker <RangePicker
locale={locale}
defaultValue={DataSaveDetail ? DataSaveDetail.time : null} defaultValue={DataSaveDetail ? DataSaveDetail.time : null}
disabledDate={disabledDate} disabledDate={disabledDate}
placeholder={['Effective Date', 'Expiration Date']} placeholder={['Effective Date', 'Expiration Date']}
...@@ -400,7 +382,6 @@ const ContractContent = (props: any) => { ...@@ -400,7 +382,6 @@ const ContractContent = (props: any) => {
<span style={{ color: 'red' }}>*</span> If the time has passed, it will not be <span style={{ color: 'red' }}>*</span> If the time has passed, it will not be
sent sent
</p> </p>
{/* <span style={{color:'#f00'}}>&nbsp;{stateTime}</span> */}
</div> </div>
</div> </div>
...@@ -424,7 +405,6 @@ const ContractContent = (props: any) => { ...@@ -424,7 +405,6 @@ const ContractContent = (props: any) => {
// pdf 换一种 // pdf 换一种
<> <>
<PDF <PDF
// file={stringSplit(fileInfo.url, 'm/cash')}
file={fileInfo.url} file={fileInfo.url}
page={pageNumber} page={pageNumber}
scale={1.25} scale={1.25}
...@@ -447,11 +427,7 @@ const ContractContent = (props: any) => { ...@@ -447,11 +427,7 @@ const ContractContent = (props: any) => {
style={{ margin: '0 auto', textAlign: 'center' }} style={{ margin: '0 auto', textAlign: 'center' }}
/> />
) : ( ) : (
<FileViewer <FileViewer fileType={fileInfo.type} filePath={fileInfo.url} />
fileType={fileInfo.type}
// filePath={stringSplit(fileInfo.url, 'm/cash')}
filePath={fileInfo.url}
/>
) )
) : ( ) : (
'' ''
......
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