Administrator
2021-11-22 0450d4dca0c99f694ea804ec2008b0766e6d6dd4
src/views/securityGuard/securityGuard.vue
@@ -46,7 +46,7 @@
              icon="el-icon-upload2"
              v-if="permission.securityGuard_import"
              @click="handleImport1"
              >保安员批量导入
            >保安员批量导入
            </el-button>
            <el-button
              type="success"
@@ -55,7 +55,7 @@
              icon="el-icon-upload2"
              v-if="permission.securityGuard_import"
              @click="handleImport2"
              >个人照片批量上传
            >个人照片批量上传
            </el-button>
            <el-button
              type="primary"
@@ -64,7 +64,7 @@
              v-if="permission.securityGuard_security_apply"
              icon="el-icon-s-promotion"
              @click="handleSecurityApply"
              >上岗证制证申请
            >上岗证制证申请
            </el-button>
            <el-button
              type="primary"
@@ -73,16 +73,15 @@
              v-if="permission.securityGuard_security_paper_apply"
              icon="el-icon-collection-tag"
              @click="handleSecurityPaperApply"
              >证书制证申请
            >证书制证申请
            </el-button>
            <el-button
              type="primary"
              type="warning"
              size="small"
              plain
              v-if="permission.securityGuard_escort_personnel_import"
              icon="el-icon-collection-tag"
              @click="handleEscortPersonnelImport"
              >押运人员批量导入
              icon="el-icon-download"
              @click="handleExportSecurityInfo"
              >保安信息导出
            </el-button>
            <el-button
@@ -92,7 +91,7 @@
              plain
              icon="el-icon-delete"
              @click="handleDelete"
              >注 销
            >注 销
            </el-button>
            <el-button
              type="info"
@@ -102,7 +101,7 @@
              v-if="permission.user_role"
              icon="el-icon-user"
              @click="handleGrant"
              >角色配置
            >角色配置
            </el-button>
            <el-button
              type="info"
@@ -112,7 +111,7 @@
              v-if="permission.user_reset"
              icon="el-icon-refresh"
              @click="handleReset"
              >密码重置
            >密码重置
            </el-button>
            <el-button
              type="info"
@@ -122,7 +121,7 @@
              v-if="userInfo.role_name.includes('admin')"
              icon="el-icon-setting"
              @click="handlePlatform"
              >平台配置
            >平台配置
            </el-button>
            <el-button
              type="success"
@@ -132,7 +131,7 @@
              v-if="userInfo.role_name.includes('admin')"
              icon="el-icon-upload2"
              @click="handleImport"
              >导入
            >导入
            </el-button>
            <el-button
              type="warning"
@@ -142,7 +141,7 @@
              v-if="userInfo.role_name.includes('admin')"
              icon="el-icon-download"
              @click="handleExport"
              >导出
            >导出
            </el-button>
          </template>
@@ -152,7 +151,7 @@
              :size="size"
              :type="type"
              @click.stop="rowClick(row)"
              >查看
            >查看
            </el-button>
            <el-button
              icon="el-icon-edit"
@@ -160,7 +159,7 @@
              :type="type"
              v-if="permission.securityGuard_delete && row.status != 2"
              @click.stop="rowStatus(row)"
              >离职登记
            >离职登记
            </el-button>
            <el-button
              icon="el-icon-edit"
@@ -168,7 +167,7 @@
              :type="type"
              v-if="row.status == 2"
              @click.stop="rowDellook(row)"
              >离职查询
            >离职查询
            </el-button>
            <el-button
              icon="el-icon-edit"
@@ -176,15 +175,16 @@
              :type="type"
              v-if="permission.securityGuard_check"
              @click.stop="rowCheck(row)"
              >异常
            >异常
            </el-button>
            <el-button
              icon="el-icon-edit"
              style="display:none"
              :size="size"
              :type="type"
              v-if="permission.securityGuard_paper"
              @click.stop="certificateClick(row)"
              >纸质证书制作
            >纸质证书制作
            </el-button>
          </template>
@@ -197,7 +197,8 @@
              class="rowClickSelf"
              title="点击查看所属公司情况"
              @click="rowClickSelf(row.deptId)"
              >{{ row.deptName }}</el-tag
            >{{ row.deptName }}
            </el-tag
            >
          </template>
          <template slot-scope="{ row }" slot="tenantName">
