This commit is contained in:
Your Name
2026-04-24 14:42:52 +08:00
parent a3e035b74b
commit aaba330f0d
7 changed files with 175 additions and 46 deletions
@@ -248,7 +248,7 @@
</el-col> -->
<el-col :span="24">
<el-form-item label="用法" prop="usage_instruction">
<el-input v-model="formData.usage_instruction" placeholder="例如:水煎服,一日二次" maxlength="200" show-word-limit />
<el-input v-model="formData.usage_instruction" placeholder="" maxlength="200" show-word-limit />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -1076,16 +1076,10 @@
</el-button>
<span class="text-xs text-gray-400">ID: {{ editForm.prescription_id || '—' }}</span>
</div>
<!-- 诊单创建人及所在部门tcm_diagnosis.admin_id接口为全角多部门路径 / / 含上级 -->
<div class="mt-2 space-y-2 text-xs sm:text-sm">
<div class="flex flex-wrap items-baseline gap-x-2 gap-y-0.5">
<span class="text-gray-500 shrink-0">诊单创建人</span>
<span class="text-gray-800 font-medium">
{{ editForm.diagnosis_creator_name || '—' }}
</span>
</div>
<!-- 创建人所属部门优先业务订单 creator_id无则诊单 admin_id非处方开方人多部门路径/含上级 -->
<div class="mt-2 space-y-1.5 text-xs sm:text-sm">
<div v-if="editDiagnosisCreatorDeptBreadcrumbs.length" class="space-y-1.5">
<div class="text-gray-500">所在部门含上级</div>
<div class="text-gray-500">创建人所属部门</div>
<div
v-for="(segments, idx) in editDiagnosisCreatorDeptBreadcrumbs"
:key="idx"
@@ -1105,12 +1099,7 @@
</el-breadcrumb>
</div>
</div>
<div
v-else
class="text-gray-400"
>
所在部门
</div>
<div v-else class="text-gray-400">创建人所属部门</div>
</div>
</el-col>
<el-col :xs="24" :sm="8">
+65 -6
View File
@@ -20,7 +20,7 @@
@click="handleDateTabClick(tab.value)"
>
{{ tab.label }}
<em v-if="tab.value && dateCounts[tab.value] !== undefined">{{ dateCounts[tab.value] }}</em>
<em v-if="dateCounts[tab.value] !== undefined">{{ dateCounts[tab.value] }}</em>
</span>
<span
:class="['chip', 'chip-pending-booking', { active: formData.pending_booking === '1' }]"
@@ -39,7 +39,6 @@
<span
:class="['chip', 'chip-pending', { active: formData.pending_assign === '1' }]"
@click="handlePendingAssignTabClick"
v-perms="['tcm.diagnosis/assign']"
>
待分配医助
<em v-if="pendingAssignCount !== undefined">{{ pendingAssignCount }}</em>
@@ -230,10 +229,19 @@
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="260" fixed="right" align="left">
<el-table-column label="操作" width="300" fixed="right" align="left">
<template #default="{ row }">
<div class="action-cell">
<el-button type="primary" link size="small" @click="handleEdit(row.id)" v-perms="['tcm.diagnosis/edit']">诊单</el-button>
<el-button
v-perms="['tcm.diagnosis/kaifang']"
type="primary"
link
size="small"
@click="handlePrescription(row)"
>
{{ prescriptionActionLabel(row) }}
</el-button>
<el-button
v-perms="['tcm.diagnosis/guahao']"
type="success"
@@ -241,6 +249,7 @@
size="small"
@click="handleAppointment(row)"
>预约</el-button>
<el-button
v-perms="['tcm.diagnosis/edit']"
type="warning"
@@ -273,6 +282,7 @@
<edit-popup ref="editRef" @success="refreshListAfterPopupSave" />
<detail-popup ref="detailRef" />
<tcm-prescription ref="prescriptionRef" @success="onPrescriptionSuccess" />
<appointment-popup ref="appointmentRef" @success="refreshListAfterPopupSave" />
<assistant-watch-call-dialog
v-model="watchCallVisible"
@@ -569,6 +579,7 @@ import dayjs from 'dayjs'
const EditPopup = defineAsyncComponent(() => import('./edit.vue'))
const DetailPopup = defineAsyncComponent(() => import('./detail.vue'))
const TcmPrescription = defineAsyncComponent(() => import('@/components/tcm-prescription/index.vue'))
const AppointmentPopup = defineAsyncComponent(() => import('./appointment.vue'))
const AssistantWatchCallDialog = defineAsyncComponent(() => import('./components/AssistantWatchCallDialog.vue'))
@@ -654,6 +665,8 @@ const doSearch = () => {
// 重点:当天/明天/后天挂号 Tab
const dateTabs = computed(() => [
{ label: '昨天挂号', value: yesterdayStr.value },
{ label: '前天挂号', value: dayBeforeStr.value },
{ label: '当天挂号', value: todayStr.value },
{ label: '明天挂号', value: tomorrowStr.value },
{ label: '后天挂号', value: dayAfterStr.value },
@@ -711,21 +724,27 @@ const handlePendingAssignTabClick = async () => {
fetchDateCounts()
}
// 获取各日期挂号数量 + 待预约 + 已完成 + 待分配医助数量
// 获取各日期挂号数量 + 全部 + 待预约 + 已完成 + 待分配医助数量
const fetchDateCounts = async () => {
try {
const [today, tomorrow, dayAfter, noApt, doneVisit, pending] = await Promise.all([
const [yesterday, dayBefore, today, tomorrow, dayAfter, all, noApt, doneVisit, pending] = await Promise.all([
tcmDiagnosisLists({ appointment_date: yesterdayStr.value, page_no: 1, page_size: 1 }),
tcmDiagnosisLists({ appointment_date: dayBeforeStr.value, page_no: 1, page_size: 1 }),
tcmDiagnosisLists({ appointment_date: todayStr.value, page_no: 1, page_size: 1 }),
tcmDiagnosisLists({ appointment_date: tomorrowStr.value, page_no: 1, page_size: 1 }),
tcmDiagnosisLists({ appointment_date: dayAfterStr.value, page_no: 1, page_size: 1 }),
tcmDiagnosisLists({ page_no: 1, page_size: 1 }),
tcmDiagnosisLists({ has_appointment: 0, page_no: 1, page_size: 1 }),
tcmDiagnosisLists({ completed_appointment: 1, page_no: 1, page_size: 1 }),
tcmDiagnosisLists({ pending_assign: 1, page_no: 1, page_size: 1 })
])
dateCounts.value = {
[yesterdayStr.value]: yesterday?.count ?? 0,
[dayBeforeStr.value]: dayBefore?.count ?? 0,
[todayStr.value]: today?.count ?? 0,
[tomorrowStr.value]: tomorrow?.count ?? 0,
[dayAfterStr.value]: dayAfter?.count ?? 0
[dayAfterStr.value]: dayAfter?.count ?? 0,
'': all?.count ?? 0
}
pendingBookingCount.value = noApt?.count ?? 0
completedVisitCount.value = doneVisit?.count ?? 0
@@ -771,6 +790,16 @@ const dayAfterStr = computed(() => {
t.setDate(t.getDate() + 2)
return `${t.getFullYear()}-${pad(t.getMonth() + 1)}-${pad(t.getDate())}`
})
const yesterdayStr = computed(() => {
const t = new Date()
t.setDate(t.getDate() - 1)
return `${t.getFullYear()}-${pad(t.getMonth() + 1)}-${pad(t.getDate())}`
})
const dayBeforeStr = computed(() => {
const t = new Date()
t.setDate(t.getDate() - 2)
return `${t.getFullYear()}-${pad(t.getMonth() + 1)}-${pad(t.getDate())}`
})
// Tab 切换
const handleTabChange = (tabName: string | number) => {
@@ -881,6 +910,7 @@ const getRowClassName = ({ row }: { row: any }) => {
const editRef = ref()
const detailRef = ref()
const prescriptionRef = ref()
const appointmentRef = ref()
/** 从路由带 id 进入时,诊单弹窗为异步组件,需在 ref 就绪后再 open */
const pendingRouteDiagnosisId = ref<number | null>(null)
@@ -1149,6 +1179,34 @@ const handleEdit = (id: number) => {
editRef.value.open('edit', id)
}
/** 与预约列表开方一致:已通过且未作废 → 查看,否则开方 */
function prescriptionActionLabel(row: any) {
if (
row?.prescription_audit_status === 1 &&
Number(row?.prescription_void_status) !== 1
) {
return '查看'
}
return '开方'
}
const handlePrescription = (row: any) => {
if (!row?.id) {
feedback.msgWarning('诊单信息不完整')
return
}
prescriptionRef.value?.open({
...row,
diagnosis_id: row.id,
id: row.appointment_id || 0,
})
}
const onPrescriptionSuccess = () => {
getLists()
;(editRef.value as { refreshCaseList?: () => void } | undefined)?.refreshCaseList?.()
}
const handleDetail = (id: number) => {
detailRef.value.open(id)
}
@@ -1560,6 +1618,7 @@ onUnmounted(() => {
.date-chips {
display: flex;
flex-wrap: wrap;
gap: 6px;
.chip {