| | |
| | | <el-form-item label="当前机构"> |
| | | <el-input v-model="setting.tenantName" disabled style="width: 250px"/> |
| | | </el-form-item> |
| | | <el-form-item label="部门" prop="sysDeptId"> |
| | | <el-select v-model="formData.sysDeptId"> |
| | | <el-option v-for="(item,index) in deptmentOptions" :key="index" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="人员姓名" prop="userName"> |
| | | <el-input v-model="formData.userName" clearable maxlength="20" show-word-limit style="width: 250px"/> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import winSm from '@/components/win/win-sm' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import * as DateFormatter from '@/utils/DateFormatter' |
| | | import * as role from "@/api/system/role"; |
| | | import * as user from "@/api/user"; |
| | | import winSm from '@/components/win/win-sm' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import * as DateFormatter from '@/utils/DateFormatter' |
| | | import * as role from "@/api/system/role"; |
| | | import * as user from "@/api/user"; |
| | | import {departmentListAll} from "@/api/system/deptment"; |
| | | |
| | | export default { |
| | | export default { |
| | | components: {winSm, myButton}, |
| | | props: { |
| | | // setting 中须至少包含控制dialog显示或隐藏的属性,其余属性可拓展 |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | deptmentOptions:[], |
| | | checkAll: false, |
| | | checkedList: [], |
| | | roleList: [ |
| | |
| | | label: 'name', |
| | | }, |
| | | formData: { |
| | | sysDeptId:'', |
| | | userName: '', |
| | | userCode: '', |
| | | userPhone: '', |
| | |
| | | seq: null, |
| | | }, |
| | | rules: { |
| | | sysDeptId: [ |
| | | {required: true, message: '请输入', trigger: 'blur'} |
| | | ], |
| | | userName: [ |
| | | {required: true, message: '请输入人员姓名', trigger: 'blur'} |
| | | ], |
| | |
| | | created() { |
| | | this.getInfo() |
| | | this.getAllRole() |
| | | this.getDeptmentOptions() |
| | | }, |
| | | methods: { |
| | | // 获取所有角色 |
| | | getAllRole() { |
| | | const user = this.$store.getters.userInfo |
| | | if (user.lv == 1) { |
| | | this.data_scope = 1 |
| | | } |
| | | if (user.lv == 2) { |
| | | this.data_scope = 2 |
| | | } |
| | | if (user.lv == 3) { |
| | | this.data_scope = 3 |
| | | } |
| | | // const user = this.$store.getters.userInfo |
| | | // this.data_scope = 1 |
| | | // if (user.lv == 1) { |
| | | // this.data_scope = 1 |
| | | // } |
| | | // if (user.lv == 2) { |
| | | // this.data_scope = 2 |
| | | // } |
| | | // if (user.lv == 3) { |
| | | // this.data_scope = 3 |
| | | // } |
| | | this.data_scope = 1 |
| | | role.listRoleByDataScope({dataScope: this.data_scope}).then(response => { |
| | | if (response) { |
| | | this.roleOptions = response; |
| | |
| | | } |
| | | ); |
| | | }, |
| | | getDeptmentOptions(){ |
| | | departmentListAll({tenantId:this.setting.tenantId}).then(res=>{ |
| | | this.deptmentOptions = res |
| | | }) |
| | | }, |
| | | handleCheckAllChange(val) { |
| | | if (val) { |
| | | this.checkedList = this.roleOptions.map(x => { |