Browse Source

新版采购退货申请功能

hella_online_20240816
wangyufei 3 months ago
parent
commit
18a284a18a
  1. 9
      src/api/wms/purchasereturnRequestDetail/index.ts
  2. 76
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue
  3. 175
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMain.data.ts

9
src/api/wms/purchasereturnRequestDetail/index.ts

@ -37,7 +37,14 @@ 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 getPurchasereturnSupplierByCode = async (params) => {
return await request.get({ url: `/wms/supplieritem/querySupplierByCode`, params })
}
// 收货明细查询
export const getPurchasereturnPurchasereceiptRecordByItemCode = async (params) => {
return await request.get({ url: `/wms/purchasereceipt-record-detail/queryPurchasereceiptRecordByItemCode`, params })
}
// 查询采购退货申请子列表 // 查询采购退货申请子列表
export const getPurchasereturnRequestDetailPageSpare = async (params) => { export const getPurchasereturnRequestDetailPageSpare = async (params) => {

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

@ -146,7 +146,8 @@ import {
PurchasereturnRequestDetail, PurchasereturnRequestDetail,
PurchasereturnRequestDetailRules, PurchasereturnRequestDetailRules,
PurchasereReturnRequestDetailLabel, PurchasereReturnRequestDetailLabel,
PurchasereceiptRecordMain1 PurchasereceiptRecordMain1,
PurchasereturnPurchasereceiptRecord
} from './purchasereturnRequestMain.data' } from './purchasereturnRequestMain.data'
import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMain' import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMain'
import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail' import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail'
@ -185,17 +186,28 @@ const updataTableColumns = (val) => {
const onChangeForm = (field, cur, formRef)=>{ const onChangeForm = (field, cur, formRef)=>{
console.log('onChangeForm',field, cur, formRef) console.log('onChangeForm',field, cur, formRef)
console.log('1111') if(field=='supplierCode'){
console.log(PurchasereturnRequestMain.allSchemas) //
PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{ PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{
if(item.field == field){
// //
let setV = {} if(item.field=='supplierCode'){
setV['supplierName'] = item.componentProps.options?.find(el=>el.id==cur)['nickname'] let setV = {}
formRef.value.setValues(setV) setV['supplierName'] = item.componentProps.options?.find(el=>el.supplierCode==cur+'')['supplierName']
} formRef.value.setValues(setV)
}) }
})
}else if(field == 'locationCode'){
// 退
tableData.value = [{
'batch':'20240908',
'status':'合格',
'inventoryBalance':300,
'qty':1,
'reason':'200',
'remark':'',
}]
}
} }
const onEnter = async (field, value) => { const onEnter = async (field, value) => {
console.log(field, value) console.log(field, value)
@ -258,18 +270,25 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if(formField=='itemCode'){ if(formField=='itemCode'){
// //
PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{ let res = await PurchasereturnRequestDetailApi.getPurchasereturnSupplierByCode({
if(item.field == 'supplierCode1'){ itemCode:val[0][searchField]
item.componentProps.options = [
{
id:'454556',
nickname:'哈哈哈哈'
}
]
formRef.setValues(setV)
}
}) })
console.log('物料供应商',res)
if(res&&res.length>0){
PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{
if(item.field == 'supplierCode'){
item.componentProps.options = res
}
})
}
}else if(formField=='hahaha'){
//
setV['poNumber'] = val[0]['poNumber']
setV['poLine'] = val[0]['poLine']
setV['receiptNumber'] = val[0]['receiptNumber']
setV['asnNumber'] = val[0]['asnNumber']
} }
formRef.setValues(setV) formRef.setValues(setV)
} }
}) })
@ -585,26 +604,23 @@ const chooseReceiptList = ()=>{
message.error('请选择物料代码') message.error('请选择物料代码')
return return
} }
if(!formRef.value.formRef.formModel.supplierName){ if(!formRef.value.formRef.formModel.supplierCode){
message.error('请选择供应商') message.error('请选择供应商')
return return
} }
searchTableRef.value.open( searchTableRef.value.open(
"收货单明细", "收货单明细",
Itembasic.allSchemas, PurchasereturnPurchasereceiptRecord.allSchemas,
ItembasicApi.getItembasicPage, PurchasereturnRequestDetailApi.getPurchasereturnPurchasereceiptRecordByItemCode,
"hahaha", "hahaha",
"hahaha", "hahaha",
false, false,
'tableForm', 'tableForm',
null, null,
[{ {
key: 'available', supplierCode:formRef.value.formRef.formModel.supplierCode,
value: 'TRUE', itemCode:formRef.value.formRef.formModel.itemCode
action: '==', },
isSearch: true,
isMainValue: false
}],
undefined, undefined,
false, false,
null null

175
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMain.data.ts

@ -21,14 +21,18 @@ import { Q2 } from '@/views/qms/inspectionQ2/inspectionQ2.data'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = { let locationList = await LocationApi.selectBusinessTypeOutLocation({
pageSize: 10, businessType:'PurchaseReturn',
pageNo: 1, isIn:'out'
code: 'PurchaseReturnRequest' })
} locationList = locationList.list.map(item=>({
const data = await getRequestsettingApi.getRequestsettingPage(queryParams) label :item.code,
const requestsettingData = data?.list[0] || {} value :item.code
}))
console.log('locationList',locationList)
// 获取当前操作人的部门 // 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
@ -72,7 +76,6 @@ export const PurchasereceiptRecordMain1 = useCrudSchemas(
sortTableDefault: 2, sortTableDefault: 2,
isSearch: true isSearch: true
}, },
{ {
label: '采购订单号', label: '采购订单号',
field: 'poNumber', field: 'poNumber',
@ -208,7 +211,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
} }
}, },
{ {
label: '供应商1', label: '供应商',
field: 'supplierCode', field: 'supplierCode',
sort: 'custom', sort: 'custom',
table: { table: {
@ -217,13 +220,10 @@ export const PurchasereturnRequestMain = useCrudSchemas(
form: { form: {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [{ options: [],
id:123,
nickname:'供应商'
}],
optionsAlias: { optionsAlias: {
labelField: 'id', labelField: 'supplierCode',
valueField: 'id' valueField: 'supplierCode'
}, },
filterable: true, filterable: true,
} }
@ -305,7 +305,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
}, },
{ {
label: '收货单号', label: '收货单号',
field: 'purchaseReceiptRecordNumber', field: 'receiptNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -321,7 +321,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
}, },
{ {
label: '发货单号', label: '发货单号',
field: 'asnNumber1', field: 'asnNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -365,15 +365,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
form: { form: {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [{ options: locationList
id:123,
nickname:'供应商'
}],
optionsAlias: {
labelField: 'id',
valueField: 'id'
},
filterable: true,
} }
} }
}, },
@ -440,6 +432,130 @@ export const PurchasereturnRequestMain = useCrudSchemas(
]) ])
) )
export const PurchasereturnPurchasereceiptRecord = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '收货日期',
field: 'currentDeliveryDate',
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}
},
{
label: '收货单号',
field: 'receiptNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '发货单号',
field: 'asnNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
}
])
)
//表单校验 //表单校验
export const PurchasereturnRequestMainRules = reactive({ export const PurchasereturnRequestMainRules = reactive({
supplierCode: [ supplierCode: [
@ -538,6 +654,7 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
} }
}, },
tableForm:{ tableForm:{
disabled:true,
hidden:false,//控制列是否展示 hidden:false,//控制列是否展示
type:'InputNumber', type:'InputNumber',
min:0, min:0,
@ -565,7 +682,6 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
isTable:false, isTable:false,
isTableForm:true, isTableForm:true,
tableForm:{ tableForm:{
disabled:true,
type:'InputNumber', type:'InputNumber',
min:0, min:0,
precision: 6 precision: 6
@ -573,7 +689,7 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
}, },
{ {
label: '退货原因', label: '退货原因',
field: 'status', field: 'reason',
dictType: DICT_TYPE.UOM, dictType: DICT_TYPE.UOM,
dictClass: 'string', dictClass: 'string',
// isSearch: true, // isSearch: true,
@ -583,7 +699,6 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150 width: 150
}, },
tableForm:{ tableForm:{
disabled:true,
type: 'Select', type: 'Select',
}, },
form: { form: {

Loading…
Cancel
Save