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',