| | |
| | | console.log(validArr, "xxx") |
| | | Promise.all(validArr) |
| | | .then((results) => { |
| | | console.log(results, "执行成功") |
| | | console.log(results, "执行成功", this.tableData) |
| | | for (let i = 0; i < this.tableData.length; i++) { |
| | | if (this.tableData[i].productName.length === 0) { |
| | | this.isNoProduct = true |
| | |
| | | return { |
| | | ...item, |
| | | productName: item.product.name, |
| | | productId: item.product.id, |
| | | unit: item.product.unit |
| | | } |
| | | }) |
| | |
| | | if (this.workType === 1) { |
| | | tableColumnArr = [ |
| | | { label: "产品名称", prop: "productName", productName: true, isRequird: true }, |
| | | { label: "产品编码", prop: "id" }, |
| | | { label: "产品编码", prop: "productId" }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "产品规格", prop: "specs" }, |
| | | { label: "产品型号", prop: "model" }, |
| | |
| | | } else if (this.workType === 2) { |
| | | tableColumnArr = [ |
| | | { label: "产品名称", prop: "productName", productName: true, isRequird: true }, |
| | | { label: "产品编码", prop: "id" }, |
| | | { label: "产品编码", prop: "productId" }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "产品规格", prop: "specs" }, |
| | | { label: "产品型号", prop: "model" }, |
| | |
| | | } else if (this.workType === 3) { |
| | | tableColumnArr = [ |
| | | { label: "产品名称", prop: "productName", productName: true, isRequird: true }, |
| | | { label: "产品编码", prop: "id" }, |
| | | { label: "产品编码", prop: "productId" }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "产品规格", prop: "specs" }, |
| | | { label: "产品型号", prop: "model" }, |
| | |
| | | let list = this.tableData.map((res) => { |
| | | return { |
| | | ...res, |
| | | productName: res.name |
| | | productName: res.name, |
| | | productId: res.id |
| | | } |
| | | }) |
| | | this.tableData = list |
| | | this.productTableList.tableData = list |
| | | // this.showSummary.show = true |
| | | }, |