|
|
<template>
|
|
|
<div class="panel-col">
|
|
|
<select v-model="params.type" class="form-control">
|
|
|
<select v-model="params.type" class="form-control" @change="changeType">
|
|
|
<option value="1">日报</option>
|
|
|
<option value="2">周报</option>
|
|
|
<option value="3">月报</option>
|
...
|
...
|
@@ -10,10 +10,10 @@ |
|
|
<com-calendar :value.sync="params.reqTime" :placeholder="'选择时间'" :end="EndDate"></com-calendar>
|
|
|
</div>
|
|
|
<div class="panel-col" v-if="params.type==3">
|
|
|
<com-calendar :format="'yyyy-MM'" :value.sync="params.reqTime" :end="EndDate" :placeholder="'选择月份'"></com-calendar>
|
|
|
<com-calendar :format="'yyyy-MM'" :value.sync="params.reqTime" :end="EndMonth" :placeholder="'选择月份'"></com-calendar>
|
|
|
</div>
|
|
|
<div class="panel-col" v-if="params.type==2">
|
|
|
<com-calendar :value.sync="params.beginTime" :state="'week'" :end="EndDate" :placeholder="'开始时间'"></com-calendar>
|
|
|
<com-calendar :value.sync="params.beginTime" :state="'week'" :placeholder="'开始时间'"></com-calendar>
|
|
|
</div>
|
|
|
<div class="panel-col" v-if="params.type==2">
|
|
|
<input type="text" :value="EndTime" class="form-control" placeholder="结束时间" disabled>
|
...
|
...
|
@@ -49,7 +49,13 @@ |
|
|
},
|
|
|
computed: {
|
|
|
EndDate(){
|
|
|
let date=new Date()
|
|
|
let date=new Date();
|
|
|
date.setDate(date.getDate()-1);
|
|
|
this.params.reqTime = util.dateFormat(date, "YYYY-MM-dd");
|
|
|
return [date.getFullYear(),date.getMonth(),date.getDate()].join('-');
|
|
|
},
|
|
|
EndMonth(){
|
|
|
let date=new Date();
|
|
|
return [date.getFullYear(),date.getMonth(),date.getDate()-1].join('-');
|
|
|
},
|
|
|
EndTime(){
|
...
|
...
|
@@ -75,6 +81,18 @@ |
|
|
}
|
|
|
return this.params.endTime;
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
changeType(){
|
|
|
if (this.params.type == 2) {
|
|
|
//周报:reqTime时间不传
|
|
|
this.params.reqTime = "";
|
|
|
}
|
|
|
else {
|
|
|
//月报,日报,开始结束时间不传
|
|
|
this.params.beginTime = this.params.endTime = "";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script> |
|
|
\ No newline at end of file |
...
|
...
|
|