Commit e24fb233 authored by cellee's avatar cellee

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

parent 92b62fb4
...@@ -22,12 +22,12 @@ const OnTime = (porps: any) => { ...@@ -22,12 +22,12 @@ const OnTime = (porps: any) => {
arrs = arrs + strArr; arrs = arrs + strArr;
}); });
let confirm = [...new Set(arrs.substr(0, arrs.length - 1).split(','))]; let confirm = [...new Set(arrs.substr(0, arrs.length - 1).split(','))];
console.log(confirm);
let newConfirm = [] as any; let newConfirm = [] as any;
confirm.forEach((element: any) => { confirm.forEach((element: any) => {
return newConfirm.push(parseInt(element)); return newConfirm.push(parseInt(element));
}); });
console.log(newConfirm);
setScheduled(newConfirm); setScheduled(newConfirm);
} }
}, [inhibitTime]); }, [inhibitTime]);
......
...@@ -9,7 +9,7 @@ import { timeToMoment } from '@/utils/time'; ...@@ -9,7 +9,7 @@ import { timeToMoment } from '@/utils/time';
export default { export default {
namespace: 'FacilityBookings', namespace: 'FacilityBookings',
state: { state: {
Data: {data:[],total:0}, Data: null,
Data2: {data:[],total:0}, Data2: {data:[],total:0},
Data3: null, Data3: null,
DataSave: null, DataSave: null,
...@@ -46,26 +46,6 @@ export default { ...@@ -46,26 +46,6 @@ export default {
return { ...state, FacilitysList} return { ...state, FacilitysList}
}, },
// 设施图片名称
retImgsName(state, { data }) {
state.imgList[data.key]['name'] =data.val;
console.log(state)
return state
},
// 清除图片
overImgList(state,{ data }) {
state.imgList[data.key] = {};
console.log(state)
return state
},
// 清除所有图片
overAllImgList(state) {
state.imgList = [{},{},{},{},{}];
return state
},
// returnPage(state, { Data,DataPage,DataSave}) { // returnPage(state, { Data,DataPage,DataSave}) {
// return { ...state, Data,DataPage,DataSave }; // return { ...state, Data,DataPage,DataSave };
// }, // },
...@@ -197,7 +177,7 @@ export default { ...@@ -197,7 +177,7 @@ export default {
} break; } break;
case 0: case 0:
case 9: { case 9: {
let Data = {data:resp.data.list,total:resp.data.page} ; let Data = resp.data ;
yield put({ type: 'returnPage', Data }); yield put({ type: 'returnPage', Data });
}break; }break;
......
...@@ -281,7 +281,7 @@ const Account = (props: any) => { ...@@ -281,7 +281,7 @@ const Account = (props: any) => {
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { reload: () => {
Refresh2(); Refresh();
}, },
setting: false, setting: false,
}} }}
......
...@@ -211,7 +211,8 @@ const Account = (props: any) => { ...@@ -211,7 +211,8 @@ const Account = (props: any) => {
const handleOk = (e: any) => { const handleOk = (e: any) => {
// //
let obj = { let obj = {
userStatus: accountName.userStatus == 0 ? 1 : 0, // userStatus: accountName.userStatus == 0 ? 1 : 0,
userStatus: 1,
userID: accountName.tosUserId, userID: accountName.tosUserId,
}; };
RA(52, obj, module, dispatch); RA(52, obj, module, dispatch);
......
...@@ -26,10 +26,9 @@ const BookingDetail = (props: any) => { ...@@ -26,10 +26,9 @@ const BookingDetail = (props: any) => {
let time2 = parseInt(moment(arr[arr.length - 1], 'HH:mm').format('hh')); let time2 = parseInt(moment(arr[arr.length - 1], 'HH:mm').format('hh'));
let Time = ''; let Time = '';
for (let i = time1; i <= time2; i++) { for (let i = time1; i <= time2; i++) {
Time = `${Time}${i}:00,`; i < 10 ? (Time = `${Time}0${i}:00,`) : (Time = `${Time}${i}:00,`);
} }
setExtractTime(Time); setExtractTime(Time);
if (DataSave.managerFeeStatus != 0) { if (DataSave.managerFeeStatus != 0) {
RA(2, { accountCategoriesId: DataSave.id }); RA(2, { accountCategoriesId: DataSave.id });
} }
...@@ -237,7 +236,7 @@ const BookingDetail = (props: any) => { ...@@ -237,7 +236,7 @@ const BookingDetail = (props: any) => {
{DataSave != null && DataSave.status == 1 && DataSave.managerFeeStatus == 0 ? ( {DataSave != null && DataSave.status == 1 && DataSave.managerFeeStatus == 0 ? (
<> <>
<div style={{ paddingBottom: 16 }}> <div style={{ paddingBottom: 16 }}>
<Descriptions column={{ xs: 2, sm: 3, md: 4 }} style={{ marginBottom: 6 }}> <Descriptions style={{ marginBottom: 6 }}>
<Descriptions.Item label="Management fee required"> <Descriptions.Item label="Management fee required">
$ {parseInt(DataSave.communityManagerFee).toFixed(2)} $ {parseInt(DataSave.communityManagerFee).toFixed(2)}
</Descriptions.Item> </Descriptions.Item>
......
...@@ -18,7 +18,6 @@ import moment from 'moment'; ...@@ -18,7 +18,6 @@ import moment from 'moment';
import { BookingsTip } from '@/utils/tip'; import { BookingsTip } from '@/utils/tip';
// 自定义时间段 // 自定义时间段
import OnTime from '@/components/OnTime/OnTime'; import OnTime from '@/components/OnTime/OnTime';
import { getNumber } from '@/utils/string'; // 正则
const Bookings = (props: any) => { const Bookings = (props: any) => {
const { dispatch, Data3, Result, DataSave, token, load, resultTime } = props; const { dispatch, Data3, Result, DataSave, token, load, resultTime } = props;
...@@ -154,6 +153,8 @@ const Bookings = (props: any) => { ...@@ -154,6 +153,8 @@ const Bookings = (props: any) => {
message.error('Appointment time range error'); message.error('Appointment time range error');
} else { } else {
tmp.reservedTimeList = soltTime; // 预约时间 tmp.reservedTimeList = soltTime; // 预约时间
console.log(tmp);
RA(11, tmp); RA(11, tmp);
} }
}; };
...@@ -225,16 +226,6 @@ const Bookings = (props: any) => { ...@@ -225,16 +226,6 @@ const Bookings = (props: any) => {
setSoltTime(s); setSoltTime(s);
}; };
// 正则手机号
const keyup_tool = (value: any) => {
return getNumber(value.replace(/[^\d^\.]+/g, ''));
};
// 手机号
const keyup_communityManagerFee = (e: any) => {
e.target.value = keyup_tool(e.target.value);
};
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件v1.2 */} {/* 头部组件v1.2 */}
...@@ -257,7 +248,13 @@ const Bookings = (props: any) => { ...@@ -257,7 +248,13 @@ const Bookings = (props: any) => {
</div> </div>
{Data3 && Data3.length > 0 ? ( {Data3 && Data3.length > 0 ? (
<> <>
<Form ref={formRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}> <Form
ref={formRef}
name="basic"
onFinish={onFinish}
validateMessages={validateMessages}
autocomplete="off"
>
<div className="box2 required"> <div className="box2 required">
<div className={styles.box2item1}>Facility Bookings : </div> <div className={styles.box2item1}>Facility Bookings : </div>
<div className={styles.box2item2}> <div className={styles.box2item2}>
...@@ -300,7 +297,6 @@ const Bookings = (props: any) => { ...@@ -300,7 +297,6 @@ const Bookings = (props: any) => {
style={{ width: 200 }} style={{ width: 200 }}
placeholder="Contact Information" placeholder="Contact Information"
disabled={prohibit} disabled={prohibit}
onKeyUp={keyup_communityManagerFee}
maxLength={11} maxLength={11}
/> />
</Form.Item> </Form.Item>
...@@ -315,7 +311,6 @@ const Bookings = (props: any) => { ...@@ -315,7 +311,6 @@ const Bookings = (props: any) => {
placeholder="Blk" placeholder="Blk"
style={{ width: 80 }} style={{ width: 80 }}
disabled={prohibit} disabled={prohibit}
onKeyUp={keyup_communityManagerFee}
maxLength={10} maxLength={10}
/> />
</Form.Item> </Form.Item>
...@@ -325,7 +320,6 @@ const Bookings = (props: any) => { ...@@ -325,7 +320,6 @@ const Bookings = (props: any) => {
placeholder="Floor" placeholder="Floor"
style={{ width: 80 }} style={{ width: 80 }}
disabled={prohibit} disabled={prohibit}
onKeyUp={keyup_communityManagerFee}
maxLength={10} maxLength={10}
/> />
</Form.Item> </Form.Item>
......
...@@ -338,7 +338,7 @@ const Facility = (props: any) => { ...@@ -338,7 +338,7 @@ const Facility = (props: any) => {
<Form.Item label="Facility" name="facilityName" rules={NewFaci[1]}> <Form.Item label="Facility" name="facilityName" rules={NewFaci[1]}>
<Input placeholder="Facility Name" disabled={facilityDetail} maxLength={30} /> <Input placeholder="Facility Name" disabled={facilityDetail} maxLength={30} />
</Form.Item> </Form.Item>
<Form.Item label="Fee($)" name="communityManagerFee" rules={NewFaci[2]}> <Form.Item label="Fee($)" name="communityManagerFee">
{/* <span className="divIconMoney">$</span> */} {/* <span className="divIconMoney">$</span> */}
<InputNumber <InputNumber
onKeyUp={keyup_communityManagerFee} onKeyUp={keyup_communityManagerFee}
...@@ -352,7 +352,7 @@ const Facility = (props: any) => { ...@@ -352,7 +352,7 @@ const Facility = (props: any) => {
/> />
</Form.Item> </Form.Item>
<Form.Item label="Deposit" name="communityMargin" rules={NewFaci[3]}> <Form.Item label="Deposit" name="communityMargin">
{/* <span className="divIconMoney">$</span> */} {/* <span className="divIconMoney">$</span> */}
<InputNumber <InputNumber
onKeyUp={keyup_communityMargin} onKeyUp={keyup_communityMargin}
......
...@@ -153,7 +153,7 @@ const FacilityBookings = (props: any) => { ...@@ -153,7 +153,7 @@ const FacilityBookings = (props: any) => {
var tmp = curString; var tmp = curString;
tmp.subscribeDate = comment.key; tmp.subscribeDate = comment.key;
if (comment.status == null || comment.status == undefined) { if (comment.status == null || comment.status == undefined) {
tmp.status = 0; tmp.status = null;
} else { } else {
tmp.status = comment.status; tmp.status = comment.status;
} }
...@@ -282,7 +282,7 @@ const FacilityBookings = (props: any) => { ...@@ -282,7 +282,7 @@ const FacilityBookings = (props: any) => {
<ProTable <ProTable
loading={loading} loading={loading}
rowKey="id" rowKey="id"
dataSource={Data.data} dataSource={Data ? Data.list : null}
columns={columns} columns={columns}
// pagination={{ // pagination={{
// current: curString.curPage, // current: curString.curPage,
...@@ -309,14 +309,14 @@ const FacilityBookings = (props: any) => { ...@@ -309,14 +309,14 @@ const FacilityBookings = (props: any) => {
// headerTitle="预约列表" // headerTitle="预约列表"
/> />
{curString ? ( {Data ? (
<div className="pages"> <div className="pages">
<Pagination <Pagination
current={curString.curPage} current={curString.curPage ? curString.curPage : 0}
total={Data.total.totalRow} total={Data.page.totalRow ? Data.page.totalRow : 0}
// pageSizeOptions={[]} // pageSizeOptions={[]}
showSizeChanger={false} showSizeChanger={false}
// pageSize={village.page.curPageSize} pageSize={Data.page.pageSize ? Data.page.pageSize : 0}
onChange={Pagechange} onChange={Pagechange}
/> />
</div> </div>
...@@ -384,6 +384,7 @@ function mapStateToProps(state: any) { ...@@ -384,6 +384,7 @@ 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;
return { return {
Data, Data,
Data2, Data2,
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-11-19 16:54:53 * @Date: 2020-11-19 16:54:53
* @LastEditTime: 2020-12-04 11:41:39 * @LastEditTime: 2020-12-07 16:17:28
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\tip.ts * @FilePath: \tostumi\src\utils\tip.ts
...@@ -30,6 +30,21 @@ const inputNumber = (rule: any, value: any, callback: any) => { ...@@ -30,6 +30,21 @@ const inputNumber = (rule: any, value: any, callback: any) => {
callback(); callback();
}; };
// 只能输入数字限制 电话提示
const inputNumberTel = (rule: any, value: any, callback: any) => {
if (value) {
if (
(/^[0-9]+$/g.test(value) && value.length == 8) ||
(/^[0-9]+$/g.test(value) && value.length == 11)
) {
callback();
} else {
callback(new Error('Please input contact information (8-11 digits)!'));
}
}
callback();
};
const reqMes = (msg: string) => { const reqMes = (msg: string) => {
return { return {
required: true, required: true,
...@@ -85,11 +100,11 @@ export const NewFaci = [ ...@@ -85,11 +100,11 @@ export const NewFaci = [
// 设施预订 // 设施预订
export const BookingsTip = [ export const BookingsTip = [
[reqMes('Please input Name ')], [reqMes('Please input Name ')],
[reqMes('Please input Contact Details')], [{ ...reqMes('Please input contact information (8-11 digits)'), validator: inputNumberTel }],
// [{ required: true, pattern: new RegExp(/^[1-9]\d*$/, 'g'), message: 'Only numbers!')], // [{ required: true, pattern: new RegExp(/^[1-9]\d*$/, 'g'), message: 'Only numbers!')],
[{ ...reqMes(''), validator: inputNumber }], [{ ...reqMes('Only numbers!'), validator: inputNumber }],
[{ ...reqMes(''), validator: inputNumber }], [{ ...reqMes('Only numbers!'), validator: inputNumber }],
[{ ...reqMes(''), validator: inputNumberStr }], [{ ...reqMes('Only numbers and letters can be entered!'), validator: inputNumberStr }],
[reqMes('Please Select The Date')], [reqMes('Please Select The Date')],
]; ];
......
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