Selaa lähdekoodia

修改下载报告

plg 1 päivä sitten
vanhempi
commit
1a80197abb
3 muutettua tiedostoa jossa 316 lisäystä ja 47 poistoa
  1. 2 1
      src/components/PlanRegister.vue
  2. 311 44
      src/components/Report.vue
  3. 3 2
      src/utils/http.js

+ 2 - 1
src/components/PlanRegister.vue

@@ -337,7 +337,8 @@ export default {
               return (
                 item.type == "1" &&
                 item.isDisplayed == "1" &&
-                item.flag != "EMOTION_STROOP"
+                !(item.flag == "EMOTION_STROOP"||
+                item.flag =='FDOT')
               );
             });
             console.log(this.taskList);

+ 311 - 44
src/components/Report.vue

@@ -98,6 +98,12 @@
                         <img src="../assets/img/table/search.png" />
                         <span> 个人报告查看 </span>
                       </div>
+                    </div>
+                     <div class="detail_button_out" v-show="scope.row.isComplete == '1'">
+                      <div class="detail_button" @click="downloadPersion(scope.row)">
+                        <img src="../assets/img/table/xiafa1.png" />
+                        <span> 下载 </span>
+                      </div>
                     </div>
                     <!-- <div
                       class="detail_button_out"
@@ -155,48 +161,187 @@
         style="border-radius: 40px"
       >
         <div slot="title">
-          <div label-width="150px" class="demo-ruleForm">
+          <div label-width="150px" class="report-ruleForm">
             <p v-if="isView" class="dig_title">查看报告</p>
             <div slot=""></div>
             <div slot="footer"></div>
+            <!-- <el-tabs type="border-card">
+              <el-tab-pane>
+                <span slot="label"> 最新报告</span>
+
+                <div style="padding-left: 20px; padding-right: 20px;padding-bottom: 20px;padding-top:20px">
+                  <div style="margin-bottom: 20px">量表</div>
+                  <el-button
+                    type="success"
+                    style="border-radius: 20px"
+                    v-for="item in topPicList"
+                    :key="item.name"
+                    @click="radioClick(item)"
+                  >
+                    {{ item.name }}
+                  </el-button>
+
+                  <div style="margin-bottom: 20px; margin-top: 20px">任务(必选)</div>
+                  <el-button
+                    type="success"
+                    style="border-radius: 20px"
+                    v-for="item in taskList"
+                    :key="item.name"
+                    @click="radioClick(item)"
+                  >
+                    {{ item.name }}
+                  </el-button>
+                  <div style="margin-bottom: 20px; margin-top: 20px">任务(可选)</div>
+                  <div v-show="taskOptionalList.length == 0">无</div>
+                  <el-button
+                    type="success"
+                    style="
+                      border-radius: 20px;
+                      margin-left: 0px;
+                      display: flex;
+                      margin-top: 20px;
+                    "
+                    v-for="item in taskOptionalList"
+                    :key="item.name"
+                    @click="radioClick(item)"
+                  >
+                    {{ item.name }}
+                  </el-button>
+                </div>
+              </el-tab-pane>
+              <el-tab-pane label="重做前" v-show="false">
+                <span slot="label"> 重做前</span>
+
+                <div style="padding-left: 20px; padding-right: 20px;padding-bottom: 20px;padding-top: 20px;">
+                  <div style="margin-bottom: 20px">量表</div>
+                  <el-button
+                    type="success"
+                    style="border-radius: 20px"
+                    v-for="item in topPicListReview"
+                    :key="item.name"
+                    @click="radioClick(item)"
+                  >
+                    {{ item.name }}
+                  </el-button>
+
+                  <div style="margin-bottom: 20px; margin-top: 20px">任务(必选)</div>
+                  <el-button
+                    type="success"
+                    style="border-radius: 20px"
+                    v-for="item in taskListReview"
+                    :key="item.name"
+                    @click="radioClick(item)"
+                  >
+                    {{ item.name }}
+                  </el-button>
+                  <div style="margin-bottom: 20px; margin-top: 20px">任务(可选)</div>
+                  <div v-show="taskOptionalListReview.length == 0">无</div>
+                  <el-button
+                    type="success"
+                    style="
+                      border-radius: 20px;
+                      margin-left: 0px;
+                      display: flex;
+                      margin-top: 20px;
+                    "
+                    v-for="item in taskOptionalListReview"
+                    :key="item.name"
+                    @click="radioClick(item)"
+                  >
+                    {{ item.name }}
+                  </el-button>
+                </div>
+              </el-tab-pane>
+            </el-tabs> -->
+            <div style="margin-bottom: 20px" v-show="!isNoReviewFlag&&userInfo.roleType == 5">
+              <el-switch
+                v-model="isChangeStatus"
+                active-text="最新报告"
+                inactive-text="重做前"
+              >
+              </el-switch>
+            </div>
+
+            <div v-show="!isChangeStatus">
+              <div style="margin-bottom: 20px">量表</div>
+              <el-button
+                type="success"
+                style="border-radius: 20px"
+                v-for="item in topPicListReview"
+                :key="item.name"
+                @click="radioClick(item)"
+              >
+                {{ item.name }}
+              </el-button>
+
+              <div style="margin-bottom: 20px; margin-top: 20px">任务(必选)</div>
+              <el-button
+                type="success"
+                style="border-radius: 20px"
+                v-for="item in taskListReview"
+                :key="item.name"
+                @click="radioClick(item)"
+              >
+                {{ item.name }}
+              </el-button>
+              <div style="margin-bottom: 20px; margin-top: 20px">任务(可选)</div>
+              <div v-show="taskOptionalListReview.length == 0">无</div>
+              <el-button
+                type="success"
+                style="
+                  border-radius: 20px;
+                  margin-left: 0px;
+                  display: flex;
+                  margin-top: 20px;
+                "
+                v-for="item in taskOptionalListReview"
+                :key="item.name"
+                @click="radioClick(item)"
+              >
+                {{ item.name }}
+              </el-button>
+            </div>
+
+            <div v-show="isChangeStatus">
+              <div style="margin-bottom: 20px">量表</div>
+              <el-button
+                type="success"
+                style="border-radius: 20px"
+                v-for="item in topPicList"
+                :key="item.name"
+                @click="radioClick(item)"
+              >
+                {{ item.name }}
+              </el-button>
+
+              <div style="margin-bottom: 20px; margin-top: 20px">任务(必选)</div>
+              <el-button
+                type="success"
+                style="border-radius: 20px"
+                v-for="item in taskList"
+                :key="item.name"
+                @click="radioClick(item)"
+              >
+                {{ item.name }}
+              </el-button>
+              <div style="margin-bottom: 20px; margin-top: 20px">任务(可选)</div>
+              <div v-show="taskOptionalList.length == 0">无</div>
+              <el-button
+                type="success"
+                style="
+                  border-radius: 20px;
+                  margin-left: 0px;
+                  display: flex;
+                  margin-top: 20px;
+                "
+                v-for="item in taskOptionalList"
+                :key="item.name"
+                @click="radioClick(item)"
+              >
+                {{ item.name }}
+              </el-button>
+            </div>
 
