Commit af67086e authored by Sixiang_Zzb's avatar Sixiang_Zzb

测试bug修复

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