| | |
| | | :span-method="arraySpanMethod" |
| | | style="width: 100%" |
| | | @selection-change="handleSelectionChange" |
| | | :row-key="(row) => row.productId" |
| | | :row-key="getRowKeys" |
| | | > |
| | | <el-table-column v-if="selectBox" type="selection" :selectable="isDisabled" :reserve-selection="true" width="40" align="center"> |
| | | |
| | |
| | | v-if="editSelCommonConfig.editVisible" |
| | | :edit-common-config="editSelCommonConfig" |
| | | :sign="sign" |
| | | :selectBoxList="tableList.tableData" |
| | | :selectBoxList="arrDisabledList" |
| | | :quotationNumber="quotationNumber" |
| | | @selClient="selClient" |
| | | @getSelectArray="getSelectArray" |
| | |
| | | mergeNumber: 1 |
| | | } |
| | | } |
| | | }, |
| | | disabledList:{ |
| | | type:[Array], |
| | | default: () => { |
| | | return [] |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | total: 0, |
| | | productList: [], |
| | | tableList: [], |
| | | tableList: { |
| | | tableData:[] |
| | | }, |
| | | editSelCommonConfig: { |
| | | editVisible: false, |
| | | isSelectBox: false, |
| | | title: "", |
| | | infomation: {} |
| | | infomation: {}, |
| | | supplierId:null, |
| | | }, |
| | | productIndex: 0 |
| | | productIndex: 0, |
| | | supplierId:null, |
| | | arrDisabledList:[] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getTableInfo() |
| | | }, |
| | | immediate: true |
| | | }, |
| | | supplierId(n,o) { |
| | | this.editSelCommonConfig.supplierId=n |
| | | console.log(n,o,"看看那") |
| | | } , |
| | | 'tableList.tableData':function () { |
| | | this.arrDisabledList=this.disabledList.concat(this.tableList.tableData) |
| | | } |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | // 获取row的key值 |
| | | getRowKeys(row) { |
| | | let string; |
| | | string = row[this.productTableList.key?this.productTableList.key:this.productTableList.productId]; |
| | | return string; |
| | | }, |
| | | isDisabled(row){ |
| | | if (this.name == "rework") { |
| | | if (row.status == 1) { |
| | |
| | | }, |
| | | getTableInfo() { |
| | | this.tableList = this.productTableList |
| | | this.arrDisabledList=this.disabledList.concat(this.tableList.tableData) |
| | | }, |
| | | // 产品名称 |
| | | async getProductList() { |
| | | let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc |
| | | await fn({ |
| | | page: 1, |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | page: 1, |
| | | pageSize: 100, |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | if (res.data.list && res.data.list.length > 0) { |
| | | this.productList = res.data.list |
| | |
| | | } |
| | | }, |
| | | commonInputChange(val, prop, row, scope) { |
| | | if (prop === "amount") { |
| | | if (prop === "amount"||prop=='purchasePrice') { |
| | | this.tableList.tableData.map((ite) => { |
| | | if (ite.name === row.name) { |
| | | ite.total = row.amount * row.purchasePrice |
| | |
| | | this.tableList.tableData.map((ite) => { |
| | | if (ite.name === item.name) { |
| | | ite.amount = item.amount || 1 |
| | | ite.productId = item.id |
| | | ite.number = item.number |
| | | ite.purchasePrice = item.purchasePrice |
| | | ite.price = item.purchasePrice |
| | |
| | | }) |
| | | }, |
| | | // 新增 |
| | | selClientClick(scope, prop) { |
| | | console.log(scope, prop) |
| | | selClientClick(scope) { |
| | | this.productIndex = scope.$index |
| | | this.editSelCommonConfig.title = "产品名称" |
| | | this.editSelCommonConfig.isSelectBox = true |