From d2611ee5cb26997b5902b0be82c10c3d1fe4a86c Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 22 Sep 2021 10:38:06 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhba_regulatory_ys

---
 src/views/securityUnitOperation/operationAnalysis.vue |  148 ++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 120 insertions(+), 28 deletions(-)

diff --git a/src/views/securityUnitOperation/operationAnalysis.vue b/src/views/securityUnitOperation/operationAnalysis.vue
index a9d2747..8fc47b9 100644
--- a/src/views/securityUnitOperation/operationAnalysis.vue
+++ b/src/views/securityUnitOperation/operationAnalysis.vue
@@ -10,7 +10,7 @@
               class="select1"
               default-expand-all
               v-model="value1"
-              placeholder="请选择内容"
+              placeholder="请选择辖区"
               type="tree"
               :dic="options1"
               :props="props"
@@ -77,7 +77,7 @@
               @click="showTable('fw')"
             >
               <span>服务对象预警(家)</span>
-              <span>{{ card.czBaoan }}</span>
+              <span>{{ yj.fuwu }}</span>
               <span>服务对象小于2家</span>
             </div>
             <div
@@ -86,7 +86,7 @@
               @click="showTable('pq')"
             >
               <span>派遣预警(家)</span>
-              <span>{{ card.kh }}</span>
+              <span>{{ yj.paiqian }}</span>
               <span>派遣率小于50%</span>
             </div>
             <div
@@ -95,7 +95,7 @@
               @click="showTable('cz')"
             >
               <span>持证上岗预警(家)</span>
-              <span>{{ card.sheb }}</span>
+              <span>{{ yj.chizheng }}</span>
               <span>持证率小于50%</span>
             </div>
           </div>
@@ -161,116 +161,117 @@
           <el-table-column :key="gridData.type" type="index"> </el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="realName"
+            prop="enterprisename"
             label="保安公司名称"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="deptName"
+            prop="jurisdictionName"
             label="所属辖区"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="sex"
+            prop="znum"
             label="服务对象数"
             :formatter="sexFormatter"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="cardid"
+            prop="dispatchUnitName"
             label="服务单位名称"
             :show-overflow-tooltip="true"
           ></el-table-column>
-          <el-table-column
+          <!-- <el-table-column
             :key="gridData.type"
             prop="age"
             label="备注"
             :show-overflow-tooltip="true"
             width="100"
-          ></el-table-column>
+          ></el-table-column> -->
         </template>
         <template v-if="gridData.type === 'pq'">
           <el-table-column :key="gridData.type" type="index"> </el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="enterpriseName"
+            prop="enterprisename"
             label="保安公司名称"
-            width="180"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="znum"
+            prop="jurisdictionName"
             label="所属辖区"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="cznum"
+            prop="znum"
             label="保安总人数"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="czl"
+            prop="cnum"
             label="派遣人数"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="sbnum"
+            prop="pnum"
             label="派遣比例"
+            :formatter="kslFormatter"
             :show-overflow-tooltip="true"
           ></el-table-column>
-          <el-table-column
+          <!-- <el-table-column
             :key="gridData.type"
             prop="sbl"
             label="备注"
             :show-overflow-tooltip="true"
-          ></el-table-column>
+          ></el-table-column> -->
         </template>
         <template v-if="gridData.type === 'cz'">
           <el-table-column :key="gridData.type" type="index"> </el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="enterpriseName"
+            prop="enterprisename"
             label="保安公司名称"
             width="180"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="znum"
+            prop="jurisdictionName"
             label="所属辖区"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="cznum"
+            prop="znum"
             label="保安总人数"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="painum"
+            prop="cnum"
             label="持证人数"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             :key="gridData.type"
-            prop="fwnum"
+            prop="pnum"
             label="持证比例"
+            :formatter="kslFormatter"
             :show-overflow-tooltip="true"
           ></el-table-column>
-          <el-table-column
+          <!-- <el-table-column
             :key="gridData.type"
             prop="pql"
             label="备注"
             :show-overflow-tooltip="true"
-          ></el-table-column>
+          ></el-table-column> -->
         </template>
       </el-table>
       <el-pagination
@@ -295,7 +296,10 @@
   getCompanys,
   queryYearKh,
   queryYearG,
