Browse Source

HL-6164WMS采购收货申请针对EDI数据来源生成标签时可以同时生成托标签&箱标签

hella_online_20241011
yufei_wang 2 months ago
parent
commit
c3eee8c10f
  1. 3
      src/components/LabelForm/index.ts
  2. 622
      src/components/LabelForm/src/LabelForm.vue
  3. 174
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  4. 155
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

3
src/components/LabelForm/index.ts

@ -0,0 +1,3 @@
import LabelForm from './src/LabelForm.vue'
export { LabelForm }

622
src/components/LabelForm/src/LabelForm.vue

@ -0,0 +1,622 @@
<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"
>
<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">
<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="batch" align="center" />
<el-table-column label="数量" width="100" prop="qty" align="center" />
<el-table-column label="计量单位" width="100" 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="100" prop="packUnit" align="center" />
<el-table-column label="箱数量" width="100" 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>
</el-dialog>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as accuracyFun from '@/utils/calculate'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const message = useMessage() //
const { t } = useI18n() //
const props = defineProps({
//
tableAllSchemas: {
type: Array,
required: true,
default: null
}
})
const dialogTableVisible = ref(false)
const defaultExpandAll = ref(false)
const tableData = ref([])
const isLoading = ref(false)
const oneId = ref(0) //id
const twoId = ref(0) //id
const openLabel = async (tableList) => {
dialogTableVisible.value = true
tableData.value = tableList
defaultExpandAll.value = false
await intData()
}
const currentPage = ref(1)
const pageSize = ref(10)
const showTableData = () => {
if (tableData.value.length > 10) {
return tableData.value.slice(
(currentPage.value - 1) * pageSize.value,
currentPage.value * pageSize.value
)
} else {
return tableData.value
}
}
const intData = async () => {
tableData.value.forEach((row) => {
expandChange(row)
})
}
const expandChange = (row: any, expandedRows: any[]) => {
//
if (row.secondPackUnit && row.secondPackQty && row.packUnit && row.packQty) {
//
row.allXiangQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty))
//
row.manXiangQty = Math.floor(parseFloat(row.qty) / parseFloat(row.packQty))
// /
row.otherNumber = Math.floor(parseFloat(row.secondPackQty) / parseFloat(row.packQty))
// %
row.allTuoQty = Math.ceil(parseFloat(row.allXiangQty) / parseFloat(row.otherNumber))
//
row.manTuoQty = Math.floor(parseFloat(row.manXiangQty) / 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)
//
row.lastNumber =
parseFloat(row.qty) >= parseFloat(row.tuoInManNumber)
? accuracyFun.subtract(parseFloat(row.qty), parseFloat(row.tuoInManNumber))
: parseFloat(row.qty)
//
row.packageList = []
for (let i = 0; i < row.allTuoQty; i++) {
oneId.value++
//
row.packageList[i] = {
id: oneId.value,
// tPoNumber: i + 1,
xNumber: '',
qtyOne: '',
isTuo: 1 //
}
//
if (row.lastNumber) {
//
if (i == row.allTuoQty - 1) {
row.packageList[i].xNumber = Math.ceil(row.lastNumber / parseFloat(row.packQty))
row.packageList[i].qtyOne = row.lastNumber
} else {
//
row.packageList[i].xNumber = row.otherNumber
row.packageList[i].qtyOne = parseFloat(row.otherNumber) * parseFloat(row.packQty)
}
} else {
// ,
row.packageList[i].xNumber = row.otherNumber
row.packageList[i].qtyOne = accuracyFun.multiply(
parseFloat(row.otherNumber),
parseFloat(row.packQty)
)
}
}
//
if (row.packUnit && row.packQty) {
row.packageList.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 j = 0; j < cur.xNumber; j++) {
twoId.value++
cur.children[j] = {
id: twoId.value
// xPoNumber: j + 1
}
//
if (cur.xLastNumber) {
//
if (j == cur.xNumber - 1) {
cur.children[j].qtyTwo = cur.xLastNumber
} else {
//
cur.children[j].qtyTwo = row.packQty
}
} else {
// ,
cur.children[j].qtyTwo = row.packQty
}
}
})
}
}
//
if (!row.secondPackUnit && row.packUnit && row.packQty) {
// %
row.allXiangQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty))
row.packageList = []
row.allTuoQty = ''
row.allTuoQty1 = 1
//
for (let i = 0; i < row.allTuoQty1; i++) {
oneId.value++
//
row.packageList[i] = {
id: oneId.value,
// xPoNumber: i + 1,
qtyOne: row.qty,
isTuo: 0 //
}
}
row.packageList.forEach((cur) => {
cur.children = []
for (let j = 0; j < row.allXiangQty; j++) {
twoId.value++
cur.children[j] = {
id: twoId.value
// xPoNumber: j + 1
}
//
cur.lastNumber = parseFloat(row.qty) % parseFloat(row.packQty)
//
if (cur.lastNumber) {
//
if (j == row.allXiangQty - 1) {
cur.children[j].qtyTwo = cur.lastNumber
} else {
//
cur.children[j].qtyTwo = row.packQty
}
} else {
// ,
cur.children[j].qtyTwo = row.packQty
}
}
})
}
}
/** 弹窗按钮 */
let Butttondata: any = []
Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]
/** 按钮事件 */
const buttonBaseClick = (val) => {
//
if (val == 'save') {
submitForm()
}
//
else if (val == 'close') {
dialogTableVisible.value = false
}
}
//
const submitForm = () => {
let isZ = false
console.log(tableData.value)
setTimeout(() => {
tableData.value.forEach((item) => {
item.packageList.forEach((cur, key) => {
cur.tPoNumber = key + 1
if (cur.qtyOne == '' || cur.qtyOne == 0) {
isZ = true
}
cur?.children?.forEach((ele, i) => {
ele.xPoNumber = i + 1
if (ele.qtyTwo == '' || ele.qtyTwo == 0) {
isZ = true
}
})
})
})
if (isZ) {
message.warning('有数量为0或空,请重新填写')
return
}
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 += 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)
// return
// const isBol = arr.some((item) => item == false)
if (obj) {
message.warning(
`物料【${obj.itemCode}】,批次【${obj.batch}】,${obj.packageList.length}托的总和数量【${obj.allNumber}】不等于发货总数量【${obj.qty}`
)
return
}
emit('submitForm', tableData.value)
}, 300)
}
//
const addT = (oneRow) => {
oneId.value++
oneRow.packageList.push({
id: oneId.value,
// tPoNumber:oneRow.packageList.length+1 || 1,
// tPoNumber:
// oneRow?.packageList?.length > 0
// ? oneRow.packageList[oneRow.packageList.length - 1]?.tPoNumber + 1
// : 1, //1
xNumber: '',
qtyOne: '',
isTuo: 1 //
})
oneRow.allTuoQty = oneRow.packageList.length
}
//
const removeT = (oneRow, oneIndex, twoRow, twoIndex) => {
oneRow.packageList = oneRow.packageList.filter((item) => item.id != twoRow.id)
oneRow.allTuoQty = oneRow.packageList.length
}
//
const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => {
twoId.value++
//
if (type == 1) {
//
//
if (parseFloat(twoRow.xNumber) == parseFloat(oneRow.otherNumber)) {
message.warning('每托箱个数最多' + oneRow.otherNumber + '箱')
return
}
twoRow.children.push({
id: twoId.value,
// xPoNumber:
// twoRow?.children?.length > 0
// ? twoRow?.children[twoRow.children.length - 1]?.xPoNumber + 1
// : 1,
qtyTwo: oneRow.packQty
})
twoRow.xNumber = twoRow.children.length
let num = 0
twoRow.children.forEach((item) => {
num = accuracyFun.add(parseFloat(num), parseFloat(item.qtyTwo) || 0)
})
twoRow.qtyOne = num
} else {
//
oneRow.isTuo = 1 //
twoRow.children.push({
id: twoId.value,
qtyTwo: oneRow.packQty
})
//
let num = 0
twoRow.children.forEach((item) => {
num = accuracyFun.add(parseFloat(num), parseFloat(item.qtyTwo))
})
twoRow.qtyOne = num
}
}
//
const removeX = (oneRow, oneIndex, twoRow, twoIndex, threeRow, threeIndex, type) => {
//
if (type == 1) {
//
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
twoRow.xNumber = twoRow.children.length
} else {
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
}
}
//
const getRowClass = (row) => {
if (!row.row.children || row.row.children.length == 0) {
return 'row-expand-cover'
}
}
//
const blurOne = (oneRow, twoRow) => {
if (!twoRow.xNumber) {
twoRow.qtyOne = ''
}
if (parseFloat(twoRow.xNumber) > parseFloat(oneRow.otherNumber)) {
message.warning('每托箱个数最多' + oneRow.otherNumber + '箱')
twoRow.xNumber = oneRow.otherNumber
twoRow.children = []
twoRow.qtyOne = 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
// })
// if (num > oneRow.allPackQty) {
// message.warning('' + oneRow.allPackQty)
// twoRow.xNumber = ''
// twoRow.qtyOne = ''
// return
// }
//
//
if (oneRow.packUnit && oneRow.packQty) {
// oneRow.packageList.forEach((cur, key) => {
twoRow.children = []
//
twoRow.xLastNumber = parseFloat(twoRow.qtyOne) % parseFloat(oneRow.packQty)
for (let j = 0; j < twoRow.xNumber; j++) {
twoId.value++
//
if (twoRow.xLastNumber) {
//
if (j == twoRow.xNumber - 1) {
twoRow.children.push({
id: twoId.value,
// xPoNumber: j + 1,
qtyTwo: twoRow.xLastNumber
})
} else {
//
twoRow.children.push({
id: twoId.value,
// xPoNumber: j + 1,
qtyTwo: oneRow.packQty
})
}
} else {
// ,
twoRow.children.push({
id: twoId.value,
// xPoNumber: j + 1,
qtyTwo: oneRow.packQty
})
}
}
// })
}
}
//
const blurTwo = (oneRow, twoRow, threeRow) => {
if (parseFloat(threeRow.qtyTwo) > parseFloat(oneRow.packQty)) {
message.warning('数量最多为' + oneRow.packQty)
threeRow.qtyTwo = oneRow.packQty
return
}
let num = 0
twoRow.children.forEach((item) => {
num = accuracyFun.add(parseFloat(num), parseFloat(item.qtyTwo))
})
twoRow.qtyOne = num
}
//
const blurThree = (oneRow, twoRow, thereeRow) => {
if (parseFloat(thereeRow.qtyTwo) > parseFloat(oneRow.packQty)) {
message.warning('每箱个数最多' + oneRow.packQty)
thereeRow.qtyTwo = oneRow.packQty
}
let num = 0
twoRow.children.forEach((item) => {
num = accuracyFun.add(parseFloat(num), parseFloat(item.qtyTwo))
})
twoRow.qtyOne = num
}
//
const uomLabel = (row) => {
const obj = getStrDictOptions(DICT_TYPE.UOM).find((item) => item.value == row.uom)
if (obj) {
return obj.label
} else {
return ''
}
}
//
const emit = defineEmits(['submitForm'])
defineExpose({ openLabel, dialogTableVisible, isLoading }) // open
</script>
<style lang="scss" scoped>
::v-deep .row-expand-cover td .el-table__expand-icon {
visibility: hidden;
}
</style>

174
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -106,15 +106,22 @@
@success="getList"
:tableAllSchemas="PurchasereceiptRequestDetailLabel.allSchemas"
:tableFormRules="PurchasereceiptRequestDetailRules"
:tableData="detatableDataLabel.tableList"
:tableData="detatableData1"
:isBusiness="true"
:isShowButton="false"
@searchTableSuccess="searchTableSuccessLabel"
:isShowReduceButton="false"
@clearInput="clearInput"
:footButttondata="footButttondata"
@footButtonClick="footButtonClick"
@formSelectChange="formSelectChangeLabel"
/>
<LabelForm
ref="labelFormRef"
:tableAllSchemas="PurchasereceiptRequestDetailLabel.allSchemas"
@submitForm="submitFormLabel"
@searchTableSuccess="searchTableSuccessLabel"
@formFormDateChange="onChangeLabel"
:key="count"
/>
<!-- 子包装弹窗 -->
<BasicForm
ref="detailParenPackingRef"
@ -187,13 +194,14 @@ import { getJmreportBaseUrl } from '@/utils/systemParam'
import { getReportUrl } from '@/utils/systemParam'
import { dateFormatter2 } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'PurchasereceiptRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const genLabelId = ref(); //ID
// const genLabelId = ref(); //ID
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
@ -437,10 +445,10 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if(val == 'ssbq'){ //
//
detatableDataLabel.params = {
masterId:row.masterId
}
genLabelId.value = row.masterId
// detatableDataLabel.params = {
// masterId:row.masterId
// }
// genLabelId.value = row.masterId
// EDI
if (row.sourceType == 'EDI') {
PurchasereceiptRequestDetailLabel.allSchemas.tableFormColumns.forEach(item => {
@ -455,7 +463,8 @@ const buttonTableClick = async (val, row) => {
}
})
}
await getDetailListList()
await getGenerateLabelList(row)
count.value++
formLabelRef.value.open('create', row, null,'createLabel')// createLabel
}else if (val == 'point') {
//
@ -481,7 +490,6 @@ const checkQualityReport = async (row)=>{
}
//
const isCreateLabel = ref(false)
const formLabelRef = ref()
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailPage
@ -489,34 +497,142 @@ const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
const { getList:getDetailList } = detatableMethods
const { tableObject: detatableDataLabel, tableMethods: detatableMethodLabels } =useTable({
getListApi: PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailLabelList
})
const { getList:getDetailListList } = detatableMethodLabels
// const { tableObject: detatableDataLabel, tableMethods: detatableMethodLabels } =useTable({
// getListApi: PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailLabelList
// })
// const { getList:getDetailListList } = detatableMethodLabels
const count = ref(0)
const footButttondata = ref([
defaultButtons.formNextStepBtn(null), // BOM
defaultButtons.formCloseBtn(null) // BOM
])
const detatableData1 = ref([])
//
const getGenerateLabelList = async (row) => {
const params1 = {
masterId: row.masterId,
pageSize: '500',
pageNo: '1',
sort: '',
by: 'ASC'
}
await PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailLabelList(params1).then((res) => {
detatableData1.value = res
detatableData1.value.forEach((item) => {
// console.log(3333, item?.boxPackaging[0])
item.boxPackaging = item.boxPackaging ? item.boxPackaging : []
item.packUnitInitOptions = item.boxPackaging
item.secondPackUnitInitOptions = item.palletPackaging || []
let obj = item?.boxPackaging[0]
if (obj) {
item.packUnit = obj.packUnit
item.packQty = obj.packQty
}
//
item.secondPackUnit = obj?.parentPackUnit
? obj.parentPackUnit
: item?.secondPackUnitInitOptions[0]?.packUnit
item.secondPackQty = obj?.parentPackUnit
? obj.parentPackQty
: item?.secondPackUnitInitOptions[0]?.packQty
})
})
}
//
const submitFormLabel = async (formType, submitData) => {
let data = {...submitData}
if(data.masterId){
data.id = data.masterId
const clearInput = async (field, row, index) => {
row[field] = ''
row['secondPackQty'] = ''
PurchasereceiptRequestDetailRules.secondPackQty[0].required = false
}
//
const labelFormRef = ref()
const footButtonClick = async (val) => {
if (val == 'nextStep') {
const validateForm = await formLabelRef.value.tableFormRef.validateForm()
if (!validateForm) {
return
}
let isNext = detatableData1.value.some((item) => {
return !item.packUnit || !item.packQty
})
if (isNext) {
message.warning('有数据没有选择箱规格')
return
}
let isNext1 = detatableData1.value.some((item) => {
return (
item.secondPackQty &&
item.packQty &&
parseFloat(item.packQty) > parseFloat(item.secondPackQty)
)
})
if (isNext1) {
message.warning('托的包装数量要大于箱的包装数量,请修改')
return
}
const data = JSON.parse(JSON.stringify(detatableData1.value))
labelFormRef.value.openLabel(data)
} else if (val == 'close') {
formLabelRef.value.dialogVisible = false
}
}
//
const formSelectChangeLabel = (field, val, row) => {
if (field == 'packUnit') {
let obj = row.boxPackaging.find((item) => item.packUnit == val)
if (obj) {
row.packQty = obj.packQty
//
const params1 = {
itemCode: row.itemCode,
packUnit: row.packUnit
}
SupplierdeliverRequestDetailApi.getGenerateLabelParentList(params1).then((res) => {
if (res?.length > 0) {
row.secondPackUnit = res[0].packUnit
row.secondPackQty = res[0].packQty
} else {
row.secondPackUnit = row?.secondPackUnitInitOptions[0]?.packUnit
row.secondPackQty = row?.secondPackUnitInitOptions[0]?.packQty
}
})
} else {
row.packQty = ''
row.secondPackUnit = ''
row.secondPackQty = ''
}
}
//
if (field == 'secondPackUnit') {
let obj = row.secondPackUnitInitOptions.find((item) => item.packUnit == val)
if (obj) {
row.secondPackQty = obj.packQty
} else {
row.secondPackQty = ''
}
}
}
//
const submitFormLabel = async (list) => {
try {
console.log("formType==",formType)
console.log("data==",data)
data.subList = detatableData.tableList
console.log("detatableData",detatableData)
const data = {
subList: list
}
await message.confirm(t('ts.是否为此数据生成标签?'))
await PurchasereceiptRequestMainApi.genLabel(data) //genLabelId.value
isCreateLabel.value = true
message.success('创建标签成功')
labelFormRef.value.isLoading = true
await PurchasereceiptRequestMainApi.genLabel(data)
message.success(t('ts.创建标签成功'))
getList()
} finally {
formLabelRef.value.formLoading = false
formLabelRef.value.dialogVisible = false
buttonBaseClick('refresh',null);
labelFormRef.value.formLoading = false
labelFormRef.value.dialogTableVisible = false
labelFormRef.value.isLoading = false
}
}
const BASE_URL = getJmreportBaseUrl()
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())

155
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

@ -2351,7 +2351,23 @@ export const PurchasereceiptRequestDetailLabel = useCrudSchemas(reactive<CrudSch
}
},
{
label: '包装数量1',
label: '箱规格',
field: 'packUnit',
isTable: true,
sort: 'custom',
form: {
},
tableForm: {
type: 'Select',
labelField: 'packName',
valueField: 'packUnit',
initOptions: [{
label: '',
value: ''
}]
}
},{
label: '箱规格数量',
field: 'packQty',
sort: 'custom',
table: {
@ -2359,75 +2375,31 @@ export const PurchasereceiptRequestDetailLabel = useCrudSchemas(reactive<CrudSch
},
form: {
componentProps: {
disabled: true,
isSearchList: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isTableRowValue: true, //查询当前searchTable表中行数据的值
isMainValue: false
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
disabled: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isTableRowValue: true, //查询当前searchTable表中行数据的值
isMainValue: false
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
isTableForm: true,
isForm: true
disabled:true
}
},
{
label: '包装规格1',
field: 'packUnit',
dictClass: 'string',
label: '托规格',
field: 'secondPackUnit',
isTable: true,
sort: 'custom',
table: {
width: 150,
componentProps: {
disabled: true
}
},
tableForm:{
disabled:true
form: {
},
isTableForm: true,
isForm: true
tableForm: {
type: 'Select',
labelField: 'packName',
valueField: 'packUnit',
initOptions: [{
label: '',
value: ''
}]
}
},
{
label: '包装数量2',
label: '托规格数量',
field: 'secondPackQty',
sort: 'custom',
table: {
@ -2435,72 +2407,11 @@ export const PurchasereceiptRequestDetailLabel = useCrudSchemas(reactive<CrudSch
},
form: {
componentProps: {
disabled: true,
isSearchList: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isTableRowValue: true, //查询当前searchTable表中行数据的值
isMainValue: false
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
disabled: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isTableRowValue: true, //查询当前searchTable表中行数据的值
isMainValue: false
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
isTableForm: true,
isForm: true
},
{
label: '包装规格2',
field: 'secondPackUnit',
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150,
componentProps: {
disabled: true
}
},
tableForm:{
disabled:true
},
isTableForm: true,
isForm: true
}
},
{
label: '供应商计量数量',

Loading…
Cancel
Save