|
|
@@ -71,6 +71,7 @@
|
|
|
<view v-if="item.status === 4 && item.collectTime" class="line sub">领取时间:{{ formatTime(item.collectTime) }}</view>
|
|
|
</view>
|
|
|
<view
|
|
|
+ v-if="shouldShowStatusBadge(item)"
|
|
|
class="status-badge"
|
|
|
:class="['st-' + item.status, { clickable: canOperateStatus(item), disabled: isNotifyDisabled(item) }]"
|
|
|
@click.stop="confirmStatusAction(index, list.data)"
|
|
|
@@ -169,6 +170,7 @@ import ModalModule from '@/components/plugin/modal'
|
|
|
import { getBoardList, getBoardCounts, notifyTomorrow, notifyBirthdayGift, modifyBirthday, collectBirthdayGift } from '@/api/birthday'
|
|
|
import { iconSrc } from '@/utils/iconSrc'
|
|
|
|
|
|
+// 生日看板供花店员工查看客户生日与赠礼状态,并处理通知、领取及生日补录流程。
|
|
|
export default {
|
|
|
name: 'BirthdayBoard',
|
|
|
components: { AppWrapperEmpty, ModalModule },
|
|
|
@@ -343,6 +345,18 @@ export default {
|
|
|
isNotifyDisabled(item = {}) {
|
|
|
return Number(item.status) === 1 && !this.canNotify(item)
|
|
|
},
|
|
|
+ // 控制状态标签是否展示;待通知记录的公历生日早于今天时隐藏,日期缺失或格式异常时保留展示。
|
|
|
+ shouldShowStatusBadge(item = {}) {
|
|
|
+ if (item.statusName !== '待通知') return true
|
|
|
+ const match = String(item.birthdayDisplay || '').match(/(\d{1,2})月(\d{1,2})日/)
|
|
|
+ if (!match) return true
|
|
|
+ const birthdayMonth = Number(match[1])
|
|
|
+ const birthdayDate = Number(match[2])
|
|
|
+ const today = new Date()
|
|
|
+ const currentMonth = today.getMonth() + 1
|
|
|
+ const currentDate = today.getDate()
|
|
|
+ return birthdayMonth > currentMonth || (birthdayMonth === currentMonth && birthdayDate >= currentDate)
|
|
|
+ },
|
|
|
confirmStatusAction(index, list) {
|
|
|
const item = list[index]
|
|
|
if (this.canNotify(item)) {
|