|
@ -154,7 +154,6 @@ |
|
|
:footButttondata="footButttondata" |
|
|
:footButttondata="footButttondata" |
|
|
@footButtonClick="footButtonClick" |
|
|
@footButtonClick="footButtonClick" |
|
|
@formSelectChange="formSelectChangeLabel" |
|
|
@formSelectChange="formSelectChangeLabel" |
|
|
@visibleChange='visibleChange' |
|
|
|
|
|
/> |
|
|
/> |
|
|
<!-- 上传质量报告 --> |
|
|
<!-- 上传质量报告 --> |
|
|
<BasicForm |
|
|
<BasicForm |
|
@ -628,7 +627,7 @@ const footButttondata = ref([ |
|
|
defaultButtons.formCloseBtn(null) // BOM关闭 |
|
|
defaultButtons.formCloseBtn(null) // BOM关闭 |
|
|
]) |
|
|
]) |
|
|
// 获取箱规格 |
|
|
// 获取箱规格 |
|
|
const getGenerateLabelList=async(row)=>{ |
|
|
const getGenerateLabelList = async (row) => { |
|
|
const params1 = { |
|
|
const params1 = { |
|
|
masterId: row.masterId, |
|
|
masterId: row.masterId, |
|
|
pageSize: '500', |
|
|
pageSize: '500', |
|
@ -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 |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@ -658,12 +663,12 @@ const footButtonClick = async (val) => { |
|
|
if (!validateForm) { |
|
|
if (!validateForm) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
let isNext = detatableData1.value.some((item)=>{ |
|
|
let isNext = detatableData1.value.some((item) => { |
|
|
return !item.packUnit || !item.packQty |
|
|
return !item.packUnit || !item.packQty |
|
|
}) |
|
|
}) |
|
|
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,9 +1002,8 @@ const { getList: getDetailList } = detatableMethods |
|
|
// 生成标签按钮操作 |
|
|
// 生成标签按钮操作 |
|
|
const submitFormLabel = async (list) => { |
|
|
const submitFormLabel = async (list) => { |
|
|
try { |
|
|
try { |
|
|
|
|
|
|
|
|
let data = { |
|
|
let data = { |
|
|
subList:list |
|
|
subList: list |
|
|
} |
|
|
} |
|
|
await message.confirm(t('ts.是否为此数据生成标签?')) |
|
|
await message.confirm(t('ts.是否为此数据生成标签?')) |
|
|
labelFormRef.value.isLoading = true |
|
|
labelFormRef.value.isLoading = true |
|
@ -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) => { |
|
|