695593266@qq.com vor 2 Monaten
Ursprung
Commit
ed10f6b493

+ 1 - 1
src/views/materialReturn/components/pickList.vue

@@ -45,7 +45,7 @@
 
       save() {
         this.$emit('emitSave', this.pickIds);
-      },
+      }
     }
   };
 </script>

+ 2 - 1
src/views/materialReturn/components/returnPop.vue

@@ -104,7 +104,8 @@
             </el-table-column>
 
             <el-table-column label="编码" prop="code"> </el-table-column>
-
+            <el-table-column label="物品编码" prop="categoryCode">
+            </el-table-column>
             <el-table-column label="名称" prop="name"> </el-table-column>
             <el-table-column label="型号" prop="modelType"> </el-table-column>
             <el-table-column label="规格" prop="specification">

+ 7 - 0
src/views/pick/pickApply/components/selfDetailed.vue

@@ -298,6 +298,13 @@
               align: 'center',
               showOverflowTooltip: true
             },
+            {
+              width: 150,
+              prop: 'warehouseName',
+              label: '仓库',
+              align: 'center',
+              showOverflowTooltip: true
+            },
             {
               width: 150,
               prop: 'supplierName',

+ 2 - 1
src/views/pick/pickApply/index.vue

@@ -219,7 +219,8 @@
     methods: {
       /* 表格数据源 */
       async datasource({ page, limit, where }) {
-        let URL = this.isReturn ? returnPage : getAllPage;
+        // let URL = this.isReturn ? returnPage : getAllPage;
+        let URL = getAllPage;
 
         let parma = {
           ...where,

+ 7 - 0
src/views/produce/components/picking/detailed.vue

@@ -402,6 +402,13 @@
               align: 'center',
               showOverflowTooltip: true
             },
+            {
+              width: 150,
+              prop: 'warehouseName',
+              label: '仓库',
+              align: 'center',
+              showOverflowTooltip: true
+            },
             {
               width: 150,
               prop: 'supplierName',

+ 43 - 49
src/views/produceOrder/index.vue

@@ -937,7 +937,7 @@
     },
     created() {
       const isWt = this.$route.query?.isWt;
-      
+
       if (isWt) {
         this.tabValue = '1';
         this.$nextTick(() => {
@@ -945,11 +945,11 @@
           const way = this.$route.query?.way;
           console.log(item);
           if (way == 'todo') {
-            this.handleOrderPublish(item)
+            this.handleOrderPublish(item);
           } else {
-            this.goDetail(item)
+            this.goDetail(item);
           }
-        })
+        });
       }
       this.getFieldModel();
       this.getPlanDotLine();
@@ -1038,44 +1038,47 @@
       },
 
       async loadTaskNames(list) {
-        for (const row of list) {
-          try {
-            const res = await getTaskInstanceList(row.id);
-            const findIndex = res.findIndex(
-              (item) => item.taskId == row.taskId
-            );
-
-            const markedList = res.map((item, index) => {
-              let flag = 'after';
-
-              if (findIndex != -1) {
-                if (index < findIndex) {
-                  flag = '4';
-                } else if (index === findIndex) {
-                  flag = '3';
-                } else {
-                  flag = '1';
-                }
-              }
-
-              return {
-                ...item,
-                flag
-              };
-            });
-
-            this.$set(this.taskNameMap, row.id, markedList);
+        const results = await Promise.all(
+          list.map((row) =>
+            getTaskInstanceList(row.id)
+              .then((res) => {
+                const findIndex = res.findIndex(
+                  (item) => item.taskId == row.taskId
+                );
+
+                const markedList = res.map((item, index) => {
+                  let flag = 'after';
+
+                  if (findIndex != -1) {
+                    if (index < findIndex) {
+                      flag = '4';
+                    } else if (index === findIndex) {
+                      flag = '3';
+                    } else {
+                      flag = '1';
+                    }
+                  }
+
+                  return {
+                    ...item,
+                    flag
+                  };
+                });
+
+                return { id: row.id, data: markedList };
+              })
+              .catch(() => {
+                return { id: row.id, data: [] };
+              })
+          )
+        );
 
-            // this.$set(
-            //   this.taskNameMap,
-            //   row.taskId,
-            //   res.list.map((i) => i.name)
-            // );
-            // console.log(res, '工序数据');
-          } catch (e) {
-            this.$set(this.taskNameMap, row.id, []);
-          }
+        // 一次性替换整个 map,只触发一次响应式更新,避免界面抖动
+        const newMap = { ...this.taskNameMap };
+        for (const { id, data } of results) {
+          newMap[id] = data;
         }
+        this.taskNameMap = newMap;
 
         this.$nextTick(() => {
           this.$refs.table?.doLayout?.();
@@ -1107,7 +1110,6 @@
 
       /* 表格数据源 */
       async datasource({ page, limit, where, order }) {
-        console.log(this.tabValue, '888');
         let statusList = this.tabValue == 1 ? [4, 5, 7] : [this.tabValue];
 
         let params = {
@@ -1129,14 +1131,6 @@
         let res = await URL({ ...params, statusList });
 
         this.loadTaskNames(res.list);
-        // let res = await URL({ ...params, statusList });
-
-        // await Promise.all(
-        //   res.list.map(async (row) => {
-        //     const tasks = await getTaskInstanceList(row.id);
-        //     row._taskList = tasks;
-        //   })
-        // );
 
         return res;
       },