Browse Source

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

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

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

@ -388,7 +388,11 @@ export default {
}, {
value: '!=',
label: '不等于'
}]
}],
// (codevalue)
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
// }
// code20230704
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,key0 And, Or
let _logic = (_code_option.action == '!=') ? "And" : (index == 0 ? "And" : "Or")
if(value && value.length > 0){
// 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: _code_option.action,
column: _code_option.column,
action: option.action,
column: option.column,
logic: _logic,
value: value,
value: val,
}
_filters.push(_item)
}
list.condition.filters.push(_item)
})
}else{
_filters.push(option)
}
})
list.condition.filters = _filters
getPageList(list, url)
.then((res) => {
this[data] = res.items;

Loading…
Cancel
Save