-            <div style="margin-bottom: 20px">量表</div>
-            <el-button
-              type="success"
-              style="border-radius: 20px"
-              v-for="item in topPicList"
-              :key="item.name"
-              @click="radioClick(item)"
-            >
-              {{ item.name }}
-            </el-button>
-
-            <div style="margin-bottom: 20px; margin-top: 20px">任务(必选)</div>
-            <el-button
-              type="success"
-              style="border-radius: 20px"
-              v-for="item in taskList"
-              :key="item.name"
-              @click="radioClick(item)"
-            >
-              {{ item.name }}
-            </el-button>
-            <div style="margin-bottom: 20px; margin-top: 20px">任务(可选)</div>
-            <div v-show="taskOptionalList.length == 0">无</div>
-            <el-button
-              type="success"
-              style="
-                border-radius: 20px;
-                margin-left: 0px;
-                display: flex;
-                margin-top: 20px;
-              "
-              v-for="item in taskOptionalList"
-              :key="item.name"
-              @click="radioClick(item)"
-            >
-              {{ item.name }}
-            </el-button>
             <div class="dig_button"></div>
           </div>
         </div>
@@ -237,9 +382,7 @@
                       <!-- roleType -->
                       <span class="info">测试用时:&nbsp;&nbsp;{{ useTime }}</span>
                       <span class="info"
-                        >所属组织:&nbsp;&nbsp;<span style="">{{
-                          orgName
-                        }}</span></span
+                        >所属组织:&nbsp;&nbsp;<span style="">{{ orgName }}</span></span
                       >
                     </div>
                   </div>
@@ -530,9 +673,11 @@
 import { oSessionStorage } from "../utils/utils";
 import * as echarts from "echarts";
 import md5 from "md5";
