Ver código fonte

修改辅导院管理

plg 7 meses atrás
pai
commit
5c2e5cf7db

+ 28 - 9
src/components/instructorRegister.vue

@@ -194,7 +194,7 @@ export default {
             for (let i = 0; i < res.data.length; i++) {
               //
               let obj = {
-                value: `'${res.data[i].id}'`,
+                value: `${res.data[i].orgNo}`,
                 label: res.data[i].orgName,
                 disabled: res.data[i].isOptional == "1" ? false : true,
               };
@@ -385,9 +385,8 @@ export default {
           let listTmp = [];
           for (let i = 0; i < res.data.gradeEntities.length; i++) {
             //
-            listTmp.push(res.data.gradeEntities[i].id);
+            listTmp.push(res.data.gradeEntities[i].orgNo);
           }
-
           this.ruleForm.studentNumber = res.data.userNo;
           //回显姓名
           this.ruleForm.name = res.data.userName;
@@ -462,17 +461,25 @@ export default {
       //   console.log(this.ruleForm.group);
       let that = this;
       console.log("grade");
-
       //   gradeList
       let list = this.gradeList.filter((item) => {
-        return this.ruleForm.grade.includes(item.id);
+        return this.ruleForm.grade.includes(item.orgNo);
       });
-      console.log(list);
+      let listTm = [];
+      for (let i = 0; i < list.length; i++) {
+        let obj = {
+          orgName: list[i].orgName,
+          orgNo: list[i].orgNo,
+          parentOrgNo: list[i].parentOrgNo,
+        };
+        listTm.push(obj);
+      }
+      //   console.log(list);
       // this.ruleForm.password = md5(this.ruleForm.password);
       this.$http.post(
         `/user/addOrUpdateUser`,
         {
-          gradeEntities: list,
+          gradeEntities: listTm,
           orgNo: this.userInfo.orgNo,
           orgName: this.userInfo.orgName,
           userNo: this.ruleForm.studentNumber,
@@ -503,12 +510,24 @@ export default {
     editUserFun() {
       let that = this;
       let list = this.gradeList.filter((item) => {
-        return this.ruleForm.grade.includes(item.id);
+        return this.ruleForm.grade.includes(item.orgNo);
       });
+      console.log(list);
+      console.log(this.gradeList);
+      console.log(this.ruleForm.grade);
+      let listTm = [];
+      for (let i = 0; i < list.length; i++) {
+        let obj = {
+          orgName: list[i].orgName,
+          orgNo: list[i].orgNo,
+          parentOrgNo: list[i].parentOrgNo,
+        };
+        listTm.push(obj);
+      }
       //   this.queryOrgName();
       //   this.userDetailData.orgNo = this.ruleForm.group[this.ruleForm.group.length - 1];
       //   this.userDetailData.orgName = this.groupName;
-      this.userDetailData.gradeEntities = list;
+      this.userDetailData.gradeEntities = listTm;
       this.userDetailData.userName = this.ruleForm.name;
       this.userDetailData.gender = this.ruleForm.sex;
       this.userDetailData.userNo = this.ruleForm.studentNumber;

+ 48 - 38
src/views/manage/channelInfo/channelInfo.vue

@@ -17,7 +17,6 @@
               placeholder="请选择组织架构"
               v-model="group"
               :options="groupData"
-         
               clearable
             ></el-cascader>
             <!-- :props="{ checkStrictly: true }" -->
@@ -52,7 +51,14 @@
             <!-- <el-button type="success" round class="add_class" @click="fileVisible = true"
               >批量导入</el-button
             > -->
-            <el-button type="success" class="add_class" icon="el-icon-plus" round @click="addUser">添加管理员</el-button>
+            <el-button
+              type="success"
+              class="add_class"
+              icon="el-icon-plus"
+              round
+              @click="addUser"
+              >添加管理员</el-button
+            >
           </div>
         </el-col>
       </el-row>
@@ -355,18 +361,16 @@ export default {
   methods: {
     //文件上传成功
     fileSuccess(res) {
-  
-
       if (res.code == 200) {
         this.searchTarget();
         this.$message({
-          message:res.msg,
+          message: res.msg,
           type: "success",
         });
-      }else{
+      } else {
         this.$message({
-          message:res.msg,
-          type: 'error',
+          message: res.msg,
+          type: "error",
         });
       }
       //查询列表
@@ -405,41 +409,45 @@ export default {
     },
     //每页多少条
     handleSizeChange(val) {
-      this.pageSize=val;
-      this.searchTarget()
+      this.pageSize = val;
+      this.searchTarget();
       // console.log(`每页 ${val} 条`);
       //将首页重置为1时---且总条数变化
       //设置为当前总条数
     },
     //获取组织架构方法--------------------开始-----------------------
     getChannel() {
-      this.$http.get(`/org/findAllOrgByPOrgNo?orgNo=${this.userInfo.orgNo}`, {}, (res) => {
-        //  this.$toast.success({message:'成功'});
-        if (res && res.code == 200) {
-          //将值赋值给list
-          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);
-
-            let listTmp =resultRes[0].children;
-            for(let i=0;i<listTmp.length;i++){
-              delete listTmp[i].children
+      this.$http.get(
+        `/org/findAllOrgByPOrgNo?orgNo=${this.userInfo.orgNo}`,
+        {},
+        (res) => {
+          //  this.$toast.success({message:'成功'});
+          if (res && res.code == 200) {
+            //将值赋值给list
+            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);
+
+              let listTmp = resultRes[0].children;
+              for (let i = 0; i < listTmp.length; i++) {
+                delete listTmp[i].children;
+              }
+              this.groupData = listTmp;
+            } else {
+              this.groupData = [];
             }
-            this.groupData = listTmp;
+            // this.channelList = res.data;
           } else {
-            this.groupData = [];
+            this.$message.error(res.msg);
           }
-          // this.channelList = res.data;
-        } else {
-          this.$message.error(res.msg);
         }
-      });
+      );
     },
     //z增加
     addPro(val) {
@@ -552,13 +560,15 @@ export default {
     },
     //根据现有情况进行搜索
     searchList() {
-      let url = `/user/findAdminUserListByPage?pageSize=${this.pageSize}&pageNum=${
+      let url = `/user/findUserListByPage?pageSize=${this.pageSize}&pageNum=${
         this.pageNum
+      }&roleType=4${
+        this.group.length == 0
+          ? `&orgNo=${this.userInfo.orgNo}`
+          : `&orgNo=${this.group[this.group.length - 1]}`
       }${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.name == "" ? "" : `&userName=${this.name}`
+      }${this.studentNumber == "" ? "" : `&userNo=${this.studentNumber}`}`;
       this.$http.get(url, {}, (res) => {
         console.log(res);
         if (res && res.code == 200) {