From 936c01060eea0924b88ca5c35d221a972a6aba7d Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期一, 05 十月 2026 10:47:22 +0800
Subject: [PATCH] 检查单列表调整

---
 src/views/ecg/doctor/components/DevReadyPanel.vue |  475 +++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 364 insertions(+), 111 deletions(-)

diff --git a/src/views/ecg/doctor/components/DevReadyPanel.vue b/src/views/ecg/doctor/components/DevReadyPanel.vue
index 97b9a02..6860dea 100644
--- a/src/views/ecg/doctor/components/DevReadyPanel.vue
+++ b/src/views/ecg/doctor/components/DevReadyPanel.vue
@@ -4,42 +4,52 @@
 <!--  褰撳墠鎮h��: {{patient?.patId}} {{isStringEmpty(patient?.patName)?'鏃�':patient.patName}}-->
 
     <el-form
+      class="patient-compact-form"
       ref="formRef"
       :model="formData"
       :rules="formRules"
       label-width="100px"
       v-loading="formLoading"
+   
     >
-      <el-form-item label="妫�鏌ラ」鐩�" prop="">
-        {{formData.checkType && checkTypeStore.getCheckTypeName(formData.checkType)}}
-      </el-form-item>
-      <el-form-item label="鎮h�呯紪鍙�" prop="patId">
-        <el-input v-model="formData.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" @input="getRentInfoByPatId" />
-        <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-row :gutter="20">
+        <el-col :span="6">
+          <el-form-item label="妫�鏌ラ」鐩�" prop="">
+            {{getCheckTypeName(formData.checkType)}}
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="鎮h�呯紪鍙�" prop="patId">
+            <el-input v-model="formData.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" @input="getRentInfoByPatId" />
+            <Barcode v-if="displayBarCode" :value="displayBarCode" :width=100 />
+            <el-button @click="copyBarcode()">澶嶅埗</el-button>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="璁惧缂栧彿" prop="devId">
+            <el-input v-model="formData.devId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" @input="getDevInfo"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
 
-      <el-form-item label="鎮h�呮弿杩�" prop="patDeptDesc">
-        <dict-tag v-if="formData.patSrc" :type="DICT_TYPE.ECG_PAT_SOURCE" :value="formData.patSrc" />
-        {{formData.patDetails?.deptDesc}} {{formData.patDetails?.wardDesc}} {{formData.patDetails?.bedNo}}
-      </el-form-item>
-      <el-form-item label="璁惧缂栧彿" prop="devId">
-        <el-input v-model="formData.devId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" @input="getDevInfo"/>
-      </el-form-item>
-      <el-form-item label="璁惧鎻忚堪" prop="">
-        {{deviceInfo.brand + "&nbsp;&nbsp;" + deviceInfo.model + " " + tranlateDevState(deviceInfo.state)}}
-      </el-form-item>
-      <el-form-item label="棰嗙敤鏃堕棿" prop="rentTime">
-        <el-date-picker
-          v-model="formData.rentTime"
-          type="date"
-          value-format="x"
-          placeholder="閫夋嫨棰嗙敤鏃堕棿"
-        />
-      </el-form-item>
+      <!-- ===== 鎮h�呬俊鎭紙闇�姹�1锛�18 椤圭粺涓�灞曠ず锛屼竴琛屽洓鍒楋級=====
+           鍚庣 DevRentRespVO 宸蹭粠棰勭害鍗曞钩閾哄洖濉紝setPatient 宸茶祴鍊煎埌 formData -->
+      <PatientInfoBlock :data="formData" check-type-field="checkType" :span="6" />
+
+      <!-- ===== 璁惧淇℃伅锛堜竴琛屽洓鍒楋級=====
+           璁惧缂栧彿鍦ㄤ笂鏂圭紪杈戝尯宸插綍鍏ワ紝姝ゅ鍙灞曠ず鍏朵綑璁惧瀛楁 -->
+      <DeviceInfoBlock :data="formData" :device="devInfo" time-label-mode="ready" :span="6">
+        <template #rentTime>
+          <el-date-picker
+            v-model="formData.rentTime"
+            type="date"
+            value-format="x"
+            placeholder="閫夋嫨棰嗙敤鏃堕棿"
+          />
+        </template>
+      </DeviceInfoBlock>
+
       <el-form-item label="澶囨敞" prop="remark">
         <el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" />
       </el-form-item>
@@ -51,20 +61,43 @@
         </el-radio-group>
       </el-form-item>
 -->
+        
     </el-form>
-    <el-button @click="submitForm" type="primary" :disabled="formLoading">棰嗙敤瀹屾垚</el-button>
+    <div class="patient-actions">
+    <el-button size="small" @click="submitForm" type="primary" :disabled="formLoading">棰嗙敤瀹屾垚</el-button>
     <el-checkbox style="margin-left:10px" label="鑷姩&nbsp;" v-model="autoPrint" />
-    <el-button @click="printBill(formData.patId!, formData.checkType!)">鎵撳嵃灏忕エ</el-button>
-    <el-button @click="printBill(formData.patId!, formData.checkType!, 8)">鎵撳嵃灏忕エ2</el-button>
-    <el-button @click="cancelReady"  :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>
+    <el-button size="small" @click="printBill(formData.patDetails?.appointmentId)">鎵撳嵃灏忕エ</el-button>
+    <el-button size="small" @click="cancelReady"  :disabled="formLoading">鏀惧純棰嗙敤</el-button>
+    <el-button size="small" @click="resetForm()">閲� 缃�</el-button>
+    <el-button size="small" v-if="needAutoFeeConfirm(formData.checkType)" @click="feeConfirm"  :disabled="formLoading">纭垂</el-button>
+    <el-button size="small" v-if="needAutoFeeConfirm(formData.checkType)" @click="feeCancel"  :disabled="formLoading">鍙栨秷纭垂</el-button>
+    </div>
 
   <!-- 鍖荤敓瑁呮満鍒楄〃 -->
-  <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" />-->
+  <div class="records-host">
+    <ContentWrap class="records-wrap">
+    <el-table
+      v-loading="loading"
+      :data="list"
+      :stripe="true"
+      :show-overflow-tooltip="true"
+      @row-click="onRowClick"
+    >
+      <!-- 闇�姹�11锛堜慨姝o級锛氥�屾挙閿�銆嶄綔涓�**宸插畬鎴愰鐢ㄨ褰曞垪琛ㄧ殑绗竴鍒�**锛堣〃澶存彃妲斤級锛�
+           鍙嚭鐜颁竴娆★紝浣滅敤浜庢渶杩戜竴浣嶅凡瀹屾垚鎮h�咃紝璇箟涓庡悗绔� lastFinishedPatient 涓�鑷淬�� -->
+      <el-table-column label="鎾ら攢" align="center" width="90px" fixed="left">
+        <template #header>
+          <el-button
+            link
+            type="warning"
+            :disabled="undoDisabled"
+            :loading="undoLoading"
+            @click="$emit('event_undo_finish')"
+          >
+            鎾ら攢
+          </el-button>
+        </template>
+      </el-table-column>
       <el-table-column label="纭垂" align="center" prop="paid">
         <template #default="scope">
           {{scope.row.paid == 1 ? "宸茬‘璐�" : ""}}
@@ -122,6 +155,7 @@
       </el-table-column>
 -->
     </el-table>
+    </ContentWrap>
     <!-- 鍒嗛〉 -->
     <Pagination
         :total="total"
@@ -129,7 +163,7 @@
         v-model:limit="queryParams.pageSize"
         @pagination="getList"
     />
-  </ContentWrap>
+  </div>
 
 </template>
 
@@ -148,9 +182,13 @@
 import {AppointmentApi, AppointmentVO} from "@/api/ecg/appointment";
 import {useCheckTypeStore} from '@/store/modules/checkType'
 import {calGender, getBookBeginTime} from "@/utils";
-import form from "@/components/Form/src/Form.vue";
-import {DICT_TYPE} from "@/utils/dict";
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
 import {tranlateDevState} from "@/utils/statusFormatter";
+import {getCheckTypeName, needAutoFeeConfirm, needDevReady} from "../../../../utils/checkTypeFormatter";
+import { useRoomStore } from '@/store/modules/room'
+// 闇�姹�1锛氭偅鑰呬俊鎭� 18 椤圭粺涓�灞曠ず鍧�
+import PatientInfoBlock from "@/views/ecg/doctor/components/PatientInfoBlock.vue";
+import DeviceInfoBlock from "@/views/ecg/doctor/components/DeviceInfoBlock.vue";
 
 /** 璁惧棰嗙敤 琛ㄥ崟 */
 defineComponent({ name: 'DevReadyPanel' })
