소스 검색

新增管床日数统计

hsh 3 년 전
부모
커밋
d584ddf566
4개의 변경된 파일282개의 추가작업 그리고 11개의 파일을 삭제
  1. 19 0
      src/api/reports/bedDays.js
  2. 5 0
      src/router/modules/dashboard.js
  3. 13 11
      src/views/examination/TjReportInfo.vue
  4. 245 0
      src/views/reports/bedDays.vue

+ 19 - 0
src/api/reports/bedDays.js

@@ -0,0 +1,19 @@
+import request from '../../utils/request'
+
+// 查询科室管床日数
+export function selectBedDays(data) {
+    return request({
+        url: '/bedDays/selectBedDays',
+        method: 'post',
+        data,
+    })
+}
+
+// 查询科室医生管床日数
+export function selectYsDaysDetails(data) {
+    return request({
+        url: '/bedDays/selectYsDaysDetails',
+        method: 'post',
+        data,
+    })
+}

+ 5 - 0
src/router/modules/dashboard.js

@@ -289,6 +289,11 @@ const route = [
                 component: createNameComponent(() => import('@/views/reports/KeShiShouRuTongJi.vue')),
                 meta: {title: '科室收入统计', icon: 'iconfont icon-keShiShouRuTongJi'},
             },
+            {
+                path: 'bedDays',
+                component: createNameComponent(() => import('@/views/reports/bedDays.vue')),
+                meta: {title: '管床日数统计', icon: 'iconfont icon-menzhenteshubingdingdianbiangeng2'},
+            },
             {
                 path: 'jiMiBaoBiao',
                 component: createNameComponent(() => import('@/views/reports/JiMuBaoBiao.vue')),

+ 13 - 11
src/views/examination/TjReportInfo.vue

@@ -8,8 +8,8 @@
       <el-row :gutter="6">
         <el-col :span="6">
           <el-table :data="inspectionIndex" :height="tableHeight" stripe highlight-current-row @row-click="queryDetail">
-            <el-table-column prop="time" label="报告日期" header-align="center" width="140"></el-table-column>
-            <el-table-column prop="name" header-align="center" label="报告内容"></el-table-column>
+            <el-table-column prop="time" label="报告日期" width="140"></el-table-column>
+            <el-table-column prop="name" label="报告内容"></el-table-column>
           </el-table>
         </el-col>
         <el-col :span="18">
@@ -18,7 +18,7 @@
               <div style="text-align: right; height: 77px; margin-bottom: 20px">
                 <svg id="barcode" v-if="tjid"></svg>
               </div>
-              <div style="text-align: right; margin-bottom: 300px">
+              <div style="text-align: right; margin-bottom: 200px">
                 <h1 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">长&emsp;沙&emsp;泰&emsp;和&emsp;医&emsp;院</h1>
                 <h1 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">体&emsp;检&emsp;报&emsp;告</h1>
               </div>
@@ -48,7 +48,7 @@
                   <el-col :span="12">部&emsp;&emsp;门:{{ tjReportDetail.reportHeader.所在部门 }}</el-col>
                   <el-col :span="6"></el-col>
                 </el-row>
-                <el-row :gutter="6" style="margin-bottom: 180px">
+                <el-row :gutter="6" style="margin-bottom: 160px">
                   <el-col :span="6"></el-col>
                   <el-col :span="6">体检日期:{{ filterDate(tjReportDetail.reportHeader.登记日期) }}</el-col>
                   <el-col :span="6">电&emsp;&emsp;话:{{ tjReportDetail.reportHeader.手机 }}</el-col>
@@ -85,7 +85,7 @@
                   <span style="font-size: 18px"><b>一丶体检结论及健康建议</b></span>
                 </div>
               </el-row>
-              <el-row :gutter="6" style="padding-bottom: 360px; margin: 0 20px 0 40px">
+              <el-row :gutter="6" style="padding-bottom: 240px; margin: 0 20px 0 40px">
                 <el-col :span="24">
                   <span style="font-size: 16px">
                     <b>
@@ -129,10 +129,10 @@
                 </div>
               </el-row>
               <el-row :gutter="6" style="padding-bottom: 8px; margin: 0 20px 0 20px">
-                <el-table :data="inspectionItems.slice(pageSize * (currentPage - 1), pageSize * currentPage)" height="640" stripe highlight-current-row>
-                  <el-table-column prop="no" label="序号" header-align="center" width="70px"></el-table-column>
-                  <el-table-column prop="item" label="体检项目" header-align="center"></el-table-column>
-                  <el-table-column label="体检结果" header-align="center">
+                <el-table :data="inspectionItems.slice(pageSize * (currentPage - 1), pageSize * currentPage)" :height="tableHeight1" stripe highlight-current-row>
+                  <el-table-column prop="no" label="序号" width="70px"></el-table-column>
+                  <el-table-column prop="item" label="体检项目"></el-table-column>
+                  <el-table-column label="体检结果">
                     <template #default="scope">
                       {{ scope.row.result }}
                       <span style="color: #f56c6c; font-size: 18px">
@@ -140,8 +140,8 @@
                       </span>
                     </template>
                   </el-table-column>
-                  <el-table-column prop="unit" label="单位" header-align="center"></el-table-column>
-                  <el-table-column prop="norm" label="参考值或范围" header-align="center"></el-table-column>
+                  <el-table-column prop="unit" label="单位"></el-table-column>
+                  <el-table-column prop="norm" label="参考值或范围"></el-table-column>
                 </el-table>
                 <el-pagination
                   :current-page="currentPage"
@@ -186,6 +186,7 @@ export default {
   setup() {
     const windowSize = store.state.app.windowSize
     const tableHeight = windowSize.h - 45
+    const tableHeight1 = windowSize.h - 360
     const inspectionIndex = ref([])
     const inspectionItems = ref([])
     const itemResult = ref({})
@@ -328,6 +329,7 @@ export default {
     return {
       barcodeValue,
       tableHeight,
+      tableHeight1,
       tjid,
       tjxm,
       checkboxList,

+ 245 - 0
src/views/reports/bedDays.vue

@@ -0,0 +1,245 @@
+<template>
+  <el-container>
+    <el-header height="35px" style="margin-top: 10px">
+      <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :shortcuts="shortcuts"> </el-date-picker>
+      <el-button type="primary" icon="Search" @click="query" style="margin-left: 5px">查询</el-button>
+      <el-button type="primary" v-if="returnData.length > 0" icon="Download" @click="exportExcel">导出excel </el-button>
+    </el-header>
+    <el-main>
+      <el-table
+        :data="returnData.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
+        :height="tableHeight"
+        stripe
+        highlight-current-row
+        show-summary
+        :summary-method="getSummaries"
+        @row-dblclick="ysDaysdetails"
+      >
+        <el-table-column prop="ryks" label="科室"></el-table-column>
+        <el-table-column prop="days" label="管床日数" sortable></el-table-column>
+      </el-table>
+      <el-dialog v-model="showSetldetails" :close-on-click-modal="false" :close-on-press-escape="false" :title="filterDialogTitle" width="70%">
+        <div style="width: 130px; height: 36px; position: absolute; top: 16px; right: 60px">
+          <el-button icon="Download" type="primary" @click="exportDetailExcel">导出Excel</el-button>
+        </div>
+        <el-table
+          :data="setldetails.slice(pageSize * (currentPage - 1), pageSize * currentPage)"
+          height="560"
+          highlight-current-row
+          stripe
+          show-summary
+          :summary-method="getSummaries"
+        >
+          <el-table-column prop="ryks" label="科室"></el-table-column>
+          <el-table-column prop="doctor" label="医生"></el-table-column>
+          <el-table-column prop="days" label="管床日数" sortable></el-table-column>
+        </el-table>
+        <el-pagination
+          :current-page="currentPage"
+          :page-size="pageSize"
+          :page-sizes="[15, 30, 45, 60]"
+          :total="setldetails.length"
+          layout="total, sizes, prev, pager, next, jumper"
+          style="margin-top: 5px"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        ></el-pagination>
+      </el-dialog>
+    </el-main>
+    <el-footer style="height: 40px">
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-sizes="[20, 30, 40, 50, 100]"
+        :page-size="pageSize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="returnData.length"
+        style="margin-top: 5px"
+      ></el-pagination>
+    </el-footer>
+  </el-container>
+</template>
+<script>
+import { reactive, ref } from '@vue/reactivity'
+import { shortcuts } from '@/data/shortcuts'
+import { clockinShortcuts } from '@/data/shortcuts'
+import { onMounted } from 'vue'
+import { formatDate, getDateRangeFormatDate } from '@/utils/date'
+import { ElMessage } from 'element-plus'
+import store from '@/store'
+import { clone } from '@/utils/clone'
+import { selectBedDays, selectYsDaysDetails } from '@/api/reports/bedDays'
+import { ExcelName, Export } from '@/utils/ExportExcel'
+
+export default {
+  setup() {
+    const windowSize = store.state.app.windowSize
+    const tableHeight = windowSize.h / 1.2
+
+    const start = formatDate(clockinShortcuts[1].value[0])
+    const end = formatDate(clockinShortcuts[1].value[1])
+
+    const queryTerm = reactive({
+      startTime: '',
+      endTime: '',
+      deptId: '',
+    })
+    onMounted(() => {
+      queryTerm.startTime = start
+      queryTerm.endTime = end + ' 23:59:59'
+      dateRange.value = [start, end]
+    })
+
+    const dateRange = ref([])
+    const returnData = ref([])
+
+    const query = () => {
+      if (dateRange.value) {
+        let dateS = getDateRangeFormatDate(dateRange.value)
+        queryTerm.startTime = dateS.startTime
+        queryTerm.endTime = dateS.endTime
+      } else {
+        queryTerm.startTime = start
+        queryTerm.endTime = end
+        ElMessage({
+          type: 'info',
+          message: '默认查询本月的数据',
+          duration: 2500,
+          showClose: true,
+        })
+      }
+      selectBedDays(queryTerm)
+        .then((res) => {
+          returnData.value = res
+        })
+        .catch(() => {
+          returnData.value = []
+        })
+    }
+
+    const setldetails = ref([])
+    const showSetldetails = ref(false)
+    const ysDaysdetails = (row) => {
+      let selectInfo = clone(queryTerm)
+      selectInfo.deptId = row.deptId
+      selectYsDaysDetails(selectInfo)
+        .then((res) => {
+          setldetails.value = res
+          showSetldetails.value = true
+        })
+        .catch(() => {
+          setldetails.value = []
+        })
+    }
+
+    const filterDialogTitle = computed(() => {
+      return '管床日数医生明细'
+    })
+
+    const handleSizeChange = (val) => {
+      pageSize.value = val
+    }
+
+    const handleCurrentChange = (val) => {
+      currentPage.value = val
+    }
+
+    const currentPage = ref(1)
+    const pageSize = ref(20)
+
+    let sum = {}
+
+    const getSummaries = (param) => {
+      const { columns, data } = param
+      const sums = []
+
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        }
+
+        if (column.property === 'doctor') {
+          sums[index] = ''
+          return
+        }
+
+        const values = data.map((item) => Number(item[column.property]))
+        if (!values.every((value) => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+              return prev + curr
+            } else {
+              return prev
+            }
+          }, 0)
+        } else {
+          sums[index] = 0
+        }
+      })
+
+      sum = sums
+      return sums
+    }
+
+    const exportExcel = () => {
+      let title = {
+        ryks: '科室',
+        days: '管床日数',
+      }
+      const data = clone(returnData.value)
+      let dd = { ryks: '', days: '' }
+      dd.ryks = sum[0]
+      dd.days = sum[1]
+      data.push(dd)
+      ExcelName(data, title)
+    }
+
+    const exportDetailExcel = () => {
+      if (setldetails.value.length === 0) {
+        ElMessage({
+          message: '没有可以导出的数据!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+      } else {
+        const title = {
+          ryks: '科室',
+          doctor: '医生',
+          days: '管床日数',
+        }
+        const data = clone(setldetails.value)
+        let dd = { ryks: '', doctor: '', days: '' }
+        dd.ryks = sum[0]
+        dd.doctor = ''
+        dd.days = sum[2]
+        data.push(dd)
+        Export(data, title, filterDialogTitle.value)
+      }
+    }
+
+    return {
+      dateRange,
+      shortcuts,
+      queryTerm,
+      returnData,
+      tableHeight,
+      pageSize,
+      currentPage,
+      filterDialogTitle,
+      setldetails,
+      showSetldetails,
+      query,
+      exportExcel,
+      exportDetailExcel,
+      getSummaries,
+      ysDaysdetails,
+      handleSizeChange,
+      handleCurrentChange,
+    }
+  },
+}
+</script>