Browse Source

修改单个注册--以及用户编辑

plg 7 months ago
parent
commit
4a10835c95
3 changed files with 408 additions and 205 deletions
  1. 296 156
      src/components/Register.vue
  2. 1 2
      src/utils/http.js
  3. 111 47
      src/views/manage/userManage.vue

+ 296 - 156
src/components/Register.vue

@@ -1,79 +1,81 @@
 <template>
   <div>
-    <el-dialog
-      :title="isView ? '用户新增' : '用户编辑'"
-      :visible.sync="dialogVisible"
-      :before-close="cancle"
-      width="60%"
-    >
-      <el-form
-        :inline="true"
-        :model="ruleForm"
-        :rules="rules"
-        ref="ruleForm"
-        label-width="120px"
-        class="demo-ruleForm"
+    <!---lxh-修改密码-->
+    <div class="dig_update">
+      <el-dialog
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        width="40%"
+        style="border-radius: 40px"
       >
-        <el-row>
-          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <el-form-item label="用户名" prop="name">
-              <el-input
-                :disabled="!isView"
-                v-model="ruleForm.name"
-                class="inputCom"
-              ></el-input>
+        <div slot="title">
+          <el-form
+            :model="ruleForm"
+            :rules="rules"
+            :inline="true"
+            ref="ruleForm"
+            label-width="150px"
+            class="demo-ruleForm"
+          >
+            <p v-if="isView" class="dig_title">单独注册</p>
+            <p v-if="!isView" class="dig_title">编辑</p>
+            <div slot=""></div>
+            <div slot="footer"></div>
+            <el-form-item label="所属组织架构" prop="group">
+              <el-cascader
+                placeholder="请选择组织架构"
+                v-model="ruleForm.group"
+                :options="groupData"
+               :show-all-levels="false"
+                clearable
+              ></el-cascader>
             </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <el-form-item label="用户昵称" prop="userName">
-              <el-input v-model="ruleForm.userName" class="inputCom"></el-input>
+            <el-form-item label="学号" prop="studentNumber">
+              <el-input v-model="ruleForm.studentNumber"></el-input>
             </el-form-item>
-          </el-col>
-          <el-col :xs="24" v-show="isView" :sm="24" :md="12" :lg="12" :xl="12">
-            <el-form-item label="密码" prop="password">
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="姓名" prop="name">
+                  <el-input v-model="ruleForm.name" autocomplete="off"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="性别" prop="name">
+                  <el-radio-group v-model="ruleForm.sex" style="margin-left: 20px">
+                    <el-radio label="1">男</el-radio>
+                    <el-radio label="0">女</el-radio>
+                  </el-radio-group>
+                </el-form-item>
+              </el-col>
+            </el-row>
+        
+            <el-form-item  v-if="isView"  label="密码" prop="password">
               <el-input
-                v-model="ruleForm.password"
                 type="password"
-                placeholder="请输入密码"
-                autocomplete="new-password"
-                class="inputCom"
+                v-model="ruleForm.password"
+                autocomplete="off"
               ></el-input>
             </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <el-form-item label="所属渠道" prop="channel">
-              <el-select v-model="ruleForm.channel" placeholder="请选择渠道">
-                <el-option
-                  :label="item.name"
-                  :value="item.id"
-                  v-for="item in channelList"
-                  :key="item.id"
-                ></el-option>
-              </el-select>
+            <el-form-item  v-if="isView"  label="确认密码" prop="comPassword">
+              <el-input
+                type="password"
+                v-model="ruleForm.comPassword"
+                autocomplete="off"
+              ></el-input>
             </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button type="info" round @click="cancle">取 消</el-button>
-        <el-button
-          v-show="isView"
-          type="primary"
-          round
-          :disabled="disableFlag"
-          @click="submitCom"
-          >确 定</el-button
-        >
-        <el-button
-          v-show="!isView"
-          type="primary"
-          round
-          :disabled="disableFlag"
-          @click="submitCom"
-          >修 改</el-button
-        >
-      </span>
-    </el-dialog>
+            <div class="dig_button">
+              <el-button type="info" round @click="resetForm('ruleForm')">重置</el-button>
+              <!-- <el-button type="success" round @click="submitForm('ruleForm')"
+                >提交</el-button
+              > -->
+              <el-button type="success" round @click="submitCom()"
+                >提交</el-button
+              >
+            </div>
+          </el-form>
+        </div>
+      </el-dialog>
+    </div>
   </div>
 </template>
 <script>
