|
|
@ -388,7 +388,11 @@ export default { |
|
|
|
}, { |
|
|
|
value: '!=', |
|
|
|
label: '不等于' |
|
|
|
}] |
|
|
|
}], |
|
|
|
// 用户筛选暂存(如果筛选是code:value值为数组的格式) |
|
|
|
filterOptionCopyForMutiple:[], |
|
|
|
// 库位筛选,默认去掉的库位代码 |
|
|
|
filterCodeExclude:'INSPECT,HOLD,TRANSFERONTHEWAY', |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
@ -436,28 +440,8 @@ export default { |
|
|
|
}, |
|
|
|
// 点击筛选按钮 20230704 |
|
|
|
sxBtnClickHandle(data){ |
|
|
|
// 如果是code回显为一条数据处理 |
|
|
|
let _values = [] |
|
|
|
let _option = null |
|
|
|
let _new = [] |
|
|
|
data.forEach((item,key)=>{ |
|
|
|
if(item.column == 'code' && (item.action == '==' || item.action == '!=')){ |
|
|
|
_values.push(item.value) |
|
|
|
_option = item |
|
|
|
}else{ |
|
|
|
_new.push(item) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(_option){ |
|
|
|
let _item = { |
|
|
|
action: _option.action, |
|
|
|
column: _option.column, |
|
|
|
logic: "And", |
|
|
|
value: _values.join(','), |
|
|
|
} |
|
|
|
_new.push(_item) |
|
|
|
this.$refs.searchTable.setScreenDataFilters(_new) |
|
|
|
} |
|
|
|
// 合并code多选,进行回显 20230705更新 |
|
|
|
this.$refs.searchTable.setScreenDataFilters(this.filterOptionCopyForMutiple) |
|
|
|
}, |
|
|
|
//确定筛选 |
|
|
|
advancedFilter(url, list, TotalCount, data, oldSkipCount) { |
|
|
@ -475,36 +459,42 @@ export default { |
|
|
|
value: type_value, |
|
|
|
hide:true |
|
|
|
} |
|
|
|
// 库位筛选,默认去掉的库位代码 |
|
|
|
let _filter_code = { |
|
|
|
action: "!=", |
|
|
|
column: "code", |
|
|
|
logic: "And", |
|
|
|
value: this.filterCodeExclude, |
|
|
|
hide: true |
|
|
|
} |
|
|
|
if(this.pageListLocation.condition.filters.length <= 0){ |
|
|
|
this.pageListLocation.condition.filters.push(_filter) |
|
|
|
this.pageListLocation.condition.filters.push(_filter_code) |
|
|
|
} |
|
|
|
let _code_value = [] |
|
|
|
let _code_option = null |
|
|
|
list.condition.filters.forEach((item,key)=>{ |
|
|
|
// if(item.action == '!=' && item.column == 'type' && item.value == type_value){ |
|
|
|
// item.hide = true |
|
|
|
// } |
|
|
|
// code多选(只针对与等于和不等于)20230704 |
|
|
|
if(item.column == 'code'){ |
|
|
|
_code_value = item.value.split(',') |
|
|
|
_code_option = item |
|
|
|
list.condition.filters.splice(key,1) |
|
|
|
} |
|
|
|
}) |
|
|
|
// 拆分code多选,回传给接口 20230704 |
|
|
|
_code_value.forEach((value,index)=>{ |
|
|
|
// 不等于情况(And),等于情况(如果key等于0是 And,其余的是 Or) |
|
|
|
let _logic = (_code_option.action == '!=') ? "And" : (index == 0 ? "And" : "Or") |
|
|
|
if(value && value.length > 0){ |
|
|
|
let _item = { |
|
|
|
action: _code_option.action, |
|
|
|
column: _code_option.column, |
|
|
|
logic: _logic, |
|
|
|
value: value, |
|
|
|
} |
|
|
|
list.condition.filters.push(_item) |
|
|
|
// code多选处理 20230705更新 |
|
|
|
this.filterOptionCopyForMutiple = JSON.parse(JSON.stringify(list.condition.filters)) |
|
|
|
let _filters = [] |
|
|
|
// 拆分code多选,回传给接口 |
|
|
|
this.filterOptionCopyForMutiple.forEach((option)=>{ |
|
|
|
if(option.column == 'code'){ |
|
|
|
option.value.split(',').forEach((val,val_index)=>{ |
|
|
|
// 如果是第一位 则是用户选择的条件 否则判断是否为!= (And) 还是 == (Or) |
|
|
|
let _logic = val_index == 0 ? option.logic : (option.action == '!=' ? 'And' : 'Or') |
|
|
|
if((val || val == 0) && val.length > 0){ |
|
|
|
let _item = { |
|
|
|
action: option.action, |
|
|
|
column: option.column, |
|
|
|
logic: _logic, |
|
|
|
value: val, |
|
|
|
} |
|
|
|
_filters.push(_item) |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
_filters.push(option) |
|
|
|
} |
|
|
|
}) |
|
|
|
list.condition.filters = _filters |
|
|
|
getPageList(list, url) |
|
|
|
.then((res) => { |
|
|
|
this[data] = res.items; |
|
|
|