@@ -368,10 +369,10 @@
                {{
                  certificateObj.cardid
                    ? certificateObj.cardid.slice(6, 10) +
                      "." +
                      certificateObj.cardid.slice(10, 12) +
                      "." +
                      certificateObj.cardid.slice(12, 14)
                    "." +
                    certificateObj.cardid.slice(10, 12) +
                    "." +
                    certificateObj.cardid.slice(12, 14)
                    : ""
                }}
              </div>
@@ -405,16 +406,17 @@
  saveOrUpdateUserPractitionersInfo,
  getzhiwen, //指纹
} 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";
import { getPostList } from "@/api/system/post";
import { mapGetters } from "vuex";
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";
import {getPostList} from "@/api/system/post";
import {mapGetters} from "vuex";
import website from "@/config/website";
import { getToken } from "@/util/auth";
import { securityFormPageColumn } from "./data";
import { mapState } from "vuex";
import {getToken} from "@/util/auth";
import {securityFormPageColumn} from "./data";
import {mapState} from "vuex";
import Qs from "qs";
//加载指纹类
import Client from "./Client";
@@ -474,19 +476,19 @@
            ? mouth < oldm
              ? false
              : mouth > oldm
              ? true
              : day < oldd
              ? false
              : true
                ? true
                : day < oldd
                  ? false
                  : true
            : year - oldy == 60
            ? mouth < oldm
              ? true
              : mouth > oldm
              ? false
              : day <= oldd
              ? false
              : true
            : true;
              ? mouth < oldm
                ? true
                : mouth > oldm
                  ? false
                  : day <= oldd
                    ? false
                    : true
              : true;
        if (ok) {
          callback();
        } else {
@@ -643,7 +645,7 @@
        searchShow: true,
        reserveSelection: true,
        selectable: (row) => {
          if (row.hold !== "1" || row.securitynumber==null || row.securitynumber=='') {
          if (row.hold !== "1" || row.securitynumber == null || row.securitynumber == '') {
            return false;
          } else {
            return true;
@@ -1150,6 +1152,7 @@
      if (this.form.fingerprint != undefined) {
        that.isopen = true;
        let isoks = false;
        function sets(state, fingerprint, myPicture) {
          isoks = state;
          var winzhiwen = document.getElementById("zhiwen").contentWindow;
@@ -1161,6 +1164,7 @@
            isoks: isoks,
          });
        }
        setTimeout(() => {
          // if()
          if (!this.form.id) {
@@ -1227,12 +1231,33 @@
      userInfo: (state) => state.user.userInfo,
    }),
  },
  beforeCreate() {},
  beforeCreate() {
  },
  created() {
    // console.log(this.userInfo, 9999);
    if (this.userInfo.role_name == "办证管理员") {
      this.search["userType"] = 7;
      this.search["hold"] = "1";
    }
    if (this.userInfo.account == "南昌市保安服务总公司" || this.userInfo.account == "押运分公司") {
      this.option.column.push({
        label: "持枪证编号",
        prop: "guncode",
        width: 90,
        addDisplay: false,
        editDisplay: false
      })
      this.option.group[1].column.push({
        label: "持枪证编号",
        prop: "guncode",
      })
      this.excelOption1.column[0].action = "/api/blade-user/import-securityYy?deptId=" + this.userInfo.dept_id
    }
  },
  mounted() {
    // this.option.column[0].hide = true
@@ -1434,6 +1459,10 @@
      done();
    },
    handleTemplate1() {
      if (this.userInfo.account == "南昌市保安服务总公司" || this.userInfo.account == "押运分公司") {
        window.open(`/api/blade-user/export-template-securityYy`);
        return
      }
      window.open(`/api/blade-user/export-template-security`);
    },
    handleImport2() {
@@ -1450,7 +1479,7 @@
    rowClick(row) {
      this.$router.push({
        path: "/securityGuardDetail",
        query: { row: JSON.stringify(row) },
        query: {row: JSON.stringify(row)},
      });
    },
    //行点击事件
@@ -1470,7 +1499,7 @@
        this.certificateObj.registered == "" ||
        this.certificateObj.registered == null
      ) {
        this.$message({ message: "请完善身份证住址信息", type: "warning" });
        this.$message({message: "请完善身份证住址信息", type: "warning"});
        return;
      }
      //更新发证时间
@@ -1533,7 +1562,7 @@
    rowClickSelf(row) {
      this.$router.push({
        path: "/securityUnitChild",
        query: { fromSecunityGuardId: row },
        query: {fromSecunityGuardId: row},
      });
    },
    nodeClick(data) {
@@ -1592,7 +1621,7 @@
          const data = {
            ids: str,
            createUser: this.userInfo.user_id,
            type:1
            type: 1
          };
          return securityApply(data);
        })
@@ -1630,7 +1659,7 @@
          const data = {
            ids: str,
            createUser: this.userInfo.user_id,
            type:2
            type: 2
          };
          return securityApply(data);
        })
