| | |
| | | searchSel: {}, |
| | | keyword: "", |
| | | keywordType: "", |
| | | showProductCol: ["产品名称", "产品编号", "销售单价", "单位", "产品规格", "型号"], |
| | | showPurchaseCol: ["产品名称", "产品编号", "供应商", "采购单价", "单位", "产品规格", "型号"], |
| | | showProductCol: ["产品名称", "产品编号", "采购单价", "单位", "产品规格", "型号"], |
| | | tableProductColumn: [ |
| | | { label: "产品名称", prop: "name", isClick: true }, |
| | | { label: "产品编号", prop: "number" }, |
| | | { label: "销售单价", prop: "purchasePrice" }, |
| | | { label: "供应商", prop: "supplierName" }, |
| | | { label: "采购单价", prop: "purchasePrice" }, |
| | | { label: "单位", prop: "unit" }, |
| | | { label: "产品规格", prop: "specifications" }, |
| | | { label: "型号", prop: "modelNumber" } |
| | |
| | | }, |
| | | 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 = { |
| | |
| | | if (res.code === 200) { |
| | | if (res.data.list && res.data.list.length > 0) { |
| | | const list = res.data.list.map((item) => { |
| | | return { |
| | | ...item |
| | | if (this.sign == "purchase") { |
| | | return { |
| | | ...item, |
| | | supplierName: item.supplier?.name |
| | | } |
| | | } else { |
| | | return { |
| | | ...item |
| | | } |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list |
| | |
| | | // this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!") |
| | | // } |
| | | // }) |
| | | // } else |
| | | // } else |
| | | if (this.TabsIndex == 1 && row.status == 1) { |
| | | this.productTableList.tableInfomation = [] |
| | | } else if ( |
| | |
| | | this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!") |
| | | } |
| | | }) |
| | | } else if (this.TabsIndex == 0|| |
| | | } else if ( |
| | | this.TabsIndex == 0 || |
| | | (this.TabsIndex == 2 && row.status == 8) || |
| | | (this.TabsIndex == 2 && row.status == 2) || |
| | | (this.TabsIndex == 2 && row.status == 3) |
| | |
| | | :amount-view="false" |
| | | :show-screen="false" |
| | | :show-action-btn="false" |
| | | :placeholder="'请输入产品名称'" |
| | | :placeholder="'请输入产品名称/产品规格/产品编码'" |
| | | @searchClick="onProductFilterSearch" |
| | | > |
| | | <template slot="leftButton"> |
| | |
| | | // 搜索产品 |
| | | onProductFilterSearch(searchText) { |
| | | this.productPagerOptions.currPage = 1 |
| | | this.getProductList("name", searchText) |
| | | this.getProductList("keyword", searchText) |
| | | }, |
| | | // 新建供应商 |
| | | addBtnClick() { |
| | |
| | | async enableClick(row, value) { |
| | | let status = value === "启用" ? 1 : 0 |
| | | await changeSupplierStatus({ |
| | | id:Number(row.id), |
| | | id: Number(row.id), |
| | | status: status |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | |
| | | this.editPurchaseConfig.title = "新建" |
| | | this.editPurchaseConfig.infomation = { |
| | | supplierId: this.selectRow.id, |
| | | purchaseTypeId:"2", |
| | | purchaseTypeId: "2", |
| | | supplierName: this.selectRow.name |
| | | } |
| | | } |