From 0f8844dcb400fcdee4ea7831336a6aff382a8cc2 Mon Sep 17 00:00:00 2001 From: songshankun <songshankun@foxmail.com> Date: 星期六, 23 九月 2023 14:59:16 +0800 Subject: [PATCH] fix: 修复搜索供应商列表结果为空时产品列表不为空的bug, 修复产品列表翻页后搜索供应商时产品列表页码未重置的bug, 修复供应商列表/产品列表/采购订单/质检单/退货单翻页后再搜索页码未重置的bug --- src/views/other/commonDialog/EditDropdownDialog.vue | 37 +++++++++++++++++++++++++++++++------ 1 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/views/other/commonDialog/EditDropdownDialog.vue b/src/views/other/commonDialog/EditDropdownDialog.vue index 4691fa8..61713a6 100644 --- a/src/views/other/commonDialog/EditDropdownDialog.vue +++ b/src/views/other/commonDialog/EditDropdownDialog.vue @@ -55,7 +55,7 @@ </template> <script> -import { getSupplierTypeList, updateSupplierType } from "@/api/supplierManage/supplier" +import { getSupplierTypeList, updateSupplierType, updateIndustry, getIndustryList } from "@/api/supplierManage/supplier" export default { name: "EditDropdownDialog", props: { @@ -90,6 +90,8 @@ setList() { if (this.editConfig.title === "渚涘簲鍟嗙被鍨�") { this.getSupplierTypeList() + } else if (this.editConfig.title === "鎵�灞炶涓�") { + this.getIndustryList() } }, // 渚涘簲鍟嗙被鍨� @@ -98,13 +100,20 @@ page: 1, pageSize: 100 }).then((res) => { - console.log("dsss") console.log(res.data) this.tableData = res.data.data.list }) }, // 鎵�灞炶涓� - async getIndustryList() {}, + async getIndustryList() { + await getIndustryList({ + page: 1, + pageSize: 100 + }).then((res) => { + console.log(res.data) + this.tableData = res.data.data.list + }) + }, handleClose() { this.editConfig.editVisible = false }, @@ -151,12 +160,16 @@ // 鏂板涓嬫媺妗� addDropdown() { this.tableData.push({ - name: "", - id: 0 + ID: 0, + name: "" }) }, async saveClick() { console.log(this.tableData) + this.tableData.map((ite) => { + ite.ID = 0 + return { ...ite } + }) if (this.editConfig.title === "渚涘簲鍟嗙被鍨�") { updateSupplierType({ supplierTypes: this.tableData @@ -164,7 +177,19 @@ console.log(res) if (res.code === 200) { this.$message.success("缂栬緫鎴愬姛") - this.$parent.getData() + this.$parent.getSupplierTypeList() + this.handleClose() + } + }) + } else if (this.editConfig.title === "鎵�灞炶涓�") { + updateIndustry({ + industries: this.tableData + }).then((res) => { + console.log(res) + if (res.code === 200) { + this.$message.success("缂栬緫鎴愬姛") + this.$parent.getIndustryList() + this.handleClose() } }) } -- Gitblit v1.8.0