新增功能
This commit is contained in:
@@ -89,7 +89,7 @@
|
||||
<el-table-column label="患者" min-width="150">
|
||||
<template #default="{ row }">
|
||||
<div class="patient-cell">
|
||||
<div class="patient-avatar">{{ (row.patient_name || '患').charAt(0) }}</div>
|
||||
<!-- <div class="patient-avatar">{{ (row.patient_name || '患').charAt(0) }}</div> -->
|
||||
<div class="patient-info">
|
||||
<div class="patient-name">{{ row.patient_name }}</div>
|
||||
<div class="patient-meta">{{ row.id }} · {{ row.gender_desc || '-' }} · {{ row.age ?? '-' }}岁</div>
|
||||
@@ -99,9 +99,12 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="挂号" min-width="180">
|
||||
<template #default="{ row }">
|
||||
<div class="appointment-cell" :class="{ 'has-apt': row.has_appointment }">
|
||||
<div
|
||||
class="appointment-cell"
|
||||
:class="appointmentCellClasses(row)"
|
||||
>
|
||||
<template v-if="row.has_appointment">
|
||||
<div class="apt-badge">已挂号</div>
|
||||
<div class="apt-badge">{{ appointmentStatusLabel(row) }}</div>
|
||||
<div class="apt-doctor">{{ row.appointment_doctor_name || '-' }}</div>
|
||||
<div class="apt-time">{{ row.appointment_time_text || '-' }}</div>
|
||||
</template>
|
||||
@@ -183,9 +186,9 @@
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-if="hasPermission(['tcm.diagnosis/assign'])" command="assign"><el-icon><User /></el-icon>指派</el-dropdown-item>
|
||||
<el-dropdown-item v-if="row.has_appointment && hasPermission(['tcm.diagnosis/videoQr'])" command="videoQr"><el-icon><Picture /></el-icon>视频二维码</el-dropdown-item>
|
||||
<el-dropdown-item v-if="hasPermission(['tcm.diagnosis/guahao']) && row.has_appointment" command="confirmQr"><el-icon><Picture /></el-icon>二维码</el-dropdown-item>
|
||||
<el-dropdown-item v-if="row.has_appointment && hasPermission(['tcm.diagnosis/guahao'])" command="cancelApt"><el-icon><CircleClose /></el-icon>取消挂号</el-dropdown-item>
|
||||
<el-dropdown-item v-if="isAppointmentActiveForVideo(row) && hasPermission(['tcm.diagnosis/videoQr'])" command="videoQr"><el-icon><Picture /></el-icon>视频二维码</el-dropdown-item>
|
||||
<el-dropdown-item v-if="hasPermission(['tcm.diagnosis/guahao']) && isAppointmentActiveForVideo(row)" command="confirmQr"><el-icon><Picture /></el-icon>二维码</el-dropdown-item>
|
||||
<el-dropdown-item v-if="canCancelAppointmentRow(row) && hasPermission(['tcm.diagnosis/guahao'])" command="cancelApt"><el-icon><CircleClose /></el-icon>取消挂号</el-dropdown-item>
|
||||
<el-dropdown-item command="order" v-if="hasPermission(['tcm.diagnosis/order'])"><el-icon><Document /></el-icon>创建订单</el-dropdown-item>
|
||||
<el-dropdown-item v-if="hasPermission(['tcm.diagnosis/delete'])" command="delete" divided><el-icon><Delete /></el-icon><span class="text-danger">删除</span></el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@@ -201,9 +204,9 @@
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<edit-popup ref="editRef" @success="getLists" />
|
||||
<edit-popup ref="editRef" @success="refreshListAfterPopupSave" />
|
||||
<detail-popup ref="detailRef" />
|
||||
<appointment-popup ref="appointmentRef" @success="getLists" />
|
||||
<appointment-popup ref="appointmentRef" @success="refreshListAfterPopupSave" />
|
||||
<assistant-watch-call-dialog
|
||||
v-model="watchCallVisible"
|
||||
:diagnosis-id="watchCallDiagnosisId"
|
||||
@@ -698,6 +701,8 @@ const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
params: formData
|
||||
})
|
||||
|
||||
/** 弹窗内保存后刷新列表:静默请求,避免 el-table v-loading 白蒙层盖住仍打开的抽屉 */
|
||||
const refreshListAfterPopupSave = () => getLists({ silent: true })
|
||||
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
@@ -995,8 +1000,8 @@ const handleRowAction = (cmd: string, row: any) => {
|
||||
switch (cmd) {
|
||||
case 'assign': handleSingleAssign(row); break
|
||||
case 'videoQr':
|
||||
if (!row.has_appointment) {
|
||||
feedback.msgWarning('未挂号患者无法生成视频二维码,请先预约医生')
|
||||
if (!isAppointmentActiveForVideo(row)) {
|
||||
feedback.msgWarning('仅「已预约」状态可生成视频二维码')
|
||||
return
|
||||
}
|
||||
handleVideoQRCode(row)
|
||||
@@ -1008,10 +1013,42 @@ const handleRowAction = (cmd: string, row: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
/** 挂号状态:1=已预约 3=已完成 4=已过号(与后端一致) */
|
||||
const appointmentStatusLabel = (row: any) => {
|
||||
const s = Number(row.appointment_status)
|
||||
if (s === 3) return '已完成'
|
||||
if (s === 4) return '已过号'
|
||||
return '已挂号'
|
||||
}
|
||||
|
||||
const appointmentCellClasses = (row: any) => {
|
||||
const s = Number(row.appointment_status)
|
||||
return {
|
||||
'has-apt': row.has_appointment,
|
||||
'apt-row-done': row.has_appointment && s === 3,
|
||||
'apt-row-missed': row.has_appointment && s === 4
|
||||
}
|
||||
}
|
||||
|
||||
/** 仅已预约(1)可进视频/小程序码 */
|
||||
const isAppointmentActiveForVideo = (row: any) =>
|
||||
row.has_appointment && Number(row.appointment_status) === 1
|
||||
|
||||
/** 已预约、已过号可取消(后端同步限制) */
|
||||
const canCancelAppointmentRow = (row: any) => {
|
||||
const s = Number(row.appointment_status)
|
||||
return !!(row.has_appointment && row.appointment_id && (s === 1 || s === 4))
|
||||
}
|
||||
|
||||
// 取消挂号
|
||||
const handleCancelAppointment = async (row: any) => {
|
||||
if (!row.has_appointment || !row.appointment_id) {
|
||||
feedback.msgWarning('该诊单未挂号或挂号信息异常')
|
||||
if (!canCancelAppointmentRow(row)) {
|
||||
const s = Number(row.appointment_status)
|
||||
if (row.has_appointment && s === 3) {
|
||||
feedback.msgWarning('已完成就诊,无法取消挂号')
|
||||
} else {
|
||||
feedback.msgWarning('该诊单未挂号或挂号信息异常')
|
||||
}
|
||||
return
|
||||
}
|
||||
try {
|
||||
@@ -1081,10 +1118,10 @@ const submitFillIdCard = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 生成视频二维码(跳转登录页)- 仅已挂号患者可生成
|
||||
// 生成视频二维码(跳转登录页)- 仅已预约(1)可生成
|
||||
const handleVideoQRCode = async (row: any) => {
|
||||
if (!row.has_appointment) {
|
||||
feedback.msgWarning('未挂号患者无法生成视频二维码,请先预约医生')
|
||||
if (!isAppointmentActiveForVideo(row)) {
|
||||
feedback.msgWarning('仅「已预约」状态可生成视频二维码')
|
||||
return
|
||||
}
|
||||
if (!row.patient_id) {
|
||||
@@ -1125,6 +1162,10 @@ const handleVideoQRCode = async (row: any) => {
|
||||
|
||||
// 生成确认诊单二维码
|
||||
const handleMiniProgramQRCode = async (row: any) => {
|
||||
if (!isAppointmentActiveForVideo(row)) {
|
||||
feedback.msgWarning('仅「已预约」状态可使用诊单二维码')
|
||||
return
|
||||
}
|
||||
if (!row.patient_id) {
|
||||
feedback.msgWarning('患者信息不完整')
|
||||
return
|
||||
@@ -1532,6 +1573,34 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
&.apt-row-missed {
|
||||
background: linear-gradient(135deg, rgba(var(--el-color-warning-rgb), 0.12), rgba(var(--el-color-warning-rgb), 0.05));
|
||||
border-color: rgba(var(--el-color-warning-rgb), 0.35);
|
||||
|
||||
.apt-badge {
|
||||
color: var(--el-color-warning-dark-2);
|
||||
background: var(--el-color-warning-light-7);
|
||||
}
|
||||
|
||||
.apt-time {
|
||||
color: var(--el-color-warning);
|
||||
}
|
||||
}
|
||||
|
||||
&.apt-row-done {
|
||||
background: linear-gradient(135deg, rgba(var(--el-color-info-rgb), 0.1), rgba(var(--el-color-info-rgb), 0.04));
|
||||
border-color: rgba(var(--el-color-info-rgb), 0.28);
|
||||
|
||||
.apt-badge {
|
||||
color: var(--el-color-info-dark-2);
|
||||
background: var(--el-color-info-light-7);
|
||||
}
|
||||
|
||||
.apt-time {
|
||||
color: var(--el-color-info);
|
||||
}
|
||||
}
|
||||
|
||||
.apt-none {
|
||||
font-size: 13px;
|
||||
color: var(--el-text-color-placeholder);
|
||||
|
||||
Reference in New Issue
Block a user