| | |
| | | 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" }, |
| | | // { label: "调出位置", prop: "fromLocationId", sonLocation: true, isRequird: true }, |
| | | { label: "调入位置", prop: "fromLocationId", sonLocation: true, isRequird: true }, |
| | | { label: "数量", prop: "amount", inputFloat: true } |
| | | ] |
| | | } 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" }, |
| | | { label: "调出位置", prop: "fromLocationId", sonLocation: true, isRequird: true }, |
| | | { label: "调入位置", prop: "toLocationId", toLocation: true, isRequird: true }, |
| | | { label: "调入位置", prop: "fromLocationId", sonLocation: true, isRequird: true }, |
| | | { label: "调出位置", prop: "toLocationId", toLocation: true, isRequird: true }, |
| | | { label: "数量", prop: "amount", inputFloat: true } |
| | | ] |
| | | } |
| | |
| | | let list = this.tableData.map((res) => { |
| | | return { |
| | | ...res, |
| | | productName: res.name |
| | | amount: 1, |
| | | productName: res.name, |
| | | productId: res.id |
| | | } |
| | | }) |
| | | this.tableData = list |
| | | this.productTableList.tableData = list |
| | | // this.showSummary.show = true |
| | | }, |
| | |
| | | }, |
| | | // 删除 |
| | | handleDelClick(scope, value) { |
| | | console.log(scope) |
| | | if (value === "操作") { |
| | | this.tableData.splice(scope.$index, 1) |
| | | this.productTableList.tableData.splice(scope.$index, 1) |
| | | this.productTableList.tableData = this.tableData |
| | | this.$message.success("删除成功!") |
| | | } else { |
| | | this.detailTableData.splice(scope.$index, 1) |