| | |
| | | update, |
| | | updatePlatform, |
| | | add, |
| | | securitySave, |
| | | grant, |
| | | resetPassword, |
| | | getUserPractitionersInfo, |
| | |
| | | } from "@/api/system/user"; |
| | | import { getList } from "@/api/securityGuard/securityGuard"; |
| | | import { getDeptLazyTree } from "@/api/system/dept"; |
| | | import { getRoleTree } 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'; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | } |
| | | }; |
| | | return { |
| | | securityid:"", |
| | | excelBox1: false, |
| | | excelForm1: {}, |
| | | excelOption1: { |
| | |
| | | value: "id", |
| | | }, |
| | | // disabled: true, |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | ], |
| | | }, |
| | | { |
| | | label: "昵称", |
| | | prop: "name", |
| | | }, |
| | | { |
| | | label: "个人照片", |
| | | type: "upload", |
| | | listType: "picture-img", |
| | |
| | | row: true, |
| | | prop: "myPicture", |
| | | }, |
| | | { |
| | | label: "编号", |
| | | prop: "code", |
| | | }, |
| | | { |
| | | label: "昵称", |
| | | prop: "name", |
| | | }, |
| | | |
| | | // { |
| | | // label: "编号", |
| | | // prop: "code", |
| | | // }, |
| | | |
| | | { |
| | | label: "所属辖区", |
| | | prop: "jurisdiction", |
| | |
| | | slot: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | required: false, |
| | | message: "请选择所属辖区", |
| | | trigger: "click", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "所属角色", |
| | | prop: "roleId", |
| | | multiple: true, |
| | | type: "tree", |
| | | dicData: [], |
| | | props: { |
| | | label: "title", |
| | | }, |
| | | checkStrictly: true, |
| | | slot: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择所属角色", |
| | | trigger: "click", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "所属岗位", |
| | | prop: "postId", |
| | | type: "tree", |
| | | multiple: true, |
| | | dicData: [], |
| | | props: { |
| | | label: "postName", |
| | | value: "id", |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请选择所属岗位", |
| | | trigger: "click", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "所属角色", |
| | | // prop: "roleId", |
| | | // multiple: true, |
| | | // type: "tree", |
| | | // dicData: [], |
| | | // props: { |
| | | // label: "title", |
| | | // }, |
| | | // checkStrictly: true, |
| | | // slot: true, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请选择所属角色", |
| | | // trigger: "click", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | // { |
| | | // label: "所属岗位", |
| | | // prop: "postId", |
| | | // type: "tree", |
| | | // multiple: true, |
| | | // dicData: [], |
| | | // props: { |
| | | // label: "postName", |
| | | // value: "id", |
| | | // }, |
| | | // rules: [ |
| | | // { |
| | | // required: false, |
| | | // message: "请选择所属岗位", |
| | | // trigger: "click", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | { |
| | | label: "是否持证", |
| | | prop: "hold", |
| | |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | ...mapState({ |
| | | userInfo: state => state.user.userInfo |
| | | }) |
| | | }, |
| | | 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; |
| | | |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | methods: { |
| | | handleImport1() { |
| | |
| | | userPractitionersList.push(info); |
| | | }); |
| | | } |
| | | var IdCardNo = row.id; |
| | | add(row).then( |
| | | () => { |
| | | const experience = { |
| | | securityid: IdCardNo, |
| | | 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 |
| | | } |
| | | const userMap = { |
| | | user: user, |
| | | userPractitionersInfo: userPractitionersList, |
| | | }; |
| | | //新增从业信息 |
| | | saveOrUpdateUserPractitionersInfo(experience).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | securitySave(userMap).then( |
| | | () => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | // this.$message({ |
| | | // type: "success", |
| | | // message: "操作成功!", |
| | | // }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | |
| | | }; |
| | | values = { |
| | | ...params, |
| | | deptId: this.deptId, |
| | | roleId: this.roleId, |
| | | 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; |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | |
| | | if (this.userInfo.role_id == "1414840172333842433") { |
| | | console.log("是公安add jurisdiction"); |
| | | values["jurisdiction"] = this.userInfo.jurisdiction; |