|
|
@@ -996,28 +996,46 @@
|
|
|
if (!isCache) {
|
|
|
return false;
|
|
|
}
|
|
|
- this.loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '加载中',
|
|
|
- background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+
|
|
|
+ // 不修改 this.List,新建一个 filterList,内部 product 只保留 confirm === 1
|
|
|
+ const filterList = this.List.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ product: Array.isArray(item.product)
|
|
|
+ ? item.product.filter((p) => p.confirm === 1)
|
|
|
+ : item.product
|
|
|
+ };
|
|
|
+ }).filter((item) => {
|
|
|
+ return Array.isArray(item.product) && item.product.length > 0;
|
|
|
});
|
|
|
|
|
|
+ if(!filterList.length) return;
|
|
|
let newList = [];
|
|
|
- for (let item of this.List) {
|
|
|
+
|
|
|
+ for (let item of filterList) {
|
|
|
newList.push({
|
|
|
currentTaskDiagram: item.currentTaskDiagram,
|
|
|
workOrderId: item.workOrderId
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ console.log("newList",newList);
|
|
|
+
|
|
|
+ this.loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
await checkRepeatFeed(newList).then((res) => {
|
|
|
if (res.data.length != 0) {
|
|
|
- this.checkFeed(res.data);
|
|
|
+ this.checkFeed(res.data, filterList);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- checkFeed(list) {
|
|
|
+ checkFeed(list, filterList) {
|
|
|
let wordCodeList = [];
|
|
|
for (let item of list) {
|
|
|
if (item.feedFormed != '0') {
|
|
|
@@ -1037,18 +1055,18 @@
|
|
|
}
|
|
|
)
|
|
|
.then(() => {
|
|
|
- this.feedReport();
|
|
|
+ this.feedReport(filterList);
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.loading.close();
|
|
|
});
|
|
|
} else {
|
|
|
- this.feedReport();
|
|
|
+ this.feedReport(filterList);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- feedReport() {
|
|
|
- batchSave(this.List)
|
|
|
+ feedReport(filterList) {
|
|
|
+ batchSave(filterList)
|
|
|
.then((res) => {
|
|
|
this.loading.close();
|
|
|
this.$message.success('投料成功');
|