|
|
@ -12,7 +12,12 @@ |
|
|
|
<template #default="scope"> |
|
|
|
<div |
|
|
|
style="margin-left: 400px; margin-top: -8px; margin-bottom: -8px" |
|
|
|
v-if="scope.row.packUnit && scope.row.packQty && scope.row.secondPackUnit && scope.row.secondPackQty" |
|
|
|
v-if=" |
|
|
|
scope.row.packUnit && |
|
|
|
scope.row.packQty && |
|
|
|
scope.row.secondPackUnit && |
|
|
|
scope.row.secondPackQty |
|
|
|
" |
|
|
|
> |
|
|
|
<el-table |
|
|
|
:data="scope.row.packageList" |
|
|
@ -102,13 +107,17 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<div style="margin-left: 550px; margin-top: -8px; margin-bottom: -8px" v-if="scope.row.packUnit && scope.row.packQty && !scope.row.secondPackUnit"> |
|
|
|
<div |
|
|
|
style="margin-left: 550px; margin-top: -8px; margin-bottom: -8px" |
|
|
|
v-if="scope.row.packUnit && scope.row.packQty && !scope.row.secondPackUnit" |
|
|
|
> |
|
|
|
<div v-for="(item, index) in scope.row.packageList" :key="index"> |
|
|
|
<el-table :data="item.children" border style="width: 300px" row-key="id"> |
|
|
|
<el-table-column label="箱行号" width="100" prop="xPoNumber" align="center" > <template #default="scope1"> |
|
|
|
{{ scope1.$index + 1 }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="箱行号" width="100" prop="xPoNumber" align="center"> |
|
|
|
<template #default="scope1"> |
|
|
|
{{ scope1.$index + 1 }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="数量" width="100" prop="qtyOne" align="center"> |
|
|
|
<template #default="scope1"> |
|
|
|
<el-input |
|
|
@ -130,7 +139,7 @@ |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
link |
|
|
|
@click="removeX(scope.row, scope.$index, item, index)" |
|
|
|
@click="removeX(scope.row, scope.$index, item, index,scope1.row, scope1.$index )" |
|
|
|
>移出</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
@ -225,12 +234,12 @@ const expandChange = (row: any, expandedRows: any[]) => { |
|
|
|
// 放满的托数量 |
|
|
|
row.manTuoQty = Math.floor(parseFloat(row.manXiangQty) / parseFloat(row.otherNumber)) |
|
|
|
// 放满的托数量*一托的箱数量*一箱的数量 获取放满的托一共多少数量 |
|
|
|
row.tuoInManNumber = |
|
|
|
parseFloat(row.manTuoQty) * parseFloat(row.otherNumber) * parseFloat(row.packQty) |
|
|
|
let num1 = accuracyFun.multiply(parseFloat(row.manTuoQty ),parseFloat(row.otherNumber)) |
|
|
|
row.tuoInManNumber =accuracyFun.multiply(num1,parseFloat(row.packQty)) |
|
|
|
// 数量除以托数量获取余数 |
|
|
|
row.lastNumber = |
|
|
|
parseFloat(row.qty) > parseFloat(row.tuoInManNumber) |
|
|
|
? parseFloat(row.qty) - parseFloat(row.tuoInManNumber) |
|
|
|
? accuracyFun.subtract( parseFloat(row.qty),parseFloat(row.tuoInManNumber)) |
|
|
|
: parseFloat(row.qty) |
|
|
|
// 循环托 |
|
|
|
row.packageList =[] |
|
|
@ -259,7 +268,7 @@ const expandChange = (row: any, expandedRows: any[]) => { |
|
|
|
} else { |
|
|
|
// 如果沒有余数,直接展示一托的全部箱数和全部数量 |
|
|
|
row.packageList[i].xNumber = row.otherNumber |
|
|
|
row.packageList[i].qtyOne = parseFloat(row.otherNumber) * parseFloat(row.packQty) |
|
|
|
row.packageList[i].qtyOne = accuracyFun.multiply( parseFloat(row.otherNumber),parseFloat(row.packQty)) |
|
|
|
} |
|
|
|
} |
|
|
|
// 判断箱信息是否存在 |
|
|
@ -417,7 +426,7 @@ const addT = (oneRow) => { |
|
|
|
} |
|
|
|
// 移出托 |
|
|
|
const removeT = (oneRow, oneIndex, twoRow, twoIndex) => { |
|
|
|
oneRow.packageList.splice(twoIndex, 1) |
|
|
|
oneRow.packageList= oneRow.packageList.filter(item=>item.id!=twoRow.id) |
|
|
|
oneRow.allTuoQty = oneRow.packageList.length |
|
|
|
} |
|
|
|
// 添加箱 |
|
|
@ -437,7 +446,7 @@ const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => { |
|
|
|
twoRow.xNumber = twoRow.children.length |
|
|
|
let num = 0 |
|
|
|
twoRow.children.forEach((item) => { |
|
|
|
num += parseFloat(item.qtyTwo) || 0 |
|
|
|
num = accuracyFun.add( parseFloat(num),parseFloat(item.qtyTwo) || 0) |
|
|
|
}) |
|
|
|
twoRow.qtyOne = num |
|
|
|
} else { |
|
|
@ -447,9 +456,8 @@ const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => { |
|
|
|
id: twoId.value, |
|
|
|
// xPoNumber: |
|
|
|
// twoRow.children.length > 0 ? twoRow.children[twoRow.children.length - 1].xPoNumber + 1 : 1, |
|
|
|
// qtyTwo: oneRow.packQty |
|
|
|
qtyTwo: oneRow.packQty |
|
|
|
}) |
|
|
|
oneRow.allTuoQty = twoRow.children.length |
|
|
|
} |
|
|
|
} |
|
|
|
// 移除箱 |
|
|
@ -457,16 +465,15 @@ const removeX = (oneRow, oneIndex, twoRow, twoIndex, threeRow, threeIndex, type) |
|
|
|
// 有父级托的时候 |
|
|
|
if (type == 1) { |
|
|
|
// 在托下移除箱 |
|
|
|
twoRow.children.splice(threeIndex, 1) |
|
|
|
twoRow.children= twoRow.children.filter(item=>item.id!=threeRow.id) |
|
|
|
let num = 0 |
|
|
|
twoRow.children.forEach((item) => { |
|
|
|
num += parseFloat(item.qtyTwo) || 0 |
|
|
|
num = accuracyFun.add( parseFloat(num),parseFloat(item.qtyTwo) || 0) |
|
|
|
}) |
|
|
|
twoRow.qtyOne = num |
|
|
|
twoRow.xNumber = twoRow.children.length |
|
|
|
} else { |
|
|
|
twoRow.children.splice(twoIndex, 1) |
|
|
|
oneRow.allTuoQty = twoRow.children.length |
|
|
|
twoRow.children= twoRow.children.filter(item=>item.id!=threeRow.id) |
|
|
|
} |
|
|
|
} |
|
|
|
// 是否显示展开图标 |
|
|
@ -486,7 +493,9 @@ const blurOne = (oneRow, twoRow) => { |
|
|
|
// twoRow.children = [] |
|
|
|
// twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty) |
|
|
|
// } |
|
|
|
twoRow.qtyOne = parseFloat(twoRow.xNumber)? parseFloat(twoRow.xNumber)* parseFloat(oneRow.packQty) : '' |
|
|
|
twoRow.qtyOne = parseFloat(twoRow.xNumber) ? |
|
|
|
accuracyFun.multiply( parseFloat(twoRow.xNumber),parseFloat(oneRow.packQty)) |
|
|
|
: '' |
|
|
|
// let num = 0 |
|
|
|
// oneRow.packageList.forEach((item) => { |
|
|
|
// num += parseFloat(item.xNumber) || 0 |
|
|
@ -544,7 +553,7 @@ const blurTwo = (oneRow, twoRow, threeRow) => { |
|
|
|
// } |
|
|
|
let num = 0 |
|
|
|
twoRow.children.forEach((item) => { |
|
|
|
num += parseFloat(item.qtyTwo) || 0 |
|
|
|
num = accuracyFun.add( parseFloat(num),parseFloat(item.qtyTwo)) |
|
|
|
}) |
|
|
|
twoRow.qtyOne = num |
|
|
|
} |
|
|
@ -556,7 +565,7 @@ const blurThree = (oneRow, twoRow, thereeRow) => { |
|
|
|
// } |
|
|
|
let num = 0 |
|
|
|
twoRow.children.forEach((item) => { |
|
|
|
num += parseFloat(item.qtyTwo) || 0 |
|
|
|
num = accuracyFun.add( parseFloat(num),parseFloat(item.qtyTwo)) |
|
|
|
}) |
|
|
|
twoRow.qtyOne = num |
|
|
|
} |
|
|
|