| | |
| | | :dataSource='sparesScrapRequirementDetailTable.dataSource' |
| | | :maxHeight='300' |
| | | :disabled='formDisabled' |
| | | @valueChange="changeAuxiliaryQuantity" |
| | | :alwaysEdit='true' |
| | | :rowNumber='true' |
| | | :bordered='bordered' |
| | |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: 0, |
| | | formatter({ cellValue, row, column }) { |
| | | |
| | | Function({cellValue, row, column}){ |
| | | console.log(cellValue) |
| | | console.log(row) |
| | | console.log(column) |
| | | if (cellValue != null) { |
| | | let conversionRatio = row.conversionRatio |
| | | |
| | | console.log(conversionRatio) |
| | | row.auxiliaryQuantity = Math.abs(cellValue * conversionRatio) |
| | | |
| | | } |
| | | console.log(cellValue) |
| | | return cellValue |
| | | |
| | | }, |
| | | validateRules: [ |
| | | { |
| | |
| | | auxiliaryUnitId: data[i].auxiliaryUnitId, |
| | | mainUnitIdName: data[i].mainUnitId_dictText, |
| | | auxiliaryUnitIdName: data[i].auxiliaryUnitId_dictText, |
| | | mainQuantity: data[i].mainQuantity, |
| | | auxiliaryQuantity: data[i].auxiliaryQuantity, |
| | | requirementTime: data[i].requirementTime, |
| | | conversionRatio: data[i].conversionRatio |
| | | |
| | |
| | | this.visible = false |
| | | this.$emit('close') |
| | | this.$refs.form.clearValidate() |
| | | }, |
| | | changeAuxiliaryQuantity(target){ |
| | | console.log(target.columnIndex) |
| | | let num=target.columnIndex |
| | | if (target.columnIndex ===num){ |
| | | target.row.auxiliaryQuantity=Math.abs(target.row.conversionRatio*target.row.mainQuantity) |
| | | } |
| | | } |
| | | } |
| | | } |