From 6c2941eb055879adf2b3ecb981c26b9612e149ed Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期二, 09 十二月 2025 19:36:58 +0800
Subject: [PATCH] 前端优化

---
 项目代码/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue |  150 ++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 132 insertions(+), 18 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue"
index 2c950a6..5afa986 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue"
@@ -38,6 +38,53 @@
           </el-row>
         </el-alert>
       </div>
+
+      <!-- 鏂板绛涢�夊尯鍩� -->
+      <div class="filter-area" style="margin: 10px 0; padding: 10px; background: #f8f9fa; border-radius: 4px;">
+        <el-form :model="filterForm" inline @submit.prevent>
+          <el-form-item label="鐗╂枡缂栧彿锛�">
+            <el-input
+              v-model="filterForm.materielCode"
+              placeholder="妯$硦绛涢�夌墿鏂欑紪鍙�"
+              clearable
+              style="width: 180px"
+              @input="filterTable"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="鐗╂枡鏉$爜锛�">
+            <el-input
+              v-model="filterForm.barcode"
+              placeholder="妯$硦绛涢�夌墿鏂欐潯鐮�"
+              clearable
+              style="width: 180px"
+              @input="filterTable"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="鎵樼洏缂栧彿锛�">
+            <el-input
+              v-model="filterForm.palletCode"
+              placeholder="妯$硦绛涢�夋墭鐩樼紪鍙�"
+              clearable
+              style="width: 180px"
+              @input="filterTable"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="璐т綅缂栧彿锛�">
+            <el-input
+              v-model="filterForm.locationCode"
+              placeholder="妯$硦绛涢�夎揣浣嶇紪鍙�"
+              clearable
+              style="width: 180px"
+              @input="filterTable"
+            ></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" @click="filterTable">鎼滅储</el-button>
+            <el-button @click="resetFilter">閲嶇疆</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+
       <div class="box-table" style="margin-top: 1%">
         <el-table
           ref="singleTable"
@@ -134,6 +181,7 @@
       row: null,
       showDetialBox: false, 
       tableData: [],
+      originalTableData: [], // 鏂板锛氬瓨鍌ㄥ師濮嬫暟鎹紝鐢ㄤ簬绛涢��
       tableColumns: [
         { prop: "materielCode", title: "鐗╂枡缂栧彿", type: "string", width: 150 },
         { prop: "barcode", title: "鐗╂枡鏉$爜", type: "string", width: 150 },
@@ -145,6 +193,14 @@
       selectionSum: 0,
       selectionClass: "less-style",
       originalQuantity: 0,
+
+      // 鏂板锛氱瓫閫夎〃鍗曟暟鎹�
+      filterForm: {
+        materielCode: "",
+        barcode: "",
+        palletCode: "",
+        locationCode: ""
+      },
 
       // 鍑哄簱寮圭獥鐩稿叧鏁版嵁
       showOutboundDialog: false,
@@ -201,23 +257,22 @@
       this.$refs.outboundFormRef.validate((valid) => {
         if (!valid) return;
 
-
-     if (this.selection.length <= 0) {
-        return this.$message.error("璇峰嬀閫�");
-      }
-      let url = this.pkcx
-        ? "api/Task/GenerateOutboundTask?orderDetailId="
-        : "api/Task/GenerateOutboundTask?orderDetailId=";
-      this.http
-        .post(url + this.row.id+"&station="+this.outboundForm.selectedPlatform, this.selection, "鏁版嵁澶勭悊涓�")
-        .then((x) => {
-          if (!x.status) return this.$message.error(x.message);
-          this.$message.success("鎿嶄綔鎴愬姛");
-          this.showDetialBox = false;
-          this.$emit("parentCall", ($vue) => {
-            $vue.getData();
+        if (this.selection.length <= 0) {
+          return this.$message.error("璇峰嬀閫�");
+        }
+        let url = this.pkcx
+          ? "api/Task/GenerateOutboundTask?orderDetailId="
+          : "api/Task/GenerateOutboundTask?orderDetailId=";
+        this.http
+          .post(url + this.row.id+"&station="+this.outboundForm.selectedPlatform, this.selection, "鏁版嵁澶勭悊涓�")
+          .then((x) => {
+            if (!x.status) return this.$message.error(x.message);
+            this.$message.success("鎿嶄綔鎴愬姛");
+            this.showDetialBox = false;
+            this.$emit("parentCall", ($vue) => {
+              $vue.getData();
+            });
           });
-        });
 
       });
     },
@@ -233,11 +288,14 @@
         )
         .then((x) => {
           this.tableData = x;
+          this.originalTableData = x; // 鏂板锛氫繚瀛樺師濮嬫暟鎹�
           // 鍒锋柊鍚庢竻绌轰箣鍓嶇殑閫夋嫨鍜岃鏁�
           this.clearSelection();
           this.selectionSum = 0;
           this.originalQuantity = 0;
           this.updateSelectionClass();
+          // 鍒锋柊鍚庨噸缃瓫閫夋潯浠�
+          this.resetFilter();
         });
     },
 
