From 0d37e7941bfca852fdf3776014a0ce72b049f1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Tue, 4 Jul 2023 15:52:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=82=B9=E7=AD=9B=E9=80=89=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=A4=9A=E9=80=89=E6=8B=86=E5=88=86=E5=9B=9E=E4=BC=A0?= =?UTF-8?q?=E5=8F=8A=E9=87=8D=E7=BB=84=E5=9B=9E=E6=98=BE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/StepsCountPlanForm/index.vue | 94 ++++++++++++------- fe/PC/src/components/searchPage/index.vue | 5 + 2 files changed, 67 insertions(+), 32 deletions(-) diff --git a/fe/PC/src/components/StepsCountPlanForm/index.vue b/fe/PC/src/components/StepsCountPlanForm/index.vue index 08873a921..ac95ef276 100644 --- a/fe/PC/src/components/StepsCountPlanForm/index.vue +++ b/fe/PC/src/components/StepsCountPlanForm/index.vue @@ -42,6 +42,7 @@ { + 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) + // code多选(只针对与等于和不等于)20230704 + 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),等于情况(如果key等于0是 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; diff --git a/fe/PC/src/components/searchPage/index.vue b/fe/PC/src/components/searchPage/index.vue index a066a9292..d8bf64922 100644 --- a/fe/PC/src/components/searchPage/index.vue +++ b/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))