From ec539c99bd1da3e48e8dc89d3f3fee5293894b56 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 17 Jul 2024 14:35:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E8=B4=A7=E8=AE=A1=E5=88=92=EF=BC=8C?= =?UTF-8?q?=E6=88=90=E5=93=81=E5=8F=91=E8=B4=A7=EF=BC=8C=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E5=A4=87=E4=BB=B6=E5=8F=91=E8=B4=A7=E5=A4=B1=E5=8E=BB=E7=84=A6?= =?UTF-8?q?=E7=82=B9=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/business/inputBlur.ts | 104 +++++++++--------- .../relegateRequestMain.data.ts | 21 +++- .../deliverRequestMain.data.ts | 51 ++++++++- .../deliverPlanMain/deliverPlanMain.data.ts | 32 +++++- 4 files changed, 150 insertions(+), 58 deletions(-) diff --git a/src/api/wms/business/inputBlur.ts b/src/api/wms/business/inputBlur.ts index 4e1ec241b..c72f0dec7 100644 --- a/src/api/wms/business/inputBlur.ts +++ b/src/api/wms/business/inputBlur.ts @@ -211,10 +211,10 @@ export const tableFormBlurVer = async (headerItem, val, row, index, routeName, f headerItem.field == 'packUnit' || headerItem.field == 'secondPackUnit' || headerItem.field == 'fromPackUnit' || - headerItem.field == 'toPackUnit'|| - headerItem.field == 'toPackUnit'|| + headerItem.field == 'toPackUnit' || + headerItem.field == 'toPackUnit' || headerItem.field == 'supplierItemCode' - + ) { let searchField = headerItem.field let pageApi = ref() @@ -239,10 +239,10 @@ export const tableFormBlurVer = async (headerItem, val, row, index, routeName, f ] ? formRef.formModel[searchCondition1[i].value] : detailData - ? detailData[searchCondition1[i].value] - : row - ? row[searchCondition1[i].value] - : '' + ? detailData[searchCondition1[i].value] + : row + ? row[searchCondition1[i].value] + : '' // 是否含有空参数情况 let isNull = false if ( @@ -354,9 +354,9 @@ export const tableFormBlurVer = async (headerItem, val, row, index, routeName, f ) { // 装配计划,裝配备件计划,预备产件计划,预生产收货申请,装配收货申请,报修收货申请,制品报废申请 pageApi.value = getProductionLineCodelistByCodes - params.value.productionLineCode= - formRef.formModel.productionLine || formRef.formModel.productionLineCode || row.productionLine || row.productionLineCode, - params.value.itemCodes=val?.trim() + params.value.productionLineCode = + formRef.formModel.productionLine || formRef.formModel.productionLineCode || row.productionLine || row.productionLineCode, + params.value.itemCodes = val?.trim() } } else if ( headerItem.field == 'packUnit' || @@ -376,39 +376,39 @@ export const tableFormBlurVer = async (headerItem, val, row, index, routeName, f routeName == 'UnplannedissueJobMain' || routeName == 'PackageoverRequestMain' ) { - params.value.itemCode= row.itemCode - params.value.packUnit= val?.trim() + params.value.itemCode = row.itemCode + params.value.packUnit = val?.trim() pageApi.value = getItemPackageunitListByCodes } } else if ( - headerItem.field == 'supplierItemCode' + headerItem.field == 'supplierItemCode' ) { // 生产退料申请,隔离退料申请 if ( routeName == 'ProductionreturnRequestMain' || - routeName == 'ProductionreturnRequestMainNo' + routeName == 'ProductionreturnRequestMainNo' ) { - searchField = 'supplierCode' - params.value.itemCodes= row.itemCode - params.value.supplierCode= val?.trim() + searchField = 'supplierCode' + params.value.itemCodes = row.itemCode + params.value.supplierCode = val?.trim() pageApi.value = getSupplierItemListByCodes } } const list = ref() // 调取包装接口 await pageApi.value(params.value).then(async (res) => { - list.value = res ? res : [] - // 只查一条数据,多条数据查询默认显示不存在 - if (res.length == 1) { - callback(list.value) - } else { - message.alert('代码' + row[headerItem.field] + '没有找到对应数据') - row[headerItem.field] = '' - return - } - }) - } + list.value = res ? res : [] + // 只查一条数据,多条数据查询默认显示不存在 + if (res.length == 1) { + callback(list.value) + } else { + message.alert('代码' + row[headerItem.field] + '没有找到对应数据') + row[headerItem.field] = '' + return + } + }) } + } } } export const FormBlur = async (field, val, routeName, formRef, detailData, formSchema, callback) => { @@ -586,7 +586,7 @@ export const FormBlur = async (field, val, routeName, formRef, detailData, formS callback(list.value) }) } - } + } else { let pageApi = ref() let params = ref() @@ -737,13 +737,13 @@ export const FormBlur = async (field, val, routeName, formRef, detailData, formS }) } } - } + } } // 根据下方输入框失去焦点校验信息 export const getListByBottonInput = async (headerItem, val, row, routeName, formRef, detailData, tableData, callback) => { let tableFormSchemaObj = headerItem?.tableForm - console.log(333,tableFormSchemaObj) + console.log(333, tableFormSchemaObj) if (tableFormSchemaObj.searchPage && tableFormSchemaObj.verificationParams) { if (!val) return; let params = ref({}) @@ -817,7 +817,7 @@ export const getListByBottonInput = async (headerItem, val, row, routeName, form if (verificationParams && verificationParams.length > 0) { for (let i = 0; i < verificationParams.length; i++) { console.log(54565, verificationParams[i].key) - verificationParams[i].key1 = verificationParams[i].key +'s' + verificationParams[i].key1 = verificationParams[i].key + 's' params.value[verificationParams[i].key1] = val } } @@ -830,25 +830,29 @@ export const getListByBottonInput = async (headerItem, val, row, routeName, form ...arr1.filter((item) => !arr2.includes(item)), ...arr2.filter((item) => !arr1.includes(item)) ].join(',') - message.alert('代码' + str + '没有找到对应数据') - return - } else { - let repeatCode = [] - if (tableData.length > 0) { - tableData.forEach((item) => { - const findIndex = arr1.findIndex(valItem => valItem == item[headerItem.field]) - if (findIndex > -1) { - arr1.splice(findIndex, 1) - repeatCode.push(item[headerItem.field]) - } - }) - } - if (repeatCode.length > 0) { - message.warning(`${t('ts.代码')}${repeatCode.join(',')}${t('ts.已经存在')}`); - return; + console.log(arr1.filter((item) => arr2.includes(item))) + console.log(22, str) + if (str) { + message.alert('代码' + str + '没有找到对应数据') + return } - callback(list.value) } + let repeatCode = [] + if (tableData.length > 0) { + tableData.forEach((item) => { + const findIndex = arr1.findIndex(valItem => valItem == item[headerItem.field]) + if (findIndex > -1) { + arr1.splice(findIndex, 1) + repeatCode.push(item[headerItem.field]) + } + }) + } + if (repeatCode.length > 0) { + message.warning(`${t('ts.代码')}${repeatCode.join(',')}${t('ts.已经存在')}`); + return; + } + console.log(list.value) + callback(list.value) }) return } else { @@ -929,5 +933,5 @@ export const getListByBottonInput = async (headerItem, val, row, routeName, form }) } - + } diff --git a/src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/relegateRequestMain.data.ts b/src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/relegateRequestMain.data.ts index 64ce34152..6df677b5e 100644 --- a/src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/relegateRequestMain.data.ts +++ b/src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/relegateRequestMain.data.ts @@ -70,7 +70,15 @@ export const RelegateRequestMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } }, table: { @@ -350,6 +358,7 @@ export const RelegateRequestDetail = useCrudSchemas(reactive([ sort: 'custom', form: { componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择降级物料代码', searchField: 'code', @@ -364,7 +373,15 @@ export const RelegateRequestDetail = useCrudSchemas(reactive([ key: 'type', value: confgiData.itemType, isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } }, tableForm:{ diff --git a/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts b/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts index fe6ea3444..fad28bdc9 100644 --- a/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts @@ -92,7 +92,15 @@ export const DeliverRequestMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -107,6 +115,7 @@ export const DeliverRequestMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择客户月台代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 @@ -123,7 +132,15 @@ export const DeliverRequestMain = useCrudSchemas(reactive([ value: 'customerCode', message: '请填写客户代码!', isMainValue: true - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -201,7 +218,15 @@ export const DeliverRequestMain = useCrudSchemas(reactive([ key: 'status', value: '6', isMainValue: false - }] + }], + verificationParams: [{ + key: 'number', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -226,6 +251,7 @@ export const DeliverRequestMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch:true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择承运商', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 @@ -236,7 +262,15 @@ export const DeliverRequestMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -737,6 +771,15 @@ export const DeliverRequestDetail = useCrudSchemas(reactive([ searchTitle: '客户物料基础信息', searchAllSchemas: Customeritem.allSchemas, searchPage: CustomerItemApi.getPageBusinessTypeToItemCode, + verificationPage: CustomerItemApi.getCustomerItemListByCodes, // 校验数去焦点输入是否正确的方法 + verificationParams: [{ + key: 'itemCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 }, form: { componentProps: { diff --git a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts index 06e18de14..c1b0b4b1b 100644 --- a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts +++ b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts @@ -87,7 +87,15 @@ export const DeliverPlanMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -119,6 +127,7 @@ export const DeliverPlanMain = useCrudSchemas(reactive([ // }, form: { componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择客户月台代码', searchField: 'code', @@ -133,7 +142,15 @@ export const DeliverPlanMain = useCrudSchemas(reactive([ key: 'customerCode', value: 'customerCode', isMainValue: true - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } }, }, @@ -594,10 +611,21 @@ export const DeliverPlanDetail = useCrudSchemas(reactive([ multiple:true, // isInpuFocusShow: true, // 开启查询弹窗 searchListPlaceholder: '请选择物料代码', + disabled:true, searchField: 'itemCode', searchTitle: '客户物料基础信息', searchAllSchemas: Customeritem.allSchemas, searchPage: CustomerItemApi.getPageBusinessTypeToItemCode, + verificationPage: CustomerItemApi.getCustomerItemListByCodes, // 校验数去焦点输入是否正确的方法 + isShowTableFormSearch: true, + verificationParams: [{ + key: 'itemCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 }, form: { componentProps: {