@@ -271,9 +329,10 @@
     // 鏇存柊宸查�夋暟閲忔牱寮�
     updateSelectionClass() {
       if (!this.row) return;
-      if (this.selectionSum === this.row.orderQuantity) {
+      // 淇锛歳ow.orderQuantity 鏀逛负 row.qty锛堟ā鏉块噷鏄剧ず鐨勬槸row.qty锛�
+      if (this.selectionSum === this.row.qty) {
         this.selectionClass = "equle-style";
-      } else if (this.selectionSum < this.row.orderQuantity) {
+      } else if (this.selectionSum < this.row.qty) {
         this.selectionClass = "less-style";
       } else {
         this.selectionClass = "more-style";
@@ -298,6 +357,55 @@
     tableButtonClick(row, item) {
       console.log("鍥炬爣鎸夐挳鐐瑰嚮锛�", item.title, row);
     },
+
+    // 鏂板锛氱瓫閫夎〃鏍兼暟鎹�
+    filterTable() {
+      if (!this.originalTableData.length) return;
+      
+      // 瑙f瀯绛涢�夋潯浠跺苟杞负灏忓啓锛堝拷鐣ュぇ灏忓啓锛�
+      const { materielCode, barcode, palletCode, locationCode } = this.filterForm;
+      const mc = materielCode.toLowerCase().trim();
+      const bc = barcode.toLowerCase().trim();
+      const pc = palletCode.toLowerCase().trim();
+      const lc = locationCode.toLowerCase().trim();
+
+      // 妯$硦绛涢�夐�昏緫
+      this.tableData = this.originalTableData.filter(item => {
+        // 姣忎釜瀛楁閮藉仛绌哄�煎鐞嗗拰灏忓啓杞崲锛屾敮鎸佹ā绯婂尮閰�
+        const itemMc = (item.materielCode || "").toLowerCase();
+        const itemBc = (item.barcode || "").toLowerCase();
+        const itemPc = (item.palletCode || "").toLowerCase();
+        const itemLc = (item.locationCode || "").toLowerCase();
+
+        return (
+          itemMc.includes(mc) &&
+          itemBc.includes(bc) &&
+          itemPc.includes(pc) &&
+          itemLc.includes(lc)
+        );
+      });
+
+      // 绛涢�夊悗娓呯┖閫夋嫨鐘舵��
+      this.clearSelection();
+      this.selectionSum = 0;
+      this.updateSelectionClass();
+    },
+
+    // 鏂板锛氶噸缃瓫閫夋潯浠�
+    resetFilter() {
+      this.filterForm = {
+        materielCode: "",
+        barcode: "",
+        palletCode: "",
+        locationCode: ""
+      };
+      // 鎭㈠鍘熷鏁版嵁
+      this.tableData = [...this.originalTableData];
+      // 閲嶇疆閫夋嫨鐘舵��
+      this.clearSelection();
+      this.selectionSum = 0;
+      this.updateSelectionClass();
+    }
   },
 };
 </script>
@@ -314,6 +422,12 @@
 .more-style {
   color: red;
 }
+
+/* 绛涢�夊尯鍩熸牱寮忎紭鍖� */
+.filter-area :deep(.el-form-item) {
+  margin-bottom: 0;
+  margin-right: 10px;
+}
 </style>
 
 <style>

--
Gitblit v1.9.3