liuyg
2021-08-19 cb81eef3d9aabe280e506fc7971c539542cf13f7
src/views/securityGuard/securityGuard.vue
@@ -107,7 +107,7 @@
              >导出
            </el-button>
          </template>
          <template slot-scope="{ type, size, row }" slot="menu">
            <!-- <el-button
                style="display:none"
@@ -125,12 +125,12 @@
              >离职登记
            </el-button>
          </template>
          <template slot-scope="{ row }" slot="sex">
            <el-tag v-if="row.sex == 1">男</el-tag>
            <el-tag v-if="row.sex == 2">女</el-tag>
          </template>
          <template slot-scope="{ row }" slot="tenantName">
            <el-tag>{{ row.tenantName }}</el-tag>
          </template>
@@ -161,7 +161,7 @@
            :props="props"
          >
          </el-tree>
          <span slot="footer" class="dialog-footer">
            <el-button @click="roleBox = false">取 消</el-button>
            <el-button type="primary" @click="submitRole">确 定</el-button>
@@ -238,7 +238,7 @@
    </el-col>
  </el-row>
</template>
<script>
import {
  getUser,
@@ -262,7 +262,7 @@
import { getToken } from "@/util/auth";
import { securityFormPageColumn } from "./data";
import { mapState } from "vuex";
export default {
  data() {
    const validatePass = (rule, value, callback) => {
@@ -284,6 +284,7 @@
    return {
      securityid: "",
      excelBox1: false,
      isSecurity: false,
      excelForm1: {},
      excelOption1: {
        submitBtn: false,
@@ -310,7 +311,7 @@
          },
        ],
      },
      form: {},
      search: {},
      roleBox: false,
@@ -377,7 +378,7 @@
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: true, //liu
        border: false,
        stripe: true,
        align: "center",
        index: true,
@@ -399,8 +400,8 @@
                label: "所属保安公司",
                prop: "deptId",
                type: "tree",
                dicUrl:
                  "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
                // dicUrl:
                  // "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
                // dicUrl: "/api/blade-system/dept/lazy-tree?parentId=0",
                props: {
                  label: "title",
@@ -485,12 +486,12 @@
                row: true,
                prop: "myPicture",
              },
              // {
              //   label: "编号",
              //   prop: "code",
              // },
              {
                label: "所属辖区",
                prop: "jurisdiction",
@@ -680,7 +681,7 @@
              {
                prop: "UserPractitionersInfo",
                type: "dynamic",
                border: true, //liu
                border: false,
                span: 24,
                children: {
                  align: "left",
@@ -925,28 +926,18 @@
      userInfo: (state) => state.user.userInfo,
    }),
  },
  beforeCreate() {
  },
  created() {
  },
  mounted() {
    // this.option.column[0].hide = true
    // 非保安单位模式默认加载管理组数据
    if (!website.tenantMode) {
      this.initData(website.tenantId);
    }
    //获取当前登录人员的角色信息
    var roleIds = this.userInfo.role_id.split(",");
    roleIds.forEach((roleId) => {
      getRoleDetail(roleId).then((res) => {
        var roleAlias = res.data.data.roleAlias;
        if (
          roleAlias == "保安公司管理员" ||
          roleAlias == "保安" ||
          roleAlias == "未持证保安"
        ) {
          const column = this.findObject(this.option.column, "deptId");
          column.search = false;
          this.initData(website.tenantId);
        }
      });
    });
  },
  methods: {
    handleImport1() {
@@ -961,7 +952,7 @@
    handleTemplate1() {
      window.open(`/api/examSubjectChoices/export-template`);
    },
    //行点击事件
    rowClick(row) {
      this.$router.push({
@@ -975,18 +966,18 @@
      this.onLoad(this.page);
    },
    initData(tenantId) {
      getRoleTree(tenantId).then((res) => {
        const column = this.findObject(this.option.group, "roleId");
        column.dicData = res.data.data;
      });
      // getRoleTree(tenantId).then((res) => {
      //   const column = this.findObject(this.option.group, "roleId");
      //   column.dicData = res.data.data;
      // });
      // getDeptTree(tenantId).then((res) => {
      //   const column = this.findObject(this.option.group, "deptId");
      //   column.dicData = res.data.data;
      // });
      getPostList(tenantId).then((res) => {
        const column = this.findObject(this.option.group, "postId");
        column.dicData = res.data.data;
      });
      // getPostList(tenantId).then((res) => {
      //   const column = this.findObject(this.option.group, "postId");
      //   column.dicData = res.data.data;
      // });
    },
    submitRole() {
      const roleList = this.$refs.treeRole.getCheckedKeys().join(",");
@@ -1289,40 +1280,65 @@
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      let values = {
        ...params,
      };
      values = {
        ...params,
        roleAlias: "111",
        ...this.query,
      };
      var that = this;
      //获取当前登录人员的角色信息
      var roleIds = this.userInfo.role_id.split(",");
      roleIds.forEach((roleId) => {
        getRoleDetail(roleId).then((res) => {
          var roleAlias = res.data.data.roleAlias;
          if (roleAlias == "保安公司管理员") {
            values["deptId"] = this.userInfo.dept_id;
          if (
            roleAlias == "保安公司管理员" ||
            roleAlias == "保安" ||
            roleAlias == "未持证保安"
          ) {
            //去除保安公司查询
            const column = that.findObject(that.option.column, "deptId");
            column.search = false;
            const deptColumn = that.findObject(that.option.group, "deptId");
            deptColumn.dicUrl = "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
            //禁止编辑
            deptColumn.disabled = true;
            deptColumn.value = that.userInfo.dept_id;
            that.isSecurity = true;
            //如果是保安公司管理员
            params["deptId"] = that.userInfo.dept_id;
          }else if (roleAlias == "公安管理员") {
            params["jurisdiction"] = that.userInfo.jurisdiction;
            var columnDept = that.findObject(that.option.column, "deptId");
            columnDept.dicUrl =
                "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction="+that.userInfo.jurisdiction
            var ColumnDeptUpdate = that.findObject(that.option.group, "deptId");
            ColumnDeptUpdate.dicUrl =
                "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction="+that.userInfo.jurisdiction
          }else{
            var columnDept1 = that.findObject(that.option.column, "deptId");
            columnDept1.dicUrl = "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
            var ColumnDeptUpdate1 = that.findObject(that.option.group, "deptId");
            ColumnDeptUpdate1.dicUrl = "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
          }
          let values = {
            ...params,
          };
          values = {
            ...params,
            roleAlias: "111",
            ...that.query,
          };
          that.loading = true;
          getList(page.currentPage, page.pageSize, values).then((res) => {
            const data = res.data.data;
            that.page.total = data.total;
            that.data = data.records;
            that.loading = false;
            that.selectionClear();
          });
        });
      });
      if (this.userInfo.role_id == "1414840172333842433") {
        console.log("是公安add jurisdiction");
        values["jurisdiction"] = this.userInfo.jurisdiction;
      }
      this.loading = true;
      getList(page.currentPage, page.pageSize, values, this.treeDeptId).then(
        (res) => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        }
      );
    },
    platformRowUpdate(row, index, done, loading) {
      updatePlatform(row.id, row.userType, row.userExt).then(
@@ -1392,17 +1408,17 @@
  },
};
</script>
<style>
.box {
  height: 800px;
}
.el-scrollbar {
  height: 100%;
}
.box .el-scrollbar__wrap {
  overflow: scroll;
}
</style>
</style>