From 3884bc3daeb9d77aad112a5ae74481729bec5d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Mon, 15 Jan 2024 10:35:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BC=B9=E7=AA=97=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=89=8D=E7=BD=AE=E6=9D=A1=E4=BB=B6=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 37 ++++++++++++------- .../productionreturnRequestMain.data.ts | 6 +++ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 7d569b1b4..93b9dc293 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -282,30 +282,39 @@ const opensearchTable = ( if (searchCondition && searchCondition.length > 0) { // 转换筛选条件所需 let filters: any[] = [] - searchCondition.forEach((item) => { + for (var i=0; i< searchCondition.length; i++ ) { + // searchCondition.forEach((item) => { // 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 - // 20231127 row[item.value]?row[item.value] 修改为 row?row[item.value] 返回'null' 为了查询不到任何数据 - if (item.isMainValue) { - _searchCondition[item.key] = formRef.value.formModel[item.value] - ? formRef.value.formModel[item.value] + if (searchCondition[i].isMainValue) { + _searchCondition[searchCondition[i].key] = formRef.value.formModel[searchCondition[i].value] + ? formRef.value.formModel[searchCondition[i].value] : props.detailData - ? props.detailData[item.value] + ? props.detailData[searchCondition[i].value] : row - ? row[item.value] - : 'null' + ? row[searchCondition[i].value] + : '' + // 是否含有空参数情况 + let isNull = false + if (_searchCondition[searchCondition[i].key] == '' || _searchCondition[searchCondition[i].key] == undefined) { + isNull = true + } + if (isNull) { + message.warning(searchCondition[i].message) + return + } } else { // 扩展 转换为筛选条件进行查询 - if (item.isSearch) { + if (searchCondition[i].isSearch) { filters.push({ - action: item.action, - column: item.key, - value: item.value + action: searchCondition[i].action, + column: searchCondition[i].key, + value: searchCondition[i].value }) } else { - _searchCondition[item.key] = item.value + _searchCondition[searchCondition[i].key] = searchCondition[i].value } } - }) + } if (filters.length > 0) { _searchCondition.isSearch = true _searchCondition.filters = filters diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts index 53b2d9954..d779eb2d6 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts @@ -435,6 +435,7 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive