|
@@ -45,8 +45,8 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="mainArea">
|
|
|
- <div v-if="(isActive === 1 || isActive === 2) && fromL.admin.school.list.length">
|
|
|
- <schoolArea :schId="schId" :schOrg="schOrg" @cutSch="cutSch"/>
|
|
|
+ <div v-if="(isActive === 1 || isActive === 2) && userinfo.role == 1 && schList.length">
|
|
|
+ <schoolArea :schId="schId" :schOrg="schOrg" :schList="schList" @cutSch="cutSch"/>
|
|
|
</div>
|
|
|
|
|
|
<div class="right_content">
|
|
@@ -111,7 +111,8 @@ export default {
|
|
|
isActive: 1,
|
|
|
isIndex2:'',
|
|
|
schId:'',
|
|
|
- schOrg:''
|
|
|
+ schOrg:'',
|
|
|
+ schList:[]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -153,50 +154,27 @@ export default {
|
|
|
// 取消操作
|
|
|
});
|
|
|
},
|
|
|
- async getliyuanOpid(){
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- let params = [
|
|
|
- {
|
|
|
- functionName: API_CONFIG.getliyuanorgPid.functionName,
|
|
|
- org:this.userinfo.org
|
|
|
- },
|
|
|
- ];
|
|
|
+ // 查询同级查询学校列表
|
|
|
+ getSchoolList(){
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ functionName: API_CONFIG.getliyuanorgPid.functionName,
|
|
|
+ org:this.userinfo.org
|
|
|
+ },
|
|
|
+ ];
|
|
|
|
|
|
- this.$ajax
|
|
|
- .post(API_CONFIG.baseUrl, params)
|
|
|
- .then((res) => {
|
|
|
- resolve(res)
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.log(err);
|
|
|
- reject(err)
|
|
|
- this.$message.error("获取校区栏失败");
|
|
|
- });
|
|
|
- })
|
|
|
- },
|
|
|
- // 查询学校列表
|
|
|
- async getSchoolList(){
|
|
|
- await this.getliyuanpid()
|
|
|
-
|
|
|
-
|
|
|
- // let params = [
|
|
|
- // {
|
|
|
- // functionName: API_CONFIG.getliyuanSchoolpid.functionName,
|
|
|
- // pid:''
|
|
|
- // },
|
|
|
- // ];
|
|
|
+ this.$ajax
|
|
|
+ .post(API_CONFIG.baseUrl, params)
|
|
|
+ .then((res) => {
|
|
|
+ let data = JSON.parse(res.data[0][0].json).admin.school.list
|
|
|
+ console.log('res',data);
|
|
|
|
|
|
- // this.$ajax
|
|
|
- // .post(API_CONFIG.baseUrl, params)
|
|
|
- // .then((res) => {
|
|
|
- // this.usuallyList = res.data[0];
|
|
|
- // this.loading = false;
|
|
|
- // })
|
|
|
- // .catch((err) => {
|
|
|
- // console.log(err);
|
|
|
- // this.loading = false;
|
|
|
- // this.$message.error("获取工具数据失败");
|
|
|
- // });
|
|
|
+ this.schList = data
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ this.$message.error("获取校区栏失败");
|
|
|
+ });
|
|
|
},
|
|
|
// 导航栏切换
|
|
|
setActive(Index) {
|
|
@@ -210,11 +188,12 @@ export default {
|
|
|
if (this.userinfo.role == 1
|
|
|
&& this.userinfo.rrole == 1
|
|
|
&& this.userinfo.type ==1
|
|
|
- && this.fromL.admin.school.list
|
|
|
+ && this.fromL.admin.school.list //判断这个是,一般默认为展示第一个校区,没有校区的话展示自己的校区
|
|
|
&& this.fromL.admin.school.list[0]
|
|
|
&& this.fromL.admin.school.list[0].children
|
|
|
&& this.fromL.admin.school.list[0].children.length) {
|
|
|
console.log('111');
|
|
|
+ this.schList = this.fromL.admin.school.list
|
|
|
this.schId = this.fromL.admin.school.list[0].children[0].schoolid
|
|
|
this.schOrg = this.fromL.admin.school.list[0].children[0].orgid
|
|
|
}else{
|
|
@@ -224,9 +203,9 @@ export default {
|
|
|
}
|
|
|
|
|
|
// 查询组织pid
|
|
|
- // if (this.userinfo.org) {
|
|
|
- // this.getSchoolList()
|
|
|
- // }
|
|
|
+ if (this.userinfo.org && !this.fromL.admin.school.list[0]) {
|
|
|
+ this.getSchoolList()
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if (index == 2) {
|