|
@@ -279,6 +279,7 @@
|
|
|
ref="jobBomRef"
|
|
ref="jobBomRef"
|
|
|
:notFormed="item.notFormedList"
|
|
:notFormed="item.notFormedList"
|
|
|
:warehouseList="warehouseList"
|
|
:warehouseList="warehouseList"
|
|
|
|
|
+ :before-create-in-product="validateTaskReportForCreateInProduct"
|
|
|
></jobBom>
|
|
></jobBom>
|
|
|
</div>
|
|
</div>
|
|
|
<div v-if="item.singleReport == 1">
|
|
<div v-if="item.singleReport == 1">
|
|
@@ -287,6 +288,7 @@
|
|
|
ref="jobRef"
|
|
ref="jobRef"
|
|
|
:notFormed="item.notFormedList"
|
|
:notFormed="item.notFormedList"
|
|
|
:warehouseList="warehouseList"
|
|
:warehouseList="warehouseList"
|
|
|
|
|
+ :before-create-in-product="validateTaskReportForCreateInProduct"
|
|
|
></jobDdBom>
|
|
></jobDdBom>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -752,8 +754,7 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
clientEnvironmentId() {
|
|
clientEnvironmentId() {
|
|
|
- // return this.$store.state.user.info.clientEnvironmentId;
|
|
|
|
|
- return 9;
|
|
|
|
|
|
|
+ return this.$store.state.user.info.clientEnvironmentId;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -795,12 +796,24 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- validateTaskReportForOneClick() {
|
|
|
|
|
|
|
+ validateTaskReportForCreateInProduct(item) {
|
|
|
|
|
+ return this.validateTaskReportForOneClick(item, 'createInProduct');
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ validateTaskReportForOneClick(
|
|
|
|
|
+ targetItem,
|
|
|
|
|
+ validateType = 'oneClickReport'
|
|
|
|
|
+ ) {
|
|
|
if (this.clientEnvironmentId != 9) {
|
|
if (this.clientEnvironmentId != 9) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- for (const item of this.List) {
|
|
|
|
|
|
|
+ const actionName =
|
|
|
|
|
+ validateType == 'createInProduct' ? '创建在制品' : '一键报工';
|
|
|
|
|
+ const quantityName =
|
|
|
|
|
+ validateType == 'createInProduct' ? '在制品数量' : '报工数量';
|
|
|
|
|
+ const list = targetItem ? [targetItem] : this.List;
|
|
|
|
|
+ for (const item of list) {
|
|
|
const taskReportInfo = item.taskReportInfo || {};
|
|
const taskReportInfo = item.taskReportInfo || {};
|
|
|
if (Object.keys(taskReportInfo).length == 0) {
|
|
if (Object.keys(taskReportInfo).length == 0) {
|
|
|
continue;
|
|
continue;
|
|
@@ -812,7 +825,7 @@
|
|
|
|
|
|
|
|
if (taskReportInfo.reportCheck != 1) {
|
|
if (taskReportInfo.reportCheck != 1) {
|
|
|
this.$message.warning(
|
|
this.$message.warning(
|
|
|
- `工单${item.code || ''}未完成任务报工,不能一键报工`
|
|
|
|
|
|
|
+ `工单${item.code || ''}未完成任务报工,不能${actionName}`
|
|
|
);
|
|
);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -824,7 +837,7 @@
|
|
|
const taskReportNum = Number(taskReportInfo.reportQuantity || 0);
|
|
const taskReportNum = Number(taskReportInfo.reportQuantity || 0);
|
|
|
if (Math.abs(Number(workReportNum) - taskReportNum) > 0.000001) {
|
|
if (Math.abs(Number(workReportNum) - taskReportNum) > 0.000001) {
|
|
|
this.$message.warning(
|
|
this.$message.warning(
|
|
|
- `工单${item.code || ''}报工数量需等于任务报工数量`
|
|
|
|
|
|
|
+ `工单${item.code || ''}${quantityName}需等于任务报工数量`
|
|
|
);
|
|
);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|