|
|
@ -154,6 +154,7 @@ |
|
|
|
:footButttondata="footButttondata" |
|
|
|
@footButtonClick="footButtonClick" |
|
|
|
@formSelectChange="formSelectChangeLabel" |
|
|
|
@visibleChange='visibleChange' |
|
|
|
/> |
|
|
|
<!-- 上传质量报告 --> |
|
|
|
<BasicForm |
|
|
@ -590,20 +591,7 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} |
|
|
|
genLabelId.value = row.masterId |
|
|
|
// 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) |
|
|
|
item.packUnitInitOptions = item.boxPackaging |
|
|
|
}) |
|
|
|
}) |
|
|
|
await getGenerateLabelList(row) |
|
|
|
formLabelRef.value.open('create', row, null, 'createLabel') //创建标签页面 createLabel 标题 |
|
|
|
} else if (val == 'ressbq') { |
|
|
|
console.log('重新生成标签') |
|
|
@ -620,24 +608,7 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} |
|
|
|
genLabelId.value = row.masterId |
|
|
|
// 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 } |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
await getGenerateLabelList(row) |
|
|
|
formLabelRef.value.open('create', row, null, 'createLabel') //创建标签页面 createLabel 标题 |
|
|
|
} |
|
|
|
}) |
|
|
@ -657,6 +628,27 @@ const footButttondata = ref([ |
|
|
|
defaultButtons.formNextStepBtn(null), // BOM下一步 |
|
|
|
defaultButtons.formCloseBtn(null) // BOM关闭 |
|
|
|
]) |
|
|
|
// 获取箱规格 |
|
|
|
const getGenerateLabelList=async(row)=>{ |
|
|
|
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) => { |
|
|
|
item.packUnitInitOptions = item.boxPackaging |
|
|
|
let obj = item?.boxPackaging[0] |
|
|
|
if (obj) { |
|
|
|
item.packUnit= obj.packUnit |
|
|
|
item.packQty = obj.packQty |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
// 下一步 |
|
|
|
const labelFormRef = ref() |
|
|
|
const footButtonClick = async (val) => { |
|
|
@ -665,6 +657,13 @@ const footButtonClick = async (val) => { |
|
|
|
if (!validateForm) { |
|
|
|
return |
|
|
|
} |
|
|
|
let isNext = detatableData1.value.some((item)=>{ |
|
|
|
return !item.packUnit || !item.packQty |
|
|
|
}) |
|
|
|
if(isNext){ |
|
|
|
message.warning('有数据没有选择箱规格') |
|
|
|
return; |
|
|
|
} |
|
|
|
const data = JSON.parse(JSON.stringify(detatableData1.value)) |
|
|
|
labelFormRef.value.openLabel(data) |
|
|
|
} else if (val == 'close') { |
|
|
@ -682,14 +681,7 @@ const formSelectChangeLabel = (field, val, row) => { |
|
|
|
} |
|
|
|
row.secondPackUnit = '' |
|
|
|
row.secondPackQty = '' |
|
|
|
// 获取托规格 |
|
|
|
const params1 = { |
|
|
|
itemCode: row.itemCode, |
|
|
|
packUnit: row.packUnit |
|
|
|
} |
|
|
|
SupplierdeliverRequestDetailApi.getGenerateLabelParentList(params1).then((res) => { |
|
|
|
row.secondPackUnitInitOptions = res |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
// 设置托 |
|
|
|
if (field == 'secondPackUnit') { |
|
|
@ -701,6 +693,24 @@ const formSelectChangeLabel = (field, val, row) => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// tableForm下拉框弹出隐藏 |
|
|
|
const visibleChange=(field, val, row, index)=>{ |
|
|
|
row.secondPackUnitInitOptions=[] |
|
|
|
console.log(field, val, row) |
|
|
|
if(field=='secondPackUnit'){ |
|
|
|
if(val){ |
|
|
|
// 获取托规格 |
|
|
|
const params1 = { |
|
|
|
itemCode: row.itemCode, |
|
|
|
packUnit: row.packUnit |
|
|
|
} |
|
|
|
SupplierdeliverRequestDetailApi.getGenerateLabelParentList(params1).then((res) => { |
|
|
|
row.secondPackUnitInitOptions = res |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 获取部门 用于详情 部门回显 |
|
|
|
const { wsCache } = useCache() |
|
|
|