From 8ce35ee72e52f51f93e61d2dec6084c3cfd397b6 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 18 十二月 2024 15:31:36 +0800
Subject: [PATCH] 设备查询完善

---
 src/views/ecg/doctor/components/RoutinePanel.vue |  100 ++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 81 insertions(+), 19 deletions(-)

diff --git a/src/views/ecg/doctor/components/RoutinePanel.vue b/src/views/ecg/doctor/components/RoutinePanel.vue
index 26d038d..5c93abe 100644
--- a/src/views/ecg/doctor/components/RoutinePanel.vue
+++ b/src/views/ecg/doctor/components/RoutinePanel.vue
@@ -11,11 +11,15 @@
         <el-col :span="12">
           <el-form-item label="鎮h�呯紪鍙�" prop="patId">
             <el-input v-model="formData.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" @input="getRentInfoByPatId" />
+<!--        <Qrcode v-if="formData.patId !== undefined && formData.patId !== ''" :text="formData.patId" logo="/logo.gif" width=100 />-->
+            <Barcode v-if="displayBarCode" :value="displayBarCode" :width=100 />
+            <el-button @click="copyBarcode()">澶嶅埗</el-button>
           </el-form-item>
           <el-form-item label="鎮h�呭悕绉�" prop="patName">
             <el-input v-model="formData.patName" placeholder="璇疯緭鍏ユ偅鑰呭悕绉�" />
           </el-form-item>
           <el-form-item label="鎮h�呮弿杩�" prop="patDeptDesc">
+            <dict-tag :type="DICT_TYPE.ECG_PAT_SOURCE" :value="formData.patSrc" />
             绉戝: {{formData.patDeptDesc}} 鐥呭尯: {{formData.patWardDesc}} 搴婁綅: {{formData.patBedNo}}
           </el-form-item>
           <el-form-item label="妫�鏌ユ椂闂�" prop="rentTime">
@@ -28,6 +32,9 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
+          <el-form-item label="妫�鏌ラ」鐩�" prop="">
+            {{formData.checkType && checkTypeStore.getCheckTypeName(formData.checkType)}}
+          </el-form-item>
           <el-form-item label="澶囨敞" prop="remark">
             <el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" />
           </el-form-item>
@@ -35,14 +42,16 @@
       </el-row>
     </el-form>
     <el-button @click="submitForm" type="primary" :disabled="formLoading">妫�鏌ュ畬鎴�</el-button>
-    <el-button @click="resetForm()">閲� 缃�</el-button>
     <el-button @click="cancelInstall"  :disabled="formLoading">鏀惧純妫�鏌�</el-button>
+    <el-button @click="resetForm()">閲� 缃�</el-button>
+    <el-button v-if="formData.checkType && checkTypeStore.getExpenseRecognition(formData.checkType)" @click="feeConfirm"  :disabled="formLoading">纭垂</el-button>
+    <el-button v-if="formData.checkType && checkTypeStore.getExpenseRecognition(formData.checkType)" @click="feeCancel"  :disabled="formLoading">鍙栨秷纭垂</el-button>
 
   <!-- 鍖荤敓瑁呮満鍒楄〃 -->
   <ContentWrap>
     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @row-click="onRowClick" >
-      <el-table-column label="id" align="center" prop="id" />
-      <el-table-column label="瑁呮満鎯呭喌" align="center" prop="lost" >
+<!--      <el-table-column label="id" align="center" prop="id" />-->
+      <el-table-column label="妫�鏌ョ姸鎬�" align="center" prop="lost" >
         <template #default="scope">
           <span v-if="scope.row.jobType === 60">宸叉鏌�</span>
           <span v-if="scope.row.jobType === 50">宸叉斁寮�</span>
@@ -108,10 +117,11 @@
 import {JobRecordApi, JobRecordVO} from "@/api/ecg/jobrecord";
 import {isStringEmpty} from "@/utils/stringUtil";
 import {curDayEnd, curDayStart} from "@/utils/dateUtil";
-import {DeviceApi} from "@/api/ecg/devmanage";
 import {QueueVO} from "@/api/ecg/queue";
 import {RoomBedVO} from "@/api/ecg/doctor";
-import {AppointmentApi} from "@/api/ecg/appointment";
+import {Barcode} from "@/components/Barcode";
+import {useCheckTypeStore} from "@/store/modules/checkType";
+import {DICT_TYPE} from "@/utils/dict";
 
 /** 璁惧瑁呮満 琛ㄥ崟 */
 defineComponent({ name: 'RoutinePanel' })
