11wqe1 1 nedēļu atpakaļ
vecāks
revīzija
825ce9ea5f

+ 2 - 2
src/common/apiConfig.js

@@ -133,8 +133,8 @@ export const API_CONFIG = {
   getKanbanTeaManagedata: {
     functionName: "getKanbanTeaManagedata", // 存储过程名称
   },
-  getliyuanSchoolpid: {
-    functionName: "getliyuanSchoolpid", // 存储过程名称
+  getliyuanorgPid: {
+    functionName: "getliyuanorgPid", // 存储过程名称
   },
 
   // 获取所有记录接口(综合了待审核、已通过、已拒绝的数据)

+ 8 - 8
src/components/schoolArea.vue

@@ -8,7 +8,7 @@
 		<div v-if="fromL.admin.school">
 			<div
 				class="priSchBox"
-				v-for="(i, index) in fromL.admin.school.list"
+				v-for="(i, index) in schList"
 				:key="index + 'a'"
 			>
 				<div class="primarySch" @click="cutS(item.schoolid)">
@@ -34,7 +34,7 @@
 import { mapGetters } from "vuex";
 
 export default {
-	props: ["schId","schOrg"],
+	props: ["schId","schOrg",'schList'],
 	data() {
 		return {
 			activeSchool: "",
@@ -53,15 +53,15 @@ export default {
 		cutS(val) {
 			console.log('cuts',val);
 			
-			if (
-				this.userinfo.role == 1 &&
-				this.userinfo.rrole == 1 &&
-				this.userinfo.type == 1
-			) {
+			// if (
+			// 	this.userinfo.role == 1 &&
+			// 	this.userinfo.rrole == 1 &&
+			// 	this.userinfo.type == 1
+			// ) {
 				this.activeSchool = val.schoolid;
 				this.schorg = val.orgid
 				this.$emit("cutSch",{ oid:val.schoolid, org :val.orgid});
-			}
+			// }
 		},
 	},
 	mounted() {

+ 3 - 0
src/store/modules/user.js

@@ -126,6 +126,9 @@ const actions = {
             // var _user = { userid: "a9c5c04d-1b6f-11f0-a66a-005056924926" }; //刘玉彤
             // var _user = { userid: "5943e08c-b7d4-11ed-8d51-005056b86db5" }; //cs111
             // var _user = { userid: "6c56ec0e-2c74-11ef-bee5-005056b86db5" }; //qgt
+            // var _user = { userid: "4fda23d4-1b6f-11f0-a66a-005056924926" }; //管理员
+            // var _user = { userid: "17c14552-41ee-11f0-b60f-005056924926" }; //普通
+
             // commit("SET_ID", _user.userid);
             // commit("SET_TOKEN", _user.userid);
             // setToken(_user.userid);

+ 7 - 6
src/views/kanBan/components/AschoolFeature.vue

@@ -21,7 +21,7 @@
 
 				<div>
 					<img
-						v-if="userinfo.role == 1 && userinfo.type == 1"
+						v-if="userinfo.rrole == 1 || (userinfo.role == 1 && userinfo.organizeid == schId)"
 						class="topTitEdit"
 						@click="editregion(0)"
 						src="../../../assets/img/bianji.svg"
@@ -82,7 +82,7 @@
 				</div>
 				<div>
 					<img
-						v-if="userinfo.role == 1 && userinfo.type == 1"
+						v-if="userinfo.rrole == 1 || (userinfo.role == 1 && userinfo.organizeid == schId)"
 						class="topTitEdit"
 						@click="editregion(1)"
 						src="../../../assets/img/bianji.svg"
@@ -140,7 +140,7 @@
 				</div>
 				<div>
 					<img
-						v-if="userinfo.role == 1 && userinfo.type == 1"
+						v-if="userinfo.rrole == 1 || (userinfo.role == 1 && userinfo.organizeid == schId)"
 						class="topTitEdit"
 						@click="editregion(2)"
 						src="../../../assets/img/bianji.svg"
@@ -202,6 +202,7 @@
 				<div style="display: flex; justify-content: space-between">
 					<div></div>
 					<div
+						v-if="userinfo.rrole == 1 || (userinfo.role == 1 && userinfo.organizeid == schId)"
 						style="
 							display: flex;
 							justify-content: space-between;
@@ -317,7 +318,7 @@
 					</div>
 				</div>
 			</div>
-			<div class="FedialogJIa" style="display: flex" @click="lookMore()">
+			<div v-if="userinfo.rrole == 1 || (userinfo.role == 1 && userinfo.organizeid == schId)" class="FedialogJIa" style="display: flex" @click="lookMore()">
 				<div style="width: 100%; border: 1px #000 dashed; cursor: pointer">
 					<img src="../../../assets/kanban/jia.svg" alt="" />
 				</div>
@@ -340,7 +341,7 @@
 						></div>
 					</div>
 					
-					<div v-if="userinfo.role == 1 && userinfo.type == 1" style="display: flex;gap: 10px;">
+					<div v-if="userinfo.rrole == 1 || (userinfo.role == 1 && userinfo.organizeid == schId)" style="display: flex;gap: 10px;">
 						<img
 							class="topTitEdit"
 							@click="editregion(4,index)"
@@ -387,7 +388,7 @@
 			</div>
 		</template>
 		
-		<template v-if="userinfo.role == 1 && userinfo.type == 1">
+		<template v-if="userinfo.rrole == 1 || (userinfo.role == 1 && userinfo.organizeid == schId)">
 			<div class="feature">
 				<div class="topTit">
 					<div>

+ 28 - 49
src/views/kanBan/index.vue

@@ -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) {