Browse Source

SCP 供应商发货申请 生成标签 当数量大于发货数量时,弹出提示的位置不对,不能在页面外。应该在当前页面

hella_online_20240829
zhang_li 4 months ago
parent
commit
5518b96f17
  1. 75
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue

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

@ -139,7 +139,9 @@
<el-button
type="warning"
link
@click="removeX(scope.row, scope.$index, item, index,scope1.row, scope1.$index )"
@click="
removeX(scope.row, scope.$index, item, index, scope1.row, scope1.$index)
"
>移出</el-button
>
</template>
@ -177,7 +179,7 @@
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as accuracyFun from "@/utils/calculate"
import * as accuracyFun from '@/utils/calculate'
const message = useMessage() //
const { t } = useI18n() //
@ -220,9 +222,8 @@ const intData = async () => {
})
}
const expandChange = (row: any, expandedRows: any[]) => {
//
if (row.secondPackUnit && row.secondPackQty&&row.packUnit && row.packQty) {
if (row.secondPackUnit && row.secondPackQty && row.packUnit && row.packQty) {
//
row.allXiangQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty))
//
@ -234,16 +235,16 @@ const expandChange = (row: any, expandedRows: any[]) => {
//
row.manTuoQty = Math.floor(parseFloat(row.manXiangQty) / parseFloat(row.otherNumber))
// **
let num1 = accuracyFun.multiply(parseFloat(row.manTuoQty ),parseFloat(row.otherNumber))
let num1 = accuracyFun.multiply(parseFloat(row.manTuoQty), parseFloat(row.otherNumber))
row.tuoInManNumber = accuracyFun.multiply(num1, parseFloat(row.packQty))
console.log(11,row.tuoInManNumber )
console.log(11, row.tuoInManNumber)
//
row.lastNumber =
parseFloat(row.qty) >= parseFloat(row.tuoInManNumber)
? accuracyFun.subtract( parseFloat(row.qty),parseFloat(row.tuoInManNumber))
? accuracyFun.subtract(parseFloat(row.qty), parseFloat(row.tuoInManNumber))
: parseFloat(row.qty)
//
row.packageList =[]
row.packageList = []
for (let i = 0; i < row.allTuoQty; i++) {
oneId.value++
//
@ -269,7 +270,10 @@ const expandChange = (row: any, expandedRows: any[]) => {
} else {
// ,
row.packageList[i].xNumber = row.otherNumber
row.packageList[i].qtyOne = accuracyFun.multiply( parseFloat(row.otherNumber),parseFloat(row.packQty))
row.packageList[i].qtyOne = accuracyFun.multiply(
parseFloat(row.otherNumber),
parseFloat(row.packQty)
)
}
}
//
@ -282,7 +286,7 @@ const expandChange = (row: any, expandedRows: any[]) => {
for (let j = 0; j < cur.xNumber; j++) {
twoId.value++
cur.children[j] = {
id: twoId.value,
id: twoId.value
// xPoNumber: j + 1
}
//
@ -303,7 +307,7 @@ const expandChange = (row: any, expandedRows: any[]) => {
}
}
//
if(!row.secondPackUnit && row.packUnit && row.packQty){
if (!row.secondPackUnit && row.packUnit && row.packQty) {
// %
row.allXiangQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty))
row.packageList = []
@ -325,7 +329,7 @@ const expandChange = (row: any, expandedRows: any[]) => {
for (let j = 0; j < row.allXiangQty; j++) {
twoId.value++
cur.children[j] = {
id: twoId.value,
id: twoId.value
// xPoNumber: j + 1
}
//
@ -377,8 +381,8 @@ const submitForm = () => {
if (cur.qtyOne == '' || cur.qtyOne == 0) {
isZ = true
}
cur?.children?.forEach((ele,i) => {
ele.xPoNumber = i+1
cur?.children?.forEach((ele, i) => {
ele.xPoNumber = i + 1
if (ele.qtyTwo == '' || ele.qtyTwo == 0) {
isZ = true
}
@ -392,9 +396,14 @@ const submitForm = () => {
let obj = tableData.value.find((item) => {
item.allNumber = 0
item.packageList.forEach((cur) => {
item.allNumber = accuracyFun.add(item.allNumber , parseFloat(cur.qtyOne)?parseFloat(cur.qtyOne):0)
item.allNumber = accuracyFun.add(
item.allNumber,
parseFloat(cur.qtyOne) ? parseFloat(cur.qtyOne) : 0
)
// item.allNumber += parseFloat(cur.qtyOne) || 0
})
console.log(111, item.allNumber)
console.log(222, parseFloat(item.qty))
return item.allNumber != parseFloat(item.qty)
})
console.log(222, obj)
@ -427,7 +436,7 @@ const addT = (oneRow) => {
}
//
const removeT = (oneRow, oneIndex, twoRow, twoIndex) => {
oneRow.packageList= oneRow.packageList.filter(item=>item.id!=twoRow.id)
oneRow.packageList = oneRow.packageList.filter((item) => item.id != twoRow.id)
oneRow.allTuoQty = oneRow.packageList.length
}
//
@ -445,20 +454,24 @@ const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => {
qtyTwo: oneRow.packQty
})
twoRow.xNumber = twoRow.children.length
let num = 0
let num = 0
twoRow.children.forEach((item) => {
num = accuracyFun.add( parseFloat(num),parseFloat(item.qtyTwo) || 0)
num = accuracyFun.add(parseFloat(num), parseFloat(item.qtyTwo) || 0)
})
twoRow.qtyOne = num
} else {
//
oneRow.isTuo= 1 //
oneRow.isTuo = 1 //
twoRow.children.push({
id: twoId.value,
// xPoNumber:
// twoRow.children.length > 0 ? twoRow.children[twoRow.children.length - 1].xPoNumber + 1 : 1,
qtyTwo: oneRow.packQty
})
//
let num = 0
twoRow.children.forEach((item) => {
num = accuracyFun.add(parseFloat(num), parseFloat(item.qtyTwo))
})
twoRow.qtyOne = num
}
}
//
@ -466,15 +479,21 @@ const removeX = (oneRow, oneIndex, twoRow, twoIndex, threeRow, threeIndex, type)
//
if (type == 1) {
//
twoRow.children= twoRow.children.filter(item=>item.id!=threeRow.id)
twoRow.children = twoRow.children.filter((item) => item.id != threeRow.id)
let num = 0
twoRow.children.forEach((item) => {
num = accuracyFun.add( parseFloat(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= twoRow.children.filter(item=>item.id!=threeRow.id)
twoRow.children = twoRow.children.filter((item) => item.id != threeRow.id)
//
let num = 0
twoRow.children.forEach((item) => {
num = accuracyFun.add(parseFloat(num), parseFloat(item.qtyTwo) || 0)
})
twoRow.qtyOne = num
}
}
//
@ -494,8 +513,8 @@ const blurOne = (oneRow, twoRow) => {
// twoRow.children = []
// twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty)
// }
twoRow.qtyOne = parseFloat(twoRow.xNumber) ?
accuracyFun.multiply( 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) => {
@ -554,7 +573,7 @@ const blurTwo = (oneRow, twoRow, threeRow) => {
// }
let num = 0
twoRow.children.forEach((item) => {
num = accuracyFun.add( parseFloat(num),parseFloat(item.qtyTwo))
num = accuracyFun.add(parseFloat(num), parseFloat(item.qtyTwo))
})
twoRow.qtyOne = num
}
@ -566,7 +585,7 @@ const blurThree = (oneRow, twoRow, thereeRow) => {
// }
let num = 0
twoRow.children.forEach((item) => {
num = accuracyFun.add( parseFloat(num),parseFloat(item.qtyTwo))
num = accuracyFun.add(parseFloat(num), parseFloat(item.qtyTwo))
})
twoRow.qtyOne = num
}

Loading…
Cancel
Save