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

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

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

Loading…
Cancel
Save