Browse Source

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

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

70
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 type_value = this.CreateFormData.requestType == 1 ? '2' : '5'
let _filter = { let _filter = {
action: "!=", action: "!=",
column: "type", column: "type",
logic: "And", logic: "And",
value: "5", value: type_value,
hide:true 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)
} }
let _code_value = []
let _code_option = null
list.condition.filters.forEach((item,key)=>{ list.condition.filters.forEach((item,key)=>{
if(item.action == '!=' && item.column == 'type' && item.value == '5'){ if(item.action == '!=' && item.column == 'type' && item.value == type_value){
item.hide = true item.hide = true
} }
}) // code20230704
if(item.column == 'code'){
_code_value = item.value.split(',')
_code_option = item
list.condition.filters.splice(key,1)
} }
// Excel(this.CreateFormData.requestType == 1) })
else{ // code 20230704
let _filter = { _code_value.forEach((value,index)=>{
action: "!=", // And,key0 And, Or
column: "type", let _logic = (_code_option.action == '!=') ? "And" : (index == 0 ? "And" : "Or")
logic: "And", if(value && value.length > 0){
value: "2", let _item = {
hide:true action: _code_option.action,
} column: _code_option.column,
if(this.pageListLocation.condition.filters.length <= 0){ logic: _logic,
this.pageListLocation.condition.filters.push(_filter) value: value,
} }
list.condition.filters.forEach((item,key)=>{ list.condition.filters.push(_item)
if(item.action == '!=' && item.column == 'type' && item.value == '2'){
item.hide = true
} }
}) })
}
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