Browse Source

新增盘点:筛选同类型:多种条件且多选拼接,与选择条件需要同步共存bug问题处理

dev_web_online
安虹睿 2 years ago
parent
commit
f1059dfc63
  1. 86
      fe/PC/src/components/StepsCountPlanForm/index.vue

86
fe/PC/src/components/StepsCountPlanForm/index.vue

@ -388,7 +388,11 @@ export default {
}, { }, {
value: '!=', value: '!=',
label: '不等于' label: '不等于'
}] }],
// (codevalue)
filterOptionCopyForMutiple:[],
//
filterCodeExclude:'INSPECT,HOLD,TRANSFERONTHEWAY',
}; };
}, },
mounted() { mounted() {
@ -436,28 +440,8 @@ export default {
}, },
// 20230704 // 20230704
sxBtnClickHandle(data){ sxBtnClickHandle(data){
// code // code 20230705
let _values = [] this.$refs.searchTable.setScreenDataFilters(this.filterOptionCopyForMutiple)
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)
}
}, },
// //
advancedFilter(url, list, TotalCount, data, oldSkipCount) { advancedFilter(url, list, TotalCount, data, oldSkipCount) {
@ -475,36 +459,42 @@ export default {
value: type_value, value: type_value,
hide:true hide:true
} }
//
let _filter_code = {
action: "!=",
column: "code",
logic: "And",
value: this.filterCodeExclude,
hide: true
}
if(this.pageListLocation.condition.filters.length <= 0){ if(this.pageListLocation.condition.filters.length <= 0){
this.pageListLocation.condition.filters.push(_filter) this.pageListLocation.condition.filters.push(_filter)
this.pageListLocation.condition.filters.push(_filter_code)
} }
let _code_value = [] // code 20230705
let _code_option = null this.filterOptionCopyForMutiple = JSON.parse(JSON.stringify(list.condition.filters))
list.condition.filters.forEach((item,key)=>{ let _filters = []
// if(item.action == '!=' && item.column == 'type' && item.value == type_value){ // code
// item.hide = true this.filterOptionCopyForMutiple.forEach((option)=>{
// } if(option.column == 'code'){
// code20230704 option.value.split(',').forEach((val,val_index)=>{
if(item.column == 'code'){ // != (And) == Or
_code_value = item.value.split(',') let _logic = val_index == 0 ? option.logic : (option.action == '!=' ? 'And' : 'Or')
_code_option = item if((val || val == 0) && val.length > 0){
list.condition.filters.splice(key,1) let _item = {
} action: option.action,
}) column: option.column,
// code 20230704 logic: _logic,
_code_value.forEach((value,index)=>{ value: val,
// And,key0 And, Or }
let _logic = (_code_option.action == '!=') ? "And" : (index == 0 ? "And" : "Or") _filters.push(_item)
if(value && value.length > 0){ }
let _item = { })
action: _code_option.action, }else{
column: _code_option.column, _filters.push(option)
logic: _logic,
value: value,
}
list.condition.filters.push(_item)
} }
}) })
list.condition.filters = _filters
getPageList(list, url) getPageList(list, url)
.then((res) => { .then((res) => {
this[data] = res.items; this[data] = res.items;

Loading…
Cancel
Save