From 812ffe6f989303514b45f8106f09ff902bbe0d8a Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 31 十月 2024 16:19:56 +0800
Subject: [PATCH] update

---
 src/views/ecg/queue/index.vue |   80 +++++++++++++++++++++++++++------------
 1 files changed, 55 insertions(+), 25 deletions(-)

diff --git a/src/views/ecg/queue/index.vue b/src/views/ecg/queue/index.vue
index 97e1d70..d682321 100644
--- a/src/views/ecg/queue/index.vue
+++ b/src/views/ecg/queue/index.vue
@@ -49,7 +49,7 @@
           class="!w-240px"
         >
           <el-option
-            v-for="dict in getIntDictOptions(DICT_TYPE.ECG_CHECK_TYPE)"
+            v-for="dict in checkTypeStore.getCheckTypeOptions()"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
@@ -98,20 +98,10 @@
           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>
+<!--
         <el-button
           type="primary"
           plain
@@ -120,6 +110,8 @@
         >
           <Icon icon="ep:plus" class="mr-5px" /> 鏂板
         </el-button>
+-->
+<!--
         <el-button
           type="success"
           plain
@@ -129,6 +121,7 @@
         >
           <Icon icon="ep:download" class="mr-5px" /> 瀵煎嚭
         </el-button>
+-->
       </el-form-item>
     </el-form>
   </ContentWrap>
@@ -140,6 +133,7 @@
       <el-table-column label="鎮h�呯紪鍙�" align="center" prop="patId" />
       <el-table-column label="鎮h�呭鍚�" align="center" prop="patName" />
       <el-table-column label="鎮h�呮�у埆" align="center" prop="patGender" />
+      <el-table-column label="鎮h�呰鎯�" align="center" prop="patDetails" />
       <el-table-column label="棰勭害鏃舵" align="center" prop="bookTimeslot" >
         <template #default="scope">
           <dict-tag :type="DICT_TYPE.ECG_BOOK_TIMESLOT" :value="scope.row.bookTimeslot" />
@@ -147,7 +141,7 @@
       </el-table-column>
       <el-table-column label="妫�鏌ョ被鍨�" align="center" prop="bookCheckType" >
         <template #default="scope">
-          <dict-tag :type="DICT_TYPE.ECG_CHECK_TYPE" :value="scope.row.bookCheckType" />
+          {{checkTypeStore.getCheckTypeName(scope.row.bookCheckType)}}
         </template>
       </el-table-column>
         <el-table-column label="鎺掗槦搴忓彿" align="center" prop="seqNum" />
@@ -173,11 +167,12 @@
           <el-button
             link
             type="primary"
-            @click="openForm('update', scope.row.id)"
-            v-hasPermi="['ecg:queue:update']"
+            @click="openAppointmentForm('preview', scope.row.patId)"
+            v-hasPermi="['ecg:appointment:preview']"
           >
-            缂栬緫
+            鏌ョ湅
           </el-button>
+<!--
           <el-button
             link
             type="danger"
@@ -186,6 +181,7 @@
           >
             鍒犻櫎
           </el-button>
+-->
           <el-button
             link
             type="danger"
@@ -193,7 +189,16 @@
             v-if="scope.row.status === 10"
             v-hasPermi="['ecg:queue:jump']"
           >
-            {{scope.row.jumpFlag === 0? "鎻掗槦" : "鍙栨秷鎻掗槦"}}
+            {{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>
@@ -208,21 +213,29 @@
   </ContentWrap>
 
   <!-- 琛ㄥ崟寮圭獥锛氭坊鍔�/淇敼 -->
-  <queueForm ref="formRef" @success="getList" />
+  <!--  <queueForm ref="formRef" @success="getList" />-->
+
+  <!-- 琛ㄥ崟寮圭獥锛氭坊鍔�/淇敼 -->
+  <AppointmentForm ref="formRef" @event_appointment_success="getList" />
 </template>
 
 <script setup lang="ts">
 import { dateFormatter } from '@/utils/formatTime'
 import download from '@/utils/download'
-import { queueApi, QueueVO } from '@/api/ecg/queue'
-import queueForm from './QueueForm2.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";
+import {useCheckTypeStore} from "@/store/modules/checkType";
+import AppointmentForm from "@/views/ecg/appointment/AppointmentForm.vue";
 
 /** 鎺掗槦 鍒楄〃 */
 defineOptions({ name: 'queue' })
 
 const message = useMessage() // 娑堟伅寮圭獥
 const { t } = useI18n() // 鍥介檯鍖�
+
+const checkTypeStore = useCheckTypeStore();
 
 const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑
 const list = ref<QueueVO[]>([]) // 鍒楄〃鐨勬暟鎹�
@@ -233,6 +246,7 @@
   patId: undefined,
   patName: undefined,
   patGender: undefined,
+  patDetails: undefined,
   bookTimeslot: undefined,
   bookCheckType: undefined,
   seqNum: undefined,
@@ -241,7 +255,6 @@
   expired: undefined,
   roomId: undefined,
   bedNo: undefined,
-  createTime: []
 })
 const queryFormRef = ref() // 鎼滅储鐨勮〃鍗�
 const exportLoading = ref(false) // 瀵煎嚭鐨勫姞杞戒腑
@@ -250,7 +263,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 {
@@ -275,6 +288,9 @@
 const openForm = (type: string, id?: number) => {
   formRef.value.open(type, id)
 }
+const openAppointmentForm = (type: string, patId: string, status: number) => {
+  formRef.value.openByQueue(type, patId, status)
+}
 
 /** 鍒犻櫎鎸夐挳鎿嶄綔 */
 const handleDelete = async (id: number) => {
@@ -282,7 +298,7 @@
     // 鍒犻櫎鐨勪簩娆$‘璁�
     await message.delConfirm()
     // 鍙戣捣鍒犻櫎
-    await queueApi.deletequeue(id)
+    await QueueApi.deletequeue(id)
     message.success(t('common.delSuccess'))
     // 鍒锋柊鍒楄〃
     await getList()
@@ -297,11 +313,25 @@
     else
       item.jumpFlag = 0
 
-    const data = await queueApi.jumpQueue(item)
+    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()
 }
 
 /** 瀵煎嚭鎸夐挳鎿嶄綔 */
@@ -311,7 +341,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