保安服务企业管理项目备份
guoshilong
2023-12-20 7becb16bb38cb3284c7f4e3dc2c486dd55812c8a
src/views/securityGuard/securityGuard.vue
@@ -28,6 +28,9 @@
          :before-close="beforeClose">
          <!-- @row-update="rowUpdate" -->
          <template slot="menuLeft">
            <el-button type="primary" size="small" plain icon="el-icon-s-check"
                       @click="handleBatchAudit">批量审批
            </el-button>
            <el-button type="success" size="small" plain icon="el-icon-upload2" v-if="permission.securityGuard_import"
              @click="handleImport1">保安员批量导入
            </el-button>
@@ -40,17 +43,18 @@
            <el-button type="success" size="small" plain icon="el-icon-upload2" v-if="permission.securityGuard_import"
              @click="handleImportNoCriminal">无犯罪记录图片批量上传
            </el-button>
            <el-button type="primary" style="display: none;" size="small" plain
              v-if="permission.securityGuard_security_apply" icon="el-icon-s-promotion"
              @click="handleSecurityApply">上岗证制证申请
            </el-button>
            <el-button type="primary" style="display: none;" size="small" plain
<!--            <el-button type="primary" size="small" plain-->
<!--              v-if="permission.securityGuard_security_apply" icon="el-icon-s-promotion"-->
<!--              @click="handleSecurityApply">上岗证制证申请-->
<!--            </el-button>-->
            <el-button type="primary"  size="small" plain
              v-if="permission.securityGuard_security_paper_apply" icon="el-icon-collection-tag"
              @click="handleSecurityPaperApply">证书制证申请
            </el-button>
            <el-button type="warning" size="small" plain icon="el-icon-download" v-if="permission.export_security_info"
              @click="handleExportSecurityInfo">保安信息导出
            </el-button>
            <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.securityGuard_delete"
              @click="handleDelete">注 销
@@ -80,26 +84,37 @@
                  @click.stop="rowClick(row)">查看
                </el-button>
                <br v-if="permission.securityGuard_view" />
                <el-button icon="el-icon-scissors" :size="size" :type="type"
                  v-if="permission.securityGuard_delete && row.status != 2" @click="$refs.crud.rowEdit(row, index)">编辑
                </el-button>
                <br v-if="permission.securityGuard_delete && row.status != 2" />
                <el-button icon="el-icon-s-check" :size="size" :type="type"
                           v-if="permission.securityGuard_delete && row.status != 2" @click="handleAudit(row)">审批
                </el-button>
                <br v-if="permission.securityGuard_delete && row.status != 2" />
                <el-button icon="el-icon-close" :size="size" :type="type"
                  v-if="permission.securityGuard_delete && row.status != 2" @click="$refs.crud.rowDel(row, index)">注销
                </el-button>
                <br v-if="permission.securityGuard_delete && row.status != 2" />
                <el-button icon="el-icon-circle-close" :size="size" :type="type"
                  v-if="permission.securityGuard_delete && row.status != 2" @click.stop="rowStatus(row)">离职
                </el-button>
                <br v-if="permission.securityGuard_delete && row.status != 2" />
                <el-button icon="el-icon-search" :size="size" :type="type" v-if="row.status == 2"
                  @click.stop="rowDellook(row)">离职查询
                </el-button>
                <br v-if="row.status == 2" />
                <el-button icon="el-icon-user" :size="size" :type="type" v-if="permission.securityGuard_check"
                  @click.stop="rowCheck(row)">异常
                </el-button>
                <br v-if="permission.securityGuard_check" />
                <el-button icon="el-icon-money" :size="size" :type="type" v-if="permission.securityGuard_check_apply"
                  @click.stop="rowCheckApply(row)">证件核实申请
                </el-button>
@@ -344,7 +359,7 @@
  getUserPractitionersInfo,
  updatePaperTime,
  getzhiwen, //指纹
  checkAccountByUser
  checkAccountByUser, batchAudit
} from "@/api/system/user";
import { securityApply } from "@/api/accreditationRecords/accreditationRecords";
import { add } from "@/api/securityapplyRecord/securityapplyRecord";
@@ -1104,11 +1119,25 @@
                label: "居住地址",
                prop: "dwellAddress",
                hide: true,
                rules: [
                  {
                    required: true,
                    message: "请输入居住地址",
                    trigger: "blur"
                  }
                ]
              },
              {
                label: "户籍地址",
                prop: "permanentResidenceAddress",
                hide: true,
                rules: [
                  {
                    required: true,
                    message: "请输入户籍地址",
                    trigger: "blur"
                  }
                ]
              },
              {
                label: "报考等级",
@@ -1477,7 +1506,9 @@
        addBtn: this.vaildData(this.permission.securityGuard_add, false),
        viewBtn: this.vaildData(null, false),
        delBtn: this.vaildData(null, false),
        editBtn: this.vaildData(this.permission.securityGuard_edit, false)
        editBtn: this.vaildData(this.permission.securityGuard_edit, false),
        securityGuard_security_apply:this.vaildData(this.permission.securityGuard_security_apply,true),
        securityGuard_security_paper_apply:this.vaildData(this.permission.securityGuard_security_paper_apply,true)
      };
    },
    platformPermissionList() {
@@ -1577,7 +1608,6 @@
      this.search["userType"] = 7;
    }
    this.deptIds = this.userInfo.dept_id;
    // this.beginzhiwen();
    // this.olondSFZ(); //检查身份证设备是否存在
  },
@@ -2415,6 +2445,83 @@
      this.sortName = "";
      // this.$refs.crud.toggleSelection();
    },
    handleBatchAudit(){
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("请选择审批结果", {
        distinguishCancelAndClose: true,
        confirmButtonText: "审批通过",
        cancelButtonText: "不通过",
        type: "warning"
      })
        .then(() => {
          //审核通过
          batchAudit(this.ids,1)
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
        }).catch(action => {
          console.log(action)
          if (action == 'cancel'){
            //审核不通过
            batchAudit(this.ids,2)
              .then(() => {
                this.onLoad(this.page);
                this.$message({
                  type: "success",
                  message: "操作成功!"
                });
                this.$refs.crud.toggleSelection();
              });
          }
      })
    },
    handleAudit(row){
      this.$confirm("请选择审批结果", {
        distinguishCancelAndClose: true,
        confirmButtonText: "审批通过",
        cancelButtonText: "不通过",
        type: "warning"
      })
        .then(() => {
          //审核通过
          batchAudit(row.id,1)
            .then(() => {
              this.onLoad(this.page);
              this.$message({
                type: "success",
                message: "操作成功!"
              });
              this.$refs.crud.toggleSelection();
            });
        }).catch(action => {
        console.log(action)
        if (action == 'cancel'){
          //审核不通过
          batchAudit(row.id,2)
            .then(() => {
              this.onLoad(this.page);
              this.$message({
                type: "success",
                message: "操作成功!"
              });
              this.$refs.crud.toggleSelection();
            });
        }
      })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");