From c13c2bb15b501c74fe4270b0ae763e5c9422ee39 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 19 十一月 2025 10:02:52 +0800
Subject: [PATCH] fix: 重构绞线报工功能

---
 src/pages/production/index.vue |   40 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/src/pages/production/index.vue b/src/pages/production/index.vue
index 017062f..1fbe803 100644
--- a/src/pages/production/index.vue
+++ b/src/pages/production/index.vue
@@ -2,7 +2,14 @@
   <view>
     <wd-row>
       <wd-col :span="21">
-        <wd-search placeholder-left hide-cancel></wd-search>
+        <wd-search
+          v-model="searchKeyword"
+          placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�"
+          placeholder-left
+          hide-cancel
+          @search="handleSearch"
+          @clear="handleClear"
+        ></wd-search>
       </wd-col>
       <wd-col :span="3">
         <view class="scan_box" @click="openScan">
@@ -14,16 +21,30 @@
       <wd-tab :title="`寰呯敓浜�(${total.wait})`" class="tab_bg">
         <ProductList
           ref="waitRef"
+          :key="`wait-${searchKey}`"
           :api="ManageApi.getProductList"
           state="寰呭畬鎴�"
+          :model="searchKeyword"
           @ok="changeWait"
+        />
+      </wd-tab>
+      <wd-tab :title="`閮ㄥ垎瀹屾垚(${total.partial})`" class="tab_bg">
+        <ProductList
+          ref="partialRef"
+          :key="`partial-${searchKey}`"
+          :api="ManageApi.getProductList"
+          state="閮ㄥ垎瀹屾垚"
+          :model="searchKeyword"
+          @ok="changePartial"
         />
       </wd-tab>
       <wd-tab :title="`宸茬敓浜�(${total.already})`" class="tab_bg">
         <ProductList
           ref="alreadyRef"
+          :key="`already-${searchKey}`"
           :api="ManageApi.getProductList"
           state="宸插畬鎴�"
+          :model="searchKeyword"
           @ok="changeAlready"
         />
       </wd-tab>
@@ -48,10 +69,14 @@
 const toast = useToast();
 
 const waitRef = ref();
+const partialRef = ref();
 const alreadyRef = ref();
 const tab = ref<number>(0);
+const searchKeyword = ref("");
+const searchKey = ref(0);
 const total = reactive({
   wait: 0,
+  partial: 0,
   already: 0,
 });
 
@@ -59,10 +84,23 @@
   total.wait = num;
 };
 
+const changePartial = (num: number) => {
+  total.partial = num;
+};
+
 const changeAlready = (num: number) => {
   total.already = num;
 };
 
+const handleSearch = () => {
+  searchKey.value++;
+};
+
+const handleClear = () => {
+  searchKeyword.value = "";
+  handleSearch();
+};
+
 const openScan = () => {
   scanRef.value.triggerScan();
 };

--
Gitblit v1.9.3