Parcourir la source

Merge branch 'dev' into test

xieyong il y a 1 mois
Parent
commit
a0195dcf9f

+ 14 - 0
src/views/produce/components/feeding/components/batchProductsBom.vue

@@ -214,6 +214,20 @@
       }
     },
 
+    watch: {
+      selection: {
+        handler(newSelection) {
+          this.list.forEach((item) => {
+            if (newSelection.includes(item)) {
+              this.$set(item, 'confirm', 1);
+            } else {
+              this.$set(item, 'confirm', 0);
+            }
+          });
+        }
+      }
+    },
+
     computed: {
       columns() {
         let action = {};

+ 2 - 2
src/views/produce/components/feeding/details.vue

@@ -33,7 +33,7 @@
           </div>
         </div>
 
-        <div v-for="(it, idx) in item.orderInfoList" :key="idx">
+        <div v-for="(it, idx) in item.orderInfoList" :key="it.taskId">
           <workOrderBom
             :item="it"
             :isDetails="true"
@@ -235,7 +235,7 @@
           taskId: taskId
         };
         const res = await feedByOrderIds(param);
-        console.log(res);
+        console.log('feedByOrderIds',res);
         this.dataList = JSON.parse(JSON.stringify(res));
         console.log(this.dataList);
       }

+ 29 - 11
src/views/produce/components/feeding/index.vue

@@ -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
+        let 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) filterList = this.List;
         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('投料成功');

+ 18 - 16
src/views/produceOrder/workReport.vue

@@ -87,6 +87,7 @@
                     v-for="row in col.items"
                     :key="row.flatIndex"
                     class="route-node-row"
+                    :class="{ 'is-parallel': row.item.isParallel == 1 }"
                     :style="{ height: stepNodeH + 'px' }"
                   >
                     <div
@@ -101,7 +102,12 @@
                       @click="handIdx(row.flatIndex, row.item)"
                     >
                       <div class="route-node-name">
-                        {{ row.item.taskTypeName }}
+                        {{ row.item.taskTypeName
+                        }}<span
+                          v-if="row.flatIndex === desIndex"
+                          class="route-node-tag"
+                          >此处</span
+                        >
                       </div>
                       <div
                         v-if="showTaskTeamName(row.item)"
@@ -110,10 +116,6 @@
                         {{ getTaskTeamName(row.item) }}
                       </div>
                     </div>
-                    <span
-                      v-if="row.flatIndex === desIndex"
-                      class="route-node-tag"
-                    >此处</span>
                   </div>
                 </div>
               </div>
@@ -1915,7 +1917,6 @@
   }
 
   .route-node-row {
-    position: relative;
     display: flex;
     align-items: center;
     justify-content: center;
@@ -1923,6 +1924,14 @@
     box-sizing: border-box;
   }
 
+  .route-node-row.is-parallel {
+    margin-bottom: 2px;
+  }
+
+  .route-node-row.is-parallel:last-child {
+    margin-bottom: 0;
+  }
+
   .route-node {
     display: flex;
     flex-direction: column;
@@ -1990,10 +1999,6 @@
       font-size: 10px;
     }
 
-    // 并行节点激活时不显示"此处"标签,避免撑高
-    .route-node-tag {
-      display: none;
-    }
   }
 
   .route-node-name {
@@ -2015,18 +2020,15 @@
   }
 
   .route-node-tag {
-    position: absolute;
-    top: 100%;
-    left: 50%;
-    transform: translateX(-50%);
-    margin-top: 6px;
+    display: inline-block;
+    margin-left: 4px;
     padding: 0 6px;
     font-size: 11px;
     line-height: 16px;
     color: #ffffff;
     background: #1890ff;
     border-radius: 8px;
-    white-space: nowrap;
+    vertical-align: middle;
   }
 
   ::v-deep .el-tabs__content {