Commit d5b3367e authored by XieZhiXiong's avatar XieZhiXiong

完善逻辑

parent cbd2feea
......@@ -162,6 +162,8 @@ const AddMember: React.FC<any> = props => {
...rest
} = values;
const filtered = areas.filter(item => item.pcode || item.ccode);
if (!id) {
setSubmitLoading(true);
const msg = message.loading({
......@@ -176,7 +178,7 @@ const AddMember: React.FC<any> = props => {
phone,
email,
channelTypeId,
areas,
areas: filtered,
remark,
detail: rest,
}).then(res => {
......@@ -206,7 +208,7 @@ const AddMember: React.FC<any> = props => {
phone,
email,
channelTypeId,
areas,
areas: filtered,
remark,
detail: rest,
}).then(res => {
......
......@@ -172,9 +172,11 @@ const AddEquity: React.FC<[]> = () => {
setSubmitLoading(true);
try {
const res = await Promise.all(promises);
message.success('保存成功');
getMemberLevelInfo();
const resArr = await Promise.all(promises);
if (resArr.every((item: { code: number }) => item.code === 1000)) {
message.success('保存成功');
getMemberLevelInfo();
}
} catch (errInfo) {
}
......
......@@ -107,12 +107,14 @@ const AuditPr1: React.FC<{}> = () => {
}),
];
Promise.all(promises).then(res => {
Promise.all(promises).then(resArr => {
if (resArr.every((item: { code: number }) => item.code === 1000)) {
setModalVisible(false);
setTimeout(() => {
history.goBack();
}, 800);
}
setConfirmLoading(false);
setModalVisible(false);
setTimeout(() => {
history.goBack();
}, 800);
}).catch(err => {
setConfirmLoading(false);
});
......
......@@ -107,12 +107,14 @@ const AuditPr2: React.FC<{}> = () => {
}),
];
Promise.all(promises).then(res => {
Promise.all(promises).then(resArr => {
if (resArr.every((item: { code: number }) => item.code === 1000)) {
setModalVisible(false);
setTimeout(() => {
history.goBack();
}, 800);
}
setConfirmLoading(false);
setModalVisible(false);
setTimeout(() => {
history.goBack();
}, 800);
}).catch(err => {
setConfirmLoading(false);
});
......
......@@ -107,12 +107,14 @@ const AuditPrComfirm: React.FC<{}> = () => {
}),
];
Promise.all(promises).then(res => {
Promise.all(promises).then(resArr => {
if (resArr.every((item: { code: number }) => item.code === 1000)) {
setModalVisible(false);
setTimeout(() => {
history.goBack();
}, 800);
}
setConfirmLoading(false);
setModalVisible(false);
setTimeout(() => {
history.goBack();
}, 800);
}).catch(err => {
setConfirmLoading(false);
});
......
......@@ -153,10 +153,13 @@ const AuditPrSubmit: React.FC<{}> = () => {
// 修改渠道信息
const handleChannelSubmit = value => {
const { channelLevel, ...rest } = value;
const { channelLevel, areas = [], ...rest } = value;
const filtered = areas.filter(item => item.pcode || item.ccode);
return PublicApi.postMemberAbilityValidateCommitChannelUpdate({
memberId: id,
validateId,
areas: filtered,
...rest,
}, {
ctlType: 'none',
......@@ -176,13 +179,15 @@ const AuditPrSubmit: React.FC<{}> = () => {
}),
];
Promise.all(promises).then(res => {
Promise.all(promises).then(resArr => {
if (resArr.every((item: { code: number }) => item.code === 1000)) {
setModalVisible(false);
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
}
setConfirmLoading(false);
setModalVisible(false);
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
}).catch(err => {
setConfirmLoading(false);
});
......
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