马宇豪
2025-01-23 e735896a68d8c1742859a06d7bc1c7c1bb61f57d
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">
@@ -303,16 +298,21 @@
          </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-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" v-if="showDeptList">
            <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">
@@ -449,6 +449,7 @@
        deptId: undefined
      },
      showInstitutuion: false,
      showDeptList: false,
      // 列信息
      columns: [
        { key: 0, label: `用户编号`, visible: true },
@@ -473,6 +474,9 @@
        ],
        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
@@ -677,6 +686,9 @@
          this.showInstitutuion = true
          this.form.institutionIds = response.data.institutions.map(i=>i.institutionId.toString())
        }
        if(response.roleIds.indexOf(101)>-1){
          this.showDeptList = true
        }
      });
    },
    /** 重置密码按钮操作 */