From 051145654d6b1b5556c70f91ca29384a35aa5f7d Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期四, 16 十一月 2023 13:46:38 +0800
Subject: [PATCH] 公共组件选择产品改为下拉可搜索框、库存调整、补货、上架规则、重订货规则修改

---
 src/views/productManage/reorderRules/index.vue |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/src/views/productManage/reorderRules/index.vue b/src/views/productManage/reorderRules/index.vue
index 9a66f15..fad6b56 100644
--- a/src/views/productManage/reorderRules/index.vue
+++ b/src/views/productManage/reorderRules/index.vue
@@ -81,7 +81,7 @@
       reorderId: 0,
       queryProductId: null,
       searchTaskMap: [],
-      currentRowId:-1
+      currentRowId: -1
     }
   },
   created() {
@@ -103,7 +103,7 @@
         selectBox: false,
         selectIndex: true,
         tableColumn: [
-          { label: "浜у搧", prop: "productName", product: true,width:"150px" },
+          { label: "浜у搧", prop: "productName", product: true, width: "150px" },
           { label: "浣嶇疆", prop: "locationName", defaultLocation: true },
           { label: "鍦ㄥ簱鏁伴噺", prop: "amount" },
           { label: "棰勬祴鏁伴噺", prop: "prediction" },
@@ -135,7 +135,7 @@
             }
             return {
               ...item,
-              productName:item.product.name,
+              productName: item.product.name,
               locationName: item.location.name,
               isSet: false,
               isEdit: true,
@@ -215,17 +215,18 @@
         this.showDiscard = false
         let requestUrl = this.currentRowId === 0 ? addReorderRule : updateReorderRule
         let params = this.saveParams()
-        requestUrl(params).then((res) => {
-          if (res.code === 200) {
-            let tipStr = this.currentRowId === 0 ? "娣诲姞鎴愬姛" : "淇敼鎴愬姛"
-            this.$message.success(tipStr)
+        requestUrl(params)
+          .then((res) => {
+            if (res.code === 200) {
+              let tipStr = this.currentRowId === 0 ? "娣诲姞鎴愬姛" : "淇敼鎴愬姛"
+              this.$message.success(tipStr)
+              this.getData()
+            }
+          })
+          .catch((err) => {
             this.getData()
-          }
-        })
-        .catch((err) => {
-          this.getData()
-          console.log(err)
-        })
+            console.log(err)
+          })
       }
     },
     saveParams() {
@@ -281,7 +282,7 @@
       if (!this.isNoProduct && this.currentRowId === 0) {
         this.$message.error("璇峰畬鎴愬綋鍓嶆柊寤烘垨鍙栨秷鏂板缓")
       } else {
-        this.currentRowId = row.id||0
+        this.currentRowId = row.id || 0
         this.addTitle = "淇濆瓨"
         this.showDiscard = true
         this.isRowClick = true
@@ -318,11 +319,11 @@
       this.locationId = item?.value ?? item?.id
     },
     // 閫変腑浜у搧鏂规硶
-    selProductClick(value,item){
-      if(value==="product"){
-      this.productId=item.id
-      this.unit=item.unit
-      }
+    selProductClick(item) {
+      this.productId = item.productId
+      this.unit = item.unit
+      this.amount = item.amount
+      this.prediction = item.prediction
     },
     // 閫変腑璺嚎鏂规硶
     selRouteClick(item, prop) {

--
Gitblit v1.8.0