fei
2025-09-21 1dbcc7c8bf3434048b74a8b762976d7549c00013
ruoyi-ui/src/views/clanManager/ancestor/index.vue
@@ -15,7 +15,7 @@
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -44,7 +44,7 @@
              v-hasPermi="['system:user:edit']"
            >修改</el-button>
          </el-col>
     <!--     <el-col :span="1.5">
            <el-button
              type="info"
@@ -75,13 +75,13 @@
          <el-table-column label="家族号" align="center" key="clanName" prop="clanName"  :show-overflow-tooltip="true" />
          <el-table-column label="用户角色" align="center" key="roleName" prop="roleName" width="120" />
      <el-table-column label="性别" align="center" key="sex" prop="sex"  width="120" >
            <template slot-scope="scope">{{scope.row.sex==0? '女': '男'}}</template>
      <el-table-column label="" align="center" key="sex" prop="sex"  width="120" >
            <template slot-scope="scope">{{scope.row.sex==1? '女': '男'}}</template>
          </el-table-column>
          <el-table-column
            label="操作"
           fixed="right" label="操作"
            align="center"
            width="160"
            class-name="small-padding fixed-width"
@@ -94,13 +94,13 @@
                @click="handleUpdate(scope.row)"
                v-hasPermi="['system:user:edit']"
              >修改</el-button>
              <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
                <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item command="handleResetPwd" icon="el-icon-key"
                    v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </template>
@@ -121,27 +121,27 @@
    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body @close="handleClose">
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
      <el-row>
         <el-col :span="12" >
           <el-form-item label="选家族号" prop="clanId">
             <el-select v-model="form.clanId"   placeholder="请输入家族名称">
         <el-option
           v-for="item in famOptions"
           :key="item.clanId"
           :label="item.clanName"
           :value="item.clanId"
         ></el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="角色" prop="role"  >
             <el-select v-model="form.roleId" placeholder="请选择角色" @change="changeRole">
               <el-option
                 v-for="item in roleOptions"
                 :key="item.roleId"
@@ -152,7 +152,7 @@
             </el-select>
           </el-form-item>
         </el-col>
      </el-row>
        <el-row v-if="!isShowAn">
          <el-col :span="12">
@@ -161,8 +161,8 @@
            </el-form-item>
          </el-col>
   <el-col :span="12">
     <el-form-item label="用户性别">
       <el-select v-model="form.sex" placeholder="请选择性别">
     <el-form-item label="祖先">
       <el-select v-model="form.sex" placeholder="请选择祖先">
         <el-option
           v-for="dict in dict.type.sys_user_sex"
           :key="dict.value"
@@ -181,8 +181,8 @@
            </el-form-item>
          </el-col>
   <el-col :span="12">
     <el-form-item label="用户性别">
       <el-select v-model="form.sex" placeholder="请选择性别">
     <el-form-item label="性别">
       <el-select v-model="form.sex" placeholder="请选择">
         <el-option
           v-for="dict in dict.type.sys_user_sex"
           :key="dict.value"
@@ -203,8 +203,8 @@
          </el-form-item>
        </el-col>
  <el-col :span="12">
    <el-form-item label="祖先性别">
      <el-select v-model="form.fsex" placeholder="请选择性别">
    <el-form-item label="性别">
      <el-select v-model="form.fsex" placeholder="请选择">
        <el-option
          v-for="dict in dict.type.sys_user_sex"
          :key="dict.value"
@@ -214,10 +214,10 @@
      </el-select>
    </el-form-item>
  </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -328,10 +328,10 @@
        name: undefined,
        role: undefined,
        sex: undefined,
      },
      // 列信息
      // 表单校验
      rules: {
        userName: [
@@ -400,7 +400,7 @@
      }
      else
      {
         this.isShowAn = true;
         this.isShowAn = true;
      }
      return;
   },
@@ -411,7 +411,7 @@
         this.famOptions = response.data
      })
   },
    // 关闭弹窗后
    handleClose(){
      this.pOID = ''
@@ -465,13 +465,13 @@
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        name: undefined,
      fname: undefined,
      fsex: undefined,
@@ -484,14 +484,23 @@
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.resetForm("queryForm");
      this.queryParams.deptId = undefined;
      this.$refs.tree.setCurrentKey(null);
     this.queryParams = {
       pageNum: 1,
       pageSize: 10,
       name: undefined,
       role: undefined,
       sex: undefined,
     },
     // this.$refs.tree.setCurrentKey(null);
      this.handleQuery();
    },
    // 多选框选中数据
@@ -522,7 +531,7 @@
    //   getUser().then(response => {
    //     this.postOptions = response.posts;
    //     // this.roleOptions = response.roles;
        // console.log(this.roleOptions,'roleOptionsroleOptionsroleOptions')
        // console.log("0-009888")
    //     this.open = true;
@@ -533,22 +542,25 @@
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.a = 2
      this.pOID = row.userId
     console.log(row)
     console.log("000000000--")
      this.pOID = row.id
      this.sex = row.sex
    //  this.getSex();
      this.reset();
      const userId = row.userId || this.ids;
     this.cuid= row.userId || this.ids;
      const userId = row.id || this.ids;
     this.cuid= row.id || this.ids;
      //  this.fid = response.data.familyId
   // alert(userId)
        //alert(this.fid)
      getUser(userId).then(response => {
        this.form = response.data;
        console.log(response.data,'formformformformform')
        console.log(this.form.spouseId,'伴侣id')
     //   console.log(this.form.spouseId,'伴侣id')
        this.postOptions = response.posts;
        this.roleOptions= []
        this.roleOptions.push(response.roles[1])
        this.roleOptions.push(response.roles[3])
        // this.roleOptions= []
        // this.roleOptions.push(response.roles[1])
        // this.roleOptions.push(response.roles[3])
        // this.roleOptions = response.roles;
        console.log(this.roleOptions,'roleOptionsroleOptionsroleOptions')
        // this.$set(this.form, "postIds", response.postIds);
@@ -585,7 +597,7 @@
        );
        this.open = true;
        this.title = "修改用户";
        this.title = "添加用户";
        this.form.password = "";
      });
    },
@@ -614,7 +626,7 @@
    submitForm: function() {
      this.$refs["form"].validate(valid => {
        let _this = this
          let fm = {}
@@ -667,8 +679,8 @@
              });
            }
            }
      });
    },
    /** 删除按钮操作 */