Commit 12cab9bc authored by cellee's avatar cellee

设施预约时间限制

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 7ca55b90
......@@ -129,7 +129,7 @@ const Bookings = (props: any) => {
return false;
}
// 手机判断
if (tmp.accountPhone.length != 11 && tmp.accountPhone.length != 8) {
if (tmp.accountPhone && tmp.accountPhone.length != 11 && tmp.accountPhone.length != 8) {
message.error('Please Fill In The Contact Information Correctly!');
return false;
}
......@@ -157,7 +157,7 @@ const Bookings = (props: any) => {
tmp.communityManagerFee = numberToString(curString.communityManagerFee);
tmp.communityMargin = numberToString(curString.communityMargin);
}
if (tmp.accountName.length < 2) {
if (tmp.accountName && tmp.accountName.length < 2) {
message.error('User Name Should be limit 2~30!', 3);
} else if (
soltTime &&
......@@ -168,8 +168,36 @@ const Bookings = (props: any) => {
} else {
tmp.reservedTimeList = soltTime; // 预约时间
// 选择的总时间段
let times = [] as any;
for (let i = 0; i <= parseInt(moment(soltTime[1], 'HH:mm').format('HH')); i++) {
if (i >= parseInt(moment(soltTime[0], 'HH:mm').format('HH'))) {
times.push(moment(i, 'HH').format('HH:mm'));
}
}
// 如果有已被预约的时间段的话、循环判断已被预约时间是否包含选择的时间
let fruit = false;
if (result) {
// 是不是存在
for (let i in times) {
result.find((item: any) => {
if (item.indexOf(times[i]) !== -1) {
fruit = true;
}
});
}
}
// 如果选择的时间段有其他包含的话 给出提示,否则 可以提交
if (fruit) {
// 判断选的时间 是不是结束时间小于开始时间
message.error('Reservation period already exists!');
return false;
} else {
RA(11, tmp);
}
}
};
// 选择设施
const RadioChoose = (e: any) => {
......@@ -459,7 +487,7 @@ const Bookings = (props: any) => {
</div>
{/* 提示已选时间段 */}
{result != null && result.length > 0 ? (
{/* {result != null && result.length > 0 ? (
<div className={styles.box3}>
<div className={styles.box3item1}>Reserved Time Period:</div>
<div className="boxdiyitem">
......@@ -472,7 +500,7 @@ const Bookings = (props: any) => {
})}
</div>
</div>
) : null}
) : null} */}
{curString.communityManagerFee != null && Data3 ? (
<>
......
......@@ -12,11 +12,14 @@ import TitleSearch from '../../../components/TitleSearch/TitleSearch';
// const managerFeeStatusDes= ["未交", "已交", "已退"]
// const marginFeeStatusDes = ["未交", "已交", "未退", "已退部分", "已退全部"]
// const statusDes = ["全部", "已申请", "已预订", "已使用", "已取消", "已完成"]
const managerFeeStatusDes = ['Not paid', 'Paid', 'Returned'];
const marginFeeStatusDes = ['Not paid', 'Paid', 'Not Returned', 'Returned part', 'Returned all'];
// const managerFeeStatusDes = ['Not paid', 'Paid', 'Returned'];
// const marginFeeStatusDes = ['Not paid', 'Paid', 'Not Returned', 'Returned part', 'Returned all'];
const statusDes = ['All', 'Applied', 'Reserved', 'Used', 'Cancelled', 'Completed'];
//修改的状态
// const feeStatus = ['已申请未给钱', '未使用', '已使用未退款', '已使用部分退款', '全退款', '其他'];
const feeStatus = ['Unpaid', 'Paid', 'Pending Refund', 'Partial Refund', 'Full Refund', 'N.A.'];
import './css/index.less';
import ProTable from '@ant-design/pro-table';
import { PlusOutlined } from '@ant-design/icons';
......@@ -109,28 +112,7 @@ const FacilityBookings = (props: any) => {
</div>
),
],
[
'Fee',
'managerFeeStatus',
(text: any, record: any) => (
<div>
{record.communityManagerFee == 0 && record.communityMargin
? 'N.A.'
: managerFeeStatusDes[text]}
</div>
),
],
[
'Deposit',
'marginFeeStatus',
(text: any, record: any) => (
<div>
{record.communityManagerFee == 0 && record.communityMargin
? 'N.A.'
: marginFeeStatusDes[text]}
</div>
),
],
['Fee/Depsit', 'feeStatus', (text: any) => <div>{feeStatus[text]}</div>],
['Status', 'status', (text: any) => <div>{statusDes[text]}</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