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) => {
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]);
......
......@@ -9,7 +9,7 @@ import { timeToMoment } from '@/utils/time';
export default {
namespace: 'FacilityBookings',
state: {
Data: {data:[],total:0},
Data: null,
Data2: {data:[],total:0},
Data3: null,
DataSave: null,
......@@ -46,26 +46,6 @@ export default {
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}) {
// return { ...state, Data,DataPage,DataSave };
// },
......@@ -197,7 +177,7 @@ export default {
} break;
case 0:
case 9: {
let Data = {data:resp.data.list,total:resp.data.page} ;
let Data = resp.data ;
yield put({ type: 'returnPage', Data });
}break;
......
......@@ -281,7 +281,7 @@ const Account = (props: any) => {
density: false,
fullScreen: false,
reload: () => {
Refresh2();
Refresh();
},
setting: false,
}}
......
......@@ -211,7 +211,8 @@ const Account = (props: any) => {
const handleOk = (e: any) => {
//
let obj = {
userStatus: accountName.userStatus == 0 ? 1 : 0,
// userStatus: accountName.userStatus == 0 ? 1 : 0,
userStatus: 1,
userID: accountName.tosUserId,
};
RA(52, obj, module, dispatch);
......
......@@ -26,10 +26,9 @@ const BookingDetail = (props: any) => {
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,`;
i < 10 ? (Time = `${Time}0${i}:00,`) : (Time = `${Time}${i}:00,`);
}
setExtractTime(Time);
if (DataSave.managerFeeStatus != 0) {
RA(2, { accountCategoriesId: DataSave.id });
}
......@@ -237,7 +236,7 @@ const BookingDetail = (props: any) => {
{DataSave != null && DataSave.status == 1 && DataSave.managerFeeStatus == 0 ? (
<>
<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">
$ {parseInt(DataSave.communityManagerFee).toFixed(2)}
</Descriptions.Item>
......
......@@ -18,7 +18,6 @@ import moment from 'moment';
import { BookingsTip } from '@/utils/tip';
// 自定义时间段
import OnTime from '@/components/OnTime/OnTime';
import { getNumber } from '@/utils/string'; // 正则
const Bookings = (props: any) => {
const { dispatch, Data3, Result, DataSave, token, load, resultTime } = props;
......@@ -154,6 +153,8 @@ const Bookings = (props: any) => {
message.error('Appointment time range error');
} else {
tmp.reservedTimeList = soltTime; // 预约时间
console.log(tmp);
RA(11, tmp);
}
};
......@@ -225,16 +226,6 @@ const Bookings = (props: any) => {
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 (
<div className={styles.base}>
{/* 头部组件v1.2 */}
......@@ -257,7 +248,13 @@ const Bookings = (props: any) => {
</div>
{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={styles.box2item1}>Facility Bookings : </div>
<div className={styles.box2item2}>
......@@ -300,7 +297,6 @@ const Bookings = (props: any) => {
style={{ width: 200 }}
placeholder="Contact Information"
disabled={prohibit}
onKeyUp={keyup_communityManagerFee}
maxLength={11}
/>
</Form.Item>
......@@ -315,7 +311,6 @@ const Bookings = (props: any) => {
placeholder="Blk"
style={{ width: 80 }}
disabled={prohibit}
onKeyUp={keyup_communityManagerFee}
maxLength={10}
/>
</Form.Item>
......@@ -325,7 +320,6 @@ const Bookings = (props: any) => {
placeholder="Floor"
style={{ width: 80 }}
disabled={prohibit}
onKeyUp={keyup_communityManagerFee}
maxLength={10}
/>
</Form.Item>
......
......@@ -338,7 +338,7 @@ const Facility = (props: any) => {
<Form.Item label="Facility" name="facilityName" rules={NewFaci[1]}>
<Input placeholder="Facility Name" disabled={facilityDetail} maxLength={30} />
</Form.Item>
<Form.Item label="Fee($)" name="communityManagerFee" rules={NewFaci[2]}>
<Form.Item label="Fee($)" name="communityManagerFee">
{/* <span className="divIconMoney">$</span> */}
<InputNumber
onKeyUp={keyup_communityManagerFee}
......@@ -352,7 +352,7 @@ const Facility = (props: any) => {
/>
</Form.Item>
<Form.Item label="Deposit" name="communityMargin" rules={NewFaci[3]}>
<Form.Item label="Deposit" name="communityMargin">
{/* <span className="divIconMoney">$</span> */}
<InputNumber
onKeyUp={keyup_communityMargin}
......
......@@ -153,7 +153,7 @@ const FacilityBookings = (props: any) => {
var tmp = curString;
tmp.subscribeDate = comment.key;
if (comment.status == null || comment.status == undefined) {
tmp.status = 0;
tmp.status = null;
} else {
tmp.status = comment.status;
}
......@@ -282,7 +282,7 @@ const FacilityBookings = (props: any) => {
<ProTable
loading={loading}
rowKey="id"
dataSource={Data.data}
dataSource={Data ? Data.list : null}
columns={columns}
// pagination={{
// current: curString.curPage,
......@@ -309,14 +309,14 @@ const FacilityBookings = (props: any) => {
// headerTitle="预约列表"
/>
{curString ? (
{Data ? (
<div className="pages">
<Pagination
current={curString.curPage}
total={Data.total.totalRow}
current={curString.curPage ? curString.curPage : 0}
total={Data.page.totalRow ? Data.page.totalRow : 0}
// pageSizeOptions={[]}
showSizeChanger={false}
// pageSize={village.page.curPageSize}
pageSize={Data.page.pageSize ? Data.page.pageSize : 0}
onChange={Pagechange}
/>
</div>
......@@ -384,6 +384,7 @@ function mapStateToProps(state: any) {
typeof state.loading.models.FacilityBookings == 'undefined'
? true
: state.loading.models.FacilityBookings;
return {
Data,
Data2,
......
/*
* @Author: your name
* @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
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\tip.ts
......@@ -30,6 +30,21 @@ const inputNumber = (rule: any, value: any, callback: any) => {
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) => {
return {
required: true,
......@@ -85,11 +100,11 @@ export const NewFaci = [
// 设施预订
export const BookingsTip = [
[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!')],
[{ ...reqMes(''), validator: inputNumber }],
[{ ...reqMes(''), validator: inputNumber }],
[{ ...reqMes(''), validator: inputNumberStr }],
[{ ...reqMes('Only numbers!'), validator: inputNumber }],
[{ ...reqMes('Only numbers!'), validator: inputNumber }],
[{ ...reqMes('Only numbers and letters can be entered!'), validator: inputNumberStr }],
[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