From e7ccd2a06e4cdf3709e699507e1e15379ded5b83 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期一, 06 十一月 2023 11:25:09 +0800
Subject: [PATCH] Merge branch 'dev' of http://192.168.5.5:10010/r/web/WMS into dev

---
 src/views/warehouseManage/listingRules/index.vue |  119 +++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 74 insertions(+), 45 deletions(-)

diff --git a/src/views/warehouseManage/listingRules/index.vue b/src/views/warehouseManage/listingRules/index.vue
index 6e0c9d6..de53dd3 100644
--- a/src/views/warehouseManage/listingRules/index.vue
+++ b/src/views/warehouseManage/listingRules/index.vue
@@ -4,12 +4,14 @@
       <SearchCommonView
         :add-title="addTitle"
         :show-discard="showDiscard"
-        :placeholder="'璇疯緭鍏ヤ綅缃�/浜у搧'"
+        :placeholder="'璇疯緭鍏ヤ骇鍝�/浜у搧绫诲埆'"
         :amount-view="false"
+        :search-task-map="searchTaskMap"
         @addCommonClick="addProductClick"
         @searchClick="getList"
         @discardBtnClick="discardBtnClick"
         @applyBtnClick="applyBtnClick"
+        @delSelectClick="delSelectClick"
       />
     </div>
     <div class="list-view">
@@ -89,15 +91,32 @@
       isRowClick: false,
       areaId: 0,
       productId: 0,
-      productCategoryId:0,
+      productCategoryId: 0,
       subLocationId: 0,
       currentRowId: 0,
