更新
This commit is contained in:
@@ -155,13 +155,15 @@
|
||||
>
|
||||
<span class="dh5-apt-status">{{ appointmentStatusLabelByStatus(apt.status) }}</span>
|
||||
<span class="dh5-apt-doctor">{{ apt.doctor_name || '-' }}</span>
|
||||
<span class="dh5-apt-time">{{ apt.time_text || '-' }}</span>
|
||||
<span class="dh5-apt-time">{{ apt.time_text || '-' }}</span>
|
||||
<span class="dh5-apt-type">挂号类型:{{ appointmentTypeDescription(apt.appointment_type) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="dh5-apt-status">{{ appointmentStatusLabel(row) }}</span>
|
||||
<span class="dh5-apt-doctor">{{ row.appointment_doctor_name || '-' }}</span>
|
||||
<span class="dh5-apt-time">{{ row.appointment_time_text || '-' }}</span>
|
||||
<span class="dh5-apt-time">{{ row.appointment_time_text || '-' }}</span>
|
||||
<span class="dh5-apt-type">挂号类型:{{ appointmentTypeDescription(row.appointment_type) }}</span>
|
||||
</template>
|
||||
</template>
|
||||
<span v-else class="dh5-apt-none">未挂号</span>
|
||||
@@ -299,7 +301,7 @@
|
||||
<span>视频二维码</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="isAppointmentActiveForVideo(moreSheetRow) && hasPermission(['tcm.diagnosis/guahao'])"
|
||||
v-if="hasActiveAppointment(moreSheetRow) && hasPermission(['tcm.diagnosis/guahao'])"
|
||||
class="dh5-action"
|
||||
@click="runAction('confirmQr')"
|
||||
>
|
||||
@@ -584,7 +586,8 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="tcmDiagnosisH5">
|
||||
<script setup lang="ts" name="tcmDiagnosisH5">
|
||||
import { appointmentTypeDescription, canAppointmentVideoCall } from '@/utils/appointment-type'
|
||||
import {
|
||||
tcmDiagnosisLists,
|
||||
tcmDiagnosisDelete,
|
||||
@@ -924,7 +927,8 @@ const appointmentRows = (row: any) => {
|
||||
status: row.appointment_status,
|
||||
doctor_id: row.appointment_doctor_id,
|
||||
doctor_name: row.appointment_doctor_name,
|
||||
time_text: row.appointment_time_text
|
||||
time_text: row.appointment_time_text,
|
||||
appointment_type: row.appointment_type
|
||||
}]
|
||||
}
|
||||
|
||||
@@ -949,11 +953,13 @@ const appointmentRowClass = (row: any) => {
|
||||
/**
|
||||
* 同一诊单可能同时有已完成的旧挂号和已预约的新挂号,二维码应使用明细里的有效预约。
|
||||
*/
|
||||
const activeAppointment = (row: any) =>
|
||||
appointmentRows(row).find((apt: any) => Number(apt?.status) === 1) ?? null
|
||||
const activeAppointment = (row: any, videoOnly = false) =>
|
||||
appointmentRows(row).find((apt: any) =>
|
||||
Number(apt?.status) === 1 && (!videoOnly || canAppointmentVideoCall(apt.appointment_type))
|
||||
) ?? null
|
||||
|
||||
const activeAppointmentRow = (row: any) => {
|
||||
const apt = activeAppointment(row)
|
||||
const activeAppointmentRow = (row: any, videoOnly = false) => {
|
||||
const apt = activeAppointment(row, videoOnly)
|
||||
if (!apt) return null
|
||||
|
||||
return {
|
||||
@@ -963,11 +969,13 @@ const activeAppointmentRow = (row: any) => {
|
||||
appointment_status: apt.status,
|
||||
appointment_doctor_id: apt.doctor_id,
|
||||
appointment_doctor_name: apt.doctor_name,
|
||||
appointment_time_text: apt.time_text
|
||||
appointment_time_text: apt.time_text,
|
||||
appointment_type: apt.appointment_type
|
||||
}
|
||||
}
|
||||
|
||||
const isAppointmentActiveForVideo = (row: any) => !!activeAppointment(row)
|
||||
const hasActiveAppointment = (row: any) => !!activeAppointment(row)
|
||||
const isAppointmentActiveForVideo = (row: any) => !!activeAppointment(row, true)
|
||||
|
||||
const canCancelAppointmentRow = (row: any) => {
|
||||
const s = Number(row.appointment_status)
|
||||
@@ -981,9 +989,10 @@ const isAssignedAssistant = (row: any) => {
|
||||
if (aid === null || aid === undefined || aid === '') return false
|
||||
return Number(aid) === Number(userStore.userInfo?.id)
|
||||
}
|
||||
const canWatchCallEntry = (row: any) =>
|
||||
isAssignedAssistant(row) && hasPermission(['tcm.diagnosis/watchCall'])
|
||||
const watchCallState = (row: any) => (row.video_call_hint?.state as string) || 'none'
|
||||
const canWatchCallEntry = (row: any) =>
|
||||
isAppointmentActiveForVideo(row) && isAssignedAssistant(row) && hasPermission(['tcm.diagnosis/watchCall'])
|
||||
const watchCallState = (row: any) =>
|
||||
isAppointmentActiveForVideo(row) ? (row.video_call_hint?.state as string) || 'none' : 'none'
|
||||
const watchCallShowEnterButton = (row: any) => {
|
||||
const st = watchCallState(row)
|
||||
return st === 'live' || st === 'pending_room'
|
||||
@@ -1015,7 +1024,11 @@ const watchCallVisibleForRow = (row: any) => {
|
||||
}
|
||||
const watchCallDialogVisible = ref(false)
|
||||
const watchCallDiagnosisId = ref(0)
|
||||
const onWatchCallEntryClick = (row: any) => {
|
||||
const onWatchCallEntryClick = (row: any) => {
|
||||
if (!canWatchCallEntry(row)) {
|
||||
feedback.msgWarning('仅已预约的视频问诊可进入视频旁观')
|
||||
return
|
||||
}
|
||||
if (watchCallState(row) !== 'live') {
|
||||
feedback.msgWarning('医生未接通或未同步房间号,请稍后再试')
|
||||
return
|
||||
@@ -1087,7 +1100,7 @@ const runAction = (cmd: string) => {
|
||||
case 'assign': handleSingleAssign(row); break
|
||||
case 'videoQr':
|
||||
if (!isAppointmentActiveForVideo(row)) {
|
||||
feedback.msgWarning('仅「已预约」状态可生成视频二维码')
|
||||
feedback.msgWarning('仅已预约的视频问诊可生成视频二维码')
|
||||
return
|
||||
}
|
||||
handleVideoQRCode(row); break
|
||||
@@ -1262,9 +1275,9 @@ const qrcodeAppointmentTimeText = computed(() => {
|
||||
})
|
||||
|
||||
const handleVideoQRCode = async (row: any) => {
|
||||
const qrcodeRow = activeAppointmentRow(row)
|
||||
const qrcodeRow = activeAppointmentRow(row, true)
|
||||
if (!qrcodeRow) {
|
||||
feedback.msgWarning('仅「已预约」状态可生成视频二维码'); return
|
||||
feedback.msgWarning('仅已预约的视频问诊可生成视频二维码'); return
|
||||
}
|
||||
if (!qrcodeRow.patient_id) { feedback.msgWarning('患者信息不完整'); return }
|
||||
lastQRCodeType.value = 'video'
|
||||
@@ -1805,8 +1818,9 @@ $dh5-card-bg: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.dh5-apt-item {
|
||||
display: flex;
|
||||
.dh5-apt-item {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 4px 8px;
|
||||
@@ -1830,11 +1844,17 @@ $dh5-card-bg: #ffffff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.dh5-apt-time {
|
||||
.dh5-apt-time {
|
||||
color: $dh5-text-mute;
|
||||
font-size: 12px;
|
||||
margin-left: auto;
|
||||
}
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.dh5-apt-type {
|
||||
flex-basis: 100%;
|
||||
color: $dh5-text-mute;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.dh5-apt-none {
|
||||
color: $dh5-warn;
|
||||
|
||||
Reference in New Issue
Block a user