@@ -1641,6 +1670,46 @@
            message: "操作成功!",
          });
        });
    },
    //保安员信息导出
    handleExportSecurityInfo() {
      this.$confirm("是否导出保安员信息数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        //获取查询条件
        // const { releaseTimeRange } = this.search;
        // if (releaseTimeRange) {
        //   this.search["startTime"] = releaseTimeRange[0];
        //   this.search["endTime"] = releaseTimeRange[1];
        // }
        var data = {
          cardid:this.search.cardid,
          deptId:this.search.deptId,
          hold:this.search.hold,
          realName: this.search.realName,
          securitynumber: this.search.securitynumber,
          status: this.search.status,
          userType: this.search.startTime,
        };
        //导出
        if (this.userInfo.role_name == "保安公司管理员") {
          //如果是保安公司管理员
          data["deptId"] = this.userInfo.dept_id;
        }
        if (this.userInfo.role_name == "培训公司管理员") {
          //如果是培训公司管理员
          data["trainingUnitId"] = this.userInfo.Id;
        }
        if (this.userInfo.role_name == "公安管理员") {
          //如果是公安管理员
          data["jurisdiction"] = this.userInfo.jurisdiction;
        }
        //序列号url形式,用&拼接
        data = Qs.stringify(data);
        window.open(`/api/blade-user/export-security-info?${this.website.tokenHeader}=${getToken()}&`+data);
      });
    },
    rowSave(row, done, loading) {
      // var dom = document.getElementById("zhiwenOur");
@@ -1694,6 +1763,7 @@
          rtime: row.rtime,
          securitynumber: row.securitynumber,
          sex: row.sex,
          guncode: row.guncode,
        },
      };
@@ -1756,7 +1826,8 @@
        "离职原因",
        {
          confirmButtonText: "确定",
          callback: (action) => {},
          callback: (action) => {
          },
        }
      );
    },
