From 4477a4a90fe3c441c25c5cddddee05aa32c8113c Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期六, 28 十月 2023 18:24:50 +0800
Subject: [PATCH] 上架规则列表编辑,产品和产品类别只能展开有数据的

---
 src/views/warehouseManage/listingRules/index.vue |   83 ++++++++++++++++++++++++++++++++++++++++-
 src/components/makepager/CommonFormTableView.vue |    2 
 2 files changed, 81 insertions(+), 4 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 9d3349d..4d58971 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -216,7 +216,7 @@
                       v-for="item in productTypeNameOptions"
                       :key="item.id"
                       :label="item.name"
-                      :value="item.name"
+                      :value="item.id"
                     >
                     </el-option>
                   </el-select>
diff --git a/src/views/warehouseManage/listingRules/index.vue b/src/views/warehouseManage/listingRules/index.vue
index 1e815d2..37e61a0 100644
--- a/src/views/warehouseManage/listingRules/index.vue
+++ b/src/views/warehouseManage/listingRules/index.vue
@@ -197,6 +197,13 @@
             }
           })
           let requestUrl = this.currentRowId === 0 ? addListingRules : updateListingRules
+          console.log({
+            id: this.currentRowId,
+            areaId: this.areaId,
+            locationId: this.subLocationId,
+            productCategoryId: this.productCategoryId,
+            productId: this.productId
+          },"鍙傛暟")
           requestUrl({
             id: this.currentRowId,
             areaId: this.areaId,
@@ -272,14 +279,80 @@
     },
     // 琛岀偣鍑�
     tableRowClick(row, rowIndex) {
-      // this.tableList.tableColumn[1].product=true
-      // this.tableList.tableColumn[2].productType=true
-      this.rowIndex=rowIndex
       console.log("11111",row,rowIndex)
+      console.log(this.isNoProduct ,this.currentRowId,"xxx")
+      // this.tableList.tableColumn[1].product=true
+      // this.tableList.tableColumn[2].productType=false
+      this.rowIndex=rowIndex
       this.isSel()
       if (!this.isNoProduct && this.currentRowId === 0) {
         this.$message.error("璇峰畬鎴愬綋鍓嶆柊寤烘垨鍙栨秷鏂板缓")
       } else {
+      if(row.productCategory!==""){
+        this.tableList.tableColumn[2].productType=true
+        this.currentRowId = row.id
+        this.addTitle = "淇濆瓨"
+        this.showDiscard = true
+        this.isRowClick = true
+        if (!this.isNoProduct) {
+          this.tableData.splice(this.tableData.length - 1, 1)
+        }
+        this.tableData.map((item, index) => {
+          if (index === rowIndex) {
+            item.isEdit = false
+            item.isOrder = true
+          } else {
+            item.isEdit = true
+          }
+        })
+        this.areaId = row.areaId
+        this.subLocationId = row.locationId
+        this.productCategoryId = row.productCategoryId
+        this.productId = row.productId
+      }else if(row.productCategory===""){
+        this.tableList.tableColumn[2].productType=false
+        this.currentRowId = row.id
+        this.addTitle = "淇濆瓨"
+        this.showDiscard = true
+        this.isRowClick = true
+        if (!this.isNoProduct) {
+          this.tableData.splice(this.tableData.length - 1, 1)
+        }
+        this.tableData.map((item, index) => {
+          if (index === rowIndex) {
+            item.isEdit = false
+            item.isOrder = true
+          } else {
+            item.isEdit = true
+          }
+        })
+        this.areaId = row.areaId
+        this.subLocationId = row.locationId
+        this.productCategoryId = row.productCategoryId
+        this.productId = row.productId
+      }else if(row.productId!==""){
+        this.tableList.tableColumn[1].product=true
+        this.currentRowId = row.id
+        this.addTitle = "淇濆瓨"
+        this.showDiscard = true
+        this.isRowClick = true
+        if (!this.isNoProduct) {
+          this.tableData.splice(this.tableData.length - 1, 1)
+        }
+        this.tableData.map((item, index) => {
+          if (index === rowIndex) {
+            item.isEdit = false
+            item.isOrder = true
+          } else {
+            item.isEdit = true
+          }
+        })
+        this.areaId = row.areaId
+        this.subLocationId = row.locationId
+        this.productCategoryId = row.productCategoryId
+        this.productId = row.productId
+      }else if(row.product===""){
+        this.tableList.tableColumn[1].product=false
         this.currentRowId = row.id
         this.addTitle = "淇濆瓨"
         this.showDiscard = true
@@ -300,6 +373,7 @@
         this.productCategoryId = row.productCategoryId
         this.productId = row.productId
       }
+    }
     },
     // 鎼滅储
     getList(val) {
@@ -335,6 +409,7 @@
     },
     // 閫変腑浜у搧鏂规硶
     selProductClick(item) {
+      console.log(item,"浜у搧")
       this.tableList.tableColumn[2].productType=false
       this.productId = item.value
       this.productCategoryId = item.categoryId
@@ -344,6 +419,8 @@
       console.log(item,"浜у搧绫诲瀷",this.tableList.tableData[this.rowIndex])
       this.tableList.tableColumn[1].product=false
       this.tableList.tableData[this.rowIndex].productName='--'
+      this.productId=''
+      this.productCategoryId=item
     },
     // 鍒犻櫎
     async delClick(scope) {

--
Gitblit v1.8.0