+import { basePath } from "../utils/http";
 export default {
   data() {
     return {
+      basePath:basePath,
       topicVisible: false,
       //接收所属组织结构的词语
       orgName: "",
@@ -591,6 +736,18 @@ export default {
       //认知任务可选的选项
       taskOptionalList: [],
 
+      //重做的量表选项
+      topPicListReview: [],
+      //重做认知任务必选的选项
+      taskListReview: [],
+      //重做的可选的选项
+      taskOptionalListReview: [],
+
+      //没有被重做过的标志
+      isNoReviewFlag: true,
+      //切换改变状态的标志
+      isChangeStatus: true,
+
       radio1: "",
       currentFlag: "",
       useTime: "",
@@ -639,7 +796,10 @@ export default {
         //选做的认知任务
         this.taskOptionalList = list.filter((item) => {
           return (
-            item.isDisplayed == "1" && item.contentType == "1" && item.isRequired == "0"&&item.isCompleted=='1'
+            item.isDisplayed == "1" &&
+            item.contentType == "1" &&
+            item.isRequired == "0" &&
+            item.isCompleted == "1"
           );
         });
         //     topPicList: [],
@@ -663,9 +823,66 @@ export default {
           return;
         }
       }
+      //查询是否重做过
       this.topicVisible = true;
+      let url = `/planContent/findResetAllByPlanId?planId=${val.id}&userNo=${val.userNo}`;
+      this.$http.get(url, {}, (res) => {
+        if (res.code == 200) {
+          console.log(res);
+          console.log(res.data);
+
+          //当返回的数组是0时 则代表没有重做过
+          if (res.data.length == 0) {
+            //
+            this.isNoReviewFlag = true;
+          } else {
+            //如果有长度则代表是重新做过
+            this.isNoReviewFlag = false;
+            this.isChangeStatus = true;
+          }
+
+          let list = [];
+          list = res.data;
+          //过滤一下list
+          // 量表过滤
+          this.topPicListReview = list.filter((item) => {
+            return (
+              item.isDisplayed == "1" &&
+              item.contentType == "0" &&
+              item.flag != "20210617140713"
+            );
+          });
+          //比作的认知任务
+          this.taskListReview = list.filter((item) => {
+            return (
+              item.isDisplayed == "1" && item.contentType == "1" && item.isRequired == "1"
+            );
+          });
+          //选做的认知任务
+          this.taskOptionalListReview = list.filter((item) => {
+            return (
+              item.isDisplayed == "1" &&
+              item.contentType == "1" &&
+              item.isRequired == "0" &&
+              item.isCompleted == "1"
+            );
+          });
+        }
+      });
       this.queryRport(val);
     },
+    //下载用户报告
+
+    downloadPersion(val){
+        let url = `/record/personalReport?planId=${val.id}&userNo=${val.userNo}`;
+           let a = document.createElement("a");
+          document.body.appendChild(a);
+          a.setAttribute("href", basePath + url);
+          a.click();
+        // this.$http.get(url, {}, (res) => {
+
+        // })
+    },
     radioClick(val) {
       // this.planObj = planObj;
       // if (this.userInfo.roleType != "5") {
@@ -686,7 +903,13 @@ export default {
       this.reportDetail(params);
     },
     reportDetail(params) {
+
       let url = `/userRecordScore/findByFlagAndUserNo?planId=${params.planId}&userNo=${params.userNo}&flag=${params.flag}`;
+      if(this.isChangeStatus){
+        url = `/userRecordScore/findByFlagAndUserNo?planId=${params.planId}&userNo=${params.userNo}&flag=${params.flag}`;
+      }else{
+        url = `/userRecordScore/findResetByFlagAndUserNo?planId=${params.planId}&userNo=${params.userNo}&flag=${params.flag}`;
+      }
       this.$http.get(url, {}, (res) => {
         if (res.code == 200) {
           // debugger;
@@ -897,7 +1120,6 @@ export default {
       }
     },
     open(val) {
-  
       this.proDataLin = val;
       this.dialogVisible = true;
       //查询用户下边的计划
@@ -1061,7 +1283,52 @@ input[aria-hidden="true"] {
   background-color: #f7f7f7;
   border: 0px;
 }
+//----------------
+.report-ruleForm /deep/ .el-form-item {
+  // margin-right: 10px;
+  vertical-align: top;
+  display: flex !important;
+  flex-direction: column;
+}
+.report-ruleForm /deep/.el-form-item__label {
+  text-align: left;
+  vertical-align: middle;
+  float: left;
+  font-size: 14px;
+  color: #606266;
+  line-height: 40px;
+  padding: 0 12px 0 0;
+  -webkit-box-sizing: border-box;
+  box-sizing: border-box;
+}
+
+.report-ruleForm /deep/.el-input {
+  width: 100% !important;
+}
+
+.report-ruleForm /deep/.el-input__inner {
+  width: 100% !important;
+  background-color: #f7f7f7;
+  border: 0px;
+}
 
+.report-ruleForm {
+  background-color: #ffffff;
+  // border-radius: 20px;
+  // margin-right: -10px;
+  margin-top: -10px;
+  // padding-right: 100px;
+  // padding-left: 100px;
+  border-radius: 20px;
+  padding-top: 20px;
+  padding-bottom: 40px;
+  .dig_title {
+    font-size: 20px;
+    margin-bottom: 30px;
+    text-align: center;
+    font-weight: 700;
+  }
+}
 .dig_button {
   display: flex;
   width: 100%;
@@ -1276,7 +1543,7 @@ input[aria-hidden="true"] {
       margin-right: 5px;
     }
     span {
-      color: #4D6AD5;
+      color: #4d6ad5;
       // font-weight: 600;
     }
   }

+ 3 - 2
src/utils/http.js

@@ -28,11 +28,12 @@ import { router } from "@/router";
 //锦泓税务服务器
 //新服务器李靖
 //export const basePath = "http://123.57.18.29:8089";
-// export const basePath = "http://123.57.18.29:8090";
+//29测试服务器
+export const basePath = "http://123.57.18.29:8094";
 // export const basePath = "http://localhost/:8094";
 //国产本
 // export const basePath = "http://localhost:8101";
-export const basePath = "http://129.211.221.44:8094";
+// export const basePath = "http://129.211.221.44:8094";
 // 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/'