From dbb160f7ce6c334ee561e551930ec72b5f5db899 Mon Sep 17 00:00:00 2001
From: zhengpz <1838927346@qq.com>
Date: Tue, 07 Dec 2021 21:09:14 +0800
Subject: [PATCH] 预警输入框禁用

---
 src/views/securityUnitOperation/operationAnalysis.vue |  319 +++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 226 insertions(+), 93 deletions(-)

diff --git a/src/views/securityUnitOperation/operationAnalysis.vue b/src/views/securityUnitOperation/operationAnalysis.vue
index c50cbfc..40ffef9 100644
--- a/src/views/securityUnitOperation/operationAnalysis.vue
+++ b/src/views/securityUnitOperation/operationAnalysis.vue
@@ -2,40 +2,30 @@
   <div class="yyPage">
     <el-row :gutter="20">
       <el-col :span="14">
-        <div class="rowContent first-menu" style="position: relative;">
+        <div class="rowContent first-menu" style="position: relative">
           <div class="rowTitle">
             <img src="../../../public/img/bajgxt/u1618.png" />
             <span>数据概览</span>
-            <el-select
+            <avue-input-tree
               class="select1"
-              ref="treeForm"
-              v-model="node.title"
-              placeholder="请选择"
-            >
-              <el-option style="height: auto;" :value="node">
-                <el-tree
-                  :data="options1"
-                  default-expand-all
-                  node-key="id"
-                  @node-click="handleNodeClick"
-                  :props="props"
-                >
-                </el-tree>
-              </el-option>
-            </el-select>
-            <el-select
+              default-expand-all
+              v-model="value1"
+              placeholder="请选择辖区"
+              type="tree"
+              :dic="options1"
+              :props="props"
+              @change="handleNodeClick"
+            ></avue-input-tree>
+            <avue-input-tree
               class="select2"
+              default-expand-all
               v-model="value2"
-              placeholder="请选择"
+              placeholder="请选择公司"
+              type="tree"
+              :dic="options2"
+              :props="props2"
               @change="changeCompanys"
-            >
-              <el-option
-                v-for="item in options2"
-                :key="item.departmentid"
-                :label="item.enterpriseName"
-                :value="item.departmentid"
-              ></el-option>
-            </el-select>
+            ></avue-input-tree>
             <el-button @click="toOperationTable">进入数据统计表</el-button>
           </div>
 
@@ -74,39 +64,54 @@
         </div>
       </el-col>
       <el-col :span="10">
-        <div class="rowContent first-menu">
+        <div class="rowContent first-menu yujing-class">
           <div class="rowTitle">
             <img src="../../../public/img/bajgxt/yj.png" />
             <span>预警分析</span>
           </div>
 
-          <div class="col-content" style="margin-left: 55px;">
-            <div
-              class="box-card"
-              style="margin-right: 50px;cursor: pointer; "
-              @click="showTable('fw')"
-            >
+          <div class="col-content" style="margin-left: 40px">
+            <div class="box-card" style="margin-right: 25px;">
               <span>服务对象预警(家)</span>
-              <span>{{ card.czBaoan }}</span>
-              <span>服务对象不多于1家</span>
+              <span style=" cursor: pointer" @click="showTable('fw')">{{
+                yj.fuwu
+              }}</span>
+              <div class="yujing_bottom">
+                <span>服务对象小于</span>
+                <el-input
+                  v-model="inputNum.fuwu"
+                  @change="getSecurityUnitServerLessPage()"
+                ></el-input>
+                <span>家</span>
+              </div>
             </div>
-            <div
-              class="box-card"
-              style="margin-right: 50px;cursor: pointer;"
-              @click="showTable('pq')"
-            >
+            <div class="box-card" style="margin-right: 25px;">
               <span>派遣预警(家)</span>
-              <span>{{ card.kh }}</span>
-              <span>派遣比例低于50%</span>
+              <span style=" cursor: pointer" @click="showTable('pq')">{{
+                yj.paiqian
+              }}</span>
+              <div class="yujing_bottom">
+                <span>派遣率小于</span>
+                <el-input
+                  v-model="inputNum.paiqian"
+                  @change="getSecurityUnitDispatcherLessPage"
+                ></el-input>
+                <span>%</span>
+              </div>
             </div>
-            <div
-              class="box-card"
-              style="margin-right: 50px;cursor: pointer;"
-              @click="showTable('cz')"
-            >
+            <div class="box-card" style="margin-right: 25px;">
               <span>持证上岗预警(家)</span>
-              <span>{{ card.sheb }}</span>
-              <span>持证率低于50%</span>
+              <span style=" cursor: pointer" @click="showTable('cz')">{{
+                yj.chizheng
+              }}</span>
+              <div class="yujing_bottom">
+                <span>持证率小于</span>
+                <el-input
+                  v-model="inputNum.chizheng"
+                  @change="getSecurityUnitHoldLessPage"
+                ></el-input>
+                <span>%</span>
+              </div>
             </div>
           </div>
         </div>
@@ -171,116 +176,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
@@ -305,7 +311,10 @@
   getCompanys,
   queryYearKh,
   queryYearG,
