|
@@ -106,15 +106,13 @@
|
|
|
this.$message.warning('请选择技术人员!');
|
|
this.$message.warning('请选择技术人员!');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- // 通过时必须回写报价单:明细表里的单价/备注/附件/工艺路线等修改都要落库,
|
|
|
|
|
- // 不能靠“是否改过单价”来判断,否则改了备注、附件这些字段就会漏调 UpdateInformation
|
|
|
|
|
|
|
+ // 指派技术员时物品清单同样可以修改,所以要先把明细落库;
|
|
|
|
|
+ // 但指派不跑整单必填校验(否则校验不过会静默返回,看起来像“点了没反应”)
|
|
|
if (status === 1) {
|
|
if (status === 1) {
|
|
|
try {
|
|
try {
|
|
|
- const payload = await this.getTableValue();
|
|
|
|
|
- // 详情组件在必填校验不通过时会返回空值(如生产交付交期没选),
|
|
|
|
|
- // 此时表格已经弹过具体是哪个必填项,这里直接拦下不再提交审批
|
|
|
|
|
|
|
+ const payload = await this.getTableValue(type === 'assign');
|
|
|
if (!payload) {
|
|
if (!payload) {
|
|
|
- console.warn('报价单取值为空(校验未通过),已阻止提交审批');
|
|
|
|
|
|
|
+ this.$message.warning('报价单明细为空,未提交');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
const data = await UpdateInformation(payload);
|
|
const data = await UpdateInformation(payload);
|
|
@@ -134,8 +132,11 @@
|
|
|
let variables = {
|
|
let variables = {
|
|
|
pass: !!status
|
|
pass: !!status
|
|
|
};
|
|
};
|
|
|
- // 后端流程变量名是 userId(不是 technicianId):指派技术员时把选中的人带上
|
|
|
|
|
|
|
+ // 指派技术员要把选中的人带到流程变量里,下一个节点(技术员审批)的审批人取的就是它。
|
|
|
|
|
+ // 平台里各流程的变量名不统一:商机/生产计划/物料计划等用 technicianId,
|
|
|
|
|
+ // 部分流程用 userId,这里两个都传,避免任务流转了却没落到选中的人身上。
|
|
|
if (status && type === 'assign' && this.pickedUserId) {
|
|
if (status && type === 'assign' && this.pickedUserId) {
|
|
|
|
|
+ variables['technicianId'] = this.pickedUserId;
|
|
|
variables['userId'] = this.pickedUserId;
|
|
variables['userId'] = this.pickedUserId;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -164,12 +165,13 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- getTableValue() {
|
|
|
|
|
|
|
+ getTableValue(skipValidate) {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
|
// 父组件回调:data 为报价单整单数据(含 quoteProductList)
|
|
// 父组件回调:data 为报价单整单数据(含 quoteProductList)
|
|
|
|
|
+ // skipValidate 透传给详情组件,指派技术员时跳过整单必填校验
|
|
|
this.$emit('getTableValue', async (data) => {
|
|
this.$emit('getTableValue', async (data) => {
|
|
|
resolve(await data);
|
|
resolve(await data);
|
|
|
- });
|
|
|
|
|
|
|
+ }, skipValidate);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|