Browse Source

YT-2686:补料申请页面

intex
songguoqiang 4 days ago
parent
commit
6fa59eddff
  1. 13
      src/api/wms/location/index.ts
  2. 14
      src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue
  3. 262
      src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts

13
src/api/wms/location/index.ts

@ -47,7 +47,7 @@ export const getLocationMPage = async (params) => {
return await request.get({ url: `/wms/location/Mpage`, params }) return await request.get({ url: `/wms/location/Mpage`, params })
} }
} }
//补料申请获取到库位根据业务类型
export const getLocationPageRepleinsh = async (params) => { export const getLocationPageRepleinsh = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
@ -57,6 +57,17 @@ export const getLocationPageRepleinsh = async (params) => {
return await request.get({ url: `/wms/location/pageForRepleinsh`, params }) return await request.get({ url: `/wms/location/pageForRepleinsh`, params })
} }
} }
//补料申请获取来源库位根据业务类型
export const formLocationPageRepleinsh = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/location/getFormRepleinshSenior', data })
} else {
return await request.get({ url: `/wms/location/pageFormRepleinsh`, params })
}
}
// 查询库位所有列表 // 查询库位所有列表
export const getLocationList = async (params) => { export const getLocationList = async (params) => {
return await request.get({ url: `/wms/location/list`, params }) return await request.get({ url: `/wms/location/list`, params })

14
src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue

@ -123,6 +123,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
newRow['itemCode'] = item['code'] newRow['itemCode'] = item['code']
newRow['uom'] = item['uom'] newRow['uom'] = item['uom']
newRow['id'] = item['id'] newRow['id'] = item['id']
newRow['itemName'] = item['name']
newRow['productionLine'] = item['itemGroup']
newRow['toLocationCode'] = formRef.formModel['toLocationCode'] newRow['toLocationCode'] = formRef.formModel['toLocationCode']
tableData.value.push(newRow) tableData.value.push(newRow)
}) })
@ -384,17 +386,17 @@ const submitForm = async (formType, submitData) => {
data.id = data.masterId data.id = data.masterId
} }
data.subList = tableData.value // data.subList = tableData.value //
data.subList.forEach(item=>{ for (const item of data.subList) {
if (item.qty <= 0) {
message.warning('数量必须大于0')
return // submitForm
}
item.toLocationCode = data.toLocationCode item.toLocationCode = data.toLocationCode
}) }
// if( data.subList.length>1){ // // if( data.subList.length>1){ //
// message.warning('') // message.warning('')
// return; // return;
// } // }
if(tableData.value.find(item => (item.qty <= 0))) {
message.warning('数量必须大于0')
return
}
formRef.value.formLoading = true formRef.value.formLoading = true
try { try {
if (formType === 'create') { if (formType === 'create') {

262
src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts

@ -7,7 +7,8 @@ import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/item
import * as LocationApi from '@/api/wms/location' import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as ProductionlineApi from '@/api/wms/productionline'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as WarehouseApi from '@/api/wms/warehouse' import * as WarehouseApi from '@/api/wms/warehouse'
import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data' import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data'
@ -93,42 +94,97 @@ export const RepleinshRequestMain = useCrudSchemas(
isDetail: true isDetail: true
}, },
{ {
label: '日期', label: '日期时间',
sortTableDefault: 5,
field: 'day', field: 'day',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom', sort: 'custom',
isDetail: true, table: {
isTable: true, width: 180
isForm: true, },
isTableForm: false, sortTableDefault: 5,
isSearch: true, form: {
sortSearchDefault: 3,
formatter: dateFormatter2,
search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss', style: { width: '100%' },
type: 'daterange', type: 'datetime',
defaultTime: [new Date('1 '), new Date('1 ')] dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
} }
}, },
form: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
format: 'YYYY-MM-DD', valueFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', type: 'daterange',
defaultTime: [new Date('1 '), new Date('1 ')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
isDetail: true,
isTable: true,
isForm: true,
isTableForm: false,
isSearch: true,
sortSearchDefault: 3,
},
{
label: '来源库位',
field: 'fromLocationCode',
sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
detail: { hiddenInMain: true,
dateFormat: 'YYYY-MM-DD' // isTableForm: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择来源库位', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.formLocationPageRepleinsh, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
verificationParams: [
{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择来源库位', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.formLocationPageRepleinsh, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
} }
}, },
{ {
label: '到库位代码', label: '目标库位',
field: 'toLocationCode', field: 'toLocationCode',
sort: 'custom', sort: 'custom',
table: { table: {
@ -141,7 +197,7 @@ export const RepleinshRequestMain = useCrudSchemas(
componentProps: { componentProps: {
enterSearch: true, enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码', // 输入框占位文本 searchListPlaceholder: '请选择目标库位', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题 searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
@ -167,7 +223,7 @@ export const RepleinshRequestMain = useCrudSchemas(
}, },
tableForm: { tableForm: {
isInpuFocusShow: true, isInpuFocusShow: true,
searchListPlaceholder: '请选择到库位代码', // 输入框占位文本 searchListPlaceholder: '请选择目标库位', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题 searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
@ -591,10 +647,12 @@ export const RepleinshRequestMainRules = reactive({
toWarehouseCode: [{ required: true, message: '请输入到仓库代码', trigger: 'blur' }], toWarehouseCode: [{ required: true, message: '请输入到仓库代码', trigger: 'blur' }],
toAreaTypes: [{ required: true, message: '请选择到库区类型范围', trigger: 'change' }], toAreaTypes: [{ required: true, message: '请选择到库区类型范围', trigger: 'change' }],
departmentCode: [{ required: true, message: '请输入部门', trigger: 'blur' }], departmentCode: [{ required: true, message: '请输入部门', trigger: 'blur' }],
day: [{ required: true, message: '请选择日期时间', trigger: 'blur' }],
autoCommit: [{ required: true, message: '请选择是否自动提交', trigger: 'change' }], autoCommit: [{ required: true, message: '请选择是否自动提交', trigger: 'change' }],
autoAgree: [{ required: true, message: '请选择是否自动通过', trigger: 'change' }], autoAgree: [{ required: true, message: '请选择是否自动通过', trigger: 'change' }],
autoExecute: [{ required: true, message: '请选择是否自动执行', trigger: 'change' }], autoExecute: [{ required: true, message: '请选择是否自动执行', trigger: 'change' }],
toLocationCode: [{ required: true, message: '请输入到库位代码', trigger: ['change', 'blur'] }], toLocationCode: [{ required: true, message: '请输入目标库位', trigger: ['change', 'blur'] }],
fromLocationCode: [{ required: true, message: '请输入来源库位', trigger: ['change', 'blur'] }],
directCreateRecord: [ directCreateRecord: [
{ required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' }
], ],
@ -669,24 +727,106 @@ export const RepleinshRequestDetail = useCrudSchemas(
] // 失去焦点校验参数 ] // 失去焦点校验参数
} }
}, },
{
label: '背番',
field: 'backNumber',
sort: 'custom',
table: {
width: 150
},
isSearch:true,
isForm: false,
isTable: true,
isDetail: true,
tableForm: {
disabled:true
}
},
{ {
label: '品名', label: '品名',
field: 'itemName', field: 'itemName',
sort: 'custom', sort: 'custom',
sortTableDefault: 4, sortTableDefault: 4,
isTableForm: false, isTableForm: true,
isForm: false isForm: false,
tableForm: {
disabled:true
}
}, },
// {
// label: '包装规格',
// field: 'packUnit',
// sort: 'custom',
// table: {
// width: 150
// },
// isTableForm: true,
// tableForm: {
// isInpuFocusShow: true,
// searchListPlaceholder: '请选择包装规格', // 输入框占位文本
// searchField: 'packUnit', // 查询弹窗赋值字段
// searchTitle: '物料包装信息', // 查询弹窗标题
// searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
// searchPage: ItempackagingApi.getItempackagingPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// },{
// key: 'itemCode',
// value: 'itemCode',
// message: '请填写品番!',
// isMainValue: true
// }]
// }
// // form: {
// // // labelMessage: '信息提示说明!!!',
// // componentProps: {
// // enterSearch:true,
// // isSearch:true,
// // isSearchList: true, // 开启查询弹窗
// // searchListPlaceholder: '请选择包装规格', // 输入框占位文本
// // searchField: 'itemCode', // 查询弹窗赋值字段
// // searchTitle: '物料包装信息', // 查询弹窗标题
// // searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
// // searchPage: ItempackagingApi.getItempackagingPage, // 查询弹窗所需分页方法
// // searchCondition: [{
// // key: 'available',
// // value: 'TRUE',
// // isMainValue: false
// // },{
// // key: 'itemCode',
// // value: 'itemCode',
// // message: '请填写品番!',
// // isMainValue: true
// // }],
// // verificationParams: [{
// // key: 'packUnit',
// // action: '==',
// // value: '',
// // isMainValue: false,
// // isSearch: true,
// // isFormModel: true,
// // }], // 失去焦点校验参数
// // }
// // }
// },
{ {
label: '背番', label: '生产线区分',
field: 'backNumber', field: 'productionLine',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isTableForm: true,
isForm: false, isForm: false,
isTable: true, isTable: false,
isDetail: true isDetail: false,
tableForm: {
disabled:true
}
}, },
{ {
label: '描述', label: '描述',
@ -701,11 +841,58 @@ export const RepleinshRequestDetail = useCrudSchemas(
}, },
{ {
label: '数量', label: '数量',
field: 'unexecutedQty', field: 'qty',
sort: 'custom', sort: 'custom',
sortTableDefault: 4, sortTableDefault: 4,
isTableForm: false, isTableForm: true,
isForm: false isForm: false,
tableForm: {
type: 'InputNumber',
min: 0,
precision: 0
}
},
{
label: '生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: true,
isForm: false,
isTable: false,
isDetail: false,
tableForm: {
enterSearch:true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'workshopCode',
value: '',
message: '请填写车间代码!',
isMainValue: false
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
},
}, },
{ {
label: '计量单位', label: '计量单位',
@ -740,7 +927,7 @@ export const RepleinshRequestDetail = useCrudSchemas(
isTable: true, isTable: true,
}, },
{ {
label: '到库位代码', label: '目标库位',
field: 'toLocationCode', field: 'toLocationCode',
sort: 'custom', sort: 'custom',
table: { table: {
@ -1009,8 +1196,11 @@ export const RepleinshRequestDetailRules = reactive({
// { required: true, message: '请选择库存状态', trigger: 'change' } // { required: true, message: '请选择库存状态', trigger: 'change' }
// ], // ],
// toLocationCode: [ // toLocationCode: [
// { required: true, message: '请输入到库位代码', trigger: 'blur' } // { required: true, message: '请输入目标库位', trigger: 'blur' }
// ], // ],
itemCode: [{ required: true, message: '请输入品番', trigger: 'blur' }], itemCode: [{ required: true, message: '请输入品番', trigger: 'blur' }],
remark: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }] remark: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
productionLineCode: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
]
}) })

Loading…
Cancel
Save