Bladeren bron

指标分析

yuwandanmian 2 jaren geleden
bovenliggende
commit
bd13fc6f3c

+ 1 - 1
package.json

@@ -18,7 +18,7 @@
     "core-js": "^3.24.1",
     "echarts": "^5.3.3",
     "el-table-infinite-scroll": "^1.0.11",
-    "element-ui": "2.13.2",
+    "element-ui": "2.15.13",
     "js-cookie": "2.2.0",
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",

+ 17 - 7
src/api/excel.js

@@ -12,10 +12,20 @@ export function bassNormalSearchDownload(data) {
 
 // 医院高级检索下载
 export function bassHighSearchDownload(data) {
-    return request_blob({
-      url: `/bass/search_result_export`,
-      method: 'post',
-      responseType: 'blob',
-      data
-    })
-  }
+  return request_blob({
+    url: `/bass/search_result_export`,
+    method: 'post',
+    responseType: 'blob',
+    data
+  })
+}
+
+// 科室病例导出
+export function depBlExport(data) {
+  return request_blob({
+    url: `/bazb/dep_bl_export`,
+    method: 'post',
+    responseType: 'blob',
+    data
+  })
+}

+ 7 - 0
src/router/index.js

@@ -192,6 +192,13 @@ export const constantRoutes = [
         hidden: true,
         meta: { title: '指标分析', keepAlive:true },
       },
