浏览代码

自查报告

zhangjie 1 年之前
父节点
当前提交
7a2671d5ed
共有 3 个文件被更改,包括 66 次插入13 次删除
  1. 4 0
      src/api.js
  2. 32 8
      src/modules/main/QualityAnalysis.vue
  3. 30 5
      src/modules/main/components/QualityAnalysisExport.vue

+ 4 - 0
src/api.js

@@ -180,6 +180,10 @@ export const distanceReport = datas => {
 export const callbackReport = datas => {
   return $get("/api/quality/callbackReport", datas);
 };
+// 自查卷
+export const selfCheckReport = datas => {
+  return $get("/api/quality/selfReport", datas);
+};
 
 // student-score -------------------------->
 export const studentScoreList = datas => {

+ 32 - 8
src/modules/main/QualityAnalysis.vue

@@ -131,6 +131,19 @@
       </Col>
     </Row>
 
+    <Row :gutter="20">
+      <Col :span="24" :xl="12">
+        <div class="part-box" v-if="selfCheckData">
+          <echart-render
+            chart-title="自查一致性分析"
+            :chart-data="selfCheckData"
+            :chart-color="['#22C0FF']"
+            chart-type="bar"
+          ></echart-render>
+        </div>
+      </Col>
+    </Row>
+
     <quality-analysis-export
       ref="QualityAnalysisExport"
       :chart-data="renderChartData"
@@ -147,6 +160,7 @@ import {
   deviationReport,
   distanceReport,
   callbackReport,
+  selfCheckReport,
   subjectList,
   areaList,
   userGroupList,
@@ -174,6 +188,7 @@ export default {
       distanceReportData: null,
       deviationReportData: null,
       callbackReportData: null,
+      selfCheckData: null,
       subjects: [],
       areas: [],
       groups: [],
@@ -261,7 +276,7 @@ export default {
       this.filter.groupId = "";
       this.getGroupList();
     },
-    parseGroupBarData(datas) {
+    parseLevelsPropData(datas) {
       if (!datas.length) {
         return { names: [], dataList: [] };
       }
@@ -281,7 +296,7 @@ export default {
         dataList: dataList
       };
     },
-    parseBarData(datas) {
+    parseReportData(datas) {
       var names = [];
       var dataList = [];
       datas.map(function(item, index) {
@@ -298,6 +313,7 @@ export default {
       this.distanceReportData = null;
       this.deviationReportData = null;
       this.callbackReportData = null;
+      this.selfCheckData = null;
       let filterData = {
         ...this.filter
       };
@@ -307,17 +323,20 @@ export default {
         levelsPropReport(datas),
         deviationReport(datas),
         distanceReport(datas),
-        callbackReport(datas)
+        callbackReport(datas),
+        selfCheckReport(datas)
       ];
       const data = await Promise.all(requests);
 
-      this.levelsPropReportData = this.parseGroupBarData(data[0]);
+      this.levelsPropReportData = this.parseLevelsPropData(data[0]);
+
+      this.deviationReportData = this.parseReportData(data[1]);
 
-      this.deviationReportData = this.parseBarData(data[1]);
+      this.distanceReportData = this.parseReportData(data[2]);
 
-      this.distanceReportData = this.parseBarData(data[2]);
+      this.callbackReportData = this.parseReportData(data[3]);
 
-      this.callbackReportData = this.parseBarData(data[3]);
+      this.selfCheckData = this.parseReportData(data[4]);
 
       this.dataReady = true;
     },
@@ -327,6 +346,8 @@ export default {
     },
     toExport() {
       if (!this.dataReady) return;
+      if (this.isDownload) return;
+      this.isDownload = true;
       const curSubject = this.subjects.find(
         item => item.subject === this.filter.subject
       );
@@ -343,13 +364,16 @@ export default {
         levelsPropReportData: this.levelsPropReportData,
         deviationReportData: this.deviationReportData,
         distanceReportData: this.distanceReportData,
-        callbackReportData: this.callbackReportData
+        callbackReportData: this.callbackReportData,
+        selfCheckData: this.selfCheckData
       };
       this.renderExportPage = true;
     },
     exportOver(result) {
       if (!result) {
         this.$Message.error("导出失败,请重新尝试!");
+      } else {
+        this.$Message.success("导出成功!");
       }
       this.renderExportPage = false;
       this.isDownload = false;

+ 30 - 5
src/modules/main/components/QualityAnalysisExport.vue

@@ -16,7 +16,7 @@
             chart-title="档位分布图"
             :animation-is-open="false"
             :chart-data="chartData.levelsPropReportData"
-            chart-type="barGroup"
+            chart-type="lineGroup"
             ref="levelsPropChart"
           ></echart-render>
         </div>
@@ -88,6 +88,27 @@
         </div>
       </div>
     </div>
+    <div class="print-box">
+      <div class="print-chart" v-if="chartData.selfCheckData">
+        <div class="print-chart-body" v-if="!showImg">
+          <echart-render
+            chart-title="自查一致性分析"
+            :animation-is-open="false"
+            :chart-data="chartData.selfCheckData"
+            :chart-color="['#22C0FF']"
+            chart-type="bar"
+            ref="selfCheckChart"
+          ></echart-render>
+        </div>
+        <div
+          class="print-chart-body"
+          v-show="showImg && chartData.selfCheckData.names.length"
+        >
+          <div class="print-chart-title">自查一致性分析:</div>
+          <img src="" ref="selfCheckImg" />
+        </div>
+      </div>
+    </div>
   </div>
 </template>
 
@@ -122,19 +143,23 @@ export default {
     this.$nextTick(() => {
       this.$refs.levelsPropImg.src = this.$refs.levelsPropChart.getDataURL({
         backgroundColor: "#fff",
-        excludeComponents: ["toolbox "]
+        excludeComponents: ["toolbox"]
       });
       this.$refs.deviationImg.src = this.$refs.deviationChart.getDataURL({
         backgroundColor: "#fff",
-        excludeComponents: ["toolbox "]
+        excludeComponents: ["toolbox"]
       });
       this.$refs.distanceImg.src = this.$refs.distanceChart.getDataURL({
         backgroundColor: "#fff",
-        excludeComponents: ["toolbox "]
+        excludeComponents: ["toolbox"]
       });
       this.$refs.callbackImg.src = this.$refs.callbackChart.getDataURL({
         backgroundColor: "#fff",
-        excludeComponents: ["toolbox "]
+        excludeComponents: ["toolbox"]
+      });
+      this.$refs.selfCheckImg.src = this.$refs.selfCheckChart.getDataURL({
+        backgroundColor: "#fff",
+        excludeComponents: ["toolbox"]
       });
 
       this.showImg = true;