-      rowIndex:-1,
-      RuleType:0,
+      rowIndex: -1,
+      RuleType: 0,
+      queryProductId: null,
+      categoryId: null,
+      searchTaskMap: []
     }
   },
   created() {
     this.setTable()
+    let query = this.$route.query
+    if (query) {
+      console.log("aaaaaaaaaaaaa", query)
+      this.queryProductId = query.productId?.length ? query.productId : null
+      this.categoryId = query.id ? Number(query.id) : null
+      this.pagerOptions.currPage = 1
+      this.searchTaskMap =
+        query?.id > 0
+          ? [{ categoryId: this.categoryId, title: query.categoryName }]
+          : query.productId?.length > 0
+          ? [{ productId: this.queryProductId, title: query.productName }]
+          : []
+      console.log(this.searchTaskMap)
+    }
     this.getData()
   },
   methods: {
@@ -109,7 +128,7 @@
         tableColumn: [
           { label: "褰撲骇鍝佸埌杈�", prop: "areaName", location: true },
           { label: "浜у搧", prop: "productName", product: true },
-          { label: "浜у搧绫诲埆", prop: "productCategory",productType: true },
+          { label: "浜у搧绫诲埆", prop: "productCategory", productType: true },
           { label: "瀛樺偍鍒板瓙浣嶇疆", prop: "subLocation", location: true }
           // { label: "鍏徃", prop: "companyName", company: true }
         ]
@@ -118,7 +137,8 @@
     // 璇锋眰鏁版嵁
     async getData() {
       await getListingRulesList({
-        // keyword: this.keyword,
+        productId: this.queryProductId ? this.queryProductId : null,
+        productCategoryId: this.categoryId ? this.categoryId : null,
         page: this.pagerOptions.currPage,
         pageSize: this.pagerOptions.pageSize
       }).then((res) => {
@@ -151,8 +171,8 @@
     },
     // 鏂板
     addProductClick() {
-      this.tableList.tableColumn[1].product=true
-      this.tableList.tableColumn[2].productType=true
+      this.tableList.tableColumn[1].product = true
+      this.tableList.tableColumn[2].productType = true
       console.log(this.tableData)
       this.isSel()
       if (this.isNoProduct && this.addTitle === "鏂板缓") {
@@ -181,7 +201,7 @@
       } else {
         if (this.areaId === 0) {
           this.$message.error("璇烽�夋嫨褰撳墠浜у搧鍒拌揪浣嶇疆")
-        } else if (this.productId === 0 && this.productCategoryId==='') {
+        } else if (this.productId === 0 && this.productCategoryId === "") {
           this.$message.error("璇烽�夋嫨浜у搧鎴栦骇鍝佺被鍒�")
         } else if (this.subLocationId === 0) {
           this.$message.error("璇烽�夋嫨瀛樺偍鍒板瓙浣嶇疆")
@@ -200,12 +220,12 @@
           })
           let requestUrl = this.currentRowId === 0 ? addListingRules : updateListingRules
           requestUrl({
-              RuleType:this.RuleType,
-              id: this.currentRowId,
-              areaId: this.areaId,
-              locationId: this.subLocationId,
-              productCategoryId: this.productCategoryId||'',
-              productId: this.productId||''
+            RuleType: this.RuleType,
+            id: this.currentRowId,
+            areaId: this.areaId,
+            locationId: this.subLocationId,
+            productCategoryId: this.productCategoryId || "",
+            productId: this.productId || ""
           }).then((res) => {
             console.log(res)
             if (res.code === 200) {
@@ -230,8 +250,8 @@
     },
     // 鍙栨秷
     discardBtnClick() {
-      this.tableList.tableColumn[1].product=true
-      this.tableList.tableColumn[2].productType=true
+      this.tableList.tableColumn[1].product = true
+      this.tableList.tableColumn[2].productType = true
       if (this.isRowClick) {
         this.tableData.map((item) => {
           item.isEdit = true
@@ -275,12 +295,12 @@
     },
     // 琛岀偣鍑�
     tableRowClick(row, rowIndex) {
-      this.rowIndex=rowIndex
+      this.rowIndex = rowIndex
       this.isSel()
       if (!this.isNoProduct && this.currentRowId === 0) {
         this.$message.error("璇峰畬鎴愬綋鍓嶆柊寤烘垨鍙栨秷鏂板缓")
       } else {
-        this.tableList.tableColumn[2].productType=true
+        this.tableList.tableColumn[2].productType = true
         this.currentRowId = row.id
         this.addTitle = "淇濆瓨"
         this.showDiscard = true
@@ -300,14 +320,17 @@
         this.subLocationId = row.locationId
         this.productCategoryId = row.productCategoryId
         this.productId = row.productId
-        if(this.tableList.tableData[rowIndex].productName===""||this.tableList.tableData[rowIndex].productName===" "){
-          this.tableList.tableColumn[1].product=false
-          this.tableList.tableColumn[2].productType=true
-        }else{
-          this.tableList.tableColumn[1].product=true
-          this.tableList.tableColumn[2].productType=false
+        if (
+          this.tableList.tableData[rowIndex].productName === "" ||
+          this.tableList.tableData[rowIndex].productName === " "
+        ) {
+          this.tableList.tableColumn[1].product = false
+          this.tableList.tableColumn[2].productType = true
+        } else {
+          this.tableList.tableColumn[1].product = true
+          this.tableList.tableColumn[2].productType = false
         }
-    }
+      }
     },
     // 鎼滅储
     getList(val) {
@@ -343,22 +366,22 @@
     },
     // 閫変腑浜у搧鏂规硶
     selProductClick(item) {
-      console.log(item,"浜у搧")
-      this.RuleType=1
-      this.tableList.tableColumn[2].productType=false
+      console.log(item, "浜у搧")
+      this.RuleType = 1
+      this.tableList.tableColumn[2].productType = false
       this.productId = item.value
       this.productCategoryId = item.categoryId
     },
     // 閫変腑浜у搧绫诲瀷鏂规硶
     selProductTypeClick(item) {
-      this.RuleType=2
-      if(this.currentRowId===0){
-        this.productCategoryId=item.value
-      }else{
-        this.tableList.tableColumn[1].product=false
-        this.tableList.tableData[this.rowIndex].productName=' '
-        this.productId=''
-        this.productCategoryId=this.tableList.tableData[this.rowIndex].productCategoryId
+      this.RuleType = 2
+      if (this.currentRowId === 0) {
+        this.productCategoryId = item.value
+      } else {
+        this.tableList.tableColumn[1].product = false
+        this.tableList.tableData[this.rowIndex].productName = " "
+        this.productId = ""
+        this.productCategoryId = this.tableList.tableData[this.rowIndex].productCategoryId
       }
     },
     // 鍒犻櫎
@@ -370,16 +393,22 @@
           this.getData()
         }
       })
+    },
+    // 鍒犻櫎浜у搧绫诲瀷
+    delSelectClick() {
+      this.categoryId = 0
+      this.queryProductId = ""
+      this.getData()
     }
   },
-  watch:{
-    rowIndex(newVal){
-      if(this.tableList.tableData[newVal].productName===" "){
-        this.tableList.tableColumn[1].product=false
-        this.tableList.tableColumn[2].productType=true
-      }else{
-        this.tableList.tableColumn[1].product=true
-        this.tableList.tableColumn[2].productType=false
+  watch: {
+    rowIndex(newVal) {
+      if (this.tableList.tableData[newVal].productName === " ") {
+        this.tableList.tableColumn[1].product = false
+        this.tableList.tableColumn[2].productType = true
+      } else {
+        this.tableList.tableColumn[1].product = true
+        this.tableList.tableColumn[2].productType = false
       }
     }
   }

--
Gitblit v1.8.0