feat(customer): support birthdate followup reminder

This commit is contained in:
Timi
2026-11-16 16:23:23 +08:00
parent 553de63cc7
commit 208fdde290
9 changed files with 687 additions and 350 deletions
@@ -54,8 +54,8 @@
<t-tag
size="small"
variant="outline"
:theme="internalNotifyStatus ? getNotifyStatusTheme(internalNotifyStatus.status) : 'primary'"
:content="internalNotifyStatus ? getNotifyStatusText(internalNotifyStatus.status) : '已配置'"
:theme="internalNotifyStatus ? getNotifyStatusTheme(internalNotifyStatus.status) : (isNotifyPending ? 'warning' : 'primary')"
:content="internalNotifyStatus ? getNotifyStatusText(internalNotifyStatus.status) : (isNotifyPending ? '待发送' : '已配置')"
/>
</template>
</t-cell>
@@ -162,6 +162,8 @@ const isLoading = ref(false);
const isCompleting = ref(false);
const isDeleting = ref(false);
const internalNotifyStatus = ref<NotifyDetail>();
// 站内通知在提醒时间之后才对接收人可见,未到时间时后端按未发送处理
const isNotifyPending = computed(() => Boolean(detail.value?.remindAt && Time.now() < detail.value.remindAt));
let loadToken = 0;
const canUpdate = computed(() => detail.value?.status === "PENDING"
@@ -258,6 +260,10 @@ async function loadInternalNotifyStatus(item: FollowUpReminder, token: number):
if (!item.internalNotifyDetailId || !userStore.hasPermissions(corePermissionCodes.notify.read)) {
return;
}
// 未到提醒时间时后端按未发送处理,直接跳过避免必然失败的请求
if (item.remindAt && Time.now() < item.remindAt) {
return;
}
try {
const result = await NotifyAPI.internalDetail(item.internalNotifyDetailId);
if (token === loadToken) {