Commit 61e10ec1 authored by 李苏's avatar 李苏 💬

新增条件

parent a8cfa785
<template> <template>
<div class="min_full" style="height: calc(84vh - 75px);"> <div class="min_full" style="height: calc(84vh - 75px);">
<Details ref='cycleDetails' :app='this' v-if='showDialog' ></Details> <Details ref='cycleDetails' :app='this' v-if='showDialog' ></Details>
<div class="search" v-condition>
<!-- <SearchButton :app='app'></SearchButton> -->
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<el-radio v-model="gd" label="Y">有工单</el-radio>
<el-radio v-model="gd" label="N">无工单</el-radio>
<el-radio v-model="gd" label="A">全部</el-radio>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作--> <!-- 按钮操作-->
<el-row class="tool-bar"> <el-row class="tool-bar">
...@@ -44,11 +60,39 @@ ...@@ -44,11 +60,39 @@
val=='M'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=true);item.prop=='month'&&(item.show=true);item.prop=='tjrq'&&(item.show=false);item.prop=='weekBegin'&&(item.show=false);item.prop=='weekEnd'&&(item.show=false)}) val=='M'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=true);item.prop=='month'&&(item.show=true);item.prop=='tjrq'&&(item.show=false);item.prop=='weekBegin'&&(item.show=false);item.prop=='weekEnd'&&(item.show=false)})
val=='W'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=false);item.prop=='month'&&(item.show=false);item.prop=='tjrq'&&(item.show=false);item.prop=='weekBegin'&&(item.show=true)&&(item.width=300);item.prop=='weekEnd'&&(item.show=true)&&(item.width=300)}) val=='W'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=false);item.prop=='month'&&(item.show=false);item.prop=='tjrq'&&(item.show=false);item.prop=='weekBegin'&&(item.show=true)&&(item.width=300);item.prop=='weekEnd'&&(item.show=true)&&(item.width=300)})
val=='D'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=false);item.prop=='month'&&(item.show=false);item.prop=='tjrq'&&(item.show=true)&&(item.width=400);item.prop=='weekBegin'&&(item.show=false);item.prop=='weekEnd'&&(item.show=false)}) val=='D'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=false);item.prop=='month'&&(item.show=false);item.prop=='tjrq'&&(item.show=true)&&(item.width=400);item.prop=='weekBegin'&&(item.show=false);item.prop=='weekEnd'&&(item.show=false)})
// this.$refs['TablePager'].pageQuery({setFirstCurrent:true}); // // this.$refs['TablePager'].pageQuery({setFirstCurrent:true});
},
gd(val){
let config={
'A':{setFirstCurrent:true},
'Y':{setFirstCurrent:true,filter:(data)=>{
let dataArry=data.filter(item=>{
if(item.allCount!=0){
return true
}else{
return false
}
})
return dataArry
}},
'N':{setFirstCurrent:true,filter:(data)=>{
let dataArry=data.filter(item=>{
if(item.allCount==0){
return true
}else{
return false
}
})
return dataArry
}}
}
this.$refs['TablePager'].pageQuery(config[this.gd])
} }
}, },
data() { data() {
return { return {
gd:'Y',
showDialog:false, showDialog:false,
DialogTitle:'班组详情', DialogTitle:'班组详情',
DialogWidth:'70vw', DialogWidth:'70vw',
...@@ -122,24 +166,39 @@ ...@@ -122,24 +166,39 @@
}, },
methods: { methods: {
details(){ details(){
let config={
'A':{setFirstCurrent:true},
'Y':{setFirstCurrent:true,filter:(data)=>{
let dataArry=data.filter(item=>{
if(item.allCount!=0){
return true
}else{
return false
}
})
return dataArry
}},
'N':{setFirstCurrent:true,filter:(data)=>{
let dataArry=data.filter(item=>{
if(item.allCount==0){
return true
}else{
return false
}
})
return dataArry
}}
}
if(this.tabData.length>0&&this.app.selectOne || this.app.clickOne){ if(this.tabData.length>0&&this.app.selectOne || this.app.clickOne){
this.showDialog=true this.showDialog=true
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs.cycleDetails.queryParams=JSON.parse(JSON.stringify(this.queryParams)) this.$refs.cycleDetails.queryParams=JSON.parse(JSON.stringify(this.queryParams))
this.$refs.cycleDetails.queryParams.grouptype='RY' this.$refs.cycleDetails.queryParams.grouptype='RY'
this.$refs.cycleDetails.queryParams.bmid=this.singleItem.bmid this.$refs.cycleDetails.queryParams.bmid=this.singleItem.bmid
this.$refs.cycleDetails.$refs['TablePager'].pageQuery({ this.$refs.cycleDetails.$refs['TablePager'].pageQuery(
filter:(data)=>{ config[this.$refs.cycleDetails.gd]
let dataArry=data.filter(item=>{ )
if(item.allCount!=0){
return true
}else{
return false
}
})
return dataArry
}
})
}) })
}else{ }else{
this.$warning('请选择一条数据') this.$warning('请选择一条数据')
......
...@@ -2,7 +2,24 @@ ...@@ -2,7 +2,24 @@
<DefaultDialog :app='app'> <DefaultDialog :app='app'>
<div slot="form" class="min_full" style="height: 70vh;border: 0px;"> <div slot="form" class="min_full" style="height: 70vh;border: 0px;">
<!-- 表格--> <!-- 表格-->
<div class="tablePagers" style="height: 100%;"> <div class="tablePagers" style="height: 100%;">
<div class="search" style="border: 0px;" v-condition>
<!-- <SearchButton :app='app'></SearchButton> -->
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<el-radio v-model="gd" label="Y">有工单</el-radio>
<el-radio v-model="gd" label="N">无工单</el-radio>
<el-radio v-model="gd" label="A">全部</el-radio>
</div>
</el-col>
</el-row>
</div>
<TablePager :showPagination='false' :delButton='false' @getData='getData' :ref="'TablePager'" :app='this' :query='query' @selectItem='selectItem' <TablePager :showPagination='false' :delButton='false' @getData='getData' :ref="'TablePager'" :app='this' :query='query' @selectItem='selectItem'
@getRow='getRow'> @getRow='getRow'>
</TablePager> </TablePager>
...@@ -30,7 +47,6 @@ ...@@ -30,7 +47,6 @@
this.queryParams.rwlx=='M'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=true);item.prop=='month'&&(item.show=true);item.prop=='tjrq'&&(item.show=false);item.prop=='weekBegin'&&(item.show=false);item.prop=='weekEnd'&&(item.show=false)}) this.queryParams.rwlx=='M'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=true);item.prop=='month'&&(item.show=true);item.prop=='tjrq'&&(item.show=false);item.prop=='weekBegin'&&(item.show=false);item.prop=='weekEnd'&&(item.show=false)})
this.queryParams.rwlx=='W'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=false);item.prop=='month'&&(item.show=false);item.prop=='tjrq'&&(item.show=false);item.prop=='weekBegin'&&(item.show=true)&&(item.width=300);item.prop=='weekEnd'&&(item.show=true)&&(item.width=300)}) this.queryParams.rwlx=='W'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=false);item.prop=='month'&&(item.show=false);item.prop=='tjrq'&&(item.show=false);item.prop=='weekBegin'&&(item.show=true)&&(item.width=300);item.prop=='weekEnd'&&(item.show=true)&&(item.width=300)})
this.queryParams.rwlx=='D'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=false);item.prop=='month'&&(item.show=false);item.prop=='tjrq'&&(item.show=true)&&(item.width=400);item.prop=='weekBegin'&&(item.show=false);item.prop=='weekEnd'&&(item.show=false)}) this.queryParams.rwlx=='D'&&this.$refs['TablePager']['newGridList'].forEach(item=>{item.prop=='year'&&(item.show=false);item.prop=='month'&&(item.show=false);item.prop=='tjrq'&&(item.show=true)&&(item.width=400);item.prop=='weekBegin'&&(item.show=false);item.prop=='weekEnd'&&(item.show=false)})
this.$refs['TablePager'].pageQuery({});
clearInterval(timer) clearInterval(timer)
}else{ }else{
console.log(`this.$refs['TablePager']['newGridList'].length!=0`) console.log(`this.$refs['TablePager']['newGridList'].length!=0`)
...@@ -52,12 +68,38 @@ ...@@ -52,12 +68,38 @@
}, },
watch:{ watch:{
gd(val){
let config={
'A':{setFirstCurrent:true},
'Y':{setFirstCurrent:true,filter:(data)=>{
let dataArry=data.filter(item=>{
if(item.allCount!=0){
return true
}else{
return false
}
})
return dataArry
}},
'N':{setFirstCurrent:true,filter:(data)=>{
let dataArry=data.filter(item=>{
if(item.allCount==0){
return true
}else{
return false
}
})
return dataArry
}}
}
this.$refs['TablePager'].pageQuery(config[this.gd])
}
}, },
data() { data() {
return { return {
/*需要的额外参数 */ /*需要的额外参数 */
gd:'Y',
baseUrl: 'kzzx/appversion', baseUrl: 'kzzx/appversion',
/* 查询参数*/ /* 查询参数*/
queryParams: { queryParams: {
......
...@@ -193,7 +193,30 @@ ...@@ -193,7 +193,30 @@
}, },
methods: { methods: {
getRow: function(e) { getRow: function(e) {
let config={
'A':{setFirstCurrent:true},
'Y':{setFirstCurrent:true,filter:(data)=>{
let dataArry=data.filter(item=>{
if(item.allCount!=0){
return true
}else{
return false
}
})
return dataArry
}},
'N':{setFirstCurrent:true,filter:(data)=>{
let dataArry=data.filter(item=>{
if(item.allCount==0){
return true
}else{
return false
}
})
return dataArry
}}
}
this.rowItem = e this.rowItem = e
this.fshake(()=>{ this.fshake(()=>{
...@@ -207,23 +230,9 @@ ...@@ -207,23 +230,9 @@
this.$refs.cycle.queryParams.jsrq=(this.singleItem.weekEnd>this.queryParams.jsrq)?(this.queryParams.jsrq):(this.singleItem.weekEnd) this.$refs.cycle.queryParams.jsrq=(this.singleItem.weekEnd>this.queryParams.jsrq)?(this.queryParams.jsrq):(this.singleItem.weekEnd)
} }
this.$refs.cycle.queryParams.gsid=this.singleItem.gsid this.$refs.cycle.queryParams.gsid=this.singleItem.gsid
this.$refs.cycle.$refs['TablePager'].pageQuery({setFirstCurrent:true,filter:(data)=>{ /* 判断前端过滤条件*/
let dataArry=data.filter(item=>{ this.$refs.cycle.$refs['TablePager'].pageQuery(config[this.$refs.cycle.gd])
if(item.allCount!=0){
return true
}else{
return false
}
})
return dataArry
}})
},500) },500)
}, },
handleClick(val){ handleClick(val){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment