From be27214928a43cacff975265a7c67e2e2461fd0c Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期六, 28 十一月 2026 19:39:01 +0800
Subject: [PATCH] 打印小票
---
src/views/ecg/doctor/components/DevReadyPanel.vue | 791 ++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 657 insertions(+), 134 deletions(-)
diff --git a/src/views/ecg/doctor/components/DevReadyPanel.vue b/src/views/ecg/doctor/components/DevReadyPanel.vue
index 653fa4f..654e3a2 100644
--- a/src/views/ecg/doctor/components/DevReadyPanel.vue
+++ b/src/views/ecg/doctor/components/DevReadyPanel.vue
@@ -4,41 +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="getDisplayBarcode()" :value="getDisplayBarcode()" :width=100 />
- </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 :xs="24" :sm="12" :md="12" :lg="6">
+ <el-form-item label="妫�鏌ラ」鐩�" prop="">
+ {{getCheckTypeName(formData.checkType)}}
+ </el-form-item>
+ </el-col>
+ <el-col :xs="24" :sm="24" :md="12" :lg="12">
+ <el-form-item label="鎮h�呯紪鍙�" prop="patId">
+ <el-input v-model="formData.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" @input="getRentInfoByPatId" />
+ <Barcode v-if="showBarCode" :value="barcodeContent" :width=100 />
+ <el-button v-if="showCopyButton" :disabled="!barcodeContent" @click="copyBarcode()">澶嶅埗</el-button>
+ </el-form-item>
+ </el-col>
+ <el-col :xs="24" :sm="12" :md="12" :lg="6">
+ <el-form-item label="璁惧缂栧彿" prop="devId">
+ <el-input v-model="formData.devId" :placeholder="requireDevId ? '璇疯緭鍏ヨ澶囩紪鍙�' : '鍙暀绌�'" @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 + " " + deviceInfo.model + " " + 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>
@@ -50,20 +61,52 @@
</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="鑷姩 " 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 @click="feeConfirm" :disabled="formLoading">纭垂</el-button>
- <el-button @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-title">
+ <span class="records-title__bar"></span>
+ <span class="records-title__text">宸插畬鎴愬垪琛�</span>
+ </div>
+ <div class="records-host">
+ <ContentWrap class="records-wrap">
+ <div class="records-scroll">
+ <el-table
+ v-loading="loading"
+ :data="list"
+ :stripe="true"
+ :show-overflow-tooltip="true"
+ highlight-current-row
+ @current-change="onCurrentRowChange"
+ @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"
+ title="鍏堝湪涓嬫柟鐐归�変竴鏉″畬鎴愯褰曪紝鍐嶇偣姝ゆ挙閿�"
+ @click="undoSelected"
+ >
+ 鎾ら攢
+ </el-button>
+ </template>
+ </el-table-column>
<el-table-column label="纭垂" align="center" prop="paid">
<template #default="scope">
{{scope.row.paid == 1 ? "宸茬‘璐�" : ""}}
@@ -71,9 +114,15 @@
</el-table-column>
<el-table-column label="棰嗙敤鎯呭喌" align="center" prop="cancelled" >
<template #default="scope">
- <span v-if="scope.row.jobType === 5">"宸查鐢�"</span>
+ <!-- 銆愭湰闇�姹傘�戝畬鎴愯鎾ら攢杩囷細璇ユ潯璁板綍鏄剧ず銆屽凡鎾ら攢銆嶏紱鍐嶆瀹屾垚鏃跺悗绔� undone 鑷姩鍙樺洖 false -->
+ <el-tag v-if="scope.row.undone" type="danger" size="small">宸叉挙閿�</el-tag>
+ <span v-else-if="scope.row.jobType === 5">"宸查鐢�"</span>
<span v-if="scope.row.jobType === 30">"宸叉斁寮�"</span>
</template>
+ </el-table-column>
+ <!-- 銆�2026-11-25 闇�姹傘�戝悓涓�鎮h�呭彲鑳芥湁澶氫釜妫�鏌ラ」鐩紝宸插畬鎴愬垪琛ㄥ垪鍑烘潵鎵嶈兘鍖哄垎/绮剧‘鎾ら攢 -->
+ <el-table-column label="妫�鏌ラ」鐩�" align="center" width="150">
+ <template #default="scope">{{ getCheckTypeName(scope.row.checkType) }}</template>
</el-table-column>
<!-- <el-table-column label="浣滀笟绫诲瀷" align="center" prop="jobType" />-->
<!-- <el-table-column label="鍖荤敓缂栧彿" align="center" prop="docId" />-->
@@ -121,6 +170,8 @@
</el-table-column>
-->
</el-table>
+ </div>
+ </ContentWrap>
<!-- 鍒嗛〉 -->
<Pagination
:total="total"
@@ -128,7 +179,7 @@
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
- </ContentWrap>
+ </div>
</template>
@@ -147,8 +198,15 @@
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 { copyText } from '@/utils/copyText'
+import { getConfigKey } from '@/api/infra/config'
+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' })
@@ -157,15 +215,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锛夋彁浜ょ殑鎸夐挳绂佺敤
@@ -182,13 +250,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({
@@ -197,17 +260,38 @@
patId: [{ required: true, message: '鐩墠娌℃湁鎮h��', trigger: 'blur' }],
patName: [{ required: true, message: '鐩墠娌℃湁鎮h��', trigger: 'blur' }]
})
+
+/**
+ * 銆愮郴缁熷弬鏁般�戝姩鎬佽鍘嬪拰蹇冪數璁惧棰嗙敤瀹夎鐧昏璁惧缂栧彿
+ * 鍊尖�滄槸鈥濓紙榛樿锛夆啋 璁惧缂栧彿蹇呭~锛�
+ * 鍊尖�滃惁鈥� 鈫� 鍏佽涓嶅~锛堟牎楠岃鍒欏悓姝ユ斁寮�锛夈��
+ */
+const requireDevId = ref(true)
+const loadDevIdRequired = async () => {
+ try {
+ const value = await getConfigKey('ecg.dev.rent.device.no.required')
+ const text = String(value ?? '').trim()
+ requireDevId.value = !(
+ text === '鍚�' || text === '0' ||
+ text.toLowerCase() === 'false' || text.toLowerCase() === 'no'
+ )
+ } catch (e) {
+ console.warn('[DevReadyPanel] 璇诲彇鈥滆澶囩紪鍙峰繀濉�濈郴缁熷弬鏁板け璐ワ紝鎸夊繀濉鐞�', e)
+ requireDevId.value = true
+ }
+ formRules.devId = requireDevId.value
+ ? [{ required: true, message: '璁惧缂栧彿涓嶈兘涓虹┖', trigger: 'blur' }]
+ : []
+}
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 getRentInfoByPatId = () => {
const tempPatId = formData.value.patId;
@@ -221,18 +305,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.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 false
+ }
+
// 鏍¢獙琛ㄥ崟
await formRef.value.validate()
// 鎻愪氦璇锋眰
@@ -240,21 +358,29 @@
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) {
+ const apptId = formData.value.patDetails?.appointmentId
+ // 銆愭湰娆′慨澶嶃�戣嚜鍔ㄦ墦鍗版椂鑻ユ病鏈夐绾﹀崟鍙峰氨**闈欓粯璺宠繃**锛�
+ // 鎵嬪姩鐐广�屾墦鍗板皬绁ㄣ�嶄細缁欏嚭"鏃犻绾﹀崟"鐨勬彁绀猴紝浣嗛鐢ㄥ畬鎴愬悗鐨勮嚜鍔ㄦ墦鍗颁笉璇ュ脊璀﹀憡鎵撴柇娴佺▼銆�
+ if (apptId != null) {
+ printBill(apptId)
+ }
+ }
- 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('鎿嶄綔瀹屾垚'))
+ return true
} finally {
formLoading.value = false
}
@@ -278,33 +404,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,
- patDeptCode: undefined,
- patDeptDesc: undefined,
- patWardCode: undefined,
- patWardDesc: undefined,
- patBedNo: 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) => {
@@ -314,15 +452,51 @@
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
+ // 銆愭湰娆′慨澶嶃�戞潯鐮�/鎵撳嵃灏忕エ渚濊禆 patDetails锛堝惈 source/appointmentId锛夛紝
+ // 闃熷垪琛屾湰灏卞甫鐫�瀹冿紱鍘熷厛鍙湪 getFreeRentInfo() 鏌ュ埌"寰呮鏌ュ崟"鏃舵墠璧嬪�硷紝
+ // 瀵艰嚧缁濆ぇ澶氭暟鎯呭喌涓� patDetails 涓� undefined 鈫� 鏉$爜涓嶆樉绀恒��
+ formData.value.patDetails = queueVO?.patDetails
+ 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 琛�
}
-defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
+/**
+ * 銆愬彨鍙疯嚜鍔ㄥ畬鎴愩�戜緵鐖堕〉闈㈢偣銆屽彨鍙枫�嶆椂鍏堣嚜鍔ㄥ畬鎴愬綋鍓嶆偅鑰咃紙绛夊悓鐐广�岄鐢ㄥ畬鎴愩�嶏級銆�
+ */
+const completeCurrent = async (): Promise<boolean> => {
+ try {
+ return (await submitForm()) === true
+ } catch (e) {
+ console.warn('[DevReadyPanel] 鑷姩銆岄鐢ㄥ畬鎴愩�嶅け璐�', e)
+ return false
+ }
+}
+defineExpose({ setPatient, getList: () => getList(), completeCurrent }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑
const list = ref<JobRecordVO[]>([]) // 鍒楄〃鐨勬暟鎹�
const total = ref(0) // 鍒楄〃鐨勬�婚〉鏁�
+// 褰撳墠璇婂淇℃伅锛堢敤浜庡彇璇婂寮�灞曠殑妫�鏌ラ」鐩仛鍏滃簳锛岃 syncRoomCheckTypes锛�
+const roomStore = useRoomStore()
+
+
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@@ -335,19 +509,67 @@
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)
list.value = data.list
total.value = data.total
+ // 鍒楄〃鍒锋柊鍚庢棫鐨勯�変腑琛屽凡澶辨晥锛屾竻鎺夛紝閬垮厤銆屾挙閿�銆嶄綔鐢ㄥ埌涓婁竴灞忕殑璁板綍
+ selectedRecord.value = undefined
} finally {
loading.value = false
}
+}
+
+/** 銆�2026-11-25 闇�姹傘�戝凡瀹屾垚鍒楄〃鐨勯�変腑琛岋細鎾ら攢鍓嶅厛鐐归�変竴鏉★紝鎾ら攢浣滅敤鍦ㄩ�変腑璁板綍涓� */
+const selectedRecord = ref<any>()
+const onCurrentRowChange = (row: any) => {
+ selectedRecord.value = row || undefined
+}
+
+/** 鎾ら攢锛氬彧鎾ら攢褰撳墠閫変腑鐨勯偅鏉″畬鎴愯褰曪紙鏈�変腑鏃舵彁绀猴紝涓嶅啀榛樿鎾ら攢"鏈�杩戜竴鏉�"锛� */
+const undoSelected = () => {
+ if (!selectedRecord.value) {
+ message.warning('璇峰厛鍦ㄣ�屽凡瀹屾垚鍒楄〃銆嶄腑鐐归�変竴鏉¤褰曪紝鍐嶇偣銆屾挙閿�銆�')
+ return
+ }
+ emit('event_undo_finish', {
+ ...selectedRecord.value,
+ checkTypeName: getCheckTypeName(selectedRecord.value.checkType)
+ })
}
const onRowClick = (cur) => {
@@ -356,13 +578,46 @@
}
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) => {
+/**
+ * 銆愭湰娆′慨澶嶃�戠瓑寰� hiprint 鎵撳嵃瀹㈡埛绔氨缁紙鏈�澶氱害 800ms锛夈��
+ *
+ * 鎵撳嵃瀹㈡埛绔槸**鏈満** websocket 鏈嶅姟锛堥粯璁� http://localhost:17521锛夛紝
+ * `print2()`锛堥潤榛樻墦鍗帮級瑕佹眰瀹冨凡杩炴帴锛涢娆$偣鍑绘椂 socket 鍙兘杩樺湪杩炴帴涓紝
+ * 杩欓噷鐭殏杞锛岄伩鍏�"鏈満鏄庢槑瑁呬簡瀹㈡埛绔紝鍗村洜涓烘病杩炰笂鑰屾墦涓嶅嚭绁�"銆�
+ *
+ * @returns true = 瀹㈡埛绔彲鐢紝鍙潤榛樻墦鍗帮紱false = 涓嶅彲鐢紝搴斿洖閫�娴忚鍣ㄦ墦鍗�
+ */
+const waitPrintClientOpened = async (tpl: any, timeoutMs = 800): Promise<boolean> => {
+ if (typeof tpl?.clientIsOpened !== 'function') return false
+ if (tpl.clientIsOpened()) return true
+ const step = 100
+ for (let waited = 0; waited < timeoutMs; waited += step) {
+ // eslint-disable-next-line no-await-in-loop
+ await new Promise((resolve) => setTimeout(resolve, step))
+ if (tpl.clientIsOpened()) return true
+ }
+ return false
+}
- const curAppointment: AppointmentVO = await AppointmentApi.getCurAppointmentByPatIdAndCheckType( patId, checkType )
- console.info( curAppointment )
+const printBill = async (appointmentId: number | null | undefined, printMode?: number) => {
+ // 銆愭湰娆′慨澶嶃�戝師鏉ヨ繖閲岀洿鎺� return锛岀幇鍦鸿〃鐜版槸"鐐广�屾墦鍗板皬绁ㄣ�嶅畬鍏ㄦ病鍙嶅簲"銆�
+ // 灏忕エ鍐呭鍙栬嚜**棰勭害鍗�**锛屾病鏈夐绾﹀崟鍙峰氨娌℃湁鍙墦鍗扮殑鍐呭 鈥斺�� 杩欓噷鏄庣‘鎻愮ず銆�
+ if (appointmentId == null) {
+ message.warning('璇ユ偅鑰呮病鏈夊叧鑱旂殑棰勭害鍗曪紙缂哄皯棰勭害鍗曞彿锛夛紝鏃犳硶鎵撳嵃灏忕エ')
+ return
+ }
+
+ const curAppointment: AppointmentVO = await AppointmentApi.getAppointment( appointmentId )
// 寮曞叆鍚庝娇鐢ㄧず渚�
hiprint.init({
@@ -372,27 +627,126 @@
// 涓嬪垪鏂规硶閮芥槸娌℃湁鎷栨嫿璁捐椤甸潰鐨�, 鐩稿綋浜庝唬鐮佹ā寮�, 浣跨敤浠g爜璁捐椤甸潰
// 鎯宠瀹炵幇鎷栨嫿璁捐椤甸潰,璇峰線涓嬬湅 '鑷畾涔夎璁�'
var hiprintTemplate = new hiprint.PrintTemplate(); // 鍙紶鍙傛暟
- //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)
- panel.addPrintText({ options: { width: 140, height: 12, top: 2, left: 20, title: checkTypeName, textAlign: 'center', fontSize: 10, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
+
+// ============================================================================
+// 銆愭湰娆¤皟鏁绰烽�傞厤寰楀疄 DL-210 + 鐑晱绾� 50脳30mm銆�
+//
+// 鎵撳嵃鏈猴細寰楀疄 DL-210锛�203dpi = 8 dots/mm锛屽彲鎵撳嵃瀹藉害 108mm锛孶SB 鍙o級
+// 鑰楁潗 锛氱儹鏁忔爣绛剧焊 50mm(瀹�) 脳 30mm(楂�)
+//
+// 涔嬪墠妯℃澘鏄� 140脳130mm锛堢粰 A4/澶ч潰鍗曠敤鐨勶級锛屾瘮 50mm 绾稿鍑� 90mm 鈬� 椹卞姩鎸� 50mm 缂╂斁锛�
+// 瀛椾笌鏉$爜浼氳鍘嬪緱寰堝皬/瑁佸垏銆傝繖閲屾暣浣撴敼涓� 50脳30mm锛屽苟鎸夊皬绾搁噸鎺掍负 **5 琛� + 1 鏉$爜**锛�
+//
+// y 0.8mm 鈹�鈹� 妫�鏌ラ」鐩紙10pt 鍔犵矖灞呬腑锛�
+// y 5.6mm 鈹�鈹� 濮撳悕 鎬у埆 骞撮緞锛�9pt 鍔犵矖灞呬腑锛�
+// y10.0mm 鈹�鈹� 鐥呭尯-搴婂彿锛堝乏鍗婏級 | 棰勭害 11-28 08:00锛堝彸鍗婏級 7.5pt
+// y14.0mm 鈹�鈹� 鎮h�呯紪鍙凤紙宸﹀崐锛� | 鎵嬫満鍙凤紙鍙冲崐锛� 7.5pt
+// y18.4mm 鈹�鈹� 鏉″舰鐮侊紙楂� 10.8mm锛屽 46mm锛涘唴瀹� = 灏辫瘖娴佹按鍙� episodeId锛�
+//
+// 鈿狅笍銆愬崟浣嶅潙路2026-11-28 瀹炴祴銆慼iprint 鐨� **闈㈡澘**灏哄 `addPrintPanel({width,height})` 鐢� **mm**锛�
+// 浣�**鍏冪礌**鐨� `top/left/width/height` 鐢� **pt**锛堟簮鐮侊細`options.displayLeft()` 杩斿洖 `left+"pt"`锛�
+// 鍏冪礌榛樿 height=9.75 / width=120 涔熼兘鏄� pt锛夈�傜涓�鐗堟妸鍏冪礌鍧愭爣涔熷綋 mm 浼犲叆锛�0.6/5/8.8鈥︼級锛�
+// 缁撴灉 27.4"mm" 瀹為檯鍙湁 27.4pt鈮�9.7mm 鈬� 鎵�鏈夋枃瀛�/鏉$爜鎸ゅ湪鏍囩椤堕儴銆佷簰鐩搁噸鍙犮��
+// 鐜板湪缁熶竴锛�**甯冨眬浠嶆寜 mm 鍐�**锛岃繘鍏� hiprint 鍓嶇敤 mm2pt() 鎹㈢畻锛�1mm = 72/25.4 pt锛夈��
+// ============================================================================
+ const PAPER_W = 50 // 鏍囩绾稿 mm锛堥潰鏉垮崟浣�=mm锛�
+ const PAPER_H = 30 // 鏍囩绾搁珮 mm锛堥潰鏉垮崟浣�=mm锛�
+ /** 1mm = 2.83465pt */
+ const PT_PER_MM = 72 / 25.4
+ /** mm 鈫� pt锛堝厓绱犲潗鏍�/灏哄鐢級 */
+ const mm2pt = (v: number) => Math.round(v * PT_PER_MM * 100) / 100
+ // 銆愭墦鍗颁唤鏁般�戞寮忓彛寰� = 2 寮狅紙鎮h�� 1 寮� + 绉戝鐣欏瓨 1 寮狅級銆�
+ // 鎯虫敼浠芥暟鍙敼杩欎竴涓暟瀛楋細鏀� 1 = 娴嬭瘯鐪佺焊锛涙敼 3 = 涓夎仈銆�
+ const PRINT_COPIES = 2
+ var panel = hiprintTemplate.addPrintPanel({ width: PAPER_W, height: PAPER_H, paperNumberDisabled:true});
+
+ const FONT = '寰蒋闆呴粦'
+ /**
+ * 鍔犱竴琛屾枃鏈紙缁熶竴瀛椾綋/灞呬腑锛夈��
+ * 鍏ュ弬鍗曚綅锛�**mm**锛堝唴閮ㄦ崲绠楁垚 hiprint 闇�瑕佺殑 pt锛夛紱fontSize 鍗曚綅鏄� **pt**銆�
+ */
+ const addLine = (opts: {
+ top: number; left?: number; width?: number; height?: number;
+ title: string; fontSize?: number; bold?: boolean; align?: string;
+ }) => {
+ panel.addPrintText({
+ options: {
+ left: mm2pt(opts.left ?? 1),
+ top: mm2pt(opts.top),
+ width: mm2pt(opts.width ?? PAPER_W - 2),
+ height: mm2pt(opts.height ?? 3.6),
+ title: opts.title ?? '',
+ textAlign: opts.align ?? 'center',
+ fontSize: opts.fontSize ?? 8,
+ fontFamily: FONT,
+ fontWeight: opts.bold === false ? '400' : '700'
+ }
+ })
+ }
+
+// 鈶� 妫�鏌ラ」鐩紙y 0.8~5.4mm锛�
+ const checkTypeName = getCheckTypeName(curAppointment.bookCheckType)
+ addLine({ top: 0.8, height: 4.6, title: checkTypeName, fontSize: 10 })
+// 鈶� 濮撳悕 鎬у埆 骞撮緞锛坹 5.6~9.6mm锛�
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', } });
- const ward_bed = curAppointment.patWardDesc + "-" + curAppointment.patBedNo
- panel.addPrintText({ options: { width: 140, height: 12, top: 30, left: 20, title: ward_bed, textAlign: 'center', fontSize: 10, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
- const bookTime = formatTimestamp(curAppointment.bookDate) + " " + getBookBeginTime(curAppointment.bookTimeslot)
- panel.addPrintText({ options: { width: 140, height: 12, top: 44, left: 20, title: bookTime, textAlign: 'center', fontSize: 10, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
- panel.addPrintText({ options: { width: 140, height: 12, top: 58, left: 20, title: curAppointment.patId, textAlign: 'center', fontSize: 10, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
- panel.addPrintText({ options: { width: 140, height: 12, top: 72, left: 20, title: curAppointment.patMobile, textAlign: 'center', fontSize: 10, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
- //鏉″舰鐮�
- panel.addPrintText({ options: { width: 140, height: 22, top: 86, left: 20, title: curAppointment.episodeId, textType: 'barcode' } });
+ addLine({ top: 5.6, height: 4.0, title: patientBaisc, fontSize: 9 })
+// 鈶� 鐥呭尯-搴婂彿 | 棰勭害鏃堕棿锛坹 10.0~13.6mm锛�"2026-11-28 08:00" 缂╂垚 "11-28 08:00"锛�
+ const ward_bed = (curAppointment.patWardDesc || '') + (curAppointment.patBedNo ? "-" + curAppointment.patBedNo : '')
+ addLine({ top: 10.0, height: 3.6, left: 1.5, width: 22, title: ward_bed, fontSize: 7.5 })
+ const bookTime = formatTimestamp(curAppointment.bookDate).slice(5) + " " + getBookBeginTime(curAppointment.bookTimeslot)
+ addLine({ top: 10.0, height: 3.6, left: 24, width: 25, title: bookTime, fontSize: 7.5 })
+// 鈶� 鎮h�呯紪鍙� | 鎵嬫満鍙凤紙y 14.0~17.6mm锛�
+ addLine({ top: 14.0, height: 3.6, left: 1.5, width: 22, title: curAppointment.patId ?? '', fontSize: 7.5 })
+ addLine({ top: 14.0, height: 3.6, left: 24, width: 25, title: curAppointment.patMobile ?? '', fontSize: 7.5 })
+// 鈶� 鏉″舰鐮侊紙鍐呭 = 灏辫瘖娴佹按鍙凤紱鍧愭爣鍚屾牱 mm鈫抪t锛�
+//
+// 銆�"娌″眳涓�"銆戔憼 鍏冪礌鎸夊唴瀹圭畻瀹藉悗 `left = (50-w)/2` 绮剧‘灞呬腑锛�
+// 鈶� hiprint 鐨勬潯褰� svg 鏄� `width:100%`锛屽搴﹂殢鍏冪礌璧帮紝鎵�浠ュ厓绱犲搴︿笉鑳介殢鎵嬬粰銆�
+// 銆�"鏁板�煎お浣�"銆慼iprint 鏉$爜鍏冪礌鍐呴儴鏄細
+// <svg class="hibarcode_imgcode" width=100% height=100%> + <div class="hibarcode_displayValue">鏁板��</div>
+// 鏉″舰鍗犳弧鍏冪礌楂樺害锛屾暟鍊� div 鎺掑湪鍏冪礌鐩掑瓙**涔嬩笅**锛屽厓绱犱竴楂樻暟鍊煎氨琚帹鍒扮焊杈癸紙鐢氳嚦浼氭帀鍒扮浜岄〉/琚锛夈��
+// 鍥犳杩欓噷锛�**鍏虫帀瀹冭嚜甯︾殑鏁板�硷紙hideTitle锛�**锛屾敼鐢辨垜浠嚜宸辩揣璐存潯鐮佺敾涓�琛屽眳涓暟鍊硷紙浣嶇疆鍙帶锛夈��
+ const barcodeText = curAppointment.episodeId ?? ''
+ const isPureDigits = /^\d+$/.test(barcodeText)
+ // CODE128 妯″潡鏁帮細璧峰 11 + 鏁版嵁 + 鏍¢獙 11 + 缁堟 13锛�
+ // 绾暟瀛楀伓鏁颁綅璧� CODE128-C锛�2 浣�/绗﹀彿锛夛紝鍚﹀垯璧� CODE128-B锛�1 浣�/绗﹀彿锛�
+ const barcodeModules = isPureDigits && barcodeText.length % 2 === 0
+ ? 11 + (barcodeText.length / 2) * 11 + 11 + 13
+ : 11 + barcodeText.length * 11 + 11 + 13
+ // JsBarcode 閲� 1 妯″潡 = 1px 鈮� 0.2646mm锛�+1mm 浣欓噺锛屽苟闄愬埗鍦� 18~40mm锛堝お绐勪細绯娿�佸お瀹借秴鍑虹焊闈級
+ const barcodeWidthMm = Math.min(40, Math.max(18, barcodeModules * 0.2646 + 1))
+ const barcodeLeftMm = (PAPER_W - barcodeWidthMm) / 2
+ const BARCODE_TOP = 17.4 // 鏉″舰璧峰
+ const BARCODE_H = 8.2 // 鏉″舰楂樺害锛�203dpi 鈮� 66 鐐归珮锛屾壂鐮佽冻澶燂級
+ panel.addPrintText({
+ options: {
+ left: mm2pt(barcodeLeftMm),
+ top: mm2pt(BARCODE_TOP),
+ width: mm2pt(barcodeWidthMm),
+ height: mm2pt(BARCODE_H),
+ title: barcodeText,
+ textType: 'barcode',
+ hideTitle: true // 涓嶈 hiprint 鑷甫鐨勬暟鍊硷紙瀹冨湪鍏冪礌涓嬫柟锛屼細鎶婂唴瀹归《鍑虹焊闈級
+ }
+ });
+ // 鈶�-2 鏁板�硷細绱ц创鏉$爜涓嬫柟 0.9mm锛屽眳涓紙涓庢潯鐮佸悓瀹斤紝瓒呭嚭浼氳鎴柇锛�
+ addLine({ top: BARCODE_TOP + BARCODE_H + 0.9, height: 3.0, title: barcodeText, fontSize: 7.5 })
//鎵撳嵃
- 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
- else
- hiprintTemplate.print([{},{},{}]);
+// 銆愭湰娆′慨澶嶃�戜紭鍏�"闈欓粯鎵撳嵃"锛堥渶瑕佹湰鏈� hiprint 鎵撳嵃瀹㈡埛绔級锛�
+// 瀹㈡埛绔湭杩炴帴/鏈畨瑁呮椂**鍥為��娴忚鍣ㄦ墦鍗�**锛堝脊鎵撳嵃瀵硅瘽妗嗭級锛岄伩鍏嶅彧鎶ャ�岃繛鎺ュ鎴风澶辫触銆嶈�屾墦涓嶅嚭绁ㄣ��
+// 路 printMode == null 鈫� 鏈熸湜闈欓粯鎵撳嵃锛堟湰鏈烘湁瀹㈡埛绔椂锛�
+// 路 printMode != null 鈫� 鏄庣‘瑕佹眰娴忚鍣ㄦ墦鍗帮紙鍘熼�昏緫淇濈暀锛�
+//
+// 銆愭墦鍗颁唤鏁般�慼iprint 鐨勫叆鍙傛暟缁勯暱搴� = 椤垫暟锛堟瘡鍏冪礌涓�椤碉級銆�
+// 姝e紡鍙e緞 = 2 寮狅紱浠芥暟鍙湪 PRINT_COPIES 涓�澶勭淮鎶わ紙1=娴嬭瘯鐪佺焊锛�3=涓夎仈锛夈��
+ const pages: any[] = Array.from({ length: PRINT_COPIES }, () => ({}))
+ if (printMode == null && (await waitPrintClientOpened(hiprintTemplate))) {
+ hiprintTemplate.print2(pages); // 闈欓粯鎵撳嵃锛堟湰鏈哄鎴风锛� 鍙紶 [瀹氫綅鍙傛暟] 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 {
+ console.info('[printBill] 鎵撳嵃瀹㈡埛绔湭灏辩华锛屽洖閫�涓烘祻瑙堝櫒鎵撳嵃锛屼唤鏁�=' + PRINT_COPIES)
+ hiprintTemplate.print(pages);
+ }
}
/* hiprint 绀轰緥
// 寮曞叆鍚庝娇鐢ㄧず渚�
@@ -433,51 +787,220 @@
*/
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) {
+ 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 = () => {
- if (!formData.value.checkType)
- return ""
+/**
+ * 鑾峰彇鏉″舰鐮侊紝鏄剧ず涓庡惁 鍚屼竴涓��
+ */
+/**
+ * 銆愭湰闇�姹傘�戞偅鑰呮潯鐮佸彛寰勶紙闂ㄨ瘖/鎬ヨ瘖/浣撴 = 灏辫瘖娴佹按鍙凤紱浣忛櫌涓嶅嚭鏉$爜锛屽彧鐣欍�屽鍒躲�嶏級
+ *
+ * 路 闂ㄨ瘖(1) / 鎬ヨ瘖(2) / 浣撴(4) 鈫� 鏉$爜鍐呭 = **灏辫瘖娴佹按鍙�**锛坋pisodeId锛�
+ * 路 浣忛櫌(3) 鈫� **涓嶆樉绀烘潯鐮�**锛屽彧淇濈暀銆屽鍒躲�嶆寜閽紙澶嶅埗鍐呭鍚屾牱鏄氨璇婃祦姘村彿锛�
+ * 路 銆屽鍒躲�嶆寜閽笌鏉$爜涓�鑷达細鍚屽彈銆屾鏌ョ被鍨� 鈫� 鎮h�呮潯鐮佹樉绀恒�嶉厤缃帶鍒�
+ * 锛堣妫�鏌ョ被鍨嬫湭鍕鹃�夎繖涓偅鑰呮潵婧愭椂锛屾潯鐮佸拰澶嶅埗鎸夐挳閮戒笉鏄剧ず锛�
+ */
+const patSourceValue = computed<number | null>(() => {
+ const source = formData.value.patDetails?.source ?? formData.value.patSrc
+ return source === null || source === undefined || source === '' ? null : Number(source)
+})
- const displayBarcode: number[] = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType!)
- if (!displayBarcode.includes( formData.value.patSrc ))
- return ""
+/** 鏄惁閫氳繃浜嗐�屾偅鑰呮潯鐮佹樉绀恒�嶉厤缃紙鍕鹃�変簡褰撳墠鎮h�呮潵婧愶級 */
+const barcodeEnabled = computed<boolean>(() => {
+ if (formData.value.checkType == null) return false
+ const displayBarcode: number[] | undefined = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType)
+ if (displayBarcode == null || displayBarcode.length === 0) return false
+ const patSource = patSourceValue.value
+ if (patSource == null) return false
+ return displayBarcode.map(Number).includes(patSource)
+})
- 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
+/** 鏉$爜 / 澶嶅埗鐨勫唴瀹癸細缁熶竴鍙栥�屽氨璇婃祦姘村彿銆� */
+const barcodeContent = computed<string>(() =>
+ barcodeEnabled.value ? (formData.value.episodeId ?? '') : ''
+)
- return ""
+/** 鏄惁鏄剧ず鏉$爜锛氫綇闄紙鏉ユ簮 3锛変笉鏄剧ず锛涘唴瀹逛负绌烘椂涔熶笉鏄剧ず */
+const showBarCode = computed<boolean>(
+ () => barcodeEnabled.value && patSourceValue.value !== 3 && barcodeContent.value !== ''
+)
+
+/** 鏄惁鏄剧ず銆屽鍒躲�嶆寜閽細涓庢潯鐮佷竴鑷达紙鍚屽彈閰嶇疆鎺у埗锛� */
+const showCopyButton = computed<boolean>(() => barcodeEnabled.value)
+
+const copyBarcode = async () => {
+ if (!barcodeContent.value) return
+ // 銆愬吋瀹� Chrome 85 / http 璁块棶銆戦潪瀹夊叏涓婁笅鏂囦笅 navigator.clipboard 涓嶅彲鐢紝鐢ㄥ吋瀹瑰疄鐜�
+ const ok = await copyText(barcodeContent.value)
+ if (ok) {
+ message.success('宸插鍒�')
+ } else {
+ message.warning('褰撳墠娴忚鍣ㄤ笉鏀寔鑷姩澶嶅埗锛岃鎵嬪姩閫変腑澶嶅埗')
+ }
}
/** 鍒濆鍖� **/
onMounted(() => {
getList()
+ loadDevIdRequired()
})
</script>
+<style scoped lang="scss">
+
+/* 銆愭湰娆¢渶姹傘�戙�屽凡瀹屾垚鍒楄〃銆嶆爣棰樻爮锛氬乏渚т富鑹茬珫绾� + 鍔犵矖灏忔爣棰橈紝绱у噾楂樺害涓嶆尋鍘嬭〃鏍� */
+.records-title {
+ display: flex;
+ align-items: center;
+ flex: none;
+ gap: 6px;
+ padding: 2px 0 6px;
+
+ &__bar {
+ width: 3px;
+ height: 14px;
+ background-color: var(--el-color-primary);
+ border-radius: 2px;
+ }
+
+ &__text {
+ font-size: 15px;
+ font-weight: 600;
+ color: var(--el-text-color-primary);
+ }
+}
+/* ==========================================================================
+ 闇�姹傦細琛ㄥ崟鍐呭鎸ゅ崰浜嗕笅鏂硅褰曡〃鏍肩殑绌洪棿 鈥斺�� 鍘嬬缉琛岄棿璺濄��
+ 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;
+ /* 鎸夐挳澶氭椂鍏佽鎹㈣锛岄伩鍏嶆尋鍦ㄤ竴琛岋紙妫�鏌ラ〉鏈�澶� 6 涓寜閽級 */
+ flex-wrap: wrap;
+ gap: 8px;
+ align-items: center;
+ /*
+ 銆愭湰娆¢渶姹傘�戞搷浣滃姛鑳藉尯鍋氫竴鐐硅瑙夊尯鍒嗭紝鏂逛究鍖荤敓涓�鐪煎畾浣嶏細
+ 鏋佹祬鐨勪富鑹插簳 + 缁嗚竟妗� + 宸︿晶 3px 涓昏壊绔栨潯锛堜笌銆屸枎宸插畬鎴愬垪琛ㄣ�嶆爣棰樻潯鍚屾璇█锛夈��
+ 鍙仛"绋嶆湁鍖哄垎"锛屼笉鏀规寜閽湰韬殑灏哄/棰滆壊/椤哄簭銆�
+ */
+ padding: 8px 10px;
+ margin: 2px 0 10px;
+ background-color: var(--el-color-primary-light-9);
+ border: 1px solid var(--el-color-primary-light-7);
+ border-left: 3px solid var(--el-color-primary);
+ border-radius: 4px;
+
+ /* Element Plus 缁欑浉閭� el-button 榛樿鍔犱簡 margin-left:12px锛屼細涓� gap 鍙犲姞锛屾竻鎺� */
+ :deep(.el-button + .el-button) {
+ margin-left: 0;
+ }
+}
+
+/* ==========================================================================
+ 銆�2026-11-25 闇�姹傘�戝凡瀹屾垚鍒楄〃锛氬彧鏄剧ず 4 琛屽乏鍙筹紝瓒呰繃灏卞嚭鐜扮旱鍚戞粴鍔ㄦ潯
+ 锛堝疄娴嬭楂� 40px銆佽〃澶� 63px 鈫� 63 + 4脳40 + 2 = 225px锛夈��
+ ========================================================================== */
+.records-scroll {
+ max-height: 225px;
+ min-height: 120px;
+ overflow-y: auto;
+ overflow-x: hidden;
+
+ :deep(.el-table__header-wrapper) {
+ position: sticky;
+ top: 0;
+ z-index: 2;
+ background-color: var(--el-bg-color);
+ }
+}
+</style>
--
Gitblit v1.9.3