<style scoped>
.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}
.clearfix{overflow:hidden;_zoom:1;}
input{background:none;outline:none;border:0px;}
.text-gray{color:#717171;}
.text-orange{color:#eb7741;}
.text-danger{color:#c03546;}
.customerManager{position: relative;background-color: #f3f6ff;}
.headerCustomer{height:7.5rem;background-color: #f3f6ff;overflow: hidden;}
.headerModel{background-color: #fff;padding: 1rem 0;padding-bottom:0;}
.headerModel .headerSearch{border-radius: 1rem;padding:0.2rem 20%;background-color: #f3f6ff;margin:0 3%;}
.headerModel .headerSearch img{float:left;height: 1rem;margin-right: 0.2rem;}
.headerModel .headerSearch input{float:left;width:80%;text-align: center;}
.headerModel .headerTime{margin: 0 3%;position: relative;padding:0.8rem 0;}
.headerModel .headerTime span{float: left;padding: 0.2rem 0.7rem;/*line-height:1;*/margin-right:0.2rem;border-radius:1rem;background-color: #f3f6ff;color:#868689;}
.headerModel .headerTime span.selected{background-color: #b1d0fe;color:#599cfd;}
.headerModel .headerTime .headerTimeRight {margin:0;float: right;padding-right: 1rem;background-image: url(https://release-sup8-images.oss-cn-shanghai.aliyuncs.com/h5_key/icon-customerdown.png);background-repeat: no-repeat;background-size: 0.6rem;background-position: 92% center;}
.headerModel .headerTime .headerTimeSearch{position:absolute;top:0.5rem;right:0rem;background-position: 96% center;background-color: #fff;}
.headerModel .headerTime .headerTimeSearch i{display: block;font-size: 0.7rem;font-style: normal;}
.middleModel{background-color: #f3f6ff;padding:0.6rem 4.5%;padding-top: 0.4rem;}
.middleModel .rightManager{float: right;}
.bottomModel{position:absolute;bottom:0;top: 0;width: 100%;margin-top: 7.5rem;background-color: #f3f6ff;overflow-y: auto;}
.bottomModel .bottomItem{margin:0 3%;margin-bottom:0.6rem;background-color: #fff;border-radius: 0.4rem;display: flex;padding:1rem 2.4%;padding-bottom:0.6rem;}
.bottomModel .bottomItem .imgTop{width:2.2rem;}
.bottomModel .bottomItem img{width:2.2rem;height:2.2rem;border-radius: 100%;}
.bottomModel .bottomItem .bottomInfo{flex:1;padding: 0 0.3rem;}
.bottomModel .bottomItem .bottomInfo h4{margin:0;margin-bottom:0.6rem;overflow: hidden;text-overflow: ellipsis;-webkit-line-clamp: 1;-webkit-box-orient: vertical;display: -webkit-box;word-wrap:break-word;word-break:break-all;}
.bottomModel .bottomItem .bottomInfo p{margin:0;margin-bottom:0.4rem;font-size: 0.7rem;color: #868689;}
.bottomModel .bottomItem .bottomInfo .valHidden{overflow: hidden;text-overflow: ellipsis;-webkit-line-clamp: 1;-webkit-box-orient: vertical;display: -webkit-box;height: 0.9rem;}
.bottomModel .bottomItem .bottomInfo p span{margin-left: 2px;}
.bottomModel .bottomItem .bottomTel{position:relative;}
.bottomModel .bottomItem .bottomTel i.btnCancel{position: absolute;background: url(https://release-sup8-images.oss-cn-shanghai.aliyuncs.com/h5_key/icon-btn-cancel.png) no-repeat center center;display: inline-block;width:1rem;height:1rem;background-size: 100%;right:0;top:0;top: -0.6rem;}
.bottomModel .bottomItem .bottomTel span{margin-top: 1rem;border-radius: 1rem;padding: 0.1rem 0.4rem;display:block;background-color: #3b8afc;color:#fff;font-size: 0.7rem;}
.bottomModel .bottomItem .bottomTel i.btnDowns{display: block;margin:0 auto;margin-top:0.9rem;background: url(https://release-sup8-images.oss-cn-shanghai.aliyuncs.com/h5_key/icon-customerdown.png) no-repeat center 0.1rem;height:2rem;width:2rem;}
.bottomModel .bottomItem .bottomTel i.btnUp{background-image: url(https://release-sup8-images.oss-cn-shanghai.aliyuncs.com/h5_key/icon-customerup.png);}
.mint-button{width:94%;margin:0 auto;margin-top:0.4rem;background-color:#3A8AFB;border-radius: 0.2rem;}
.btnContent{height:3.4rem;background-color:#F3F6FF;position: absolute;bottom:0;width: 100%;}
.mask {position: absolute;top: 0;left: 0;height: 100%;width: 100%;background: rgba(0, 0, 0, 0.5);}
.mint-popup-bottom{width:100%;}
.picker-toolbar-title .btnHeader{display: flex;}
.picker-toolbar-title .btnHeader .button{width: 50%;text-align: center;}
.picker-toolbar-title .btnHeader button{flex: 1;}
.picker-toolbar-title .setDateHearder{display: flex;}
.picker-toolbar-title .setDateHearder div{flex: 1;text-align: left;padding: 0.4rem 0;margin-left: 2%;}
.picker-toolbar-title .setDateHearder div p{margin:0;}
.picker-toolbar-title .setDateHearder div p:nth-of-type(1){font-size: 0.76rem;color:#868689;}
.picker-toolbar-title .setDateHearder div p:nth-last-of-type(1){padding:0.8rem 0;font-weight: 600;}
.picker-toolbar-title .setDateHearder div p.selected{border-bottom: 2px solid #3b8afc;}
.nodata {margin:0 auto;color:#616161;font-size:0.7rem;padding-top:12rem;text-align: center;background: url(http://image.supercarrier8.com/h5_key/icon-nodataRewardList.png) no-repeat center center;background-size: 10rem;}
</style>
<style>
.picker-toolbar{height: auto;}
</style>
<template>     
  <div class="jfBaseSize customerManager" v-cloak v-bind:style="isShow.vh?'height:100vh':'height: 100%;'"> 
    <div class="headerCustomer">
      <div class="headerModel">
        <div class="headerSearch clearfix">
          <form action='javascript:void(0)'>
            <img src="http://image.supercarrier8.com/h5_key/icon-search.png" alt="">
            <input type="search" placeholder="请输入手机号" v-model="searchRequest.Mobile" @key.13="getSearchList" @input="getSearchList"/>
          </form>
        </div>
        <div class="headerTime clearfix">
          <span v-bind:class="searchRequest.dateType==0?'selected':''" v-on:click="changeTime(0)">全部</span>
          <span v-bind:class="searchRequest.dateType==1?'selected':''" v-on:click="changeTime(1)">今日</span>
          <span v-bind:class="searchRequest.dateType==2?'selected':''" v-on:click="changeTime(2)">昨日</span>
          <span v-bind:class="searchRequest.dateType==3?'selected':''" v-on:click="changeTime(3)">近7日</span>
          <span class="headerTimeRight" v-on:click="setDateTimeShow" v-if="!isShow.isDateSearch">自定义</span>
          <span class="headerTimeRight headerTimeSearch" v-on:click="setDateTimeShow" v-if="isShow.isDateSearch">
            <i v-html='dateTimeObj.dateTimeVal1'></i>
            <i v-html='dateTimeObj.dateTimeVal2'></i>
          </span>
        </div>
      </div>
      <div class="middleModel">
        共<span class="text-orange" v-html="responseResult.Total"></span>条记录
      </div>
    </div>
    <div class="bottomModel" v-if="responseResult.Total>0">
      <div class='bottomItem' v-for="item in responseResult.Rows" v-bind:key="item.ID">
        <div class="imgTop">
          <img v-bind:src="item.HeadImage?item.HeadImage:'http://image.supercarrier8.com/h5_key/icon_headDefault.png'" alt="">
        </div>
        <div class="bottomInfo">
          <h4 v-html='item.NickName?item.NickName:"-"'></h4>
          <p>手机号:<span v-html='item.Mobile?item.Mobile:"-"'></span></p>
          <p>注册时间:<span v-html='item.RegDate?item.RegDate:"-"'></span></p>
          <p>奖励:<span class="text-orange" v-html='item.AwardData?item.AwardData:"-"'></span></p>
        </div>
        <div class="bottomTel" v-if="item.Mobile">
          <span v-on:click.stop="goTel(item.Mobile)">立即联系</span>
        </div>
      </div>
    </div>
    <div class="bottomModel" v-else>
      <div class="nodata">您还没有邀请转化记录!</div>
    </div>
    <mt-popup v-model="isShow.isDateTimeShow" popup-transition="popup-fade" v-bind:closeOnClickModal="isShow.iscloseOnClickModal" position="bottom">
      <mt-picker :slots="dateTimeObj.slots1" ref="picker1" value-key="dateTimeStart" :show-toolbar="true" style="width:100%;" v-show="isShow.datetimed1" v-on:change="onDateChange1">
          <div class="picker-toolbar-title">
            <div class="btnHeader">
              <el-button type="text" name="button" class="button" v-on:click="setDateCancel">取消</el-button>
              <el-button type="text" name="button" class="button" v-on:click="setDateOk">确定</el-button>
            </div>
            <div class="setDateHearder">
              <div>
                <p>开始时间</p>
                <p class="selected" v-html='dateTimeObj.dateTimeVal1?dateTimeObj.dateTimeVal1:"请选择"'></p>
              </div>
              <div v-on:click="selectedDateTab(2)">
                <p>结束时间</p>
                <p v-html='dateTimeObj.dateTimeVal2?dateTimeObj.dateTimeVal2:"请选择"'></p>
              </div>
            </div>
          </div>
      </mt-picker>
      <mt-picker :slots="dateTimeObj.slots2" ref="picker2" value-key="dateTimeEnd" :show-toolbar="true" style="width:100%;" v-show="isShow.datetimed2" v-on:change="onDateChange2">
          <div class="picker-toolbar-title">
            <div class="btnHeader">
              <el-button type="text" name="button" class="button" v-on:click="setDateCancel">取消</el-button>
              <el-button type="text" name="button" class="button" v-on:click="setDateOk">确定</el-button>
            </div>
            <div class="setDateHearder">
              <div v-on:click="selectedDateTab(1)">
                <p>开始时间</p>
                <p v-html='dateTimeObj.dateTimeVal1?dateTimeObj.dateTimeVal1:"请选择"'></p>
              </div>
              <div>
                <p>结束时间</p>
                <p class="selected" v-html='dateTimeObj.dateTimeVal2?dateTimeObj.dateTimeVal2:"请选择"'></p>
              </div>
            </div>
          </div>
      </mt-picker>
    </mt-popup>
     <ReturnHome ref="returnhome"></ReturnHome>
  </div>
</template>
<script>
import Vue from 'vue';
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import { Toast,DatetimePicker,Indicator,Picker,MessageBox } from 'mint-ui';
import channelHelper from "@/assets/js/channelHelper.js";
import { base64 } from "@/assets/js/cryptoHelper";
import { debug } from 'util';
import ReturnHome from "@/components/channel/temp001/ReturnHome";
import '@/assets/js/libs/js.cookie';
import utils from "@/assets/js/utils.js";
Vue.use(ElementUI);
export default {
  props: ["comp", "cfg", "selectedPage"],
    components: {ReturnHome},
  provide(){       
     return{           
        goPage:this.goPage       
     }   
  },
  data() {
    return {
      isShow:{
        vh:true,
        iscloseOnClickModal:false,
        isDateTimeShow:false,
        datetimed1:false,
        datetimed2:false,
        isDateSearch:false,
        isRemindManager:false,
        isSearchOk:true,
      },
      dateTimeObj:{
        slots1:[
          {
            flex: 1,
            values: [],
            className: 'slot1',
            textAlign: 'center',
            defaultIndex:1
          }, {
            flex: 1,
            values: [],
            className: 'slot2',
            textAlign: 'center',
            defaultIndex:1
          }, {
            flex: 1,
            values: [],
            className: 'slot3',
            textAlign: 'center',
            defaultIndex:1
          }
        ],
        slots2:[
          {
            flex: 1,
            values: [],
            className: 'slot1',
            textAlign: 'center',
            defaultIndex:1
          }, {
            flex: 1,
            values: [],
            className: 'slot2',
            textAlign: 'center',
            defaultIndex:1
          }, {
            flex: 1,
            values: [],
            className: 'slot3',
            textAlign: 'center',
            defaultIndex:1
          }
        ],
        dateTimeVal1:'',
        dateTimeVal2:'',
        dateTimeValOld1:[],
        dateTimeValOld2:[],
        isDateTime1:false,
        isDateTime2:false,
      },
      searchRequest:{
        Mobile:'',
        BeginTime:'',
        EndTime:'',
        Offset:0,
        Limit:100,
        EntranceId:this.sup8.context.entranceid,
        EnterpriseNo:this.sup8.context.enterpriseno,
        UserToken:channelHelper.GetUserToken(),
        LanguageType:"zh-cn",
        dateType:0,
      },
      responseResult:{
        Rows:[],
        Total:0,
      },
    }
  },
  methods: {
    goPage(pagetype){
        this.$parent.changeSelectedPage(pagetype);
    },
    goTel(Mobile){
      if(Mobile){
        window.location.href = 'tel://'+Mobile;
      }
    },
    getSearchList(){
      var that=this;
      if(that.isShow.isSearchOk){
        that.$set(that.isShow,'isSearchOk',false);
        setTimeout(() => {
          that.$set(that.isShow,'isSearchOk',true);
          that.GetChangeRecordList();
        
        }, 500);
      }
    },
    //列表获取
    GetChangeRecordList(){
      var that=this;
      var url = "/channel/GetChangeRecordList";
      if(that.searchRequest.Mobile){
        var reg=/^(1{1}[0-9]{10})|([0-9]{1,10})$/;
        if(!reg.test(that.searchRequest.Mobile)){
          Toast('仅限输入手机号数字');
          return;
        }
      }
      var dataParams = that.searchRequest;
      if(dataParams.BeginTime&&dataParams.BeginTime.length==10){
        dataParams.BeginTime=dataParams.BeginTime+' 00:00:00';
      }
      if(dataParams.EndTime&&dataParams.EndTime.length==10){
        dataParams.EndTime=dataParams.EndTime+' 23:59:59';
      }
      Indicator.open();
      var cbSuccess = function(res){
        if (res.flag) {
          var data=res.data;
          if(data&&data.Rows&&data.Rows.length>0){
            for(var i=0;i<data.Rows.length;i++){
              var obj=data.Rows[i];
              if(obj.RegDate){
                data.Rows[i].RegDate=utils.formatDate("yyyy.MM.dd hh:mm",obj.RegDate);
              }
            }
            that.$set(that.responseResult,'Total',data.Total);
            that.$set(that.responseResult,'Rows',data.Rows);
          }else{
            that.$set(that.responseResult,'Total',0);
            that.$set(that.responseResult,'Rows',[]);
          }
        }else
        { 
          that.$set(that.responseResult,'Total',0);
          that.$set(that.responseResult,'Rows',[]);
          // Toast(res.msg);
        }
        Indicator.close();
      };
      var cbError = function(jqXHR, textStatus, errorThrown){
        Toast(jqXHR.responseText);
      };
      //请求后端
      channelHelper.CommonCallService(url,dataParams,cbSuccess,cbError,null,null);
    },
    //时间切换
    changeTime(type){
      var that=this;
      that.$set(that.isShow,'isDateSearch',false);
      var dataNow=new Date();
      var yearNow=dataNow.getFullYear();
      var nowMonth=dataNow.getMonth()+1;
      var nowDay=dataNow.getDate();
      var nowDateLast=new Date(yearNow, nowMonth, 0).getDate();
      if(type==0){
        that.$set(that.searchRequest,'BeginTime','');
        that.$set(that.searchRequest,'EndTime','');
      }else if(type==1){
        that.$set(that.searchRequest,'BeginTime',utils.formatDate("yyyy-MM-dd",dataNow)+' 00:00:00');
        that.$set(that.searchRequest,'EndTime',utils.formatDate("yyyy-MM-dd",dataNow)+' 23:59:59');
      }else if(type==2){
        dataNow.setTime(dataNow.getTime()-24*60*60*1000);
        var mm=(dataNow.getMonth()+1);
        var dateTime= dataNow.getFullYear()+"-" + (mm<10?('0'+mm):mm) + "-" + dataNow.getDate();
        that.$set(that.searchRequest,'BeginTime',dateTime+' 00:00:00');
        that.$set(that.searchRequest,'EndTime',dateTime+' 23:59:59');
      }else if(type==3){
        that.$set(that.searchRequest,'BeginTime',that.getDay(-6)+' 00:00:00');
        that.$set(that.searchRequest,'EndTime',that.getDay(0)+' 23:59:59');
      }
      that.$set(that.searchRequest,'dateType',type);
      that.GetChangeRecordList();
    },
    //显示时间
    setDateTimeShow:function(){
      this.$set(this.isShow,'isDateTimeShow',true);
      this.$set(this.isShow,'datetimed1',true);
      this.$set(this.isShow,'datetimed2',false);
      this.$set(this.dateTimeObj,'dateTimeValOld1',[this.dateTimeObj.slots1[0].defaultIndex,this.dateTimeObj.slots1[1].defaultIndex,this.dateTimeObj.slots1[2].defaultIndex]);
      this.$set(this.dateTimeObj,'dateTimeValOld2',[this.dateTimeObj.slots2[0].defaultIndex,this.dateTimeObj.slots2[1].defaultIndex,this.dateTimeObj.slots2[2].defaultIndex]);
    },
    //时间切换 开始/结束 
    selectedDateTab:function(type){
      if(type==1){
        this.$set(this.isShow,'datetimed1',true);
        this.$set(this.isShow,'datetimed2',false);
      }else{
        this.$set(this.isShow,'datetimed1',false);
        this.$set(this.isShow,'datetimed2',true);
      }
    },
    //时间设置取消
    setDateCancel:function(){
      this.$set(this.isShow,'isDateTimeShow',false);
      this.$set(this.isShow,'datetimed1',false);
      this.$set(this.isShow,'datetimed2',false);
      this.$set(this.dateTimeObj.slots1[0],'defaultIndex',this.dateTimeObj.dateTimeValOld1[0]);
      this.$set(this.dateTimeObj.slots1[1],'defaultIndex',this.dateTimeObj.dateTimeValOld1[1]);
      this.$set(this.dateTimeObj.slots1[2],'defaultIndex',this.dateTimeObj.dateTimeValOld1[2]);
      this.$set(this.dateTimeObj.slots2[0],'defaultIndex',this.dateTimeObj.dateTimeValOld2[0]);
      this.$set(this.dateTimeObj.slots2[1],'defaultIndex',this.dateTimeObj.dateTimeValOld2[1]);
      this.$set(this.dateTimeObj.slots2[2],'defaultIndex',this.dateTimeObj.dateTimeValOld2[2]);
    },
    //时间设置确定
    setDateOk:function(){
      var that=this;
      var startdate=this.dateTimeObj.dateTimeVal1.replace(/\./g,"-");
      var enddate=this.dateTimeObj.dateTimeVal2.replace(/\./g,"-");
      if(Date.parse(startdate)<=Date.parse(enddate))
      { 
      that.$set(that.searchRequest,'dateType',4);
      that.$set(that.searchRequest,'BeginTime',startdate);
      that.$set(that.searchRequest,'EndTime',enddate);
      that.$set(that.isShow,'isDateSearch',true);
      this.$set(this.isShow,'isDateTimeShow',false);
      this.$set(this.isShow,'datetimed1',false);
      this.$set(this.isShow,'datetimed2',false);
      that.GetChangeRecordList();
      }
      else
      {
        Toast("开始时间不能大于结束时间！");return false;
      }
    },
    onDateChange1:function(picker, values,column) {
      if(this.dateTimeObj.isDateTime1){
        values[0]=this.dateTimeObj.slots1[0].values[this.dateTimeObj.slots1[0].defaultIndex];
        values[1]=this.dateTimeObj.slots1[1].values[this.dateTimeObj.slots1[1].defaultIndex];
        values[2]=this.dateTimeObj.slots1[2].values[this.dateTimeObj.slots1[2].defaultIndex];
        this.$set(this.dateTimeObj,'isDateTime1',false);
      }else{
        this.$set(this.dateTimeObj.slots1[2],'defaultIndex',(parseInt(values[2])-1));
        this.$set(this.dateTimeObj.slots1[1],'defaultIndex',(parseInt(values[1])-1));
        for(var i=0;i<this.dateTimeObj.slots1[0].values.length;i++){
          if(this.dateTimeObj.slots1[0].values[i].toString()==values[0].toString()){
            this.$set(this.dateTimeObj.slots1[0],'defaultIndex',i);
          }
        }
      }
      var nowDateLast=new Date(values[0], values[1], 0).getDate();
      var arr=this.dateTimeObj.slots1[2].values;
      var vLen=arr.length;
      var index=Math.abs(nowDateLast-vLen);
      if(index!=0){
        if(vLen<nowDateLast){
          for(var i=1;i<=index;i++){
            arr.push(vLen+i);
          }
        }else if(vLen>nowDateLast){
          arr.splice(nowDateLast,index);
          if(parseInt(values[2])>nowDateLast){
            this.$set(this.dateTimeObj.slots1[2],'defaultIndex',(nowDateLast-1));
            this.$set(this.dateTimeObj.slots1[1],'defaultIndex',(parseInt(values[1])-1));
            for(var i=0;i<this.dateTimeObj.slots1[0].values.length;i++){
              if(this.dateTimeObj.slots1[0].values[i].toString()==values[0].toString()){
                this.$set(this.dateTimeObj.slots1[0],'defaultIndex',i);
              }
            }
            values[2]=nowDateLast;
            this.$set(this.dateTimeObj,'isDateTime1',true);
          }
        }
        this.$set(this.dateTimeObj.slots1[2],'values',arr);
      }
      this.$set(this.dateTimeObj,'dateTimeVal1',values[0]+'.'+values[1]+'.'+values[2]);
    },
    onDateChange2:function(picker, values,column) {
      if(this.dateTimeObj.isDateTime2){
        values[0]=this.dateTimeObj.slots2[0].values[this.dateTimeObj.slots2[0].defaultIndex];
        values[1]=this.dateTimeObj.slots2[1].values[this.dateTimeObj.slots2[1].defaultIndex];
        values[2]=this.dateTimeObj.slots2[2].values[this.dateTimeObj.slots2[2].defaultIndex];
        this.$set(this.dateTimeObj,'isDateTime2',false);
      }else{
        this.$set(this.dateTimeObj.slots2[2],'defaultIndex',(parseInt(values[2])-1));
        this.$set(this.dateTimeObj.slots2[1],'defaultIndex',(parseInt(values[1])-1));
        for(var i=0;i<this.dateTimeObj.slots2[0].values.length;i++){
          if(this.dateTimeObj.slots2[0].values[i].toString()==values[0].toString()){
            this.$set(this.dateTimeObj.slots2[0],'defaultIndex',i);
          }
        }
      }
      var nowDateLast=new Date(values[0], values[1], 0).getDate();
      var arr=this.dateTimeObj.slots2[2].values;
      var vLen=arr.length;
      var index=Math.abs(nowDateLast-vLen);
      if(index!=0){
        if(vLen<nowDateLast){
          for(var i=1;i<=index;i++){
            arr.push(vLen+i);
          }
        }else if(vLen>nowDateLast){
          arr.splice(nowDateLast,index);
          if(parseInt(values[2])>nowDateLast){
            this.$set(this.dateTimeObj.slots2[2],'defaultIndex',(nowDateLast-1));
            this.$set(this.dateTimeObj.slots2[1],'defaultIndex',(parseInt(values[1])-1));
            for(var i=0;i<this.dateTimeObj.slots2[0].values.length;i++){
              if(this.dateTimeObj.slots2[0].values[i].toString()==values[0].toString()){
                this.$set(this.dateTimeObj.slots2[0],'defaultIndex',i);
              }
            }
            values[2]=nowDateLast;
            this.$set(this.dateTimeObj,'isDateTime2',true);
          }
        }
        this.$set(this.dateTimeObj.slots2[2],'values',arr);
      }
      this.$set(this.dateTimeObj,'dateTimeVal2',values[0]+'.'+values[1]+'.'+values[2]);
    },
    getYearMM:function(){
      var dataNow=new Date();
      var yearNow=dataNow.getFullYear();
      var nowMonth=dataNow.getMonth()+1;
      var nowDay=dataNow.getDate();
      var yearArr=[yearNow];
      for(var i=1;i<=20;i++){
        yearArr.unshift((yearNow-i).toString());
      }
      this.$set(this.dateTimeObj.slots1[0],'values',yearArr);
      this.$set(this.dateTimeObj.slots2[0],'values',yearArr);
      this.$set(this.dateTimeObj.slots1[0],'defaultIndex',20);
      this.$set(this.dateTimeObj.slots2[0],'defaultIndex',20);
      var MM=[];
      for(var j=1;j<=12;j++){
        if(j<10){
          MM.push('0'+j);
        }else{
          MM.push(j.toString());
        }
      }
      this.$set(this.dateTimeObj.slots1[1],'values',MM);
      this.$set(this.dateTimeObj.slots2[1],'values',MM);
      this.$set(this.dateTimeObj.slots1[1],'defaultIndex',nowMonth-1);
      this.$set(this.dateTimeObj.slots2[1],'defaultIndex',nowMonth-1);
      var nowDateLast=new Date(yearNow, nowMonth, 0).getDate();
      var DD=[];
      for(var e=1;e<=nowDateLast;e++){
        if(e<10){
          DD.push('0'+e);
        }else{
          DD.push(e.toString());
        }
      }
      this.$set(this.dateTimeObj.slots1[2],'values',DD);
      this.$set(this.dateTimeObj.slots2[2],'values',DD);
      this.$set(this.dateTimeObj.slots1[2],'defaultIndex',nowDay-1);
      this.$set(this.dateTimeObj.slots2[2],'defaultIndex',nowDay-1);
      this.$set(this.dateTimeObj,'dateTimeVal1',yearArr[20]+'.'+MM[nowMonth-1]+'.'+DD[nowDay-1]);
      this.$set(this.dateTimeObj,'dateTimeVal2',yearArr[20]+'.'+MM[nowMonth-1]+'.'+DD[nowDay-1]);
    },
    getDay:function (day){
      var that=this;
      var today = new Date();
      var targetday_milliseconds=today.getTime() + 1000*60*60*24*day;
      today.setTime(targetday_milliseconds); //注意，这行是关键代码
      var tYear = today.getFullYear();
      var tMonth = today.getMonth();
      var tDate = today.getDate();
      tMonth = that.doHandleMonth(tMonth + 1);
      tDate = that.doHandleMonth(tDate);
      return tYear+"-"+tMonth+"-"+tDate;
    },
    doHandleMonth:function (month){
      var that=this;
      var m = month;
      if(month.toString().length == 1){
      m = "0" + month;
      }
      return m;
    },
    judgeLogin:function(){
      var eno = this.sup8.context.enterpriseno;
      if (!channelHelper.CheckLogin(this.$parent,eno,this.sup8.context.entranceid)) {
        this.$parent.changeSelectedPage('Key_Login');
        return false;
      }
    },
  },
  components: {
    ElementUI
  },
  watch: {},
  created: function() {
    var that = this;
    var isDesign = location.pathname.indexOf('design');
    if(isDesign!=-1)
    {
        return;
    }
    //判断是否登录
    that.judgeLogin();
    that.getYearMM();
    that.GetChangeRecordList();
  },
  mounted: function() {
    var that =this;
    var isDesign = location.pathname.indexOf('design');
    if (!(isDesign>-1)) {
        that.$set(that.isShow,'vh',true);
    }else{
        that.$set(that.isShow,'vh',false);
    }
  }
};
</script>

