Procházet zdrojové kódy

fix(warehouseApplication): 调整申请详情表格库存数量列

- 移除未使用的 mathjs 导入
- 将 columns 改为计算属性并按详情模式过滤列
- 新增可用数量、锁定数量列并移除原库存数量字段
yusheng před 5 dny
rodič
revize
8ae93eac63

+ 44 - 23
src/views/warehouseManagement/warehouseApplication/components/edit.vue

@@ -112,7 +112,6 @@
 <script>
   import storageApi from '@/api/warehouseManagement';
   import { getCode } from '@/api/codeManagement/index.js';
-  import { re } from 'mathjs';
   export default {
     props: {},
     data() {
@@ -124,7 +123,29 @@
           sourceType: '',
           remark: ''
         },
-        columns: [
+
+        rules: {
+          sourceType: [
+            { required: true, message: '请选择申请类型', trigger: 'change' }
+          ]
+        },
+        loading: false,
+        selectionList: [],
+        ids: [],
+        detailJnVOList: []
+      };
+    },
+    computed: {
+      readonlyMode() {
+        return this.title === '详情';
+      },
+      tableColumns() {
+        return this.title === '详情'
+          ? this.columns.filter((c) => c.type !== 'selection')
+          : this.columns;
+      },
+      columns() {
+        return [
           {
             columnKey: 'selection',
             type: 'selection',
@@ -208,9 +229,28 @@
             width: 160
           },
           {
-            prop: 'originalMeasureQuantity',
+            prop: 'stockCountBase',
             label: '库存数量',
             sortable: 'custom',
+            isNone: this.title == '详情',
+            showOverflowTooltip: true,
+            width: 130,
+            align: 'center'
+          },
+          {
+            prop: 'availableCountBase',
+            isNone: this.title == '详情',
+            label: '可用数量',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            width: 130,
+            align: 'center'
+          },
+          {
+            prop: 'lockQuantity',
+            isNone: this.title == '详情',
+            label: '锁定数量',
+            sortable: 'custom',
             showOverflowTooltip: true,
             width: 130,
             align: 'center'
@@ -246,26 +286,7 @@
             showOverflowTooltip: true,
             width: 130
           }
-        ],
-        rules: {
-          sourceType: [
-            { required: true, message: '请选择申请类型', trigger: 'change' }
-          ]
-        },
-        loading: false,
-        selectionList: [],
-        ids: [],
-        detailJnVOList: []
-      };
-    },
-    computed: {
-      readonlyMode() {
-        return this.title === '详情';
-      },
-      tableColumns() {
-        return this.title === '详情'
-          ? this.columns.filter((c) => c.type !== 'selection')
-          : this.columns;
+        ].filter((c) => !c.isNone);
       }
     },