@@ -91,6 +93,18 @@ export default {
         callback();
       }
     };
+    var validateComPass = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("请输入密码"));
+      } else if (value.length < 6) {
+        callback(new Error("密码至少6位"));
+      } else if (value !== this.ruleForm.password) {
+        callback(new Error("两次密码不一致"));
+        // callback();
+      } else {
+        callback();
+      }
+    };
     var validatePhone = (rule, value, callback) => {
       let myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
       if (value === "") {
@@ -102,6 +116,25 @@ export default {
       }
     };
     return {
+      //编辑返回的值
+      userDetailData:{},
+      //组织架构名字
+      groupName: "",
+      ppData: [],
+      groupData: [],
+      options: [
+        {
+          value: "1",
+          label: "选项1",
+          children: [
+            {
+              value: "11",
+              label: "选项11",
+              children: [{ value: "111", label: "选项111" }],
+            },
+          ],
+        },
+      ],
       disableFlag: false,
       phoneFlag: false,
       flag: 3,
@@ -109,25 +142,26 @@ export default {
       //渠道列表
       channelList: [{ name: "渠道天成", id: "1" }],
       ruleForm: {
-        id: "",
+        //所属组织架构
+        group: "",
+        //学号
+        studentNumber: "",
+        //姓名
         name: "",
-        userName: "",
+        //性别
+        sex: "",
+        //密码
         password: "",
-        channel: "",
-        channelId: "",
-        openId: "",
-        phone: "",
-        photoPath: "",
-        state: "",
-        type: "",
+        comPassword: "",
       },
       isView: true,
       rules: {
-        name: [{ required: true, message: "请输入用户名称", trigger: "blur" }],
-        userName: [{ required: true, message: "请输入用户昵称", trigger: "blur" }],
+        group: [{ required: true, message: "请选择组织架构", trigger: "blur" }],
+        studentNumber: [{ required: true, message: "请输入学号", trigger: "blur" }],
+        name: [{ required: true, message: "请输入学号", trigger: "blur" }],
         // password: [{ required: true, message: "请输密码", trigger: "blur" }],
         password: [{ required: true, validator: validatePass, trigger: "blur" }],
-        channel: [{ required: true, message: "请输选择渠道", trigger: "change" }],
+        comPassword: [{ required: true, validator: validateComPass, trigger: "blur" }],
       },
     };
   },
@@ -138,39 +172,75 @@ export default {
     //获取渠道信息
 
     // this.ruleForm.type = "3";
-    this.getChannel();
   },
   methods: {
-    //获取渠道信息
+    //获取组织架构方法--------------------开始-----------------------
     getChannel() {
-      this.$http.get(`/channel/findAll`, {}, (res) => {
+      this.$http.get(`/org/findAllOrgByPOrgNo`, {}, (res) => {
         //  this.$toast.success({message:'成功'});
         if (res && res.code == 200) {
+          debugger;
           //将值赋值给list
-          this.channelList = res.data;
+          if (res.data.length > 0) {
+            let resAdd = this.addPro(res.data);
+            this.ppData = JSON.parse(JSON.stringify(resAdd));
+            let forRes = this.arrToTree(resAdd);
+            // console.log('格式化的结构')
+            // console.log(forRes)
+            let resultRes = this.deleteChildren(forRes);
+            console.log("格式化的结构且去掉children");
+            console.log(resultRes);
+            this.groupData = resultRes;
+          } else {
+            this.groupData = [];
+          }
+          // this.channelList = res.data;
         } else {
           this.$message.error(res.msg);
         }
       });
     },
-    phoneCheck() {
-      //判断是否重复
-      this.$http.get(`v1/system/checkPhone/${this.ruleForm.phone}`, {}, (res) => {
-        //  this.$toast.success({message:'成功'});
-        if (res && res.code == 200) {
-          if (res.data) {
-            this.phoneFlag = true;
+    //z增加
+    addPro(val) {
+      let data = JSON.parse(JSON.stringify(val));
+      for (let i = 0; i < val.length; i++) {
+        data[i].value = val[i].orgNo;
+        data[i].label = val[i].orgName;
+      }
+      return data;
+    },
+    //非递归方式:将平铺数据转换为树形结构数据
+    arrToTree(arr) {
+      let data = arr.filter((item) => {
+        item.children = arr.filter((e) => {
+          return item.orgNo === e.parentOrgNo;
+        });
+        return !item.parentOrgNo;
+      });
+      return data;
+    },
+    //去除转换树形结构数据后存在的空children
+    deleteChildren(arr) {
+      let childs = arr;
+      for (let i = childs.length; i--; i > 0) {
+        if (childs[i].children) {
+          if (childs[i].children.length) {
+            this.deleteChildren(childs[i].children);
           } else {
-            this.phoneFlag = false;
-            // this.$toast.success({ message: "手机号重复" });
-            this.$message.warning("手机号重复");
+            delete childs[i].children;
           }
-        } else {
-          // this.$toast.fail({ message: res.msg });
-          this.$message.error(res.msg);
         }
-      });
+      }
+      return arr;
     },
+    queryOrgName() {
+      for (let i = 0; i < this.ppData.length; i++) {
+        if (this.ruleForm.group[this.ruleForm.group.length-1] == this.ppData[i].orgNo) {
+          this.groupName = this.ppData[i].orgName;
+        }
+      }
+    },
+    //获取组织架构方法--------------------结束-----------------------
     timeChange(val) {
       if (val !== null) {
         //根据时间得到格式化的数据
@@ -194,7 +264,9 @@ export default {
       }
     },
     open(val) {
-      // this.cancle();
+       this.cancle();
+      this.getChannel();
+     
       this.dialogVisible = true;
       this.isView = val;
 
@@ -203,29 +275,55 @@ export default {
       });
     },
     edit(val) {
+      debugger;
+      this.getChannel();
       this.dialogVisible = true;
       this.isView = false;
-      this.ruleForm.id = val.id;
-      this.ruleForm.name = val.name;
-      this.ruleForm.userName = val.userName;
-      this.ruleForm.password = val.password;
-      this.ruleForm.channel = val.channelId;
-      this.ruleForm.channelId = val.channelId;
-      this.ruleForm.openId = val.openId;
-      this.ruleForm.phone = val.phone;
-      this.ruleForm.photoPath = val.photoPath;
-      this.ruleForm.state = val.state;
-      this.ruleForm.type = val.type;
+      this.queryUserDetail(val.id)
+      //调用查询详情的接口
+    },
+    //调用查询详情的接口
+    queryUserDetail(val){
+      let url = `/user/findUserById?id=${val}`
+      
+      this.$http.get(url,
+        {
+        },
+        (res) => {
+          debugger;
+          console.log(res)
+          if (res && res.code == 200) {
+           //获取返回值
+           //根据将数据存储
+           this.userDetailData=res.data;
+           let a =[]
+           for(let i=res.data.orgList.length;i>0;i--){
+                //
+                a.push(res.data.orgList[i-1].orgNo)                      
+           }
+           //回显学号
+           this.ruleForm.studentNumber=res.data.userNo;
+           //回显姓名
+           this.ruleForm.name=res.data.userName
+           //回显性别
+            this.ruleForm.sex=res.data.gender
+           this.ruleForm.group=a;
+          } else {
+            // this.$toast.fail(res.msg);
+            this.$message.error(res.msg);
+          }
+        }
+      );
     },
     cancle() {
       this.$refs["ruleForm"].clearValidate();
       //清空表单
+      this.ruleForm.group = "";
       this.ruleForm.name = "";
-
+      this.ruleForm.studentNumber = "";
       this.ruleForm.password = "";
-      this.ruleForm.userName = "";
-      this.ruleForm.channel = "";
-
+      this.ruleForm.comPassword = "";
+      this.ruleForm.sex = "";
       this.dialogVisible = false;
     },
     disableFlagStatus() {
@@ -240,9 +338,9 @@ export default {
       this.disableFlag = true;
       let validSp = [];
       if (this.isView) {
-        validSp = ["name", "userName", "channel", "password"];
+        validSp = ["group", "studentNumber", "name", "sex", "password", "comPassword"];
       } else {
-        validSp = ["name", "userName", "channel"];
+        validSp = ["group", "studentNumber", "name", "sex"];
       }
       let aa = [];
       this.$refs["ruleForm"].validateField(validSp, (valid) => {
@@ -250,15 +348,15 @@ export default {
           aa.push(valid);
           //判断是编辑还是新增
           if (this.isView) {
-            if (aa.length == 4) {
+            if (aa.length == 6) {
               this.register();
-            }else{
+            } else {
               this.disableFlagStatus();
             }
           } else {
-            if (aa.length == 3) {
+            if (aa.length == 4) {
               this.editUserFun();
-            }else{
+            } else {
               this.disableFlagStatus();
             }
           }
@@ -271,26 +369,28 @@ export default {
       });
     },
     register() {
+      this.queryOrgName();
+     
+      console.log( this.ruleForm.group)
       let that = this;
       // this.ruleForm.password = md5(this.ruleForm.password);
-      let password = md5(this.ruleForm.password);
       this.$http.post(
-        `/user/save`,
+        `/user/addOrUpdateUser`,
         {
-          channelId: this.ruleForm.channel,
-          phone: "",
-          name: this.ruleForm.name,
-          userName: this.ruleForm.userName,
-          password: password,
-          id: "",
-          state: "1",
-          // ...this.ruleForm, //解构对象
+          orgNo:this.ruleForm.group[this.ruleForm.group.length-1] ,
+          orgName: this.groupName,
+          userNo: this.ruleForm.studentNumber,
+          userName: this.ruleForm.name,
+          gender: this.ruleForm.sex,
+          password: md5(this.ruleForm.password),
         },
         (res) => {
+          debugger;
           this.disableFlagStatus();
           // this.disableFlag = false;
           if (res && res.code == 200) {
             this.dialogVisible = false;
+            debugger
             // this.$toast.success({ message: "成功" });
             //调用父组件的查询方法
             that.$emit("search");
@@ -304,34 +404,17 @@ export default {
       );
     },
     editUserFun() {
+      
       let that = this;
-      // this.ruleForm.password = md5(this.ruleForm.password);
-      // let password = md5(this.ruleForm.password);
-      // this.ruleForm.id = val.id;
-      // this.ruleForm.name = val.name;
-      // this.ruleForm.userName = val.userName;
-      // this.ruleForm.password = "";
-      // this.ruleForm.channel = val.channelId;
-      // this.ruleForm.channelId = val.channelId;
-      // this.ruleForm.openId = val.openId;
-      // this.ruleForm.phone = val.phone;
-      // this.ruleForm.photoPath = val.photoPath;
-      // this.ruleForm.state = val.state;
-      // this.ruleForm.type = val.tyep;
+      this.queryOrgName();
+      this.userDetailData.orgNo=this.ruleForm.group[this.ruleForm.group.length-1];
+      this.userDetailData.orgName=this.groupName; 
+      this.userDetailData.userName= this.ruleForm.name;
+      this.userDetailData.gender= this.ruleForm.sex;
       this.$http.post(
-        `/user/save`,
+     `/user/addOrUpdateUser`,
         {
-          id: this.ruleForm.id,
-          name: this.ruleForm.name,
-          userName: this.ruleForm.userName,
-          password: this.ruleForm.password,
-          channelId: this.ruleForm.channel,
-          openId: this.ruleForm.openId,
-          phone: this.ruleForm.phone,
-          photoPath: this.ruleForm.photoPath,
-          state: this.ruleForm.state,
-          type: this.ruleForm.type,
-          // ...this.ruleForm, //解构对象
+        ...this.userDetailData
         },
         (res) => {
           this.disableFlagStatus();
@@ -355,8 +438,65 @@ export default {
   },
 };
 </script>
-<style scoped>
-.inputCom {
-  width: 200px;
+<style lang="less" scoped>
+.dig_update /deep/.el-cascader {
+  position: relative;
+  font-size: 14px;
+  line-height: 40px;
+  width: 100%;
+}
+.dig_update /deep/.el-dialog {
+  box-shadow: none !important;
+  background: transparent !important;
+}
+.demo-ruleForm /deep/ .el-form-item {
+  margin-right: 10px;
+  vertical-align: top;
+  display: flex !important;
+  flex-direction: column;
+}
+.demo-ruleForm /deep/.el-form-item__label {
+  text-align: left;
+  vertical-align: middle;
+  float: left;
+  font-size: 14px;
+  color: #606266;
+  line-height: 40px;
+  padding: 0 12px 0 0;
+  -webkit-box-sizing: border-box;
+  box-sizing: border-box;
+}
+
+.demo-ruleForm /deep/.el-input {
+  width: 100% !important;
+}
+
+.demo-ruleForm /deep/.el-input__inner {
+  width: 100% !important;
+  background-color: #f7f7f7;
+  border: 0px;
+}
+
+.dig_button {
+  display: flex;
+  width: 100%;
+  justify-content: space-around;
+}
+
+.demo-ruleForm {
+  background-color: #ffffff;
+  // border-radius: 20px;
+  margin-right: -10px;
+  margin-top: -10px;
+  padding-right: 100px;
+  padding-left: 100px;
+  border-radius: 20px;
+  padding-top: 20px;
+  padding-bottom: 40px;
+  .dig_title {
+    margin-bottom: 30px;
+    text-align: center;
+    font-weight: 700;
+  }
 }
 </style>

+ 1 - 2
src/utils/http.js

@@ -134,7 +134,6 @@ const http = {
       } else {
         // res.data = JSON.parse(res.data);
       }
-      debugger
       if (sCallBack) {
         sCallBack(res.data);
       }
@@ -192,7 +191,7 @@ const http = {
         if (isMI) {
           res.data = JSON.parse(Decrypt(res.data));
         }else{
-          res.data = JSON.parse(res.data);
+          // res.data = JSON.parse(res.data);
         }
       }
 

+ 111 - 47
src/views/manage/userManage.vue

@@ -7,11 +7,16 @@
             <el-input v-model="name" clearable placeholder="请输入姓名"></el-input
             >&nbsp;&nbsp;&nbsp;&nbsp;
 
-            <el-input v-model="userName" clearable placeholder="请输入学号"></el-input
+            <el-input
+              v-model="studentNumber"
+              clearable
+              placeholder="请输入学号"
+            ></el-input
             >&nbsp;&nbsp;&nbsp;&nbsp;
-            <el-cascader placeholder="请选择组织架构"
-             v-model="group"
-              :options="options"
+            <el-cascader
+              placeholder="请选择组织架构"
+              v-model="group"
+              :options="groupData"
               :props="{ checkStrictly: true }"
               clearable
             ></el-cascader>
@@ -65,30 +70,17 @@
           </el-table-column> -->
           <el-table-column
             show-overflow-tooltip
-            prop="name"
-            label="用户名"
+            prop="userName"
+            label="名"
             align="center"
             width=""
           >
           </el-table-column>
-          <el-table-column prop="userName" label="用户昵称" align="center" width="">
+          <el-table-column prop="userNo" label="学号" align="center" width="">
           </el-table-column>
-          <!-- <el-table-column prop="state" label="用户状态" align="center" :formatter="formatterDelete" width="">
-          </el-table-column> -->
-          <el-table-column
-            prop="channelName"
-            label="所属渠道"
-            align="center"
-            width=""
-          ></el-table-column>
-          <el-table-column
-            prop="type"
-            label="所属角色"
-            align="center"
-            width=""
-            :formatter="formatterRole"
-            show-overflow-tooltip
-          >
+          <el-table-column prop="gender" label="性别" align="center" width="" :formatter="genderFun">
+          </el-table-column>
+          <el-table-column prop="orgName" label="所属组织架构" align="center" width="">
           </el-table-column>
           <el-table-column label="操作" width="510px" align="center">
             <template slot-scope="scope">
@@ -193,10 +185,31 @@ export default {
   },
   data() {
     return {
-      group:'',
-      options:[{value:'1',label:"选项1",children:[{value:'11',label:'选项11',children:[{value:'111',label:'选项111'}]}]}],
-      // sex: "1",
+      //根据名称搜索
+      name: "",
+      //搜索的用户编号
+      studentNumber: "",
+      //搜索的组织架构
+      // 搜索需要的性别
       sex: "",
+
+      group: "",
+      ppData: [],
+      groupData: [],
+      options: [
+        {
+          value: "1",
+          label: "选项1",
+          children: [
+            {
+              value: "11",
+              label: "选项11",
+              children: [{ value: "111", label: "选项111" }],
+            },
+          ],
+        },
+      ],
+
       centerDialogVisible: false,
       editUserFlag: false,
       startTime: "",
@@ -209,9 +222,6 @@ export default {
       tableData: [],
       userInfo: {}, //用户信息
       userId: "", //用户id
-      name: "", //根据名称搜索
-      userName: "", //根据昵称搜索
-      hospitalOrDepartment: "", //医院科室
 
       invitationCode: "",
       roleType: "0",
@@ -231,8 +241,6 @@ export default {
   mounted() {
     this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
 
-
-    
     this.getChannel();
     if (!this.userInfo) {
       //如果用户信息不存在跳转登陆页
@@ -241,24 +249,82 @@ export default {
     this.searchTarget();
   },
   methods: {
+    //性别---
+    genderFun(val){
+      let sex =val.gender
+      if(sex=='1'){
+        return '男'
+      }else if (sex=='0'){
+        return '女'
+      }else{
+        return sex
+      }
+    },
     //每页多少条
     handleSizeChange(val) {
       console.log(`每页 ${val} 条`);
       //将首页重置为1时---且总条数变化
       //设置为当前总条数
     },
-    //获取渠道信息
+    //获取组织架构方法--------------------开始-----------------------
     getChannel() {
-      this.$http.get(`/channel/findAll`, {}, (res) => {
+      this.$http.get(`/org/findAllOrgByPOrgNo`, {}, (res) => {
         //  this.$toast.success({message:'成功'});
         if (res && res.code == 200) {
           //将值赋值给list
-          this.channelList = res.data;
+          if (res.data.length > 0) {
+            let resAdd = this.addPro(res.data);
+            this.ppData = JSON.parse(JSON.stringify(resAdd));
+            let forRes = this.arrToTree(resAdd);
+            // console.log('格式化的结构')
+            // console.log(forRes)
+            let resultRes = this.deleteChildren(forRes);
+            console.log("格式化的结构且去掉children");
+            console.log(resultRes);
+            this.groupData = resultRes;
+          } else {
+            this.groupData = [];
+          }
+          // this.channelList = res.data;
         } else {
           this.$message.error(res.msg);
         }
       });
     },
+    //z增加
+    addPro(val) {
+      let data = JSON.parse(JSON.stringify(val));
+      for (let i = 0; i < val.length; i++) {
+        data[i].value = val[i].orgNo;
+        data[i].label = val[i].orgName;
+      }
+      return data;
+    },
+    //非递归方式:将平铺数据转换为树形结构数据
+    arrToTree(arr) {
+      let data = arr.filter((item) => {
+        item.children = arr.filter((e) => {
+          return item.orgNo === e.parentOrgNo;
+        });
+        return !item.parentOrgNo;
+      });
+      return data;
+    },
+    //去除转换树形结构数据后存在的空children
+    deleteChildren(arr) {
+      let childs = arr;
+      for (let i = childs.length; i--; i > 0) {
+        if (childs[i].children) {
+          if (childs[i].children.length) {
+            this.deleteChildren(childs[i].children);
+          } else {
+            delete childs[i].children;
+          }
+        }
+      }
+      return arr;
+    },
+    //获取组织架构方法--------------------结束-----------------------
     formatterDelete(row) {
       if (row.state == 0) {
         return "已删除";
@@ -295,9 +361,13 @@ export default {
     },
     clearSearch() {
       this.name = "";
-      this.userName = "";
+      //搜索的用户编号
+      this.studentNumber = "";
+      //搜索的组织架构
+      // 搜索需要的性别
       this.sex = "";
-      // this.searchTarget();
+      this.group = "";
+      this.searchTarget();
     },
     formatterRole(val) {
       if (val.type == "1") {
@@ -338,21 +408,15 @@ export default {
     },
     //根据现有情况进行搜索
     searchList() {
-      //  let url =``
-      this.$http.post(
-        `/user/find`,
+      let url = `/user/findUserListByPage?pageSize=${this.pageSize}&pageNum=${this.pageNum}${this.sex==''?'': `&gender=${this.sex}`}${this.group.length==0?'': `&orgNo=${this.group[this.group.length-1]}`}${this.name==''?'': `&userName=${this.name}`}${this.studentNumber==''?'': `&userNo=${this.studentNumber}`}`
+      this.$http.get(url
+       ,
         {
-          pageNum: this.pageNum,
-          pageSize: this.pageSize,
-          phone: "",
-          name: this.name,
-          userName: this.userName,
-          channelId: this.channel,
         },
         (res) => {
-          // console.log(res,'用户测试记录')
+          console.log(res)
           if (res && res.code == 200) {
-            this.tableData = res.data.data;
+            this.tableData = res.data.content;
             this.total = res.data.totalElements;
           } else {
             // this.$toast.fail(res.msg);