From 3964635b9c420f2b146429b774642141be414a56 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 16 Jul 2024 17:09:43 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/business/inputBlur.ts | 3 +- .../productionMainAssemble.data.ts | 57 ++++++++++++++++-- .../productionMainAssembleSparePart.data.ts | 60 ++++++++++++++++--- .../productionMainPredictSparePart.data.ts | 57 ++++++++++++++++-- 4 files changed, 159 insertions(+), 18 deletions(-) diff --git a/src/api/wms/business/inputBlur.ts b/src/api/wms/business/inputBlur.ts index 754ec10f9..4e1ec241b 100644 --- a/src/api/wms/business/inputBlur.ts +++ b/src/api/wms/business/inputBlur.ts @@ -744,7 +744,8 @@ 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) - if (tableFormSchemaObj.searchPage && tableFormSchemaObj.verificationParams) { + if (tableFormSchemaObj.searchPage && tableFormSchemaObj.verificationParams) { + if (!val) return; let params = ref({}) let list = ref([]) console.log(3344) diff --git a/src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts b/src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts index cce78d9d4..5b6cb43d4 100644 --- a/src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts +++ b/src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts @@ -104,6 +104,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择车间', searchField: 'code', @@ -114,7 +115,15 @@ export const ProductionMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -128,6 +137,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择生产线', searchField: 'code', @@ -143,7 +153,15 @@ export const ProductionMain = useCrudSchemas(reactive([ value: 'workshop', message: '请填写车间代码!', isMainValue: true - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -157,6 +175,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择班组', searchField: 'code', @@ -167,7 +186,15 @@ export const ProductionMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -181,6 +208,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择班次', searchField: 'code', @@ -191,7 +219,15 @@ export const ProductionMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -671,7 +707,18 @@ export const ProductionDetail = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }], + }], + verificationPage: ProductionlineitemApi.getProductionLineCodelistByCodes, // 校验数去焦点输入是否正确的方法 + isShowTableFormSearch: true, + + verificationParams: [{ + key: 'itemCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 }, }, { diff --git a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts index e700e948f..ece420527 100644 --- a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts +++ b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts @@ -104,6 +104,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择车间', searchField: 'code', @@ -114,7 +115,15 @@ export const ProductionMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -128,6 +137,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择生产线', searchField: 'code', @@ -143,7 +153,15 @@ export const ProductionMain = useCrudSchemas(reactive([ value: 'workshop', message: '请填写车间代码!', isMainValue: true - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -157,6 +175,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择班组', searchField: 'code', @@ -167,7 +186,15 @@ export const ProductionMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -181,6 +208,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择班次', searchField: 'code', @@ -191,7 +219,15 @@ export const ProductionMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -643,18 +679,18 @@ export const ProductionDetail = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }], + }] } }, tableForm:{ multiple:true, - enterSearch:true, // isInpuFocusShow: true, searchListPlaceholder: '请选择物料代码', // 输入框占位文本 searchField: 'itemCode', // 查询弹窗赋值字段 searchTitle: '生产线物料关系信息', // 查询弹窗标题 searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类 searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法 + disabled:true, searchCondition: [{ key:'productionLineCode', value:'productionLine', @@ -664,7 +700,17 @@ export const ProductionDetail = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }], + }], + verificationPage: ProductionlineitemApi.getProductionLineCodelistByCodes, // 校验数去焦点输入是否正确的方法 + isShowTableFormSearch: true, + verificationParams: [{ + key: 'itemCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 }, }, { diff --git a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts index 7db5dfe79..fd3f997e5 100644 --- a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts +++ b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts @@ -104,6 +104,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择车间', searchField: 'code', @@ -114,7 +115,15 @@ export const ProductionMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -128,6 +137,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择生产线', searchField: 'code', @@ -143,7 +153,15 @@ export const ProductionMain = useCrudSchemas(reactive([ value: 'workshop', message: '请填写车间代码!', isMainValue: true - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -157,6 +175,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择班组', searchField: 'code', @@ -167,7 +186,15 @@ export const ProductionMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -181,6 +208,7 @@ export const ProductionMain = useCrudSchemas(reactive([ form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择班次', searchField: 'code', @@ -191,7 +219,15 @@ export const ProductionMain = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }] + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 } } }, @@ -650,6 +686,7 @@ export const ProductionDetail = useCrudSchemas(reactive([ multiple:true, enterSearch:true, // isInpuFocusShow: true, + disabled:true, searchListPlaceholder: '请选择物料代码', // 输入框占位文本 searchField: 'itemCode', // 查询弹窗赋值字段 searchTitle: '生产线物料关系信息', // 查询弹窗标题 @@ -664,7 +701,17 @@ export const ProductionDetail = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false - }], + }], + verificationPage: ProductionlineitemApi.getProductionLineCodelistByCodes, // 校验数去焦点输入是否正确的方法 + isShowTableFormSearch: true, + verificationParams: [{ + key: 'itemCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 }, }, { From f992358ad36e224443f1fe054727ba021e16114e Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Tue, 16 Jul 2024 17:09:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ src/components/BasicForm/src/BasicForm.vue | 17 +++++++++++++++++ .../scrapRequestMain/scrapRequestMain.data.ts | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b50a3f14d..a19ccd983 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ form: { value:'prodLine', // 指主表某字段 message: '请选择生产线信息!', // 当前置条件为空时 弹出信息提示 isMainValue: true // 表示查询条件是主表的字段的值 + isFilterValue:true // 字段拼到filters里,值取主表数据 + action: '==', // 查询拼接条件 }, { key: 'customerCode', // 查询列表中字段 diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index f166f9a8b..dec0c25a5 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -410,6 +410,21 @@ const opensearchTable = ( // searchCondition.forEach((item) => { // 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 if (searchCondition[i].isMainValue) { + if(searchCondition[i].isFilterValue){ + //后端接口需要拼入到filters中 + filters.push({ + action: searchCondition[i].action, + column: searchCondition[i].key, + value: formRef.value.formModel[searchCondition[i].value] + ? formRef.value.formModel[searchCondition[i].value] + : props.detailData + ? props.detailData[searchCondition[i].value] + : row + ? row[searchCondition[i].value] + : '' + }) + }else{ + _searchCondition[searchCondition[i].key] = formRef.value.formModel[searchCondition[i].value] ? formRef.value.formModel[searchCondition[i].value] : props.detailData @@ -431,6 +446,8 @@ const opensearchTable = ( ) return } + } + } else if (searchCondition[i].isTableRowValue) { if (searchCondition[i].required) { if (row[searchCondition[i].value] == '' || row[searchCondition[i].value] == undefined) { diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts index b26be7afc..09f24d259 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts @@ -526,7 +526,9 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ key: 'warehouseCode', value: 'fromWarehouseCode', message: '请填写从仓库代码!', - isMainValue: true + isMainValue: true, + action: '==', + isFilterValue:true },{ key: 'businessType', value: 'Scrap', From 79a3ad7f348448ddd6329c18c59a6886a36ff1ae Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Tue, 16 Jul 2024 17:11:04 +0800 Subject: [PATCH 3/3] 1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a19ccd983..bd3e22726 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ form: { value:'prodLine', // 指主表某字段 message: '请选择生产线信息!', // 当前置条件为空时 弹出信息提示 isMainValue: true // 表示查询条件是主表的字段的值 - isFilterValue:true // 字段拼到filters里,值取主表数据 + isFilterValue:true // 字段拼到filters里,和isMainValue配合使用 action: '==', // 查询拼接条件 }, {