Browse Source

盘点筛选条件多选拆分回传及重组回显处理

dev_web_online
安虹睿 2 years ago
parent
commit
0d37e7941b
  1. 94
      fe/PC/src/components/StepsCountPlanForm/index.vue
  2. 5
      fe/PC/src/components/searchPage/index.vue

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

@ -42,6 +42,7 @@
<!-- 搜索按钮窗体组件LocationForPADPlan -->
<searchPage
v-if="active == 1"
@sxBtnClickHandle="sxBtnClickHandle"
ref="searchTable"
:tableLoading="tableLoading"
:advancedFilter="advancedFilter(
@ -424,48 +425,77 @@ export default {
detailsDataPush(val) {
this.$emit("detailsDataPush", val);
},
// 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)
}
},
//
advancedFilter(url, list, TotalCount, data, oldSkipCount) {
return () => {
list.SkipCount = (oldSkipCount - 1) * list.MaxResultCount;
this.tableLoading = true;
// 线 20230703
// Excel(this.CreateFormData.requestType != 1)线 20230703
if ( this.CreateFormData.requestType != 1) {
let _filter = {
action: "!=",
column: "type",
logic: "And",
value: "5",
hide:true
}
if(this.pageListLocation.condition.filters.length <= 0){
this.pageListLocation.condition.filters.push(_filter)
}
list.condition.filters.forEach((item,key)=>{
if(item.action == '!=' && item.column == 'type' && item.value == '5'){
item.hide = true
}
})
// Excel(this.CreateFormData.requestType == 1)2
// Excel(this.CreateFormData.requestType != 1)线5
let type_value = this.CreateFormData.requestType == 1 ? '2' : '5'
let _filter = {
action: "!=",
column: "type",
logic: "And",
value: type_value,
hide:true
}
if(this.pageListLocation.condition.filters.length <= 0){
this.pageListLocation.condition.filters.push(_filter)
}
// Excel(this.CreateFormData.requestType == 1)
else{
let _filter = {
action: "!=",
column: "type",
logic: "And",
value: "2",
hide:true
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
}
if(this.pageListLocation.condition.filters.length <= 0){
this.pageListLocation.condition.filters.push(_filter)
// code20230704
if(item.column == 'code'){
_code_value = item.value.split(',')
_code_option = item
list.condition.filters.splice(key,1)
}
list.condition.filters.forEach((item,key)=>{
if(item.action == '!=' && item.column == 'type' && item.value == '2'){
item.hide = true
})
// 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){
let _item = {
action: _code_option.action,
column: _code_option.column,
logic: _logic,
value: value,
}
})
}
list.condition.filters.push(_item)
}
})
getPageList(list, url)
.then((res) => {
this[data] = res.items;

5
fe/PC/src/components/searchPage/index.vue

@ -220,8 +220,13 @@ export default {
}]
this.screenData.filters = data
}
this.$emit('sxBtnClickHandle',this.screenData.filters)
this.modal = true
},
// this.screenData.filters
setScreenDataFilters (data){
this.screenData.filters = data
},
//
screenFormClick (val) {
let filter = JSON.parse(JSON.stringify(this.filterPageListParams))

Loading…
Cancel
Save