|
@@ -1608,6 +1608,7 @@
|
|
|
if (!this.List[i].productRecycleList[j].warehouseId) {
|
|
if (!this.List[i].productRecycleList[j].warehouseId) {
|
|
|
const isRecycle = await this.checkRecycle();
|
|
const isRecycle = await this.checkRecycle();
|
|
|
if (!isRecycle) {
|
|
if (!isRecycle) {
|
|
|
|
|
+ this.loading.close();
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1704,97 +1705,46 @@
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ let newList = [];
|
|
|
for (let item of this.List) {
|
|
for (let item of this.List) {
|
|
|
- // if (item.currentTaskDiagram.isFirstTask == '1') {
|
|
|
|
|
- await checkReportNumber({
|
|
|
|
|
|
|
+ newList.push({
|
|
|
currentTaskDiagram: item.currentTaskDiagram,
|
|
currentTaskDiagram: item.currentTaskDiagram,
|
|
|
workOrderId: item.workOrderId
|
|
workOrderId: item.workOrderId
|
|
|
- }).then((res) => {
|
|
|
|
|
- const totalNum = Number(item.formingNum);
|
|
|
|
|
- const reportNum = this.add(
|
|
|
|
|
- item.workReportInfo.notFormedNum,
|
|
|
|
|
- item.workReportInfo.formedNum
|
|
|
|
|
- );
|
|
|
|
|
- const totalReportNum = this.add(reportNum, Number(res));
|
|
|
|
|
- if (totalReportNum > totalNum) {
|
|
|
|
|
- this.$confirm('报工数量大于生产数量, 是否继续报工?', '提示', {
|
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- // this.$message({
|
|
|
|
|
- // type: 'success',
|
|
|
|
|
- // message: '删除成功!'
|
|
|
|
|
- // });
|
|
|
|
|
- // return true;
|
|
|
|
|
- // this.loadingBtn = true;
|
|
|
|
|
- // jobSave(this.List)
|
|
|
|
|
- // .then((res) => {
|
|
|
|
|
- // this.loadingBtn = false;
|
|
|
|
|
- // this.loading.close();
|
|
|
|
|
- // this.$message.success('报工成功');
|
|
|
|
|
- // this.checked = false;
|
|
|
|
|
- // this.executorIdList = [];
|
|
|
|
|
- // this.teamId = '';
|
|
|
|
|
- // this.getList(this.idsList);
|
|
|
|
|
- // this.$emit('jobSuccess', 'Success');
|
|
|
|
|
- // })
|
|
|
|
|
- // .catch(() => {
|
|
|
|
|
- // this.loadingBtn = false;
|
|
|
|
|
- // this.loading.close();
|
|
|
|
|
- // });
|
|
|
|
|
- this.jobBookReport();
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => {
|
|
|
|
|
- this.loading.close();
|
|
|
|
|
- // this.$message({
|
|
|
|
|
- // type: 'info',
|
|
|
|
|
- // message: '已取消删除'
|
|
|
|
|
- // });
|
|
|
|
|
- // return false;
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- this.jobBookReport();
|
|
|
|
|
- // this.loadingBtn = true;
|
|
|
|
|
- // jobSave(this.List)
|
|
|
|
|
- // .then((res) => {
|
|
|
|
|
- // this.loadingBtn = false;
|
|
|
|
|
- // this.loading.close();
|
|
|
|
|
- // this.$message.success('报工成功');
|
|
|
|
|
- // this.checked = false;
|
|
|
|
|
- // this.executorIdList = [];
|
|
|
|
|
- // this.teamId = '';
|
|
|
|
|
- // this.getList(this.idsList);
|
|
|
|
|
- // this.$emit('jobSuccess', 'Success');
|
|
|
|
|
- // })
|
|
|
|
|
- // .catch(() => {
|
|
|
|
|
- // this.loadingBtn = false;
|
|
|
|
|
- // this.loading.close();
|
|
|
|
|
- // });
|
|
|
|
|
- }
|
|
|
|
|
});
|
|
});
|
|
|
- // } else {
|
|
|
|
|
- // this.jobBookReport();
|
|
|
|
|
- // // this.loadingBtn = true;
|
|
|
|
|
- // // jobSave(this.List)
|
|
|
|
|
- // // .then((res) => {
|
|
|
|
|
- // // this.loadingBtn = false;
|
|
|
|
|
- // // this.loading.close();
|
|
|
|
|
- // // this.$message.success('报工成功');
|
|
|
|
|
- // // this.checked = false;
|
|
|
|
|
- // // this.executorIdList = [];
|
|
|
|
|
- // // this.teamId = '';
|
|
|
|
|
- // // this.getList(this.idsList);
|
|
|
|
|
- // // this.$emit('jobSuccess', 'Success');
|
|
|
|
|
- // // })
|
|
|
|
|
- // // .catch(() => {
|
|
|
|
|
- // // this.loadingBtn = false;
|
|
|
|
|
- // // this.loading.close();
|
|
|
|
|
- // // });
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ // await checkReportNumber({
|
|
|
|
|
+ // currentTaskDiagram: item.currentTaskDiagram,
|
|
|
|
|
+ // workOrderId: item.workOrderId
|
|
|
|
|
+ // }).then((res) => {
|
|
|
|
|
+ // const totalNum = Number(item.formingNum);
|
|
|
|
|
+ // const reportNum = this.add(
|
|
|
|
|
+ // item.workReportInfo.notFormedNum,
|
|
|
|
|
+ // item.workReportInfo.formedNum
|
|
|
|
|
+ // );
|
|
|
|
|
+ // const totalReportNum = this.add(reportNum, Number(res));
|
|
|
|
|
+ // if (totalReportNum > totalNum) {
|
|
|
|
|
+ // this.$confirm('报工数量大于生产数量, 是否继续报工?', '提示', {
|
|
|
|
|
+ // confirmButtonText: '确定',
|
|
|
|
|
+ // cancelButtonText: '取消',
|
|
|
|
|
+ // type: 'warning'
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .then(() => {
|
|
|
|
|
+ // this.jobBookReport();
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .catch(() => {
|
|
|
|
|
+ // this.loading.close();
|
|
|
|
|
+ // });
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.jobBookReport();
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ await checkReportNumber(newList).then((res) => {
|
|
|
|
|
+ if (res.length != 0) {
|
|
|
|
|
+ this.checkJobBook(res);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
// this.loadingBtn = true;
|
|
// this.loadingBtn = true;
|
|
|
// jobSave(this.List)
|
|
// jobSave(this.List)
|
|
|
// .then((res) => {
|
|
// .then((res) => {
|
|
@@ -1818,6 +1768,36 @@
|
|
|
// });
|
|
// });
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ checkJobBook(list) {
|
|
|
|
|
+ let wordCodeList = [];
|
|
|
|
|
+ for (let item of list) {
|
|
|
|
|
+ if (item.reportFormed != '0') {
|
|
|
|
|
+ wordCodeList.push(item.workOrderCode);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (wordCodeList.length != 0) {
|
|
|
|
|
+ this.$confirm(
|
|
|
|
|
+ `工单号${wordCodeList.join(',')}已有报工,是否继续重复报工?`,
|
|
|
|
|
+ '提示',
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ center: true
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.jobBookReport();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.loading.close();
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.jobBookReport();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
jobBookReport() {
|
|
jobBookReport() {
|
|
|
this.loadingBtn = true;
|
|
this.loadingBtn = true;
|
|
|
jobSave(this.List)
|
|
jobSave(this.List)
|