Browse Source

重新生成标签

master_hella_20240701
张立 7 months ago
parent
commit
81b7051a13
  1. 35
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  2. 6
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue

35
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -623,7 +623,25 @@ const buttonTableClick = async (val, row) => {
masterId: row.masterId masterId: row.masterId
} }
genLabelId.value = row.masterId genLabelId.value = row.masterId
await getDetailList() // await getDetailList()
const params1 = {
masterId: row.masterId,
pageSize: '500',
pageNo: '1',
sort: '',
by: 'ASC'
}
await SupplierdeliverRequestDetailApi.getGenerateLabelList(params1).then((res) => {
detatableData1.value = res
detatableData1.value.forEach((item) => {
console.log(item.boxPackaging)
if (item.boxPackaging?.length > 0) {
item.packUnitInitOptions = item.boxPackaging.map((cur) => {
return { label: cur.packName, value: cur.packUnit }
})
}
})
})
formLabelRef.value.open('create', row, null, 'createLabel') // createLabel formLabelRef.value.open('create', row, null, 'createLabel') // createLabel
} }
}) })
@ -980,15 +998,8 @@ const { getList: getDetailList } = detatableMethods
// //
const submitFormLabel = async (data) => { const submitFormLabel = async (data) => {
try { try {
// console.log('formType==', formType)
// console.log('data==', data)
// data.subList = detatableData.tableList
// if (detatableData.tableList.find((item) => item.secondPackUnit == item.packUnit)) {
// message.warning(t('ts.12'))
// return
// }
const data1 = { const data1 = {
subList: [...data] subList: JSON.parse(JSON.stringify(data))
} }
data1.subList.forEach((row) => { data1.subList.forEach((row) => {
if (row.secondPackUnit && row.secondPackQty) { if (row.secondPackUnit && row.secondPackQty) {
@ -1009,7 +1020,8 @@ const submitFormLabel = async (data) => {
}) })
} }
}) })
console.log('detatableData', detatableData)
console.log(data1)
await message.confirm(t('ts.是否为此数据生成标签?')) await message.confirm(t('ts.是否为此数据生成标签?'))
await SupplierdeliverRequestMainApi.genLabel(data1) await SupplierdeliverRequestMainApi.genLabel(data1)
isCreateLabel.value = true isCreateLabel.value = true
@ -1018,6 +1030,9 @@ const submitFormLabel = async (data) => {
} finally { } finally {
formLabelRef.value.formLoading = false formLabelRef.value.formLoading = false
formLabelRef.value.dialogVisible = false formLabelRef.value.dialogVisible = false
labelFormRef.value.formLoading = false
labelFormRef.value.dialogVisible = false
} }
} }
const clearInput = async (field, row, index) => { const clearInput = async (field, row, index) => {

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

@ -6,7 +6,6 @@
row-key="id" row-key="id"
style="width: 1050px; max-height: 70vh; overflow-y: auto" style="width: 1050px; max-height: 70vh; overflow-y: auto"
v-if="tableData.length > 0 && dialogTableVisible == true" v-if="tableData.length > 0 && dialogTableVisible == true"
@expand-change="expandChange"
> >
<el-table-column type="expand" width="50"> <el-table-column type="expand" width="50">
<template #default="scope"> <template #default="scope">
@ -170,12 +169,16 @@ const intData = () => {
row.isTuo = 0 // row.isTuo = 0 //
// % // %
row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty)) row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty))
} }
expandChange(row)
}) })
console.log(tableData.value)
} }
const expandChange = (row: any, expandedRows: any[]) => { const expandChange = (row: any, expandedRows: any[]) => {
// //
if (row.secondPackUnit && row.secondPackQty) { if (row.secondPackUnit && row.secondPackQty) {
console.log(222,row)
// //
row.lastNumber = parseFloat(row.qty) % parseFloat(row.secondPackQty) row.lastNumber = parseFloat(row.qty) % parseFloat(row.secondPackQty)
// / // /
@ -194,6 +197,7 @@ const expandChange = (row: any, expandedRows: any[]) => {
qtyOne: '', qtyOne: '',
isTuo : 1 // isTuo : 1 //
} }
console.log(222,row)
// //
if (row.lastNumber) { if (row.lastNumber) {
// //

Loading…
Cancel
Save