liuyg
2021-08-19 0c35e05ca9c90883e5073ea35232ea100f866a8f
src/views/securityGuard/securityGuard.vue
@@ -255,13 +255,13 @@
} from "@/api/system/user";
import { getList } from "@/api/securityGuard/securityGuard";
import { getDeptLazyTree } from "@/api/system/dept";
import { getRoleTree,getRoleDetail } from "@/api/system/role";
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 { mapState } from "vuex";
export default {
  data() {
@@ -282,7 +282,7 @@
      }
    };
    return {
      securityid:"",
      securityid: "",
      excelBox1: false,
      excelForm1: {},
      excelOption1: {
@@ -377,7 +377,7 @@
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: false,
        border: true, //liu
        stripe: true,
        align: "center",
        index: true,
@@ -485,12 +485,12 @@
                row: true,
                prop: "myPicture",
              },
              // {
              //   label: "编号",
              //   prop: "code",
              // },
              {
                label: "所属辖区",
                prop: "jurisdiction",
@@ -680,7 +680,7 @@
              {
                prop: "UserPractitionersInfo",
                type: "dynamic",
                border: false,
                border: true, //liu
                span: 24,
                children: {
                  align: "left",
@@ -922,8 +922,8 @@
      return ids.join(",");
    },
    ...mapState({
            userInfo: state => state.user.userInfo
        })
      userInfo: (state) => state.user.userInfo,
    }),
  },
  mounted() {
    // this.option.column[0].hide = true
@@ -934,16 +934,19 @@
    //获取当前登录人员的角色信息
    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;
          }
        })
    })
    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;
        }
      });
    });
  },
  methods: {
    handleImport1() {
@@ -1025,34 +1028,34 @@
        });
      }
      const user = {
          account: row.account,
          address: row.address,
          birthday: row.birthday,
          cardid: row.cardid,
          deptId: row.deptId,
          education: row.education,
          email: row.email,
          height: row.height,
          hold: row.hold,
          jurisdiction: row.jurisdiction,
          myPicture: row.myPicture,
          name:row.name,
          nation:row.nation,
          nativeplace:row.nativeplace,
          password: row.password,
          password2:row.password2,
          phone: row.phone,
          politicaloutlook:row.politicaloutlook,
          realName: row.realName,
          registered:row.registered,
          rtime: row.rtime,
          securitynumber:row.securitynumber,
          sex: row.sex
      }
        account: row.account,
        address: row.address,
        birthday: row.birthday,
        cardid: row.cardid,
        deptId: row.deptId,
        education: row.education,
        email: row.email,
        height: row.height,
        hold: row.hold,
        jurisdiction: row.jurisdiction,
        myPicture: row.myPicture,
        name: row.name,
        nation: row.nation,
        nativeplace: row.nativeplace,
        password: row.password,
        password2: row.password2,
        phone: row.phone,
        politicaloutlook: row.politicaloutlook,
        realName: row.realName,
        registered: row.registered,
        rtime: row.rtime,
        securitynumber: row.securitynumber,
        sex: row.sex,
      };
      const userMap = {
            user: user,
            userPractitionersInfo: userPractitionersList,
          };
        user: user,
        userPractitionersInfo: userPractitionersList,
      };
      securitySave(userMap).then(
        () => {
          this.$message({
@@ -1291,21 +1294,20 @@
      };
      values = {
        ...params,
        roleAlias:"111",
        roleAlias: "111",
        ...this.query,
      };
      //获取当前登录人员的角色信息
      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;
            }
          })
      })
      roleIds.forEach((roleId) => {
        getRoleDetail(roleId).then((res) => {
          var roleAlias = res.data.data.roleAlias;
          if (roleAlias == "保安公司管理员") {
            values["deptId"] = this.userInfo.dept_id;
          }
        });
      });
      if (this.userInfo.role_id == "1414840172333842433") {
        console.log("是公安add jurisdiction");