@@ -125,9 +135,18 @@
 
 const emit = defineEmits(['event_routine']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋�
 
+const checkTypeStore = useCheckTypeStore()
+
 const setPatient = (queueVO: QueueVO | undefined) => {
+  resetForm()
+  formData.value.applyNo = queueVO?.applyNo
+  formData.value.episodeId = queueVO?.episodeId
   formData.value.patId = queueVO?.patId
-  getRentInfoByPatId()
+  formData.value.patName = queueVO?.patName
+  formData.value.checkType = queueVO?.bookCheckType
+  formData.value.patSrc = queueVO?.patDetails.source
+  getFreeRentInfo(formData.value)
+  copyBarcode()
 }
 defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
 
@@ -146,6 +165,8 @@
 })
 const formRef = ref() // 琛ㄥ崟 Ref
 
+const displayBarCode = ref<string> ()
+
 /** 鎻愪氦琛ㄥ崟 */
 const submitForm = async () => {
   // 鏍¢獙琛ㄥ崟
@@ -162,7 +183,7 @@
     // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
     emit('event_routine')
     resetForm()
-    getList()
+    getList()  // 鍖荤敓浣滀笟鍘嗗彶
   } finally {
     formLoading.value = false
   }
@@ -200,16 +221,21 @@
     return
 
   formData.value.patId = tempPatId;
-  getFreeRentInfo()
+  getFreeRentInfo(formData.value)
+  copyBarcode()
 }
 
-const getFreeRentInfo = async () => {
-  const data = await DevRentApi.getFreeRent(formData.value)
+const getFreeRentInfo = async (devRentVO) => {
+  const data = await DevRentApi.getFreeRent(devRentVO)
   if (null === data)
     return
 
   // formDate 瀵瑰簲  DevRent
-  formData.value = data 
+  // formData.value = data  //涓嶈兘鏁翠釜璧嬪�硷紝 榛樿棰嗙敤鏃堕棿琚竻绌�
+  formData.value.id = data.id;
+  formData.value.applyNo = data.applyNo;
+  formData.value.episodeId = data.episodeId;
+  formData.value.patDetails = data.patDetails
 }
 
 
@@ -255,18 +281,54 @@
   formData.value.roomId = props.room.roomId
   formData.value.bedNo = props.room.bedNo
   const data = formData.value as unknown as DevRentVO
-  if (formData.value.id === null || formData.value.id === undefined) {
-    const result = await DevRentApi.routineCheckCancel(data)
-    formData.value.id = result
-    message.success(t('鎿嶄綔鎴愬姛'))
-  } else {
-    await DevRentApi.routineCheckCancel(data)
-    message.success(t('鎿嶄綔鎴愬姛'))
-  }
+  await DevRentApi.routineCheckCancel(data)
+
   // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
   emit('event_routine')
   resetForm()
   getList()
+
+  message.success(t('鎿嶄綔鎴愬姛'))
+}
+
+const feeConfirm = async () => {
+  const result = await DevRentApi.feeConfirm(formData.value.id)
+  if (0 == result)
+    message.success(t('鎿嶄綔鎴愬姛'))
+}
+
+const feeCancel = async () => {
+  const result = await DevRentApi.feeCancel(formData.value.id)
+  if (0 == result)
+    message.success(t('鎿嶄綔鎴愬姛'))
+}
+
+const getDisplayBarcode = (): string => {
+  if (!formData.value.checkType)
+    return ""
+
+  const displayBarcode: number[] = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType!)
+  if (!displayBarcode.includes( formData.value.patSrc ))
+    return ""
+
+  return getBarcode()
+}
+
+const getBarcode = (): string => {
+  if (!formData.value.checkType)
+    return ""
+
+  if (1 === formData.value.patSrc || 2 === formData.value.patSrc)
+    return formData.value.applyNo??""
+  else if (3 === formData.value.patSrc || 4 === formData.value.patSrc)
+    return formData.value.episodeId??""
+
+  return ""
+}
+
+const copyBarcode = async () => {
+  displayBarCode.value = getDisplayBarcode()
+  await navigator.clipboard.writeText( getBarcode() );
 }
 
 /** 鍒濆鍖� **/

--
Gitblit v1.9.3