| | |
| | | <div class="product-view"> |
| | | <CommonFormTableView |
| | | :show-summary="showSummary" |
| | | :addTypeIdMultiple="true" |
| | | :product-table-list="productTableList" |
| | | @inputContent="inputContent" |
| | | @addProductClick="addProductClick" |
| | | @getSelectArray="getSelectArray" |
| | | @emptyProductClick="emptyProductClick" |
| | | @recalculateProductClick="recalculateProductClick" |
| | | @clearupProduct="clearupProduct" |
| | |
| | | }, |
| | | // 产品新增 |
| | | addProductClick() { |
| | | this.productId++ |
| | | this.tableData.push({ |
| | | productId: this.productId, |
| | | id: 0, |
| | | amount: 0, |
| | | desc: "", |
| | | name: "", |
| | | number: "", |
| | | price: 0, |
| | | total: 0 |
| | | }) |
| | | // this.productId++ |
| | | // this.tableData.push({ |
| | | // productId: this.productId, |
| | | // id: 0, |
| | | // amount: 0, |
| | | // desc: "", |
| | | // name: "", |
| | | // number: "", |
| | | // price: 0, |
| | | // total: 0 |
| | | // }) |
| | | // this.showSummary.show = true |
| | | }, |
| | | // 新增方式修改 |
| | | getSelectArray(val) { |
| | | if (val.length > 0) { |
| | | val.map((item, index) => { |
| | | item.productId = this.tableData.length + index + 1 |
| | | }) |
| | | } |
| | | this.tableData = this.tableData.concat(val) |
| | | this.productTableList.tableData = this.tableData |
| | | this.showSummary.show = true |
| | | }, |
| | | // 产品清空 |