@@ -159,15 +197,25 @@
   room: {
     type: Object as PropType<RoomBedVO>,
     required: true
+  },
+  /** 闇�姹�11锛氳褰曞垪琛ㄧ涓�鍒椼�屾挙閿�銆嶆寜閽殑绂佺敤鎬侊紙鐢辩埗椤甸潰鎺у埗锛� */
+  undoDisabled: {
+    type: Boolean,
+    required: false,
+    default: false
+  },
+  /** 闇�姹�11锛氳褰曞垪琛ㄧ涓�鍒椼�屾挙閿�銆嶆寜閽殑 loading锛堢敱鐖堕〉闈㈡帶鍒讹級 */
+  undoLoading: {
+    type: Boolean,
+    required: false,
+    default: false
   }
 })
 
-const emit = defineEmits(['event_dev_ready']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋�
+const emit = defineEmits(['event_dev_ready', 'event_undo_finish'])
 
 const { t } = useI18n() // 鍥介檯鍖�
 const message = useMessage() // 娑堟伅寮圭獥
-
-const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀�
 
 const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤
 
@@ -184,13 +232,8 @@
   checkType: undefined,
   rentTime: new Date().getTime(),
   returnTime: undefined,
-  interference: undefined,
-  baseline: undefined,
-  detachment: undefined,
   remark: undefined,
   paid: undefined,
-  roomId: props.room.roomId,
-  bedNo: props.room.bedNo
 })
 
 const formRules = reactive({
@@ -201,14 +244,11 @@
 })
 const formRef = ref() // 琛ㄥ崟 Ref
 
