From 6b9717d6a189fd4334f4af71ce98661a82ef4ed7 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 31 Dec 2021 15:33:34 +0800
Subject: [PATCH] 新增用户身份证号码账户校验,考试情况统计修改

---
 src/api/system/user.js                                  |   10 +
 src/views/accreditationRecords/accreditationRecords.vue |    7 
 src/views/securityAnalysis/child/certificate.vue        |   50 ++---
 src/views/securityGuard/securityGuard.vue               |   47 +++++
 src/views/securityAnalysis/child/examination.vue        |   54 ++++-
 src/views/securityAnalysis/index.vue                    |  267 ++++++++++++++++++++++----------
 src/api/securityAnalysis/securityAnalysis.js            |   12 +
 7 files changed, 313 insertions(+), 134 deletions(-)

diff --git a/src/api/securityAnalysis/securityAnalysis.js b/src/api/securityAnalysis/securityAnalysis.js
index 8ef8444..1337743 100644
--- a/src/api/securityAnalysis/securityAnalysis.js
+++ b/src/api/securityAnalysis/securityAnalysis.js
@@ -70,10 +70,20 @@
     })
 }
 
+export const getExamStatisInfo = (deptid, jurisdiction) => { //保安员考试情况统计  只需要公司的deptid
+    return request({
+        url: '/api/examScore/getExamStatisInfo',
+        method: 'get',
+        params: {
+            deptid: deptid,
+            jurisdiction: jurisdiction,
+        }
+    })
+}
+
 export const getinformationstatisticsXX = (current, size, params) => { //保安员考试情况统计 详细信息  只需要公司的deptid
     return request({
         url: '/api/examScore/score-page',
-        // url: 'http://192.168.0.109:81/information/selectExtype',
         method: 'get',
         params: {
             ...params,
diff --git a/src/api/system/user.js b/src/api/system/user.js
index 04b98c2..0c4c448 100644
--- a/src/api/system/user.js
+++ b/src/api/system/user.js
@@ -1,7 +1,7 @@
 import request from '@/router/axios';
 
 
-export const getzhiwen = (id) => {//获取指纹的代码
+export const getzhiwen = (id) => { //获取指纹的代码
     return request({
         url: '/api/blade-user/details',
         method: 'get',
@@ -88,6 +88,14 @@
     })
 }
 
+export const checkAccountByUser = (data) => {
+    return request({
+        url: '/api/blade-user/checkAccount',
+        method: 'get',
+        params: data
+    })
+}
+
 
 export const securitySave = (row) => {
     return request({
diff --git a/src/views/accreditationRecords/accreditationRecords.vue b/src/views/accreditationRecords/accreditationRecords.vue
index c0bb52f..14984b3 100644
--- a/src/views/accreditationRecords/accreditationRecords.vue
+++ b/src/views/accreditationRecords/accreditationRecords.vue
@@ -42,7 +42,7 @@
           size="small"
           plain
           icon="el-icon-download"
-          v-if="permission.accreditationRecords_export || check"
+          v-if="permission.accreditationRecords_export"
           @click="handleExport"
           >保安员证信息导出
         </el-button>
@@ -369,6 +369,9 @@
   created() {
     if (this.userInfo.role_name == "上岗证办理管理员") {
       this.questionBankSearch["status"] = 1;
+      this.option.reserveSelection= false;
+      this.option.tip= false;
+      this.option.selection= false;
     }
     if (this.userInfo.role_name == "公安管理员") {
       //判断是否为市局管理员
@@ -514,7 +517,7 @@
       done();
     },
     selectionChange(list) {
-      // this.selectionList = list;
+      this.selectionList = list;
       this.choiceList = [];
       for (let k in list) {
         this.choiceList.push({
diff --git a/src/views/securityAnalysis/child/certificate.vue b/src/views/securityAnalysis/child/certificate.vue
index 182b376..ecddb9c 100644
--- a/src/views/securityAnalysis/child/certificate.vue
+++ b/src/views/securityAnalysis/child/certificate.vue
@@ -9,6 +9,7 @@
       :option="option1"
       :data="data1"
       :page.sync="page1"
+      :search.sync="search"
       :table-loading="loading1"
        @sort-change="sortChange"
       @on-load="getPractitionersPageInfo(page1)"
@@ -51,6 +52,7 @@
         ...this.$store.state.control.changePageSize,
       },
       query1: {},
+      search:{},
       data1: [],
       option1: {
         addBtn: false,
@@ -87,17 +89,15 @@
             // prop: "deptName",
             prop: "deptId",
             type: "tree",
-            sort:true,
+            sortable:true,
             dicUrl: dicUrl,
             props: {
               label: "title",
               value: "id",
             },
-            // hide: true,
-            // slot: true,
             searchSpan: 5,
             display: false,
-            search: search,
+            search: true,
             minWidth: 220,
           },
           {
@@ -196,7 +196,6 @@
   methods: {
     //排序
     sortChange(value) {
-      // console.log(value, 51151515);
       if (value.order == "ascending") {
         this.sort = "asc";
       }
@@ -205,43 +204,42 @@
       }
       this.sortName = value.prop;
       //字段匹配
-      if (value.prop == "sexs") {
-        this.sortName = "sex";
+      if (value.prop == "deptId") {
+        this.sortName = "dept_id";
       }
-      if (value.prop == "examinationType") {
-        this.sortName = "examination_type";
-      }
-      if (value.prop == "userType") {
-        this.sortName = "user_type";
-      }
-      this.onLoad(this.page, this.query);
+      this.getPractitionersPageInfo(this.page1, this.query1);
     },
     //清空按钮
     selectionClear() {
-      // this.selectionList = [];
       this.sort = "";
       this.sortName = "";
-      // this.$refs.crud.toggleSelection();
     },
     getPractitionersPageInfo(page, params = {}) {
+      params = this.search;
+      var that = this;
       if (this.card.jurisdiction == 1372091709474910209) {
-        this.card.jurisdiction = "";
+        params['jurisdiction'] = "";
+      }else{
+        params['jurisdiction'] = this.card.jurisdiction;
       }
-      // if (params.hold == undefined) {
-      //   params.hold = 1;
-      // }
+      if (this.sort) {
+        params["sort"] = this.sort;
+      }
+      if (this.sortName) {
+        params["sortName"] = this.sortName;
+      }
+      params['status'] = 1;
+
       params = {
         ...params,
         ...this.query1,
-        status: 1,
-        ...this.card,
       };
       getList(page.currentPage, page.pageSize, params).then((res) => {
-        // console.log(res.data.data.records);
         const data = res.data.data;
         this.data1 = data.records;
         this.page1.total = data.total;
         this.loading1 = false;
+        that.selectionClear();
       });
     },
     refreshChange() {
@@ -254,10 +252,8 @@
       done();
     },
     searchReset() {
-      this.query1 = {};
-      this.page1.currentPage = 1;
-      this.refreshChange();
-      // console.log(212);
+      this.query = {};
+      this.getPractitionersPageInfo(this.page1, this.query1);
     },
   },
 };
diff --git a/src/views/securityAnalysis/child/examination.vue b/src/views/securityAnalysis/child/examination.vue
index c6f46d8..7024111 100644
--- a/src/views/securityAnalysis/child/examination.vue
+++ b/src/views/securityAnalysis/child/examination.vue
@@ -9,6 +9,7 @@
       :option="option1"
       :data="data1"
       :page.sync="page1"
+      :search.sync="search"
       :table-loading="loading1"
       @on-load="getPractitionersPageInfo(page1)"
       @search-change="searchChange"
@@ -36,6 +37,7 @@
         total: 0,
         ...this.$store.state.control.changePageSize,
       },
+      search:{},
       query1: {},
       data1: [],
       option1: {
@@ -64,9 +66,17 @@
             search: true,
           },
           {
+            label: "学校名称",
+            prop: "trainingUnitName",
+            disabled: true,
+            search: true,
+            minWidth:160
+          },
+          {
             label: "考试场次",
             prop: "examName",
             disabled: true,
+            minWidth:160
           },
           {
             label: "考试时间",
@@ -88,14 +98,38 @@
             prop: "allGrade",
             disabled: true,
           },
+          {
+            label: "是否合格",
+            prop: "qualified",
+            type: "select",
+            search: true,
+            searchSpan: 4,
+            dicData: [
+              {
+                label: "合格",
+                value: 0,
+              },
+              {
+                label: "不合格",
+                value: 1,
+              },
+              {
+                label: "暂未录实操成绩",
+                value: 2,
+              },
+              {
+                label: "缺考,成绩无效",
+                value: 3,
+              },
+            ],
+          },
         ],
       },
     };
   },
   methods: {
     getPractitionersPageInfo(page, params = {}) {
-      // this.data1 = this.czdata;
-      // console.log(page);
+      params = this.search;
       params = {
         ...params,
         ...this.card,
@@ -126,19 +160,9 @@
       this.getPractitionersPageInfo(this.page1);
     },
     searchChange(params, done) {
-      if (params.czname == undefined) {
-        this.data1 = this.czdata;
-        done();
-        return;
-      }
-      var text = new RegExp(params.czname, "g"),
-        d = [];
-      for (let k in this.czdata) {
-        if (text.test(this.czdata[k].czname)) {
-          d.push(this.czdata[k]);
-        }
-      }
-      this.data1 = d;
+      this.query1 = params;
+      this.query1.currentPage = 1;
+      this.getPractitionersPageInfo(this.page1, params);
       done();
     },
     searchReset(done) {
diff --git a/src/views/securityAnalysis/index.vue b/src/views/securityAnalysis/index.vue
index 7f7d113..d530621 100644
--- a/src/views/securityAnalysis/index.vue
+++ b/src/views/securityAnalysis/index.vue
@@ -106,6 +106,7 @@
   getinformationselectHold, //保安员持证
   getinformationselectDis, //派遣服务单位
   getinformationstatistics, //保安员考试情况统计
+  getExamStatisInfo, //保安员考试情况统计
   getinformationselectDisp, //保安派遣情况
   getinformationselectSoil, //社保缴纳情况统计
 } from "@/api/securityAnalysis/securityAnalysis";
@@ -483,33 +484,163 @@
 
       this.EC2.setOption(option);
     },
+    //备份误删
+    // getEC3() {
+    //   var that = this;
+    //   getinformationstatistics(this.deptid, this.jurisdiction).then((res) => {
+    //     var a = res.data.data;
+    //     // console.log(a, 22222222222222222222);
+    //     // var a = res.data.data,
+    //     //   s = [],
+    //     //   l = [];
+    //     // console.log(a); // 0 :理论 1:实操
+    //     // for (var k in a[0]) {
+    //     //   l.push(a[0][k]);
+    //     //   s.push(a[1][k]);
+    //     // }
+    //     var l = a.llcj;
+    //     var s = a.sccj;
+    //     this.setEC3(s, l);
+    //   });
+    // },
+    //后改
     getEC3() {
-      var that = this;
-      getinformationstatistics(this.deptid, this.jurisdiction).then((res) => {
-        var a = res.data.data;
-        // console.log(a, 22222222222222222222);
-        // var a = res.data.data,
-        //   s = [],
-        //   l = [];
-        // console.log(a); // 0 :理论 1:实操
-        // for (var k in a[0]) {
-        //   l.push(a[0][k]);
-        //   s.push(a[1][k]);
-        // }
-        var l = a.llcj;
-        var s = a.sccj;
-        this.setEC3(s, l);
+      getExamStatisInfo(this.deptid, this.jurisdiction).then((res) => {
+        this.setEC3(res.data.data);
       });
     },
-    setEC3(s, l) {
-      var xd = [],
-        sd = [],
-        ld = [],
-        that = this;
-      for (var i = 0; i <= 100; i++) {
-        xd.push(i + "分");
-      }
-      // console.log(sd);
+    //备份,误删
+    // setEC3(s, l) {
+    //   var xd = [],
+    //     sd = [],
+    //     ld = [],
+    //     that = this;
+    //   for (var i = 0; i <= 100; i++) {
+    //     xd.push(i + "分");
+    //   }
+    //   // console.log(sd);
+    //   var option = {
+    //     title: {
+    //       text: "保安员考试情况统计",
+    //       left: "center",
+    //       top: 20,
+    //     },
+    //     tooltip: {
+    //       trigger: "axis",
+    //       axisPointer: {
+    //         type: "cross",
+    //         label: {
+    //           backgroundColor: "#6a7985",
+    //         },
+    //       },
+    //       // formatter(params) {
+    //       //   console.log(params);
+    //       //   var str = "";
+    //       //   for (var x in params) {
+    //       //     str += params[x].axisValue + ":" + params[x].data + "/n";
+    //       //   }
+    //       //   return str;
+    //       // },
+    //       formatter:
+    //         "<span>实操成绩</span>({b0}) :  {c0}<span>人</span><br /><span>理论成绩</span>({b1}) :  {c1}<span>人</span>",
+    //     },
+    //     toolbox: this.gettoolbox("考试情况查询", "保安员考试情况明细", 3),
+    //     legend: {
+    //       data: ["实操成绩", "理论成绩"],
+    //     },
+    //     // toolbox: {
+    //     //   feature: {
+    //     //     saveAsImage: {},
+    //     //   },
+    //     // },
+    //     grid: {
+    //       left: "3%",
+    //       right: "5%",
+    //       bottom: "3%",
+    //       containLabel: true,
+    //     },
+    //     xAxis: [
+    //       {
+    //         type: "category",
+    //         boundaryGap: false,
+    //         // data: ["0~60分", "60~80分", "80~90分", "90~100分"],
+    //         data: xd,
+    //       },
+    //     ],
+    //     yAxis: [
+    //       {
+    //         type: "value",
+    //       },
+    //     ],
+    //     series: [
+    //       {
+    //         name: "实操成绩",
+    //         type: "line",
+    //         stack: "总量",
+    //         areaStyle: {},
+    //         emphasis: {
+    //           focus: "series",
+    //         },
+    //         // data: [1, 2, 3, 1],
+    //         // data: [
+    //         //   1, 0, 0, 0, 3, 2, 1, 0, 4, 0, 5, 0, 4, 0, 0, 9, 7, 0, 2, 0, 5, 0,
+    //         //   0, 0, 7, 9, 0, 0, 7, 0, 5, 0, 7, 1, 0, 9, 2, 0, 0, 0, 3, 0, 0, 0,
+    //         //   7, 9, 0, 0, 7, 0, 5, 0, 7, 24, 2, 9, 7, 37, 0, 3, 5, 0, 0, 0, 7,
+    //         //   9, 1, 0, 7, 0, 5, 4, 2, 0, 0, 9, 7, 35, 0, 0, 3, 0, 0, 12, 7, 9,
+    //         //   0, 0, 7, 0, 2, 0, 7, 0, 0, 9, 7, 0, 0, 1,
+    //         // ],
+    //         data: s,
+    //       },
+    //       {
+    //         name: "理论成绩",
+    //         type: "line",
+    //         stack: "总量",
+    //         areaStyle: {},
+    //         emphasis: {
+    //           focus: "series",
+    //         },
+    //         // data: [
+    //         //   4, 0, 5, 0, 7, 3, 2, 9, 7, 1, 0, 3, 5, 0, 9, 7, 0, 2, 0, 0, 7, 0,
+    //         //   2, 0, 7, 0, 0, 9, 5, 0, 0, 0, 7, 9, 0, 0, 7, 0, 5, 0, 7, 1, 0, 9,
+    //         //   2, 0, 0, 50, 3, 0, 30, 0, 7, 9, 0, 20, 7, 40, 0, 0, 0, 7, 9, 1, 0,
+    //         //   7, 0, 5, 4, 2, 0, 0, 9, 7, 35, 0, 0, 3, 0, 0, 12, 7, 9, 0, 7, 0,
+    //         //   0, 11, 0, 0, 0, 3, 2, 1, 0, 4, 0, 5, 0, 3,
+    //         // ],
+    //         data: l,
+    //       },
+    //     ],
+    //   };
+
+    //   this.EC3.setOption(option);
+    // },
+    //后改,考试数据统计
+    setEC3(data) {
+      const seriesdata = [];
+      data.forEach((item) => {
+        if (item.type == 1) {
+          seriesdata.push({
+            name: item.name + "-合格人数",
+            type: "bar",
+            stack: item.name,
+            emphasis: {
+              focus: "series",
+            },
+            data: item.examSocreStatis,
+          });
+        }
+        if (item.type == 2) {
+          seriesdata.push({
+            name: item.name + "-不合格人数",
+            type: "bar",
+            stack: item.name,
+            emphasis: {
+              focus: "series",
+            },
+            data: item.examSocreStatis,
+          });
+        }
+      });
+      //echarts 图表数据
       var option = {
         title: {
           text: "保安员考试情况统计",
@@ -519,43 +650,41 @@
         tooltip: {
           trigger: "axis",
           axisPointer: {
-            type: "cross",
-            label: {
-              backgroundColor: "#6a7985",
-            },
+            type: "shadow",
           },
-          // formatter(params) {
-          //   console.log(params);
-          //   var str = "";
-          //   for (var x in params) {
-          //     str += params[x].axisValue + ":" + params[x].data + "/n";
-          //   }
-          //   return str;
-          // },
-          formatter:
-            "<span>实操成绩</span>({b0}) :  {c0}<span>人</span><br /><span>理论成绩</span>({b1}) :  {c1}<span>人</span>",
+        },
+        color: ["#91CD76", "#EF6667"],
+        legend: {
+          data: ["a", "b"],
+          icon: "circle",
+          itemWidth: 10,
+          itemHeight: 10,
+          itemGap: 20,
         },
         toolbox: this.gettoolbox("考试情况查询", "保安员考试情况明细", 3),
-        legend: {
-          data: ["实操成绩", "理论成绩"],
-        },
-        // toolbox: {
-        //   feature: {
-        //     saveAsImage: {},
-        //   },
-        // },
         grid: {
           left: "3%",
-          right: "5%",
+          right: "4%",
           bottom: "3%",
           containLabel: true,
         },
         xAxis: [
           {
             type: "category",
-            boundaryGap: false,
-            // data: ["0~60分", "60~80分", "80~90分", "90~100分"],
-            data: xd,
+            data: [
+              "1月",
+              "2月",
+              "3月",
+              "4月",
+              "5月",
+              "6月",
+              "7月",
+              "8月",
+              "9月",
+              "10月",
+              "11月",
+              "12月",
+            ],
           },
         ],
         yAxis: [
@@ -563,43 +692,7 @@
             type: "value",
           },
         ],
-        series: [
-          {
-            name: "实操成绩",
-            type: "line",
-            stack: "总量",
-            areaStyle: {},
-            emphasis: {
-              focus: "series",
-            },
-            // data: [1, 2, 3, 1],
-            // data: [
-            //   1, 0, 0, 0, 3, 2, 1, 0, 4, 0, 5, 0, 4, 0, 0, 9, 7, 0, 2, 0, 5, 0,
-            //   0, 0, 7, 9, 0, 0, 7, 0, 5, 0, 7, 1, 0, 9, 2, 0, 0, 0, 3, 0, 0, 0,
-            //   7, 9, 0, 0, 7, 0, 5, 0, 7, 24, 2, 9, 7, 37, 0, 3, 5, 0, 0, 0, 7,
-            //   9, 1, 0, 7, 0, 5, 4, 2, 0, 0, 9, 7, 35, 0, 0, 3, 0, 0, 12, 7, 9,
-            //   0, 0, 7, 0, 2, 0, 7, 0, 0, 9, 7, 0, 0, 1,
-            // ],
-            data: s,
-          },
-          {
-            name: "理论成绩",
-            type: "line",
-            stack: "总量",
-            areaStyle: {},
-            emphasis: {
-              focus: "series",
-            },
-            // data: [
-            //   4, 0, 5, 0, 7, 3, 2, 9, 7, 1, 0, 3, 5, 0, 9, 7, 0, 2, 0, 0, 7, 0,
-            //   2, 0, 7, 0, 0, 9, 5, 0, 0, 0, 7, 9, 0, 0, 7, 0, 5, 0, 7, 1, 0, 9,
-            //   2, 0, 0, 50, 3, 0, 30, 0, 7, 9, 0, 20, 7, 40, 0, 0, 0, 7, 9, 1, 0,
-            //   7, 0, 5, 4, 2, 0, 0, 9, 7, 35, 0, 0, 3, 0, 0, 12, 7, 9, 0, 7, 0,
-            //   0, 11, 0, 0, 0, 3, 2, 1, 0, 4, 0, 5, 0, 3,
-            // ],
-            data: l,
-          },
-        ],
+        series: seriesdata,
       };
 
       this.EC3.setOption(option);
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index b0f645b..22eaf77 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -438,6 +438,7 @@
   getUserPractitionersInfo,
   updatePaperTime,
   getzhiwen, //指纹
+  checkAccountByUser,
 } from "@/api/system/user";
 import { securityApply } from "@/api/accreditationRecords/accreditationRecords";
 import { getList } from "@/api/securityGuard/securityGuard";
@@ -534,6 +535,35 @@
     function trim(str) {
       return str.replace(/(^\s*)|(\s*$)/g, "");
     }
+    /**
+     * 身份证号码账号校验
+     */
+    let useBack = "";
+    function checkAccount(idCard, callback) {
+      var data = {
+        cardid: idCard,
+      };
+      if (window.deptIdss) {
+        data["deptId"] = window.deptIdss;
+      }
+      //调用接口校验
+      if (useBack != idCard) {
+        useBack = idCard;
+        checkAccountByUser(data)
+          .then((res) => {
+            useBack = "ok";
+            callback();
+          })
+          .catch((error) => {
+            callback("当前身份证号码已录入!");
+          });
+      } else if (useBack == "ok") {
+        callback();
+      } else {
+        console.log("cf");
+        callback(new Error("当前身份证号码已录入!"));
+      }
+    }
     const validatePassCardid = (rule, value, callback) => {
       let ok = false;
       if (value.length == 18) {
@@ -553,7 +583,8 @@
       }
 
       if (ok) {
-        callback();
+        //调用接口进行账户重复校验
+        checkAccount(value, callback);
       } else {
         callback(new Error("身份证错误"));
       }
@@ -758,6 +789,7 @@
         },
       },
       choiceList: [],
+      deptIdss: "",
       option: {
         searchIndex: 5, //收缩展示数量
         searchIcon: true, //搜索是否收缩
@@ -779,6 +811,7 @@
         },
         indexWidth: 55,
         searchMenuSpan: 6,
+
         stripe: true,
         border: true,
         delBtn: true,
@@ -1030,6 +1063,7 @@
                 prop: "email",
                 type: "upload",
                 listType: "picture-img",
+                display: true,
                 propsHttp: {
                   res: "data",
                   url: "url",
@@ -1359,12 +1393,21 @@
         this.initData(this.form.tenantId);
       }
     },
+    "form.deptId": {
+      handler(val) {
+        if (val) {
+          window.deptIdss = val;
+        }
+      },
+      immediate: true,
+    },
     "form.hold": {
       handler(val) {
         var securitynumbercolumn = this.findObject(
           this.option.group,
           "securitynumber"
         );
+        var emailcolumn = this.findObject(this.option.group, "email");
         // console.log(val,1234);
         if (val == 1) {
           securitynumbercolumn.display = true;
@@ -1375,6 +1418,7 @@
               trigger: "blur",
             },
           ];
+          emailcolumn.display = true;
         } else {
           securitynumbercolumn.display = false;
           securitynumbercolumn.rules = [
@@ -1384,6 +1428,7 @@
               trigger: "blur",
             },
           ];
+          emailcolumn.display = false;
         }
       },
       immediate: true,

--
Gitblit v1.9.3