Commit 02608e8a authored by cellee's avatar cellee

Merge branch 'final' of http://120.77.240.215:9701/Maple/tostumi.git into final

parents 5a33990a a58884e8
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
var CurDataDetail = { var CurDataDetail = {
community: tmp.communityName, community: tmp.communityName,
address: tmp.addressAndpostalCode, address: tmp.addressAndpostalCode,
home: tmp.buildingNumber + '#' + tmp.floorNumber + '-' + tmp.roomNumber, home: tmp.buildingNumber + ' #' + tmp.floorNumber + '-' + tmp.roomNumber,
name: tmp.owerName, name: tmp.owerName,
phone: tmp.owerPhone, phone: tmp.owerPhone,
email: tmp.owerEmail, email: tmp.owerEmail,
......
...@@ -23,6 +23,8 @@ export default { ...@@ -23,6 +23,8 @@ export default {
memberResult: null, memberResult: null,
DataServices: null, DataServices: null,
Data4Error: null,
}, },
reducers: { reducers: {
...@@ -62,6 +64,9 @@ export default { ...@@ -62,6 +64,9 @@ export default {
returnDataServices(state, { DataServices }) { returnDataServices(state, { DataServices }) {
return { ...state, DataServices }; return { ...state, DataServices };
}, },
returnData4Error(state, { Data4Error }) {
return { ...state, Data4Error };
},
}, },
effects: { effects: {
...@@ -93,6 +98,7 @@ export default { ...@@ -93,6 +98,7 @@ export default {
if (resp.code == 500 || resp.error_code != '0000') { if (resp.code == 500 || resp.error_code != '0000') {
// message.error("Server Error,try again,error code:500",3) // message.error("Server Error,try again,error code:500",3)
// window.location.href = '/500'; // window.location.href = '/500';
console.log();
} }
if (resp.error_code != '0000') { if (resp.error_code != '0000') {
...@@ -100,6 +106,7 @@ export default { ...@@ -100,6 +106,7 @@ export default {
console.log(playload); console.log(playload);
var Data3Error = null; var Data3Error = null;
var Result = null; var Result = null;
let Data4Error = null;
switch (playload.index) { switch (playload.index) {
case 11: case 11:
{ {
...@@ -120,6 +127,12 @@ export default { ...@@ -120,6 +127,12 @@ export default {
yield put({ type: 'returnResult', Result }); yield put({ type: 'returnResult', Result });
} }
break; break;
case 14:
{
Data4Error = { msg: 'The community or unit is already registered!' };
}
yield put({ type: 'returnData4Error', Data4Error });
break;
} }
} else { } else {
switch (playload.index) { switch (playload.index) {
...@@ -216,5 +229,10 @@ export default { ...@@ -216,5 +229,10 @@ export default {
let memberResult = null; let memberResult = null;
yield put({ type: 'returnMemberResult', memberResult }); yield put({ type: 'returnMemberResult', memberResult });
}, },
*Data4ErrorClear({}, { put }) {
let Data4Error = null;
yield put({ type: 'returnData4Error', Data4Error });
},
}, },
}; };
...@@ -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');
}; };
......
...@@ -42,6 +42,8 @@ const CardAdd = (props: any) => { ...@@ -42,6 +42,8 @@ const CardAdd = (props: any) => {
} }
values.communityName = communityName; values.communityName = communityName;
console.log(values);
values.buildNumber = 'BLK ' + values.buildNumber;
setLoading(true); setLoading(true);
RA(35, values, module, dispatch); RA(35, values, module, dispatch);
}; };
...@@ -67,21 +69,6 @@ const CardAdd = (props: any) => { ...@@ -67,21 +69,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 +80,6 @@ const CardAdd = (props: any) => { ...@@ -93,21 +80,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 +148,7 @@ const CardAdd = (props: any) => { ...@@ -176,7 +148,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 +175,7 @@ const CardAdd = (props: any) => { ...@@ -203,7 +175,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,7 @@ const CardDetail = (props: any) => { ...@@ -73,7 +70,7 @@ 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} {DataSave.build_number + ' #' + DataSave.floor_number + '-' + DataSave.room_number}
</Col> </Col>
</Row> </Row>
...@@ -159,6 +156,12 @@ const CardDetail = (props: any) => { ...@@ -159,6 +156,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 } });
}; };
...@@ -74,6 +71,7 @@ const Detail = (props: any) => { ...@@ -74,6 +71,7 @@ const Detail = (props: any) => {
fromRef.current.setFieldsValue(tmp); fromRef.current.setFieldsValue(tmp);
} }
setLoading(false); setLoading(false);
console.log(CurDataDetail);
} }
}, [CurDataDetail]); }, [CurDataDetail]);
...@@ -158,9 +156,9 @@ const Detail = (props: any) => { ...@@ -158,9 +156,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}
......
...@@ -72,7 +72,7 @@ const RenovationDetail = (props: any) => { ...@@ -72,7 +72,7 @@ const RenovationDetail = (props: any) => {
<Col span={3}>{DataSave.communityName}</Col> <Col span={3}>{DataSave.communityName}</Col>
<Col>Unit:</Col> <Col>Unit:</Col>
<Col> <Col>
{DataSave.communityBuildDecorate}#{DataSave.communityFloorDecorate}- {DataSave.communityBuildDecorate} #{DataSave.communityFloorDecorate}-
{DataSave.communityRoomDecoate} {DataSave.communityRoomDecoate}
</Col> </Col>
</Row> </Row>
...@@ -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;
} // }
} // }
...@@ -7,18 +7,28 @@ import styles from './UsersAdd.less'; ...@@ -7,18 +7,28 @@ import styles from './UsersAdd.less';
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 SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { checkParam, RA } from '../../../utils/method'; import { checkParam, RA, Data4ErrorClear } from '../../../utils/method';
import { validateMessages } from '@/utils/params'; import { validateMessages } from '@/utils/params';
const module = 'User'; const module = 'User';
const UsersAdd = (props: any) => { const UsersAdd = (props: any) => {
const { dispatch, communityInfo } = props; const { dispatch, communityInfo, Data4Error } = props;
const [postman, setPostman] = useState({ extend: null }); const [postman, setPostman] = useState({ extend: null });
const formRef = useRef(null as any); const formRef = useRef(null as any);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
useEffect(() => {
if (Data4Error) {
if (Data4Error.msg) {
setLoading(false);
message.error(Data4Error.msg, 3);
Data4ErrorClear(module, dispatch);
}
}
}, [Data4Error]);
const onFinish = (values: any) => { const onFinish = (values: any) => {
if (postman.extend != null) { if (postman.extend != null) {
values.communityName = postman.extend; values.communityName = postman.extend;
...@@ -36,12 +46,14 @@ const UsersAdd = (props: any) => { ...@@ -36,12 +46,14 @@ const UsersAdd = (props: any) => {
message.error('Error,Please finish it,not empty!', 3); message.error('Error,Please finish it,not empty!', 3);
} }
}; };
const extendName = (values: any) => { const extendName = (values: any) => {
var tmp = postman; var tmp = postman;
tmp.extend = values; tmp.extend = values;
RA(32, { communityName: values }, module, dispatch); RA(32, { communityName: values }, module, dispatch);
setPostman(tmp); setPostman(tmp);
}; };
useEffect(() => { useEffect(() => {
if (communityInfo != null) { if (communityInfo != null) {
if (postman.extend != null) { if (postman.extend != null) {
...@@ -156,11 +168,12 @@ const UsersAdd = (props: any) => { ...@@ -156,11 +168,12 @@ const UsersAdd = (props: any) => {
}; };
function mapStateToProps(state: any) { function mapStateToProps(state: any) {
const { DataSave, communityInfo } = state.User; const { DataSave, communityInfo, Data4Error } = state.User;
return { return {
DataSave, DataSave,
communityInfo, communityInfo,
Data4Error,
}; };
} }
export default connect(mapStateToProps)(UsersAdd); export default connect(mapStateToProps)(UsersAdd);
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}>
......
...@@ -85,6 +85,9 @@ export const DataSaveDetailClear = (module: any, dispatch: any) => { ...@@ -85,6 +85,9 @@ export const DataSaveDetailClear = (module: any, dispatch: any) => {
export const DataSaveClear = (module: any, dispatch: any) => { export const DataSaveClear = (module: any, dispatch: any) => {
dispatch({ type: module + '/DataSaveClear' }); dispatch({ type: module + '/DataSaveClear' });
}; };
export const Data4ErrorClear = (module: any, dispatch: any) => {
dispatch({ type: module + '/Data4ErrorClear' });
};
// const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]] // const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
// const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }] // const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }]
export const Fromate = (values: any, reg: any) => { export const Fromate = (values: any, reg: any) => {
......
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