Browse Source

托规格默认

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

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

@ -154,7 +154,6 @@
:footButttondata="footButttondata"
@footButtonClick="footButtonClick"
@formSelectChange="formSelectChangeLabel"
@visibleChange='visibleChange'
/>
<!-- 上传质量报告 -->
<BasicForm
@ -628,7 +627,7 @@ const footButttondata = ref([
defaultButtons.formCloseBtn(null) // BOM
])
//
const getGenerateLabelList=async(row)=>{
const getGenerateLabelList = async (row) => {
const params1 = {
masterId: row.masterId,
pageSize: '500',
@ -640,13 +639,19 @@ const getGenerateLabelList=async(row)=>{
detatableData1.value = res
detatableData1.value.forEach((item) => {
item.packUnitInitOptions = item.boxPackaging
item.secondPackUnitInitOptions = item.palletPackaging || []
let obj = item?.boxPackaging[0]
if (obj) {
item.packUnit= obj.packUnit
item.packUnit = obj.packUnit
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
})
})
}
@ -658,12 +663,12 @@ const footButtonClick = async (val) => {
if (!validateForm) {
return
}
let isNext = detatableData1.value.some((item)=>{
let isNext = detatableData1.value.some((item) => {
return !item.packUnit || !item.packQty
})
if(isNext){
if (isNext) {
message.warning('有数据没有选择箱规格')
return;
return
}
const data = JSON.parse(JSON.stringify(detatableData1.value))
labelFormRef.value.openLabel(data)
@ -677,12 +682,25 @@ const formSelectChangeLabel = (field, val, row) => {
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.packQty = ''
row.secondPackUnit = row?.secondPackUnitInitOptions[0]?.packUnit
row.secondPackQty = row?.secondPackUnitInitOptions[0]?.packQty
}
})
} else {
row.packQty = ''
row.secondPackUnit = ''
row.secondPackQty = ''
}
}
//
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()
@ -1000,9 +1002,8 @@ const { getList: getDetailList } = detatableMethods
//
const submitFormLabel = async (list) => {
try {
let data = {
subList:list
subList: list
}
await message.confirm(t('ts.是否为此数据生成标签?'))
labelFormRef.value.isLoading = true
@ -1016,7 +1017,6 @@ const submitFormLabel = async (list) => {
labelFormRef.value.formLoading = false
labelFormRef.value.dialogTableVisible = false
labelFormRef.value.isLoading = false
}
}
const clearInput = async (field, row, index) => {

Loading…
Cancel
Save