feat: 新增合同配置页面,优化多页面合同关联逻辑
1. 新增crm/contract/selectConfig页面,支持本地配置可选合同列表,区分手动/接口同步来源 2. 优化ContractSelect组件,新增上次选中合同置顶、本地存储选中记录功能 3. 为合卷、分条、退火计划、钢卷编辑页面添加合同必填校验与自动关联逻辑 4. 移除各业务页面冗余的合同关系手动调用代码,统一关联逻辑
This commit is contained in:
@@ -378,7 +378,6 @@ import AbnormalForm from './components/AbnormalForm';
|
||||
import PlanSheetViewer from './components/PlanSheetViewer.vue';
|
||||
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
|
||||
import ContractSelect from "@/components/KLPService/ContractSelect";
|
||||
import { addCoilContractRel } from "@/api/wms/coilContractRel";
|
||||
|
||||
export default {
|
||||
name: 'SplitCoil',
|
||||
@@ -748,6 +747,10 @@ export default {
|
||||
this.$message.error(`第${i + 1}个子卷的目标库区不能为空`);
|
||||
return;
|
||||
}
|
||||
if (!item.contractId) {
|
||||
this.$message.error(`第${i + 1}个子卷的合同不能为空`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const loadingInstance = this.$loading({
|
||||
@@ -768,9 +771,10 @@ export default {
|
||||
hasMergeSplit: 1, // 1表示分条
|
||||
newCoils: this.splitList.map(item => ({
|
||||
...item,
|
||||
itemType: item.itemType || this.motherCoil.itemType,
|
||||
itemId: item.itemId || this.motherCoil.itemId,
|
||||
hasMergeSplit: 1
|
||||
itemType: item.itemType,
|
||||
itemId: item.itemId,
|
||||
hasMergeSplit: 1,
|
||||
contractId: item.contractId,
|
||||
}))
|
||||
};
|
||||
|
||||
@@ -778,24 +782,6 @@ export default {
|
||||
if (response.code === 200) {
|
||||
this.$message.success('分条保存成功');
|
||||
|
||||
// 拿到多个子卷的coilId
|
||||
const newCoilIds = response.msg.split(',');
|
||||
// 先构建所有的请求体,并移除合同为空为空的项
|
||||
const requests = newCoilIds.map((coilId, index) => ({
|
||||
coilId,
|
||||
contractId: this.splitList[index].contractId
|
||||
}))
|
||||
.filter(req => req.contractId);
|
||||
// 为每个子卷添加合同关联
|
||||
Promise.all(requests.map(async (req, index) => {
|
||||
addCoilContractRel(req);
|
||||
}));
|
||||
|
||||
// 如果是从待操作列表进来的,标记操作为完成
|
||||
// if (this.actionId) {
|
||||
// await completeAction(this.actionId, response.msg);
|
||||
// }
|
||||
|
||||
// 延迟返回,让用户看到成功提示
|
||||
setTimeout(() => {
|
||||
this.$router.back();
|
||||
|
||||
Reference in New Issue
Block a user