Commit c12249f6 authored by cellee's avatar cellee

bug

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 1f5066d9
......@@ -9,8 +9,7 @@ import { history } from 'umi';
import { village } from '@/utils/tip';
import moment from 'moment';
import { parseInt } from 'lodash';
import { event } from '@/.umi/plugin-locale/locale';
import { getNumber } from '@/utils/string'; // 正则
const { RangePicker } = TimePicker;
......@@ -188,9 +187,12 @@ const Adds = (props: any) => {
// 表单验证
const onFinish = (values: any) => {
let { residentialZipCode, residentialAddress, residentialName } = values.des;
let tel = values.info.tel;
if (residentialZipCode.length < 6) {
message.error('Please Enter 6-digit Zip Code!');
} else if (tel.length != 8 && tel.length != 11) {
message.error('Incorrect Contact Information!');
} else {
onUpDate(values);
}
......@@ -198,12 +200,13 @@ const Adds = (props: any) => {
// 表单提交
function onUpDate(values: any) {
console.log(values.help);
// 额外判断
let obj: any = new Object();
obj.propertyFee = PropertyFee;
// 小区信息;
let { residentialZipCode, residentialAddress, residentialName } = values.des;
console.log(values);
obj.residentialZipCode = `SINGAPORE ${residentialZipCode}`;
obj.residentialAddress = residentialAddress;
obj.residentialName = residentialName;
......@@ -244,13 +247,13 @@ const Adds = (props: any) => {
obj.residentialHotlineServieStartTime = values.workingHours[0].format('HH:mm');
obj.residentialHotlineServieEndTime = values.workingHours[1].format('HH:mm');
}
console.log('Success:', obj);
if (Data) {
obj.id = Data.id;
}
console.log(obj);
// 上传
RA(29, obj, 'CellList', dispatch);
// RA(29, obj, 'CellList', dispatch);
}
// 返回
......@@ -265,14 +268,19 @@ const Adds = (props: any) => {
return value;
}
// 键盘回车事件
const onKeyDowns = (event: any) => {
console.log(event);
// 正则手机号
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 (
<>
<Spin spinning={loading} tip="信息提交中..." size="large">
<Spin spinning={loading} tip="loading..." size="large">
<div className="form">
<h3 className="capi">
<EditOutlined />
......@@ -285,7 +293,6 @@ const Adds = (props: any) => {
</div>
</h3>
<Form
onKeyDown={onKeyDowns}
name="basic"
form={form}
onFinish={onFinish}
......@@ -293,17 +300,18 @@ const Adds = (props: any) => {
layout="horizontal"
labelAlign="left"
>
<Form.Item label="Community Name" name="des" rules={village[4] as any}>
<Form.Item label="Community Name" name="des" rules={[{ required: false }]}>
<Input.Group compact>
<Form.Item name={['des', 'residentialZipCode']} noStyle rules={village[0] as any}>
<Input
style={{ marginRight: '10px', width: 120 }}
placeholder="6 Postcode"
maxLength={6}
onKeyUp={keyup_communityManagerFee}
/>
</Form.Item>
<Form.Item name={['des', 'residentialAddress']} noStyle rules={village[0] as any}>
<Form.Item name={['des', 'residentialAddress']} noStyle rules={village[1] as any}>
<Input
style={{ width: '360px' }}
placeholder="Please enter community adds"
......@@ -316,7 +324,7 @@ const Adds = (props: any) => {
name={['des', 'residentialName']}
normalize={insdInp}
noStyle
rules={village[0] as any}
rules={village[2] as any}
>
<Input
style={{ marginRight: '10px', width: '260px' }}
......@@ -330,20 +338,22 @@ const Adds = (props: any) => {
</Input.Group>
</Form.Item>
<Form.Item label="Working Hours" name="workingHours" rules={village[1] as any}>
<Form.Item label="Working Hours" name="workingHours" rules={village[3] as any}>
<RangePicker format="HH:mm" placeholder={['Start Time', 'End Time']} />
</Form.Item>
<Form.Item label="Community Telephone" name="info" rules={village[3] as any}>
<Form.Item label="Community Telephone" name="info" rules={[{ required: false }]}>
<Input.Group compact>
<Form.Item name={['info', 'tel']} noStyle rules={village[0] as any}>
<Form.Item name={['info', 'tel']} noStyle rules={village[4] as any}>
<Input
style={{ marginRight: '10px', width: '160px' }}
placeholder="Please enter phone"
maxLength={11}
onKeyUp={keyup_communityManagerFee}
/>
</Form.Item>
<Button type="text"></Button>
<Form.Item name={['info', 'email']} noStyle rules={village[0] as any}>
<Form.Item name={['info', 'email']} noStyle rules={village[5] as any}>
<Input
style={{ marginLeft: '10px', width: '180px' }}
placeholder="Please enter email"
......@@ -355,9 +365,9 @@ const Adds = (props: any) => {
<Form.Item
label="Administrators"
name="residentialManagerUserName"
rules={village[2] as any}
rules={village[6] as any}
>
<Input style={{ width: '160px' }} placeholder="Contacts" />
<Input style={{ width: '160px' }} placeholder="Contacts" maxLength={30} />
{/* <Button type="text">
<PlusCircleOutlined style={{ fontSize: '18px', color: '#08c' }} />
</Button> */}
......@@ -396,7 +406,7 @@ const Adds = (props: any) => {
<LinkOutlined color="#409EFF" />
{loubaUpload.length > 0 ? loubaUpload[0].name : ''}
</p>
<span className="capi">Support Files:.doc,.docx,.jpg,.png,.pdf</span>
<span>Support Files:.jpg, .png, .pdf</span>
</div>
</Form.Item>
......@@ -409,7 +419,7 @@ const Adds = (props: any) => {
<LinkOutlined color="#409EFF" />
{guideUpload.length > 0 ? guideUpload[0].name : ''}
</p>
<span className="capi">Support Files:.doc,.docx,.jpg,.png,.pdf</span>
<span>Support Files:.jpg, .png, .pdf</span>
</div>
</Form.Item>
......@@ -426,7 +436,7 @@ const Adds = (props: any) => {
<LinkOutlined color="#409EFF" />
{periodUpload.length > 0 ? periodUpload[0].name : ''}
</p>
<span className="capi">Support Files:.doc,.docx,.jpg,.png,.pdf</span>
<span>Support Files:.jpg, .png, .pdf</span>
</div>
</Form.Item>
......
......@@ -165,6 +165,7 @@ const CellLists = (props: any) => {
total={village.page.totalRow}
pageSize={village.page.curPageSize}
onChange={paginationHandler}
showSizeChanger={false}
/>
</div>
) : (
......
......@@ -54,7 +54,7 @@ const Add = (props: any) => {
// 解除结束时间不可选
settimeT(false);
// 图片名
setImageName(DataSave.noticImageName);
setImageName(DataSave.noticImageName.split(','));
}
}, [DataSave]);
......
......@@ -391,14 +391,14 @@ const Bookings = (props: any) => {
type={0}
/>
</Form.Item>
<span className="diyspan">-</span>
<span className="diyspan"> </span>
<Form.Item name="endTime" noStyle>
<OnTime
placeholder={'Closing Time'} // 默认值
disabled={prohibit} // 是否禁止
limit={curString.categoriesOpenTime} // 禁止时间段
openSelect={endTimes} // 时间类型
type={1}
type={0}
/>
</Form.Item>
</Form.Item>
......
......@@ -384,7 +384,7 @@ const Facility = (props: any) => {
<OnTime
placeholder={'Closing Time'} // 默认值
openSelect={endTimes}
type={1}
type={0}
defaultValue={soltTime[1]}
disabled={imgOpen}
/>
......
......@@ -90,24 +90,14 @@ const FacilityBookings = (props: any) => {
'Order Time',
null,
(text: any, record: any) => (
<div>
<ClockCircleOutlined style={{ color: '#666' }} />
&nbsp;
{moment(record.createTime.time).format('YYYY-MM-DD')}
</div>
<div>{moment(record.createTime.time).format('YYYY-MM-DD')}</div>
),
],
[
'Booking Schedule',
'subscribeDate',
(text: any) => (
<div>
<ClockCircleOutlined style={{ color: '#666' }} />
&nbsp;
{moment(text).format('YYYY-MM-DD')}
</div>
),
(text: any) => <div>{moment(text).format('YYYY-MM-DD')}</div>,
],
['Fee', 'managerFeeStatus', (text: any) => <div>{managerFeeStatusDes[text]}</div>],
['Deposit', 'marginFeeStatus', (text: any) => <div>{marginFeeStatusDes[text]}</div>],
......@@ -367,7 +357,7 @@ const FacilityBookings = (props: any) => {
{curString ? (
<div className="pages">
<Pagination
current={curString.curPage2}
current={Data2.total.curPageSize}
total={Data2.total.totalRow}
// pageSizeOptions={[]}
showSizeChanger={false}
......
......@@ -12,11 +12,19 @@ export const tipList = [
// 小区提示
export const village = [
[{ required: true, message: 'Please select community' }],
[{ required: true, message: 'Please select working hours !' }],
[{ required: true, message: 'Please enter the community administrator !' }],
[{ required: true, message: 'Please enter the phone number and email address !' }],
[{ required: true, message: 'Please input the address and name of the community !' }],
[{ required: true, message: 'Please enter the postcode' }],
[{ required: true, message: 'Please enter the address of the community !' }],
[{ required: true, message: 'Please enter the cell name !' }],
[{ required: true, message: 'Please select the time !' }],
[{ required: true, message: 'Please enter your mobile phone number !' }],
[
{
required: true,
type: 'email',
message: 'Please enter the correct email address !',
},
],
[{ required: true, message: 'Please enter the name of the community administrator !' }],
];
//公告提示
......
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