Authored by 姜敏

销售报表-时间控件

... ... @@ -6,14 +6,17 @@
<option value="3">月报</option>
</select>
</div>
<div class="panel-col" v-show="params.type!=2">
<com-calendar :type="type" :value.sync="params.reqTime" :placeholder="'选择时间'"></com-calendar>
<div class="panel-col" v-if="params.type==1">
<com-calendar :value.sync="params.reqTime" :placeholder="'选择时间'"></com-calendar>
</div>
<div class="panel-col" v-show="params.type==2">
<com-calendar :type="type" :value.sync="params.beginTime" :placeholder="'开始时间'"></com-calendar>
<div class="panel-col" v-if="params.type==3">
<com-calendar :format="'yyyy-MM'" :value.sync="params.reqTime" :placeholder="'选择时间'"></com-calendar>
</div>
<div class="panel-col" v-show="params.type==2">
<com-calendar :type="type" :value.sync="params.endTime" :placeholder="'结束时间'"></com-calendar>
<div class="panel-col" v-if="params.type==2">
<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>
</div>
<div class="panel-col">
<input type="text" class="form-control" placeholder="SKN" v-model="params.productSkn">
... ... @@ -37,6 +40,7 @@
<script>
import calendar from '../../../../components/calendar/index';
import util from 'util';
export default {
components: {
comCalendar: calendar
... ... @@ -50,6 +54,15 @@
selects: ViewModel.data
}
},
methods: {}
computed: {
EndTime(){
var date=new Date(this.params.beginTime);
date.setDate(date.getDate()+7);
this.params.endTime = util.dateFormat(date,"YYYY-MM-dd");
return this.params.endTime;
}
},
methods: {
}
}
</script>
\ No newline at end of file
... ...
... ... @@ -106,16 +106,13 @@
},
methods: {
submit() {
if(this.params.type==3){
//月报:reqTime截取月份,开始结束时间不传
this.params.reqTime=this.params.reqTime.substring(0,7);
this.params.beginTime=this.params.endTime="";
}else if(this.params.type==1){
//日报:开始结束时间不传
this.params.beginTime=this.params.endTime="";
}else{
if (this.params.type == 2) {
//周报:reqTime时间不传
this.params.reqTime="";
this.params.reqTime = "";
}
else {
//日报.月报,开始结束时间不传
this.params.beginTime = this.params.endTime = "";
}
var data = {
type: this.params.type,
... ... @@ -132,7 +129,7 @@
},
getTime(time){
if (time !== "") {
time = time.split('/').join("")
time = time.split('-').join("")
}
return time;
}
... ...
... ... @@ -105,16 +105,13 @@
},
methods: {
submit() {
if(this.params.type==3){
//月报:reqTime截取月份,开始结束时间不传
this.params.reqTime=this.params.reqTime.substring(0,7);
this.params.beginTime=this.params.endTime="";
}else if(this.params.type==1){
//日报:开始结束时间不传
this.params.beginTime=this.params.endTime="";
}else{
if (this.params.type == 2) {
//周报:reqTime时间不传
this.params.reqTime="";
this.params.reqTime = "";
}
else {
//月报,日报,开始结束时间不传
this.params.beginTime = this.params.endTime = "";
}
var data = {
type: this.params.type,
... ... @@ -131,7 +128,7 @@
},
getTime(time){
if (time !== "") {
time = time.split('/').join("")
time = time.split('-').join("")
}
return time;
}
... ...