From 0358c535963edb19780cd53c8e133bf298da6419 Mon Sep 17 00:00:00 2001 From: zuozhengqing <a13193816592@163.com> Date: 星期二, 31 十月 2023 10:14:47 +0800 Subject: [PATCH] 上架规则列表修改 --- src/components/makepager/CommonFormTableView.vue | 62 ++++++++++++++++++++++++++++++ 1 files changed, 61 insertions(+), 1 deletions(-) diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue index a10671d..1962ce1 100644 --- a/src/components/makepager/CommonFormTableView.vue +++ b/src/components/makepager/CommonFormTableView.vue @@ -196,6 +196,35 @@ </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="{ + value: item.id, + label: 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"> @@ -276,6 +305,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 { @@ -325,6 +355,7 @@ }, productIndex: 0, productNameOptions: [], + productTypeNameOptions: [], memberOptions: [{ id: 1, name: "绠$悊鍛�" }], selOptions: [ { id: 1, name: "浠�" }, @@ -340,6 +371,7 @@ this.getRuleList() } else { this.getProductList() + this.getProductCategoryList() } if (this.islistingrules) { this.getLocationList() @@ -382,6 +414,21 @@ } }) }, + // 鑾峰彇浜у搧绫诲瀷鍒楄〃 + 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 + } + }) + }, // 浣嶇疆 async getLocationList() { await getLocationList({ @@ -419,7 +466,6 @@ }, // 閫夋嫨浜у搧 selProductClick(item) { - console.log(item) this.tableList.tableData.map((ite) => { if (ite.productName.label === item.label) { ite.productId = item.value @@ -445,6 +491,20 @@ console.log(this.tableList.tableData) this.$emit("selProductClick", item) }, + // 閫夋嫨浜у搧绫诲瀷 + selProductTypeClick(item) { + this.tableList.tableData.map((ite) => { + if (ite.productCategory.label === item.label) { + ite.productCategoryId = item.value + ite.productCategory = item.label + } + }) + if (this.isinventory) { + this.getProductCategoryList() + } + console.log(this.tableList.tableData) + this.$emit("selProductTypeClick", item) + }, // 閫夋嫨浣嶇疆 selLocationClick(item, prop) { console.log(item) -- Gitblit v1.8.0