From db905ecd14f63dba9337b4f4715584ef2d7e8c7e Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期五, 07 三月 2025 14:45:00 +0800
Subject: [PATCH] 修改

---
 src/views/system/user/index.vue |   86 ++++++++++++++++++++++++------------------
 1 files changed, 49 insertions(+), 37 deletions(-)

diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 9f61dcd..6fd572b 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -6,7 +6,7 @@
         <div class="head-container">
           <el-input
             v-model="deptName"
-            placeholder="请输入部门名称"
+            placeholder="请输入组织架构名称"
             clearable
             size="small"
             prefix-icon="el-icon-search"
@@ -142,7 +142,7 @@
           <el-table-column label="真实姓名" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
           <el-table-column label="用户名" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
           <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
-          <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
+          <el-table-column label="组织架构" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
           <el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
             <template slot-scope="scope">
               <el-switch
@@ -212,11 +212,6 @@
               <el-input v-model="form.nickName" placeholder="请输入真实姓名" maxlength="30" />
             </el-form-item>
           </el-col>
-<!--          <el-col :span="12">-->
-<!--            <el-form-item label="归属部门" prop="deptId">-->
-<!--              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />-->
-<!--            </el-form-item>-->
-<!--          </el-col>-->
         </el-row>
         <el-row :gutter="20">
           <el-col :span="12">
@@ -288,33 +283,38 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="12" v-if="showInstitutuion">
-            <el-form-item label="所属机构" prop="institutionIds">
-              <el-select v-model="form.institutionIds" multiple placeholder="请选择所属机构" style="width: 100%">
-                <el-option
-                  v-for="item in sectionOptions"
-                  :key="item.institutionId"
-                  :label="item.institutionName"
-                  :value="item.institutionId"
-                  :disabled="item.status == 1"
-                ></el-option>
-              </el-select>
+          <el-col :span="12">
+            <el-form-item label="组织架构" prop="deptId">
+              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择组织架构" />
             </el-form-item>
           </el-col>
+<!--          <el-col :span="12" v-if="showInstitutuion">-->
+<!--            <el-form-item label="所属机构" prop="institutionIds">-->
+<!--              <el-select v-model="form.institutionIds" multiple placeholder="请选择所属机构" style="width: 100%">-->
+<!--                <el-option-->
+<!--                  v-for="item in sectionOptions"-->
+<!--                  :key="item.institutionId"-->
+<!--                  :label="item.institutionName"-->
+<!--                  :value="item.institutionId"-->
+<!--                  :disabled="item.status == 1"-->
+<!--                ></el-option>-->
+<!--              </el-select>-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
         </el-row>
         <el-row :gutter="20">
-          <el-col :span="12">
-            <el-form-item label="所属地区">
-              <el-select v-model="form.districtId" placeholder="请选择" style="width: 100%;">
-                <el-option
-                  v-for="item in areaList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
+<!--          <el-col :span="12">-->
+<!--            <el-form-item label="所属地区">-->
+<!--              <el-select v-model="form.districtId" placeholder="请选择" style="width: 100%;">-->
+<!--                <el-option-->
+<!--                  v-for="item in areaList"-->
+<!--                  :key="item.id"-->
+<!--                  :label="item.name"-->
+<!--                  :value="item.id">-->
+<!--                </el-option>-->
+<!--              </el-select>-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
           <el-col :span="12">
             <el-form-item label="状态">
               <el-radio-group v-model="form.status" style="width: 100%;">
@@ -449,12 +449,13 @@
         deptId: undefined
       },
       showInstitutuion: false,
+      showDeptList: false,
       // 列信息
       columns: [
         { key: 0, label: `用户编号`, visible: true },
         { key: 1, label: `用户名`, visible: true },
         { key: 2, label: `真实姓名`, visible: true },
-        { key: 3, label: `部门`, visible: true },
+        { key: 3, label: `组织架构`, visible: true },
         { key: 4, label: `手机号码`, visible: true },
         { key: 5, label: `状态`, visible: true },
         { key: 6, label: `创建时间`, visible: true }
@@ -471,8 +472,11 @@
         roleIds: [
           { required: true, message: "角色不能为空", trigger: "blur" }
         ],
-        institutionIds: [
-          { required: true, message: "所属机构不能为空", trigger: "blur" }
+        // institutionIds: [
+        //   { required: true, message: "所属机构不能为空", trigger: "blur" }
+        // ],
+        deptId: [
+          { required: true, message: "组织架构不能为空", trigger: "blur" }
         ],
         password: [
           { required: true, message: "用户密码不能为空", trigger: "blur" },
@@ -588,6 +592,11 @@
     },
     getSections(val){
       this.sectionOptions = []
+      if(val.indexOf(101)>-1){
+        this.showDeptList = true
+      }else{
+        this.showDeptList = false
+      }
       if(val.indexOf(100)>-1 && val.indexOf(102)>-1){
         this.getSectionList()
         this.showInstitutuion = true
@@ -672,10 +681,13 @@
         this.open = true;
         this.title = "修改用户";
         this.form.password = "";
-        if(response.roleIds.indexOf(100)>-1 || response.roleIds.indexOf(102)>-1){
-          this.getSectionList()
-          this.showInstitutuion = true
-          this.form.institutionIds = response.data.institutions.map(i=>i.institutionId.toString())
+        // if(response.roleIds.indexOf(100)>-1 || response.roleIds.indexOf(102)>-1){
+        //   this.getSectionList()
+        //   this.showInstitutuion = true
+        //   this.form.institutionIds = response.data.institutions.map(i=>i.institutionId.toString())
+        // }
+        if(response.roleIds.indexOf(101)>-1){
+          this.showDeptList = true
         }
       });
     },

--
Gitblit v1.9.2