修复预约改派与员工统计展示

This commit is contained in:
2026-07-25 13:36:04 +08:00
parent 219870a67b
commit 858f28be26
14 changed files with 421 additions and 18 deletions
@@ -208,6 +208,7 @@ Page({
timeText: '',
priceText: '未定',
detailTags: [],
artistChangeRequests: [],
productImageUrls: [],
productImageFileIds: '',
imageUploading: false,
@@ -244,6 +245,7 @@ Page({
timeText: '',
priceText: '未定',
detailTags: [],
artistChangeRequests: [],
productImageUrls: [],
productImageFileIds: '',
canEditAppointment: false,
@@ -263,17 +265,22 @@ Page({
const status = Number(appointment.status)
const showPendingActions = status === STATUS_PENDING_SERVICE
const showRestoreAction = status === STATUS_COMPLETED || status === STATUS_CANCELLED
const canEditAppointment = Boolean(appointment.canEdit)
const canTransfer = canTransferAppointment() && canEditAppointment
this.setData({
appointment,
avatarText: String(appointment.customerName || '客').slice(0, 1),
timeText: `${(appointment.startTime || '').slice(0, 16)} - ${(appointment.endTime || '').slice(11, 16)}`,
priceText: formatAppointmentPrice(appointment.amount),
detailTags: buildDetailTags(appointment),
artistChangeRequests: Array.isArray(appointment.artistChangeRequests)
? appointment.artistChangeRequests
: [],
productImageUrls: imageUrls,
productImageFileIds: resolveProductImageFileIds(appointment).join(','),
canEditAppointment: Boolean(appointment.canEdit),
canTransferAppointment: canTransferAppointment(),
showActionRow: showPendingActions || showRestoreAction,
canEditAppointment,
canTransferAppointment: canTransfer,
showActionRow: showPendingActions || showRestoreAction || canTransfer,
showPendingActions,
showRestoreAction,
loadError: ''
@@ -328,7 +335,7 @@ Page({
},
goTransfer() {
if (!this.data.canTransferAppointment) {
if (!this.data.canTransferAppointment || !this.data.canEditAppointment) {
wx.showToast({ title: '只有店长可以改派预约', icon: 'none' })
return
}