浏览代码

增加科室数据导出

hsh 2 年之前
父节点
当前提交
a06ed868a7
共有 1 个文件被更改,包括 24 次插入4 次删除
  1. 24 4
      src/components/operate-monitoring/ReportFirstPage.vue

+ 24 - 4
src/components/operate-monitoring/ReportFirstPage.vue

@@ -12,6 +12,8 @@
                 统计结果描述: <span style="color: #fc6c34;">{{ reportInfo1.overview }}{{ reportInfo1.unit }}</span>
                 <el-button type="primary" icon="Search" style="margin-left: 10px;" @click="selectReportMx">明细数据
                 </el-button>
+                <el-button type="primary" icon="Download" style="margin-left: 10px;" @click="exportReportFirst">导出数据
+                </el-button>
             </div>
         </template>
         <template #aside>
@@ -26,16 +28,15 @@
             <div style="width: 80%; height: 400px" id="firstDst"></div>
         </template>
     </page-layer>
-    <el-dialog v-if="props.reportFirst.tableInfo.sndGroup !== 'patient'" :title="titleChart" v-model="sndDrawer"
-        fullscreen destroy-on-close>
+    <el-dialog v-if="props.reportFirst.tableInfo.sndGroup !== 'patient'" :title="titleChart" v-model="sndDrawer" fullscreen
+        destroy-on-close>
         <ReportSecondPage :reportSecond="reportSecond" />
     </el-dialog>
     <el-dialog v-else :title="titleChart" v-model="patientDrawer" width="80%" height="80%" top="40px" draggable
         destroy-on-close>
         <ReportPatientPage :reportPatient="reportPatient" />
     </el-dialog>
-    <el-dialog :title="titleChart" v-model="patientMxDrawer" width="80%" height="80%" top="40px" draggable
-        destroy-on-close>
+    <el-dialog :title="titleChart" v-model="patientMxDrawer" width="80%" height="80%" top="40px" draggable destroy-on-close>
         <ReportPatientPage :reportPatient="reportPatient" />
     </el-dialog>
 </template>
@@ -46,6 +47,7 @@ import { clone } from '@/utils/clone'
 import PageLayer from '@/layout/PageLayer.vue'
 import { highBarUtils, highPieUtils } from '@/utils/high-charts'
 import { selectReportGroup } from '@/api/reports/high-report'
+import { Export } from '@/utils/ExportExcel'
 import ReportSecondPage from '@/components/operate-monitoring/ReportSecondPage.vue'
 import ReportPatientPage from '@/components/operate-monitoring/ReportPatientPage.vue'
 
@@ -146,4 +148,22 @@ const selectReportMx = () => {
     reportPatient.value.row = reportInfo1.value
     reportPatient.value.params = clone(params)
 }
+
+const exportReportFirst = () => {
+    if (reportData.value.length <= 0) {
+        ElMessage({
+            message: '没有可以导出的数据!',
+            type: 'warning',
+            duration: 2500,
+            showClose: true,
+        })
+    }
+
+    let title = {
+        x: x1Name.value,
+        y: y1Name.value
+    }
+    Export(reportData.value, title, reportInfo1.value.reportName);
+}
+
 </script>