Browse Source

新版-采购退货申请-查询采购退货申请子列表

hella_online_20240819
wangyufei 3 months ago
parent
commit
2f213ba1ab
  1. 5
      src/api/wms/purchasereturnRequestDetail/index.ts
  2. 60
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue
  3. 6
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMainNew.data.ts

5
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 }) 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) => { export const getPurchasereturnSupplierByCode = async (params) => {
return await request.get({ url: `/wms/supplieritem/querySupplierByCode`, params }) return await request.get({ url: `/wms/supplieritem/querySupplierByCode`, params })

60
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue

@ -265,32 +265,36 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro
if(formField=='itemCode'){ if(formField=='itemCode'){
setV['itemName'] = val[0]['name'] setV['itemName'] = val[0]['name']
// //
let res = await PurchasereturnRequestDetailApi.getPurchasereturnSupplierByCode({ //
itemCode:val[0][searchField] setV['supplierCode'] = ''
}) setV['supplierName'] = ''
console.log('物料供应商',res) setV['hahaha'] = ''
if(res&&res.length>0){ setV['poNumber'] = ''
PurchasereturnRequestMainNew.allSchemas.formSchema.forEach(item=>{ setV['poLine'] = ''
if(item.field == 'supplierCode'){ setV['receiptNumber'] = ''
// setV['asnNumber'] = ''
setV['supplierCode'] = '' tableData.value = []
setV['supplierName'] = '' getSupplierOptions(val[0][searchField])
setV['hahaha'] = ''
setV['poNumber'] = ''
setV['poLine'] = ''
setV['receiptNumber'] = ''
setV['asnNumber'] = ''
tableData.value = []
item.componentProps.options = res
}
})
}
} }
formRef.setValues(setV) 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) => { const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
@ -507,7 +511,7 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = async (type: string, row?: number) => { const openForm = async (type: string, row?: Object) => {
isShowButton.value = true isShowButton.value = true
if (type == 'create') { if (type == 'create') {
@ -525,6 +529,14 @@ const openForm = async (type: string, row?: number) => {
}) })
} }
if (type == 'update') { 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) => { PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') { if (item.field == 'supplierCode') {
item.componentProps.disabled = true item.componentProps.disabled = true
@ -535,9 +547,7 @@ const openForm = async (type: string, row?: number) => {
item.componentProps.isSearchList = false item.componentProps.isSearchList = false
} }
}) })
tableData.value = [{ tableData.value = updateData.subList||[]
}]
} }
formRef.value.open(type, row) formRef.value.open(type, row)
} }
@ -839,7 +849,7 @@ const searchTableSuccess1 = (formField, searchField, val, type, row) => {
if(formField=='hahaha'){ if(formField=='hahaha'){
// //
const setV = {} const setV = {}
setV['hahaha'] = val[0]['asnNumber'] setV['hahaha'] = val[0]['poNumber']
setV['poNumber'] = val[0]['poNumber'] setV['poNumber'] = val[0]['poNumber']
setV['poLine'] = val[0]['poLine'] setV['poLine'] = val[0]['poLine']
setV['receiptNumber'] = val[0]['receiptNumber'] setV['receiptNumber'] = val[0]['receiptNumber']

6
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMainNew.data.ts

@ -478,12 +478,14 @@ export const PurchasereturnRequestDetailNew = useCrudSchemas(reactive<CrudSchema
}, },
{ {
label: '状态', label: '状态',
field: 'status', field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
tableForm:{ tableForm:{
type: 'Select',
disabled:true disabled:true
}, },
form: { form: {
@ -543,7 +545,7 @@ export const PurchasereturnRequestDetailNew = useCrudSchemas(reactive<CrudSchema
}, },
{ {
label: '退货原因', label: '退货原因',
field: 'reason_type', field: 'reasonType',
dictType: DICT_TYPE.UOM, dictType: DICT_TYPE.UOM,
dictClass: 'string', dictClass: 'string',
// isSearch: true, // isSearch: true,

Loading…
Cancel
Save