瀏覽代碼

手术安排添加手术统计

lighter 1 年之前
父節點
當前提交
e019034e48
共有 2 個文件被更改,包括 138 次插入2 次删除
  1. 8 0
      src/api/surgical-management/surgery-arrangement.js
  2. 130 2
      src/views/surgical-management/SurgeryArrangement.vue

+ 8 - 0
src/api/surgical-management/surgery-arrangement.js

@@ -37,4 +37,12 @@ export function notifyDoctor(data) {
         method: 'post',
         data
     })
+}
+
+export function queryStatistics(data) {
+    return request({
+        url: '/surgeryArrangement/queryStatistics',
+        method: 'post',
+        data
+    })
 }

+ 130 - 2
src/views/surgical-management/SurgeryArrangement.vue

@@ -26,6 +26,7 @@
       <el-divider direction="vertical"/>
       <el-button icon="Search" type="primary" @click="clickQuery">查询</el-button>
       <el-button icon="Printer" type="danger" @click="clickPrint">打印</el-button>
+      <el-button icon="PieChart" type="success" @click="showSurgeryStatistics">统计</el-button>
     </template>
     <template #main>
       <el-tag effect="dark" size="small" type="danger">急诊:{{ emergencyCount }}条</el-tag>
@@ -258,6 +259,75 @@
       </div>
     </div>
   </div>
+
+  <el-dialog v-model="surgeryStatisticsVisible" title="手术统计" width="70%">
+
+    <div style="display: flex; align-items: center">
+      <div style="width: 220px">
+        <el-date-picker
+            v-model="statisticsDateRange"
+            :shortcuts="shortcuts"
+            end-placeholder="结束日期"
+            range-separator="至"
+            start-placeholder="开始日期"
+            style="width: 200px"
+            :clearable="false"
+            type="daterange"
+        />
+      </div>
+      <el-select v-model="statisticsRequest.statisticsLabel" style="margin-left: 12px;width: 100px">
+        <el-option label="按科室" value="BY_DEPARTMENT"></el-option>
+        <el-option label="按手术" value="BY_SURGERY"></el-option>
+      </el-select>
+      <el-divider direction="vertical"></el-divider>
+      <el-button icon="Search" @click="executeQueryStatistics">查询</el-button>
+    </div>
+
+    <div style="height: 500px">
+      <div style="height: 460px; margin-top: 20px; padding: 8px 0; overflow-y: scroll; background-color: #e0e0e0">
+        <div v-for="(val,key) in surgeryStatistics.surgeryMap">
+          <div
+              style="display: flex; width: 330px; padding-left: 12px; line-height: 32px; border-bottom: 1px solid white">
+            <div style="width: 32px">
+              <div class="show-detail-icon" @click="showStatisticsDetail(key)"> ></div>
+            </div>
+            <div style="width: 260px;padding-left:8px;text-align: left">{{ key }}</div>
+            <div style="width: 40px;text-align: center">
+              <span style="font-weight: bold;color: black">{{ val.length }}</span>台
+            </div>
+          </div>
+
+          <div v-if="currentStatistics.key === key" style="background-color: white;padding: 0 12px">
+            <el-table :data="currentStatistics.list">
+              <el-table-column prop="deptName" label="手术科室"></el-table-column>
+              <el-table-column prop="recordId" label="手术单号"></el-table-column>
+              <el-table-column prop="patientName" label="患者姓名"></el-table-column>
+              <el-table-column prop="inpatientNo" label="住院号"></el-table-column>
+              <el-table-column prop="applyDocName" label="申请医生"></el-table-column>
+              <el-table-column prop="applyDate" label="申请时间"></el-table-column>
+              <el-table-column prop="opDatetime" label="手术时间"></el-table-column>
+              <el-table-column prop="opCode" label="手术编码"></el-table-column>
+              <el-table-column prop="opName" label="手术名称"></el-table-column>
+              <el-table-column prop="opScaleName" label="手术级别"></el-table-column>
+              <el-table-column prop="urgentClinicName" label="手术分类"></el-table-column>
+              <el-table-column prop="statusName" label="手术状态"></el-table-column>
+              <el-table-column prop="doctorZdName" label="主刀医生"></el-table-column>
+              <el-table-column prop="doctorMzName" label="麻醉医生"></el-table-column>
+              <el-table-column prop="hocusName" label="麻醉方式"></el-table-column>
+              <el-table-column prop="nurseXhName" label="巡回护士"></el-table-column>
+              <el-table-column prop="nurseQxName" label="器械护士"></el-table-column>
+            </el-table>
+          </div>
+
+        </div>
+      </div>
+      <div style="margin-top: 15px;font-weight: bold" v-show="surgeryStatistics.total">
+        总计:{{ surgeryStatistics.total }}台
+      </div>
+    </div>
+
+  </el-dialog>
+
 </template>
 
 <script name="SurgeryArrangement" setup>