-const deviceInfo = ref<DeviceVO> ({
-  id: 0,
-  devId: '',
-  category: '',
-  brand: '',
-  model: '',
-  purchaseDate: 0,
-  state: 0,
+const devInfo = ref<Partial<DeviceVO>>({
+  category: undefined,
+  brand: undefined,
+  model: undefined,
+  state: undefined,
 })
 
 const displayBarCode = ref<string> ()
@@ -226,20 +266,52 @@
 
 // 鏍规嵁鎮h�呮垨璁惧, 鑾峰彇 Free鐨勭璧�
 const getFreeRentInfo = async (devRentVO) => {
+  if ((devRentVO.devId == null || devRentVO.devId === '') && (devRentVO.patId == null || devRentVO.patId === '') )
+    return
+
   const data = await DevRentApi.getFreeRent(devRentVO)
   if (null === data)
     return
 
   // formDate 瀵瑰簲  DevRent
-  // formData.value = data  //涓嶈兘鏁翠釜璧嬪�硷紝 榛樿棰嗙敤鏃堕棿琚竻绌�
-  formData.value.id = data.id;   //rent id
-  formData.value.applyNo = data.applyNo;
-  formData.value.episodeId = data.episodeId;
-  formData.value.patDetails = data.patDetails
+  // 鈿狅笍 鍘熷疄鐜版槸鏁翠綋鏇挎崲 formData锛屼細鎶婃偅鑰呬俊鎭啿鎴� null锛�
+  //   瀹炴祴 GET /ecg/dev-rent/get 鐨勫搷搴旈噷锛岄櫎 patName 澶栫殑鎮h�呭瓧娈靛叏鏄� null
+  //   锛坉ev_rent 琛ㄤ笉瀛樿繖浜涘垪锛屼笖璇ヨ矾寰勬湭浠� appointment 鍥炲~锛夈��
+  //   鏁呮敼涓恒�屽彧瑕嗙洊闈炵┖瀛楁銆嶏紝淇濈暀宸插洖濉殑鎮h�呬俊鎭紙PatientInfoBlock 渚濊禆锛夈��
+  const _merged = { ...formData.value } as Record<string, any>
+  Object.keys(data as Record<string, any>).forEach((k) => {
+    const v = (data as Record<string, any>)[k]
+    if (v !== null && v !== undefined && v !== '') _merged[k] = v
+  })
+  formData.value = _merged as typeof formData.value
+
+  // 棰嗙敤鏃堕棿  閲囩敤褰撳墠鏃堕棿
+  formData.value.rentTime = new Date().getTime()
 }
 
 /** 鎻愪氦琛ㄥ崟 */
 const submitForm = async () => {
+  // ==========================================================================
+  // 銆愬畧鍗�戙�岃澶囬鐢ㄣ�嶅彧鍙楃悊**闇�瑕佽澶囬鐢�**鐨勬鏌ラ」鐩��
+  //
+  // 鑳屾櫙锛歚check_type.need_dev_ready`锛堟槸鍚﹂渶瑕佽澶囬鐢級鍦ㄥ悗绔�**浠庢湭琚牎楠�**锛�
+  // 鍖荤敓鍙湪鏈〉鎵嬪姩杈撳叆鎮h�呯紪鍙凤紝鎶�**甯歌蹇冪數鍥�(ct=100) / 甯歌蹇冪數鍚戦噺鍥�(ct=1100)**
+  // 杩欑被 needDevReady=0 鐨勬偅鑰呮媺杩涙潵骞剁偣銆岄鐢ㄥ畬鎴愩�嶏紝
+  // 琛ㄧ幇涓�"甯歌蹇冪數鍥俱�佸績鐢靛悜閲忓浘鎮h�呭嚭鐜板湪璁惧棰嗙敤妯″潡"鐨勬贩涔便��
+  //
+  // 瀹炴祴锛堢湡瀹炴帴鍙o級锛�119/D1 绛夎澶囧噯澶囧伐浣嶇殑 get-to-be-installed-list 杩斿洖绌猴紝
+  // 璇存槑**鑷姩鍒嗘祦鏄寜宸ヤ綅 checkTypes 杩囨护鐨勩�佹病鏈夐棶棰�**锛�
+  // 娣蜂贡鏉ヨ嚜"浜哄伐鎶婁笉灞炰簬鏈祦绋嬬殑鎮h�呮媺杩涙潵"銆�
+  // ==========================================================================
+  if (formData.value.checkType != null && !needDevReady(formData.value.checkType)) {
+    const ctName = getCheckTypeName(formData.value.checkType) || String(formData.value.checkType)
+    message.warning(
+      `銆�${ctName}銆嶄笉闇�瑕佽澶囬鐢紝涓嶈兘鍦ㄨ澶囬鐢ㄦā鍧楀姙鐞嗐�俙 +
+      `璇风‘璁ゆ槸鍚﹀簲鍒般�屽彨鍙锋鏌ャ�嶉〉闈㈠鐞嗚鎮h�呫�俙
+    )
+    return
+  }
+
   // 鏍¢獙琛ㄥ崟
   await formRef.value.validate()
   // 鎻愪氦璇锋眰
@@ -247,20 +319,22 @@
   try {
     formData.value.roomId = props.room.roomId
     formData.value.bedNo = props.room.bedNo
-    const data = formData.value
-    console.info( data )
+    await DevRentApi.devReady(formData.value)
 
-    await DevRentApi.devReady(data)
+    if (autoPrint.value && formData.value.patId && formData.value.checkType) {
+      printBill(formData.value.patDetails?.appointmentId)
+    }
 
-    if (autoPrint.value)
-      printBill( data.patId, data.checkType)
+    // 鑷姩纭垂
+    if (needAutoFeeConfirm(formData.value.checkType)) {
+      feeConfirm()
+    }
 
-    dialogVisible.value = false
-    // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
-    emit('event_dev_ready')
     resetForm()
     getList()
 
+    // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
+    emit('event_dev_ready')
     message.success(t('鎿嶄綔瀹屾垚'))
   } finally {
     formLoading.value = false
@@ -285,28 +359,45 @@
 /** 閲嶇疆琛ㄥ崟 */
 const resetForm = () => {
   formData.value = {
-    id: undefined,
     devId: undefined,
     patId: undefined,
     patName: undefined,
     checkType: undefined,
     rentTime: new Date().getTime(),
     returnTime: undefined,
-    interference: undefined,
-    baseline: undefined,
-    detachment: undefined,
+    tolerance: undefined,
     remark: undefined,
     patDetails: undefined,
     paid: undefined,
-    roomId: props.room.roomId,
-    bedNo: props.room.bedNo
+    // 闇�姹�1锛歅atientInfoBlock 渚濊禆鐨勫钩閾哄瓧娈碉紝鍏堝垵濮嬪寲涓� undefined锛�
+    // 闅忓悗鐢� setPatient 浠� QueueVO 璧嬪�硷紙涓嶅垵濮嬪寲浼氳涓嶅埌灞炴�э級
+    applyNo: undefined,
+    episodeId: undefined,
+    patGender: undefined,
+    patBirthday: undefined,
+    registerDate: undefined,
+    doctor: undefined,
+    doctorTime: undefined,
+    patSrc: undefined,
+    patMobile: undefined,
+    patPhone: undefined,
+    patWardDesc: undefined,
+    patBedNo: undefined,
+    medicalCard: undefined,
+    doctorAdviceNo: undefined,
+    outpatientNo: undefined,
+    patIdentityId: undefined,
+    status: undefined,
+    seqNum: undefined,
   }
   formRef.value?.resetFields()
 
-  deviceInfo.value.category = ''
-  deviceInfo.value.brand = ''
-  deviceInfo.value.model = ''
-  deviceInfo.value.state = 0
+  devInfo.value = {
+    category: undefined,
+    brand: undefined,
+    model: undefined,
+    state: undefined,
+  }
 }
 
 const setPatient = (queueVO: QueueVO | undefined) => {
@@ -316,8 +407,25 @@
   formData.value.patId = queueVO?.patId
   formData.value.patName = queueVO?.patName
   formData.value.checkType = queueVO?.bookCheckType
-  formData.value.patSrc = queueVO?.patDetails.source
-  getFreeRentInfo(formData.value)
+  formData.value.tolerance = queueVO?.tolerance // 澶氳�愯嵂锛屽悗绔粠棰勭害鍗曡ˉ榻�
+  // 闇�姹�1锛氫互涓嬪钩閾哄瓧娈电敱鍚庣浠庨绾﹀崟鍥炲~鍒� QueueRespVO锛�
+  // 蹇呴』鏄惧紡璧嬪�肩粰 formData锛屽惁鍒欐ā鏉块噷璇讳笉鍒帮紙鍘熷厛鍙祴鍊间簡涓婇潰 6 涓級銆�
+  formData.value.patGender = queueVO?.patGender
+  formData.value.patBirthday = queueVO?.patBirthday
+  formData.value.registerDate = queueVO?.registerDate
+  formData.value.doctor = queueVO?.doctor
+  formData.value.doctorTime = queueVO?.doctorTime
+  formData.value.patSrc = queueVO?.patSrc
+  formData.value.patMobile = queueVO?.patMobile
+  formData.value.patPhone = queueVO?.patPhone
+  formData.value.patWardDesc = queueVO?.patWardDesc
+  formData.value.patBedNo = queueVO?.patBedNo
+  formData.value.medicalCard = queueVO?.medicalCard
+  formData.value.outpatientNo = queueVO?.outpatientNo
+    // 闇�姹�1锛氬尰鍢卞彿锛堟鍓� 3 涓潰鏉块兘閬楁紡浜嗚瀛楁鐨勮祴鍊硷紝瀵艰嚧 PatientInfoBlock 鎭掓樉绀� '-'锛�
+    formData.value.doctorAdviceNo = queueVO?.doctorAdviceNo
+  formData.value.patIdentityId = queueVO?.patIdentityId
+  getFreeRentInfo(formData.value)  // 寰呮鏌ョ殑淇℃伅  @ dev_rent 琛�
   copyBarcode()
 }
 defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
@@ -326,6 +434,10 @@
 const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑
 const list = ref<JobRecordVO[]>([]) // 鍒楄〃鐨勬暟鎹�
 const total = ref(0) // 鍒楄〃鐨勬�婚〉鏁�
+// 褰撳墠璇婂淇℃伅锛堢敤浜庡彇璇婂寮�灞曠殑妫�鏌ラ」鐩仛鍏滃簳锛岃 syncRoomCheckTypes锛�
+const roomStore = useRoomStore()
+
+
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
@@ -338,11 +450,39 @@
   jobTime: [curDayStart(), curDayEnd()],
   summary: undefined,
   remark: undefined,
-  createTime: []
+  createTime: [],
+  // ========================================================================
+  // 鎸�**褰撳墠璇婂寮�灞曠殑妫�鏌ラ」鐩�**闅旂宸插畬鎴愯褰曘��
+  //
+  // 鑳屾櫙锛歚job_record` 琛ㄥ彧鏈� doc_id + check_type锛�**娌℃湁 room_id**锛�
+  // 鑰� /ecg/job-record/doctor-page 鏄己鍒舵寜鐧诲綍鍖荤敓鏌�"鑷繁鐨勮褰�"銆�
+  // 浜庢槸鍚屼竴鍖荤敓鍦ㄥ涓瘖瀹ゅ潗璇婃椂锛堝 1鍙烽棬璇� ct=[100,1100]銆�6鍙烽棬璇� ct=[400] 骞虫澘杩愬姩蹇冪數锛夛紝
+  // 鍙彿妫�鏌ラ〉浼氭妸**澶氫釜璇婂鐨勮褰曟贩鍦ㄤ竴璧�**鏄剧ず 鈥斺�� 姝f槸鐢ㄦ埛鍙嶉鐨勭幇璞°��
+  //
+  // 鐢卞悇椤甸潰锛圧outine.vue / index.vue / DevInstall.vue锛夊湪 onMounted 鏃�
+  // 鐢ㄥ綋鍓嶈瘖瀹ょ殑 checkTypes 璧嬪�硷紝骞跺湪姣忔鏌ヨ鍓嶅悓姝ワ紝纭繚鍒囪瘖瀹ゅ悗绔嬪嵆鐢熸晥銆�
+  // ========================================================================
+  checkTypes: undefined as number[] | undefined
 })
+
+/**
+ * 鎶娿�屽綋鍓嶈瘖瀹ゅ紑灞曠殑妫�鏌ラ」鐩�嶅悓姝ュ埌鏌ヨ鏉′欢锛屽疄鐜板凡瀹屾垚璁板綍鎸夎瘖瀹ら殧绂汇��
+ * 瑙� queryParams.checkTypes 鐨勮鏄庛��
+ */
+const syncRoomCheckTypes = () => {
+  // 浼樺厛鐢ㄩ〉闈紶鍏ョ殑璇婂淇℃伅锛涗负绌烘椂鍥為��鍒� store锛堟洿鍙潬锛岃 TitlePanel 鍚屽璇存槑锛�
+  const fromProp = props.room?.checkTypes
+  const types = (Array.isArray(fromProp) && fromProp.length > 0)
+    ? fromProp
+    : roomStore.room?.checkTypes
+  queryParams.checkTypes = (Array.isArray(types) && types.length > 0) ? [...types] : undefined
+}
+
 
 /** 鏌ヨ鍒楄〃 */
 const getList = async () => {
+  // 鏌ヨ鍓嶅悓姝ュ綋鍓嶈瘖瀹ゅ紑灞曠殑妫�鏌ラ」鐩紝淇濊瘉鍙樉绀烘湰璇婂鐨勮褰�
+  syncRoomCheckTypes()
   loading.value = true
   try {
     const data = await JobRecordApi.getJobRecordDoctorPage(queryParams)
@@ -359,13 +499,21 @@
 }
 
 const getSelectedRent = async (rentId) => {
-  formData.value = await DevRentApi.getDevRent(rentId)
+  const data = await DevRentApi.getDevRent(rentId)
+
+  formData.value = data
+
+  devInfo.value.category = data.category
+  devInfo.value.brand = data.brand
+  devInfo.value.model = data.model
+  devInfo.value.state = data.devState
 }
 
-const printBill = async (patId: string, checkType: number, printMode?: number) => {
+const printBill = async (appointmentId: number | null | undefined, printMode?: number) => {
+  if ( appointmentId == null )
+    return
 
-  const curAppointment: AppointmentVO = await AppointmentApi.getCurAppointmentByPatIdAndCheckType( patId, checkType )
-  console.info( curAppointment )
+  const curAppointment: AppointmentVO = await AppointmentApi.getAppointment( appointmentId )
 
 // 寮曞叆鍚庝娇鐢ㄧず渚�
   hiprint.init({
@@ -378,7 +526,7 @@
   //var panel = hiprintTemplate.addPrintPanel({ width: 100, height: 130, paperFooter: 340, paperHeader: 10 }); 瀵艰嚧璧颁笁椤�
   var panel = hiprintTemplate.addPrintPanel({ width: 140, height: 130, paperNumberDisabled:true});
 //鏂囨湰
-  const checkTypeName = checkTypeStore.getCheckTypeName(curAppointment.bookCheckType)
+  const checkTypeName = getCheckTypeName(curAppointment.bookCheckType)
   panel.addPrintText({ options: { width: 140, height: 12, top: 2, left: 20, title: checkTypeName, textAlign: 'center', fontSize: 10, fontFamily: '寰蒋闆呴粦',  fontWeight: '700', } });
   const patientBaisc = curAppointment.patName + "  " + calGender(curAppointment.patGender) + "  " + calculateAge(curAppointment.patBirthday) + "宀�"
   panel.addPrintText({ options: { width: 140, height: 12, top: 16, left: 20, title: patientBaisc, textAlign: 'center' , fontSize: 10, fontFamily: '寰蒋闆呴粦',  fontWeight: '700', } });
@@ -392,8 +540,8 @@
   panel.addPrintText({ options: { width: 140, height: 22, top: 86, left: 20, title: curAppointment.episodeId, textType: 'barcode' } });
 
 //鎵撳嵃
-  if (undefined === printMode)
-    hiprintTemplate.print2([{},{},{}]); // 鍙互浼� [瀹氫綅鍙傛暟]  http://https://ccsimple.github.io/sv-print-docs/config/template.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E8%AE%BE%E8%AE%A1%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B
+  if (printMode == null)
+    hiprintTemplate.print2([{},{},{}]); // 棰勮鏂瑰紡 鍙互浼� [瀹氫綅鍙傛暟]  http://https://ccsimple.github.io/sv-print-docs/config/template.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E8%AE%BE%E8%AE%A1%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B
   else
     hiprintTemplate.print([{},{},{}]);
 }
@@ -436,49 +584,81 @@
 */
 
 const getDevInfo = async () => {
-  deviceInfo.value.category = ''
-  deviceInfo.value.brand = ''
-  deviceInfo.value.model = ''
-  deviceInfo.value.state = 0
-  if (isStringEmpty(formData.value.devId))
+  if (formData.value?.devId == null) {
+    devInfo.value.brand = undefined
+    devInfo.value.model = undefined
+    devInfo.value.state = undefined
     return
+  }
 
   const data = await DeviceApi.getDeviceByDevId(formData.value.devId!)
-  console.info( data )
   if ( null !== data)
-    deviceInfo.value = data
+    devInfo.value = data
 }
 
 const feeConfirm = async () => {
-  const result = await DevRentApi.feeConfirm(formData.value.id)
-  if (0 == result)
-    message.success(t('鎿嶄綔鎴愬姛'))
+  if (formData.value.id == null) {
+    message.error('璇峰厛棰嗙敤')
+    return
+  }
+
+ try {
+    const result = await DevRentApi.feeConfirm(formData.value.id)
+    if (0 === result) {
+      //message.success('纭垂鎿嶄綔鎴愬姛')
+    }
+  } catch (err) {
+    // 妗嗘灦 浼氱粰鍑� 鍚庡彴鐨� 閿欒淇℃伅
+  }
 }
 
 const feeCancel = async () => {
-  const result = await DevRentApi.feeCancel(formData.value.id)
-  if (0 == result)
-    message.success(t('鎿嶄綔鎴愬姛'))
+  if (formData.value.id == null) {
+    message.error('璇峰厛棰嗙敤')
+    return
+  }
+
+  try {
+    const result = await DevRentApi.feeCancel(formData.value.id)
+    if (0 === result) {
+      //message.success('纭垂鍙栨秷鎴愬姛')
+    }
+  } catch (err) {
+    // 妗嗘灦 浼氱粰鍑� 鍚庡彴鐨� 閿欒淇℃伅
+  }
 }
 
+/**
+ * 鑾峰彇鏉″舰鐮侊紝鏄剧ず涓庡惁  鍚屼竴涓��
+ */
 const getDisplayBarcode = (): string => {
-  if (!formData.value.checkType)
+  if (formData.value.checkType == null)
     return ""
 
-  const displayBarcode: number[] = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType!)
-  if (!displayBarcode.includes( formData.value.patSrc ))
+  if (formData.value.patDetails?.source == null)
+    return ""
+
+  const displayBarcode: number[] = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType)
+  if (displayBarcode == null || displayBarcode.length === 0)
+    return ""
+
+  if (!displayBarcode.includes( formData.value.patDetails.source ))
     return ""
 
   return getBarcode()
 }
 
 const getBarcode = (): string => {
-  if (!formData.value.checkType)
+  if (formData.value.checkType == null)
     return ""
 
-  if (1 === formData.value.patSrc || 2 === formData.value.patSrc)
+  const patSource = formData.value.patDetails?.source
+  if (patSource == null)
+    return ""
+
+  if (1 === patSource || 2 === patSource)
     return formData.value.applyNo??""
-  else if (3 === formData.value.patSrc || 4 === formData.value.patSrc)
+  else if (3 === patSource || 4 === patSource)
     return formData.value.episodeId??""
 
   return ""
@@ -486,7 +666,12 @@
 
 const copyBarcode = async () => {
   displayBarCode.value = getDisplayBarcode()
-  await navigator.clipboard.writeText( getBarcode() );
+
+  const barCode = getBarcode()
+  if (isStringEmpty(barCode))
+    return
+
+  await navigator.clipboard.writeText( barCode );
 }
 
 /** 鍒濆鍖� **/
@@ -496,3 +681,71 @@
 
 </script>
 
+<style scoped lang="scss">
+/* ==========================================================================
+   闇�姹傦細琛ㄥ崟鍐呭鎸ゅ崰浜嗕笅鏂硅褰曡〃鏍肩殑绌洪棿 鈥斺�� 鍘嬬缉琛岄棿璺濄��
+   Element Plus 榛樿 `.el-form-item { margin-bottom: 18px }`锛�
+   鏈〉琛ㄥ崟鍚� 18 椤规偅鑰呬俊鎭紙4 鍒� = 5 琛岋級+ 9 椤硅澶囦俊鎭紝
+   浠呴棿璺濆氨瑕佷笂鐧� px锛屾妸 el-table 鎸ゅ埌鐪嬩笉瑙併��
+   杩欓噷缁熶竴鍘嬪埌 4px銆傛敞鎰� :deep 鏄繀闇�鐨勶紙el-form-item 鏄湰缁勪欢鐨勫瓙缁勪欢娓叉煋锛夈��
+   ========================================================================== */
+.patient-compact-form :deep(.el-form-item) {
+  margin-bottom: 4px;
+}
+
+/* ==========================================================================
+   鎮h�呬俊鎭浐瀹氬湪鍐呭鍖洪《閮ㄣ��
+   鍐呭鍖鸿嚜韬笉婊氬姩锛堟粴鍔ㄦ潯鍦ㄨ褰曡〃鏍间笂锛夛紝鍥犳**涓嶉渶瑕� position:sticky** 鈥斺��
+   鐩存帴浣滀负 flex 鐨勫浐瀹氶」锛坒lex:none锛夊嵆鍙缁堢暀鍦ㄩ《閮ㄣ��
+   鑳屾櫙涓嶉�忔槑锛屼繚璇佷笌涓嬫柟璁板綍琛ㄦ牸瑙嗚鍒嗙銆�
+   ========================================================================== */
+:deep(.doctor-page__content) > .patient-compact-form {
+  flex: none;
+  padding-bottom: 4px;
+  background-color: var(--el-bg-color);
+  border-bottom: 1px solid var(--el-border-color-lighter);
+}
+
+
+
+/* ==========================================================================
+   鎮h�呬俊鎭浐瀹氬湪鍐呭鍖洪《閮ㄣ��
+   鍐呭鍖猴紙.doctor-page__content锛夎嚜韬粴鍔紝鎵�浠ヨ繖閲屽繀椤荤敤 position:sticky
+   鎵嶈兘璁� 18 椤规偅鑰呬俊鎭湪璁板綍鍒楄〃婊氬姩鏃朵繚鎸佸彲瑙併��
+   鑳屾櫙涓嶉�忔槑锛岄伩鍏嶆粴鍔ㄥ唴瀹逛粠琛ㄥ崟椤归棿闅欓�忓嚭銆�
+   ========================================================================== */
+:deep(.doctor-page__content) > .patient-compact-form {
+  position: sticky;
+  top: 0;
+  z-index: 3;
+  padding-bottom: 4px;
+  background-color: var(--el-bg-color);
+  border-bottom: 1px solid var(--el-border-color-lighter);
+}
+
+/* ==========================================================================
+   鎮h�呮搷浣滃姛鑳藉潡锛氫綅浜庛�屾偅鑰呬俊鎭�嶄笌銆屽凡瀹屾垚璁板綍鍒楄〃銆嶄箣闂达紝鐙珛鎴愬潡銆�
+   闇�姹傦細鍚勫姛鑳芥寜閽紙妫�鏌ュ畬鎴� / 鏀惧純妫�鏌� / 閲嶇疆 / 鐭ユ儏鍚屾剰涔� 鈥︼級**鎺掑湪涓�琛�**銆�
+   鍋氭硶锛歠lex + gap锛屽苟 **绂佹鎹㈣**锛坒lex-wrap:nowrap锛夛紱
+   鎸夐挳鐢� size="small" 浠ュ绾冲叏閮ㄦ寜閽紱鍗充娇瀹藉害涓嶈冻涔熶笉鎶樿銆�
+   涓婁笅杈规 + 搴曡壊锛屼娇瀹冧笌鎮h�呬俊鎭�佽褰曞垪琛ㄥ湪瑙嗚涓婂垎鍖恒��
+   ========================================================================== */
+.patient-actions {
+  display: flex;
+  flex: none;
+  flex-wrap: nowrap;
+  gap: 8px;
+  align-items: center;
+  /* 涓婁笅鐣欑櫧 + 鍒嗛殧绾匡紝褰㈡垚鐙珛鍔熻兘鍧� */
+  padding: 6px 4px;
+  margin-bottom: 6px;
+  background-color: var(--el-bg-color);
+  border-top: 1px solid var(--el-border-color-lighter);
+  border-bottom: 1px solid var(--el-border-color-lighter);
+
+  /* Element Plus 缁欑浉閭� el-button 榛樿鍔犱簡 margin-left:12px锛屼細涓� gap 鍙犲姞锛屾竻鎺� */
+  :deep(.el-button + .el-button) {
+    margin-left: 0;
+  }
+}
+</style>

--
Gitblit v1.9.3