From 478947a847fb71c054ddb4cf1e2cf3ee83aeee77 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Mon, 30 Aug 2021 11:51:22 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_regulatory

---
 src/views/securityUnitOperation/operationAnalysis.vue |   92 ++++++++++++++++++++++++++++++---------------
 1 files changed, 61 insertions(+), 31 deletions(-)

diff --git a/src/views/securityUnitOperation/operationAnalysis.vue b/src/views/securityUnitOperation/operationAnalysis.vue
index 1134e14..b6985de 100644
--- a/src/views/securityUnitOperation/operationAnalysis.vue
+++ b/src/views/securityUnitOperation/operationAnalysis.vue
@@ -60,11 +60,11 @@
               <span>{{ card.czBaoan }}</span>
               <span>较上月增加{{ card.addczBaoan }}人</span>
             </div>
-            <div class="box-card">
+            <!-- <div class="box-card">
               <span>过考保安员</span>
               <span>{{ card.gkBaoan }}</span>
               <span>较上月增加{{ card.addgkBaoan }}人</span>
-            </div>
+            </div> -->
             <div class="box-card">
               <span>服务客户</span>
               <span>{{ card.kh }}</span>
@@ -111,19 +111,19 @@
           <div class="leftEchartTitle qing">
             <div class="block1"></div>
             <span>青年</span>
-            <span>11</span>
+            <span>{{ ageData.qing }}</span>
             <span>人</span>
           </div>
           <div class="leftEchartTitle zhong">
             <div class="block1"></div>
             <span>中年</span>
-            <span>321</span>
+            <span>{{ ageData.zhong }}</span>
             <span>人</span>
           </div>
           <div class="leftEchartTitle lao">
             <div class="block1"></div>
             <span>老年</span>
-            <span>123</span>
+            <span>{{ ageData.lao }}</span>
             <span>人</span>
           </div>
           <div id="bottomEchart1"></div>
@@ -141,7 +141,8 @@
   queryCounts,
   getCompanys,
   queryYearKh,
-  queryYearG
+  queryYearG,
+  selectAge
 } from "../../api/securityUnitOperation/securityUnitOperation";
 export default {
   data() {
@@ -203,36 +204,49 @@
         middleEchart2: null,
         bottomEchart: null,
         bottomEchart1: null
+      },
+      ageData: {
+        qing: 0,
+        zhong: 0,
+        lao: 0
       }
     };
   },
   methods: {
-    setEchart() {
-      this.loading3 = true;
-      let data = [];
-      if (!this.echartDom.bottomEchart) {
-        this.echartDom.bottomEchart = echarts.init(
-          document.getElementById("bottomEchart")
-        );
-        this.echartDom.bottomEchart.setOption(echartJs.bottomOption1(data));
-      }
-      this.loading3 = false;
-
-      let data1 = [];
-      if (!this.echartDom.bottomEchart1) {
-        this.echartDom.bottomEchart1 = echarts.init(
-          document.getElementById("bottomEchart1")
-        );
-        this.echartDom.bottomEchart1.setOption(echartJs.bottomOption2(data1));
-      }
+    setAgeEchart() {
+      this.loading4 = true;
+      let params = {
+        jurisdiction: this.value1,
+        deptid: this.value2
+      };
+      selectAge(params).then(res => {
+        if (res.data.code === 200) {
+          if (!this.echartDom.bottomEchart1) {
+            this.echartDom.bottomEchart1 = echarts.init(
+              document.getElementById("bottomEchart1")
+            );
+          }
+          this.echartDom.bottomEchart1.setOption(
+            echartJs.bottomOption2(res.data.data)
+          );
+          this.ageData.qing = res.data.data.qcount;
+          this.ageData.zhong = res.data.data.zcount;
+          this.ageData.lao = res.data.data.lcount;
+        } else {
+          this.$message.error(res.data.msg);
+        }
+        this.loading4 = false;
+      });
     },
     toOperationTable() {
       this.$router.push({
         path:
-          "/securityUnitOperation/operationTable?jurisdiction =" +
+          "/securityUnitOperation/operationTable?jurisdiction=" +
           this.value2 +
-          "&enterpriseName =" +
-          this.enterpriseName
+          "&enterpriseName=" +
+          this.enterpriseName +
+          "&jurisdiction1=" +
+          this.value1
       });
     },
     getFenju() {
@@ -255,9 +269,10 @@
       getCompanys({ jurisdiction: this.value1 }).then(res => {
         if (res.data.code === 200) {
           this.options2 = res.data.data;
-          debugger
           this.value2 = this.options2[0] ? this.options2[0].departmentid : "";
-          this.enterpriseName = this.options2[0] ? this.options2[0].enterpriseName : "";
+          this.enterpriseName = this.options2[0]
+            ? this.options2[0].enterpriseName
+            : "";
           this.changeCompanys();
         }
       });
@@ -311,6 +326,7 @@
     },
     getQueryYearG() {
       this.loading1 = true;
+      this.loading3 = true;
       let params = {
         jurisdiction: this.value1,
         deptid: this.value2
@@ -325,7 +341,16 @@
           this.echartDom.middleEchart1.setOption(
             echartJs.middleOption1(res.data.data)
           );
+          if (!this.echartDom.bottomEchart) {
+            this.echartDom.bottomEchart = echarts.init(
+              document.getElementById("bottomEchart")
+            );
+          }
+          this.echartDom.bottomEchart.setOption(
+            echartJs.bottomOption1(res.data.data)
+          );
         }
+        this.loading3 = false;
         this.loading1 = false;
       });
     },
@@ -347,10 +372,15 @@
         baoanPq: 0,
         addbaoanPq: 0
       };
+      this.ageData = {
+        qing: 0,
+        zhong: 0,
+        lao: 0
+      };
     },
     changeCompanys() {
       this.options2.forEach(item => {
-        if (item.value === this.value2) {
+        if (item.departmentid === this.value2) {
           this.enterpriseName = item.enterpriseName;
         }
       });
@@ -358,10 +388,10 @@
       this.getQueryCounts();
       this.getQueryYearKh();
       this.getQueryYearG();
+      this.setAgeEchart();
     }
   },
   mounted() {
-    this.setEchart();
     this.getFenju();
   }
 };

--
Gitblit v1.9.3