fix(wms): 修复合同ID为空时添加合同关系的错误
在合并、分条和批量分条操作中,当合同ID为空时不再尝试添加合同关系 同时优化批量分条时的合同关系添加逻辑,先过滤掉空合同ID
This commit is contained in:
@@ -766,10 +766,12 @@ export default {
|
|||||||
|
|
||||||
const coilId = response.data;
|
const coilId = response.data;
|
||||||
|
|
||||||
addCoilContractRel({
|
if (this.targetCoil.contractId) {
|
||||||
coilId: coilId,
|
addCoilContractRel({
|
||||||
contractId: this.targetCoil.contractId,
|
coilId: coilId,
|
||||||
})
|
contractId: this.targetCoil.contractId,
|
||||||
|
})
|
||||||
|
}
|
||||||
this.$message.success('合卷保存成功');
|
this.$message.success('合卷保存成功');
|
||||||
|
|
||||||
// 延迟返回,让用户看到成功提示
|
// 延迟返回,让用户看到成功提示
|
||||||
|
|||||||
@@ -675,10 +675,12 @@ export default {
|
|||||||
// 新增分条:调用创建接口
|
// 新增分条:调用创建接口
|
||||||
res = await createSpecialChild(this.coilId, this.actionId, splitData)
|
res = await createSpecialChild(this.coilId, this.actionId, splitData)
|
||||||
// 新增分条后,需要添加分条的合同关系
|
// 新增分条后,需要添加分条的合同关系
|
||||||
addCoilContractRel({
|
if (this.splitForm.contractId) {
|
||||||
coilId: res.data.coilId,
|
addCoilContractRel({
|
||||||
contractId: this.splitForm.contractId,
|
coilId: res.data.coilId,
|
||||||
})
|
contractId: this.splitForm.contractId,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$message.success(this.splitForm.coilId ? '编辑分条成功' : '新增分条成功')
|
this.$message.success(this.splitForm.coilId ? '编辑分条成功' : '新增分条成功')
|
||||||
|
|||||||
@@ -684,12 +684,15 @@ export default {
|
|||||||
|
|
||||||
// 拿到多个子卷的coilId
|
// 拿到多个子卷的coilId
|
||||||
const newCoilIds = response.msg.split(',');
|
const newCoilIds = response.msg.split(',');
|
||||||
|
// 先构建所有的请求体,并移除合同为空为空的项
|
||||||
|
const requests = newCoilIds.map((coilId, index) => ({
|
||||||
|
coilId,
|
||||||
|
contractId: this.splitList[index].contractId
|
||||||
|
}))
|
||||||
|
.filter(req => req.contractId);
|
||||||
// 为每个子卷添加合同关联
|
// 为每个子卷添加合同关联
|
||||||
Promise.all(newCoilIds.map(async (coilId, index) => {
|
Promise.all(requests.map(async (req, index) => {
|
||||||
addCoilContractRel({
|
addCoilContractRel(req);
|
||||||
coilId,
|
|
||||||
contractId: this.splitList[index].contractId
|
|
||||||
});
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 如果是从待操作列表进来的,标记操作为完成
|
// 如果是从待操作列表进来的,标记操作为完成
|
||||||
|
|||||||
@@ -26,10 +26,10 @@
|
|||||||
<!-- 自定义日期选择器 -->
|
<!-- 自定义日期选择器 -->
|
||||||
<span v-if="viewType === 'custom'" style="margin-left: 10px;">
|
<span v-if="viewType === 'custom'" style="margin-left: 10px;">
|
||||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeStart"
|
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeStart"
|
||||||
type="date" value-format="yyyy-MM-dd" placeholder="选择开始日期"></el-date-picker>
|
type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始日期"></el-date-picker>
|
||||||
至
|
至
|
||||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeEnd"
|
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeEnd"
|
||||||
type="date" value-format="yyyy-MM-dd" placeholder="选择结束日期"></el-date-picker>
|
type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束日期"></el-date-picker>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|||||||
Reference in New Issue
Block a user