From 496ab649c883f9be20fa982da9918889cdd18282 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期三, 27 九月 2023 20:18:35 +0800
Subject: [PATCH] 新建库存调整接口联调
---
src/components/makepager/CommonFormTableView.vue | 49 +++++++++++++++++++++++++++++++++++++++++++++----
src/views/operate/inventoryAdjustment/index.vue | 3 ++-
2 files changed, 47 insertions(+), 5 deletions(-)
diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 997cf9e..099c275 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -154,8 +154,8 @@
"
>
<el-option
- v-for="item in selLocationOptions"
- :key="item.id"
+ v-for="(item, index) in selLocationOptions"
+ :key="index"
:label="item.name"
:value="{ value: item.id, label: item.name }"
>
@@ -249,6 +249,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 SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
export default {
name: "CommmonFormTableView",
@@ -307,9 +308,10 @@
}
},
created() {
- this.getProductList()
if (this.isinventory) {
- this.getLocationList()
+ this.getRuleList()
+ } else {
+ this.getProductList()
}
if (this.islistingrules) {
this.getLocationList()
@@ -335,6 +337,20 @@
if (res.data && res.data.length > 0) {
this.productNameOptions = res.data
}
+ }
+ })
+ },
+ // 搴撳瓨璋冩暣鑾峰彇浣嶇疆鍜屼骇鍝�
+ async getRuleList() {
+ await getRuleList({
+ locationId: 0,
+ productId: ""
+ }).then((res) => {
+ console.log(res)
+ if (res.code === 200) {
+ const list = res.data ? res.data : []
+ this.selLocationOptions = list.locationList
+ this.productNameOptions = list.productList
}
})
},
@@ -384,6 +400,18 @@
ite.unit = item.unit
}
})
+ if (this.isinventory) {
+ getRuleList({
+ locationId: 0,
+ productId: item.value
+ }).then((res) => {
+ console.log(res)
+ if (res.code === 200) {
+ const list = res.data ? res.data : []
+ this.selLocationOptions = list.locationList
+ }
+ })
+ }
console.log(this.tableList.tableData)
this.$emit("selProductClick", item)
},
@@ -391,6 +419,19 @@
selLocationClick(item, prop) {
console.log(item)
console.log(this.tableList.tableData)
+ if (this.isinventory) {
+ getRuleList({
+ locationId: item.value,
+ productId: ""
+ }).then((res) => {
+ console.log(res)
+ if (res.code === 200) {
+ const list = res.data ? res.data : []
+ // this.selLocationOptions = list.locationList
+ this.productNameOptions = list.productList
+ }
+ })
+ }
this.$emit("selLocationClick", item, prop)
},
// 閫夋嫨鍗曚綅/鐢ㄦ埛
diff --git a/src/views/operate/inventoryAdjustment/index.vue b/src/views/operate/inventoryAdjustment/index.vue
index 8e9c374..4688670 100644
--- a/src/views/operate/inventoryAdjustment/index.vue
+++ b/src/views/operate/inventoryAdjustment/index.vue
@@ -16,6 +16,7 @@
<div class="list-view">
<div class="table">
<CommonFormTableView
+ ref="tablelistRef"
:isinventory="true"
:product-table-list="tableList"
@inputContent="inputContent"
@@ -141,7 +142,7 @@
addProductClick() {
console.log(this.tableData)
this.isSel()
- this.isSel()
+ this.$refs.tablelistRef.getRuleList()
if (this.isNoProduct && this.addTitle === "鏂板缓") {
this.addTitle = "淇濆瓨"
this.showDiscard = true
--
Gitblit v1.8.0