From 4b4438e7231bff0f260b0c17761072503e2af7b1 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期六, 28 十月 2023 15:55:01 +0800
Subject: [PATCH] 上架规则,产品类别下拉框可编辑,出入库明细调整

---
 src/components/makepager/CommonFormTableView.vue |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 0e99386..93c4b3c 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -195,6 +195,32 @@
                   </el-select>
                 </div>
               </el-form-item>
+              <!-- 浜у搧绫诲瀷 -->
+              <el-form-item v-else-if="item.productType" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
+                <div class="custom-name">
+                  <span v-if="scope.row.isEdit || scope.row.editable">{{ scope.row[item.prop] }}</span>
+                  <el-select
+                    v-else
+                    v-model="scope.row[item.prop]"
+                    placeholder="璇烽�夋嫨"
+                    size="mini"
+                    style="width: 80%"
+                    @change="
+                      (val) => {
+                        selProductTypeClick(val)
+                      }
+                    "
+                  >
+                    <el-option
+                      v-for="item in productTypeNameOptions"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.name"
+                    >
+                    </el-option>
+                  </el-select>
+                </div>
+              </el-form-item>
               <!-- 鐢ㄦ埛 -->
               <el-form-item v-else-if="item.user" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
                 <div class="custom-name">
@@ -249,6 +275,7 @@
 import { getLocationList } from "@/api/warehouseManage/warehouse"
 import { getCompanyList } from "@/api/common/other"
 import { getRuleList } from "@/api/operate/inventoryAdjustment"
+import { getProductCategoryList } from "@/api/product/productCategory"
 import SimpleSearchInput from "@/components/makepager/SimpleSearchInput"
 // import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
 export default {
@@ -298,6 +325,7 @@
       },
       productIndex: 0,
       productNameOptions: [],
+      productTypeNameOptions: [],
       memberOptions: [{ id: 1, name: "绠$悊鍛�" }],
       selOptions: [
         { id: 1, name: "浠�" },
@@ -312,6 +340,7 @@
       this.getRuleList()
     } else {
       this.getProductList()
+      this.getProductCategoryList()
     }
     if (this.islistingrules) {
       this.getLocationList()
@@ -351,6 +380,21 @@
           const list = res.data ? res.data : []
           this.selLocationOptions = list.locationList
           this.productNameOptions = list.productList
+        }
+      })
+    },
+    // 鑾峰彇浜у搧绫诲瀷鍒楄〃
+    async getProductCategoryList(){
+      await getProductCategoryList({
+        categoryId:0,
+        keyWord:"",
+        page:1,
+        pageSize:15
+      }).then((res) => {
+        console.log(res,"鐪嬬湅浜у搧绫诲瀷鍒楄〃")
+        if (res.code === 200) {
+          const list = res.data ? res.data : []
+          this.productTypeNameOptions = list
         }
       })
     },
@@ -417,6 +461,14 @@
       console.log(this.tableList.tableData)
       this.$emit("selProductClick", item)
     },
+    // 閫夋嫨浜у搧绫诲瀷
+    selProductTypeClick(item) {
+      if (this.isinventory) {
+        this.getProductCategoryList()
+      }
+      console.log(this.tableList.tableData)
+      this.$emit("selProductTypeClick", item)
+    },
     // 閫夋嫨浣嶇疆
     selLocationClick(item, prop) {
       console.log(item)

--
Gitblit v1.8.0