南昌市物联网技防平台-前端
liuyg
2021-05-10 f5a707f00606722f0d288df0d707c7bc9098fcdd
src/views/healthcode/healthcode.vue
@@ -274,13 +274,29 @@
           if (this.$route.query.startTime != undefined && this.$route.query.startTime != null && this.$route.query.startTime != "" ) {
             return this.$route.query.startTime
           }
           return '';
           // 当前时间
          var date = new Date();
          //年
          var Y = date.getFullYear();
          //月
          var M = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
          //日
          var D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
           return Y + "-" + M + "-" + D;
      },
      getEndTime(){
           if (this.$route.query.endTime != undefined && this.$route.query.endTime != null && this.$route.query.endTime != "" ) {
             return this.$route.query.endTime
           }
           return '';
            // 当前时间
            var date = new Date();
            //年
            var Y = date.getFullYear();
            //月
            var M = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
            //日
            var D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
            return Y + "-" + M + "-" + D;
      },
      getHealthcodeType(){
          if (this.$route.query.type != undefined) {
@@ -291,15 +307,17 @@
      },
      getHealthcodeData(e) {
        var that = this;
        this.query={};
        this.$router.push({ query: {} });
        that.activeClass = e;
        //status 0:本日  1:本月  2:本年   type: 1:绿色   2:黄色  3:红色
        var params = {
          status: e
        };
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
      },
      //数据导出
      handleExport() {
        this.$confirm("是否导出健康码数据?", "提示", {
@@ -319,7 +337,7 @@
          //window.open(`http://localhost:8108/ureport/excel?_u=blade-healthcode.statis.xml.ureport.xml&begTime=${begTime}&endTime=${endTime}&type=${type}&timeDesc=${timeDesc}`);
          window.open(`https://web.byisf.com/api/blade-report/ureport/preview?_u=blade-healthcode.statis.xml.ureport.xml&begTime=${begTime}&endTime=${endTime}&type=${type}&timeDesc=${timeDesc}`);
      },
      onLoad(page, params = {}) {
      onLoad(page, params) {
        const { dateTime } = this.query;
        let values = {
          ...params,
@@ -345,12 +363,13 @@
            endTime: this.$route.query.endTime
          }
          this.activeClass =4;
        }else{
          params = {
              status:this.$route.query.status,
              type:this.$route.query.type
          }
        }
        // else{
        //   params = {
        //       status:this.$route.query.status,
        //       type:this.$route.query.type
        //   }
        // }
        if(this.activeClass == 0 && this.query.dateTime==null){
          params = {