保安服务企业管理项目备份
src/views/accreditationRecords/accreditationRecords.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"
@@ -48,7 +53,7 @@
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          style="display:none"
          style="display: none"
          :size="size"
          :type="type"
          v-if="permission.notice_upload"
@@ -64,10 +69,12 @@
        </el-button> -->
      </template>
      <template slot-scope="{ row }" slot="deptName">
            <el-tag>{{ row.deptName }}</el-tag>
        <el-tag>{{ row.deptName }}</el-tag>
      </template>
      <template slot-scope="{ row }" slot="sex">
            <el-tag>{{ row.sex=="1"?"男":row.sex=="2"?"女":""}}</el-tag>
        <el-tag>{{
          row.sex == "1" ? "男" : row.sex == "2" ? "女" : ""
        }}</el-tag>
      </template>
    </avue-crud>
  </basic-container>
@@ -79,7 +86,7 @@
  remove,
  update,
  add,
  getAccreditationRecords
  getAccreditationRecords,
} from "@/api/accreditationRecords/accreditationRecords";
import { getDept } from "@/api/system/dept";
import { mapGetters } from "vuex";
@@ -90,7 +97,7 @@
export default {
  data() {
    return {
      check:false,
      check: false,
      form: {},
      query: {},
      questionBankSearch: {},
@@ -105,6 +112,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
      },
      selectionList: [],
      option: {
@@ -126,6 +134,7 @@
        saveBtnText: "发布",
        menuWidth: 150,
        dialogClickModal: false,
        ...this.$store.state.control.clearOtherBut,
        column: [
          {
            label: "申请时间",
@@ -139,7 +148,7 @@
            editDisplay: false,
            viewDisplay: false,
            search: true,
            searchSpan:5,
            searchSpan: 5,
            rules: [
              {
                required: true,
@@ -153,12 +162,12 @@
            prop: "realName",
            search: true,
            searchSpan: 3,
            width:100,
            width: 100,
            searchLabelWidth: 50,
            // display: false,
          },
          // {
          //   label: "所属保安公司",
          //   label: "企业名称",
          //   searchLabelWidth: "110",
          //   // prop: "deptName",
          //   prop: "deptId",
@@ -177,20 +186,20 @@
          //   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,
              search: true,
              overHidden: true,
              minWidth: 200
            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,
            search: true,
            overHidden: true,
            minWidth: 200,
          },
          {
            label: "性别",
@@ -265,7 +274,7 @@
            label: "有无照片",
            prop: "isAvatar",
            type: "select",
            search:true,
            search: true,
            searchLabelWidth: 90,
            minWidth: 105,
            searchSpan: 3,
@@ -273,20 +282,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,
              },
            ],
          },
        ],
      },
@@ -298,8 +307,14 @@
    permissionList() {
      return {
        addBtn: this.vaildData(null, false),
        viewBtn: this.vaildData(this.permission.accreditationRecords_view, false),
        delBtn: this.vaildData(this.permission.accreditationRecords_delete, false),
        viewBtn: this.vaildData(
          this.permission.accreditationRecords_view,
          false
        ),
        delBtn: this.vaildData(
          this.permission.accreditationRecords_delete,
          false
        ),
        editBtn: this.vaildData(null, false),
      };
    },
@@ -317,13 +332,13 @@
  mounted() {
    this.getDeptInfo(this.userInfo.dept_id);
  },
  created(){
      if (this.userInfo.role_name == "公安管理员") {
  created() {
    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);
      }
@@ -473,40 +488,40 @@
        window.localStorage.getItem("saber-userInfo")
      ).content.dept_id;
        const { releaseTimeRange } = this.query;
        params["type"] = 1;
        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["type"] = 1;
      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() {
@@ -518,12 +533,12 @@
        //获取查询条件
        const { releaseTimeRange } = this.questionBankSearch;
        if (releaseTimeRange) {
            this.questionBankSearch['startTime'] = releaseTimeRange[0];
            this.questionBankSearch['endTime'] = releaseTimeRange[1];
          this.questionBankSearch["startTime"] = releaseTimeRange[0];
          this.questionBankSearch["endTime"] = releaseTimeRange[1];
        }
        var data = {
          type:1,
          applyUnit:this.questionBankSearch.applyUnit,
          type: 1,
          applyUnit: this.questionBankSearch.applyUnit,
          deptName: this.questionBankSearch.deptName,
          idCardNo: this.questionBankSearch.idCardNo,
          realName: this.questionBankSearch.realName,
@@ -546,7 +561,11 @@
        }
        //序列号url形式,用&拼接
        data = Qs.stringify(data);
        window.open(`/api/accreditationRecords/export-security-paper?${this.website.tokenHeader}=${getToken()}&`+data);
        window.open(
          `/api/accreditationRecords/export-security-paper?${
            this.website.tokenHeader
          }=${getToken()}&` + data
        );
      });
    },
  },