-  selectAge
+  selectAge,
+  getSecurityUnitServerLessPage,
+  getSecurityUnitDispatcherLessPage,
+  getSecurityUnitHoldLessPage
 } from "../../api/securityUnitOperation/securityUnitOperation";
 export default {
   data() {
@@ -328,6 +337,11 @@
         addsheb: 0,
         baoanPq: 0,
         addbaoanPq: 0
+      },
+      yj: {
+        fuwu: 0,
+        paiqian: 0,
+        chizheng: 0
       },
       options0: [
         {
@@ -378,6 +392,11 @@
         label: "title",
         value: "id"
       },
+      props2: {
+        children: "children",
+        label: "enterpriseName",
+        value: "departmentid"
+      },
       node: {}, //选中的记录
       gridData: {
         data: [],
@@ -387,26 +406,49 @@
         title: ""
       },
       dialogloading: false,
-      dialogTableVisible: false
+      dialogTableVisible: false,
+      inputNum: {
+        fuwu: 2,
+        paiqian: 50,
+        chizheng: 50
+      }
     };
   },
   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) {
-      this.node = data;
-      this.value1 = data.id;
-      this.$refs.treeForm.blur();
+      // debugger
+      this.value1 = data;
       this.getCompanys();
     },
     setAgeEchart() {
@@ -435,6 +477,7 @@
       });
     },
     toOperationTable() {
+      debugger;
       this.$router.push({
         path:
           "/securityUnitOperation/operationTable?jurisdiction=" +
@@ -452,8 +495,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);
@@ -465,10 +509,11 @@
       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.enterpriseName = this.options2[0]
-            ? this.options2[0].enterpriseName
-            : "";
+          // this.value2 = this.options2[0] ? this.options2[0].departmentid : "";
+          // this.enterpriseName = this.options2[0]
+          //   ? this.options2[0].enterpriseName
+          //   : "";
+          this.value2 = "";
           this.changeCompanys();
         }
       });
@@ -482,20 +527,20 @@
         if (res.data.code === 200) {
           let data = res.data.data[0];
           this.card = {
-            baoanTotal: data.baoan.thisnum,
-            addbaoanTotal: data.baoan.thisnum - data.baoan.lastnum,
-            zcBaoan: data.zcbaoan.thisnum,
-            addzcBaoan: data.zcbaoan.thisnum - data.zcbaoan.lastnum,
-            czBaoan: data.czbaoan.thisnum,
-            addczBaoan: data.czbaoan.thisnum - data.czbaoan.lastnum,
+            baoanTotal: data.baoan.num,
+            addbaoanTotal: data.baoan.thisnum,
+            zcBaoan: data.zcbaoan.num,
+            addzcBaoan: data.zcbaoan.thisnum,
+            czBaoan: data.czbaoan.num,
+            addczBaoan: data.czbaoan.thisnum,
             gkBaoan: 0,
             addgkBaoan: 0,
-            kh: data.kh.thisnum,
-            addkh: data.kh.thisnum - data.kh.lastnum,
-            sheb: data.sheb.thisnum,
-            addsheb: data.sheb.thisnum - data.sheb.lastnum,
-            baoanPq: data.paiq.thisnum,
-            addbaoanPq: data.paiq.thisnum - data.paiq.lastnum
+            kh: data.kh.num,
+            addkh: data.kh.thisnum,
+            sheb: data.sheb.num,
+            addsheb: data.sheb.thisnum,
+            baoanPq: data.paiq.num,
+            addbaoanPq: data.paiq.thisnum
           };
         }
       });
@@ -568,11 +613,73 @@
         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,
+        proportion: this.inputNum.fuwu
+      };
+      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,
+        proportion: this.inputNum.paiqian
+      };
+      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,
+        proportion: this.inputNum.chizheng
+      };
+      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 => {
@@ -585,6 +692,9 @@
       this.getQueryYearKh();
       this.getQueryYearG();
       this.setAgeEchart();
+      this.getSecurityUnitServerLessPage();
+      this.getSecurityUnitDispatcherLessPage();
+      this.getSecurityUnitHoldLessPage();
     }
   },
   mounted() {
@@ -608,6 +718,7 @@
       font-size: 31px;
     }
   }
+
   .col-content {
     margin-top: 39px !important;
   }
@@ -785,6 +896,11 @@
     span:nth-child(2) {
       color: #06ffff;
       font-size: 34px;
+    }
+  }
+  .yujing-class {
+    .box-card {
+      width: 180px !important;
     }
   }
   .leftEchartTitle.qing {
@@ -1016,4 +1132,21 @@
     height: 77%;
   }
 }
+.yujing_bottom {
+  display: inline-flex;
+  // width: 100%;
+  span {
+    width: auto;
+  }
+  .el-input {
+    width: 30px;
+    /deep/ .el-input__inner {
+      width: 30px;
+      padding: 0px;
+      height: 20px !important;
+      line-height: 20px !important;
+      text-align: center;
+    }
+  }
+}
 </style>

--
Gitblit v1.9.3