From f6d5dc98286c7eb1e80092084b96be54ecd56dfe Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期五, 23 八月 2024 11:03:05 +0800
Subject: [PATCH] update

---
 src/views/ecg/doctor/index.vue                 |    4 +-
 src/views/ecg/doctor/components/QueuePanel.vue |   18 ++++++++
 src/api/ecg/doctor/index.ts                    |   17 ++++++++
 src/views/ecg/queue/index.vue                  |   24 ++++++++++++
 src/api/ecg/queue/index.ts                     |   10 ++++-
 5 files changed, 68 insertions(+), 5 deletions(-)

diff --git a/src/api/ecg/doctor/index.ts b/src/api/ecg/doctor/index.ts
index 53ae9a0..b9073a4 100644
--- a/src/api/ecg/doctor/index.ts
+++ b/src/api/ecg/doctor/index.ts
@@ -5,6 +5,13 @@
   bedNo: string // 璇婄枟搴婄紪鍙�
 }
 
+export interface PatientVO {
+  roomId: number // 璇婂缂栧彿
+  bedNo: string // 璇婄枟搴婄紪鍙�
+  patId: string // 鎮h�呯紪鍙�
+  jumpFlag: number // 鎻掗槦鏍囪
+}
+
 export interface PatientStatisticVO {
   finishedNum: number
   readyNum: number
@@ -33,6 +40,16 @@
   // 鍙栨偅鑰呯粺璁�
   getPatientStatistic: async (params: RoomBedVO) => {
     return await request.get({ url: `/ecg/doctor/get-patient-statistic`, params })
+  },
+
+  // 鍙洖杩囧彿鎮h��
+  recallPatient: async (params: PatientVO) => {
+    return await request.get({ url: `/ecg/doctor/recall-patient`, params })
+  },
+
+  // 鍙洖杩囧彿鎮h��
+  patientJump: async (params: PatientVO) => {
+    return await request.get({ url: `/ecg/doctor/patient-jump`, params })
   }
 
 }
diff --git a/src/api/ecg/queue/index.ts b/src/api/ecg/queue/index.ts
index 2a349f2..1a82dea 100644
--- a/src/api/ecg/queue/index.ts
+++ b/src/api/ecg/queue/index.ts
@@ -10,8 +10,9 @@
   bookCheckType: number // 棰勭害妫�鏌ョ被鍨�
   seqNum: number // 鎺掗槦搴忓彿
   status: number // 10:鎺掗槦涓� 20:鍊欒瘖鍑嗗 30:灏辫瘖涓� 40:灏辫瘖瀹屾垚 50:杩囧彿 60:杩囨湡
-  passed: boolean // 杩囧彿鏍囪
-  expired: boolean // 棰勭害杩囨湡鏍囪
+  passed: number // 杩囧彿鏍囪
+  expired: number // 棰勭害杩囨湡鏍囪
+  jumpFlag: number //鎻掗槦鏍囪
   roomId: number // 璇婂缂栧彿
   roomName: string // 璇婂鍚嶇О
   bedNo: string // 璇婄枟搴婄紪鍙�
@@ -44,6 +45,11 @@
     return await request.delete({ url: `/ecg/queue/delete?id=` + id })
   },
 
+  // 鎻掗槦鎺掗槦
+  jumpQueue: async (params: queueVO) => {
+    return await request.get({ url: `/ecg/queue/patient-jump`, params })
+  },
+
   // 瀵煎嚭鎺掗槦 Excel
   exportqueue: async (params) => {
     return await request.download({ url: `/ecg/queue/export-excel`, params })
diff --git a/src/views/ecg/doctor/components/QueuePanel.vue b/src/views/ecg/doctor/components/QueuePanel.vue
index cf06b0c..a864a1b 100644
--- a/src/views/ecg/doctor/components/QueuePanel.vue
+++ b/src/views/ecg/doctor/components/QueuePanel.vue
@@ -1,11 +1,14 @@
 <script setup lang="ts">
 import {defineComponent, PropType} from "vue";
-import { queueApi, queueVO } from '@/api/ecg/queue'
+import { queueVO } from '@/api/ecg/queue'
 import {DICT_TYPE} from "@/utils/dict";
+import {PatientVO, DoctorApi} from "@/api/ecg/doctor";
 
 defineComponent({
   name: 'QueuePanel'
 })
+
+const message = useMessage() // 娑堟伅寮圭獥
 
 const  props = defineProps({
   queue: {
@@ -20,6 +23,18 @@
 */
 })
 
+const recall = async (item) => {
+  const patientVO: PatientVO = {
+    roomId: item.roomId,
+    bedNo: item.bedNo,
+    patId: item.patId,
+    jumpFlag: 0
+  }
+
+  const data = await DoctorApi.recallPatient(patientVO);
+  message.info(data)
+}
+
 </script>
 
 <template>
@@ -30,6 +45,7 @@
   {{item.bedNo}}
   <dict-tag :type="DICT_TYPE.ECG_CHECK_TYPE" :value="item.bookCheckType" />
   <dict-tag :type="DICT_TYPE.ECG_QUEUE_STATUS" :value="item.status" />
+  <el-button v-if="item.status === 50" @click="recall(item)"> 鍙洖 </el-button>
 </div>
 </template>
 
diff --git a/src/views/ecg/doctor/index.vue b/src/views/ecg/doctor/index.vue
index 47ee8de..fb472b4 100644
--- a/src/views/ecg/doctor/index.vue
+++ b/src/views/ecg/doctor/index.vue
@@ -66,8 +66,8 @@
       </el-aside>
     </el-container>
     <el-container style="justify-content: center;">
-      <el-button type="primary" @click="finishNextPatient">瀹屾垚涓嬩竴浣�</el-button>
-      <el-button type="primary" @click="passNextPatient">杩囧彿涓嬩竴浣�</el-button>
+      <el-button type="primary" @click="finishNextPatient">鍙彿</el-button>
+      <el-button type="primary" @click="passNextPatient">杩囧彿</el-button>
     </el-container>
   </el-container>
 </template>
diff --git a/src/views/ecg/queue/index.vue b/src/views/ecg/queue/index.vue
index 6f15206..f0fb6da 100644
--- a/src/views/ecg/queue/index.vue
+++ b/src/views/ecg/queue/index.vue
@@ -186,6 +186,15 @@
           >
             鍒犻櫎
           </el-button>
+          <el-button
+            link
+            type="danger"
+            @click="handleJump(scope.row)"
+            v-if="scope.row.status === 10"
+            v-hasPermi="['ecg:queue:jump']"
+          >
+            {{scope.row.jumpFlag === 0? "鎻掗槦" : "鍙栨秷鎻掗槦"}}
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -280,6 +289,21 @@
   } catch {}
 }
 
+/** 鎻掗槦鎸夐挳鎿嶄綔 */
+const handleJump = async (item: queueVO ) => {
+  try {
+    if (item.jumpFlag === 0)
+      item.jumpFlag = 1
+    else
+      item.jumpFlag = 0
+
+    const data = await queueApi.jumpQueue(item)
+    message.success(data)
+    // 鍒锋柊鍒楄〃
+    await getList()
+  } catch {}
+}
+
 /** 瀵煎嚭鎸夐挳鎿嶄綔 */
 const handleExport = async () => {
   try {

--
Gitblit v1.9.3