Browse Source

修改组织架构--及趋势统计的教师组

plg 3 months ago
parent
commit
77456b5216
3 changed files with 105 additions and 37 deletions
  1. 2 2
      src/utils/http.js
  2. 2 2
      src/views/manage/channelInfo/orderSettlement.vue
  3. 101 33
      src/views/manage/tendency.vue

+ 2 - 2
src/utils/http.js

@@ -18,7 +18,7 @@ import { router } from "@/router";
 // axios.defaults.baseURL = 'https://child.hhnao.com:8070';
 //https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx01d1a44906973cf2&redirect_uri=http%3A%2F%2F192.168.18.51%3A8085&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect
 // 少锋本地
-export const basePath = "http://10.113.248.4:8089";
+// export const basePath = "http://10.113.248.4:8089";
 //少锋本地 wifi
 // export const basePath = "http://172.28.50.2:8089";
 //30
@@ -26,7 +26,7 @@ export const basePath = "http://10.113.248.4:8089";
 //红朵服务器
 // export const basePath = "http://129.211.221.44:8089";
 //锦泓税务服务器
-// export const basePath = "http://146.56.226.174:8089";
+export const basePath = "http://146.56.226.174:8089";
 // const base_url = 'http://43.143.198.30:8089/'
 // const base_url = 'http://10.113.248.4:8090/'
 // export const basePath='http://43.143.198.30:8086'

+ 2 - 2
src/views/manage/channelInfo/orderSettlement.vue

@@ -167,7 +167,7 @@ export default {
       let list = [];
       let ji = {
           value: -1 + "",
-          label: -1 + "级(教师)",
+          label: "教师组",
         };
       list.push(ji)
       for (let i = preYear; i < currentYear + 1; i++) {
@@ -264,7 +264,7 @@ export default {
                 extend: "",
                 isOptional: data[j].isOptional,
                 orgDesc: "",
-                orgName: data[j].extend+'级',
+                orgName: data[j].extend==-1?'教师组':`${data[j].extend}级`,
                 orgNo: uniqueId,
                 orgStatus: data[j].orgStatus,
                 parentOrgNo: listYuan[i].orgNo,

+ 101 - 33
src/views/manage/tendency.vue

@@ -448,13 +448,15 @@ export default {
 
     //判断当页面是 isUser为false时需要调用判断方法
     if (!this.isUser) {
-      this.initGroup();
+      this.initGroup(true);
     }
   },
   methods: {
     banChange(val) {
       if (!this.isUser) {
-        this.query4Score();
+        this.year = "";
+        // this.query4Score();
+        this.initGroup(false);
       }
     },
     yearChange(val) {
@@ -651,30 +653,39 @@ export default {
       } else {
         //组织
         //默认选择第一个
-        this.initGroup();
+        this.initGroup(true);
         // this.queryDetailScore();
       }
     },
-    initGroup() {
+    initGroup(val) {
       if (this.userInfo.roleType == "5") {
-        this.group = [this.groupData[0].orgNo, this.groupData[0].children[0].orgNo];
-        // 最新的级数
+        if (val) {
+          this.group = [this.groupData[0].orgNo, this.groupData[0].children[0].orgNo];
+        }
+        //循环当前级
+        let ji = -1;
+        if (val) {
+          ji = parseInt(this.groupData[0].children[0].extend);
+        } else {
+          //循环拿到当前的ji的数据
+
+          for (let i = 0; i < this.channelTmp.length; i++) {
+            //
+
+            if (this.channelTmp[i].orgNo == this.group[this.group.length - 1]) {
+              //
+              ji = parseInt(this.channelTmp[i].extend);
+            }
+          }
+        }
 
-        //orgName
-        let ji = parseInt(this.groupData[0].children[0].extend);
         //获取当前年
         let currentYear = new Date().getFullYear();
         //判断级数是和当前年相同吗
-        if (currentYear == ji) {
-          this.optionsYear = [
-            {
-              label: `${currentYear}年`,
-              value: ji,
-            },
-          ];
-        } else {
+        if (ji == -1) {
+          //则显示近10年
           let list = [];
-          for (let i = ji; i <= currentYear; i++) {
+          for (let i = currentYear - 5; i <= currentYear; i++) {
             let obj = {
               label: `${i}年`,
               value: i,
@@ -682,26 +693,58 @@ export default {
             list.push(obj);
           }
           this.optionsYear = list;
-          // this.year = list[0].value;
+        } else {
+          if (currentYear == ji) {
+            this.optionsYear = [
+              {
+                label: `${currentYear}年`,
+                value: ji,
+              },
+            ];
+          } else {
+            let list = [];
+            for (let i = ji; i <= currentYear; i++) {
+              let obj = {
+                label: `${i}年`,
+                value: i,
+              };
+              list.push(obj);
+            }
+            this.optionsYear = list;
+            // this.year = list[0].value;
+          }
         }
       }
       if (this.userInfo.roleType == "4" || this.userInfo.roleType == "3") {
-        this.group = [this.groupData[0].orgNo];
+        if (val) {
+          this.group = [this.groupData[0].orgNo];
+        }
+
+        let ji = -1;
+        if (val) {
+          ji = parseInt(this.groupData[0].extend);
+        } else {
+          //循环拿到当前的ji的数据
+
+          for (let i = 0; i < this.channelTmp.length; i++) {
+            //
+
+            if (this.channelTmp[i].orgNo == this.group[this.group.length - 1]) {
+              //
+              ji = parseInt(this.channelTmp[i].extend);
+            }
+          }
+        }
 
-        let ji = parseInt(this.groupData[0].extend);
         //获取当前年
         let currentYear = new Date().getFullYear();
         //判断级数是和当前年相同吗
-        if (currentYear == ji) {
-          this.optionsYear = [
-            {
-              label: `${currentYear}年`,
-              value: ji,
-            },
-          ];
-        } else {
+
+        //判断级数是和当前年相同吗
+        if (ji == -1) {
+          //则显示近10年
           let list = [];
-          for (let i = ji; i <= currentYear; i++) {
+          for (let i = currentYear - 5; i <= currentYear; i++) {
             let obj = {
               label: `${i}年`,
               value: i,
@@ -709,6 +752,25 @@ export default {
             list.push(obj);
           }
           this.optionsYear = list;
+        } else {
+          if (currentYear == ji) {
+            this.optionsYear = [
+              {
+                label: `${currentYear}年`,
+                value: ji,
+              },
+            ];
+          } else {
+            let list = [];
+            for (let i = ji; i <= currentYear; i++) {
+              let obj = {
+                label: `${i}年`,
+                value: i,
+              };
+              list.push(obj);
+            }
+            this.optionsYear = list;
+          }
         }
       }
       this.query4Score();
@@ -796,16 +858,22 @@ export default {
               this.channelTmp = res.data;
               //将值赋值给list
               if (res.data.length > 0) {
+                //应该在这就过滤掉extend 等于1的
+                //此代码过滤掉了教师
+                // let dataTmp =res.data.filter((item)=>{
+                //   return item.extend!=-1
+                // })
+
                 let resAdd = this.addPro(res.data);
                 this.ppData = JSON.parse(JSON.stringify(resAdd));
                 let forRes = this.arrToTree(resAdd);
 
                 let resultRes = this.deleteChildren(forRes);
-
                 let list = resultRes[0].children;
-                this.groupData = list.filter((item) => {
-                  return item.extend != -1;
-                });
+                this.groupData = list;
+                // this.groupData = list.filter((item) => {
+                //   return item.extend != -1;
+                // });
                 resole(1);
               } else {
                 this.groupData = [];