@@ -1766,7 +1837,7 @@
        cancelButtonText: "取消",
        inputErrorMessage: "",
      })
        .then(({ value }) => {
        .then(({value}) => {
          row.reasonForLeav = value;
          row.status = "2";
          // return;
@@ -1778,7 +1849,8 @@
          });
          this.refreshChange();
        })
        .catch(() => {});
        .catch(() => {
        });
    },
    rowDel(row) {
      this.$confirm("确定注销当前用户?", {
@@ -1966,7 +2038,7 @@
      this.page.currentPage = currentPage;
    },
    //行样式调整
    rowStyle({ row, column, rowIndex }) {
    rowStyle({row, column, rowIndex}) {
      if (row.examinationType == "1") {
        return {
          color: "#ff2727",
@@ -1987,7 +2059,7 @@
      roleIds.forEach((roleId) => {
        getRoleDetail(roleId).then((res) => {
          var roleAlias = res.data.data.roleAlias;
          if (roleAlias == "保安公司管理员" || roleAlias == "保安") {
          if (roleAlias == "保安公司管理员" || roleAlias == "保安" || roleAlias == "分公司管理员") {
            //去除保安公司查询
            const column = that.findObject(that.option.column, "deptId");
            column.search = false;
@@ -2008,7 +2080,7 @@
            );
            importColumn.action =
              "/api/blade-user/import-security?deptId=" + this.deptIds;
          } else if (roleAlias == "公安管理员") {
          } else if (roleAlias == "公安管理员" || roleAlias == "administrator") {
            params["jurisdiction"] = that.userInfo.jurisdiction;
            var columnDept = that.findObject(that.option.column, "deptId");
            columnDept.dicUrl =
@@ -2018,9 +2090,14 @@
            ColumnDeptUpdate.dicUrl =
              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction=" +
              that.userInfo.jurisdiction;
            //审查状态查询开启
            var columnExaminationType = that.findObject(that.option.column, "examinationType");
            columnExaminationType.search = true;
            columnExaminationType.hide = false;
          } else if (roleAlias == "培训公司管理员") {
            //如果是保安公司管理员
            params["trainingUnitId"] = that.userInfo.dept_id;
            //如果是培训公司管理员
            // params["trainingUnitId"] = that.userInfo.dept_id;
            var columnDept2 = that.findObject(that.option.column, "deptId");
            columnDept2.dicUrl =
              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
@@ -2041,6 +2118,7 @@
            ColumnDeptUpdate1.dicUrl =
              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
          }
          let values = {
            ...params,
@@ -2151,11 +2229,13 @@
.box .el-scrollbar__wrap {
  overflow: scroll;
}
.rowClickSelf {
  &:hover {
    cursor: pointer;
  }
}
//保安证  本子
.certificate_box {
  width: 100%;
@@ -2167,6 +2247,7 @@
  flex-direction: column;
  font: normal 18px "SimSuncss" !important;
}
.security_main {
  width: 630px;
  height: 512px;
@@ -2178,6 +2259,7 @@
  // background-repeat: no-repeat;
  position: relative;
}
// 标题
$upTop: 45px;
$downTop: 265px; //整体高度
@@ -2189,6 +2271,7 @@
  line-height: 45px;
  letter-spacing: 3px;
}
//发证公安机关&nbsp;(印章)
.security_m_l_center {
  position: absolute;
@@ -2196,6 +2279,7 @@
  left: 30px;
  line-height: 40px;
}
//证件编号 &nbsp;
.security_m_l_down {
  position: absolute;
@@ -2217,6 +2301,7 @@
  text-align: justify;
  text-align-last: justify;
}
//出生年月
.security_m_r_b {
  position: absolute;
@@ -2226,6 +2311,7 @@
  text-align: justify;
  text-align-last: justify;
}
//地址
.security_m_r_c {
  position: absolute;
@@ -2235,6 +2321,7 @@
  text-align: justify;
  text-align-last: justify;
}
//公民身份证
.security_m_r_d {
  position: absolute;
@@ -2244,6 +2331,7 @@
  text-align: justify;
  text-align-last: justify;
}
//照片
// width: calc(358px / 22px);
// height: calc(441px / 22px);
@@ -2253,6 +2341,7 @@
  position: absolute;
  top: $upTop;
  left: 421px;
  img {
    width: 100%;
    height: 100%;
@@ -2269,6 +2358,7 @@
  line-height: 45px;
  letter-spacing: 3px;
}
//发证时间
$timeTop: 315px; //整体高度
//年
@@ -2278,6 +2368,7 @@
  left: 109px;
  line-height: 40px;
}
//月
.security_m_l_titlepaperTimeyue {
  position: absolute;
@@ -2285,6 +2376,7 @@
  left: 168px;
  line-height: 40px;
}
//日
.security_m_l_titlepaperTimeri {
  position: absolute;
@@ -2292,6 +2384,7 @@
  left: 159px;
  line-height: 40px;
}
//证件编号
.security_m_l_downsecuritynumber {
  position: absolute;
@@ -2308,6 +2401,7 @@
  left: $centerLeft;
  // width: $rightWidth;
}
// 生日
.security_m_r_o_rightbirthday {
  position: absolute;
@@ -2315,6 +2409,7 @@
  left: $centerLeft;
  // width: $rightWidth;
}
// 地址
.security_m_r_o_rightaddress {
  position: absolute;
@@ -2322,6 +2417,7 @@
  left: $centerLeft;
  width: 185px;
}
// 身份证
.security_m_r_o_rightcardid {
  position: absolute;
@@ -2329,6 +2425,7 @@
  left: $centerLeft;
  // width: $rightWidth;
}
//背景图
.security_main_backImge {
  position: absolute;
@@ -2346,6 +2443,7 @@
  line-height: 40px;
  letter-spacing: 2px;
}
.zhiwenMain {
  width: 100%;
  height: 305px;
@@ -2354,6 +2452,7 @@
  // justify-content: space-around;
  // border: 1px solid red;
}
// .zhiwenImgs {
//   width: 178px;
//   height: 178px;