From b10d61337f207fbdbea2c44f4f270d83c845cbf9 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期五, 29 十一月 2024 13:28:06 +0800
Subject: [PATCH] 检查类型  条码显示控制

---
 src/views/ecg/queue/index.vue |  170 ++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 127 insertions(+), 43 deletions(-)

diff --git a/src/views/ecg/queue/index.vue b/src/views/ecg/queue/index.vue
index c226d11..669df7d 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"
@@ -67,6 +67,7 @@
       </el-form-item>
       <el-form-item label="鎺掗槦鐘舵��" prop="status">
         <el-select
+          multiple
           v-model="queryParams.status"
           placeholder="璇烽�夋嫨鎺掗槦鐘舵��"
           clearable
@@ -101,6 +102,7 @@
       <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
@@ -109,6 +111,8 @@
         >
           <Icon icon="ep:plus" class="mr-5px" /> 鏂板
         </el-button>
+-->
+<!--
         <el-button
           type="success"
           plain
@@ -118,6 +122,7 @@
         >
           <Icon icon="ep:download" class="mr-5px" /> 瀵煎嚭
         </el-button>
+-->
       </el-form-item>
     </el-form>
   </ContentWrap>
@@ -125,26 +130,86 @@
   <!-- 鍒楄〃 -->
   <ContentWrap>
     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
-      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="鎿嶄綔" align="center" min-width="120px">
+        <template #default="scope">
+<!--          <el-button
+              link
+              type="primary"
+              @click="openAppointmentForm('preview', scope.row.patId, scope.row.bookCheckType)"
+              v-hasPermi="['ecg:appointment:preview']"
+          >
+            鏌ョ湅
+          </el-button>-->
+          <!--
+                    <el-button
+                      link
+                      type="danger"
+                      @click="handleDelete(scope.row.id)"
+                      v-hasPermi="['ecg:queue:delete']"
+                    >
+                      鍒犻櫎
+                    </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 === 3 || scope.row.status === 5 || scope.row.status === 7"
+              v-hasPermi="['ecg:queue:recall']"
+          >
+            鍙洖
+          </el-button>
+          <el-button
+              link
+              type="danger"
+              @click="passWaitingPatient(scope.row)"
+              v-if="scope.row.status === 10"
+              v-hasPermi="['ecg:queue:pass']"
+          >
+            杩囧彿
+          </el-button>
+        </template>
+      </el-table-column>
+<!--      <el-table-column label="id" align="center" prop="id" />-->
+      <el-table-column label="灏辫瘖娴佹按鍙�" align="center" prop="episodeId" min-width="150px"/>
       <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="棰勭害鏃舵" align="center" prop="bookTimeslot" >
