Browse Source

批量添加,失去焦点添加参数可选可空的判断

hella_online_20240919
yufei_wang 2 months ago
parent
commit
492753db1a
  1. 9
      src/api/wms/business/inputBlur.ts

9
src/api/wms/business/inputBlur.ts

@ -49,8 +49,10 @@ export const tableFormBlurVer = async (headerItem, val, row, index, routeName, f
params.value[searchCondition[i].key] == '' || params.value[searchCondition[i].key] == '' ||
params.value[searchCondition[i].key] == undefined params.value[searchCondition[i].key] == undefined
) { ) {
if(!searchCondition[i].isOptional){ // 添加参数可选可空的判断
isNull = true isNull = true
} }
}
if (isNull) { if (isNull) {
message.warning( message.warning(
searchCondition[i].message ? searchCondition[i].message : '前置条件未选择!' searchCondition[i].message ? searchCondition[i].message : '前置条件未选择!'
@ -58,6 +60,9 @@ export const tableFormBlurVer = async (headerItem, val, row, index, routeName, f
row[headerItem.field] = '' row[headerItem.field] = ''
return return
} }
if(searchCondition[i].isOptional&&!params.value[searchCondition[i].key]){ // 添加参数可选可空的判断
continue
}
filters.push({ filters.push({
action: searchCondition[i].action || '==', action: searchCondition[i].action || '==',
column: searchCondition[i].key, column: searchCondition[i].key,
@ -493,8 +498,12 @@ export const getListByBottonInput = async (headerItem, val, row, routeName, form
params.value[searchCondition1[i].key] == '' || params.value[searchCondition1[i].key] == '' ||
params.value[searchCondition1[i].key] == undefined params.value[searchCondition1[i].key] == undefined
) { ) {
if(!searchCondition1[i].isOptional){ // 添加参数可选可空的判断
if(!searchCondition1[i].isOptional){ // 添加参数可选可空的判断
isNull = true isNull = true
} }
}
}
if (isNull) { if (isNull) {
message.warning( message.warning(
searchCondition1[i].message ? searchCondition1[i].message : '前置条件未选择!' searchCondition1[i].message ? searchCondition1[i].message : '前置条件未选择!'

Loading…
Cancel
Save