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

新增条件

parent a8cfa785
<template>
<div class="min_full" style="height: calc(84vh - 75px);">
<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">
......@@ -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=='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)})
// 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() {
return {
gd:'Y',
showDialog:false,
DialogTitle:'班组详情',
DialogWidth:'70vw',
......@@ -122,24 +166,39 @@
},
methods: {
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){
this.showDialog=true
this.$nextTick(()=>{
this.$refs.cycleDetails.queryParams=JSON.parse(JSON.stringify(this.queryParams))
this.$refs.cycleDetails.queryParams.grouptype='RY'
this.$refs.cycleDetails.queryParams.bmid=this.singleItem.bmid
this.$refs.cycleDetails.$refs['TablePager'].pageQuery({
filter:(data)=>{
let dataArry=data.filter(item=>{
if(item.allCount!=0){
return true
}else{
return false
}
})
return dataArry
}
})
this.$refs.cycleDetails.$refs['TablePager'].pageQuery(
config[this.$refs.cycleDetails.gd]
)
})
}else{
this.$warning('请选择一条数据')
......
......@@ -2,7 +2,24 @@
<DefaultDialog :app='app'>
<div slot="form" class="min_full" style="height: 70vh;border: 0px;">
<!-- 表格-->
<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'
@getRow='getRow'>
</TablePager>
......@@ -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=='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.$refs['TablePager'].pageQuery({});
clearInterval(timer)
}else{
console.log(`this.$refs['TablePager']['newGridList'].length!=0`)
......@@ -52,12 +68,38 @@
},
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() {
return {
/*需要的额外参数 */
gd:'Y',
baseUrl: 'kzzx/appversion',
/* 查询参数*/
queryParams: {
......
......@@ -193,7 +193,30 @@
},
methods: {
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.fshake(()=>{
......@@ -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.gsid=this.singleItem.gsid
this.$refs.cycle.$refs['TablePager'].pageQuery({setFirstCurrent:true,filter:(data)=>{
let dataArry=data.filter(item=>{
if(item.allCount!=0){
return true
}else{
return false
}
})
return dataArry
}})
/* 判断前端过滤条件*/
this.$refs.cycle.$refs['TablePager'].pageQuery(config[this.$refs.cycle.gd])
},500)
},
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