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/productManage/productCategory/AddProductCategoryDialog.vue |   93 +++++++++++++++++++++++++++++-----------------
 1 files changed, 58 insertions(+), 35 deletions(-)

diff --git a/src/views/productManage/productCategory/AddProductCategoryDialog.vue b/src/views/productManage/productCategory/AddProductCategoryDialog.vue
index b8453ee..63c4f32 100644
--- a/src/views/productManage/productCategory/AddProductCategoryDialog.vue
+++ b/src/views/productManage/productCategory/AddProductCategoryDialog.vue
@@ -38,7 +38,12 @@
         size="mini"
       >
         <div class="basic-info">
-          <FormBtnsView :showProduct="true" :countObject="statisticsMap" @productClick="productClick" />
+          <FormBtnsView
+            :showProduct="true"
+            :countObject="statisticsMap"
+            @productClick="productClick"
+            @listingRulesClick="listingRulesClick"
+          />
           <div class="basic-info-view">
             <!-- <el-row> -->
             <!-- <el-col :span="24">
@@ -173,7 +178,7 @@
 import { addProductCategory, updateProductCategory, deleteProductCategory } from "@/api/product/productCategory"
 
 import { getDataByType } from "@/api/data"
-import {getProductList} from "@/api/product/product";
+import { getProductList } from "@/api/product/product"
 export default {
   name: "AddProductCategoryDialog",
   props: {
@@ -184,7 +189,7 @@
           visible: false,
           title: "鏂板缓",
           infomation: { type: [] },
-          autoEdit: false,
+          autoEdit: false
         }
       }
     },
@@ -197,13 +202,13 @@
   },
   components: {},
   computed: {
-    modalTitle(){
-      if (this.editConfig.title === '缂栬緫' && this.editConfig.autoEdit){
-        return '缂栬緫'
-      }else if (this.editConfig.title === '缂栬緫') {
-        return !this.showEdit ? '缂栬緫' : '鏌ョ湅'
-      }else {
-        return '鏂板缓'
+    modalTitle() {
+      if (this.editConfig.title === "缂栬緫" && this.editConfig.autoEdit) {
+        return "缂栬緫"
+      } else if (this.editConfig.title === "缂栬緫") {
+        return !this.showEdit ? "缂栬緫" : "鏌ョ湅"
+      } else {
+        return "鏂板缓"
       }
     }
   },
@@ -225,7 +230,7 @@
       showEdit: false, // 鏄惁鏄剧ず缂栬緫鎸夐挳
       isDelClick: false, // 鍒犻櫎鎸夐挳鏄惁鍙偣鍑�
       showFooter: false, // 鏄惁鏄剧ず鍙栨秷淇濆瓨,
-      statisticsMap:{
+      statisticsMap: {
         product: 0 // 浜у搧鏁伴噺
       }
     }
@@ -233,7 +238,7 @@
   created() {
     this.setBottonView()
     this.getProductCount()
-    if (this.editConfig.autoEdit){
+    if (this.editConfig.autoEdit) {
       this.editClick()
     }
     this.setOptionalFieldsToEmpty()
@@ -242,40 +247,44 @@
     /**
      * 闈炲繀濉」鍚庣杩斿洖鐨勬槸鏁板瓧 0,琛ㄥ崟闇�瑕佺┖涓叉墠鑳借涓烘湭閫夋嫨鍥炴樉
      */
-    setOptionalFieldsToEmpty(){
-      ['parentId','costingMethod','inventoryValuation','forceRemovalStrategy']
-          .filter(filed => this.editConfig.infomation[filed] === 0)
-          .forEach(filed => {
-            this.editConfig.infomation[filed] = ''
-          })
+    setOptionalFieldsToEmpty() {
+      let arr = ["parentId", "costingMethod", "inventoryValuation", "forceRemovalStrategy"]
+      arr
+        .filter((filed) => this.editConfig.infomation[filed] === 0)
+        .forEach((filed) => {
+          this.editConfig.infomation[filed] = ""
+        })
     },
     /**
      * 鍚庣鍙帴鍙楁暟瀛楀舰寮�, 淇濆瓨鏃惰繕寰楀啀杞洖鍘�
      */
-    unsetFieldsToNumber(){
-      ['parentId','costingMethod','inventoryValuation','forceRemovalStrategy']
-          .filter(filed => this.editConfig.infomation[filed] === '')
-          .forEach(filed => {
-            this.editConfig.infomation[filed] = 0
-          })
+    unsetFieldsToNumber() {
+      let arr = ["parentId", "costingMethod", "inventoryValuation", "forceRemovalStrategy"]
+      arr
+        .filter((filed) => this.editConfig.infomation[filed] === "")
+        .forEach((filed) => {
+          this.editConfig.infomation[filed] = 0
+        })
     },
     // 鑾峰彇浜у搧鏁伴噺
-    getProductCount(){
+    getProductCount() {
       getProductList({
-        keyWord: '',
+        keyWord: "",
         categoryId: this.editConfig.title === "鏂板缓" ? null : this.editConfig.infomation.id,
         page: 1,
         pageSize: 1
-      }).then((res) => {
-        if (res.code === 200) {
-          this.statisticsMap.product = res?.total ?? 0
-        }else{
-          this.statisticsMap.product = 0
-        }
-      }).catch(err=>{
-        console.error(err)
-        this.statisticsMap.product = 0
       })
+        .then((res) => {
+          if (res.code === 200) {
+            this.statisticsMap.product = res?.total ?? 0
+          } else {
+            this.statisticsMap.product = 0
+          }
+        })
+        .catch((err) => {
+          console.error(err)
+          this.statisticsMap.product = 0
+        })
     },
     // 璁剧疆鍒犻櫎/鎵撳嵃/缂栬緫鏄惁鏄剧ず
     setBottonView() {
@@ -374,6 +383,20 @@
           })
         }
       })
+    },
+    // 涓婃灦瑙勫垯
+    listingRulesClick() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.$router.push({
+            path: "/warehouseManage/listingRules",
+            query: {
+              categoryName: this.editConfig.infomation.name,
+              id: this.editConfig.title === "鏂板缓" ? "" : this.editConfig.infomation.id
+            }
+          })
+        }
+      })
     }
   }
 }

--
Gitblit v1.8.0