Browse Source

托规格默认

hella_online_20240829
zhang_li 5 months ago
parent
commit
d10c3215a0
  1. 48
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

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

@ -154,7 +154,6 @@
:footButttondata="footButttondata" :footButttondata="footButttondata"
@footButtonClick="footButtonClick" @footButtonClick="footButtonClick"
@formSelectChange="formSelectChangeLabel" @formSelectChange="formSelectChangeLabel"
@visibleChange='visibleChange'
/> />
<!-- 上传质量报告 --> <!-- 上传质量报告 -->
<BasicForm <BasicForm
@ -640,13 +639,19 @@ const getGenerateLabelList=async(row)=>{
detatableData1.value = res detatableData1.value = res
detatableData1.value.forEach((item) => { detatableData1.value.forEach((item) => {
item.packUnitInitOptions = item.boxPackaging item.packUnitInitOptions = item.boxPackaging
item.secondPackUnitInitOptions = item.palletPackaging || []
let obj = item?.boxPackaging[0] let obj = item?.boxPackaging[0]
if (obj) { if (obj) {
item.packUnit = obj.packUnit item.packUnit = obj.packUnit
item.packQty = obj.packQty item.packQty = obj.packQty
} }
item.secondPackUnit= '' //
item.secondPackQty = '' item.secondPackUnit = obj.parentPackUnit
? obj.parentPackUnit
: item?.secondPackUnitInitOptions[0]?.packUnit
item.secondPackQty = obj.parentPackUnit
? obj.parentPackQty
: item?.secondPackUnitInitOptions[0]?.packQty
}) })
}) })
} }
@ -663,7 +668,7 @@ const footButtonClick = async (val) => {
}) })
if (isNext) { if (isNext) {
message.warning('有数据没有选择箱规格') message.warning('有数据没有选择箱规格')
return; return
} }
const data = JSON.parse(JSON.stringify(detatableData1.value)) const data = JSON.parse(JSON.stringify(detatableData1.value))
labelFormRef.value.openLabel(data) labelFormRef.value.openLabel(data)
@ -677,12 +682,25 @@ const formSelectChangeLabel = (field, val, row) => {
let obj = row.boxPackaging.find((item) => item.packUnit == val) let obj = row.boxPackaging.find((item) => item.packUnit == val)
if (obj) { if (obj) {
row.packQty = obj.packQty 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 { } else {
row.packQty = '' row.secondPackUnit = row?.secondPackUnitInitOptions[0]?.packUnit
row.secondPackQty = row?.secondPackUnitInitOptions[0]?.packQty
} }
})
} else {
row.packQty = ''
row.secondPackUnit = '' row.secondPackUnit = ''
row.secondPackQty = '' row.secondPackQty = ''
}
} }
// //
if (field == 'secondPackUnit') { if (field == 'secondPackUnit') {
@ -694,23 +712,7 @@ const formSelectChangeLabel = (field, val, row) => {
} }
} }
} }
// tableForm
const visibleChange=(field, val, row, index)=>{
row.secondPackUnitInitOptions=[]
if(field=='secondPackUnit'){
if(val){
//
const params1 = {
itemCode: row.itemCode,
packUnit: row.packUnit
}
SupplierdeliverRequestDetailApi.getGenerateLabelParentList(params1).then((res) => {
row.secondPackUnitInitOptions = res
})
}
}
}
// //
const { wsCache } = useCache() const { wsCache } = useCache()
@ -1000,7 +1002,6 @@ const { getList: getDetailList } = detatableMethods
// //
const submitFormLabel = async (list) => { const submitFormLabel = async (list) => {
try { try {
let data = { let data = {
subList: list subList: list
} }
@ -1016,7 +1017,6 @@ const submitFormLabel = async (list) => {
labelFormRef.value.formLoading = false labelFormRef.value.formLoading = false
labelFormRef.value.dialogTableVisible = false labelFormRef.value.dialogTableVisible = false
labelFormRef.value.isLoading = false labelFormRef.value.isLoading = false
} }
} }
const clearInput = async (field, row, index) => { const clearInput = async (field, row, index) => {

Loading…
Cancel
Save