完善小程序排班与预约快捷操作

This commit is contained in:
2026-09-04 16:13:58 +08:00
parent 4209ee732c
commit 9ac56115d0
6 changed files with 88 additions and 6 deletions
+43
View File
@@ -418,5 +418,48 @@ Page({
wx.navigateTo({
url: `/pages/appointment-detail/index?id=${event.currentTarget.dataset.id}`
})
},
stopTap() {
},
async quickUpdateStatus(event) {
const appointment = this.data.appointments.find(item => String(item.orderItemId) === String(event.currentTarget.dataset.id))
if (!appointment) return
try {
await planningApi.updateStatus(appointment.orderId, Number(event.currentTarget.dataset.status))
wx.showToast({ title: '预约已确认', icon: 'success' })
this.loadCalendar()
} catch (error) {
wx.showToast({ title: error.message || '预约状态更新失败', icon: 'none' })
}
},
quickTransfer(event) {
wx.navigateTo({ url: `/pages/artist-transfer/index?id=${event.currentTarget.dataset.id}` })
},
quickCancel(event) {
const appointment = this.data.appointments.find(item => String(item.orderItemId) === String(event.currentTarget.dataset.id))
if (!appointment) return
wx.showModal({
title: '取消预约',
content: '确定取消这条预约吗?',
success: result => {
if (result.confirm) {
this.updateAppointmentStatus(appointment.orderId, 3)
}
}
})
},
async updateAppointmentStatus(orderId, status) {
try {
await planningApi.updateStatus(orderId, status)
wx.showToast({ title: '预约已取消', icon: 'success' })
this.loadCalendar()
} catch (error) {
wx.showToast({ title: error.message || '预约取消失败', icon: 'none' })
}
}
})