@@ -266,7 +336,8 @@ import {
   selectSurgeryArrangements,
   updateSurgeryStatus,
   updateArrangement,
-  notifyDoctor
+  notifyDoctor,
+  queryStatistics
 } from '@/api/surgical-management/surgery-arrangement'
 import {shortcuts} from '@/data/shortcuts.js'
 import {formatDate, formatDatetime, getDateRangeFormatDate} from '@/utils/date'
@@ -299,6 +370,7 @@ let statusList = reactive([
   {code: 'd', name: '取消'},
 ])
 const dateRange = ref([shortcuts[0].value[0], shortcuts[0].value[1]])
+
 let queryParam = reactive({
   ward: '',
   patNo: '',
@@ -573,6 +645,43 @@ const clickPrint = () => {
   LODOP.PREVIEW()
 }
 
+const statisticsRequest = reactive({
+  startDate: null,
+  endDate: null,
+  statisticsLabel: 'BY_DEPARTMENT'
+})
+const statisticsDateRange = ref([])
+const surgeryStatisticsVisible = ref(true)
+const surgeryStatistics = ref([])
+
+function showSurgeryStatistics() {
+  statisticsDateRange.value = [shortcuts[0].value[0], shortcuts[0].value[1]]
+  surgeryStatisticsVisible.value = true
+}
+
+function executeQueryStatistics() {
+  let temp = getDateRangeFormatDate(statisticsDateRange.value)
+  statisticsRequest.startDate = temp.startTime
+  statisticsRequest.endDate = temp.endTime
+  queryStatistics(statisticsRequest).then(res => {
+    surgeryStatistics.value = res
+  })
+}
+
+const currentStatistics = reactive({
+  key: '',
+  list: [],
+})
+function showStatisticsDetail(key) {
+  if (key === currentStatistics.key) {
+    currentStatistics.key = ''
+    currentStatistics.list = []
+    return
+  }
+  currentStatistics.key = key
+  currentStatistics.list = surgeryStatistics.value.surgeryMap[key]
+}
+
 onMounted(() => {
   initLodop()
   nowdate.value = formatDate(new Date())
@@ -588,7 +697,7 @@ onMounted(() => {
 </script>
 
 <style scoped>
-:deep(.el-table tbody tr:hover>td) {
+:deep(.el-table tbody tr:hover > td) {
   background-color: unset !important;
 }
 
@@ -638,4 +747,23 @@ onMounted(() => {
   padding-left: 2px;
   padding-right: 2px;
 }
+
+.show-detail-icon {
+  width: 24px;
+  height: 24px;
+  margin-top: 4px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border-radius: 4px;
+  background-color: white;
+  color: #737373;
+}
+.show-detail-icon:hover {
+  cursor: pointer;
+  scale: 1.12;
+  background-color: #5b5d5d;
+  color: white;
+}
+
 </style>