src/views/accreditationRecords/accreditationRecordsPaper.vue
@@ -1,5 +1,10 @@
<template>
  <basic-container class="desk1">
  <basic-container
    :class="[
      'desk1',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch' : '',
    ]"
  >
    <avue-crud
      :option="option"
      :table-loading="loading"
@@ -24,7 +29,7 @@
    >
      <template slot="menuLeft">
        <el-button
          style="display:none"
          style="display: none"
          type="danger"
          size="small"
          icon="el-icon-delete"
@@ -52,22 +57,20 @@
          >证书打印信息导出
        </el-button>
        <el-button
              type="primary"
              size="small"
              plain
              v-if="permission.accreditationRecords_batch_audit  || check"
              icon="el-icon-collection-tag"
              @click="handleSecurityAudit"
              >批量审批
          type="primary"
          size="small"
          plain
          v-if="permission.accreditationRecords_batch_audit || check"
          icon="el-icon-collection-tag"
          @click="handleSecurityAudit"
          >批量审批
        </el-button>
      </template>
      <template slot-scope="{ row }" slot="category">
        <el-tag>{{ row.categoryName }}</el-tag>
      </template>
      <template slot-scope="{ row }" slot="userType">
            {{
              row.userType == 6 ? "已制证" : row.userType == 7 ? "未制证" : ""
            }}
        {{ row.userType == 6 ? "已制证" : row.userType == 7 ? "未制证" : "" }}
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
@@ -115,19 +118,19 @@
    </avue-crud>
    <el-dialog
        title="证书申请审核"
        :visible.sync="dialogFormVisible"
        modal-append-to-body="false"
        append-to-body="true"
        :close-on-click-model="true"
      >
        <avue-form
          ref="formAudit"
          v-model="Audit"
          :option="optionAudit"
          @reset-change="emptytChange"
          @submit="submit"
        ></avue-form>
      title="证书申请审核"
      :visible.sync="dialogFormVisible"
      modal-append-to-body="false"
      append-to-body="true"
      :close-on-click-model="true"
    >
      <avue-form
        ref="formAudit"
        v-model="Audit"
        :option="optionAudit"
        @reset-change="emptytChange"
        @submit="submit"
      ></avue-form>
    </el-dialog>
    <el-dialog
      title="批量审批"
@@ -144,45 +147,45 @@
        @submit="submitBatchAudit"
      ></avue-form>
    </el-dialog>
      <div style="position: fixed; top: 9999px; width: 100%; height: 100%">
          <div class="certificate_box" id="certificateDom">
            <div class="security_main" ref="certificateBox">
              <div class="security_m_l_titleName widt">
                {{ certificateObj.realName }}
              </div>
              <div class="security_m_r_o_jg widt">南昌市公安局</div>
              <div class="security_m_l_titlepaperTimenian widt">
                {{ certificateYear }}
              </div>
              <div class="security_m_l_titlepaperTimeyue widt">
                {{ certificateMonth }}
              </div>
              <div class="security_m_l_downsecuritynumber widt">
                {{ certificateObj.securityNumber }}
              </div>
              <div class="security_m_r_o_right widt">
                {{ certificateObj.realName }}
              </div>
              <div class="security_m_r_o_rightbirthday widt">
                {{
                  certificateObj.idCardNo
                    ? certificateObj.idCardNo.slice(6, 10) +
                      "." +
                      certificateObj.idCardNo.slice(10, 12) +
                      "." +
                      certificateObj.idCardNo.slice(12, 14)
                    : ""
                }}
              </div>
              <div class="security_m_r_o_rightaddress security_m_r_o_l_r widt">
                {{ certificateObj.registered }}
              </div>
              <div class="security_m_r_o_rightcardid">
                {{ certificateObj.idCardNo }}
              </div>
            </div>
    <div style="position: fixed; top: 9999px; width: 100%; height: 100%">
      <div class="certificate_box" id="certificateDom">
        <div class="security_main" ref="certificateBox">
          <div class="security_m_l_titleName widt">
            {{ certificateObj.realName }}
          </div>
          <div class="security_m_r_o_jg widt">南昌市公安局</div>
          <div class="security_m_l_titlepaperTimenian widt">
            {{ certificateYear }}
          </div>
          <div class="security_m_l_titlepaperTimeyue widt">
            {{ certificateMonth }}
          </div>
          <div class="security_m_l_downsecuritynumber widt">
            {{ certificateObj.securityNumber }}
          </div>
          <div class="security_m_r_o_right widt">
            {{ certificateObj.realName }}
          </div>
          <div class="security_m_r_o_rightbirthday widt">
            {{
              certificateObj.idCardNo
                ? certificateObj.idCardNo.slice(6, 10) +
                  "." +
                  certificateObj.idCardNo.slice(10, 12) +
                  "." +
                  certificateObj.idCardNo.slice(12, 14)
                : ""
            }}
          </div>
          <div class="security_m_r_o_rightaddress security_m_r_o_l_r widt">
            {{ certificateObj.registered }}
          </div>
          <div class="security_m_r_o_rightcardid">
            {{ certificateObj.idCardNo }}
          </div>
        </div>
      </div>
    </div>
  </basic-container>
