|
|
@ -175,12 +175,10 @@ const intData = () => { |
|
|
|
} |
|
|
|
expandChange(row) |
|
|
|
}) |
|
|
|
console.log(tableData.value) |
|
|
|
} |
|
|
|
const expandChange = (row: any, expandedRows: any[]) => { |
|
|
|
// 判断托信息是否存在 |
|
|
|
if (row.secondPackUnit && row.secondPackQty) { |
|
|
|
console.log(222,row) |
|
|
|
// 数量除以托数量获取余数 |
|
|
|
row.lastNumber = parseFloat(row.qty) % parseFloat(row.secondPackQty) |
|
|
|
// 托数量/箱数量 一托可以放几箱 |
|
|
@ -199,7 +197,6 @@ const expandChange = (row: any, expandedRows: any[]) => { |
|
|
|
qtyOne: '', |
|
|
|
isTuo : 1 //有托 |
|
|
|
} |
|
|
|
console.log(222,row) |
|
|
|
// 如果有余数 |
|
|
|
if (row.lastNumber) { |
|
|
|
// 最后一条信息直接展示余数的信息 |
|
|
@ -302,7 +299,6 @@ const submitForm = () => { |
|
|
|
let arr = tableData.value.map((item) => { |
|
|
|
item.allNumber = 0 |
|
|
|
// 判断托信息是否存在 |
|
|
|
console.log(item.packageList) |
|
|
|
item.packageList.forEach((cur) => { |
|
|
|
item.allNumber += parseFloat(cur.qtyOne) || 0 |
|
|
|
}) |
|
|
@ -312,13 +308,11 @@ const submitForm = () => { |
|
|
|
return false |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(3434, arr) |
|
|
|
const isBol = arr.some((item) => item == false) |
|
|
|
if (isBol) { |
|
|
|
message.warning('当前添加的数量与总数量不一致') |
|
|
|
return |
|
|
|
} |
|
|
|
console.log(343546568678) |
|
|
|
emit('submitForm', tableData.value) |
|
|
|
} |
|
|
|
// 添加托 |
|
|
@ -446,8 +440,6 @@ const blurOne = (oneRow, twoRow) => { |
|
|
|
} |
|
|
|
//在托下方的箱数量失去焦点 |
|
|
|
const blurTwo = (oneRow, twoRow, threeRow) => { |
|
|
|
console.log(parseFloat(threeRow.qtyTwo)) |
|
|
|
console.log(parseFloat(oneRow.packQty)) |
|
|
|
if (parseFloat(threeRow.qtyTwo) > parseFloat(oneRow.packQty)) { |
|
|
|
message.warning('数量最多为' + oneRow.packQty) |
|
|
|
threeRow.qtyTwo = oneRow.packQty |
|
|
|