| | |
| | | " |
| | | > |
| | | <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 }" |
| | | > |
| | |
| | | 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", |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getProductList() |
| | | if (this.isinventory) { |
| | | this.getLocationList() |
| | | this.getRuleList() |
| | | } else { |
| | | this.getProductList() |
| | | } |
| | | if (this.islistingrules) { |
| | | this.getLocationList() |
| | |
| | | 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 |
| | | } |
| | | }) |
| | | }, |
| | |
| | | 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) |
| | | }, |
| | |
| | | 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) |
| | | }, |
| | | // 选择单位/用户 |