From 6d4df5cbb1def7e0da95fe9cdd8570e9019a6033 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 03 Nov 2021 15:40:04 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises

---
 vue.config.js                                           |    4 
 src/views/accreditationRecords/accreditationRecords.vue |  424 ++++++++++++++++++++++++++++++++++++++
 src/router/views/index.js                               |   14 +
 src/views/securityGuard/securityGuard.vue               |   72 ++++++
 src/views/securityGuard/securityCertificate.vue         |   60 +++--
 src/api/accreditationRecords/accreditationRecords.js    |   49 ++++
 src/views/trainingRegistration/index.vue                |    1 
 7 files changed, 594 insertions(+), 30 deletions(-)

diff --git a/src/api/accreditationRecords/accreditationRecords.js b/src/api/accreditationRecords/accreditationRecords.js
new file mode 100644
index 0000000..113bd65
--- /dev/null
+++ b/src/api/accreditationRecords/accreditationRecords.js
@@ -0,0 +1,49 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params, deptId) => {
+    return request({
+        url: '/api/accreditationRecords/page',
+        method: 'get',
+        params: {
+            ...params,
+            current,
+            size,
+            deptId,
+        }
+    })
+}
+
+export const remove = (ids) => {
+    return request({
+        url: '/api/accreditationRecords/remove',
+        method: 'post',
+        params: {
+            ids,
+        }
+    })
+}
+
+export const add = (row) => {
+    return request({
+        url: '/api/accreditationRecords/submit',
+        method: 'post',
+        data: row
+    })
+}
+
+export const update = (row) => {
+    return request({
+        url: '/api/accreditationRecords/update',
+        method: 'post',
+        data: row
+    })
+}
+
+
+export const securityApply = (row) => {
+    return request({
+        url: '/api/accreditationRecords/securityApply',
+        method: 'post',
+        data: row
+    })
+}
\ No newline at end of file
diff --git a/src/router/views/index.js b/src/router/views/index.js
index 80d9da6..416d68a 100644
--- a/src/router/views/index.js
+++ b/src/router/views/index.js
@@ -968,5 +968,19 @@
             component: () =>
                 import ( /* webpackChunkName: "views" */ '@/views/trainExam/index')
         }]
+    },
+    {
+        path: '/accreditationRecords',
+        component: Layout,
+        redirect: '/accreditationRecords/accreditationRecords',
+        children: [{
+            path: 'index',
+            name: '制证管理',
+            meta: {
+                i18n: 'index'
+            },
+            component: () =>
+                import ( /* webpackChunkName: "views" */ '@/views/accreditationRecords/accreditationRecords')
+        }]
     }
 ]
