From 624dbdf2b7e3dc1bbcb9d6ebe8fd9d2ab36e214a Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期三, 15 十一月 2023 18:40:28 +0800
Subject: [PATCH] 重订货规则列表-产品调整

---
 src/views/productManage/reorderRules/index.vue |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/src/views/productManage/reorderRules/index.vue b/src/views/productManage/reorderRules/index.vue
index 9384663..cbf2af2 100644
--- a/src/views/productManage/reorderRules/index.vue
+++ b/src/views/productManage/reorderRules/index.vue
@@ -7,9 +7,11 @@
         :show-apply="false"
         :placeholder="'璇疯緭鍏ヤ綅缃�/浜у搧'"
         :amount-view="false"
+        :search-task-map="searchTaskMap"
         @addCommonClick="addProductClick"
         @searchClick="getList"
         @discardBtnClick="discardBtnClick"
+        @delSelectClick="delSelectClick"
       />
     </div>
     <div class="list-view">
@@ -76,11 +78,21 @@
       maxInventory: 0,
       orderNumber: 0,
       unit: "",
-      reorderId: 0
+      reorderId: 0,
+      queryProductId: null,
+      searchTaskMap: []
     }
   },
   created() {
     this.setTable()
+    let query = this.$route.query
+    if (query) {
+      this.queryProductId = query.productId?.length ? query.productId : null
+      this.pagerOptions.currPage = 1
+      this.searchTaskMap =
+        query.productId?.length > 0 ? [{ productId: this.queryProductId, title: query.productName }] : []
+      console.log(this.searchTaskMap)
+    }
     this.getData()
   },
   methods: {
@@ -90,7 +102,7 @@
         selectBox: false,
         selectIndex: true,
         tableColumn: [
-          { label: "浜у搧", prop: "productName", product: true },
+          { label: "浜у搧", prop: "productName", product: true,width:"150px" },
           { label: "浣嶇疆", prop: "locationName", defaultLocation: true },
           { label: "鍦ㄥ簱鏁伴噺", prop: "amount" },
           { label: "棰勬祴鏁伴噺", prop: "prediction" },
@@ -105,6 +117,7 @@
     // 璇锋眰鏁版嵁
     async getData() {
       await getReorderRuleList({
+        productId: this.queryProductId ? this.queryProductId : null,
         page: this.pagerOptions.currPage,
         pageSize: this.pagerOptions.pageSize
       }).then((res) => {
@@ -121,7 +134,7 @@
             }
             return {
               ...item,
-              productName: item.product.name,
+              productName:item.product.name,
               locationName: item.location.name,
               isSet: false,
               isEdit: true,
@@ -280,7 +293,7 @@
         this.tableData.map((item, index) => {
           if (index === rowIndex) {
             item.isEdit = false
-            item.editable = true
+            item.editable = false
             item.isOrder = true
           } else {
             item.isEdit = true
@@ -319,6 +332,11 @@
     // 鑾峰彇褰撳墠鏃堕棿
     currentTime() {
       return currentTime()
+    },
+    // 鍒犻櫎浜у搧
+    delSelectClick() {
+      this.queryProductId = ""
+      this.getData()
     }
   }
 }

--
Gitblit v1.8.0