|
|
@ -1,185 +1,188 @@ |
|
|
|
<template> |
|
|
|
<el-dialog v-model="dialogTableVisible" title="标签" width="1100"> |
|
|
|
<div v-loading="isLoading"> |
|
|
|
<el-table |
|
|
|
:data="showTableData()" |
|
|
|
border |
|
|
|
row-key="id" |
|
|
|
style="width: 1050px; max-height: 70vh; overflow-y: auto" |
|
|
|
v-if="tableData.length > 0 && dialogTableVisible == true" |
|
|
|
|
|
|
|
> |
|
|
|
<el-table-column type="expand" width="50"> |
|
|
|
<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 |
|
|
|
" |
|
|
|
> |
|
|
|
<el-table |
|
|
|
:data="scope.row.packageList" |
|
|
|
border |
|
|
|
style="width: 550px" |
|
|
|
row-key="id" |
|
|
|
:row-class-name="getRowClass" |
|
|
|
<div v-loading="isLoading"> |
|
|
|
<el-table |
|
|
|
:data="showTableData()" |
|
|
|
border |
|
|
|
row-key="id" |
|
|
|
style="width: 1050px; max-height: 70vh; overflow-y: auto" |
|
|
|
v-if="tableData.length > 0 && dialogTableVisible == true" |
|
|
|
> |
|
|
|
<el-table-column type="expand" width="50"> |
|
|
|
<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 |
|
|
|
" |
|
|
|
> |
|
|
|
<el-table-column type="expand" width="50"> |
|
|
|
<template #default="scope1"> |
|
|
|
<div style="margin-left: 150px; margin-top: -8px; margin-bottom: -8px"> |
|
|
|
<el-table :data="scope1.row.children" border style="width: 300px" row-key="id"> |
|
|
|
<el-table-column label="箱行号" width="100" prop="xPoNumber" align="center"> |
|
|
|
<template #default="scope2"> |
|
|
|
{{ scope2.$index + 1 }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="数量" width="100" prop="qtyTwo" align="center"> |
|
|
|
<template #default="scope2"> |
|
|
|
<el-input |
|
|
|
v-model="scope2.row.qtyTwo" |
|
|
|
@blur="blurTwo(scope.row, scope1.row, scope2.row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="添加箱" width="100" prop="add" align="center"> |
|
|
|
<template #header> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
link |
|
|
|
@click="addX(scope.row, scope.$index, scope1.row, scope1.$index, 1)" |
|
|
|
>添加箱</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
<template #default="scope2"> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
link |
|
|
|
@click=" |
|
|
|
removeX( |
|
|
|
scope.row, |
|
|
|
scope.$index, |
|
|
|
scope1.row, |
|
|
|
scope1.$index, |
|
|
|
scope2.row, |
|
|
|
scope2.$index, |
|
|
|
1 |
|
|
|
) |
|
|
|
" |
|
|
|
>移出</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="托行号" width="100" prop="tPoNumber" align="center"> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.$index + 1 }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="箱个数" width="100" prop="xNumber" align="center"> |
|
|
|
<template #default="scope1"> |
|
|
|
<el-input |
|
|
|
v-model="scope1.row.xNumber" |
|
|
|
@input="blurOne(scope.row, scope1.row)" |
|
|
|
onkeyup="value=value.replace(/\D/g,'')" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="数量" width="100" prop="qtyOne" align="center" /> |
|
|
|
<el-table-column label="操作" width="100" prop="action" align="center"> |
|
|
|
<template #default="scope1"> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
link |
|
|
|
@click="removeT(scope.row, scope.$index, scope1.row, scope1.$index)" |
|
|
|
>移出</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="添加托" width="100" prop="add" align="center"> |
|
|
|
<template #header> |
|
|
|
<el-button type="primary" link @click="addT(scope.row)">添加托</el-button> |
|
|
|
</template> |
|
|
|
</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 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"> |
|
|
|
<el-table |
|
|
|
:data="scope.row.packageList" |
|
|
|
border |
|
|
|
style="width: 550px" |
|
|
|
row-key="id" |
|
|
|
:row-class-name="getRowClass" |
|
|
|
> |
|
|
|
<el-table-column type="expand" width="50"> |
|
|
|
<template #default="scope1"> |
|
|
|
{{ scope1.$index + 1 }} |
|
|
|
<div style="margin-left: 150px; margin-top: -8px; margin-bottom: -8px"> |
|
|
|
<el-table |
|
|
|
:data="scope1.row.children" |
|
|
|
border |
|
|
|
style="width: 300px" |
|
|
|
row-key="id" |
|
|
|
> |
|
|
|
<el-table-column label="箱行号" width="100" prop="xPoNumber" align="center"> |
|
|
|
<template #default="scope2"> |
|
|
|
{{ scope2.$index + 1 }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="数量" width="100" prop="qtyTwo" align="center"> |
|
|
|
<template #default="scope2"> |
|
|
|
<el-input |
|
|
|
v-model="scope2.row.qtyTwo" |
|
|
|
@blur="blurTwo(scope.row, scope1.row, scope2.row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="添加箱" width="100" prop="add" align="center"> |
|
|
|
<template #header> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
link |
|
|
|
@click="addX(scope.row, scope.$index, scope1.row, scope1.$index, 1)" |
|
|
|
>添加箱</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
<template #default="scope2"> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
link |
|
|
|
@click=" |
|
|
|
removeX( |
|
|
|
scope.row, |
|
|
|
scope.$index, |
|
|
|
scope1.row, |
|
|
|
scope1.$index, |
|
|
|
scope2.row, |
|
|
|
scope2.$index, |
|
|
|
1 |
|
|
|
) |
|
|
|
" |
|
|
|
>移出</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="数量" width="100" prop="qtyOne" align="center"> |
|
|
|
<el-table-column label="托行号" width="100" prop="tPoNumber" align="center"> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.$index + 1 }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="箱个数" width="100" prop="xNumber" align="center"> |
|
|
|
<template #default="scope1"> |
|
|
|
<el-input |
|
|
|
v-model="scope1.row.qtyTwo" |
|
|
|
@blur="blurThree(scope.row, item, scope1.row)" |
|
|
|
v-model="scope1.row.xNumber" |
|
|
|
@input="blurOne(scope.row, scope1.row)" |
|
|
|
onkeyup="value=value.replace(/\D/g,'')" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="添加箱" width="100" prop="add" align="center"> |
|
|
|
<template #header> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
link |
|
|
|
@click="addX(scope.row, scope.$index, item, index)" |
|
|
|
>添加箱</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
<el-table-column label="数量" width="100" prop="qtyOne" align="center" /> |
|
|
|
<el-table-column label="操作" width="100" prop="action" align="center"> |
|
|
|
<template #default="scope1"> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
link |
|
|
|
@click=" |
|
|
|
removeX(scope.row, scope.$index, item, index, scope1.row, scope1.$index) |
|
|
|
" |
|
|
|
@click="removeT(scope.row, scope.$index, scope1.row, scope1.$index)" |
|
|
|
>移出</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="添加托" width="100" prop="add" align="center"> |
|
|
|
<template #header> |
|
|
|
<el-button type="primary" link @click="addT(scope.row)">添加托</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="品番" width="150" prop="itemCode" align="center" /> |
|
|
|
<el-table-column label="背番" width="150" prop="backNumber" align="center" /> |
|
|
|
<el-table-column label="批次" width="150" prop="batch" align="center" /> |
|
|
|
<el-table-column label="库存数量" width="150" prop="balanceQty" align="center" /> |
|
|
|
<el-table-column label="库存计量单位" width="150" prop="uom" align="center"> |
|
|
|
<template #default="scope"> {{ uomLabel(scope.row) }}</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column label="托个数" width="100" prop="allTuoQty" align="center" /> |
|
|
|
<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="qtyOne" align="center"> |
|
|
|
<template #default="scope1"> |
|
|
|
<el-input |
|
|
|
v-model="scope1.row.qtyTwo" |
|
|
|
@blur="blurThree(scope.row, item, scope1.row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="添加箱" width="100" prop="add" align="center"> |
|
|
|
<template #header> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
link |
|
|
|
@click="addX(scope.row, scope.$index, item, index)" |
|
|
|
>添加箱</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
<template #default="scope1"> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
link |
|
|
|
@click=" |
|
|
|
removeX(scope.row, scope.$index, item, index, scope1.row, scope1.$index) |
|
|
|
" |
|
|
|
>移出</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="品番" width="150" prop="itemCode" align="center" /> |
|
|
|
<el-table-column label="背番" width="150" prop="backNumber" align="center" /> |
|
|
|
<el-table-column label="批次" width="150" prop="batch" align="center" /> |
|
|
|
<el-table-column label="库存数量" width="150" prop="balanceQty" align="center" /> |
|
|
|
<el-table-column label="库存计量单位" width="150" prop="uom" align="center"> |
|
|
|
<template #default="scope"> {{ uomLabel(scope.row) }}</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column label="托个数" width="100" prop="allTuoQty" align="center" /> |
|
|
|
<el-table-column label="托规格" width="100" prop="secondPackUnit" align="center" /> |
|
|
|
<el-table-column label="托数量" width="100" prop="secondPackQty" align="center" /> --> |
|
|
|
<el-table-column label="包装规格" width="200" prop="packUnit" align="center" /> |
|
|
|
<el-table-column label="库存标包数量" width="200" prop="packQty" align="center" /> |
|
|
|
</el-table> |
|
|
|
<el-pagination |
|
|
|
v-show="tableData.length > 10" |
|
|
|
style="margin-top: 10px" |
|
|
|
v-model:current-page="currentPage" |
|
|
|
v-model:page-size="pageSize" |
|
|
|
:small="true" |
|
|
|
:background="false" |
|
|
|
layout="total, prev, pager, next, jumper" |
|
|
|
:total="tableData.length" |
|
|
|
/> |
|
|
|
<div style="text-align: right;margin-top:10px"> |
|
|
|
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" /> |
|
|
|
<el-table-column label="包装规格" width="200" prop="packUnit" align="center" /> |
|
|
|
<el-table-column label="库存标包数量" width="200" prop="packQty" align="center" /> |
|
|
|
</el-table> |
|
|
|
<el-pagination |
|
|
|
v-show="tableData.length > 10" |
|
|
|
style="margin-top: 10px" |
|
|
|
v-model:current-page="currentPage" |
|
|
|
v-model:page-size="pageSize" |
|
|
|
:small="true" |
|
|
|
:background="false" |
|
|
|
layout="total, prev, pager, next, jumper" |
|
|
|
:total="tableData.length" |
|
|
|
/> |
|
|
|
<div style="text-align: right; margin-top: 10px"> |
|
|
|
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
|
<script setup lang="ts"> |
|
|
@ -449,7 +452,7 @@ const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => { |
|
|
|
// 有父级托的时候 |
|
|
|
if (type == 1) { |
|
|
|
// 在托下添加箱 |
|
|
|
// 在托下添加箱 |
|
|
|
// 在托下添加箱 |
|
|
|
if (parseFloat(twoRow.xNumber) == parseFloat(oneRow.otherNumber)) { |
|
|
|
message.warning('每托箱个数最多' + oneRow.otherNumber + '箱') |
|
|
|
return |
|
|
@ -524,7 +527,7 @@ const blurOne = (oneRow, twoRow) => { |
|
|
|
} |
|
|
|
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 |
|
|
@ -588,9 +591,12 @@ const blurTwo = (oneRow, twoRow, threeRow) => { |
|
|
|
} |
|
|
|
// 箱数量失去焦点 |
|
|
|
const blurThree = (oneRow, twoRow, thereeRow) => { |
|
|
|
if (parseFloat(thereeRow.qtyTwo) > parseFloat(oneRow.packQty)) { |
|
|
|
message.warning('每箱个数最多' + oneRow.packQty) |
|
|
|
thereeRow.qtyTwo = oneRow.packQty |
|
|
|
console.log('yeyeye', oneRow) |
|
|
|
if (oneRow.allowOverShipment != 'TRUE') { |
|
|
|
if (parseFloat(thereeRow.qtyTwo) > parseFloat(oneRow.packQty)) { |
|
|
|
message.warning('每箱个数最多' + oneRow.packQty) |
|
|
|
thereeRow.qtyTwo = oneRow.packQty |
|
|
|
} |
|
|
|
} |
|
|
|
let num = 0 |
|
|
|
twoRow.children.forEach((item) => { |
|
|
@ -611,7 +617,6 @@ const uomLabel = (row) => { |
|
|
|
// 传递给父类 |
|
|
|
const emit = defineEmits(['submitForm']) |
|
|
|
defineExpose({ openLabel, dialogTableVisible, isLoading }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
::v-deep .row-expand-cover td .el-table__expand-icon { |
|
|
|