Browse Source

学校添加用户区域id改为当前学校所在区域id

gzb
guozhongbo 7 months ago
parent
commit
3c9bf7b341

+ 4
- 1
src/store/index.js View File

13
       regionids: [],
13
       regionids: [],
14
       // 进入的学校
14
       // 进入的学校
15
       schoolid: null,
15
       schoolid: null,
16
+      // 当前学校区域id
17
+      schoolRegid: null,
16
       // 所属位置(所属区域、所属学校)
18
       // 所属位置(所属区域、所属学校)
17
       belong: []
19
       belong: []
18
     }
20
     }
95
       );
97
       );
96
     },
98
     },
97
     // 进入学校设置跳转痕迹
99
     // 进入学校设置跳转痕迹
98
-    setEnterSchoolPower(state, { schoolid, schoolName }) {
100
+    setEnterSchoolPower(state, { regionid, schoolid, schoolName }) {
101
+      state.userPower.schoolRegid = regionid; //当前学校区域id
99
       state.userPower.schoolid = schoolid;
102
       state.userPower.schoolid = schoolid;
100
       state.userPower.belong.push(schoolName);
103
       state.userPower.belong.push(schoolName);
101
       localStorage.setItem(
104
       localStorage.setItem(

+ 1
- 0
src/views/regionSection/regionManage/schoolManage.vue View File

743
     // 进入学校
743
     // 进入学校
744
     toSchool(row) {
744
     toSchool(row) {
745
       this.$store.commit("setEnterSchoolPower", {
745
       this.$store.commit("setEnterSchoolPower", {
746
+        regionid: row.regionid,
746
         schoolid: row.schoolid,
747
         schoolid: row.schoolid,
747
         schoolName: row.schoolName
748
         schoolName: row.schoolName
748
       });
749
       });

+ 4
- 6
src/views/schoolSection/userManage/userManage.vue View File

776
         this.form_data = new FormData();
776
         this.form_data = new FormData();
777
         this.form_data.append("file", file);
777
         this.form_data.append("file", file);
778
         this.form_data.append("schoolid", this.powerParams.objectid);
778
         this.form_data.append("schoolid", this.powerParams.objectid);
779
-        let _regionids = this.$store.state.userPower.regionids;
780
-        _regionids = [..._regionids];
781
-        this.form_data.append("regionid", _regionids.pop());
779
+        let regionid = this.$store.state.userPower.schoolRegid;
780
+        this.form_data.append("regionid", regionid);
782
       } else {
781
       } else {
783
         this.importInfo.file = null;
782
         this.importInfo.file = null;
784
         this.$Message.error("请上传excel文件");
783
         this.$Message.error("请上传excel文件");
850
             this.$Message.error("请选择班级!");
849
             this.$Message.error("请选择班级!");
851
             return;
850
             return;
852
           }
851
           }
853
-          let _regionids = this.$store.state.userPower.regionids;
854
-          _regionids = [..._regionids];
852
+          let regionid = this.$store.state.userPower.schoolRegid;
855
           let form = {
853
           let form = {
856
             username: this.addInfo.username,
854
             username: this.addInfo.username,
857
             loginname: this.addInfo.loginname,
855
             loginname: this.addInfo.loginname,
859
             loginpwd: this.addInfo.loginpwd,
857
             loginpwd: this.addInfo.loginpwd,
860
             rtype: this.powerParams.rtype,
858
             rtype: this.powerParams.rtype,
861
             objectid: this.powerParams.objectid,
859
             objectid: this.powerParams.objectid,
862
-            regionid: _regionids.pop(),
860
+            regionid: regionid,
863
             schoolid: this.powerParams.objectid,
861
             schoolid: this.powerParams.objectid,
864
             enabled: this.addInfo.enabled,
862
             enabled: this.addInfo.enabled,
865
             studentno: this.addInfo.studentno,
863
             studentno: this.addInfo.studentno,

Loading…
Cancel
Save