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

---
 src/views/warehouseManage/listingRules/index.vue      |   23 +++++++++--
 src/views/reportForm/inboundOutboundDetail/index.vue  |   37 +++++++++++-------
 src/components/makepager/CommonFormTableView.vue      |   52 ++++++++++++++++++++++++++
 src/components/layout/components/appsidebar/index.vue |    2 
 4 files changed, 95 insertions(+), 19 deletions(-)

diff --git a/src/components/layout/components/appsidebar/index.vue b/src/components/layout/components/appsidebar/index.vue
index ea8aeef..796b29b 100644
--- a/src/components/layout/components/appsidebar/index.vue
+++ b/src/components/layout/components/appsidebar/index.vue
@@ -59,7 +59,7 @@
           <el-menu-item index="/reportForm/inventoryReport">搴撳瓨鎶ヨ〃</el-menu-item>
           <el-menu-item index="/reportForm/locationReport">浣嶇疆鎶ヨ〃</el-menu-item>
           <!-- <el-menu-item index="/warehouseManage/bussinessType">鏌愭棩搴撳瓨</el-menu-item> -->
-          <!-- <el-menu-item index="/productManage/product">鍑哄叆搴撴槑缁嗘姤琛�</el-menu-item> -->
+          <el-menu-item index="/reportForm/inboundOutboundDetail">鍑哄叆搴撴槑缁嗘姤琛�</el-menu-item>
         </el-submenu>
       </el-menu>
     </div>
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)
diff --git a/src/views/reportForm/inboundOutboundDetail/index.vue b/src/views/reportForm/inboundOutboundDetail/index.vue
index 594c6a6..55058e2 100644
--- a/src/views/reportForm/inboundOutboundDetail/index.vue
+++ b/src/views/reportForm/inboundOutboundDetail/index.vue
@@ -31,7 +31,7 @@
 <script>
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 import { getHistory } from "@/api/reportForm/inventoryRwport"
-import { getProductOperatonList } from "@/api/product/product"
+// import { getProductOperatonList } from "@/api/product/product"
 
 import AddOverviewDialog from "@/views/overview/AddOverviewDialog"
 
@@ -181,23 +181,32 @@
           }
         })
       } else {
-        await getProductOperatonList({
-          productId: this.params.id,
+        // await getProductOperatonList({
+        //   productId: this.params.id,
+        //   page: this.pagerOptions.currPage,
+        //   pageSize: this.pagerOptions.pageSize
+        // }).then((res) => {
+        //   if (res.code === 200) {
+        //     const list = res.data.map((item) => {
+        //       return {
+        //         ...item,
+        //         fromLocation: item.fromLocation.name,
+        //         toLocation: item.toLocation.name,
+        //         productName: this.params.name,
+        //         amount: item.details[0].product.amount,
+        //         unit: item.details[0].product.unit
+        //       }
+        //     })
+        //     this.tableList.tableInfomation = list || []
+        //     this.pagerOptions.totalCount = res.total
+        //   }
+        // })
+        await getHistory({
           page: this.pagerOptions.currPage,
           pageSize: this.pagerOptions.pageSize
         }).then((res) => {
           if (res.code === 200) {
-            const list = res.data.map((item) => {
-              return {
-                ...item,
-                fromLocation: item.fromLocation.name,
-                toLocation: item.toLocation.name,
-                productName: this.params.name,
-                amount: item.details[0].product.amount,
-                unit: item.details[0].product.unit
-              }
-            })
-            this.tableList.tableInfomation = list || []
+            this.tableList.tableInfomation = res.data
             this.pagerOptions.totalCount = res.total
           }
         })
diff --git a/src/views/warehouseManage/listingRules/index.vue b/src/views/warehouseManage/listingRules/index.vue
index 78e234e..ffb0523 100644
--- a/src/views/warehouseManage/listingRules/index.vue
+++ b/src/views/warehouseManage/listingRules/index.vue
@@ -21,6 +21,7 @@
           @tableRowClick="tableRowClick"
           @selLocationClick="selLocationClick"
           @selProductClick="selProductClick"
+          @selProductTypeClick="selProductTypeClick"
         >
           <template slot="tableButton">
             <el-table-column label="鎿嶄綔" width="90" align="center">
@@ -89,7 +90,8 @@
       areaId: 0,
       productId: 0,
       subLocationId: 0,
-      currentRowId: 0
+      currentRowId: 0,
+      rowIndex:0
     }
   },
   created() {
@@ -105,7 +107,7 @@
         tableColumn: [
           { label: "褰撲骇鍝佸埌杈�", prop: "areaName", location: true },
           { label: "浜у搧", prop: "productName", product: true },
-          { label: "浜у搧绫诲埆", prop: "productCategory" },
+          { label: "浜у搧绫诲埆", prop: "productCategory",productType: true },
           { label: "瀛樺偍鍒板瓙浣嶇疆", prop: "subLocation", location: true }
           // { label: "鍏徃", prop: "companyName", company: true }
         ]
@@ -147,6 +149,8 @@
     },
     // 鏂板
     addProductClick() {
+      this.tableList.tableColumn[1].product=true
+      this.tableList.tableColumn[2].productType=true
       console.log(this.tableData)
       this.isSel()
       if (this.isNoProduct && this.addTitle === "鏂板缓") {
@@ -222,6 +226,8 @@
     },
     // 鍙栨秷
     discardBtnClick() {
+      this.tableList.tableColumn[1].product=true
+      this.tableList.tableColumn[2].productType=true
       if (this.isRowClick) {
         this.tableData.map((item) => {
           item.isEdit = true
@@ -265,7 +271,10 @@
     },
     // 琛岀偣鍑�
     tableRowClick(row, rowIndex) {
-      console.log("11111")
+      // this.tableList.tableColumn[1].product=true
+      // this.tableList.tableColumn[2].productType=true
+      this.rowIndex=rowIndex
+      console.log("11111",row,rowIndex)
       this.isSel()
       if (!this.isNoProduct && this.currentRowId === 0) {
         this.$message.error("璇峰畬鎴愬綋鍓嶆柊寤烘垨鍙栨秷鏂板缓")
@@ -324,10 +333,16 @@
     },
     // 閫変腑浜у搧鏂规硶
     selProductClick(item) {
-      console.log(item)
+      this.tableList.tableColumn[2].productType=false
       this.productId = item.value
       this.productCategoryId = item.categoryId
     },
+    // 閫変腑浜у搧绫诲瀷鏂规硶
+    selProductTypeClick(item) {
+      console.log(item,"浜у搧绫诲瀷",this.tableList.tableData[this.rowIndex])
+      this.tableList.tableColumn[1].product=false
+      this.tableList.tableData[this.rowIndex].productName='--'
+    },
     // 鍒犻櫎
     async delClick(scope) {
       console.log(scope)

--
Gitblit v1.8.0