Commit af67086e authored by Sixiang_Zzb's avatar Sixiang_Zzb

测试bug修复

parent 19afdaad
......@@ -94,6 +94,9 @@ const Card = (props: any) => {
message.error('No Permissions!!!', 3);
return;
}
const user = JSON.parse(localStorage.getItem('userInfo') as string);
values['Reply_name'] = user.userModel.tosUserName;
values['Reply_Contact'] = user.userModel.tosUserPhone;
SA(values, module, dispatch);
history.push('./AccessCardApplication/Detail');
};
......
......@@ -67,21 +67,6 @@ const CardAdd = (props: any) => {
form.resetFields();
}, []);
// const checkData: (rule: any, value: string, callback: any) => void = (
// rule: any,
// value: any,
// callback: any,
// ) => {
// if (value) {
// if (/^\d$/) {
// } else {
// }
// }
// callback()
// };
const checkData2: (rule: any, value: string, cb: any) => void = (rule, value, cb) => {
if (value) {
if (/^[a-zA-Z0-9]+$/g.test(value)) {
......@@ -93,21 +78,6 @@ const CardAdd = (props: any) => {
cb();
};
// const checkName: (rule: any, value: string, callback: any) => void = (
// rule: any,
// value: any,
// callback: any,
// ) => {
// if (value) {
// if () {
// } else {
// callback(new Error(''));
// }
// }
// callback();
// };
// 手机号码验证
const phoneNumber: (rule: any, value: string, cb: any) => void = (rule, value, cb) => {
if (value) {
......@@ -176,7 +146,7 @@ const CardAdd = (props: any) => {
<Form.Item
name="communityOwner"
style={{ marginRight: 20 }}
rules={[{ required: true, max: 8, min: 2 }]}
rules={[{ required: true, max: 30, min: 2 }]}
>
<Input placeholder={'Name'} />
</Form.Item>
......@@ -203,7 +173,7 @@ const CardAdd = (props: any) => {
<Form.Item
name="applyName"
style={{ marginRight: 20 }}
rules={[{ required: true, max: 8, min: 2 }]}
rules={[{ required: true, max: 30, min: 2 }]}
>
<Input placeholder={'Name'} />
</Form.Item>
......
......@@ -27,10 +27,7 @@ const CardDetail = (props: any) => {
const formRef = useRef(null);
const [loading, setLoading] = useState(false);
useEffect(() => {
if (DataSave != null) {
console.log(DataSave);
// RA(36, { id: DataSave.id }, module, dispatch);
} else {
if (!DataSave) {
history.go(-1);
}
}, []);
......@@ -73,7 +70,12 @@ const CardDetail = (props: any) => {
<Col span={3}>{DataSave.community_name}</Col>
<Col>Unit:</Col>
<Col>
{DataSave.build_number + '#' + DataSave.floor_number + '-' + DataSave.room_number}
{'BLK ' +
DataSave.build_number +
'#' +
DataSave.floor_number +
'-' +
DataSave.room_number}
</Col>
</Row>
......@@ -159,6 +161,12 @@ const CardDetail = (props: any) => {
</Form>
) : (
<>
<Row>
<Col span={3}>Replyer:</Col>
<Col span={3}>{DataSave.Reply_name}</Col>
<Col span={3}>Contact:</Col>
<Col>{DataSave.Reply_Contact}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Examine:</Col>
<Col span={4}>
......
import React, { useState, useEffect, useRef } from 'react';
import styles from './css/Detail.less';
import { Input, Form, Row, Col, Upload, Spin, Button, Descriptions } from 'antd';
import { Form, Row, Col, Spin, Button, Descriptions } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
import { connect } from 'umi';
import TextArea from 'antd/lib/input/TextArea';
import { PlusOutlined } from '@ant-design/icons';
import Line from '../../components/Line/Line';
import TitleBack from '../../components/TitleBack/TitleBack';
import PictureOptionsRow from '../../components/PictureOptions/PictureOptionsRow';
import { getCookie } from '@/utils/method';
import { timestampToTime } from '@/utils/time';
import { validateMessages } from '@/utils/params';
const treatStatus = ['Pending', 'Processed'];
......@@ -20,7 +17,7 @@ const Detail = (props: any) => {
const [editorFlag, setEditorFlag] = useState(true);
const { dispatch, location, CurDataDetail } = props;
const fromRef = useRef(null);
const fromRef = useRef(null) as any;
const RA = (index: any, values: any) => {
dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } });
};
......@@ -158,9 +155,9 @@ const Detail = (props: any) => {
>
{!editorFlag ? (
<Row gutter={16}>
<Col>Response:</Col>
<Col>Replyer:</Col>
<Col span={6}>{getCookie('name')}</Col>
<Col>Contract Detail:</Col>
<Col>Contact:</Col>
<Col>{getCookie('phone')}</Col>
</Row>
) : null}
......
......@@ -152,9 +152,9 @@ const RenovationDetail = (props: any) => {
) : (
<>
<Row>
<Col span={3}>replier:</Col>
<Col span={3}>Replyer:</Col>
<Col span={3}>{DataSave.replyName}</Col>
<Col span={3}>Phone: </Col>
<Col span={3}>Contact: </Col>
<Col>{DataSave.replyPhone}</Col>
</Row>
......
......@@ -59,7 +59,7 @@
position: absolute;
top: 34px;
left: 33px;
width: 260px;
width: 180px;
z-index: 10;
background-color: #fff;
min-height: 20px;
......@@ -71,21 +71,21 @@
position: absolute;
top: 34px;
left: -87px;
width: 260px;
width: 180px;
z-index: 20;
background-color: #fff;
min-height: 20px;
}
}
.roomNumber {
:global(.ant-form-item-explain) {
position: absolute;
top: 34px;
left: -205px;
width: 260px;
z-index: 30;
background-color: #fff;
min-height: 20px;
}
}
// .roomNumber {
// :global(.ant-form-item-explain) {
// position: absolute;
// top: 34px;
// left: -205px;
// width: 260px;
// z-index: 30;
// background-color: #fff;
// min-height: 20px;
// }
// }
import React, { useState, useEffect, useRef } from 'react';
import styles from './Edit.less';
import {
Input,
Button,
Form,
Result,
Pagination,
Tooltip,
Checkbox,
Spin,
Radio,
message,
} from 'antd';
import { Link, useIntl, connect, history } from 'umi';
import { Input, Button, Form, Spin, Radio, message } from 'antd';
import { connect, history } from 'umi';
import SelectOptions from '../../../components/SelectOptions/index';
import TitleBack from '../../../components/TitleBack/TitleBack';
......@@ -21,8 +10,13 @@ import { RA } from '@/utils/method';
const module = 'User';
let options: Array<{ label: string; value: number }> = [];
let optionsList: {
serviceName: string;
serviceCode: string;
}[] = [];
const Edit = (props: any) => {
const { dispatch, CurData, SaveChooseData, location, CommunityList, DataServices } = props;
const { dispatch, CurData, SaveChooseData, CommunityList, DataServices } = props;
const TosTosServiceProviderSave = (values: any) => {
dispatch({ type: 'ServiceProvider/TosTosServiceProviderSave', playload: values });
};
......@@ -44,12 +38,15 @@ const Edit = (props: any) => {
// 处理服务范围数据
useEffect(() => {
if (DataServices != null) {
console.log(DataServices);
options = DataServices.data.rows.map((v: any) => {
return {
label: v.serviceName,
value: v.serviceCode,
};
});
optionsList = [...DataServices.data.rows];
}
}, [DataServices]);
......@@ -69,20 +66,15 @@ const Edit = (props: any) => {
useEffect(() => {
if (SaveChooseData != null) {
// console.log(SaveChooseData);
// console.log(options);
// let arr: Array<''> = [];
// SaveChooseData.serviceScopeList.forEach((v: any) => {
// options.forEach((ele: any) => {
// if (v === ele.value) {
// arr.push(ele.value as never);
// }
// });
// });
// console.log(arr);
// SaveChooseData.serviceScopeList = arr;
SaveChooseData.serviceScopeList = SaveChooseData.serviceScopeList[0];
formRef.current.setFieldsValue(SaveChooseData);
// 处理服务范围数据
optionsList.forEach((v) => {
if (v.serviceName === SaveChooseData.serviceScope) {
SaveChooseData.serviceScopeList = v.serviceCode;
formRef.current.setFieldsValue(SaveChooseData);
}
});
console.log(SaveChooseData);
}
}, [SaveChooseData]);
......@@ -97,6 +89,7 @@ const Edit = (props: any) => {
val.creator = 'admin';
val.updater = 'admin';
val.serviceScopeList = [val.serviceScopeList];
console.log(val);
if (SaveChooseData) {
val.id = SaveChooseData.id;
}
......
......@@ -59,17 +59,16 @@ const ServiceProviderManagement = (props: propsType) => {
message.error('No Permissions!!!', 3);
return;
}
values.serviceScope = options[values.serviceScopeList[0]][1];
SaveChooseData(values);
if (values.serviceScopeList[0].toString() === '0') {
history.push(location.pathname + '/Detail');
} else if (values.serviceScopeList[0].toString() === '1') {
if (values.serviceScope === 'Accountant') {
history.push(location.pathname + '/AccoutingDetail');
} else {
history.push('/404');
history.push(location.pathname + '/Detail');
}
};
const goToEdit = (values: object, e: any) => {
if (permissionArr.indexOf('7') < 0) {
message.error('No Permissions!!!', 3);
......@@ -100,12 +99,12 @@ const ServiceProviderManagement = (props: propsType) => {
},
{
title: 'Services Available',
dataIndex: 'serviceScopeList',
render: (text: Array<''>, record: object) => {
let type: string = '';
if (options.length > 0) type = options[text[0]][1];
return type;
},
dataIndex: 'serviceScope',
// render: (text: Array<''>, record: object) => {
// let type: string = '';
// if (options.length > 0) type = options[text[0]][1];
// return type;
// },
},
{ title: 'Account Status', dataIndex: 'enable' },
{
......@@ -215,22 +214,22 @@ const ServiceProviderManagement = (props: propsType) => {
};
// 数据处理
// const dataSource = (values: any) => {
// let tmp = values;
// for (let items in tmp) {
// switch (tmp[items].enable) {
// case 0:
// tmp[items].enable = 'Normal';
// break;
// case 1:
// tmp[items].enable = 'Deregistered';
// break;
// case 2:
// break;
// }
// }
// return tmp;
// };
const dataSource = (values: any) => {
let tmp = values;
for (let items in tmp) {
switch (tmp[items].enable) {
case 0:
tmp[items].enable = 'Normal';
break;
case 1:
tmp[items].enable = 'Deregistered';
break;
case 2:
break;
}
}
return tmp;
};
return (
<div className={styles.base}>
......
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