+      {
+        path: '/caseIndexAnalysisList',
+        name: 'CaseIndexAnalysisList',
+        component: () => import('@/views/allcase/caseIndexAnalysisList'),
+        hidden: true,
+        meta: { title: '指标分析-科室详情' },
+      },
       {
         path: '/searchSystem',
         name: 'SearchSystem',

+ 138 - 30
src/views/allcase/caseIndexAnalysis.vue

@@ -25,7 +25,7 @@
       <el-col :span="16">
         <div class="box_wrapper">
           <el-form :inline="true" :model="formInline" class="demo-form-inline">
-            <el-form-item label="时间">
+            <el-form-item label="出院时间">
               <el-date-picker
                 v-model="formInline.time"
                 type="daterange"
@@ -42,13 +42,16 @@
           </el-form>
           <!-- 排名柱状图 -->
           <div class="rank-box">
-            <div id="myChart1" style="width: 100%; height: 400px; background: yellow"></div>
+            <Title :title="'科室排名Rank10'" style="margin-bottom: 0;" />
+            <div v-if="rankData.length" id="myChart1" style="width: 100%; height: 400px;"></div>
+            <el-empty v-else description="暂无排名数据"></el-empty>
           </div>
           <div class="table-box">
+            <Title :title="'科室排名'" />
             <el-table :data="tableData" style="width: 100%">
               <el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
               <el-table-column prop="dep_name" label="出院科室"></el-table-column>
-              <el-table-column prop="" label="">
+              <el-table-column prop="" label="" align="center">
                 <template slot="header" slot-scope="scope">
                   <span>{{ scope._self.ruleName }}</span>
                 </template>
@@ -56,8 +59,16 @@
                   <span>{{ (scope.row.res * 100).toFixed(2) + '%' }}</span>
                 </template>
               </el-table-column>
-              <el-table-column prop="numerator" label="正确病历数"></el-table-column>
-              <el-table-column prop="denominator" label="病历总数"></el-table-column>
+              <el-table-column prop="numerator" label="正确病历数" align="center">
+                <template slot-scope="scope">
+                  <span class="link" @click="toPage(scope.row, 1)">{{ scope.row.numerator }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="denominator" label="病历总数" align="center">
+                <template slot-scope="scope">
+                  <span class="link" @click="toPage(scope.row, 0)">{{ scope.row.denominator }}</span>
+                </template>
+              </el-table-column>
             </el-table>
           </div>
         </div>
@@ -67,28 +78,15 @@
 </template>
 
 <script>
+import * as echarts from 'echarts';
+import Title from '@/components/Title';
 export default {
+  components: {
+    Title
+  },
   data() {
     return {
       menus: [
-        // {
-        //   id: 1,
-        //   name: '一、人力资源配置指标',
-        //   children: [
-        //     {
-        //       id: 11,
-        //       name: '指标一、住院病案管理人员月均负担出院患者病历数',
-        //     },
-        //     {
-        //       id: 12,
-        //       name: '指标二、门诊病案管理人员月均负担门诊患者病历数',
-        //     },
-        //     {
-        //       id: 13,
-        //       name: '指标三、病案编码人员月均负担出院患者病历数',
-        //     },
-        //   ],
-        // },
         {
           id: 2,
           name: '二、病历书写时效性指标',
@@ -239,21 +237,28 @@ export default {
       if (!value) return true;
       return data.name.indexOf(value) !== -1;
     },
+    // 菜单点击
     handleNodeClick(data) {
       const { id, name } = data;
       if (id > 10) {
         this.ruleId = id;
         this.ruleName = name.split('、')[1];
       }
-      if (id > 10 && this.formInline.year) {
-        this.getList();
+      if (id > 10 && this.formInline.time.length) {
+        this.getList()
+        this.getRankList()
       }
-      console.log(this.ruleName)
     },
+    // 搜索
     onSearch() {
-      this.getList()
-      this.getRankList()
+      if (this.ruleId && this.formInline.time.length) {
+        this.getList()
+        this.getRankList()
+      } else {
+        this.$message.error('请完善指标和出院时间!')
+      }
     },
+    // 获取科室排名
     getList() {
       const params = {
         type: this.ruleId,
@@ -275,6 +280,7 @@ export default {
         }
       });
     },
+    // 获取排名rank10
     getRankList() {
       const params = {
         type: this.ruleId,
@@ -292,9 +298,107 @@ export default {
         if (Array.isArray(res.data.data)) {
           this.rankData = res.data.data;
         } else {
-          this.tableData = [];
+          this.rankData = [];
         }
+        if (this.rankData.length) {
+          this.$nextTick(() => {
+            this.initCharts1()
+          })
+        }
+      });
+    },
+    // 柱状图
+    initCharts1() {
+      let dataName = [];
+      let dataFleg = [];
+      for (let item in this.rankData) {
+        dataName.push(this.rankData[item].dep_name);
+        dataFleg.push((this.rankData[item].res * 100).toFixed(2));
+      }
+      // 销毁上一次实例
+      echarts.init(document.getElementById('myChart1')).dispose();
+      // 构建新实例
+      let myChart = echarts.init(document.getElementById('myChart1'));
+      window.addEventListener('resize', function () {
+        myChart.resize();
       });
+      if (this.rankData.length) {
+        myChart.setOption({
+          toolbox: {
+            feature: {
+              saveAsImage: {
+                name: '科室排名',
+              },
+            },
+          },
+          tooltip: {
+            trigger: 'axis',
+            axisPointer: {
+              type: 'cross',
+              crossStyle: {
+                color: '#999',
+              },
+            },
+          },
+          legend: {
+            show: true,
+          },
+          xAxis: {
+            type: 'category',
+            data: dataName,
+            axisLabel: {
+              rotate: 15
+            }
+          },
+          grid: {
+            left: '3%',
+            right: '3%',
+            bottom: '3%',
+            containLabel: true,
+          },
+          yAxis: {
+            type: 'value',
+            axisLabel: {
+              show: true,
+              interval: 0,
+              formatter: '{value} %'
+            }
+          },
+          series: [
+            {
+              data: dataFleg,
+              type: 'bar',
+              showBackground: true,
+              barMaxWidth: 30,
+              label: {
+                show: true,
+                position: 'top',
+              },
+              name: this.ruleName,
+              backgroundStyle: {
+                color: 'rgba(180, 180, 180, 0.2)',
+              },
+            },
+          ],
+        });
+      } else {
+        myChart.setOption({
+          title: {
+            text: '暂无数据',
+            x: 'center',
+            y: 'center',
+            textStyle: {
+              fontSize: 14,
+              fontWeight: 'normal',
+            },
+          },
+        });
+      }
+    },
+    // 跳转列表页
+    toPage(row, status) {
+      const { time } = this.formInline
+      this.$router.push({ path: '/caseIndexAnalysisList', query: { ruleId: this.ruleId, ruleName: this.ruleName, start: time[0], end: time[1], dep_id: row.dep_id, status }})
     }
   },
 };
@@ -323,7 +427,11 @@ export default {
   margin-bottom: 20px;
 }
 .table-box {
-
+  .link {
+    color: #409eff;
+    font-weight: 600;
+    cursor: pointer;
+  }
 }
 ::v-deep.el-table .el-table__header tr th {
   background: #f1f6ff;

+ 132 - 0
src/views/allcase/caseIndexAnalysisList.vue

@@ -0,0 +1,132 @@
+<template>
+  <div class="box">
+    <div class="box_wrapper">
+      <CaseIndexAnalysisListSearch :data="searchData" @search="onSearch" />
+      <CaseIndexAnalysisListTable :list="tableData" @export="handleExport" />
+      <!-- 分页 -->
+      <el-pagination
+          v-if="tableData && tableData.length !== 0"
+          @size-change="SizeChangeEvent"
+          @current-change="pageHasChanged"
+          :total="paginationData.total"
+          background
+          class="table-pagination"
+          style="margin: 30px 0px; float: right;"
+          :page-size="paginationData.pageSize"
+          :current-page.sync="paginationData.currentPage"
+          layout="total, sizes, prev, pager, next, jumper"
+        ></el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+  import CaseIndexAnalysisListSearch from './components/CaseIndexAnalysisListSearch.vue'
+  import CaseIndexAnalysisListTable from './components/CaseIndexAnalysisListTable.vue'
+  import { depBlExport } from '@/api/excel'
+
+  export default {
+    components : {
+      CaseIndexAnalysisListSearch,
+      CaseIndexAnalysisListTable
+    },
+    data() {
+      return {
+        searchData: {
+          time: [],
+          dep_id: '',
+          status: '',
+        },
+        tableData: [],
+        paginationData: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+        },
+      }
+    },
+    methods: {
+      // 分页
+      SizeChangeEvent(val) {
+        this.paginationData.pageSize = val;
+        this.getList();
+      },
+      pageHasChanged() {
+        this.getList();
+      },
+      // 搜索
+      onSearch() {
+        this.paginationData.currentPage = 1;
+        this.getList();
+      },
+      getList() {
+        const { ruleId } = this.$route.query
+        const { time, dep_id } = this.searchData
+        const { currentPage, pageSize } = this.paginationData
+        const params = {
+          type: ruleId,
+          page: currentPage,
+          page_size: pageSize,
+          dep_id
+        }
+        
+        if (time && time.length) {
+          params.start_time = time[0]
+          params.end_time = time[1]
+        }
+        this.$axios2.post('/dep_bl_list', params).then(res => {
+          if (Array.isArray(res.data.data)) {
+            this.tableData = res.data.data;
+            this.paginationData.total = res.data.count
+          } else {
+            this.tableData = [];
+          }
+        });
+      },
+      // 导出
+      handleExport() {
+        const { dep_id, time, status } = this.searchData
+        const { ruleId } = this.$route.query
+        const params = {
+          dep_id,
+          type: ruleId,
+          status
+        }
+        
+        if (time && time.length) {
+          params.start_time = time[0]
+          params.end_time = time[1]
+        }
+        depBlExport(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)
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+.box {
+  padding: 16px;
+  .box_wrapper {
+    padding: 16px;
+    background: #fff;
+    border-radius: 5px;
+    overflow: hidden;
+  }
+}
+</style>

+ 95 - 0
src/views/allcase/components/CaseIndexAnalysisListSearch.vue

@@ -0,0 +1,95 @@
+<template>
+  <div>
+    <el-form :inline="true" :model="data" class="demo-form-inline">
+      <el-form-item label="科室">
+        <el-select v-model="data.dep_id" filterable placeholder="请选择">
+          <el-option v-for="item of departments" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="状态" style="margin-bottom: 0">
+        <el-select v-model="data.status" clearable placeholder="请选择">
+          <el-option label="正确" :value="1"></el-option>
+          <el-option label="错误" :value="0"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="出院时间">
+        <el-date-picker
+          v-model="data.time"
+          type="daterange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :picker-options="pickerOptions"
+          value-format="yyyyMMdd"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" @click="onSubmit">查询</el-button>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="onReset">重置</el-button>
+      </el-form-item>
+      <el-form-item style="float: right;">
+        <el-button @click="onBack">返回</el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+
+<script>
+  export default {
+    props: {
+      data: {
+        type: Object,
+        default() {
+          return {
+            dep_id: '',
+            time: [],
+            status: ''
+          }
+        }
+      }
+    },
+    data() {
+      return {
+        pickerOptions: {
+          disabledDate(time) {
+            return time.getTime() > Date.now()
+          }
+        },
+        departments: []
+      }
+    },
+    async created() {
+      await this.getDeportmentList()
+      const { dep_id, start, end, status } = this.$route.query
+      this.data.dep_id = parseInt(dep_id)
+      this.data.time = [start, end]
+      this.data.status = status ? parseInt(status) : ''
+      this.onSubmit()
+    },
+    methods: {
+      onReset() {
+        this.data.status = ''
+        this.data.time = []
+        this.$emit('search')
+      },
+      onSubmit() {
+        this.$emit('search')
+      },
+      getDeportmentList() {
+        this.$axios.post("/selectInfo").then((res) => {
+          // 不要全部选项
+          this.departments = res.data.department.slice(1, res.data.department.length)
+        });
+      },
+      onBack() {
+        this.$router.go(-1)
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 100 - 0
src/views/allcase/components/CaseIndexAnalysisListTable.vue

@@ -0,0 +1,100 @@
+<template>
+  <div>
+    <div class="btn-box">
+      <Title :title="$route.query.ruleName" style="float: left; margin-top: 11px;" />
+      <el-button type="primary" plain style="float: right;" @click="onExport">导出Excel</el-button>
+    </div>
+    <el-table
+      :data="list"
+      style="width: 100%">
+      <el-table-column
+        type="index"
+        label="序号"
+        width="80"
+        align="center">
+      </el-table-column>
+      <el-table-column
+        prop="MED_REC_ID"
+        label="住院号"
+        width="160">
+      </el-table-column>
+      <el-table-column
+        prop="AAA01"
+        label="患者姓名"
+        width="120">
+      </el-table-column>
+      <el-table-column
+        prop="AAC11N"
+        label="出院科室"
+        width="160">
+      </el-table-column>
+      <el-table-column
+        prop="AAC01"
+        label="出院时间"
+        width="160">
+      </el-table-column>
+      <el-table-column
+        prop="AAB01"
+        label="入院时间"
+        width="160">
+      </el-table-column>
+      <el-table-column
+        prop="status"
+        label="状态"
+        width="100">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.status === '正确'" type="success">正确</el-tag>
+          <el-tag v-else type="danger">错误</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="describe"
+        label="描述">
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import Title from '@/components/Title';
+  export default {
+    components: {
+      Title
+    },
+    props: {
+      list: {
+        type: Array,
+        default() {
+          return []
+        }
+      }
+    },
+    methods: {
+      onExport() {
+        this.$emit('export')
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+.btn-box {
+  overflow: hidden;
+  margin-bottom: 15px;
+}
+::v-deep.el-table .el-table__header tr th {
+  background: #f1f6ff;
+  color: #13171e;
+  border-bottom: 0px;
+}
+::v-deep.el-table .el-table__row td {
+  color: #7e8bab;
+  border-bottom: 1px solid #f4f4f4;
+}
+::v-deep.el-table .el-table__header tr th:first-child {
+  border-radius: 5px 0px 0px 5px;
+}
+::v-deep.el-table .el-table__header tr th:nth-child(3) {
+  border-radius: 0px 5px 5px 0px;
+}
+</style>