From 6fa59eddff22f328a0469f6414793a9adc818919 Mon Sep 17 00:00:00 2001 From: songguoqiang Date: Wed, 4 Jun 2025 19:47:22 +0800 Subject: [PATCH] =?UTF-8?q?YT-2686=EF=BC=9A=E8=A1=A5=E6=96=99=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/location/index.ts | 13 +- .../repleinsh/repleinshRequestMain/index.vue | 16 +- .../repleinshRequestMain.data.ts | 262 +++++++++++++++--- 3 files changed, 247 insertions(+), 44 deletions(-) diff --git a/src/api/wms/location/index.ts b/src/api/wms/location/index.ts index 9060039d4..e7920efbf 100644 --- a/src/api/wms/location/index.ts +++ b/src/api/wms/location/index.ts @@ -47,7 +47,7 @@ export const getLocationMPage = async (params) => { return await request.get({ url: `/wms/location/Mpage`, params }) } } - +//补料申请获取到库位根据业务类型 export const getLocationPageRepleinsh = async (params) => { if (params.isSearch) { delete params.isSearch @@ -57,6 +57,17 @@ export const getLocationPageRepleinsh = async (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) => { return await request.get({ url: `/wms/location/list`, params }) diff --git a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue b/src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue index 64b1fa210..674655e9f 100644 --- a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue +++ b/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['uom'] = item['uom'] newRow['id'] = item['id'] + newRow['itemName'] = item['name'] + newRow['productionLine'] = item['itemGroup'] newRow['toLocationCode'] = formRef.formModel['toLocationCode'] tableData.value.push(newRow) }) @@ -384,17 +386,17 @@ const submitForm = async (formType, submitData) => { data.id = data.masterId } data.subList = tableData.value // 拼接子表数据参数 - data.subList.forEach(item=>{ - item.toLocationCode = data.toLocationCode - }) + for (const item of data.subList) { + if (item.qty <= 0) { + message.warning('数量必须大于0') + return // 这会从整个 submitForm 函数返回 + } + item.toLocationCode = data.toLocationCode +} // if( data.subList.length>1){ // 喜婷说可以添加多条 // message.warning('明细只能选择一条数据') // return; // } - if(tableData.value.find(item => (item.qty <= 0))) { - message.warning('数量必须大于0') - return - } formRef.value.formLoading = true try { if (formType === 'create') { diff --git a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts b/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts index 9887391fd..0c030948a 100644 --- a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts +++ b/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 { 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 { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data' @@ -93,42 +94,97 @@ export const RepleinshRequestMain = useCrudSchemas( isDetail: true }, { - label: '日期', - sortTableDefault: 5, + label: '日期时间', field: 'day', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, sort: 'custom', - isDetail: true, - isTable: true, - isForm: true, - isTableForm: false, - isSearch: true, - sortSearchDefault: 3, - formatter: dateFormatter2, - search: { + table: { + width: 180 + }, + sortTableDefault: 5, + form: { component: 'DatePicker', componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 '), new Date('1 ')] + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' } }, - form: { + search: { component: 'DatePicker', componentProps: { - format: 'YYYY-MM-DD', - valueFormat: 'x', - defaultTime: [new Date('1 '), new Date('1 ')] + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + 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: { width: 150 }, - detail: { - dateFormat: 'YYYY-MM-DD' + hiddenInMain: true, + // 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', sort: 'custom', table: { @@ -141,7 +197,7 @@ export const RepleinshRequestMain = useCrudSchemas( componentProps: { enterSearch: true, isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择到库位代码', // 输入框占位文本 + searchListPlaceholder: '请选择目标库位', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库位信息', // 查询弹窗标题 searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 @@ -167,7 +223,7 @@ export const RepleinshRequestMain = useCrudSchemas( }, tableForm: { isInpuFocusShow: true, - searchListPlaceholder: '请选择到库位代码', // 输入框占位文本 + searchListPlaceholder: '请选择目标库位', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库位信息', // 查询弹窗标题 searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 @@ -591,10 +647,12 @@ export const RepleinshRequestMainRules = reactive({ toWarehouseCode: [{ required: true, message: '请输入到仓库代码', trigger: 'blur' }], toAreaTypes: [{ required: true, message: '请选择到库区类型范围', trigger: 'change' }], departmentCode: [{ required: true, message: '请输入部门', trigger: 'blur' }], + day: [{ required: true, message: '请选择日期时间', trigger: 'blur' }], autoCommit: [{ required: true, message: '请选择是否自动提交', trigger: 'change' }], autoAgree: [{ 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: [ { 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: '品名', field: 'itemName', sort: 'custom', sortTableDefault: 4, - isTableForm: false, - isForm: false + isTableForm: true, + 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: '背番', - field: 'backNumber', + label: '生产线区分', + field: 'productionLine', sort: 'custom', table: { width: 150 }, + isTableForm: true, isForm: false, - isTable: true, - isDetail: true + isTable: false, + isDetail: false, + tableForm: { + disabled:true + } }, { label: '描述', @@ -701,11 +841,58 @@ export const RepleinshRequestDetail = useCrudSchemas( }, { label: '数量', - field: 'unexecutedQty', + field: 'qty', sort: 'custom', sortTableDefault: 4, - isTableForm: false, - isForm: false + isTableForm: true, + 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: '计量单位', @@ -740,7 +927,7 @@ export const RepleinshRequestDetail = useCrudSchemas( isTable: true, }, { - label: '到库位代码', + label: '目标库位', field: 'toLocationCode', sort: 'custom', table: { @@ -1009,8 +1196,11 @@ export const RepleinshRequestDetailRules = reactive({ // { required: true, message: '请选择库存状态', trigger: 'change' } // ], // toLocationCode: [ - // { required: true, message: '请输入到库位代码', trigger: 'blur' } + // { 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' } + ] })