|
|
|
@ -815,14 +815,18 @@ export default {
|
|
|
|
|
cellAutofillOption: true,
|
|
|
|
|
checkboxOption: {
|
|
|
|
|
hideSelectAll: false,
|
|
|
|
|
// 可控属性
|
|
|
|
|
selectedRowKeys: [],
|
|
|
|
|
// 行选择改变事件
|
|
|
|
|
selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
|
|
|
|
|
this.selectArr = selectedRowKeys
|
|
|
|
|
this.changeSelectedRowKeys(selectedRowKeys)
|
|
|
|
|
// this.selectArr = selectedRowKeys
|
|
|
|
|
},
|
|
|
|
|
// 全选改变事件
|
|
|
|
|
selectedAllChange: ({ isSelected, selectedRowKeys }) => {
|
|
|
|
|
if (isSelected) {
|
|
|
|
|
this.selectArr = selectedRowKeys
|
|
|
|
|
this.changeSelectedRowKeys(selectedRowKeys)
|
|
|
|
|
// this.selectArr = selectedRowKeys
|
|
|
|
|
} else {
|
|
|
|
|
this.selectArr = []
|
|
|
|
|
}
|
|
|
|
@ -832,6 +836,7 @@ export default {
|
|
|
|
|
hideSelectAll: false,
|
|
|
|
|
// 行选择改变事件
|
|
|
|
|
selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
|
|
|
|
|
console.log(row, isSelected, selectedRowKeys)
|
|
|
|
|
this.selectChildArr = selectedRowKeys
|
|
|
|
|
},
|
|
|
|
|
// 全选改变事件
|
|
|
|
@ -1025,6 +1030,11 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
// 给可控属性重新赋值
|
|
|
|
|
changeSelectedRowKeys(keys) {
|
|
|
|
|
this.selectArr = keys
|
|
|
|
|
this.checkboxOption.selectedRowKeys = keys
|
|
|
|
|
},
|
|
|
|
|
startEditingCell(rowKey, colKey, defaultValue) {
|
|
|
|
|
this.$refs['tableRef'].startEditingCell({ rowKey, colKey, defaultValue })
|
|
|
|
|
},
|
|
|
|
@ -1176,6 +1186,8 @@ export default {
|
|
|
|
|
pkgs += Number(item.pkgs)
|
|
|
|
|
})
|
|
|
|
|
this.totalPkgs = pkgs
|
|
|
|
|
this.checkboxOption.selectedRowKeys = []
|
|
|
|
|
this.selectArr = []
|
|
|
|
|
},
|
|
|
|
|
developboxLine() {
|
|
|
|
|
const arr = []
|
|
|
|
@ -1402,6 +1414,13 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
console.log(this.tableData, this.selectArr[0])
|
|
|
|
|
if (this.tableData[this.selectArr[0]].ctnnum > 1) {
|
|
|
|
|
console.log(
|
|
|
|
|
parseFloat(this.tableData[this.selectArr[0]].ctnnum),
|
|
|
|
|
parseFloat(this.tableData[this.selectArr[0]].pkgs)
|
|
|
|
|
)
|
|
|
|
|
if (
|
|
|
|
|
parseFloat(this.tableData[this.selectArr[0]].ctnnum) <= parseFloat(this.tableData[this.selectArr[0]].pkgs)
|
|
|
|
|
) {
|
|
|
|
|
let tableData = this.tableData
|
|
|
|
|
let data = []
|
|
|
|
|
let num = 0
|
|
|
|
@ -1459,6 +1478,9 @@ export default {
|
|
|
|
|
this.totalCbm = totalCbm.toFixed(2)
|
|
|
|
|
this.tableData = data
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('所选数据的件数应大于等于箱量')
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('所选数据的箱量应大于1')
|
|
|
|
|
}
|
|
|
|
|