From 14e02654e0545ee69456d64aef2f35c7c219d708 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 07 May 2021 11:26:49 +0800
Subject: [PATCH] 地图模式设备状态修改

---
 src/views/healthcode/healthcode.vue |   72 ++++++++++++++++++++++++++++++++---
 1 files changed, 65 insertions(+), 7 deletions(-)

diff --git a/src/views/healthcode/healthcode.vue b/src/views/healthcode/healthcode.vue
index 0689cdd..ae02016 100644
--- a/src/views/healthcode/healthcode.vue
+++ b/src/views/healthcode/healthcode.vue
@@ -23,21 +23,36 @@
         <template slot="menuLeft">
           <el-button
             v-bind:class="activeClass == 0 ? 'btn-color' : ''"
-            size="medium "
+            size="small "
             @click="getHealthcodeData(0)"
             >本日
           </el-button>
           <el-button
             v-bind:class="activeClass == 1 ? 'btn-color' : ''"
-            size="medium "
+            size="small "
             @click="getHealthcodeData(1)"
             >本周
           </el-button>
           <el-button
             v-bind:class="activeClass == 2 ? 'btn-color' : ''"
-            size="medium "
+            size="small "
             @click="getHealthcodeData(2)"
             >本月
+          </el-button>
+        </template>
+
+        <template slot="menuLeft">
+          <el-button type="warning"
+                      size="small"
+                      plain
+                      icon="el-icon-download"
+                      @click="handleExport">导出
+          </el-button>
+          <el-button type="warning"
+                      size="small"
+                      plain
+                      icon="el-icon-pie-chart"
+                      @click="handleExportStatis">导出报表
           </el-button>
         </template>
 
@@ -65,7 +80,7 @@
         option: {
           menu:false,
           height:'auto',
-          calcHeight: 30,
+          calcHeight: 54,
           border: false,
           stripe:true,
           tip: false,
@@ -106,6 +121,7 @@
               format: "yyyy-MM-dd",
               valueFormat: "yyyy-MM-dd",
               searchRange: true,
+              searchValue:[this.getStartTime(),this.getEndTime()],
               searchSpan: 5,
               hide: true,
               addDisplay: false,
@@ -123,7 +139,7 @@
             {
               label: '省份',
               prop: 'province',
-              search: true,
+              //search: true,
               searchSpan: 3,
               type: 'select',
               props: {
@@ -139,7 +155,7 @@
               prop: 'city',
               type: 'select',
               searchSpan: 3,
-              search: true,
+              //search: true,
               props: {
                 label: 'name',
                 value: 'name'
@@ -150,7 +166,7 @@
             {
               label: '区县',
               searchSpan: 3,
-              search: true,
+              //search: true,
               prop: 'district',
               type: 'select',
               props: {
@@ -216,7 +232,10 @@
       beforeOpen(done, type) {
       },
       searchReset() {
+        //清空搜索框中的内容
         this.query = {};
+        //清空this.$route.query
+        this.$router.push({ query: {} });
         this.onLoad(this.page);
       },
       searchChange(params, done) {
@@ -248,6 +267,18 @@
            }
          }
       },
+      getStartTime(){
+           if (this.$route.query.startTime != undefined && this.$route.query.startTime != null && this.$route.query.startTime != "" ) {
+             return this.$route.query.startTime
+           }
+           return '';
+      },
+      getEndTime(){
+           if (this.$route.query.endTime != undefined && this.$route.query.endTime != null && this.$route.query.endTime != "" ) {
+             return this.$route.query.endTime
+           }
+           return '';
+      },
       getHealthcodeType(){
           if (this.$route.query.type != undefined) {
               var type = this.$route.query.type+"";
@@ -265,6 +296,25 @@
         this.query = params;
         this.page.currentPage = 1;
         this.onLoad(this.page, params);
+      },
+      //数据导出
+      handleExport() {
+        this.$confirm("是否导出健康码数据?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          window.open(`/api/blade-jfpts/healthcode/healthcode/export-healthcode?begTime=${this.$route.query.startTime}&endTime=${this.$route.query.endTime}&type=${this.$route.query.type}&timeDesc=${this.$route.query.timeDesc}`);
+        });
+      },
+      //数据报表导出
+      handleExportStatis() {
+          let begTime = this.$route.query.startTime==undefined? '':this.$route.query.startTime;
+          let endTime = this.$route.query.endTime==undefined? '':this.$route.query.endTime;
+          let type = this.$route.query.type==undefined? '':this.$route.query.type;
+          let timeDesc = this.$route.query.timeDesc==undefined? '':this.$route.query.timeDesc;
+          //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 = {}) {
         const { dateTime } = this.query;
@@ -316,6 +366,14 @@
           };
         }
 
+        if (this.$route.query.timeDesc) {
+          values = {
+            ...params,
+            timeDesc: this.$route.query.timeDesc,
+            ...this.query,
+          };
+        }
+
         this.loading = true;
         getList(page.currentPage, page.pageSize,values).then(res => {
           const data = res.data.data;

--
Gitblit v1.9.3