瀏覽代碼

fix 周报下载按钮显示

anxiaoxia 2 年之前
父節點
當前提交
8ec5d1ed3f
共有 1 個文件被更改,包括 51 次插入32 次删除
  1. 51 32
      src/views/ReportForm/weekReport/reportDetail.vue

+ 51 - 32
src/views/ReportForm/weekReport/reportDetail.vue

@@ -6,6 +6,7 @@
                 <el-button
                     size="small"
                     class="ml20"
+                    :disabled="showPdfBtn"
                     @click="exportClick()"
                 >下载报告</el-button>
             </div>
@@ -2030,6 +2031,9 @@ import {    queryWeekday, querySubstandardList, queryDay, querysectionSpace, sav
 export default {
     data() {
         return {
+            showPdfBtn: true,
+            buildingId: '', // 建筑ID
+            buildingName: '', // 建筑名称
             totalReportCount: '',
             yearReportNum: '',
             pdfPmDateShow: false,
@@ -2214,6 +2218,7 @@ export default {
     beforeMount() {
         // console.log(this.$route,"---------------------------------------")
         // http://192.168.0.24:9906/weekpdf?startDate=20210118&endDate=20210124&projectName=你好&projectId=Pj1101080259
+        debugger
         this.comstartDate = this.$route.query.startDate;
         this.comendDate = this.$route.query.endDate;
         this.projectName = this.$route.query.projectName;
@@ -2223,6 +2228,7 @@ export default {
         this.dataChange([this.comstartDate, this.comendDate])
     },
     async mounted() {
+        this.showPdfBtn = true;
         this.indexMap = {
             Tdb: 9,
             RH: 10,
@@ -2234,15 +2240,28 @@ export default {
         }
         this.timeArray = this.generateTime();
         await this.getSeasontype();
-        this.getWeekSpace('floor');
-        this.getWeekSpace();
-        this.getUserActivity();
-        this.getTempRate();
-        this.getStandardList();
-        this.getCustormList();
-        // this.getEmailDate();
-        this.getPmdate();
-        this.getWeekNumber();
+        /*  this.getWeekSpace('floor');
+         this.getWeekSpace();
+         this.getUserActivity();
+         this.getTempRate();
+         this.getStandardList();
+         this.getCustormList();
+         this.getEmailDate();
+         this.getPmdate();
+         this.getWeekNumber(); */
+        Promise.all([
+            this.getWeekSpace('floor'),
+            this.getWeekSpace(),
+            this.getUserActivity(),
+            this.getTempRate(),
+            this.getStandardList(),
+            this.getCustormList(),
+            this.getEmailDate(),
+            this.getPmdate(),
+            this.getWeekNumber()
+        ]).then(() => {
+            this.showPdfBtn = false;
+        })
     },
     methods: {
         moment,
@@ -2270,11 +2289,11 @@ export default {
         getPmdate() {
             const getParams = {
                 "projectId": this.projectId,//项目id
-                 buildingId: this.buildingId,
+                buildingId: this.buildingId,
                 "startDate": this.startDate,
                 "endDate": this.endDate,
             }
-            queryPm2d5({ getParams }).then(res => {
+            return queryPm2d5({ getParams }).then(res => {
                 console.log(res);
                 if (res.data) {
                     // 手动排序
@@ -2297,7 +2316,7 @@ export default {
             let postParams = {
                 "id": this.remarkId[this.envType],
                 "projectId": this.projectId,//项目id
-                 buildingId: this.buildingId,
+                buildingId: this.buildingId,
                 "startDate": this.startDate,
                 "endDate": this.endDate,
                 "year": this.startDate.slice(0, 4),
@@ -2328,11 +2347,11 @@ export default {
             let postParams = {
                 "criteria": {
                     "projectId": this.projectId,
-                     buildingId: this.buildingId,
+                    buildingId: this.buildingId,
                     "startDate": this.startDate
                 }
             }
-            queryCustormList({ postParams }).then(res => {
+            return queryCustormList({ postParams }).then(res => {
                 this.custormList = res.data || [];
                 const weekType = {
                     WeekDay: "工作日",
@@ -2352,10 +2371,10 @@ export default {
         getWeekNumber() {
             let getParams = {
                 projectId: this.projectId,
-                 buildingId: this.buildingId,
+                buildingId: this.buildingId,
                 startDate: this.startDate
             }
-            queryWeekNumberHttp({ getParams }).then(res => {
+            return queryWeekNumberHttp({ getParams }).then(res => {
                 //  总共的周报数量totalReportCount  年当前期数yearReportNum
                 this.totalReportCount = res.totalReportCount;
                 this.yearReportNum = res.yearReportNum;
@@ -2364,7 +2383,7 @@ export default {
         async getSeasontype(falg = true) {
             let getParams = {
                 projectId: this.projectId,
-                 buildingId: this.buildingId,
+                buildingId: this.buildingId,
                 dateTiime: falg ? this.startDate : this.endDate
             }
             await querySeason({ getParams }).then(res => {
@@ -2374,7 +2393,7 @@ export default {
         tableSave(e, type) {
             let getParams = {
                 projectId: this.projectId,
-                 buildingId: this.buildingId,
+                buildingId: this.buildingId,
                 spaceId: e.spaceId,
                 startDate: this.startDate,
             }
@@ -2400,7 +2419,7 @@ export default {
             let postParams = {
                 "criteria": {
                     "projectId": this.projectId,
-                     buildingId: this.buildingId,
+                    buildingId: this.buildingId,
                     "startDate": this.startDate,
                     "endDate": this.endDate,
                     // "type":value,//0 内外区 1 朝向 2 楼层 3 新风机组 4 温度 5 湿度 6 co2 7 pm2.5 8 甲醛
@@ -2409,7 +2428,7 @@ export default {
             if (value) {
                 postParams.criteria.type = 2;
             }
-            queryWeekSpace({ postParams }).then(res => {
+            return queryWeekSpace({ postParams }).then(res => {
                 if (!res.content) {
                     return
                 }
@@ -2525,11 +2544,11 @@ export default {
             let postParams = {
                 "criteria": {
                     "projectId": this.projectId,
-                     buildingId: this.buildingId,
+                    buildingId: this.buildingId,
                     "startDate": this.startDate
                 }
             };
-            queryStandardList({ postParams }).then(res => {
+            return queryStandardList({ postParams }).then(res => {
                 this.StandardList = res.data || [];
             })
         },
@@ -2537,7 +2556,7 @@ export default {
             let postParams = {
                 "criteria": {
                     "projectId": this.projectId,
-                     buildingId: this.buildingId,
+                    buildingId: this.buildingId,
                     starDate: this.startDate,
                     endDate: this.endDate,
                     // "createTime":{
@@ -2546,7 +2565,7 @@ export default {
                     // },
                 },
             }
-            queryUserActivity({ postParams }).then(res => {
+            return queryUserActivity({ postParams }).then(res => {
                 this.userDate = res;
             })
         },
@@ -2555,7 +2574,7 @@ export default {
             let postParams = {
                 "criteria": {
                     "projectId": this.projectId,
-                     buildingId: this.buildingId,
+                    buildingId: this.buildingId,
                     "date": {
                         "$gte": this.startDate,
                         "$lte": this.endDate
@@ -2563,7 +2582,7 @@ export default {
                 }
             }
             postParams.criteria.time = { $gte: "060000", $lte: "200000" };
-            queryTempRate({ postParams }).then(res => {
+            return queryTempRate({ postParams }).then(res => {
                 if (res.data) {
                     this.chartweekTemp = this.arreyInit(res.data);
                     this.chartweekTemp.coldSpaceProprotion && (this.chartweekTemp.coldProprotion = this.chartweekTemp.coldSpaceProprotion);
@@ -2605,7 +2624,7 @@ export default {
             let postParams = {
                 "criteria": {
                     "projectId": this.projectId,
-                     buildingId: this.buildingId,
+                    buildingId: this.buildingId,
                     "date": {
                         "$gte": this.startDate,
                         "$lte": this.endDate
@@ -2715,7 +2734,7 @@ export default {
                 "criteria": {
                     "projectId": this.projectId,
                     "startDate": this.startDate,
-                     buildingId: this.buildingId,
+                    buildingId: this.buildingId,
                 },
                 page: 1,
                 size: 10,
@@ -2874,7 +2893,7 @@ export default {
             let postParams = {
                 "criteria": {
                     "projectId": this.projectId,
-                     buildingId: this.buildingId,
+                    buildingId: this.buildingId,
                 },
                 "orders": [
                     {
@@ -2884,7 +2903,7 @@ export default {
                 ]
             }
 
-            queryEmail({ postParams }).then(res => {
+           return queryEmail({ postParams }).then(res => {
                 if (res.count) {
                     this.emailData = res.content;
                     this.noEmailuser = false;
@@ -2899,7 +2918,7 @@ export default {
             let postParams = {
                 "criteria": {
                     "projectId": this.projectId,
-                     buildingId: this.buildingId,
+                    buildingId: this.buildingId,
                     "sendTime": {
                         "$gte": sendTime + ''  //  本周的开始时间,用于查询出已经发出过周报的邮箱
                     }
@@ -2939,7 +2958,7 @@ export default {
 
             let postParams = {
                 ids: [],
-                 buildingId: this.buildingId,
+                buildingId: this.buildingId,
                 lastWeekMonday: this.startDate,
                 lastWeekSunday: this.endDate
             }