From e192caaf21db3ef9b81b3fac75dfd317cb7bc0d0 Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Wed, 11 Sep 2024 19:19:36 +0800 Subject: [PATCH] =?UTF-8?q?HL-5932=E5=8F=91=E6=96=99=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=88=E5=A4=9A=E9=80=89=E3=80=81=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=B7=BB=E5=8A=A0=EF=BC=89=E6=97=B6=EF=BC=8C=E7=BB=99?= =?UTF-8?q?=E5=8C=85=E8=A3=85=E8=A7=84=E6=A0=BC=E8=B5=8B=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/issueRequestMain/index.ts | 5 +++- .../issue/issueRequestMain/index.vue | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/api/wms/issueRequestMain/index.ts b/src/api/wms/issueRequestMain/index.ts index 40d37e803..b319da323 100644 --- a/src/api/wms/issueRequestMain/index.ts +++ b/src/api/wms/issueRequestMain/index.ts @@ -61,7 +61,10 @@ export const updateIssueRequestMain = async (data: IssueRequestMainVO) => { export const deleteIssueRequestMain = async (id: number) => { return await request.delete({ url: `/wms/issue-request-main/delete?id=` + id }) } - +// 获取默认包装规格 +export const getPackUnit = async (data) => { + return await request.post({ url: `/wms/issue-request-main/getPackUnit`, data }) +} // 导出发料申请主 Excel export const exportIssueRequestMain = async (params) => { if (params.isSearch) { diff --git a/src/views/wms/issueManage/issue/issueRequestMain/index.vue b/src/views/wms/issueManage/issue/issueRequestMain/index.vue index 0aca9f690..d32b0d392 100644 --- a/src/views/wms/issueManage/issue/issueRequestMain/index.vue +++ b/src/views/wms/issueManage/issue/issueRequestMain/index.vue @@ -169,12 +169,31 @@ const onEnter = async (field,value) => { }]) } } +// 获取默认包装规格 +const getDefaultPackUnit = async (packUnitList)=>{ + console.log('获取默认包装规格',packUnitList) + let res = await IssueRequestMainApi.getPackUnit({ + list:packUnitList + }) + console.log('res',res) + if(res&&res.list.length>0){ + tableData.value.forEach(item=>{ + if(!item['packUnit']){ + let findItem = res.list.find(item1=>item1.itemCode == item.itemCode) + if(findItem){ + item['packUnit'] = findItem['packUnit'] + } + } + }) + } +} // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(async() => { if (type == 'tableForm') { // 明细查询页赋值 if (formField == 'itemCode') { + let packUnitList = [] val.forEach(item=>{ let tableForm = JSON.parse(JSON.stringify(tableFormKeys)) if (tableData.value.length > 0) { @@ -185,8 +204,15 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => const newRow = JSON.parse(JSON.stringify({...tableForm,...item})) newRow['itemCode'] = item['code'] newRow['uom'] = item['uom'] + packUnitList.push({ + itemCode:item['code'], + workshopCode:formRef.formModel['workshopCode'],//车间代码 + productionLineCode:formRef.formModel['productionLineCode'],//生产线代码 + workStationCode:formRef.formModel['workStationCode'],//工位代码 + }) tableData.value.push(newRow) }) + getDefaultPackUnit(packUnitList) }else if(formField == 'packUnit'){ row['packQty'] = val[0]['packQty'] row[formField] = val[0][searchField]