From ebee36ca9a39b59d98da3613804791faa8dd2da6 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期六, 22 十一月 2025 16:20:52 +0800
Subject: [PATCH] 打印完善
---
src/views/ecg/doctor/components/DevReadyPanel.vue | 53 ++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/src/views/ecg/doctor/components/DevReadyPanel.vue b/src/views/ecg/doctor/components/DevReadyPanel.vue
index de29af4..fdefbb9 100644
--- a/src/views/ecg/doctor/components/DevReadyPanel.vue
+++ b/src/views/ecg/doctor/components/DevReadyPanel.vue
@@ -40,6 +40,10 @@
placeholder="閫夋嫨棰嗙敤鏃堕棿"
/>
</el-form-item>
+ <el-form-item label="鏄惁澶氳��" prop="tolerance">
+ <el-tag type="info" v-if="formData.tolerance == 0">鍚�</el-tag>
+ <el-tag type="danger" v-else>鏄�</el-tag>
+ </el-form-item>
<el-form-item label="澶囨敞" prop="remark">
<el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" />
</el-form-item>
@@ -54,7 +58,7 @@
</el-form>
<el-button @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.patDetails?.appointmentId)">鎵撳嵃灏忕エ</el-button>
<el-button @click="cancelReady" :disabled="formLoading">鏀惧純棰嗙敤</el-button>
<el-button @click="resetForm()">閲� 缃�</el-button>
<el-button v-if="needAutoFeeConfirm(formData.checkType)" @click="feeConfirm" :disabled="formLoading">纭垂</el-button>
@@ -147,7 +151,7 @@
import {AppointmentApi, AppointmentVO} from "@/api/ecg/appointment";
import {useCheckTypeStore} from '@/store/modules/checkType'
import {calGender, getBookBeginTime} from "@/utils";
-import {DICT_TYPE} from "@/utils/dict";
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import {tranlateDevState} from "@/utils/statusFormatter";
import {getCheckTypeName, needAutoFeeConfirm} from "../../../../utils/checkTypeFormatter";
@@ -241,7 +245,7 @@
await DevRentApi.devReady(formData.value)
if (autoPrint.value && formData.value.patId && formData.value.checkType) {
- printBill(formData.value.patId, formData.value.checkType)
+ printBill(formData.value.patDetails?.appointmentId)
}
// 鑷姩纭垂
@@ -357,10 +361,11 @@
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({
@@ -445,26 +450,39 @@
const feeConfirm = async () => {
if (formData.value.id == null) {
- message.error(t('璇峰厛棰嗙敤'))
+ message.error('璇峰厛棰嗙敤')
return
}
- const result = await DevRentApi.feeConfirm(formData.value.id)
- if (0 === result)
- message.success(t('纭垂鎿嶄綔鎴愬姛'))
+ try {
+ const result = await DevRentApi.feeConfirm(formData.value.id)
+ if (0 === result) {
+ //message.success('纭垂鎿嶄綔鎴愬姛')
+ }
+ } catch (err) {
+ // 妗嗘灦 浼氱粰鍑� 鍚庡彴鐨� 閿欒淇℃伅
+ }
}
const feeCancel = async () => {
if (formData.value.id == null) {
- message.error(t('璇峰厛棰嗙敤'))
+ message.error('璇峰厛棰嗙敤')
return
}
- const result = await DevRentApi.feeCancel(formData.value.id)
- if (0 === result)
- message.success(t('鎿嶄綔鎴愬姛'))
+ try {
+ const result = await DevRentApi.feeCancel(formData.value.id)
+ if (0 === result) {
+ //message.success('纭垂鍙栨秷鎴愬姛')
+ }
+ } catch (err) {
+ // 妗嗘灦 浼氱粰鍑� 鍚庡彴鐨� 閿欒淇℃伅
+ }
}
+/**
+ * 鑾峰彇鏉″舰鐮侊紝鏄剧ず涓庡惁 鍚屼竴涓��
+ */
const getDisplayBarcode = (): string => {
if (formData.value.checkType == null)
return ""
@@ -500,7 +518,12 @@
const copyBarcode = async () => {
displayBarCode.value = getDisplayBarcode()
- await navigator.clipboard.writeText( getBarcode() );
+
+ const barCode = getBarcode()
+ if (isStringEmpty(barCode))
+ return
+
+ await navigator.clipboard.writeText( barCode );
}
/** 鍒濆鍖� **/
--
Gitblit v1.9.3