From f3cb03e9e6cbd21bc5f1d9b2570f964d29a48aa8 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期一, 15 四月 2024 10:09:56 +0800
Subject: [PATCH] 库存调整更换接口

---
 src/api/operate/inventoryAdjustment.js           |    8 ++++++++
 src/components/makepager/CommonFormTableView.vue |   10 +++++++---
 src/views/operate/inventoryAdjustment/index.vue  |   17 ++++++++++++++---
 3 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/src/api/operate/inventoryAdjustment.js b/src/api/operate/inventoryAdjustment.js
index 61a55b0..2045aaa 100644
--- a/src/api/operate/inventoryAdjustment.js
+++ b/src/api/operate/inventoryAdjustment.js
@@ -49,3 +49,11 @@
     data
   })
 }
+// 鑾峰彇浣嶇疆浜у搧淇℃伅
+export function getLocationProductAmount(data) {
+  return request({
+    url: "/api-wms/v1/locationProductAmount/getLocationProductAmount",
+    method: "post",
+    data
+  })
+}
\ No newline at end of file
diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 903d1aa..8465b21 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -450,7 +450,7 @@
 import { getProductList } from "@/api/product/product"
 import { getLocationList } from "@/api/warehouseManage/warehouse"
 import { getCompanyList } from "@/api/common/other"
-import { getRuleList } from "@/api/operate/inventoryAdjustment"
+import { getRuleList} from "@/api/operate/inventoryAdjustment"
 import { getProductCategoryList } from "@/api/product/productCategory"
 import SimpleSearchInput from "@/components/makepager/SimpleSearchInput"
 import { getAmountAndPrediction } from "@/api/product/reorderRules"
@@ -772,6 +772,7 @@
     },
     // 閫夋嫨浜у搧
     selProductClick(item, row) {
+      console.log("閫夋嫨浜у搧",row,item)
       if (this.isReorder) {
         this.productId = item.id
         this.productName = item.name
@@ -794,13 +795,12 @@
             ite.productName = item.name
             ite.categoryId = item.categoryId
             ite.productCategory = item.categoryName
-            ite.amount = item.amount
+            // ite.amount = item.amount
             ite.unit = item.unit
           }
         })
         this.$emit("selProductClick", "product", this.tableList.tableData[selIndex])
       }
-
       if (this.isinventory) {
         getRuleList({
           locationId: 0,
@@ -813,6 +813,7 @@
           }
         })
       }
+
       // this.$emit("selProductClick", item)
     },
     // 閫夋嫨浜у搧绫诲瀷
@@ -844,6 +845,7 @@
     },
     // 閫夋嫨浣嶇疆
     selLocationClick(item, prop, row) {
+      console.log("浣嶇疆閫夋嫨",item,row)
       if (prop === "areaName") {
         getLocationList({
           jointName: item.label,
@@ -855,6 +857,8 @@
             this.selSonLocationOptions = list
           }
         })
+      }else if(prop==='locationName'){
+        console.log("locationName")
       }
       if (this.isReorder) {
         this.locacionId = item.value
diff --git a/src/views/operate/inventoryAdjustment/index.vue b/src/views/operate/inventoryAdjustment/index.vue
index 10a7700..daa9bec 100644
--- a/src/views/operate/inventoryAdjustment/index.vue
+++ b/src/views/operate/inventoryAdjustment/index.vue
@@ -64,9 +64,11 @@
   getInventoryAdjustmentList,
   addInventoryAdjustment,
   updateInventoryAdjustment,
-  finishInventoryAdjustment
+  finishInventoryAdjustment,
+  getLocationProductAmount
 } from "@/api/operate/inventoryAdjustment"
 import { currentTime } from "@/common/config/index"
+
 export default {
   name: "InventoryAdjustment",
   props: {},
@@ -314,10 +316,19 @@
       console.log(item, prop)
       this.locationId = item.value
     },
-    // 閫変腑浜у搧鏂规硶
-    selProductClick(value, item) {
+    // 閫夋嫨浜у搧鏂规硶
+    async selProductClick(value, item) {
+          console.log("鐪嬬湅杩斿洖",this.tableData)
       if (value === "product") {
         this.productId = item.productId
+        await getLocationProductAmount({
+          locationId:this.locationId,
+          productId:this.productId
+        }).then((res)=>{
+          if(res&&res.code===200){
+            this.tableData[0].amount=res.data.amount||0
+          }
+        })
       }
     },
     // 鑾峰彇褰撳墠鏃堕棿

--
Gitblit v1.8.0