Explorar el Código

导出 在看问卷详情和修改

1
mo hace 3 años
padre
commit
66fa295b76
Se han modificado 3 ficheros con 26 adiciones y 9 borrados
  1. 21 6
      src/views/setQuestions/index.vue
  2. 3 1
      src/views/setQuestions/userAskList.vue
  3. 2 2
      vue.config.js

+ 21 - 6
src/views/setQuestions/index.vue

@@ -92,16 +92,16 @@
                 >{{ scope.row.status ? "停用" : "启用" }}</el-button
               >
               <!-- 启用的问卷不能修改 -->
-              <!-- <el-button
-                @click="onQuestionOperation('update', scope.row)"
+              <el-button
+                @click="exportQuestionnaire( scope.row)"
                 v-if="
                   $helpers.permission(
-                    '/operateManager/questionOperation/update'
-                  ) && !scope.row.status
+                    'questionnaireUserResult/export'
+                  )
                 "
                 type="text"
-                >修改</el-button
-              > -->
+                >导出</el-button
+              >
               <el-button
                 @click="lookAsk(scope.row)"
                 v-if="
@@ -133,6 +133,9 @@
 import pagination from "@/components/Pagination/index";
 import QrCode from "@/components/QrCode/index";
 import { vaildStudentUrl } from '@/utils/validate'
+import { Export } from "@/utils/downLoadFile";
+import cleanDeep from "clean-deep";
+import qs from "qs"
 import {
   questionnaireTopicQueryPage,
   questionnaireTopicUpdateStatus,
@@ -241,6 +244,18 @@ export default {
       }
        this.codeUrl =str
       this.qrcodeStatus = true
+    },
+    exportQuestionnaire(row){
+         Export(
+        this,
+        {
+          url: "/api-web/questionnaireUserResult/export",
+          params: qs.stringify(cleanDeep({topicId:row.id})),
+          fileName: `${row.title}导出.xls`,
+          method: "post",
+        },
+        "确定导出问卷"
+      );
     }
   },
 };

+ 3 - 1
src/views/setQuestions/userAskList.vue

@@ -151,7 +151,9 @@ export default {
         let result = await questionnaireUserResult(params);
         this.tableList = result.data.rows;
         this.pageInfo.total = result.data.total;
-      } catch {}
+      } catch(e) {
+        console.log(e)
+      }
     },
     onCancel() {
       this.$store.dispatch("delVisitedViews", this.$route);

+ 2 - 2
vue.config.js

@@ -17,10 +17,10 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // //  https://online.dayaedu.com
 // let target = 'https://online.dayaedu.com' //线上
 // let target = 'http://192.168.3.251:8000' // 何国威
-// let target = 'http://192.168.3.250:8000' //邹璇
+let target = 'http://192.168.3.20:8000' //邹璇
 // let target = 'http://192.168.3.119:8000' //勇哥
 // let target = 'http://dev.dayaedu.com' // 开发环境
-let target = 'https://test.dayaedu.com' //测试环境
+// let target = 'https://test.dayaedu.com' //测试环境
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**