chris 3 lat temu
rodzic
commit
c16bc07542
1 zmienionych plików z 23 dodań i 4 usunięć
  1. 23 4
      src/views/modules/warehouse/inventory-detail.vue

+ 23 - 4
src/views/modules/warehouse/inventory-detail.vue

@@ -122,6 +122,7 @@
           prop="inventoryState"
           header-align="center"
           align="center"
+          :formatter="formatState"
           label="盘库状态">
         </el-table-column>
         <el-table-column
@@ -186,19 +187,31 @@
             code: '1',
             value: '盘点中'
           }
+        ],
+        optionsState: [
+          {
+            code: '0',
+            value: '正常'
+          },
+          {
+            code: '-1',
+            value: '盘亏'
+          },
+          {
+            code: '1',
+            value: '盘盈'
+          }
         ]
       }
     },
     methods: {
       init (id, display) {
-        console.log('monitoring1')
         this.visible = true
         this.id = id || 0
         this.display = display
         this.dataForm = {}
         this.dataForm1 = {}
         // 获取详情
-        console.log('monitoring2')
         this.queryData()
       },
       // 查询
@@ -208,7 +221,6 @@
       },
       // 获取数据列表
       getDataList () {
-        console.log('monitoring3')
         this.dataListLoading = true
         let params = {
           'current': this.pageIndex,
@@ -364,10 +376,17 @@
       formatMs (row) {
         for (let i = 0; i < this.optionsMs.length; i++) {
           if (this.optionsMs[i].code === row.materialState) {
-            this.getDataList()
             return this.optionsMs[i].value
           }
         }
+      },
+      // 盘库状态转换
+      formatState (row) {
+        for (let i = 0; i < this.optionsState.length; i++) {
+          if (this.optionsState[i].code === row.inventoryState) {
+            return this.optionsState[i].value
+          }
+        }
       }
     }
   }