Browse Source

Merge branch 'master' into 'master'

增加报表数据导出

See merge request lighter/vue-intergration-platform!19
huangshuhua 2 years ago
parent
commit
6ea87d831c

+ 28 - 4
src/views/medical-insurance/statistical/CssybBzTj.vue

@@ -10,17 +10,17 @@
         :trigger-on-focus="false"
         clearable
         class="inline-input w-50 m-2"
-        style="width: 240px"
+        style="width: 200px"
         placeholder="请输入关键字"
         @select="handleSelect"
       >
         <template #prepend>科室</template>
       </el-autocomplete>
-      <el-select v-model="insurId" style="width: 200px" clearable placeholder="请选择险种">
+      <el-select v-model="insurId" style="width: 180px" clearable placeholder="请选择险种">
         <el-option label="长沙市城职普通住院" value="1"></el-option>
         <el-option label="长沙市城居普通住院" value="2"></el-option>
       </el-select>
-      <el-input v-model="bzmc" clearable style="width: 240px" class="w-50 m-2" placeholder="请输入关键字">
+      <el-input v-model="bzmc" clearable style="width: 220px" class="w-50 m-2" placeholder="请输入关键字">
         <template #prepend>病种名称</template>
       </el-input>
       <el-autocomplete
@@ -30,7 +30,7 @@
         :trigger-on-focus="false"
         clearable
         class="inline-input w-50 m-2"
-        style="width: 240px"
+        style="width: 220px"
         placeholder="请输入关键字"
         @select="handleSelect"
       >
@@ -41,6 +41,7 @@
         <el-option label="亏损" value="k"></el-option>
       </el-select>
       <el-button type="primary" icon="Search" @click="query" style="margin-left: 5px">查询</el-button>
+      <el-button type="primary" icon="Download" @click="exportBz" style="margin-left: 5px">导出</el-button>
     </el-header>
     <el-main>
       <el-table :data="returnData.slice((currentPage - 1) * pageSize, currentPage * pageSize)" :height="tableHeight" highlight-current-row stripe>
@@ -179,6 +180,7 @@ import { shortcuts, seltYearAndNowLast } from '@/data/shortcuts'
 import { formatDate, getDateRangeFormatDate } from '@/utils/date'
 import { selectSmallDept, selectDoctor } from '@/api/medical-insurance/si-yb-util'
 import { selectCssYbBzTj, selectBzDbDetail, selectBzDbBrDetail } from '@/api/ybkf/yb-cssybtj'
+import { Export } from '@/utils/ExportExcel'
 
 export default {
   setup() {
@@ -326,6 +328,27 @@ export default {
       })
     }
 
+    // ----------------导出--------------------
+    const exportBz = () => {
+      if (returnData.value.length === 0) {
+        ElMessage({
+          message: '没有可以导出的数据!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+      } else {
+        const title = {
+          zdmc: '病种名称',
+          cjyjzf: '人均医保预计支付(元)',
+          cjtczf: '人均医保统筹支付(元)',
+          rs: '人次',
+          bal: '盈亏额',
+        }
+        Export(returnData.value, title, '市医保病种统计')
+      }
+    }
+
     return {
       dateRange,
       shortcuts,
@@ -349,6 +372,7 @@ export default {
       querySearchDoctor,
       cz,
       openBzBrMx,
+      exportBz,
       handleSizeChange,
       handleCurrentChange,
     }

+ 41 - 0
src/views/medical-insurance/statistical/CssybCsTj.vue

@@ -21,6 +21,7 @@
         <el-option label="长沙市城居普通住院" value="2"></el-option>
       </el-select>
       <el-button type="primary" icon="Search" @click="query" style="margin-left: 5px">查询</el-button>
+      <el-button type="primary" icon="Download" @click="exportCycs" style="margin-left: 5px">导出</el-button>
     </el-header>
     <el-main>
       <el-table
@@ -85,6 +86,7 @@ import { selectSmallDept } from '@/api/medical-insurance/si-yb-util'
 import { selectCssYbCsTj } from '@/api/ybkf/yb-cssybtj'
 import { ElMessage } from 'element-plus'
 import store from '@/store'
+import { Export } from '@/utils/ExportExcel'
 
 export default {
   setup() {
@@ -228,6 +230,44 @@ export default {
       return sums
     }
 
+    // ----------------导出--------------------
+    const exportCycs = () => {
+      if (returnData.value.length === 0) {
+        ElMessage({
+          message: '没有可以导出的数据!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+      } else {
+        const title = {
+          cyks: '科室',
+          zyh: '住院号',
+          doctor: '医生',
+          xm: '姓名',
+          yblx: '险种',
+          zfy: '总费用',
+          yjzf: '预计支付',
+          tczf: '统筹支付',
+          bal: '盈亏额',
+          bxbl: '报销比例(%)',
+          score: '分值',
+          zlfs: '治疗方式',
+          sblx: '申报类型',
+          zdmc: '主要诊断',
+          zdbm: '诊断编码',
+          ssmc: '主要手术',
+          ssbm: '手术编码',
+          ryks: '入院科室',
+          cyks: '出院科室',
+          jssj: '结算时间',
+        }
+
+        returnData.value.push(sum)
+        Export(returnData.value, title, '市医保病种统计')
+      }
+    }
+
     return {
       dateRange,
       shortcuts,
@@ -243,6 +283,7 @@ export default {
       query,
       handleSelect,
       querySearchDept,
+      exportCycs,
       handleSizeChange,
       handleCurrentChange,
     }