|
@ -856,63 +856,16 @@ const onBlur = async (field, e) => { |
|
|
formSchema.value.find((item) => item.field == field)?.componentProps?.verificationParams || |
|
|
formSchema.value.find((item) => item.field == field)?.componentProps?.verificationParams || |
|
|
[] |
|
|
[] |
|
|
console.log('走新方法啦') |
|
|
console.log('走新方法啦') |
|
|
searchCondition = [...searchCondition, ...verificationParams] |
|
|
// searchCondition = [...searchCondition, ...verificationParams] |
|
|
|
|
|
|
|
|
if (e && isString(e)) { |
|
|
if (e && isString(e)) { |
|
|
let setV = {} |
|
|
let setV = {} |
|
|
setV[field] = '' |
|
|
setV[field] = '' |
|
|
let params = {} |
|
|
let params = {} |
|
|
// 循环参数设置参数为key:value格式 |
|
|
|
|
|
// if (searchCondition1 && searchCondition1.length > 0) { |
|
|
|
|
|
// for (let i = 0; i < searchCondition1.length; i++) { |
|
|
|
|
|
// searchCondition1[i].isSearch = true |
|
|
|
|
|
// if (searchCondition1[i].isMainValue) { |
|
|
|
|
|
// params[searchCondition1[i].key] = formRef.value.formModel[searchCondition1[i].value] |
|
|
|
|
|
// ? formRef.value.formModel[searchCondition1[i].value] |
|
|
|
|
|
// : props.detailData |
|
|
|
|
|
// ? props.detailData[searchCondition1[i].value] |
|
|
|
|
|
// : '' |
|
|
|
|
|
// // 是否含有空参数情况 |
|
|
|
|
|
// let isNull = false |
|
|
|
|
|
// if (params[searchCondition1[i].key] == '' || params[searchCondition1[i].key] == undefined) { |
|
|
|
|
|
// isNull = true |
|
|
|
|
|
// } |
|
|
|
|
|
// if (isNull) { |
|
|
|
|
|
// message.warning( |
|
|
|
|
|
// searchCondition1[i].message ? searchCondition1[i].message : '前置条件未选择!' |
|
|
|
|
|
// ) |
|
|
|
|
|
// return |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// // 扩展 转换为筛选条件进行查询 |
|
|
|
|
|
// if (searchCondition1[i].isSearch) { |
|
|
|
|
|
// if (searchCondition1[i].isFormModel) { |
|
|
|
|
|
// //用formModel中的值 |
|
|
|
|
|
// if (searchCondition1[i].required) { |
|
|
|
|
|
// if ( |
|
|
|
|
|
// formRef.value.formModel[searchCondition1[i].value] == '' || |
|
|
|
|
|
// formRef.value.formModel[searchCondition1[i].value] == undefined |
|
|
|
|
|
// ) { |
|
|
|
|
|
// message.warning( |
|
|
|
|
|
// searchCondition1[i].message |
|
|
|
|
|
// ? searchCondition1[i].message |
|
|
|
|
|
// : '前置条件未选择!' |
|
|
|
|
|
// ) |
|
|
|
|
|
// return |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// params[searchCondition1[i].key] = searchCondition1[i].value |
|
|
|
|
|
// } else { |
|
|
|
|
|
// params[searchCondition1[i].key] = searchCondition1[i].value |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// 判断查询条件中,是否存在指向主表的数据 |
|
|
|
|
|
const _searchCondition = {} |
|
|
const _searchCondition = {} |
|
|
|
|
|
let filters: any[] = [] |
|
|
if (searchCondition && searchCondition.length > 0) { |
|
|
if (searchCondition && searchCondition.length > 0) { |
|
|
// 转换筛选条件所需 |
|
|
// 转换筛选条件所需 |
|
|
let filters: any[] = [] |
|
|
|
|
|
for (var i = 0; i < searchCondition.length; i++) { |
|
|
for (var i = 0; i < searchCondition.length; i++) { |
|
|
// searchCondition.forEach((item) => { |
|
|
// searchCondition.forEach((item) => { |
|
|
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 |
|
|
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 |
|
@ -925,9 +878,7 @@ const onBlur = async (field, e) => { |
|
|
? props.detailData[searchCondition[i].value] |
|
|
? props.detailData[searchCondition[i].value] |
|
|
: // : row |
|
|
: // : row |
|
|
// ? row[searchCondition[i].value] |
|
|
// ? row[searchCondition[i].value] |
|
|
e |
|
|
'' |
|
|
? e.trim() |
|
|
|
|
|
: '' |
|
|
|
|
|
// 是否含有空参数情况 |
|
|
// 是否含有空参数情况 |
|
|
let isNull = false |
|
|
let isNull = false |
|
|
if ( |
|
|
if ( |
|
@ -942,7 +893,13 @@ const onBlur = async (field, e) => { |
|
|
) |
|
|
) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
filters.push({ |
|
|
|
|
|
action: searchCondition[i].action || '==', |
|
|
|
|
|
column: searchCondition[i].key, |
|
|
|
|
|
value: formRef.value.formModel[searchCondition[i].value] |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// else if (searchCondition[i].isTableRowValue) { |
|
|
// else if (searchCondition[i].isTableRowValue) { |
|
|
// if (searchCondition[i].required) { |
|
|
// if (searchCondition[i].required) { |
|
|
// if (row[searchCondition[i].value] == '' || row[searchCondition[i].value] == undefined) { |
|
|
// if (row[searchCondition[i].value] == '' || row[searchCondition[i].value] == undefined) { |
|
@ -973,21 +930,49 @@ const onBlur = async (field, e) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
filters.push({ |
|
|
filters.push({ |
|
|
action: searchCondition[i].action, |
|
|
action: searchCondition[i].action || '==', |
|
|
column: searchCondition[i].key, |
|
|
column: searchCondition[i].key, |
|
|
value: formRef.value.formModel[searchCondition[i].value] |
|
|
value: formRef.value.formModel[searchCondition[i].value] |
|
|
? formRef.value.formModel[searchCondition[i].value] |
|
|
|
|
|
: e.trim() |
|
|
|
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
filters.push({ |
|
|
filters.push({ |
|
|
action: searchCondition[i].action, |
|
|
action: searchCondition[i].action || '==', |
|
|
column: searchCondition[i].key, |
|
|
column: searchCondition[i].key, |
|
|
value: searchCondition[i].value |
|
|
value: searchCondition[i].value |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
_searchCondition[searchCondition[i].key] = searchCondition[i].value |
|
|
filters.push({ |
|
|
|
|
|
action: searchCondition[i].action || '==', |
|
|
|
|
|
column: searchCondition[i].key, |
|
|
|
|
|
value: searchCondition[i].value |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (verificationParams && verificationParams.length > 0) { |
|
|
|
|
|
// 转换筛选条件所需 |
|
|
|
|
|
for (var i = 0; i < verificationParams.length; i++) { |
|
|
|
|
|
// 扩展 转换为筛选条件进行查询 |
|
|
|
|
|
if (verificationParams[i].isSearch) { |
|
|
|
|
|
if (verificationParams[i].isFormModel) { |
|
|
|
|
|
filters.push({ |
|
|
|
|
|
action: verificationParams[i].action, |
|
|
|
|
|
column: verificationParams[i].key, |
|
|
|
|
|
value: formRef.value.formModel[verificationParams[i].value] |
|
|
|
|
|
? formRef.value.formModel[verificationParams[i].value] |
|
|
|
|
|
: e.trim() |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
filters.push({ |
|
|
|
|
|
action: verificationParams[i].action, |
|
|
|
|
|
column: verificationParams[i].key, |
|
|
|
|
|
value: verificationParams[i].value |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
_searchCondition[verificationParams[i].key] = verificationParams[i].value |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -995,13 +980,18 @@ const onBlur = async (field, e) => { |
|
|
_searchCondition.isSearch = true |
|
|
_searchCondition.isSearch = true |
|
|
_searchCondition.filters = filters |
|
|
_searchCondition.filters = filters |
|
|
} |
|
|
} |
|
|
} |
|
|
console.log(4545, _searchCondition) |
|
|
let obj = { |
|
|
let obj = { |
|
|
by: 'ASC', |
|
|
by: 'ASC', |
|
|
pageNo: 1, |
|
|
pageNo: 1, |
|
|
pageSize: 20 |
|
|
pageSize: 20 |
|
|
} |
|
|
} |
|
|
params = { ..._searchCondition, ...obj } |
|
|
console.log(888,_searchCondition) |
|
|
|
|
|
params = { |
|
|
|
|
|
isSearch:_searchCondition.isSearch, |
|
|
|
|
|
filters:_searchCondition.filters, |
|
|
|
|
|
...obj |
|
|
|
|
|
} |
|
|
// console.log(333,params) |
|
|
// console.log(333,params) |
|
|
if (!formSchemaObj?.multiple && e.indexOf(',') > -1) { |
|
|
if (!formSchemaObj?.multiple && e.indexOf(',') > -1) { |
|
|
message.alert('该输入框只能输入一条数据') |
|
|
message.alert('该输入框只能输入一条数据') |
|
@ -1059,6 +1049,7 @@ const onBlur = async (field, e) => { |
|
|
isExecute.value = true |
|
|
isExecute.value = true |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 批量增加 |
|
|
// 批量增加 |
|
|
const batchAdd = async (val) => { |
|
|
const batchAdd = async (val) => { |
|
|
const row = {} |
|
|
const row = {} |
|
|