Browse Source

新版采购退货申请功能

hella_online_20240816
wangyufei 3 months ago
parent
commit
18a284a18a
  1. 9
      src/api/wms/purchasereturnRequestDetail/index.ts
  2. 62
      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 })
}
}
// 物料供应商查询
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) => {

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

@ -146,7 +146,8 @@ import {
PurchasereturnRequestDetail,
PurchasereturnRequestDetailRules,
PurchasereReturnRequestDetailLabel,
PurchasereceiptRecordMain1
PurchasereceiptRecordMain1,
PurchasereturnPurchasereceiptRecord
} from './purchasereturnRequestMain.data'
import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMain'
import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail'
@ -185,17 +186,28 @@ const updataTableColumns = (val) => {
const onChangeForm = (field, cur, formRef)=>{
console.log('onChangeForm',field, cur, formRef)
console.log('1111')
console.log(PurchasereturnRequestMain.allSchemas)
if(field=='supplierCode'){
//
PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{
if(item.field == field){
//
if(item.field=='supplierCode'){
let setV = {}
setV['supplierName'] = item.componentProps.options?.find(el=>el.id==cur)['nickname']
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) => {
console.log(field, value)
@ -258,18 +270,25 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro
setV[formField] = val[0][searchField]
if(formField=='itemCode'){
//
let res = await PurchasereturnRequestDetailApi.getPurchasereturnSupplierByCode({
itemCode:val[0][searchField]
})
console.log('物料供应商',res)
if(res&&res.length>0){
PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{
if(item.field == 'supplierCode1'){
item.componentProps.options = [
{
id:'454556',
nickname:'哈哈哈哈'
}
]
formRef.setValues(setV)
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)
}
})
@ -585,26 +604,23 @@ const chooseReceiptList = ()=>{
message.error('请选择物料代码')
return
}
if(!formRef.value.formRef.formModel.supplierName){
if(!formRef.value.formRef.formModel.supplierCode){
message.error('请选择供应商')
return
}
searchTableRef.value.open(
"收货单明细",
Itembasic.allSchemas,
ItembasicApi.getItembasicPage,
PurchasereturnPurchasereceiptRecord.allSchemas,
PurchasereturnRequestDetailApi.getPurchasereturnPurchasereceiptRecordByItemCode,
"hahaha",
"hahaha",
false,
'tableForm',
null,
[{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
}],
{
supplierCode:formRef.value.formRef.formModel.supplierCode,
itemCode:formRef.value.formRef.formModel.itemCode
},
undefined,
false,
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 { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize: 10,
pageNo: 1,
code: 'PurchaseReturnRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData = data?.list[0] || {}
let locationList = await LocationApi.selectBusinessTypeOutLocation({
businessType:'PurchaseReturn',
isIn:'out'
})
locationList = locationList.list.map(item=>({
label :item.code,
value :item.code
}))
console.log('locationList',locationList)
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
@ -72,7 +76,6 @@ export const PurchasereceiptRecordMain1 = useCrudSchemas(
sortTableDefault: 2,
isSearch: true
},
{
label: '采购订单号',
field: 'poNumber',
@ -208,7 +211,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
}
},
{
label: '供应商1',
label: '供应商',
field: 'supplierCode',
sort: 'custom',
table: {
@ -217,13 +220,10 @@ export const PurchasereturnRequestMain = useCrudSchemas(
form: {
component: 'Select',
componentProps: {
options: [{
id:123,
nickname:'供应商'
}],
options: [],
optionsAlias: {
labelField: 'id',
valueField: 'id'
labelField: 'supplierCode',
valueField: 'supplierCode'
},
filterable: true,
}
@ -305,7 +305,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
},
{
label: '收货单号',
field: 'purchaseReceiptRecordNumber',
field: 'receiptNumber',
sort: 'custom',
table: {
width: 150
@ -321,7 +321,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
},
{
label: '发货单号',
field: 'asnNumber1',
field: 'asnNumber',
sort: 'custom',
table: {
width: 150
@ -365,15 +365,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
form: {
component: 'Select',
componentProps: {
options: [{
id:123,
nickname:'供应商'
}],
optionsAlias: {
labelField: 'id',
valueField: 'id'
},
filterable: true,
options: locationList
}
}
},
@ -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({
supplierCode: [
@ -538,6 +654,7 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
}
},
tableForm:{
disabled:true,
hidden:false,//控制列是否展示
type:'InputNumber',
min:0,
@ -565,7 +682,6 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
isTable:false,
isTableForm:true,
tableForm:{
disabled:true,
type:'InputNumber',
min:0,
precision: 6
@ -573,7 +689,7 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
},
{
label: '退货原因',
field: 'status',
field: 'reason',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
// isSearch: true,
@ -583,7 +699,6 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150
},
tableForm:{
disabled:true,
type: 'Select',
},
form: {

Loading…
Cancel
Save