| | |
| | | import { cloneDeep } from 'lodash-es' |
| | | import { hiprint } from 'vue-plugin-hiprint' |
| | | import { calGender, getBookBeginTime } from '@/utils' |
| | | import { getCheckTypeName } from '@/utils/checkTypeFormatter' |
| | | import { getCheckTypeName, getCheckTypeSeqPrefix } from '@/utils/checkTypeFormatter' |
| | | |
| | | defineComponent({ |
| | | name: 'CheckItemPanel' |
| | |
| | | const checkTypeTimeslotList = ref<QueueSequenceVO>() |
| | | const bookTimeSlotVip = ref<number>() |
| | | |
| | | const bookSeqNum = ref<number>() |
| | | /** |
| | | * 本次签到拿到的排队号(号统一后由后端写入 queue.seq_num,并由确认接口直接返回)。 |
| | | * |
| | | * 说明:变量名从 bookSeqNum 改为 seqNum —— 号已经统一,系统里不再有 book_seq_num 这一路。 |
| | | * 预约对象上的 `bookSeqNum` 字段名保留(接口字段不动),值来源也已改为 queue.seq_num, |
| | | * 仅在"该预约已经排过队"时用于回显。 |
| | | */ |
| | | const seqNum = ref<number>() |
| | | |
| | | /** 排队号显示文案:检查项目前缀 + 号(号按检查项目各自编号,必须靠前缀区分) */ |
| | | const seqNumText = computed(() => { |
| | | const num = seqNum.value ?? props.appointment?.bookSeqNum |
| | | if (num === undefined || num === null || num === '') return '' |
| | | return `${getCheckTypeSeqPrefix(props.appointment?.bookCheckType)}${num}` |
| | | }) |
| | | |
| | | const _confirmAppointment = async () => { |
| | | if (!isCurrentDay(props.appointment.bookDate)) { |
| | | ElMessageBox.confirm('非当天预约项,确定要今天检查吗?', 'Warning', { |
| | | confirmButtonText: '好的', |
| | | cancelButtonText: '不用', |
| | | type: 'warning' |
| | | }) |
| | | // 【本需求】非当天预约:先提醒,确认后**按预留号**签入(不占用今天同时段的正常预约号) |
| | | // 注意 bookDate 从后端回来是**时间戳数值**(如 1792339200000),必须格式化后再拼进提示, |
| | | // 否则会直接显示一串数字。formatTimestamp → dayjs(x).format('YYYY-MM-DD')。 |
| | | const bookDateText = props.appointment.bookDate |
| | | ? formatTimestamp(props.appointment.bookDate) |
| | | : '-' |
| | | ElMessageBox.confirm( |
| | | `该患者预约日期为 ${bookDateText},不是今天。\n` + |
| | | '是否仍要今天签到?确认后将分配【预留号】(不会占用今天该时段的正常预约号)。', |
| | | '非当天预约签到', |
| | | { |
| | | confirmButtonText: '继续签到', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | } |
| | | ) |
| | | .then(async () => { |
| | | const tempAppointment = cloneDeep(props.appointment) |
| | | if (undefined !== bookTimeSlotVip.value && null !== bookTimeSlotVip.value) { |
| | | tempAppointment.bookTimeslot = bookTimeSlotVip.value |
| | | } |
| | | // 【本需求】显式带上"已确认签入"标记:后端据此放行非当天预约,并按预留号取号 |
| | | tempAppointment.forceCheckIn = true |
| | | const data = await AppointmentApi.confirmAppointmentVip(tempAppointment) |
| | | bookSeqNum.value = data |
| | | seqNum.value = data |
| | | // 发送操作成功的事件 |
| | | emit('event_appoint_confirm') |
| | | _printNote() |
| | |
| | | tempAppointment.bookTimeslot = bookTimeSlotVip.value |
| | | } |
| | | const data = await AppointmentApi.confirmAppointmentVip(tempAppointment) |
| | | bookSeqNum.value = data |
| | | seqNum.value = data |
| | | // 发送操作成功的事件 |
| | | emit('event_appoint_confirm') |
| | | _printNote() |
| | |
| | | }) |
| | | } else { |
| | | const data = await AppointmentApi.confirmAppointment(props.appointment) |
| | | bookSeqNum.value = data |
| | | seqNum.value = data |
| | | // 发送操作成功的事件 |
| | | emit('event_appoint_confirm') |
| | | // _printNote() |
| | |
| | | } |
| | | }) |
| | | |
| | | // 右侧 Pane 输出 |
| | | const _bookSeqNum = bookSeqNum.value ?? props.appointment?.bookSeqNum |
| | | // 右侧 Pane 输出:排队号(前缀 + 号,与屏上显示一致) |
| | | panel.addPrintText({ |
| | | options: { |
| | | width: 130, |
| | | height: 20, |
| | | top: 7, |
| | | left: 170, |
| | | title: '' + _bookSeqNum, |
| | | title: seqNumText.value, |
| | | textAlign: 'center', |
| | | fontSize: 30, |
| | | fontFamily: '微软雅黑', |
| | |
| | | :disabled="item.queueVipNo === item.queueVipFull" |
| | | /> |
| | | </el-select> |
| | | {{ bookSeqNum ?? appointment.bookSeqNum }} |
| | | {{ seqNumText }} |
| | | <el-divider /> |
| | | <el-button |
| | | @click="_confirmAppointment" |