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 | 80 +++++++++++++++++++++++----------------- 1 files changed, 46 insertions(+), 34 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 02611be..6fd572b 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -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,6 +449,7 @@ deptId: undefined }, showInstitutuion: false, + showDeptList: false, // 列信息 columns: [ { key: 0, 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