Browse Source

[门诊病历导出]

yuwandanmian 2 years ago
parent
commit
d6cfa1b2f8

+ 10 - 0
src/api/excel.js

@@ -29,3 +29,13 @@ export function depBlExport(data) {
     data
   })
 }
+
+// 门诊病历导出
+export function outHospitalExport(data) {
+  return request_blob({
+    url: `/api/omr_zk/error_list_export`,
+    method: 'post',
+    responseType: 'blob',
+    data
+  })
+}

+ 1 - 1
src/views/outpatient/case/index.vue

@@ -231,7 +231,7 @@ import { dateFormat } from '@/utils/index'
     },
     methods: {
       funGoto(blbh) {
-        this.$router.push({ path: '/outpatientMedicalRecordDetail', query: { blbh } })
+        this.$router.push({ path: '/outpatientMedicalRecordDetail', query: { blbh, from: 'search' } })
       },
       selectInfo() {
         this.$axios.post('/omr_zk/serach_type_list').then(res => {

+ 39 - 3
src/views/outpatient/control/defectNumber.vue

@@ -1,6 +1,9 @@
 <template>
   <div class="dashboard-container">
     <div class="tableBox">
+      <div style="overflow: hidden;">
+        <el-button @click="toBack" style="float: right;">返回</el-button>
+      </div>
       <div class="block">
         <div class="blockCon">
           <el-date-picker v-model="formData.startTime" class="selects" type="date" format="yyyy年MM月dd日" value-format="yyyyMMdd" placeholder="就诊时间-开始"></el-date-picker>
@@ -26,8 +29,8 @@
           <span class="kong"></span>
           <el-button class="sc" @click="funQuery">查询</el-button>
           <el-button type="primary" plain @click="onReset">重置条件</el-button>
+          <el-button @click="onExport" type="primary" plain style="position: absolute; right: 35px;">导出Excel</el-button>
         </div>
-        <el-button @click="toBack" style="position: absolute; right: 35px;">返回</el-button>
       </div>
       <el-table :data="tableData" style="width: 100%">
         <el-table-column type="index" label="序号"></el-table-column>
@@ -57,6 +60,7 @@
 import Title from '@/components/Title';
 import { mapGetters } from 'vuex';
 import mPagination from '@/components/m-pagination';
+import { outHospitalExport } from '@/api/excel'
 
 export default {
   name: 'Dashboard',
@@ -73,7 +77,6 @@ export default {
         dep_id: '',
         startTime:'',
         endTime:'',
-        recordNum: '',
         sfzh: '',
         doctor_id: ''
       },
@@ -97,23 +100,56 @@ export default {
     this.funQuery();
   },
   methods: {
+    // 导出
+    onExport() {
+      const { dep_id, startTime, endTime, sfzh, doctor_id } = this.formData
+        const params = {
+          dep_id,
+          start_time: startTime,
+          end_time: endTime,
+          sfzh,
+          doctor_id,
+          rule_id: this.rule_id,
+          is_error: this.$route.query.is_error
+        }
+        outHospitalExport(params).then(res => {
+          const content = res.data // 后台返回二进制数据
+          const blob = new Blob([content])
+          const fileName = `门诊病例.csv`
+          if ('download' in document.createElement('a')) { // 非IE下载
+            const elink = document.createElement('a')
+            elink.download = fileName
+            elink.style.display = 'none'
+            elink.href = URL.createObjectURL(blob)
+            document.body.appendChild(elink)
+            elink.click()
+            URL.revokeObjectURL(elink.href) // 释放URL 对象
+            document.body.removeChild(elink)
+          } else { // IE10+下载
+            navigator.msSaveBlob(blob, fileName)
+          }
+        })
+    },
+    // 重置
     onReset() {
       this.formData = {
         dep_id: '',
         startTime:'',
         endTime:'',
-        recordNum: '',
         sfzh: '',
         doctor_id: ''
       }
       this.funQuery();
     },
+    // 返回
     toBack() {
       this.$router.history.go(-1)
     },
+    // 跳转详情
     funGoto(blbh) {
       this.$router.push({ path: '/outpatientMedicalRecordDetail', query: { blbh } })
     },
+    // 获取部门和医生select
     selectInfo() {
       this.$axios.post('/omr_zk/department_list').then(res => {
         this.departmentList = res.data;

+ 24 - 1
src/views/outpatient/control/detail.vue

@@ -73,22 +73,44 @@
         </el-row>
       </div>
     </div>
+    <CaseQualityBox v-if="!$route.query.from" :data="results" style="margin: 20px 0 0 20px; height: 880px;" />
   </div>
 </template>
 
 <script>
+import CaseQualityBox from '@/views/allcase/components/CaseQualityBox'
+
 export default {
+  components: {
+    CaseQualityBox
+  },
   data() {
     return {
       data: {
         xy: []
+      },
+      results: {
+        score: 0,
+        data: {}
       }
     }
   },
   created() {
     this.getDetails()
+    if (!this.$route.query.from) {
+      this.getCaseQualityResults();
+    }
   },
   methods: {
+    // 获取新病案指控结果
+    getCaseQualityResults() {
+      const params = {
+        blbh: this.$route.query.blbh
+      };
+      this.$axios.post('/omr_zk/get_omr_quality', params).then(res => {
+        this.results = res.data;
+      });
+    },
     getDetails() {
       this.$axios.post('/omr_zk/omr_info', { blbh: this.$route.query.blbh }).then(res => {
         this.data = res.data;
@@ -102,11 +124,12 @@ export default {
 .bcjl {
   margin: 0 20px;
   line-height: 1.5;
-  padding-bottom: 100px;
+  display: flex;
   .content-box {
     background: #fff;
     padding: 20px;
     margin-top: 20px;
+    flex: 1;
   }
   .title {
     font-size: 24px;