From 51672c18cb2c751bac5a9542658a36b4ea718b70 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 16 Jul 2024 14:07:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E6=96=99=EF=BC=8C=E8=A1=A5=E6=96=99?= =?UTF-8?q?=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/business/inputBlur.ts | 7 +- src/api/wms/workstation/index.ts | 5 + src/components/BasicForm/src/BasicForm.vue | 2 +- .../preparetoissueMain/index.vue | 4 + .../preparetoissueMain.data.ts | 101 ++++++++++++++++-- .../repleinshRequestMain.data.ts | 11 +- 6 files changed, 117 insertions(+), 13 deletions(-) diff --git a/src/api/wms/business/inputBlur.ts b/src/api/wms/business/inputBlur.ts index 905a255d5..53574165c 100644 --- a/src/api/wms/business/inputBlur.ts +++ b/src/api/wms/business/inputBlur.ts @@ -807,6 +807,9 @@ export const getListByBottonInput = async (headerItem, val, row, routeName, form console.log(999, verificationParams) if (verificationParams && verificationParams.length > 0) { for (let i = 0; i < verificationParams.length; i++) { + if (verificationParams[i].key == 'code') { + verificationParams[i].key = 'codes' + } params.value[verificationParams[i].key] = val } } @@ -814,7 +817,7 @@ export const getListByBottonInput = async (headerItem, val, row, routeName, form list.value = res ? res : [] let arr1 = val.split(',').map(item => item.trim()) if (arr1.length != res.length) { - let arr2 = res.map((item) => item[field]) + let arr2 = res.map((item) => item[headerItem.tableForm.searchField]) let str = [ ...arr1.filter((item) => !arr2.includes(item)), ...arr2.filter((item) => !arr1.includes(item)) @@ -828,7 +831,7 @@ export const getListByBottonInput = async (headerItem, val, row, routeName, form const findIndex = arr1.findIndex(valItem => valItem == item[field]) if (findIndex > -1) { arr1.splice(findIndex, 1) - repeatCode.push(item.itemCode) + repeatCode.push(item[field]) } }) } diff --git a/src/api/wms/workstation/index.ts b/src/api/wms/workstation/index.ts index 780baf167..499cf6987 100644 --- a/src/api/wms/workstation/index.ts +++ b/src/api/wms/workstation/index.ts @@ -76,4 +76,9 @@ export const selectAreaTypeToLocation = async (params) => { // 查询工位列表 export const getWorkstationNoPage = async (params) => { return await request.get({ url: `/wms/workstation/noPage`, params }) +} + +// 根据code获取数据列表 +export const getWorkstationByCodes = async (params) => { + return await request.get({ url: `/wms/workstation/listByCodes`, params }) } \ No newline at end of file diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 99a390f19..f166f9a8b 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -883,7 +883,7 @@ const batchAdd = async (val) => { emit( 'searchTableSuccess', headerItem.field, - 'itemCode', + headerItem.tableForm.searchField, list, formRef.value, 'tableForm', diff --git a/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue b/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue index 6ede9c549..91e9e534b 100644 --- a/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue +++ b/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue @@ -122,6 +122,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => newRow['toLocationCode'] = item['rawLocationCode'] tableData.value.push(newRow) }) + console.log(77,formField) + console.log(66,searchField) + console.log(88,tableData.value) + console.log(99,val) } else { row[formField] = val[0][searchField] } diff --git a/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts b/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts index d16192121..45148f84e 100644 --- a/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts +++ b/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts @@ -84,12 +84,21 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择车间代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '车间信息', // 查询弹窗标题 searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 - searchPage: WorkshopApi.getWorkshopPage // 查询弹窗所需分页方法 + searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法 + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -103,12 +112,21 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ form: { labelMessage: '该生产线会影响明细中的物料代码,工位', componentProps: { + enterSearch: true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择生产线', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '生产线信息', // 查询弹窗标题 searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 - searchPage: ProductionlineApi.getProductionlinePage // 查询弹窗所需分页方法 + searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -122,12 +140,21 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选班组', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '班组信息', // 查询弹窗标题 searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 - searchPage: TeamApi.getTeamPage // 查询弹窗所需分页方法 + searchPage: TeamApi.getTeamPage, // 查询弹窗所需分页方法 + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -141,12 +168,21 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选班次', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '班次信息', // 查询弹窗标题 searchAllSchemas: Shift.allSchemas, // 查询弹窗所需类 - searchPage: ShiftApi.getShiftPage // 查询弹窗所需分页方法 + searchPage: ShiftApi.getShiftPage, // 查询弹窗所需分页方法 + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -224,6 +260,7 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ form: { labelMessage: '同时影响车间 生产线 班组 班次', componentProps: { + enterSearch:true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择生产计划', // 输入框占位文本 searchField: 'number', // 查询弹窗赋值字段 @@ -244,7 +281,15 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ key: 'planType', value: 'predict', isMainValue: false - }] + }], + verificationParams: [{ + key: 'number', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -479,6 +524,7 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch:true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择工位', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 @@ -499,10 +545,20 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } }, tableForm: { + enterSearch: true, + isShowTableFormSearch:true, multiple: true, isInpuFocusShow: true, searchListPlaceholder: '请选择工位', // 输入框占位文本 @@ -510,6 +566,7 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ searchTitle: '工位信息', // 查询弹窗标题 searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类 searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法 + verificationPage: WorkStationApi.getWorkstationByCodes,// 失去焦点校验输入框的数据内容存在 searchCondition: [{ key: 'productionLineCode', value: 'prodLine', @@ -524,7 +581,15 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 }, }, { @@ -537,6 +602,7 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择物料代码', // 输入框占位文本 searchField: 'itemCode', // 查询弹窗赋值字段 @@ -548,10 +614,19 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ value: 'prodLine', message: '请填写生产线代码!', isMainValue: true - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } }, tableForm: { + enterSearch: true, isInpuFocusShow: true, searchListPlaceholder: '请选择物料代码', // 输入框占位文本 searchField: 'itemCode', // 查询弹窗赋值字段 @@ -563,7 +638,15 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ value: 'prodLine', message: '请填写生产线代码!', isMainValue: true - }] + }], + verificationParams: [{ + key: 'componentItemCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 }, }, { diff --git a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts b/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts index 0e728c496..90ede593f 100644 --- a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts +++ b/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts @@ -222,6 +222,7 @@ export const RepleinshRequestMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch:true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择到库位代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 @@ -232,7 +233,15 @@ export const RepleinshRequestMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } }, tableForm:{