更新
This commit is contained in:
@@ -12,7 +12,8 @@
|
|||||||
{
|
{
|
||||||
active:
|
active:
|
||||||
formData.pending_assign !== '1' &&
|
formData.pending_assign !== '1' &&
|
||||||
formData.pending_unscheduled !== '1' &&
|
formData.pending_booking !== '1' &&
|
||||||
|
formData.completed_appointment !== '1' &&
|
||||||
formData.appointment_date === tab.value
|
formData.appointment_date === tab.value
|
||||||
}
|
}
|
||||||
]"
|
]"
|
||||||
@@ -22,11 +23,18 @@
|
|||||||
<em v-if="tab.value && dateCounts[tab.value] !== undefined">{{ dateCounts[tab.value] }}</em>
|
<em v-if="tab.value && dateCounts[tab.value] !== undefined">{{ dateCounts[tab.value] }}</em>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
:class="['chip', 'chip-unscheduled', { active: formData.pending_unscheduled === '1' }]"
|
:class="['chip', 'chip-pending-booking', { active: formData.pending_booking === '1' }]"
|
||||||
@click="handlePendingUnscheduledTabClick"
|
@click="handlePendingBookingTabClick"
|
||||||
>
|
>
|
||||||
待预约
|
待预约
|
||||||
<em v-if="pendingUnscheduledCount !== undefined">{{ pendingUnscheduledCount }}</em>
|
<em v-if="pendingBookingCount !== undefined">{{ pendingBookingCount }}</em>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
:class="['chip', 'chip-completed-visit', { active: formData.completed_appointment === '1' }]"
|
||||||
|
@click="handleCompletedVisitTabClick"
|
||||||
|
>
|
||||||
|
已完成
|
||||||
|
<em v-if="completedVisitCount !== undefined">{{ completedVisitCount }}</em>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
:class="['chip', 'chip-pending', { active: formData.pending_assign === '1' }]"
|
:class="['chip', 'chip-pending', { active: formData.pending_assign === '1' }]"
|
||||||
@@ -599,7 +607,11 @@ const formData = reactive({
|
|||||||
diagnosis_confirmed: '' as '' | '0' | '1',
|
diagnosis_confirmed: '' as '' | '0' | '1',
|
||||||
appointment_date: '' as string,
|
appointment_date: '' as string,
|
||||||
has_appointment: '' as '' | '0' | '1',
|
has_appointment: '' as '' | '0' | '1',
|
||||||
pending_assign: '' as '' | '1'
|
pending_assign: '' as '' | '1',
|
||||||
|
/** 顶部「待预约」Tab:仅展示已建诊单且尚未挂号(无有效预约) */
|
||||||
|
pending_booking: '' as '' | '1',
|
||||||
|
/** 顶部「已完成」Tab:至少有一条挂号记录为已完成 status=3 */
|
||||||
|
completed_appointment: '' as '' | '1'
|
||||||
})
|
})
|
||||||
|
|
||||||
const activeTab = ref('all')
|
const activeTab = ref('all')
|
||||||
@@ -618,6 +630,8 @@ const confirmedOptions = [
|
|||||||
|
|
||||||
const setHasAppointment = (v: string) => {
|
const setHasAppointment = (v: string) => {
|
||||||
formData.has_appointment = v as '' | '0' | '1'
|
formData.has_appointment = v as '' | '0' | '1'
|
||||||
|
formData.pending_booking = ''
|
||||||
|
formData.completed_appointment = ''
|
||||||
pager.page = 1
|
pager.page = 1
|
||||||
getLists()
|
getLists()
|
||||||
fetchDateCounts()
|
fetchDateCounts()
|
||||||
@@ -625,6 +639,8 @@ const setHasAppointment = (v: string) => {
|
|||||||
|
|
||||||
const setConfirmed = (v: string) => {
|
const setConfirmed = (v: string) => {
|
||||||
formData.diagnosis_confirmed = v as '' | '0' | '1'
|
formData.diagnosis_confirmed = v as '' | '0' | '1'
|
||||||
|
formData.pending_booking = ''
|
||||||
|
formData.completed_appointment = ''
|
||||||
pager.page = 1
|
pager.page = 1
|
||||||
getLists()
|
getLists()
|
||||||
fetchDateCounts()
|
fetchDateCounts()
|
||||||
@@ -645,31 +661,65 @@ const dateTabs = computed(() => [
|
|||||||
])
|
])
|
||||||
|
|
||||||
const dateCounts = ref<Record<string, number>>({})
|
const dateCounts = ref<Record<string, number>>({})
|
||||||
|
const pendingBookingCount = ref<number | undefined>(undefined)
|
||||||
|
const completedVisitCount = ref<number | undefined>(undefined)
|
||||||
const pendingAssignCount = ref<number | undefined>(undefined)
|
const pendingAssignCount = ref<number | undefined>(undefined)
|
||||||
|
|
||||||
const handleDateTabClick = async (value: string) => {
|
const handleDateTabClick = async (value: string) => {
|
||||||
formData.pending_assign = ''
|
formData.pending_assign = ''
|
||||||
|
formData.pending_booking = ''
|
||||||
|
formData.completed_appointment = ''
|
||||||
|
formData.has_appointment = ''
|
||||||
formData.appointment_date = value
|
formData.appointment_date = value
|
||||||
pager.page = 1
|
pager.page = 1
|
||||||
await getLists()
|
await getLists()
|
||||||
fetchDateCounts()
|
fetchDateCounts()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 已创建诊单、尚未挂号的记录(与第二行「未挂号」同条件,便于从 Tab 一键进入) */
|
||||||
|
const handlePendingBookingTabClick = async () => {
|
||||||
|
formData.pending_assign = ''
|
||||||
|
formData.pending_booking = '1'
|
||||||
|
formData.completed_appointment = ''
|
||||||
|
formData.appointment_date = ''
|
||||||
|
formData.has_appointment = '0'
|
||||||
|
pager.page = 1
|
||||||
|
await getLists()
|
||||||
|
fetchDateCounts()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 至少有一条挂号为「已完成」(后端 appointment.status=3) */
|
||||||
|
const handleCompletedVisitTabClick = async () => {
|
||||||
|
formData.pending_assign = ''
|
||||||
|
formData.pending_booking = ''
|
||||||
|
formData.completed_appointment = '1'
|
||||||
|
formData.has_appointment = ''
|
||||||
|
formData.appointment_date = ''
|
||||||
|
pager.page = 1
|
||||||
|
await getLists()
|
||||||
|
fetchDateCounts()
|
||||||
|
}
|
||||||
|
|
||||||
const handlePendingAssignTabClick = async () => {
|
const handlePendingAssignTabClick = async () => {
|
||||||
formData.pending_assign = '1'
|
formData.pending_assign = '1'
|
||||||
|
formData.pending_booking = ''
|
||||||
|
formData.completed_appointment = ''
|
||||||
|
formData.has_appointment = ''
|
||||||
formData.appointment_date = ''
|
formData.appointment_date = ''
|
||||||
pager.page = 1
|
pager.page = 1
|
||||||
await getLists()
|
await getLists()
|
||||||
fetchDateCounts()
|
fetchDateCounts()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取各日期挂号数量 + 待分配医助数量
|
// 获取各日期挂号数量 + 待预约 + 已完成 + 待分配医助数量
|
||||||
const fetchDateCounts = async () => {
|
const fetchDateCounts = async () => {
|
||||||
try {
|
try {
|
||||||
const [today, tomorrow, dayAfter, pending] = await Promise.all([
|
const [today, tomorrow, dayAfter, noApt, doneVisit, pending] = await Promise.all([
|
||||||
tcmDiagnosisLists({ appointment_date: todayStr.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: tomorrowStr.value, page_no: 1, page_size: 1 }),
|
||||||
tcmDiagnosisLists({ appointment_date: dayAfterStr.value, page_no: 1, page_size: 1 }),
|
tcmDiagnosisLists({ appointment_date: dayAfterStr.value, 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 })
|
tcmDiagnosisLists({ pending_assign: 1, page_no: 1, page_size: 1 })
|
||||||
])
|
])
|
||||||
dateCounts.value = {
|
dateCounts.value = {
|
||||||
@@ -677,6 +727,8 @@ const fetchDateCounts = async () => {
|
|||||||
[tomorrowStr.value]: tomorrow?.count ?? 0,
|
[tomorrowStr.value]: tomorrow?.count ?? 0,
|
||||||
[dayAfterStr.value]: dayAfter?.count ?? 0
|
[dayAfterStr.value]: dayAfter?.count ?? 0
|
||||||
}
|
}
|
||||||
|
pendingBookingCount.value = noApt?.count ?? 0
|
||||||
|
completedVisitCount.value = doneVisit?.count ?? 0
|
||||||
pendingAssignCount.value = pending?.count ?? 0
|
pendingAssignCount.value = pending?.count ?? 0
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('获取日期数量失败', e)
|
console.error('获取日期数量失败', e)
|
||||||
@@ -725,6 +777,8 @@ const handleTabChange = (tabName: string | number) => {
|
|||||||
formData.diagnosis_confirmed = ''
|
formData.diagnosis_confirmed = ''
|
||||||
formData.has_appointment = ''
|
formData.has_appointment = ''
|
||||||
formData.appointment_date = ''
|
formData.appointment_date = ''
|
||||||
|
formData.pending_booking = ''
|
||||||
|
formData.completed_appointment = ''
|
||||||
if (tabName === 'unconfirmed') {
|
if (tabName === 'unconfirmed') {
|
||||||
formData.diagnosis_confirmed = '0'
|
formData.diagnosis_confirmed = '0'
|
||||||
} else if (tabName === 'confirmed') {
|
} else if (tabName === 'confirmed') {
|
||||||
@@ -805,6 +859,8 @@ const handleReset = () => {
|
|||||||
formData.appointment_date = ''
|
formData.appointment_date = ''
|
||||||
formData.has_appointment = ''
|
formData.has_appointment = ''
|
||||||
formData.pending_assign = ''
|
formData.pending_assign = ''
|
||||||
|
formData.pending_booking = ''
|
||||||
|
formData.completed_appointment = ''
|
||||||
pager.page = 1
|
pager.page = 1
|
||||||
getLists()
|
getLists()
|
||||||
fetchDateCounts()
|
fetchDateCounts()
|
||||||
@@ -1532,6 +1588,36 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chip-pending-booking {
|
||||||
|
margin-left: 8px;
|
||||||
|
color: var(--el-color-info);
|
||||||
|
background: var(--el-color-info-light-9);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--el-color-info-light-8);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
color: #fff;
|
||||||
|
background: var(--el-color-info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.chip-completed-visit {
|
||||||
|
margin-left: 8px;
|
||||||
|
color: var(--el-color-success);
|
||||||
|
background: var(--el-color-success-light-9);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--el-color-success-light-8);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
color: #fff;
|
||||||
|
background: var(--el-color-success);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.chip-pending {
|
.chip-pending {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
color: var(--el-color-warning);
|
color: var(--el-color-warning);
|
||||||
|
|||||||
Reference in New Issue
Block a user