调差功能修改

This commit is contained in:
黎永顺 2022-12-08 11:42:08 +08:00
parent a41a37db67
commit 33ef783d2b
1 changed files with 23 additions and 11 deletions

View File

@ -355,10 +355,20 @@ class AdjustTable extends Component {
title: "信息确认",
content: "确定保存吗?保存后数据将即时更新到台账!",
onOk: () => {
const { adjustToOptions, categoryTypeOptions, key, target, ...extraParams } = record;
const {
adjustToOptions, categoryTypeOptions, key, target, status,
originId, targetOptions: targetOption,
...extraParams
} = record;
const month = getQueryString("billMonth");
const paymentOrg = getQueryString("paymentOrganization");
const bool = _.every(Object.keys({ ...extraParams, target }), child => !!{ ...extraParams, target }[child]);
const tmpObj = { ...extraParams, target };
for (let i in tmpObj) {
Object.assign(tmpObj,{[i]:tmpObj[i].toString()})
}
const bool = _.every(Object.keys({ ...extraParams, target }), child => {
return !!tmpObj[child];
});
if (!bool) {
Modal.warning({
title: "信息确认",
@ -377,15 +387,17 @@ class AdjustTable extends Component {
if (status) {
const { data: dataMsg, errorMessage = [], successIds = [] } = data;
const msg = dataMsg + errorMessage.join(",");
message.success(msg || "保存成功");
this.setState({
dataSource: _.map(this.state.dataSource, it => {
if (record.target === it.target) {
return { ...it, status: true, id: successIds[0] };
}
return { ...it };
})
});
!_.isEmpty(errorMessage) ? message.error(msg) : message.success(msg || "保存成功");
if (_.isEmpty(errorMessage)) {
this.setState({
dataSource: _.map(this.state.dataSource, it => {
if (record.target === it.target) {
return { ...it, status: true, id: successIds[0] };
}
return { ...it };
})
});
}
} else {
message.error(errormsg || "保存失败");
}