|
@ -5,11 +5,14 @@ |
|
|
border |
|
|
border |
|
|
row-key="id" |
|
|
row-key="id" |
|
|
style="width: 1050px; max-height: 70vh; overflow-y: auto" |
|
|
style="width: 1050px; max-height: 70vh; overflow-y: auto" |
|
|
|
|
|
v-if="tableData.length > 0 && dialogTableVisible == true" |
|
|
|
|
|
@expand-change="expandChange" |
|
|
> |
|
|
> |
|
|
<el-table-column type="expand" width="50"> |
|
|
<el-table-column type="expand" width="50"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<div |
|
|
<div |
|
|
style="margin-left: 400px; margin-top: -8px; margin-bottom: -8px" |
|
|
style="margin-left: 400px; margin-top: -8px; margin-bottom: -8px" |
|
|
|
|
|
v-if="scope.row.secondPackUnit && scope.row.secondPackQty" |
|
|
> |
|
|
> |
|
|
<el-table |
|
|
<el-table |
|
|
:data="scope.row.children" |
|
|
:data="scope.row.children" |
|
@ -62,7 +65,7 @@ |
|
|
</el-table> |
|
|
</el-table> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="托行号" width="100" prop="tPoNumber" align="center" /> |
|
|
<el-table-column label="托行号" width="100" prop="tPoNumber" align="center" /> |
|
|
<el-table-column label="箱个数" width="100" prop="xNumber" align="center"> |
|
|
<el-table-column label="箱个数" width="100" prop="xNumber" align="center"> |
|
|
<template #default="scope1"> |
|
|
<template #default="scope1"> |
|
@ -87,7 +90,7 @@ |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
</div> |
|
|
</div> |
|
|
<!-- <div style="margin-left: 550px; margin-top: -8px; margin-bottom: -8px" v-else> |
|
|
<div style="margin-left: 550px; margin-top: -8px; margin-bottom: -8px" v-else> |
|
|
<el-table :data="scope.row.children" border style="width: 300px" row-key="id"> |
|
|
<el-table :data="scope.row.children" border style="width: 300px" row-key="id"> |
|
|
<el-table-column label="箱行号" width="100" prop="xPoNumber" align="center" /> |
|
|
<el-table-column label="箱行号" width="100" prop="xPoNumber" align="center" /> |
|
|
<el-table-column label="数量" width="100" prop="qtyOne" align="center"> |
|
|
<el-table-column label="数量" width="100" prop="qtyOne" align="center"> |
|
@ -111,18 +114,18 @@ |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
</div> --> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="物料代码" width="150" prop="itemCode" align="center" /> |
|
|
<el-table-column label="物料代码" width="150" prop="itemCode" align="center" /> |
|
|
<el-table-column label="批次" width="150" prop="batch" align="center" /> |
|
|
<el-table-column label="批次" width="150" prop="batch" align="center" /> |
|
|
<el-table-column label="数量" width="100" prop="orderQty" align="center" /> |
|
|
<el-table-column label="数量" width="100" prop="qty" align="center" /> |
|
|
<el-table-column label="计量单位" width="100" prop="uom" align="center" /> |
|
|
<el-table-column label="计量单位" width="100" prop="uom" align="center" /> |
|
|
<el-table-column label="托个数" width="100" prop="packQty1" align="center" /> |
|
|
<el-table-column label="托个数" width="100" prop="allTuoQty" align="center" /> |
|
|
<el-table-column label="托规格" width="100" prop="packUnit" align="center" /> |
|
|
<el-table-column label="托规格" width="100" prop="secondPackUnit" align="center" /> |
|
|
<el-table-column label="托数量" width="100" prop="packQty" align="center" /> |
|
|
<el-table-column label="托数量" width="100" prop="secondPackQty" align="center" /> |
|
|
<el-table-column label="箱规格" width="100" prop="secondPackUnit" align="center" /> |
|
|
<el-table-column label="箱规格" width="100" prop="packUnit" align="center" /> |
|
|
<el-table-column label="箱数量" width="100" prop="secondPackQty" align="center" /> |
|
|
<el-table-column label="箱数量" width="100" prop="packQty" align="center" /> |
|
|
</el-table> |
|
|
</el-table> |
|
|
<template #footer> |
|
|
<template #footer> |
|
|
<slot name="foorter"></slot> |
|
|
<slot name="foorter"></slot> |
|
@ -145,16 +148,126 @@ const props = defineProps({ |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
const dialogTableVisible = ref(false) |
|
|
const dialogTableVisible = ref(false) |
|
|
|
|
|
const defaultExpandAll = ref(false) |
|
|
|
|
|
|
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
|
const openLabel = (tableList) => { |
|
|
const openLabel = (tableList) => { |
|
|
console.log(tableList) |
|
|
console.log(tableList) |
|
|
dialogTableVisible.value = true |
|
|
dialogTableVisible.value = true |
|
|
tableData.value = tableList |
|
|
tableData.value = tableList |
|
|
intData() |
|
|
defaultExpandAll.value = false |
|
|
|
|
|
// intData() |
|
|
|
|
|
intData1() |
|
|
} |
|
|
} |
|
|
const oneId = ref(0) //每托的id |
|
|
const oneId = ref(0) //每托的id |
|
|
const twoId = ref(0) //每箱的id |
|
|
const twoId = ref(0) //每箱的id |
|
|
|
|
|
const intData1 = () => { |
|
|
|
|
|
tableData.value.forEach((row) => { |
|
|
|
|
|
// 数量%托数量 获取总共几托 |
|
|
|
|
|
row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.secondPackQty)) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
const expandChange = (row: any, expandedRows: any[]) => { |
|
|
|
|
|
console.log(row) |
|
|
|
|
|
console.log(expandedRows) |
|
|
|
|
|
// 判断托信息是否存在 |
|
|
|
|
|
if (row.secondPackUnit && row.secondPackQty) { |
|
|
|
|
|
// 数量除以托数量获取余数 |
|
|
|
|
|
row.lastNumber = parseFloat(row.qty) % parseFloat(row.secondPackQty) |
|
|
|
|
|
// 托数量/箱数量 一托可以放几箱 |
|
|
|
|
|
row.otherNumber = parseFloat(row.secondPackQty) / parseFloat(row.packQty) |
|
|
|
|
|
// 数量%托数量 获取总共几托 |
|
|
|
|
|
row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.secondPackQty)) |
|
|
|
|
|
row.children = [] |
|
|
|
|
|
row.isTuo = 1//有托 |
|
|
|
|
|
// 循环托 |
|
|
|
|
|
for (let i = 0; i < row.allTuoQty; i++) { |
|
|
|
|
|
oneId.value++ |
|
|
|
|
|
// 先给所有托一个默认对象值 |
|
|
|
|
|
row.children[i] = { |
|
|
|
|
|
id: oneId.value, |
|
|
|
|
|
tPoNumber: i + 1, |
|
|
|
|
|
xNumber: '', |
|
|
|
|
|
qtyOne: '' |
|
|
|
|
|
} |
|
|
|
|
|
// 如果有余数 |
|
|
|
|
|
if (row.lastNumber) { |
|
|
|
|
|
// 最后一条信息直接展示余数的信息 |
|
|
|
|
|
if (i == row.allTuoQty - 1) { |
|
|
|
|
|
row.children[i].xNumber = Math.ceil(row.lastNumber / parseFloat(row.packQty)) |
|
|
|
|
|
row.children[i].qtyOne = row.lastNumber |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他数据展示一托的全部箱数和全部数量 |
|
|
|
|
|
row.children[i].xNumber = row.otherNumber |
|
|
|
|
|
row.children[i].qtyOne = row.secondPackQty |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果沒有余数,直接展示一托的全部箱数和全部数量 |
|
|
|
|
|
row.children[i].xNumber = row.otherNumber |
|
|
|
|
|
row.children[i].qtyOne = row.secondPackQty |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 判断箱信息是否存在 |
|
|
|
|
|
if (row.packUnit && row.packQty) { |
|
|
|
|
|
row.children.forEach((cur, key) => { |
|
|
|
|
|
cur.children = [] |
|
|
|
|
|
// 数量除以箱数量获取余数 |
|
|
|
|
|
cur.xLastNumber = parseFloat(cur.qtyOne) % parseFloat(row.packQty) |
|
|
|
|
|
// cur.xiangNumber = Math.ceil(parseFloat(cur.qtyOne) / parseFloat(item.secondPackQty)) |
|
|
|
|
|
for (let i = 0; i < cur.xNumber; i++) { |
|
|
|
|
|
twoId.value++ |
|
|
|
|
|
cur.children[i] = { |
|
|
|
|
|
id: twoId.value, |
|
|
|
|
|
xPoNumber: i + 1 |
|
|
|
|
|
} |
|
|
|
|
|
// 如果有余数 |
|
|
|
|
|
if (cur.xLastNumber) { |
|
|
|
|
|
// 最后一条信息直接展示余数的信息 |
|
|
|
|
|
if (i == cur.xNumber - 1) { |
|
|
|
|
|
cur.children[i].qtyTwo = cur.xLastNumber |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他数据展示一托的全部箱数和全部数量 |
|
|
|
|
|
cur.children[i].qtyTwo = row.packQty |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果沒有余数,直接展示一托的全部箱数和全部数量 |
|
|
|
|
|
cur.children[i].qtyTwo = row.packQty |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
// 数量除以箱数量获取余数 |
|
|
|
|
|
row.lastNumber = parseFloat(row.qty) % parseFloat(row.packQty) |
|
|
|
|
|
// 数量%每箱数量 获取总共几箱 |
|
|
|
|
|
row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty)) |
|
|
|
|
|
row.isTuo = 0//无托 |
|
|
|
|
|
row.children = [] |
|
|
|
|
|
// 循环箱 |
|
|
|
|
|
for (let i = 0; i < row.allTuoQty; i++) { |
|
|
|
|
|
oneId.value++ |
|
|
|
|
|
// 先给所有托一个默认对象值 |
|
|
|
|
|
row.children[i] = { |
|
|
|
|
|
id: oneId.value, |
|
|
|
|
|
xPoNumber: i + 1, |
|
|
|
|
|
qtyOne: '' |
|
|
|
|
|
} |
|
|
|
|
|
// 如果有余数 |
|
|
|
|
|
if (row.lastNumber) { |
|
|
|
|
|
// 最后一条信息直接展示余数的信息 |
|
|
|
|
|
if (i == row.allTuoQty - 1) { |
|
|
|
|
|
row.children[i].qtyOne = row.lastNumber |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他数据展示一托的全部箱数和全部数量 |
|
|
|
|
|
row.children[i].qtyOne = row.packQty |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果沒有余数,直接展示一托的全部箱数和全部数量 |
|
|
|
|
|
row.children[i].qtyOne = row.packQty |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
const intData = () => { |
|
|
const intData = () => { |
|
|
// 目前托信息等于包装规格1 |
|
|
// 目前托信息等于包装规格1 |
|
|
tableData.value.forEach((item) => { |
|
|
tableData.value.forEach((item) => { |
|
@ -163,13 +276,13 @@ const intData = () => { |
|
|
// 判断托信息是否存在 |
|
|
// 判断托信息是否存在 |
|
|
if (item.packUnit && item.packQty) { |
|
|
if (item.packUnit && item.packQty) { |
|
|
// 数量除以托数量获取余数 |
|
|
// 数量除以托数量获取余数 |
|
|
item.lastNumber = parseFloat(item.orderQty) % parseFloat(item.packQty) |
|
|
item.lastNumber = parseFloat(item.qty) % parseFloat(item.packQty) |
|
|
// 托数量/箱数量 一托可以放几箱 |
|
|
// 托数量/箱数量 一托可以放几箱 |
|
|
item.otherNumber = parseFloat(item.packQty) / parseFloat(item.secondPackQty) |
|
|
item.otherNumber = parseFloat(item.packQty) / parseFloat(item.secondPackQty) |
|
|
// 数量%每箱数量 获取总共几箱 |
|
|
// 数量%每箱数量 获取总共几箱 |
|
|
item.allPackQty = Math.ceil(parseFloat(item.orderQty) / parseFloat(item.secondPackQty)) |
|
|
item.allPackQty = Math.ceil(parseFloat(item.qty) / parseFloat(item.secondPackQty)) |
|
|
// 数量%托数量 获取总共几托 |
|
|
// 数量%托数量 获取总共几托 |
|
|
item.allTuoQty = Math.ceil(parseFloat(item.orderQty) / parseFloat(item.packQty)) |
|
|
item.allTuoQty = Math.ceil(parseFloat(item.qty) / parseFloat(item.packQty)) |
|
|
item.children = [] |
|
|
item.children = [] |
|
|
// 循环托 |
|
|
// 循环托 |
|
|
for (let i = 0; i < item.packQty1; i++) { |
|
|
for (let i = 0; i < item.packQty1; i++) { |
|
@ -179,30 +292,31 @@ const intData = () => { |
|
|
id: oneId.value, |
|
|
id: oneId.value, |
|
|
tPoNumber: i + 1, |
|
|
tPoNumber: i + 1, |
|
|
xNumber: '', |
|
|
xNumber: '', |
|
|
qtyOne: '' |
|
|
qtyOne: '', |
|
|
|
|
|
children: [] |
|
|
} |
|
|
} |
|
|
// 循环当前数量所需要的托数量 |
|
|
// 循环当前数量所需要的托数量 |
|
|
for (let j = 0; j < item.allTuoQty; j++) { |
|
|
// for (let j = 0; j < item.allTuoQty; j++) { |
|
|
if (i == j) { |
|
|
// if (i == j) { |
|
|
// 如果有余数 |
|
|
// // 如果有余数 |
|
|
if (item.lastNumber) { |
|
|
// if (item.lastNumber) { |
|
|
// 最后一条信息直接展示余数的信息 |
|
|
// // 最后一条信息直接展示余数的信息 |
|
|
if (j == item.allTuoQty - 1) { |
|
|
// if (j == item.allTuoQty - 1) { |
|
|
item.children[j].xNumber = Math.ceil(item.lastNumber / parseFloat(item.secondPackQty)) |
|
|
// item.children[j].xNumber = Math.ceil(item.lastNumber / parseFloat(item.secondPackQty)) |
|
|
item.children[j].qtyOne = item.lastNumber |
|
|
// item.children[j].qtyOne = item.lastNumber |
|
|
}else{ |
|
|
// }else{ |
|
|
// 其他数据展示一托的全部箱数和全部数量 |
|
|
// // 其他数据展示一托的全部箱数和全部数量 |
|
|
item.children[j].xNumber = item.otherNumber |
|
|
// item.children[j].xNumber = item.otherNumber |
|
|
item.children[j].qtyOne = item.packQty |
|
|
// item.children[j].qtyOne = item.packQty |
|
|
} |
|
|
// } |
|
|
}else{ |
|
|
// }else{ |
|
|
// 如果沒有余数,直接展示一托的全部箱数和全部数量 |
|
|
// // 如果沒有余数,直接展示一托的全部箱数和全部数量 |
|
|
item.children[j].xNumber = item.otherNumber |
|
|
// item.children[j].xNumber = item.otherNumber |
|
|
item.children[j].qtyOne = item.packQty |
|
|
// item.children[j].qtyOne = item.packQty |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
} |
|
|
// } |
|
|
} |
|
|
// } |
|
|
} |
|
|
} |
|
|
// 判断箱信息是否存在 |
|
|
// 判断箱信息是否存在 |
|
|
if (item.secondPackUnit && item.secondPackQty) { |
|
|
if (item.secondPackUnit && item.secondPackQty) { |
|
@ -213,9 +327,9 @@ const intData = () => { |
|
|
// cur.xiangNumber = Math.ceil(parseFloat(cur.qtyOne) / parseFloat(item.secondPackQty)) |
|
|
// cur.xiangNumber = Math.ceil(parseFloat(cur.qtyOne) / parseFloat(item.secondPackQty)) |
|
|
for (let i = 0; i < cur.xNumber; i++) { |
|
|
for (let i = 0; i < cur.xNumber; i++) { |
|
|
twoId.value++ |
|
|
twoId.value++ |
|
|
cur.children[i]={ |
|
|
cur.children[i] = { |
|
|
id: twoId.value, |
|
|
id: twoId.value, |
|
|
xPoNumber: i + 1, |
|
|
xPoNumber: i + 1 |
|
|
} |
|
|
} |
|
|
// 如果有余数 |
|
|
// 如果有余数 |
|
|
if (cur.xLastNumber) { |
|
|
if (cur.xLastNumber) { |
|
@ -235,11 +349,11 @@ const intData = () => { |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
// 数量除以箱数量获取余数 |
|
|
// 数量除以箱数量获取余数 |
|
|
item.lastNumber = parseFloat(item.orderQty) % parseFloat(item.secondPackQty) |
|
|
item.lastNumber = parseFloat(item.qty) % parseFloat(item.secondPackQty) |
|
|
// 数量%每箱数量 获取总共几箱 |
|
|
// 数量%每箱数量 获取总共几箱 |
|
|
item.allPackQty = Math.ceil(parseFloat(item.orderQty) / parseFloat(item.secondPackQty)) |
|
|
item.allPackQty = Math.ceil(parseFloat(item.qty) / parseFloat(item.secondPackQty)) |
|
|
item.children = [] |
|
|
item.children = [] |
|
|
console.log(333,item.lastNumber) |
|
|
console.log(333, item.lastNumber) |
|
|
// 循环箱 |
|
|
// 循环箱 |
|
|
for (let i = 0; i < item.packQty1; i++) { |
|
|
for (let i = 0; i < item.packQty1; i++) { |
|
|
oneId.value++ |
|
|
oneId.value++ |
|
@ -249,31 +363,27 @@ const intData = () => { |
|
|
xPoNumber: i + 1, |
|
|
xPoNumber: i + 1, |
|
|
qtyOne: '' |
|
|
qtyOne: '' |
|
|
} |
|
|
} |
|
|
console.log(444,item.allPackQty) |
|
|
// 循环当前数量所需要的箱数量 |
|
|
// 循环当前数量所需要的箱数量 |
|
|
for (let j = 0; j < item.allPackQty; j++) { |
|
|
for (let j = 0; j < item.allPackQty; j++) { |
|
|
|
|
|
if (i == j) { |
|
|
if (i == j) { |
|
|
// 如果有余数 |
|
|
// 如果有余数 |
|
|
if (item.lastNumber) { |
|
|
if (item.lastNumber) { |
|
|
// 最后一条信息直接展示余数的信息 |
|
|
// 最后一条信息直接展示余数的信息 |
|
|
if (j == item.allPackQty - 1) { |
|
|
if (j == item.allPackQty - 1) { |
|
|
item.children[j].qtyOne = item.lastNumber |
|
|
item.children[j].qtyOne = item.lastNumber |
|
|
}else{ |
|
|
} else { |
|
|
// 其他数据展示一托的全部箱数和全部数量 |
|
|
// 其他数据展示一托的全部箱数和全部数量 |
|
|
item.children[j].qtyOne = item.secondPackQty |
|
|
item.children[j].qtyOne = item.secondPackQty |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
} else { |
|
|
// 如果沒有余数,直接展示一托的全部箱数和全部数量 |
|
|
// 如果沒有余数,直接展示一托的全部箱数和全部数量 |
|
|
item.children[j].qtyOne = item.secondPackQty |
|
|
item.children[j].qtyOne = item.secondPackQty |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
console.log(111, tableData.value) |
|
|
|
|
|
} |
|
|
} |
|
|
/** 弹窗按钮 */ |
|
|
/** 弹窗按钮 */ |
|
|
let Butttondata: any = [] |
|
|
let Butttondata: any = [] |
|
@ -302,7 +412,7 @@ const submitForm = () => { |
|
|
item.allNumber += parseFloat(cur.qtyOne) || 0 |
|
|
item.allNumber += parseFloat(cur.qtyOne) || 0 |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
if (item.allNumber == parseFloat(item.orderQty)) { |
|
|
if (item.allNumber == parseFloat(item.qty)) { |
|
|
return true |
|
|
return true |
|
|
} else { |
|
|
} else { |
|
|
return false |
|
|
return false |
|
@ -319,16 +429,16 @@ const addT = (oneRow) => { |
|
|
oneId.value++ |
|
|
oneId.value++ |
|
|
oneRow.children.push({ |
|
|
oneRow.children.push({ |
|
|
id: oneId.value, |
|
|
id: oneId.value, |
|
|
tPoNumber: oneRow.children[oneRow.children.length - 1].tPoNumber + 1, //行号是上一行的行号加1 |
|
|
tPoNumber: (oneRow.children[oneRow.children.length - 1]?.tPoNumber || 0) + 1, //行号是上一行的行号加1 |
|
|
xNumber: '', |
|
|
xNumber: '', |
|
|
qtyOne: '' |
|
|
qtyOne: '' |
|
|
}) |
|
|
}) |
|
|
oneRow.packQty1 = oneRow.children.length |
|
|
oneRow.allTuoQty = oneRow.children.length |
|
|
} |
|
|
} |
|
|
// 移出托 |
|
|
// 移出托 |
|
|
const removeT = (oneRow, oneIndex, twoRow, twoIndex) => { |
|
|
const removeT = (oneRow, oneIndex, twoRow, twoIndex) => { |
|
|
oneRow.children.splice(twoIndex, 1) |
|
|
oneRow.children.splice(twoIndex, 1) |
|
|
oneRow.packQty1 = oneRow.children.length |
|
|
oneRow.allTuoQty = oneRow.children.length |
|
|
} |
|
|
} |
|
|
// 添加箱 |
|
|
// 添加箱 |
|
|
const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => { |
|
|
const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => { |
|
@ -351,7 +461,7 @@ const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => { |
|
|
xPoNumber: oneRow.children[oneRow.children.length - 1].xPoNumber + 1, |
|
|
xPoNumber: oneRow.children[oneRow.children.length - 1].xPoNumber + 1, |
|
|
qtyOne: '' |
|
|
qtyOne: '' |
|
|
}) |
|
|
}) |
|
|
oneRow.packQty1 = oneRow.children.length |
|
|
oneRow.allTuoQty = oneRow.children.length |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// 移除箱 |
|
|
// 移除箱 |
|
@ -368,7 +478,7 @@ const removeX = (oneRow, oneIndex, twoRow, twoIndex, threeRow, threeIndex, type) |
|
|
twoRow.xNumber = twoRow.children.length |
|
|
twoRow.xNumber = twoRow.children.length |
|
|
} else { |
|
|
} else { |
|
|
oneRow.children.splice(twoIndex, 1) |
|
|
oneRow.children.splice(twoIndex, 1) |
|
|
oneRow.packQty1 = oneRow.children.length |
|
|
oneRow.allTuoQty = oneRow.children.length |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// 是否显示展开图标 |
|
|
// 是否显示展开图标 |
|
@ -379,14 +489,16 @@ const getRowClass = (row) => { |
|
|
} |
|
|
} |
|
|
// 托失去焦点 |
|
|
// 托失去焦点 |
|
|
const blurOne = (oneRow, twoRow) => { |
|
|
const blurOne = (oneRow, twoRow) => { |
|
|
|
|
|
if (!twoRow.xNumber) { |
|
|
|
|
|
twoRow.qtyOne = '' |
|
|
|
|
|
} |
|
|
if (parseFloat(twoRow.xNumber) > parseFloat(oneRow.otherNumber)) { |
|
|
if (parseFloat(twoRow.xNumber) > parseFloat(oneRow.otherNumber)) { |
|
|
message.warning('每托箱个数最多' + oneRow.otherNumber + '箱') |
|
|
message.warning('每托箱个数最多' + oneRow.otherNumber + '箱') |
|
|
twoRow.xNumber = oneRow.otherNumber |
|
|
twoRow.xNumber = oneRow.otherNumber |
|
|
twoRow.children = [] |
|
|
twoRow.children = [] |
|
|
twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.secondPackQty) |
|
|
twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty) |
|
|
return |
|
|
|
|
|
} |
|
|
} |
|
|
twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.secondPackQty) |
|
|
twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty) |
|
|
let num = 0 |
|
|
let num = 0 |
|
|
oneRow.children.forEach((item) => { |
|
|
oneRow.children.forEach((item) => { |
|
|
num += parseFloat(item.xNumber) || 0 |
|
|
num += parseFloat(item.xNumber) || 0 |
|
@ -399,11 +511,11 @@ const blurOne = (oneRow, twoRow) => { |
|
|
} |
|
|
} |
|
|
// 托信息修改的時候箱数据自动排列 |
|
|
// 托信息修改的時候箱数据自动排列 |
|
|
// 判断箱信息是否存在 |
|
|
// 判断箱信息是否存在 |
|
|
if (oneRow.secondPackUnit && oneRow.secondPackQty) { |
|
|
if (oneRow.packUnit && oneRow.packQty) { |
|
|
oneRow.children.forEach((cur, key) => { |
|
|
oneRow.children.forEach((cur, key) => { |
|
|
cur.children = [] |
|
|
cur.children = [] |
|
|
// 数量除以托数量获取余数 |
|
|
// 数量除以托数量获取余数 |
|
|
cur.xLastNumber = parseFloat(cur.xNumber) % parseFloat(oneRow.secondPackQty) |
|
|
cur.xLastNumber = parseFloat(cur.xNumber) % parseFloat(oneRow.packQty) |
|
|
for (let j = 0; j < cur.xNumber; j++) { |
|
|
for (let j = 0; j < cur.xNumber; j++) { |
|
|
twoId.value++ |
|
|
twoId.value++ |
|
|
// 如果有余数 |
|
|
// 如果有余数 |
|
@ -420,7 +532,7 @@ const blurOne = (oneRow, twoRow) => { |
|
|
cur.children.push({ |
|
|
cur.children.push({ |
|
|
id: twoId.value, |
|
|
id: twoId.value, |
|
|
xPoNumber: j + 1, |
|
|
xPoNumber: j + 1, |
|
|
qtyTwo: oneRow.secondPackQty |
|
|
qtyTwo: oneRow.packQty |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
@ -428,7 +540,7 @@ const blurOne = (oneRow, twoRow) => { |
|
|
cur.children.push({ |
|
|
cur.children.push({ |
|
|
id: twoId.value, |
|
|
id: twoId.value, |
|
|
xPoNumber: j + 1, |
|
|
xPoNumber: j + 1, |
|
|
qtyTwo: oneRow.secondPackQty |
|
|
qtyTwo: oneRow.packQty |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -438,10 +550,10 @@ const blurOne = (oneRow, twoRow) => { |
|
|
//在托下方的箱数量失去焦点 |
|
|
//在托下方的箱数量失去焦点 |
|
|
const blurTwo = (oneRow, twoRow, threeRow) => { |
|
|
const blurTwo = (oneRow, twoRow, threeRow) => { |
|
|
console.log(parseFloat(threeRow.qtyTwo)) |
|
|
console.log(parseFloat(threeRow.qtyTwo)) |
|
|
console.log(parseFloat(oneRow.secondPackQty)) |
|
|
console.log(parseFloat(oneRow.packQty)) |
|
|
if (parseFloat(threeRow.qtyTwo) > parseFloat(oneRow.secondPackQty)) { |
|
|
if (parseFloat(threeRow.qtyTwo) > parseFloat(oneRow.packQty)) { |
|
|
message.warning('数量最多为' + oneRow.secondPackQty) |
|
|
message.warning('数量最多为' + oneRow.packQty) |
|
|
threeRow.qtyTwo = oneRow.secondPackQty |
|
|
threeRow.qtyTwo = oneRow.packQty |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
let num = 0 |
|
|
let num = 0 |
|
@ -452,9 +564,9 @@ const blurTwo = (oneRow, twoRow, threeRow) => { |
|
|
} |
|
|
} |
|
|
// 箱数量失去焦点 |
|
|
// 箱数量失去焦点 |
|
|
const blurThree = (oneRow, twoRow) => { |
|
|
const blurThree = (oneRow, twoRow) => { |
|
|
if (parseFloat(twoRow.qtyOne) > parseFloat(oneRow.secondPackQty)) { |
|
|
if (parseFloat(twoRow.qtyOne) > parseFloat(oneRow.packQty)) { |
|
|
message.warning('每箱个数最多' + oneRow.secondPackQty) |
|
|
message.warning('每箱个数最多' + oneRow.packQty) |
|
|
twoRow.qtyOne = oneRow.secondPackQty |
|
|
twoRow.qtyOne = oneRow.packQty |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
defineExpose({ openLabel }) // 提供 open 方法,用于打开弹窗 |
|
|
defineExpose({ openLabel }) // 提供 open 方法,用于打开弹窗 |
|
|