|
|
@ -154,7 +154,6 @@ |
|
|
|
:footButttondata="footButttondata" |
|
|
|
@footButtonClick="footButtonClick" |
|
|
|
@formSelectChange="formSelectChangeLabel" |
|
|
|
@visibleChange='visibleChange' |
|
|
|
/> |
|
|
|
<!-- 上传质量报告 --> |
|
|
|
<BasicForm |
|
|
@ -607,7 +606,7 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} |
|
|
|
genLabelId.value = row.masterId |
|
|
|
// await getDetailList() |
|
|
|
await getGenerateLabelList(row) |
|
|
|
await getGenerateLabelList(row) |
|
|
|
formLabelRef.value.open('create', row, null, 'createLabel') //创建标签页面 createLabel 标题 |
|
|
|
} |
|
|
|
}) |
|
|
@ -628,27 +627,33 @@ const footButttondata = ref([ |
|
|
|
defaultButtons.formCloseBtn(null) // BOM关闭 |
|
|
|
]) |
|
|
|
// 获取箱规格 |
|
|
|
const getGenerateLabelList=async(row)=>{ |
|
|
|
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 |
|
|
|
} |
|
|
|
item.secondPackUnit= '' |
|
|
|
item.secondPackQty = '' |
|
|
|
}) |
|
|
|
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 |
|
|
|
item.secondPackUnitInitOptions = item.palletPackaging || [] |
|
|
|
let obj = item?.boxPackaging[0] |
|
|
|
if (obj) { |
|
|
|
item.packUnit = obj.packUnit |
|
|
|
item.packQty = obj.packQty |
|
|
|
} |
|
|
|
// 有托规格显示托规格,没有显示第一条规格 |
|
|
|
item.secondPackUnit = obj.parentPackUnit |
|
|
|
? obj.parentPackUnit |
|
|
|
: item?.secondPackUnitInitOptions[0]?.packUnit |
|
|
|
item.secondPackQty = obj.parentPackUnit |
|
|
|
? obj.parentPackQty |
|
|
|
: item?.secondPackUnitInitOptions[0]?.packQty |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
// 下一步 |
|
|
|
const labelFormRef = ref() |
|
|
@ -658,12 +663,12 @@ const footButtonClick = async (val) => { |
|
|
|
if (!validateForm) { |
|
|
|
return |
|
|
|
} |
|
|
|
let isNext = detatableData1.value.some((item)=>{ |
|
|
|
return !item.packUnit || !item.packQty |
|
|
|
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.secondPackUnit = row?.secondPackUnitInitOptions[0]?.packUnit |
|
|
|
row.secondPackQty = row?.secondPackUnitInitOptions[0]?.packQty |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
row.packQty = '' |
|
|
|
row.secondPackUnit = '' |
|
|
|
row.secondPackQty = '' |
|
|
|
} |
|
|
|
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,10 +1002,9 @@ const { getList: getDetailList } = detatableMethods |
|
|
|
// 生成标签按钮操作 |
|
|
|
const submitFormLabel = async (list) => { |
|
|
|
try { |
|
|
|
|
|
|
|
let data = { |
|
|
|
subList:list |
|
|
|
} |
|
|
|
let data = { |
|
|
|
subList: list |
|
|
|
} |
|
|
|
await message.confirm(t('ts.是否为此数据生成标签?')) |
|
|
|
labelFormRef.value.isLoading = true |
|
|
|
await SupplierdeliverRequestMainApi.genLabel(data) |
|
|
@ -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) => { |
|
|
|