From e65e3c1a492714364483b892bd3fa01adb643191 Mon Sep 17 00:00:00 2001
From: cy <1664593601@qq.com>
Date: 星期六, 25 十一月 2023 13:40:40 +0800
Subject: [PATCH] feat: 人员角色编辑

---
 admin-web/src/views/systemManger/server/user/edit.vue |   39 +++++++++++++++++++++++++++++----------
 1 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/admin-web/src/views/systemManger/server/user/edit.vue b/admin-web/src/views/systemManger/server/user/edit.vue
index b5646fc..a97169d 100644
--- a/admin-web/src/views/systemManger/server/user/edit.vue
+++ b/admin-web/src/views/systemManger/server/user/edit.vue
@@ -11,6 +11,11 @@
       <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>
@@ -66,6 +71,7 @@
     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 {
         components: {winSm, myButton},
@@ -81,6 +87,7 @@
         },
         data() {
             return {
+                deptmentOptions:[],
                 checkAll: false,
                 checkedList: [],
                 roleList: [
@@ -103,6 +110,7 @@
                     label: 'name',
                 },
                 formData: {
+                    sysDeptId:'',
                     userName: '',
                     userCode: '',
                     userPhone: '',
@@ -112,6 +120,9 @@
                     seq: null,
                 },
                 rules: {
+                    sysDeptId: [
+                        {required: true, message: '璇疯緭鍏�', trigger: 'blur'}
+                    ],
                     userName: [
                         {required: true, message: '璇疯緭鍏ヤ汉鍛樺鍚�', trigger: 'blur'}
                     ],
@@ -133,20 +144,23 @@
         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;
@@ -157,6 +171,11 @@
                     }
                 );
             },
+            getDeptmentOptions(){
+                departmentListAll({tenantId:this.setting.tenantId}).then(res=>{
+                    this.deptmentOptions = res
+                })
+            },
             handleCheckAllChange(val) {
                 if (val) {
                     this.checkedList = this.roleOptions.map(x => {

--
Gitblit v1.9.1