</template>
@@ -194,7 +197,7 @@
  add,
  getAccreditationRecords,
  audit,
  batchAudit
  batchAudit,
} from "@/api/accreditationRecords/accreditationRecords";
import { updatePaperTime } from "@/api/system/user";
import { getDept } from "@/api/system/dept";
@@ -206,7 +209,7 @@
export default {
  data() {
    return {
      check:false,
      check: false,
      certificateYear: null,
      certificateMonth: null,
      certificateFlag: false,
@@ -216,10 +219,10 @@
        idCardNo: "",
        registered: "",
      },
      Audit: {},
      dialogFormVisible: false,
      dialogBatchAudit:false,
      dialogBatchAudit: false,
      optionAudit: {
        height: "auto",
        calcHeight: 30,
@@ -237,6 +240,7 @@
        excelBtn: false,
        menuWidth: 230,
        dialogClickModal: false,
        ...this.$store.state.control.clearOtherBut,
        column: [
          {
            label: "审核状态",
@@ -297,6 +301,7 @@
        excelBtn: false,
        menuWidth: 380,
        dialogClickModal: false,
        ...this.$store.state.control.clearOtherBut,
        column: [
          {
            label: "所选保安人数",
@@ -361,6 +366,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
      },
      selectionList: [],
      option: {
@@ -384,6 +390,7 @@
        saveBtnText: "发布",
        menuWidth: 180,
        dialogClickModal: false,
        ...this.$store.state.control.clearOtherBut,
        column: [
          {
            label: "申请时间",
@@ -416,7 +423,7 @@
            // display: false,
          },
          // {
          //   label: "所属保安公司",
          //   label: "企业名称",
          //   searchLabelWidth: "110",
          //   // prop: "deptName",
          //   prop: "deptId",
@@ -435,7 +442,7 @@
          //   minWidth: 260,
          // },
          {
            label: "所属保安公司",
            label: "企业名称",
            searchLabelWidth: "110",
            prop: "deptName",
            // type: "tree",
@@ -581,7 +588,7 @@
            label: "有无照片",
            prop: "isAvatar",
            type: "select",
            search:true,
            search: true,
            searchLabelWidth: 90,
            minWidth: 105,
            searchSpan: 3,
@@ -589,20 +596,20 @@
            editDisplay: false,
            hide: true,
            display: false,
            dicData:[
            dicData: [
              {
                label:"全部",
                value:3
                label: "全部",
                value: 3,
              },
              {
                label:"有",
                value:1
                label: "有",
                value: 1,
              },
              {
                label:"无",
                value:2
              }
            ]
                label: "无",
                value: 2,
              },
            ],
          },
        ],
      },
@@ -614,7 +621,10 @@
    permissionList() {
      return {
        addBtn: this.vaildData(null, false),
        viewBtn: this.vaildData(this.permission.accreditationRecords_paper_view, false),
        viewBtn: this.vaildData(
          this.permission.accreditationRecords_paper_view,
          false
        ),
        delBtn: this.vaildData(null, false),
        editBtn: this.vaildData(null, false),
      };
@@ -643,10 +653,10 @@
    }
    if (this.userInfo.role_name == "公安管理员") {
      //判断是否为市局管理员
      if(this.userInfo.jurisdiction=="1372091709474910209"){
          this.check = true;
          // this.vaildData(this.permission.accreditationRecords_paper_delete, false);
      }else{
      if (this.userInfo.jurisdiction == "1372091709474910209") {
        this.check = true;
        // this.vaildData(this.permission.accreditationRecords_paper_delete, false);
      } else {
        this.check = false;
        // this.vaildData(null, false);
      }
@@ -787,11 +797,11 @@
        }
      }
      const data = {
        ids:str,
        auditStatus:row.auditStatus,
        auditDetail:row.auditDetail,
        auditUser:this.userInfo.Id,
      }
        ids: str,
        auditStatus: row.auditStatus,
        auditDetail: row.auditDetail,
        auditUser: this.userInfo.Id,
      };
      //提交申请
      batchAudit(data).then(
        () => {
@@ -962,41 +972,41 @@
        window.localStorage.getItem("saber-userInfo")
      ).content.dept_id;
        const { releaseTimeRange } = this.query;
        // params["jurisdiction"] = this.jurisdiction;
        params["type"] = 2;
        if (this.userInfo.role_name == "保安公司管理员") {
          //如果是保安公司管理员
          params["deptId"] = this.userInfo.dept_id;
        }
        if (this.userInfo.role_name == "培训公司管理员") {
          //如果是培训公司管理员
          params["createUser"] = this.userInfo.Id;
        }
        if (this.userInfo.role_name == "公安管理员") {
          //如果是公安管理员
          params["jurisdiction"] = this.userInfo.jurisdiction;
        }
        let values = {
      const { releaseTimeRange } = this.query;
      // params["jurisdiction"] = this.jurisdiction;
      params["type"] = 2;
      if (this.userInfo.role_name == "保安公司管理员") {
        //如果是保安公司管理员
        params["deptId"] = this.userInfo.dept_id;
      }
      if (this.userInfo.role_name == "培训公司管理员") {
        //如果是培训公司管理员
        params["createUser"] = this.userInfo.Id;
      }
      if (this.userInfo.role_name == "公安管理员") {
        //如果是公安管理员
        params["jurisdiction"] = this.userInfo.jurisdiction;
      }
      let values = {
        ...params,
      };
      if (releaseTimeRange) {
        values = {
          ...params,
          startTime: releaseTimeRange[0],
          endTime: releaseTimeRange[1],
          ...this.query,
        };
        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();
        });
        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();
      });
    },
    //保安员证信息导出
    handleExport() {
@@ -1012,10 +1022,10 @@
          this.questionBankSearch["endTime"] = releaseTimeRange[1];
        }
        var data = {
          type:2,
          userType:this.questionBankSearch.userType,
          applyUnit:this.questionBankSearch.applyUnit,
          auditStatus:this.questionBankSearch.auditStatus,
          type: 2,
          userType: this.questionBankSearch.userType,
          applyUnit: this.questionBankSearch.applyUnit,
          auditStatus: this.questionBankSearch.auditStatus,
          deptName: this.questionBankSearch.deptName,
          idCardNo: this.questionBankSearch.idCardNo,
          realName: this.questionBankSearch.realName,
@@ -1039,7 +1049,11 @@
        }
        //序列号url形式,用&拼接
        data = Qs.stringify(data);
        window.open(`/api/accreditationRecords/export-security-book-paper?${this.website.tokenHeader}=${getToken()}&`+data);
        window.open(
          `/api/accreditationRecords/export-security-book-paper?${
            this.website.tokenHeader
          }=${getToken()}&` + data
        );
      });
    },
    //保安员证信息导出
@@ -1056,10 +1070,10 @@
          this.questionBankSearch["endTime"] = releaseTimeRange[1];
        }
        var data = {
          type:2,
          userType:this.questionBankSearch.userType,
          applyUnit:this.questionBankSearch.applyUnit,
          auditStatus:this.questionBankSearch.auditStatus,
          type: 2,
          userType: this.questionBankSearch.userType,
          applyUnit: this.questionBankSearch.applyUnit,
          auditStatus: this.questionBankSearch.auditStatus,
          deptName: this.questionBankSearch.deptName,
          idCardNo: this.questionBankSearch.idCardNo,
          realName: this.questionBankSearch.realName,
@@ -1082,7 +1096,11 @@
        }
        //序列号url形式,用&拼接
        data = Qs.stringify(data);
        window.open(`/api/accreditationRecords/export-security-book-papers?${this.website.tokenHeader}=${getToken()}&`+data);
        window.open(
          `/api/accreditationRecords/export-security-book-papers?${
            this.website.tokenHeader
          }=${getToken()}&` + data
        );
      });
    },
  },