+      <el-table-column label="鎮h�呭鍚�" align="center" min-width="120px">
+        <template #default="scope">
+          {{scope.row.patName}} ({{genderFormat(scope.row.patGender)}})
+        </template>
+      </el-table-column>
+      <el-table-column label="妫�鏌ョ被鍨�" align="center" prop="bookCheckType" min-width="100px">
+        <template #default="scope">
+          {{checkTypeStore.getCheckTypeName(scope.row.bookCheckType)}}
+        </template>
+      </el-table-column>
+      <el-table-column label="鎮h�呰鎯�" align="center" prop="patDetails" min-width="300px">
+        <template #default="scope">
+          <span>{{scope.row.patDetails?.mobile}} {{scope.row.patDetails?.wardDesc}} {{scope.row.patDetails?.bedNo}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="棰勭害鏃舵" align="center" prop="bookTimeslot" min-width="100px">
         <template #default="scope">
           <dict-tag :type="DICT_TYPE.ECG_BOOK_TIMESLOT" :value="scope.row.bookTimeslot" />
         </template>
       </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" />
-        </template>
-      </el-table-column>
-        <el-table-column label="鎺掗槦搴忓彿" align="center" prop="seqNum" />
       <el-table-column label="鐘舵��" align="center" prop="status" >
         <template #default="scope">
           <dict-tag :type="DICT_TYPE.ECG_QUEUE_STATUS" :value="scope.row.status" />
         </template>
       </el-table-column>
+      <el-table-column label="棰勭害鍙�" align="center" prop="bookSeqNum" />
+      <el-table-column label="鎺掗槦鍙�" align="center" prop="seqNum" />
+      <el-table-column label="VIP" align="center" prop="isVip" />
       <el-table-column label="杩囧彿鏍囪" align="center" prop="passed" />
       <el-table-column label="杩囨湡鏍囪" align="center" prop="expired" />
       <el-table-column label="璇婂缂栧彿" align="center" prop="roomId" />
@@ -157,35 +222,6 @@
         :formatter="dateFormatter"
         width="180px"
       />
-      <el-table-column label="鎿嶄綔" align="center" min-width="120px">
-        <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            @click="openForm('update', scope.row.id)"
-            v-hasPermi="['ecg:queue:update']"
-          >
-            缂栬緫
-          </el-button>
-          <el-button
-            link
-            type="danger"
-            @click="handleDelete(scope.row.id)"
-            v-hasPermi="['ecg:queue:delete']"
-          >
-            鍒犻櫎
-          </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>
     <!-- 鍒嗛〉 -->
     <Pagination
@@ -197,21 +233,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 './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";
+import {genderFormat} from "@/utils/stringUtil";
 
 /** 鎺掗槦 鍒楄〃 */
 defineOptions({ name: 'queue' })
 
 const message = useMessage() // 娑堟伅寮圭獥
 const { t } = useI18n() // 鍥介檯鍖�
+
+const checkTypeStore = useCheckTypeStore();
 
 const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑
 const list = ref<QueueVO[]>([]) // 鍒楄〃鐨勬暟鎹�
@@ -222,10 +266,11 @@
   patId: undefined,
   patName: undefined,
   patGender: undefined,
+  patDetails: undefined,
   bookTimeslot: undefined,
   bookCheckType: undefined,
   seqNum: undefined,
-  status: undefined,
+  status: [],
   passed: undefined,
   expired: undefined,
   roomId: undefined,
@@ -263,6 +308,9 @@
 const openForm = (type: string, id?: number) => {
   formRef.value.open(type, id)
 }
+const openAppointmentForm = (type: string, patId: string, checkType: number) => {
+  formRef.value.openByQueue(type, patId, checkType)
+}
 
 /** 鍒犻櫎鎸夐挳鎿嶄綔 */
 const handleDelete = async (id: number) => {
@@ -292,6 +340,42 @@
   } catch {}
 }
 
+const passWaitingPatient = async (item: QueueVO) => {
+  const patientVO: PatientVO = {
+    patId: item.patId,
+    checkType: item.bookCheckType,
+  }
+
+  const data = await DoctorApi.passWaitingPatient(patientVO);
+  message.info(data)
+  // 鍒锋柊鍒楄〃
+  await getList()
+}
+
+const recall = async (item: QueueVO) => {
+  const patientVO: PatientVO = {
+    roomId: item.roomId,
+    bedNo: item.bedNo,
+    patId: item.patId,
+    checkType: item.bookCheckType,
+    //jumpFlag: 0,
+    roomId_operator: item.roomId,  // 闃熷垪鐣岄潰 鍙洖鎿嶄綔鏃� 淇濇寔鍘熸潵鐨勫伐浣�
+    bedNo_operator: item.bedNo,    // 闃熷垪鐣岄潰 鍙洖鎿嶄綔鏃� 淇濇寔鍘熸潵鐨勫伐浣�
+  }
+
+  let data = ""
+  if (item.status === 3) // 鎺掗槦涓� 鎮h�� 杩囧彿
+    data = await DoctorApi.recallPassWaitingPatient(patientVO);
+  else if (item.status === 5) // 甯歌銆侀鐢� 杩囧彿
+    data = await DoctorApi.recallPatient(patientVO);
+  else if (item.status === 7)
+    data = await DoctorApi.recallInstallPatient(patientVO);
+
+  message.info(data)
+  // 鍒锋柊鍒楄〃
+  await getList()
+}
+
 /** 瀵煎嚭鎸夐挳鎿嶄綔 */
 const handleExport = async () => {
   try {

--
Gitblit v1.9.3