|
|
@@ -967,17 +967,15 @@
|
|
|
return this.$message.warning('请选择执行时间');
|
|
|
}
|
|
|
|
|
|
- // for (let i = 0; i < this.List.length; i++) {
|
|
|
- // console.log('1231321313');
|
|
|
- // console.log(this.List[i].packInfo, '1231321313');
|
|
|
- // if (
|
|
|
- // this.List[i].packInfo &&
|
|
|
- // Object.keys(this.List[i].packInfo).length === 0
|
|
|
- // ) {
|
|
|
- // this.loading.close();
|
|
|
- // return this.$message.warning('请到主数据配置包装规格');
|
|
|
- // }
|
|
|
- // }
|
|
|
+ for (let i = 0; i < this.List.length; i++) {
|
|
|
+ if (
|
|
|
+ this.List[i].packInfo &&
|
|
|
+ Object.keys(this.List[i].packInfo).length === 0
|
|
|
+ ) {
|
|
|
+ this.loading.close();
|
|
|
+ return this.$message.warning('请到主数据配置包装规格');
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// if(this.taskObj.type !=6){
|
|
|
// if(this.reportNeedFeed==1&&!(this.List[0].semiProductList.length>0||this.List[0].pickOutInList.length>0)){
|
|
|
@@ -1052,16 +1050,26 @@
|
|
|
// }
|
|
|
|
|
|
if (this.clientEnvironmentId != 2) {
|
|
|
- let succ = this.List.some((L) => {
|
|
|
- return L.productRecycleList.length > 0;
|
|
|
- });
|
|
|
-
|
|
|
- if (succ) {
|
|
|
- const isRecycle = await this.checkRecycle();
|
|
|
- if (!isRecycle) {
|
|
|
- return false;
|
|
|
+ for (let i = 0; i < this.List.length; i++) {
|
|
|
+ for (let j = 0; j < this.List[i].productRecycleList.length; j++) {
|
|
|
+ if (!this.List[i].productRecycleList[j].warehouseId) {
|
|
|
+ const isRecycle = await this.checkRecycle();
|
|
|
+ if (!isRecycle) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // let succ = this.List.some((L) => {
|
|
|
+ // return L.productRecycleList.length > 0;
|
|
|
+ // });
|
|
|
+ // if (succ) {
|
|
|
+ // const isRecycle = await this.checkRecycle();
|
|
|
+ // if (!isRecycle) {
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
console.log(this.item, '9999999999');
|
|
|
@@ -1164,252 +1172,8 @@
|
|
|
// });
|
|
|
},
|
|
|
|
|
|
- async checkChooseData(dataList, type, chooseType) {
|
|
|
- if (chooseType == 'choose') {
|
|
|
- for (let i = 0; i < dataList.length; i++) {
|
|
|
- if (!dataList[i].extInfo.engrave) {
|
|
|
- this.$message.warning('请输入刻码!');
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- for (let i = 0; i < dataList.length; i++) {
|
|
|
- if (dataList[i].semiProductList.length > 0) {
|
|
|
- for (let j = 0; j < dataList[i].semiProductList.length; j++) {
|
|
|
- if (!dataList[i].semiProductList[j].extInfo.engrave) {
|
|
|
- this.$message.warning('请输入刻码!');
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (chooseType == 'choose') {
|
|
|
- dataList.forEach((item) => {
|
|
|
- this.List.forEach((it) => {
|
|
|
- it.semiProductList.forEach((fitem) => {
|
|
|
- if (fitem.extInfo.id == item.extInfo.id) {
|
|
|
- fitem.extInfo.engrave = item.extInfo.engrave;
|
|
|
- fitem.extInfo.confirm = item.extInfo.confirm;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- // for (let i = 0; i < this.List[0].semiProductList.length; i++) {
|
|
|
- // if (!this.List[0].semiProductList[i].extInfo.engrave) {
|
|
|
- // this.$message.warning('请输入刻码!');
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // }
|
|
|
- }
|
|
|
- // for (let i = 0; i < dataList.length; i++) {
|
|
|
- // if (!dataList[i].extInfo.engrave) {
|
|
|
- // this.$message.warning('请输入刻码!');
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // this.List[0].semiProductList = dataList;
|
|
|
-
|
|
|
- console.log('465646546', this.List);
|
|
|
-
|
|
|
- this.loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '加载中',
|
|
|
- background: 'rgba(0, 0, 0, 0.7)'
|
|
|
- });
|
|
|
-
|
|
|
- let arr = this.List.filter((L) => L.workReportInfo.executorTime);
|
|
|
- if (!arr.length) {
|
|
|
- this.loading.close();
|
|
|
- return this.$message.warning('请选择执行时间');
|
|
|
- }
|
|
|
-
|
|
|
- // if(this.taskObj.type !=6){
|
|
|
- // if(this.reportNeedFeed==1&&!(this.List[0].semiProductList.length>0||this.List[0].pickOutInList.length>0)){
|
|
|
- // this.loading.close();
|
|
|
- // return this.$message.warning('请先投料再报工');
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- let bol2;
|
|
|
- bol2 = this.List.every((e) => {
|
|
|
- return (
|
|
|
- // e.workReportInfo['formedNum'] && e.workReportInfo['formedNum'] != 0
|
|
|
- e.workReportInfo['formedNum'] != ''
|
|
|
- );
|
|
|
- });
|
|
|
-
|
|
|
- // if (!bol2) {
|
|
|
- // this.$message.warning('请输入合格品数量');
|
|
|
- // this.loading.close();
|
|
|
- // return false;
|
|
|
- // }
|
|
|
-
|
|
|
- // 预制体
|
|
|
-
|
|
|
- let wId;
|
|
|
- let bol = true;
|
|
|
- let _i;
|
|
|
- this.List.forEach((L) => {
|
|
|
- if (
|
|
|
- L.semiProductList.length > 0 &&
|
|
|
- this.taskObj.type != 4 &&
|
|
|
- L.singleReport == 1
|
|
|
- ) {
|
|
|
- bol = L.semiProductList.every((e, i) => {
|
|
|
- _i = i + 1;
|
|
|
- wId = L.code;
|
|
|
-
|
|
|
- if (this.taskObj.type == 6) {
|
|
|
- return (
|
|
|
- Object.prototype.hasOwnProperty.call(e.extInfo, 'taskId') &&
|
|
|
- e.extInfo.taskId
|
|
|
- );
|
|
|
- } else {
|
|
|
- if (e.extInfo.isQualified == 1 || e.extInfo.notType == 5) {
|
|
|
- return (
|
|
|
- Object.prototype.hasOwnProperty.call(e.extInfo, 'taskId') &&
|
|
|
- e.extInfo.taskId &&
|
|
|
- e.extInfo.reportWeight
|
|
|
- );
|
|
|
- } else {
|
|
|
- return (
|
|
|
- Object.prototype.hasOwnProperty.call(
|
|
|
- e.extInfo,
|
|
|
- 'notType'
|
|
|
- ) && e.extInfo.notType
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- // if (!bol) {
|
|
|
- // this.$message.warning(`请完善工单${wId}第${_i}处置方式`);
|
|
|
- // this.loading.close();
|
|
|
-
|
|
|
- // return false;
|
|
|
- // }
|
|
|
-
|
|
|
- if (this.clientEnvironmentId != 2) {
|
|
|
- let succ = this.List.some((L) => {
|
|
|
- return L.productRecycleList.length > 0;
|
|
|
- });
|
|
|
-
|
|
|
- if (succ) {
|
|
|
- const isRecycle = await this.checkRecycle();
|
|
|
- if (!isRecycle) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- console.log(this.item, '9999999999');
|
|
|
-
|
|
|
- return;
|
|
|
- if (
|
|
|
- this.taskObj.type == 4 &&
|
|
|
- this.clientEnvironmentId != 3 &&
|
|
|
- this.clientEnvironmentId != 2 &&
|
|
|
- this.List[0].singleReport !== 1
|
|
|
- ) {
|
|
|
- this.checkPack();
|
|
|
-
|
|
|
- // if (!isPack) {
|
|
|
- // return false
|
|
|
- // }
|
|
|
- }
|
|
|
- console.log('4444444444', this.List);
|
|
|
- if (this.taskObj.type == 1) {
|
|
|
- const isCache = await this.checkCache(type);
|
|
|
-
|
|
|
- if (!isCache) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (
|
|
|
- this.clientEnvironmentId == 3 &&
|
|
|
- type == 2 &&
|
|
|
- this.taskObj.type == 6
|
|
|
- ) {
|
|
|
- this.List.forEach((L) => {
|
|
|
- if (L.singleReport == 0) {
|
|
|
- L.semiProductList = [];
|
|
|
- }
|
|
|
- });
|
|
|
- console.log('ashsaoghaoghoasg');
|
|
|
- }
|
|
|
- let isSemiProduct = false;
|
|
|
- this.List.map((semi) => {
|
|
|
- if (
|
|
|
- semi.semiProductList.length == 0 &&
|
|
|
- semi.singleReport == 1 &&
|
|
|
- semi.currentTaskDiagram.isFirstTask == 1 &&
|
|
|
- this.clientEnvironmentId != 3
|
|
|
- ) {
|
|
|
- isSemiProduct = true;
|
|
|
- this.loading.close();
|
|
|
- setTimeout(() => {
|
|
|
- this.$message.warning({
|
|
|
- message: '请工单编号:' + semi.code + '先创建在制品',
|
|
|
- key: semi.code // 使用当前时间作为key,确保唯一性
|
|
|
- });
|
|
|
- }, 500);
|
|
|
- }
|
|
|
-
|
|
|
- if (semi.semiProductList.length == 0 && semi.singleReport == 0) {
|
|
|
- semi.semiProductList.map((ditem) => {
|
|
|
- if (ditem.extInfo.batchReportInfo) {
|
|
|
- ditem.extInfo.batchReportInfo.map((baItem) => {
|
|
|
- let idvalue = baItem.deviceId
|
|
|
- ? baItem.deviceId.split('/')
|
|
|
- : '';
|
|
|
- baItem.deviceId = idvalue ? idvalue[0] : '';
|
|
|
- });
|
|
|
- }
|
|
|
- if (ditem.extInfo.notBatchReportInfo) {
|
|
|
- ditem.extInfo.notBatchReportInfo.map((noItem) => {
|
|
|
- let idvalue = noItem.deviceId
|
|
|
- ? noItem.deviceId.split('/')
|
|
|
- : '';
|
|
|
- noItem.deviceId = idvalue ? idvalue[0] : '';
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- if (isSemiProduct) {
|
|
|
- this.loading.close();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- console.log(this.List, 'this.List');
|
|
|
- // this.loadingBtn = true;
|
|
|
- // jobSave(this.List)
|
|
|
- // .then((res) => {
|
|
|
- // this.loadingBtn = false;
|
|
|
- // this.loading.close();
|
|
|
- // this.$message.success('报工成功');
|
|
|
- // this.getList(this.idsList);
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // this.loadingBtn = false;
|
|
|
- // this.loading.close();
|
|
|
- // })
|
|
|
- // .finally(() => {
|
|
|
- // setTimeout(function () {
|
|
|
- // // this.loading.close();
|
|
|
- // }, 3000);
|
|
|
- // });
|
|
|
- },
|
|
|
-
|
|
|
checkRecycle() {
|
|
|
- this.loading.close();
|
|
|
+ // this.loading.close();
|
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
this.$confirm('是否跳过副产品回收处置!', '提示', {
|
|
|
@@ -1424,26 +1188,6 @@
|
|
|
resolve(false);
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
- // for (let i = 0; i < this.List.length; i++) {
|
|
|
- // for (let j = 0; j < this.List[i].productRecycleList.length; j++) {
|
|
|
- // if (!this.List[i].productRecycleList[j].warehouseId) {
|
|
|
- // return new Promise((resolve) => {
|
|
|
- // this.$confirm('是否跳过副产品回收处置!', '提示', {
|
|
|
- // confirmButtonText: '确定',
|
|
|
- // cancelButtonText: '取消',
|
|
|
- // type: 'warning'
|
|
|
- // })
|
|
|
- // .then(() => {
|
|
|
- // resolve(true);
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // resolve(false);
|
|
|
- // });
|
|
|
- // });
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
},
|
|
|
|
|
|
checkCache(type) {
|