From 88e9acc00c5e9efa9be636c6083ea634ae04e889 Mon Sep 17 00:00:00 2001
From: zhengpz <11@qq.com>
Date: Fri, 30 Jul 2021 22:53:36 +0800
Subject: [PATCH] 对接接口

---
 src/views/securityUnitOperation/economicAnalysis.vue |   83 +++++++++++++++++++++++++++++++++--------
 1 files changed, 67 insertions(+), 16 deletions(-)

diff --git a/src/views/securityUnitOperation/economicAnalysis.vue b/src/views/securityUnitOperation/economicAnalysis.vue
index 7b5e9d3..23c01cc 100644
--- a/src/views/securityUnitOperation/economicAnalysis.vue
+++ b/src/views/securityUnitOperation/economicAnalysis.vue
@@ -49,13 +49,13 @@
           <div class="col-content">
             <div class="box-card">
               <span>社保缴纳人数</span>
-              <span>11291</span>
-              <span>较上月增加12人</span>
+              <span>{{ socialSecurity.num }}</span>
+              <span>较上月增加{{ socialSecurity.addNum }}人</span>
             </div>
             <div class="box-card">
-              <span>社保缴纳总额(万)</span>
-              <span>410</span>
-              <span>较上月增加15万</span>
+              <span>社保缴纳总额(元)</span>
+              <span>{{ socialSecurity.money }}</span>
+              <span>较上月增加{{ socialSecurity.addMoney }}元</span>
             </div>
             <div class="box-card">
               <span>公司派遣人数</span>
@@ -103,6 +103,9 @@
 import {
   getCompanys,
   selectPCount,
+  selectTo,
+  queryYearSoil,
+  queryYearAn,
 } from "../../api/securityUnitOperation/securityUnitOperation";
 export default {
   data() {
@@ -138,18 +141,15 @@
       ],
       options1: [],
       options2: [],
+      socialSecurity: {
+        num: 0,
+        addNum: 0,
+        money: 0,
+        addMoney: 0,
+      },
     };
   },
   methods: {
-    setEchart() {
-      let data = [];
-      let bottomEchart = echarts.init(document.getElementById("bottomEchart"));
-      bottomEchart.setOption(echartJs.bottomOption(data));
-      let middleEchart1 = echarts.init(
-        document.getElementById("middleEchart1")
-      );
-      middleEchart1.setOption(echartJs.economicMiddle(data));
-    },
     toEconomicTable() {
       this.$router.push({ path: "/securityUnitOperation/economicTable" });
     },
@@ -188,16 +188,67 @@
         if (res.data.code === 200) {
           this.options2 = res.data.data;
           this.value2 = this.options2[0] ? this.options2[0].departmentid : "";
-          this.pieChange();
+          this.changeCompanys();
+        }
+      });
+    },
+    getSocialSecurity() {
+      let params = {
+        jurisdiction: this.value1,
+        deptid: this.value2,
+      };
+      selectTo(params).then((res) => {
+        if (res.data.code === 200) {
+          let data = res.data.data[0];
+          this.socialSecurity.num = data.thismouth;
+          this.socialSecurity.addNum = data.thismouth - data.lastmonth;
+          this.socialSecurity.money = data.thisamount;
+          this.socialSecurity.addMoney = data.thisamount - data.lastamount;
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    getQueryYearSoil() {
+      let params = {
+        jurisdiction: this.value1,
+        deptid: this.value2,
+      };
+      queryYearSoil(params).then((res) => {
+        if (res.data.code === 200) {
+          let middleEchart1 = echarts.init(
+            document.getElementById("middleEchart1")
+          );
+          middleEchart1.setOption(echartJs.economicMiddle(res.data.data));
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    getQueryYearAn() {
+      let params = {
+        jurisdiction: this.value1,
+        deptid: this.value2,
+      };
+      queryYearAn(params).then((res) => {
+        if (res.data.code === 200) {
+          let bottomEchart = echarts.init(
+            document.getElementById("bottomEchart")
+          );
+          bottomEchart.setOption(echartJs.bottomOption(res.data.data));
+        } else {
+          this.$message.error(res.msg);
         }
       });
     },
     changeCompanys() {
       this.pieChange();
+      this.getSocialSecurity();
+      this.getQueryYearSoil();
+      this.getQueryYearAn();
     },
   },
   mounted() {
-    this.setEchart();
     this.getFenju();
   },
 };

--
Gitblit v1.9.3