\ No newline at end of file
diff --git a/src/views/accreditationRecords/accreditationRecords.vue b/src/views/accreditationRecords/accreditationRecords.vue
new file mode 100644
index 0000000..96cf922
--- /dev/null
+++ b/src/views/accreditationRecords/accreditationRecords.vue
@@ -0,0 +1,424 @@
+<template>
+  <basic-container class="desk1">
+    <avue-crud
+      :option="option"
+      :table-loading="loading"
+      :data="data"
+      :page.sync="page"
+      ref="crud"
+      @row-del="rowDel"
+      v-model="form"
+      :permission="permissionList"
+      @row-update="rowUpdate"
+      @row-save="rowSave"
+      :before-open="beforeOpen"
+      @filter="filterChange"
+      @search-change="searchChange"
+      @search-reset="searchReset"
+      @selection-change="selectionChange"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+      @refresh-change="refreshChange"
+      @on-load="onLoad"
+    >
+      <template slot="menuLeft">
+        <el-button
+          style="display:none"
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          v-if="permission.notice_delete"
+          plain
+          @click="handleDelete"
+          >删 除
+        </el-button>
+        <!-- v-if="permission.notice_delete" -->
+      </template>
+      <template slot-scope="{ row }" slot="category">
+        <el-tag>{{ row.categoryName }}</el-tag>
+      </template>
+      <template slot-scope="{ type, size, row }" slot="menu">
+        <el-button
+          style="display:none"
+          :size="size"
+          :type="type"
+          v-if="permission.notice_upload"
+          @click="handleUploadPage(row)"
+          >附件上传
+        </el-button>
+        <!-- <el-button
+          v-if="!deptCategory"
+          :size="size"
+          :type="type"
+          @click="handleUploadPage(row)"
+          >附件查看
+        </el-button> -->
+      </template>
+      <template slot-scope="{ row }" slot="deptName">
+            <el-tag>{{ row.deptName }}</el-tag>
+      </template>
+      <template slot-scope="{ row }" slot="sex">
+            <el-tag>{{ row.sex=="1"?"男":row.sex=="2"?"女":""}}</el-tag>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import {
+  getList,
+  remove,
+  update,
+  add,
+} from "@/api/accreditationRecords/accreditationRecords";
+import { getDept } from "@/api/system/dept";
+import { mapGetters } from "vuex";
+import { mapState } from "vuex";
+
+export default {
+  data() {
+    return {
+      form: {},
+      query: {},
+      loading: true,
+      deptCategory: "",
+      deptId: "",
+      permissionAdd: "",
+      permissionDelete: "",
+      permissionView: "",
+      permissionEdit: "",
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      selectionList: [],
+      option: {
+        height: "auto",
+        filterBtn: true,
+        calcHeight: 30,
+        dialogWidth: 950,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        stripe: true,
+        viewBtn: true,
+        selection: true,
+        excelBtn: false,
+        addBtnText: "发布",
+        addTitle: "发布",
+        saveBtnText: "发布",
+        menuWidth: 150,
+        dialogClickModal: false,
+        column: [
+          {
+            label: "姓名",
+            prop: "realName",
+            search: true,
+            searchSpan: 3,
+            width:100,
+            searchLabelWidth: 50,
+            display: false,
+          },
+          // {
+          //   label: "所属保安公司",
+          //   searchLabelWidth: "110",
+          //   // prop: "deptName",
+          //   prop: "deptId",
+          //   type: "tree",
+          //   dicUrl:
+          //     "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+          //   props: {
+          //     label: "title",
+          //     value: "id",
+          //   },
+          //   // hide: true,
+          //   slot: true,
+          //   searchSpan: 5,
+          //   display: false,
+          //   search: true,
+          //   minWidth: 260,
+          // },
+          {
+              label: "所属保安公司",
+              searchLabelWidth: "110",
+              prop: "deptName",
+              // type: "tree",
+              // dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+              // props: {
+              //     label: "title",
+              //     value: "id",
+              // },
+              slot: true,
+              searchSpan: 5,
+              display: false,
+              search: true,
+              minWidth: 200
+          },
+          {
+            label: "性别",
+            prop: "sex",
+            width: 80,
+            type: "select",
+            display: false,
+          },
+          {
+            label: "身份证号码",
+            prop: "idCardNo",
+            search: true,
+            searchLabelWidth: 90,
+            searchSpan: 5,
+            display: false,
+          },
+          {
+            label: "年龄",
+            prop: "age",
+            display: false,
+          },
+          {
+            label: "保安证编号",
+            prop: "securityNumber",
+            search: true,
+            searchLabelWidth: 90,
+            minWidth: 105,
+            searchSpan: 4,
+            addDisplay: false,
+            editDisplay: false,
+            // hide: true,
+          },
+          // {
+          //   label: "申请人",
+          //   prop: "createUser",
+          //   search: true,
+          //   searchLabelWidth: 90,
+          //   minWidth: 105,
+          //   searchSpan: 4,
+          //   addDisplay: false,
+          //   editDisplay: false,
+          //   // hide: true,
+          // },
+          {
+            label: "申请时间",
+            prop: "createTime",
+            // search: true,
+            searchLabelWidth: 90,
+            minWidth: 105,
+            // searchSpan: 4,
+            addDisplay: false,
+            editDisplay: false,
+            // hide: true,
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  computed: {
+    ...mapGetters(["userInfo", "permission"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(null, false),
+        viewBtn: this.vaildData(this.permission.notice_view, false),
+        delBtn: this.vaildData(null, false),
+        editBtn: this.vaildData(null, false),
+      };
+    },
+    ids() {
+      let ids = [];
+      this.selectionList.forEach((ele) => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    },
+    ...mapState({
+      userInfo: (state) => state.user.userInfo,
+    }),
+  },
+  mounted() {
+    this.getDeptInfo(this.userInfo.dept_id);
+  },
+  methods: {
+    //获取当前用户部门信息
+    getDeptInfo(deptId) {
+      var that = this;
+      getDept(deptId).then((res) => {
+        var deptCategory = res.data.data.deptCategory;
+        deptCategory == 1
+          ? (that.deptCategory = true)
+          : (that.deptCategory = false);
+      });
+    },
+    //跳转到附件列表页面
+    handleUploadPage(row) {
+      this.$router.push({
+        path: `/resource/uploadNotice`,
+        query: {
+          deptId: row.deptId,
+          noticeId: row.id,
+        },
+      });
+    },
+    rowSave(row, done, loading) {
+      if (this.deptCategory) {
+        row.category = 1;
+      } else {
+        row.category = 2;
+      }
+      row["type"] = 1;
+      row.deptId = this.deptId;
+      add(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      // if (this.deptCategory) {
+      //   row.category = 1;
+      // }else{
+      //   row.category = 2;
+      // }
+      row.deptId = this.deptId;
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getNotice(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.deptId = JSON.parse(
+        window.localStorage.getItem("saber-userInfo")
+      ).content.dept_id;
+
+      //获取当前用户部门信息,判断是否为公安,如果是公安,则只能查看公告信息
+      var that = this;
+      getDept(this.deptId).then((res) => {
+        var deptCategory = res.data.data.deptCategory;
+        deptCategory == 1
+          ? (that.deptCategory = true)
+          : (that.deptCategory = false);
+
+        // const { releaseTimeRange } = this.query;
+        params["jurisdiction"] = this.jurisdiction;
+        params["type"] = 1;
+        let values = {
+          ...params,
+        };
+        // if (releaseTimeRange) {
+        //   values = {
+        //     ...params,
+        //     startTime: releaseTimeRange[0],
+        //     endTime: releaseTimeRange[1],
+        //     ...this.query,
+        //   };
+        //   values.releaseTimeRange = null;
+        // }
+        this.loading = true;
+        getList(page.currentPage, page.pageSize, values).then((res) => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      });
+    },
+  },
+};
+</script>
+
+<style>
+</style>
diff --git a/src/views/securityGuard/securityCertificate.vue b/src/views/securityGuard/securityCertificate.vue
index 793d92c..ac7322e 100644
--- a/src/views/securityGuard/securityCertificate.vue
+++ b/src/views/securityGuard/securityCertificate.vue
@@ -11,7 +11,7 @@
       <div class="security_m_l_center no-print">
         发证公安机关&nbsp;(印章)<br />
         发证日期
-        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;月
+        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;月
       </div>
       <div class="security_m_l_down no-print">证件编号</div>
       <div class="security_m_r_a no-print">姓名</div>
@@ -23,22 +23,22 @@
         <div v-if="!data.avatar">暂无照片</div>
         <img :src="data.avatar" alt="" v-else />
       </div>
-      <div class="security_m_l_titleName">{{ data.realName }}</div>
-      <div class="security_m_l_titlepaperTimenian">
+      <div class="security_m_l_titleName widt">{{ data.realName }}</div>
+      <div class="security_m_l_titlepaperTimenian widt">
         {{ data.paperTime.slice(0, 4) }}
       </div>
-      <div class="security_m_l_titlepaperTimeyue">
+      <div class="security_m_l_titlepaperTimeyue widt">
         {{ data.paperTime.slice(5, 7) }}
       </div>
-      <div class="security_m_l_titlepaperTimeri">
+      <!-- <div class="security_m_l_titlepaperTimeri">
         {{ data.paperTime.slice(8, 10) }}
-      </div>
-      <div class="security_m_l_downsecuritynumber">
+      </div> -->
+      <div class="security_m_l_downsecuritynumber widt">
         {{ data.securitynumber }}
       </div>
-      <div class="security_m_r_o_right">{{ data.realName }}</div>
-      <div class="security_m_r_o_rightbirthday">{{ data.birthday }}</div>
-      <div class="security_m_r_o_rightaddress security_m_r_o_l_r">
+      <div class="security_m_r_o_right widt">{{ data.realName }}</div>
+      <div class="security_m_r_o_rightbirthday widt">{{ data.cardid.slice(6, 10) }}. {{ data.cardid.slice(10, 12) }}. {{ data.cardid.slice(12, 14) }}</div>
+      <div class="security_m_r_o_rightaddress security_m_r_o_l_r widt">
         {{ data.address }}
       </div>
       <div class="security_m_r_o_rightcardid">{{ data.cardid }}</div>
@@ -96,7 +96,7 @@
 }
 // 标题
 $upTop: 55px;
-$downTop: 280px;
+$downTop: 230px;  //整体高度
 //经国家保安员考试审查合格。<br />特颁此证。
 .security_main-title {
   position: absolute;
@@ -111,16 +111,17 @@
 .security_m_l_center {
   position: absolute;
   top: $downTop;
-  left: 39px;
-  font-size: 18px;
+  left: 32px;
+  font-size: 16px;
   line-height: 40px;
 }
 //证件编号 &nbsp;
 .security_m_l_down {
   position: absolute;
   top: 421px;
-  left: 39px;
+  left: 32px;
   font-size: 24px;
+  font-weight: 500;
 }
 
 $rightLeft: 343px;
@@ -137,6 +138,7 @@
   width: $rightWidth;
   text-align: justify;
   text-align-last: justify;
+  font-weight: 500;
 }
 //出生年月
 .security_m_r_b {
@@ -186,7 +188,7 @@
 // 抬头名字
 .security_m_l_titleName {
   position: absolute;
-  top: 46px;
+  top: 16px;
   left: 85px;
   line-height: 45px;
   font-size: 22px;
@@ -194,46 +196,54 @@
   letter-spacing: 3px;
 }
 //发证时间
-$timeTop: 320px;
+$timeTop: 280px; //整体高度
 //年
 .security_m_l_titlepaperTimenian {
   position: absolute;
   top: $timeTop;
-  left: 123px;
+  left: 104px;
   font-size: 18px;
   line-height: 40px;
+  // font-weight: 500;
 }
 //月
 .security_m_l_titlepaperTimeyue {
   position: absolute;
   top: $timeTop;
-  left: 192px;
+  left: 164px;
   font-size: 18px;
   line-height: 40px;
+  // font-weight: 500;
 }
 //日
 .security_m_l_titlepaperTimeri {
   position: absolute;
   top: $timeTop;
-  left: 253px;
+  left: 209px;
   font-size: 18px;
   line-height: 40px;
+  // font-weight: 500;
 }
 //证件编号
 .security_m_l_downsecuritynumber {
   position: absolute;
-  top: 421px;
-  left: 160px;
+  top: 369px; //整体高度
+  left: 146px;
   font-size: 24px;
 }
+
+
+
+//内容
 // 姓名
-$centerLeft: 430px;
+$centerLeft: 440px;
 .security_m_r_o_right {
   position: absolute;
   top: $downTop;
   left: $centerLeft;
   font-size: $rightFontSize;
   // width: $rightWidth;
+  // font-weight: 500;
 }
 // 生日
 .security_m_r_o_rightbirthday {
@@ -242,6 +252,7 @@
   left: $centerLeft;
   font-size: $rightFontSize;
   // width: $rightWidth;
+  // font-weight: 500;
 }
 // 地址
 .security_m_r_o_rightaddress {
@@ -250,6 +261,7 @@
   left: $centerLeft;
   font-size: $rightFontSize;
   width: 160px;
+  // font-weight: 500;
 }
 // 身份证
 .security_m_r_o_rightcardid {
@@ -258,6 +270,7 @@
   left: $centerLeft;
   font-size: $rightFontSize;
   // width: $rightWidth;
+  // font-weight: 500;
 }
 //背景图
 .security_main_backImge {
@@ -268,4 +281,7 @@
   background-size: 100% 100%;
   background-repeat: no-repeat;
 }
+// .widt{
+//   font-weight: 550;
+// }
 </style>
\ No newline at end of file
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index 56c52e5..26a1a35 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -58,6 +58,17 @@
               >个人照片批量上传
             </el-button>
             <el-button
+              style="display:none"
+              type="primary"
+              size="small"
+              plain
+              v-if="permission.securityGuard_security_apply"
+              icon="el-icon-s-promotion"
+              @click="handleSecurityApply"
+              >制证申请
+            </el-button>
+            
+            <el-button
               type="danger"
               style="display: none"
               size="small"
@@ -299,6 +310,7 @@
   getUserPractitionersInfo,
   saveOrUpdateUserPractitionersInfo,
 } from "@/api/system/user";
+import {securityApply} from '@/api/accreditationRecords/accreditationRecords'
 import { getList } from "@/api/securityGuard/securityGuard";
 import { getDeptLazyTree } from "@/api/system/dept";
 import { getRoleTree, getRoleDetail } from "@/api/system/role";
@@ -505,12 +517,20 @@
           children: "children",
         },
       },
+      choiceList: [],
       option: {
         height: "auto",
         calcHeight: 80,
-        tip: false,
+        tip: true,
         searchShow: true,
-
+        reserveSelection:true,
+        selectable: (row) => {
+          if (row.hold!=="1") {
+            return false;
+          } else {
+            return true;
+          }
+        },
         indexWidth: 55,
         searchMenuSpan: 6,
         stripe: true,
@@ -1101,6 +1121,42 @@
         this.onLoad(this.page);
       });
     },
+    //制证申请
+    handleSecurityApply(){
+      if (this.choiceList.length === 0) {
+        this.$message.warning("请勾选至少一位持证保安员");
+        return;
+      }
+        this.$confirm("共选择制证申请人数"+this.choiceList.length+"人,确定申请制证?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          let cho = this.choiceList;
+          console.log(this.choiceList,14521);
+          let str = "";
+          for (let k in cho) {
+            str += cho[k].id;
+            if (k != cho.length - 1) {
+              str += ",";
+            }
+          }
+          console.log(str,1132);
+          const data = {
+            ids:str,
+            createUser:this.userInfo.user_id
+          }
+          return securityApply(data);
+        })
+        .then(() => {
+          // this.$refs.crud.toggleSelection();
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
     rowSave(row, done, loading) {
       if (row.deptId) {
         row.deptId = row.deptId;
@@ -1266,11 +1322,17 @@
       done();
     },
     selectionChange(list) {
-      this.selectionList = list;
+      // this.selectionList = list;
+      this.choiceList = [];
+      for (let k in list) {
+        this.choiceList.push({
+          id: list[k].id,
+        });
+      }
     },
     selectionClear() {
-      this.selectionList = [];
-      this.$refs.crud.toggleSelection();
+      // this.selectionList = [];
+      // this.$refs.crud.toggleSelection();
     },
     handleDelete() {
       if (this.selectionList.length === 0) {
diff --git a/src/views/trainingRegistration/index.vue b/src/views/trainingRegistration/index.vue
index ad2c4bf..b288021 100644
--- a/src/views/trainingRegistration/index.vue
+++ b/src/views/trainingRegistration/index.vue
@@ -134,7 +134,6 @@
   data() {
     return {
       choiceName: [],
-
       loading: true,
       excelBox: false,
       dialogExamFormVisible: false,
diff --git a/vue.config.js b/vue.config.js
index 41bf142..aabc55c 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -27,8 +27,8 @@
         proxy: {
             '/api': {
                 // 本地服务接口地址
-                // target: 'http://localhost:81',
-                target: 'http://192.168.0.114:81',//钟日健W
+                target: 'http://localhost:81',
+                // target: 'http://192.168.0.114:81',//钟日健W
                 // target: 'http://localhost:81', //原W
                 // target: 'http://192.168.0.108:81',//原W
                 // target: 'http://192.168.0.107:81',//唐N

--
Gitblit v1.9.3