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/appointment/CheckItemPanel.vue | 130 ++++++++++++++++++++++++++++++++++++++++---
1 files changed, 121 insertions(+), 9 deletions(-)
diff --git a/src/views/ecg/appointment/CheckItemPanel.vue b/src/views/ecg/appointment/CheckItemPanel.vue
index 58dd1ff..70f48f6 100644
--- a/src/views/ecg/appointment/CheckItemPanel.vue
+++ b/src/views/ecg/appointment/CheckItemPanel.vue
@@ -2,30 +2,130 @@
import {defineComponent, PropType} from "vue";
import {useCheckTypeStore} from "@/store/modules/checkType";
import {AppointmentApi, AppointmentVO} from "@/api/ecg/appointment";
-import {dateFormatter2, formatDate} from "@/utils/formatTime";
import {formatTimeslot} from "@/utils/formatter";
+import {calculateAge, formatTimestamp, isCurrentDay} from "@/utils/dateUtil";
+import {QueueSequenceApi, QueueSequenceVO} from "@/api/ecg/queuesequence";
+import {formatDate} from "../../../utils/formatTime";
+import { cloneDeep } from 'lodash-es'
+import {hiprint} from "vue-plugin-hiprint";
+import {calGender, getBookBeginTime} from "@/utils";
defineComponent({
name: 'CheckItemPanel'
})
-const props = defineProps({
+const props = defineProps({
appointment: {
type: Object as PropType<AppointmentVO>,
required: true
}
})
+const emit = defineEmits(['event_appoint_confirm']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋�
+
const checkTypeStore = useCheckTypeStore();
+const checkTypeTimeslotList = ref<QueueSequenceVO>()
+const bookTimeSlotVip = ref<number>()
+
+const bookSeqNum = ref<number>()
+
const _confirmAppointment = async () => {
- const data = await AppointmentApi.confirmAppointment(props.appointment)
- ElNotification({
- title: '娓╅Θ鎻愮ず',
- message: data,
- type: 'warning'
- })
+ if (!isCurrentDay(props.appointment.bookDate)) {
+ ElMessageBox.confirm(
+ '闈炲綋澶╅绾﹂」锛岀‘瀹氳浠婂ぉ妫�鏌ュ悧锛�',
+ 'Warning',
+ {
+ confirmButtonText: '濂界殑',
+ cancelButtonText: '涓嶇敤',
+ type: 'warning',
+ }
+ )
+ .then(async () => {
+ const tempAppointment = cloneDeep(props.appointment)
+ if( undefined !== bookTimeSlotVip.value && null !== bookTimeSlotVip.value ) {
+ tempAppointment.bookTimeslot = bookTimeSlotVip.value
+ }
+ const data = await AppointmentApi.confirmAppointmentVip(tempAppointment)
+ bookSeqNum.value = data
+ // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
+ emit('event_appoint_confirm')
+ _printNote()
+ ElNotification({
+ title: '娓╅Θ鎻愮ず',
+ message: data,
+ type: 'info'
+ })
+ })
+ .catch(() => {
+ ElNotification({
+ title: '娓╅Θ鎻愮ず',
+ message: '纭澶辫触',
+ type: 'warning'
+ })
+ })
+ } else {
+ const data = await AppointmentApi.confirmAppointment(props.appointment)
+ bookSeqNum.value = data
+ // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
+ emit('event_appoint_confirm')
+ _printNote()
+ ElNotification({
+ title: '娓╅Θ鎻愮ず',
+ message: data,
+ type: 'info'
+ })
+ }
}
+
+const _printNote = async (printMode?: number) => {
+ console.info( props.appointment )
+
+// 寮曞叆鍚庝娇鐢ㄧず渚�
+ hiprint.init({
+ // host: 'http://192.168.2.100:17521',
+ token: '111111'
+ });
+// 涓嬪垪鏂规硶閮芥槸娌℃湁鎷栨嫿璁捐椤甸潰鐨�, 鐩稿綋浜庝唬鐮佹ā寮�, 浣跨敤浠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(props.appointment.bookCheckType)
+ panel.addPrintText({ options: { width: 140, height: 15, top: 0, left: 20, title: checkTypeName, textAlign: 'center', fontSize: 15, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
+ const patientBaisc = props.appointment.patName + " " + calGender(props.appointment.patGender) + " " + calculateAge(props.appointment.patBirthday) + "宀�"
+ panel.addPrintText({ options: { width: 140, height: 15, top: 25, left: 20, title: patientBaisc, textAlign: 'center' , fontSize: 15, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
+ const ward_bed = props.appointment.patWardDesc + "-" + props.appointment.patBedNo
+ panel.addPrintText({ options: { width: 140, height: 15, top: 50, left: 20, title: ward_bed, textAlign: 'center', fontSize: 15, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
+ const bookTime = formatTimestamp(props.appointment.bookDate) + " " + getBookBeginTime(props.appointment.bookTimeslot)
+ panel.addPrintText({ options: { width: 140, height: 15, top: 75, left: 20, title: bookTime, textAlign: 'center', fontSize: 15, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
+ //panel.addPrintText({ options: { width: 140, height: 12, top: 58, left: 20, title: props.appointment.patId, textAlign: 'center', fontSize: 8 } });
+ //panel.addPrintText({ options: { width: 140, height: 12, top: 72, left: 20, title: props.appointment.patMobile, textAlign: 'center', fontSize: 8, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
+
+ // 鏉$爜 灏辫瘖娴佹按鍙�
+ panel.addPrintText({ options: { width: 140, height: 22, top: 104, left: 20, title: props.appointment.episodeId, textType: 'barcode' } });
+
+ // 鍙充晶 Pane 杈撳嚭
+ const _bookSeqNum = bookSeqNum.value??props.appointment?.bookSeqNum
+ panel.addPrintText({ options: { width: 140, height: 20, top: 0, left: 160, title: ''+_bookSeqNum, textAlign: 'center', fontSize: 30, fontFamily: '寰蒋闆呴粦', fontWeight: '1200' } });
+
+ // 娉ㄦ剰浜嬮」
+ const notes = checkTypeStore.getCheckTypeNotes(props.appointment.bookCheckType)
+ panel.addPrintText({ options: { width: 140, height: 40, top: 30, left: 160, title: notes, textAlign: 'center', fontSize: 13, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
+
+//鎵撳嵃
+ 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([{}]);
+}
+
+onMounted( async () => {
+ const data = await QueueSequenceApi.getTimeslotByCheckType(props.appointment.bookCheckType)
+ console.info( data )
+ checkTypeTimeslotList.value = data
+})
</script>
@@ -34,8 +134,20 @@
<template #header>{{checkTypeStore.getCheckTypeName(appointment.bookCheckType)}}</template>
<div>{{formatDate(appointment.bookDate, 'YYYY-MM-DD')}}</div>
<div>{{formatTimeslot(appointment.bookTimeslot)}}</div>
+
+ <el-select v-if="!isCurrentDay(appointment.bookDate)" v-model="bookTimeSlotVip" placeholder="璇烽�夋嫨棰勭害鏃堕棿娈�">
+ <el-option
+ v-for="item in checkTypeTimeslotList"
+ :key="item.id"
+ :label="formatTimeslot(item.timeSlot)"
+ :value="item.timeSlot"
+ :disabled="item.queueVipNo === item.queueVipFull"
+ />
+ </el-select>
+ {{bookSeqNum??appointment.bookSeqNum}}
<el-divider/>
- <el-button type="primary" @click="_confirmAppointment"><Icon icon="ep:refresh" class="mr-5px" /> 鎺掗槦 </el-button>
+ <el-button @click="_confirmAppointment" :type="isCurrentDay(appointment.bookDate)?'primary':'warning'"><Icon icon="ep:list" class="mr-5px" /> 鎺掗槦 </el-button>
+ <el-button @click="_printNote(8)"><Icon icon="ep:printer" class="mr-5px" /> 鎵撳嵃鍙� </el-button>
</el-card>
</template>
--
Gitblit v1.9.3