| | |
| | | clientId: 0, |
| | | isRequest: true, |
| | | client_name: "", |
| | | tableInfomation: [] |
| | | tableInfomation: [], |
| | | supplierId:null, |
| | | } |
| | | } |
| | | }, |
| | |
| | | searchSel: {}, |
| | | keyword: "", |
| | | keywordType: "", |
| | | showProductCol: ["产品名称", "产品编号", "供应商", "采购单价", "单位", "产品规格", "型号"], |
| | | showPurchaseCol: ["产品名称", "产品编号", "供应商", "采购单价", "单位", "产品规格", "型号"], |
| | | showProductCol: ["产品名称", "产品编号", "采购单价", "单位", "产品规格", "型号"], |
| | | tableProductColumn: [ |
| | | { label: "产品名称", prop: "name", isClick: true }, |
| | | { label: "产品编号", prop: "number" }, |
| | |
| | | tableColumn: [], |
| | | selectArray: [] |
| | | } |
| | | }, |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.getData() |
| | |
| | | }, |
| | | setTable() { |
| | | if (this.editConfig.title === "产品名称") { |
| | | this.showCol = this.showProductCol |
| | | if (this.sign == "purchase") { |
| | | this.showCol = this.showPurchaseCol |
| | | } else { |
| | | this.showCol = this.showProductCol |
| | | } |
| | | |
| | | this.tableColumn = this.tableProductColumn |
| | | } |
| | | this.tableList = { |
| | |
| | | async getProductList() { |
| | | let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc |
| | | await fn({ |
| | | keyword: this.keyword, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | keyword: this.keyword, |
| | | page: this.pagerOptions.currPage, |
| | | supplierId:this.editConfig.supplierId, |
| | | pageSize: this.pagerOptions.pageSize, |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | if (res.data.list && res.data.list.length > 0) { |
| | | const list = res.data.list.map((item) => { |
| | | return { |
| | | ...item, |
| | | supplierName: item.supplier.name |
| | | if (this.sign == "purchase") { |
| | | return { |
| | | ...item, |
| | | supplierName: item.supplier?.name |
| | | } |
| | | } else { |
| | | return { |
| | | ...item |
| | | } |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list |