From 1b8daa902b075c7cedee7bbcc13b914b7a5b4ad4 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期一, 03 十一月 2025 11:48:49 +0800
Subject: [PATCH] 优化盘点逻辑

---
 新建文件夹/WMS/src/views/stock/Dt_Inventory_Batch.vue |  138 +++++++++++++++++++---------------------------
 1 files changed, 57 insertions(+), 81 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/stock/Dt_Inventory_Batch.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/stock/Dt_Inventory_Batch.vue"
index a3a84a3..ed656f8 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/stock/Dt_Inventory_Batch.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/stock/Dt_Inventory_Batch.vue"
@@ -1,7 +1,15 @@
 <template>
-  <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
-    :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
-    :table="table" :extend="extend">
+  <view-grid
+    ref="grid"
+    :columns="columns"
+    :detail="detail"
+    :editFormFields="editFormFields"
+    :editFormOptions="editFormOptions"
+    :searchFormFields="searchFormFields"
+    :searchFormOptions="searchFormOptions"
+    :table="table"
+    :extend="extend"
+  >
   </view-grid>
 </template>
 <script>
@@ -30,6 +38,7 @@
       productionDate: "",
       validityPeriod: "",
       remark: "",
+      availableQuantity: "",
     });
     const editFormOptions = ref([
       [
@@ -39,18 +48,14 @@
           field: "materielCode",
           type: "string",
         },
+      ],
+      [
         {
           title: "鐗╂枡鍚嶇О",
           required: true,
           field: "materielName",
           type: "string",
         },
-        {
-          title: "鐗╂枡瑙勬牸",
-          required: true,
-          field: "materielSpec",
-          type: "string",
-        }
       ],
       [
         {
@@ -59,61 +64,15 @@
           field: "batchNo",
           type: "string",
         },
+      ],
+      [
         {
-          title: "搴撳瓨鏁�",
+          title: "璋冩嫧鏁伴噺",
           required: true,
           field: "stockQuantity",
           type: "number",
         },
-        {
-          title: "鍑哄簱鏁�",
-          required: true,
-          field: "outboundQuantity",
-          type: "number",
-        }
       ],
-      [
-        {
-          title: "鐩樼偣鏁�",
-          required: true,
-          field: "supplyQuantity",
-          type: "number",
-        },
-        {
-          title: "ERP瀹為檯搴撳瓨鏁�",
-          required: true,
-          field: "erpStockQuantity",
-          type: "number",
-        },
-        {
-          title: "搴撳瓨宸紓",
-          field: "status",
-          type: "select",
-          bind: { key: "stockDifference", data: [] }
-        }
-      ],
-      [
-        {
-          title: "鐢熶骇鏃ユ湡",
-          field: "productionDate",
-          type: "date",
-          span: 12
-        },
-        {
-          title: "鏈夋晥鏈熻嚦",
-          field: "validityPeriod",
-          type: "date",
-          span: 12
-        }
-      ],
-      [
-        {
-          title: "澶囨敞",
-          field: "remark",
-          type: "string",
-          span: 24
-        }
-      ]
     ]);
     const searchFormFields = ref({
       materielCode: "",
@@ -122,9 +81,9 @@
     });
     const searchFormOptions = ref([
       [
-        { title: "鐗╂枡缂栧彿", field: "materielCode" },
-        { title: "鐗╂枡鍚嶇О", field: "materielName" },
-        { title: "鎵规鍙�", field: "batchNo" },
+        { title: "鐗╂枡缂栧彿", field: "materielCode", type: "like" },
+        { title: "鐗╂枡鍚嶇О", field: "materielName", type: "like" },
+        { title: "鎵规鍙�", field: "batchNo", type: "like" },
       ],
     ]);
     const columns = ref([
@@ -175,17 +134,34 @@
       },
       {
         field: "outboundQuantity",
-        title: "鍑哄簱鏁�",
+        title: "寰呭嚭搴撴暟鏁伴噺",
         type: "number",
         width: 100,
         align: "left",
       },
       {
         field: "supplyQuantity",
-        title: "鐩樼偣鏁�",
+        title: "鐩樼偣宸紓鏁�",
         type: "number",
         width: 100,
         align: "left",
+        cellStyle: (row) => {
+          const value = row.supplyQuantity;
+          if (value > 0) {
+            return { color: "#00ff00" }; // 缁胯壊
+          } else if (value < 0) {
+            return { color: "#ff0000" }; // 绾㈣壊
+          }
+          // else {
+          //   return { color: '#000000' }; // 榛戣壊
+          // }
+        },
+      },
+      {
+        title: "鍙敤搴撳瓨鏁�",
+        required: true,
+        field: "availableQuantity",
+        type: "number",
       },
       {
         field: "erpStockQuantity",
@@ -194,21 +170,21 @@
         width: 120,
         align: "left",
       },
-      {
-        field: "status",
-        title: "搴撳瓨宸紓",
-        type: "select",
-        width: 100,
-        align: "left",
-        bind: { key: "stockDifference", data: [] },
-      },
-      {
-        field: "productionDate",
-        title: "鐢熶骇鏃ユ湡",
-        type: "date",
-        width: 120,
-        align: "left",
-      },
+      // {
+      //   field: "status",
+      //   title: "搴撳瓨宸紓",
+      //   type: "select",
+      //   width: 100,
+      //   align: "left",
+      //   bind: { key: "stockDifference", data: [] },
+      // },
+      // {
+      //   field: "productionDate",
+      //   title: "鐢熶骇鏃ユ湡",
+      //   type: "date",
+      //   width: 120,
+      //   align: "left",
+      // },
       {
         field: "validityPeriod",
         title: "鏈夋晥鏈熻嚦",
@@ -236,7 +212,7 @@
         type: "string",
         width: 100,
         align: "left",
-        hidden: true
+        hidden: true,
       },
       {
         field: "modifyDate",
@@ -244,7 +220,7 @@
         type: "datetime",
         width: 160,
         align: "left",
-        hidden: true
+        hidden: true,
       },
       {
         field: "remark",
@@ -252,7 +228,7 @@
         type: "string",
         width: 100,
         align: "left",
-        hidden: true
+        hidden: true,
       },
     ]);
     const detail = ref({

--
Gitblit v1.9.3