Parcourir la source

修改查看趋势后可以返回的功能

plg il y a 2 semaines
Parent
commit
98c62932bd

+ 17 - 14
src/components/GroupCompare.vue

@@ -224,7 +224,7 @@ export default {
       optionYiYu: { name: [], score: [] },
       //焦虑全部的数据
       optionJL: { name: [], score: [] },
-      //躯体化全部的数据
+      //压力全部的数据
       optionQTH: { name: [], score: [] },
       //视觉整合能力
       optionSJ: { name: [], score: [] },
@@ -232,7 +232,7 @@ export default {
       yiyuList10: [],
       //焦虑前10
       jlList10: [],
-      //躯体化前10
+      //压力前10
       qthList10: [],
       //视觉整合能力前10
       sjList10: [],
@@ -257,6 +257,9 @@ export default {
       //跳转到趋势统计的页面
       //规定好跳转到哪个页面--然后跳转的类型
       // this.$router.push({path:'/manage/tendency',query:{orgNo:'1212',type:'1'}})
+      //planInfo
+      this.planInfo.orgNo=val.orgNo
+      sessionStorage.setItem("tendency", JSON.stringify(this.planInfo));
       this.$router.push({
         path: "/manage/tendency",
         query: { orgNo: val.orgNo },
@@ -282,7 +285,7 @@ export default {
       this.queryGradeOrYuanYiYu();
       //焦虑
       this.queryGradeOrYuanJL();
-      //躯体化
+      //压力
       this.queryGradeOrYuanQTH();
       //视觉整合能力
       this.queryGradeOrYuanSJ();
@@ -291,7 +294,7 @@ export default {
       this.queryGradeOrYuan10();
       //查询焦虑前10
       this.queryGradeOrYuanjl10();
-      //查询躯体化前10
+      //查询压力前10
       this.queryGradeOrYuanqth10();
       //查询视觉整合能力前10
       this.queryGradeOrYuansj10();
@@ -302,7 +305,7 @@ export default {
       this.queryGradeOrYuanYiYu();
       //焦虑
       this.queryGradeOrYuanJL();
-      //躯体化
+      //压力
       this.queryGradeOrYuanQTH();
       //视觉整合能力
       this.queryGradeOrYuanSJ();
@@ -311,7 +314,7 @@ export default {
       this.queryGradeOrYuan10();
       //查询焦虑前10
       this.queryGradeOrYuanjl10();
-      //查询躯体化前10
+      //查询压力前10
       this.queryGradeOrYuanqth10();
       //查询视觉整合能力前10
       this.queryGradeOrYuansj10();
@@ -327,7 +330,7 @@ export default {
         this.queryGradeOrYuanYiYu();
         //焦虑
         this.queryGradeOrYuanJL();
-        //躯体化
+        //压力
         this.queryGradeOrYuanQTH();
         //视觉整合能力
         this.queryGradeOrYuanSJ();
@@ -336,7 +339,7 @@ export default {
         this.queryGradeOrYuan10();
         //查询焦虑前10
         this.queryGradeOrYuanjl10();
-        //查询躯体化前10
+        //查询压力前10
         this.queryGradeOrYuanqth10();
         //查询视觉整合能力前10
         this.queryGradeOrYuansj10();
@@ -400,13 +403,13 @@ export default {
         }
       });
     },
-    //查询全年级和全院的所有统计---躯体化
+    //查询全年级和全院的所有统计---压力
     queryGradeOrYuanQTH() {
       let url = "";
       if (this.groupType == "1") {
-        url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=躯体化&isLimit=false&planId=${this.planInfo.id}`;
+        url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=压力&isLimit=false&planId=${this.planInfo.id}`;
       } else if (this.groupType == "2" && this.groupGrade != "") {
-        url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=躯体化&grade=${this.groupGrade}&isLimit=false&planId=${this.planInfo.id}`;
+        url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=压力&grade=${this.groupGrade}&isLimit=false&planId=${this.planInfo.id}`;
       }
       this.$http.get(url, {}, (res) => {
         if (res.code == 200) {
@@ -563,14 +566,14 @@ export default {
         }
       });
     },
-    //查询躯体化前10数据
+    //查询压力前10数据
     queryGradeOrYuanqth10() {
       //res 返回数据结构
       let url = "";
       if (this.groupType == "1") {
-        url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=躯体化&isLimit=true&planId=${this.planInfo.id}`;
+        url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=压力&isLimit=true&planId=${this.planInfo.id}`;
       } else if (this.groupType == "2" && this.groupGrade != "") {
-        url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=躯体化&grade=${this.groupGrade}&isLimit=true&planId=${this.planInfo.id}`;
+        url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=压力&grade=${this.groupGrade}&isLimit=true&planId=${this.planInfo.id}`;
       }
       this.$http.get(url, {}, (res) => {
         if (res.code == 200) {

+ 14 - 6
src/components/PlanReport.vue

@@ -398,7 +398,7 @@
                   <span class="sex_class">{{ tabNameCurrent }}</span>
                   <span class="sex_class">心理健康</span>
                   <span class="sex_class"
-                    >中重度{{ dime == "躯体化" ? "压力" : dime }}</span
+                    >中重度{{ dime == "压力" ? "压力" : dime }}</span
                   >
                 </div>
                 <div style="display: flex; flex-direction: column">
@@ -766,6 +766,9 @@ export default {
       //满分人员每页多少条
       fullmarkTotal: 0,
       planType: "",
+
+      //存储传过来的值
+      tmpCuObj:{}
     };
   },
   mounted() {
@@ -886,12 +889,14 @@ export default {
   },
   methods: {
     queryQS(val) {
+      
+      this.tmpCuObj.userNo=val.userNo;
       let url = "/manage/tendency";
       this.bus.$emit("menuStatusUpdate", url);
       //跳转到趋势统计的页面
       //规定好跳转到哪个页面--然后跳转的类型
       // this.$router.push({path:'/manage/tendency',query:{orgNo:'1212',type:'1'}})
-      sessionStorage.setItem("individualTendency", JSON.stringify(val));
+      sessionStorage.setItem("individualTendency", JSON.stringify(this.tmpCuObj));
       this.$router.push({
         path: "/manage/individualTendency",
       });
@@ -983,7 +988,7 @@ export default {
     },
     //格式化页面数据
     forDimen(row) {
-      if (row.dimensionName == "躯体化") {
+      if (row.dimensionName == "压力") {
         return "压力";
       } else {
         return row.dimensionName;
@@ -1052,6 +1057,9 @@ export default {
       this.queryBread(params);
     },
     open(val) {
+      //需要保存传过来的参数//然后再给存过来
+     this.tmpCuObj=val
+      
       this.planType = val.planType;
       this.planId = val.id;
       this.planName = val.planName;
@@ -1188,7 +1196,7 @@ export default {
       } else {
         this.dimensionName = val;
         if (val == "压力") {
-          this.getDimensionPeopleList("躯体化");
+          this.getDimensionPeopleList("压力");
         } else {
           this.getDimensionPeopleList(val);
         }
@@ -1231,7 +1239,7 @@ export default {
         this.getAbnormalList();
       } else if (this.userType == "压力") {
         //---
-        this.getDimensionPeopleList("躯体化");
+        this.getDimensionPeopleList("压力");
       } else {
         this.getDimensionPeopleList(this.userType);
       }
@@ -1422,7 +1430,7 @@ export default {
               },
               {
                 value: res.data.highNum,
-                name: `中重度${this.dime == "躯体化" ? "压力" : this.dime}`,
+                name: `中重度${this.dime == "压力" ? "压力" : this.dime}`,
               },
             ];
       

+ 40 - 10
src/views/manage/channelManagement/channelManagement.vue

@@ -195,7 +195,6 @@
                   v-clipboard:success="copySuc"
                   v-clipboard:error="copyFail"
                   title="复制文本"
-                  
                   v-show="
                     scope.row.isShow &&
                     scope.row.extractCode != null &&
@@ -600,18 +599,34 @@ export default {
       this.$router.push({ path: "/" });
     }
     this.searchTarget();
+    let a = sessionStorage.getItem("individualTendency");
+
+    if (a != null) {
+      let user = JSON.parse(a);
+      if (user.isBack) {
+        user.isBack = false;
+        // let user = JSON.parse(sessionStorage.getItem("individualTendency"));
+        sessionStorage.setItem("individualTendency", JSON.stringify(user));
+        this.addRegisterUser(user);
+      }
+    }
   },
-  onUnmounted() {
-    
-    clearInterval(this.timeFlag)
+
+  destroyed() {
+    clearInterval(this.timeFlag);
   },
   methods: {
+    //点击确认开始关闭定时器
     fileNameFormatter(val) {
-      let nameTmp = val.filePath;
-      //开始截取字符串
-      let lastIndex = nameTmp.lastIndexOf("/");
-      // console.log(nameTmp.slice(lastIndex+1, 0));
-      return nameTmp.slice(lastIndex + 1, nameTmp.length);
+      if (val.filePath == null) {
+        return;
+      } else {
+        let nameTmp = val.filePath;
+        //开始截取字符串
+        let lastIndex = nameTmp.lastIndexOf("/");
+        // console.log(nameTmp.slice(lastIndex+1, 0));
+        return nameTmp.slice(lastIndex + 1, nameTmp.length);
+      }
     },
     closeResetFun() {
       //关闭
@@ -732,6 +747,9 @@ export default {
       this.resetVisible = true;
       //需要传输
 
+      //开始不调用测试了
+      clearInterval(this.timeFlag);
+
       this.$http.post(`/generate/report/v2`, params, (res) => {
         if (res && res.code == 200) {
           // this.currentDownFun(res.data);
@@ -744,6 +762,7 @@ export default {
             this.resetVisible = false;
           });
         } else {
+          this.resetVisible = false;
           this.$message.error(res.msg);
         }
       });
@@ -763,6 +782,7 @@ export default {
     },
     //下载全部班级
     downloadAllFun() {
+      clearInterval(this.timeFlag);
       //下载全部班级
       //循环班级列表拿到
       let params = {};
@@ -791,6 +811,7 @@ export default {
           });
           // this.currentDownFun(res.data);
         } else {
+          this.resetVisible = false;
           this.$message.error(res.msg);
         }
       });
@@ -1066,9 +1087,18 @@ export default {
       }
     },
     addRegisterUser(val) {
-      this.$refs.register.open(val);
+      let obj = {
+        planType: val.planType,
+        id: val.id,
+        planName: val.planName,
+        rouName: "planReport",
+        isBack: false,
+        userNo: "",
+      };
+      this.$refs.register.open(obj);
     },
     editRegisterUser(val) {
+      // debugger;
       this.$refs.register.edit(val);
     },
     resetFun() {

+ 24 - 3
src/views/manage/channelManagement/contract.vue

@@ -39,7 +39,7 @@
             ></el-input>
             <div v-show="!isUser">&nbsp;&nbsp;&nbsp;&nbsp;</div>
             <el-cascader
-              v-show="userInfo.roleType == '5'&&isUser"
+              v-show="userInfo.roleType == '5' && isUser"
               placeholder="请选择组织架构"
               v-model="group"
               :options="groupData"
@@ -48,7 +48,7 @@
             ></el-cascader>
             <!-- :props="{ checkStrictly: true }" -->
             <el-cascader
-              v-show="userInfo.roleType == '4'&&isUser"
+              v-show="userInfo.roleType == '4' && isUser"
               placeholder="请选择组织架构"
               v-model="group"
               :options="groupData"
@@ -480,11 +480,32 @@ export default {
     }
     // this.searchTarget();
     this.isClikcObj(false);
+
+    let a = sessionStorage.getItem("tendency");
+
+    if (a != null) {
+      let user = JSON.parse(a);
+      if (user.isBack) {
+        user.isBack = false;
+        // let user = JSON.parse(sessionStorage.getItem("individualTendency"));
+        sessionStorage.setItem("tendency", JSON.stringify(user));
+        // this.addRegisterUser(user);
+        this.$refs.groupUser.open(user);
+      }
+    }
   },
   methods: {
     groupCompare(val) {
       //打开群体报告统计页面
-      this.$refs.groupUser.open(val);
+      let obj = {
+        planType: val.planType,
+        id: val.id,
+        planName: val.planName,
+        rouName: "comparaAnalysis",
+        isBack: false,
+        orgNo: "",
+      };
+      this.$refs.groupUser.open(obj);
     },
     titleFormatter(val) {
       if (val.planStatus == "1") {

+ 32 - 2
src/views/manage/generalSituation.vue

@@ -536,6 +536,29 @@ export default {
 
     this.queryDetailScore();
 
+    // this.searchTarget();
+
+    let a = sessionStorage.getItem("individualTendency");
+
+    if (a != null) {
+      let user = JSON.parse(a);
+      if (user.isBack) {
+        user.isBack = false;
+        //   let obj ={
+        //   planType:this.planData.planType,
+        //   id:this.planData.id,
+        //   planName:this.planData.planName,
+        //   rouName:'generalSituation',
+        //   isBack:false,
+        //   userNo:""
+        // }
+        // this.$refs.register.open(obj);
+        // let user = JSON.parse(sessionStorage.getItem("individualTendency"));
+        sessionStorage.setItem("individualTendency", JSON.stringify(user));
+        this.$refs.register.open(user);
+      }
+    }
+
     //当屏幕变化自适应大小
     window.addEventListener("resize", this.echartsAllSize);
   },
@@ -560,8 +583,15 @@ export default {
       }, 1000);
     },
     queryDetail() {
-
-      this.$refs.register.open(this.planData);
+      let obj = {
+        planType: this.planData.planType,
+        id: this.planData.id,
+        planName: this.planData.planName,
+        rouName: "generalSituation",
+        isBack: false,
+        userNo: "",
+      };
+      this.$refs.register.open(obj);
     },
     //根据组织编号查询总人数
     queryAllPeople() {

+ 41 - 6
src/views/manage/individualTendency.vue

@@ -20,6 +20,8 @@
               >
               </el-option>
             </el-select>
+
+            <el-button v-show="isJump" @click="backParent" style="border-radius: 20px;margin-left:20px"> 返回</el-button>
           </div>
         </el-col>
       </el-row>
@@ -98,6 +100,8 @@ export default {
   components: { PerQSChart: PerQSChart },
   data() {
     return {
+      //是否是其他页面跳转过来的
+      isJump: false,
       //判断是用户还是计划对比
       isUser: false,
       //用户背景图
@@ -217,11 +221,42 @@ export default {
     }
   },
   methods: {
+    //返回父级
+    backParent() {
+      let user = JSON.parse(sessionStorage.getItem("individualTendency"));
+      user.isBack = true;
+      sessionStorage.setItem("individualTendency", JSON.stringify(user));
+      if (user.rouName == "planReport") {
+        let url = "/manage/planReport";
+        this.bus.$emit("menuStatusUpdate", url);
+        this.$router.push({
+          path: "/manage/planReport",
+        });
+      }
+      //generalSituation
+      if(user.rouName == "generalSituation"){
+        //
+        let url = "/manage/generalSituation";
+        this.bus.$emit("menuStatusUpdate", url);
+        this.$router.push({
+          path: "/manage/generalSituation",
+        });
+      }
+    },
     queryUserDetail() {
       //调用接口访问-----
       //根据userNo 查询
       // this.userInfoLin
       let user = JSON.parse(sessionStorage.getItem("individualTendency"));
+      // debugger;
+      //判断有没有属性isBack  如果有的话需要
+      //就是从其他页面回来的
+      if (user.hasOwnProperty("isBack")) {
+        //
+        this.isJump = true;
+      }
+
+      //判断是哪个页面过来的,到时候还需要返回回去
       return new Promise((solve, reject) => {
         let url = `/user/findUserByUserNo?userNo=${user.userNo}`;
         this.$http.get(url, {}, (res) => {
@@ -239,7 +274,7 @@ export default {
     },
     //查询4个维度的值
     async query4Score() {
-      let list = ["抑郁", "焦虑", "躯体化", "视觉整合能力"];
+      let list = ["抑郁", "焦虑", "压力", "视觉整合能力"];
       //抑郁集合
       let listDepressed = [];
       //焦虑组合
@@ -257,8 +292,8 @@ export default {
         if (list[i] == "焦虑") {
           listAnxiety = await this.queryDetailScore(list[i]);
         }
-        //躯体化集合
-        if (list[i] == "躯体化") {
+        //压力集合
+        if (list[i] == "压力") {
           listStress = await this.queryDetailScore(list[i]);
         }
         //视觉能力集合
@@ -271,7 +306,7 @@ export default {
       // console.log(listAnxiety);
       // //抑郁
       // console.log(listDepressed);
-      // //躯体化
+      // //压力
       // console.log(listStress);
       // //视觉整合能力
       // console.log(listSj);
@@ -299,7 +334,7 @@ export default {
         for (let i = 0; i < listDepressed.length; i++) {
           listDepressedTmp.push(listDepressed[i].dimScore);
         }
-        //躯体化数据重组
+        //压力数据重组
         let listStressTmp = [];
         for (let i = 0; i < listStress.length; i++) {
           listStressTmp.push(listStress[i].dimScore);
@@ -677,7 +712,7 @@ export default {
         this.pageNum = 1;
         this.searchList();
       } else {
-        // this.queryDetailScore("躯体化");
+        // this.queryDetailScore("压力");
         this.query4Score();
       }
     },

+ 28 - 14
src/views/manage/tendency.vue

@@ -45,7 +45,7 @@
               clearable
             ></el-cascader>
             <el-cascader
-              v-show="userInfo.roleType == '4'||userInfo.roleType == '3'"
+              v-show="userInfo.roleType == '4' || userInfo.roleType == '3'"
               @change="banChange"
               placeholder="请选择组织架构"
               v-model="group"
@@ -70,7 +70,7 @@
               </el-option>
             </el-select>
             &nbsp;&nbsp;&nbsp;&nbsp;
-
+            <el-button v-show="!isUser && isJump" style="border-radius:20px;" @click="backParent"> 返回</el-button>
             <div
               style="display: flex; flex-direction: row; align-items: center"
               v-show="isUser"
@@ -89,7 +89,6 @@
             </div>
             <div v-show="isUser">&nbsp;&nbsp;&nbsp;&nbsp;</div>
 
-
             <el-button
               type="primary"
               round
@@ -260,6 +259,7 @@ export default {
   components: { QSChart: QSChart },
   data() {
     return {
+      isJump: false,
       //判断是用户还是计划对比
       isUser: true,
       //用户背景图
@@ -286,7 +286,7 @@ export default {
       //搜索的组织架构
       // 搜索需要的性别
       sex: "",
-      userType:'',
+      userType: "",
 
       group: "",
       ppData: [],
@@ -486,7 +486,7 @@ export default {
     },
     //查询4个维度的值
     async query4Score() {
-      let list = ["抑郁", "焦虑", "躯体化", "视觉整合能力"];
+      let list = ["抑郁", "焦虑", "压力", "视觉整合能力"];
       //抑郁集合
       let listDepressed = [];
       //焦虑组合
@@ -504,8 +504,8 @@ export default {
         if (list[i] == "焦虑") {
           listAnxiety = await this.queryDetailScore(list[i]);
         }
-        //躯体化集合
-        if (list[i] == "躯体化") {
+        //压力集合
+        if (list[i] == "压力") {
           listStress = await this.queryDetailScore(list[i]);
         }
         //视觉能力集合
@@ -518,7 +518,7 @@ export default {
       // console.log(listAnxiety);
       // //抑郁
       // console.log(listDepressed);
-      // //躯体化
+      // //压力
       // console.log(listStress);
       // //视觉整合能力
       // console.log(listSj);
@@ -546,7 +546,7 @@ export default {
         for (let i = 0; i < listDepressed.length; i++) {
           listDepressedTmp.push((parseFloat(listDepressed[i].num) * 100).toFixed(2));
         }
-        //躯体化数据重组
+        //压力数据重组
         let listStressTmp = [];
         for (let i = 0; i < listStress.length; i++) {
           listStressTmp.push((parseFloat(listStress[i].num) * 100).toFixed(2));
@@ -679,6 +679,18 @@ export default {
         // this.queryDetailScore();
       }
     },
+    backParent() {
+      let user = JSON.parse(sessionStorage.getItem("tendency"));
+      user.isBack = true;
+      sessionStorage.setItem("tendency", JSON.stringify(user));
+      if (user.rouName == "comparaAnalysis") {
+        let url = "/manage/comparaAnalysis";
+        this.bus.$emit("menuStatusUpdate", url);
+        this.$router.push({
+          path: "/manage/comparaAnalysis",
+        });
+      }
+    },
     initGroup(val) {
       if (this.userInfo.roleType == "5") {
         if (val) {
@@ -686,6 +698,7 @@ export default {
           //需要循环列表
           //且、路径上有参数的话
           let params = this.$route.query;
+          this.isJump = true;
           if (params.hasOwnProperty("orgNo")) {
             //当存在该属性时
             //  this. channelTmp
@@ -709,6 +722,7 @@ export default {
         if (val) {
           let params = this.$route.query;
           if (params.hasOwnProperty("orgNo")) {
+            this.isJump = true;
             for (let i = 0; i < this.channelTmp.length; i++) {
               //
               if (this.channelTmp[i].orgNo == this.group[this.group.length - 1]) {
@@ -773,6 +787,7 @@ export default {
         if (val) {
           let params = this.$route.query;
           console.log(params.hasOwnProperty("orgNo"));
+          this.isJump = true;
           if (params.hasOwnProperty("orgNo")) {
             //当存在该属性时
             this.group = [params.orgNo];
@@ -912,8 +927,8 @@ export default {
     getChannel() {
       return new Promise((resole, reject) => {
         this.$http.get(
-         // `/org/findAllOrgByPOrgNo?orgNo=${this.userInfo.orgNo}`,
-         `/org/findAllOrgByCurrent`,
+          // `/org/findAllOrgByPOrgNo?orgNo=${this.userInfo.orgNo}`,
+          `/org/findAllOrgByCurrent`,
           {},
           (res) => {
             //  this.$toast.success({message:'成功'});
@@ -1035,7 +1050,7 @@ export default {
       // 搜索需要的性别
       this.planName = "";
       this.group = "";
-      this.userType='';
+      this.userType = "";
       this.searchTarget();
     },
 
@@ -1056,7 +1071,7 @@ export default {
       if (this.isUser) {
         url = `/user/findUserListByPage?pageSize=${this.pageSize}&pageNum=${
           this.pageNum
-      }${this.userType==''?'':`&roleType=${this.userType}`}${
+        }${this.userType == "" ? "" : `&roleType=${this.userType}`}${
           this.group.length == 0
             ? `&orgNo=${this.userInfo.orgNo}`
             : `&orgNo=${this.group[this.group.length - 1]}`
@@ -1089,7 +1104,6 @@ export default {
         this.pageNum = 1;
         this.searchList();
       } else {
-        // this.queryDetailScore("躯体化");
         this.query4Score();
       }
     },