Commit a58884e8 authored by Sixiang_Zzb's avatar Sixiang_Zzb

测试bug修复

parent af67086e
...@@ -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 });
},
}, },
}; };
...@@ -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);
}; };
......
...@@ -70,12 +70,7 @@ const CardDetail = (props: any) => { ...@@ -70,12 +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>
{'BLK ' + {DataSave.build_number + ' #' + DataSave.floor_number + '-' + DataSave.room_number}
DataSave.build_number +
'#' +
DataSave.floor_number +
'-' +
DataSave.room_number}
</Col> </Col>
</Row> </Row>
......
...@@ -71,6 +71,7 @@ const Detail = (props: any) => { ...@@ -71,6 +71,7 @@ const Detail = (props: any) => {
fromRef.current.setFieldsValue(tmp); fromRef.current.setFieldsValue(tmp);
} }
setLoading(false); setLoading(false);
console.log(CurDataDetail);
} }
}, [CurDataDetail]); }, [CurDataDetail]);
......
...@@ -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>
......
...@@ -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);
...@@ -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