ysy 1 rok temu
rodzic
commit
ff14b86837

+ 20 - 4
src/views/materialReturn/index.vue

@@ -10,6 +10,8 @@
         :datasource="datasource"
         row-key="id"
         cache-key="returnKey"
+        autoAmendPage
+        :parse-data="parseData"
         :selection.sync="selection"
       >
         <template v-slot:toolbar>
@@ -59,7 +61,7 @@
         selection: [],
 
         returnShow: false,
-        returnDetailsId: null ,
+        returnDetailsId: null,
 
         sceneList: []
       };
@@ -132,7 +134,7 @@
       },
 
       handleReturn() {
-        this.returnDetailsId = null
+        this.returnDetailsId = null;
         this.returnShow = true;
       },
 
@@ -145,8 +147,8 @@
       },
 
       handDetailed(row) {
-        this.returnDetailsId = row.id
-        this.returnShow = true
+        this.returnDetailsId = row.id;
+        this.returnShow = true;
       },
 
       getByCodeFn() {
@@ -174,6 +176,20 @@
       /* 刷新表格 */
       reload(where = {}) {
         this.$refs.table.reload({ page: 1, where });
+      },
+
+      /* 数据转为树形结构 */
+      parseData(data) {
+        return {
+          ...data,
+          list: this.$util.toTreeData({
+            data: data.list,
+            count: data.total,
+
+            idField: 'id',
+            parentIdField: 'parentId'
+          })
+        };
       }
     }
   };

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

@@ -131,8 +131,7 @@
             prop: 'code',
             label: '领料单编号',
             align: 'center',
-            align: 'left',
-             
+            align: 'left'
           },
 
           {