-  selectAge
+  selectAge,
+  getSecurityUnitServerLessPage,
+  getSecurityUnitDispatcherLessPage,
+  getSecurityUnitHoldLessPage
 } from "../../api/securityUnitOperation/securityUnitOperation";
 export default {
   data() {
@@ -318,6 +322,11 @@
         addsheb: 0,
         baoanPq: 0,
         addbaoanPq: 0
+      },
+      yj: {
+        fuwu: 0,
+        paiqian: 0,
+        chizheng: 0
       },
       options0: [
         {
@@ -386,19 +395,39 @@
     };
   },
   methods: {
+    kslFormatter(row) {
+      if (row.pnum && row.pnum !== "0") {
+        return row.pnum + "%";
+      } else {
+        return row.pnum;
+      }
+    },
+    changePage() {
+      this.showcurTable(this.gridData.type);
+    },
     showTable(type) {
       this.gridData.type = type;
+      this.gridData.current = 1;
+      this.gridData.data = [];
+      this.showcurTable(type);
+    },
+    showcurTable(type) {
       this.dialogTableVisible = true;
+      // this.dialogloading = true;
       if (type === "fw") {
         this.gridData.title = "服务对象预警保安公司";
+        this.getSecurityUnitServerLessPage();
       } else if (type === "pq") {
         this.gridData.title = "派遣预警保安公司";
+        this.getSecurityUnitDispatcherLessPage();
       } else if (type === "cz") {
         this.gridData.title = "持证上岗预警保安公司";
+        this.getSecurityUnitHoldLessPage();
       }
     },
     //点击节点
     handleNodeClick(data) {
+      debugger
       this.value1 = data;
       this.getCompanys();
     },
@@ -445,8 +474,9 @@
       lazyTrees().then(res => {
         if (res.data.code === 200) {
           this.options1 = res.data.data;
-          this.value1 = this.options1[0] ? this.options1[0].id : "";
+          // this.value1 = this.options1[0] ? this.options1[0].id : "";
           this.node = this.options1[0];
+          debugger
           this.getCompanys();
         } else {
           this.$message.error(res.msg);
@@ -458,7 +488,7 @@
       getCompanys({ jurisdiction: this.value1 }).then(res => {
         if (res.data.code === 200) {
           this.options2 = res.data.data;
-          this.value2 = this.options2[0] ? this.options2[0].departmentid : "";
+          // this.value2 = this.options2[0] ? this.options2[0].departmentid : "";
           this.enterpriseName = this.options2[0]
             ? this.options2[0].enterpriseName
             : "";
@@ -561,11 +591,70 @@
         baoanPq: 0,
         addbaoanPq: 0
       };
+      this.yj = {
+        fuwu: 0,
+        paiqian: 0,
+        chizheng: 0
+      };
       this.ageData = {
         qing: 0,
         zhong: 0,
         lao: 0
       };
+    },
+    getSecurityUnitServerLessPage() {
+      let params = {
+        jurisdiction: this.value1,
+        departmentid: this.value2,
+        current: this.gridData.current,
+        size: 10
+      };
+      getSecurityUnitServerLessPage(params).then(res => {
+        if (res.data.code === 200) {
+          this.yj.fuwu = res.data.data.total;
+          this.gridData.data = res.data.data.records;
+          this.gridData.total = res.data.data.total;
+        }
+        if (this.dialogloading) {
+          this.dialogloading = false;
+        }
+      });
+    },
+    getSecurityUnitDispatcherLessPage() {
+      let params = {
+        jurisdiction: this.value1,
+        departmentid: this.value2,
+        current: this.gridData.current,
+        size: 10
+      };
+      getSecurityUnitDispatcherLessPage(params).then(res => {
+        if (res.data.code === 200) {
+          this.yj.paiqian = res.data.data.total;
+          this.gridData.data = res.data.data.records;
+          this.gridData.total = res.data.data.total;
+        }
+        if (this.dialogloading) {
+          this.dialogloading = false;
+        }
+      });
+    },
+    getSecurityUnitHoldLessPage() {
+      let params = {
+        jurisdiction: this.value1,
+        departmentid: this.value2,
+        current: this.gridData.current,
+        size: 10
+      };
+      getSecurityUnitHoldLessPage(params).then(res => {
+        if (res.data.code === 200) {
+          this.yj.chizheng = res.data.data.total;
+          this.gridData.data = res.data.data.records;
+          this.gridData.total = res.data.data.total;
+        }
+        if (this.dialogloading) {
+          this.dialogloading = false;
+        }
+      });
     },
     changeCompanys() {
       this.options2.forEach(item => {
@@ -578,6 +667,9 @@
       this.getQueryYearKh();
       this.getQueryYearG();
       this.setAgeEchart();
+      this.getSecurityUnitServerLessPage();
+      this.getSecurityUnitDispatcherLessPage();
+      this.getSecurityUnitHoldLessPage();
     }
   },
   mounted() {

--
Gitblit v1.9.3