Browse Source

SCP 供应商发票申请 生成标签时 既有箱规格,也有托规格。计算结果不对

hella_online_20240829
zhang_li 4 months ago
parent
commit
d46613c384
  1. 58
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue

58
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue

@ -69,7 +69,7 @@
<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">
<el-input v-model="scope1.row.xNumber" @blur="blurOne(scope.row, scope1.row)" /> <el-input v-model="scope1.row.xNumber" @blur="blurOne(scope.row, scope1.row)" onkeyup="value=value.replace(/\D/g,'')" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" width="100" prop="qtyOne" align="center" /> <el-table-column label="数量" width="100" prop="qtyOne" align="center" />
@ -205,12 +205,22 @@ const intData =async () => {
const expandChange = (row: any, expandedRows: any[]) => { const expandChange = (row: any, expandedRows: any[]) => {
// //
if (row.secondPackUnit && row.secondPackQty) { if (row.secondPackUnit && row.secondPackQty) {
// // // /
row.lastNumber = parseFloat(row.qty) % parseFloat(row.secondPackQty) // row.otherNumber =Math.floor(parseFloat(row.secondPackQty) / parseFloat(row.packQty))
// //
// row.lastNumber = parseFloat(row.qty) % parseFloat(row.secondPackQty)
// // %
// row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.secondPackQty))
//
row.allXiangQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty))
// / // /
row.otherNumber = parseFloat(row.secondPackQty) / parseFloat(row.packQty) row.otherNumber =Math.floor(parseFloat(row.secondPackQty) / parseFloat(row.packQty))
// % // %
row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.secondPackQty)) row.allTuoQty = Math.ceil(parseFloat(row.allXiangQty) / parseFloat(row.otherNumber))
//
row.lastNumber = parseFloat(row.allXiangQty) % parseFloat(row.otherNumber)
row.packageList = [] row.packageList = []
// //
for (let i = 0; i < row.allTuoQty; i++) { for (let i = 0; i < row.allTuoQty; i++) {
@ -232,12 +242,12 @@ const expandChange = (row: any, expandedRows: any[]) => {
} else { } else {
// //
row.packageList[i].xNumber = row.otherNumber row.packageList[i].xNumber = row.otherNumber
row.packageList[i].qtyOne = row.secondPackQty row.packageList[i].qtyOne = parseFloat(row.otherNumber) * parseFloat(row.packQty)
} }
} else { } else {
// , // ,
row.packageList[i].xNumber = row.otherNumber row.packageList[i].xNumber = row.otherNumber
row.packageList[i].qtyOne = row.secondPackQty row.packageList[i].qtyOne = parseFloat(row.otherNumber) * parseFloat(row.packQty)
} }
} }
// //
@ -418,23 +428,23 @@ const blurOne = (oneRow, twoRow) => {
if (!twoRow.xNumber) { if (!twoRow.xNumber) {
twoRow.qtyOne = '' 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.packQty) // twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty)
} // }
twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty) twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty)
let num = 0 // let num = 0
oneRow.packageList.forEach((item) => { // oneRow.packageList.forEach((item) => {
num += parseFloat(item.xNumber) || 0 // num += parseFloat(item.xNumber) || 0
}) // })
if (num > oneRow.allPackQty) { // if (num > oneRow.allPackQty) {
message.warning('总箱数不可以大于' + oneRow.allPackQty) // message.warning('' + oneRow.allPackQty)
twoRow.xNumber = '' // twoRow.xNumber = ''
twoRow.qtyOne = '' // twoRow.qtyOne = ''
return // return
} // }
// //
// //
if (oneRow.packUnit && oneRow.packQty) { if (oneRow.packUnit && oneRow.packQty) {

Loading…
Cancel
Save