From 1d08de208c93dba281f39cbbc59bdc336841a3e4 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期二, 15 十月 2024 16:33:45 +0800
Subject: [PATCH] 大屏..小屏 叫号

---
 src/views/ecg/queue/index.vue |   72 +++++++++++++++++++++++++++---------
 1 files changed, 54 insertions(+), 18 deletions(-)

diff --git a/src/views/ecg/queue/index.vue b/src/views/ecg/queue/index.vue
index 6f15206..7841c12 100644
--- a/src/views/ecg/queue/index.vue
+++ b/src/views/ecg/queue/index.vue
@@ -98,17 +98,6 @@
           class="!w-240px"
         />
       </el-form-item>
-      <el-form-item label="鍒涘缓鏃堕棿" prop="createTime">
-        <el-date-picker
-          v-model="queryParams.createTime"
-          value-format="YYYY-MM-DD HH:mm:ss"
-          type="daterange"
-          start-placeholder="寮�濮嬫棩鏈�"
-          end-placeholder="缁撴潫鏃ユ湡"
-          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
-          class="!w-220px"
-        />
-      </el-form-item>
       <el-form-item>
         <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 鎼滅储</el-button>
         <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 閲嶇疆</el-button>
@@ -186,6 +175,24 @@
           >
             鍒犻櫎
           </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>
+          <el-button
+            link
+            type="danger"
+            @click="recall(scope.row)"
+            v-if="scope.row.status === 5"
+            v-hasPermi="['ecg:queue:recall']"
+          >
+            鍙洖
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -205,9 +212,10 @@
 <script setup lang="ts">
 import { dateFormatter } from '@/utils/formatTime'
 import download from '@/utils/download'
-import { queueApi, queueVO } from '@/api/ecg/queue'
-import queueForm from './queueForm.vue'
+import { QueueApi, QueueVO } from '@/api/ecg/queue'
+import queueForm from './QueueForm.vue'
 import {DICT_TYPE, getIntDictOptions} from '@/utils/dict'
+import {DoctorApi, PatientVO} from "@/api/ecg/doctor";
 
 /** 鎺掗槦 鍒楄〃 */
 defineOptions({ name: 'queue' })
@@ -216,7 +224,7 @@
 const { t } = useI18n() // 鍥介檯鍖�
 
 const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑
-const list = ref<queueVO[]>([]) // 鍒楄〃鐨勬暟鎹�
+const list = ref<QueueVO[]>([]) // 鍒楄〃鐨勬暟鎹�
 const total = ref(0) // 鍒楄〃鐨勬�婚〉鏁�
 const queryParams = reactive({
   pageNo: 1,
@@ -232,7 +240,6 @@
   expired: undefined,
   roomId: undefined,
   bedNo: undefined,
-  createTime: []
 })
 const queryFormRef = ref() // 鎼滅储鐨勮〃鍗�
 const exportLoading = ref(false) // 瀵煎嚭鐨勫姞杞戒腑
@@ -241,7 +248,7 @@
 const getList = async () => {
   loading.value = true
   try {
-    const data = await queueApi.getqueuePage(queryParams)
+    const data = await QueueApi.getqueuePage(queryParams)
     list.value = data.list
     total.value = data.total
   } finally {
@@ -273,11 +280,40 @@
     // 鍒犻櫎鐨勪簩娆$‘璁�
     await message.delConfirm()
     // 鍙戣捣鍒犻櫎
-    await queueApi.deletequeue(id)
+    await QueueApi.deletequeue(id)
     message.success(t('common.delSuccess'))
     // 鍒锋柊鍒楄〃
     await getList()
   } 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 recall = async (item: QueueVO) => {
+  const patientVO: PatientVO = {
+    roomId: item.roomId,
+    bedNo: item.bedNo,
+    patId: item.patId,
+    jumpFlag: 0
+  }
+
+  const data = await DoctorApi.recallPatient(patientVO);
+  message.info(data)
+  // 鍒锋柊鍒楄〃
+  await getList()
 }
 
 /** 瀵煎嚭鎸夐挳鎿嶄綔 */
@@ -287,7 +323,7 @@
     await message.exportConfirm()
     // 鍙戣捣瀵煎嚭
     exportLoading.value = true
-    const data = await queueApi.exportqueue(queryParams)
+    const data = await QueueApi.exportqueue(queryParams)
     download.excel(data, '鎺掗槦.xls')
   } catch {
   } finally {

--
Gitblit v1.9.3