diff --git a/src/api/wms/purchasereturnRequestDetail/index.ts b/src/api/wms/purchasereturnRequestDetail/index.ts index 6634cddde..3451bc4aa 100644 --- a/src/api/wms/purchasereturnRequestDetail/index.ts +++ b/src/api/wms/purchasereturnRequestDetail/index.ts @@ -37,6 +37,11 @@ export const getPurchasereturnRequestDetailPage = async (params) => { return await request.get({ url: `/wms/purchasereturn-request-detail/page`, params }) } } + +// 查询采购退货申请子列表 +export const getPurchasereturnRequestDetailEditData = async (params) => { + return await request.get({ url: `/wms/purchasereturn-request-main/editReturnNew`, params }) +} // 物料供应商查询 export const getPurchasereturnSupplierByCode = async (params) => { return await request.get({ url: `/wms/supplieritem/querySupplierByCode`, params }) diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue index f9b6b21b5..a1d5730e7 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue @@ -265,32 +265,36 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro if(formField=='itemCode'){ setV['itemName'] = val[0]['name'] // 更换查询 供应商下拉框数据 - let res = await PurchasereturnRequestDetailApi.getPurchasereturnSupplierByCode({ - itemCode:val[0][searchField] - }) - console.log('物料供应商',res) - if(res&&res.length>0){ - PurchasereturnRequestMainNew.allSchemas.formSchema.forEach(item=>{ - if(item.field == 'supplierCode'){ - //重置 - setV['supplierCode'] = '' - setV['supplierName'] = '' - setV['hahaha'] = '' - setV['poNumber'] = '' - setV['poLine'] = '' - setV['receiptNumber'] = '' - setV['asnNumber'] = '' - tableData.value = [] - item.componentProps.options = res - } - }) - } + // 重置数据 + setV['supplierCode'] = '' + setV['supplierName'] = '' + setV['hahaha'] = '' + setV['poNumber'] = '' + setV['poLine'] = '' + setV['receiptNumber'] = '' + setV['asnNumber'] = '' + tableData.value = [] + getSupplierOptions(val[0][searchField]) + } formRef.setValues(setV) } }) } +const getSupplierOptions = async (itemCode)=>{ + let res = await PurchasereturnRequestDetailApi.getPurchasereturnSupplierByCode({ + itemCode + }) + console.log('物料供应商',res) + if(res&&res.length>0){ + PurchasereturnRequestMainNew.allSchemas.formSchema.forEach(item=>{ + if(item.field == 'supplierCode'){ + item.componentProps.options = res + } + }) + } +} // 查询页面返回——详情 const searchTableSuccessDetail = (formField, searchField, val, formRef) => { nextTick(() => { @@ -507,7 +511,7 @@ const buttonTableClick = async (val, row) => { /** 添加/修改操作 */ const formRef = ref() -const openForm = async (type: string, row?: number) => { +const openForm = async (type: string, row?: Object) => { isShowButton.value = true if (type == 'create') { @@ -525,6 +529,14 @@ const openForm = async (type: string, row?: number) => { }) } if (type == 'update') { + let updateData = await PurchasereturnRequestDetailApi.getPurchasereturnRequestDetailEditData({ + masterId:row.masterId + }) + console.log('updateData',updateData) + if(updateData){ + updateData['hahaha'] = updateData['poNumber'] + } + getSupplierOptions(updateData['itemCode']) PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { if (item.field == 'supplierCode') { item.componentProps.disabled = true @@ -535,9 +547,7 @@ const openForm = async (type: string, row?: number) => { item.componentProps.isSearchList = false } }) - tableData.value = [{ - - }] + tableData.value = updateData.subList||[] } formRef.value.open(type, row) } @@ -839,7 +849,7 @@ const searchTableSuccess1 = (formField, searchField, val, type, row) => { if(formField=='hahaha'){ // 选择收货单明细 const setV = {} - setV['hahaha'] = val[0]['asnNumber'] + setV['hahaha'] = val[0]['poNumber'] setV['poNumber'] = val[0]['poNumber'] setV['poLine'] = val[0]['poLine'] setV['receiptNumber'] = val[0]['receiptNumber'] diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMainNew.data.ts b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMainNew.data.ts index 3f0f6fda6..ba641667b 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMainNew.data.ts +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMainNew.data.ts @@ -478,12 +478,14 @@ export const PurchasereturnRequestDetailNew = useCrudSchemas(reactive