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

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
}
@@ -73,6 +73,23 @@
<view class="card note-card">{{appointment.remark || '暂无备注'}}</view>
</view>
<view wx:if="{{!loadError && artistChangeRequests.length}}" class="section">
<view class="section-title">改派历史</view>
<view class="card change-history-card">
<view wx:for="{{artistChangeRequests}}" wx:key="id" class="change-history-item">
<view class="change-history-path">
<text>{{item.fromArtistName || '未分配'}}</text>
<text class="change-history-arrow">→</text>
<text>{{item.toArtistName || '未分配'}}</text>
</view>
<view class="change-history-meta">
<text>操作人:{{item.requesterName || '系统'}}</text>
<text>{{item.approvedTime || item.createTime || ''}}</text>
</view>
</view>
</view>
</view>
<view wx:if="{{priceModalVisible}}" class="detail-modal-mask" catchtap="stopTap">
<view class="price-modal" catchtap="stopTap">
<view class="price-modal-head">
@@ -97,9 +114,10 @@
</view>
</view>
<view wx:if="{{!loadError && showActionRow}}" class="fixed-bottom action-row {{showRestoreAction ? 'single' : ''}}">
<view wx:if="{{!loadError && showActionRow}}" class="fixed-bottom action-row {{showRestoreAction ? 'single' : ''}} {{canTransferAppointment ? 'with-transfer' : ''}}">
<button wx:if="{{showPendingActions}}" class="primary-btn" bindtap="complete">完成</button>
<button wx:if="{{showPendingActions}}" class="danger-btn" bindtap="deleteAppointment">删除此订单</button>
<button wx:if="{{canTransferAppointment}}" class="secondary-btn transfer-btn" bindtap="goTransfer">改派</button>
<button wx:if="{{showRestoreAction}}" class="secondary-btn" bindtap="restorePending">修改状态</button>
</view>
</view>
@@ -165,6 +165,42 @@
line-height: 1.6;
}
.change-history-card {
padding: 0 24rpx;
}
.change-history-item {
padding: 22rpx 0;
border-bottom: 1rpx solid #eee5dc;
}
.change-history-item:last-child {
border-bottom: 0;
}
.change-history-path {
display: flex;
align-items: center;
gap: 12rpx;
color: #2d2924;
font-size: 26rpx;
font-weight: 800;
}
.change-history-arrow {
color: #7d9d90;
font-size: 28rpx;
}
.change-history-meta {
display: flex;
justify-content: space-between;
gap: 16rpx;
margin-top: 10rpx;
color: #9a9288;
font-size: 22rpx;
}
.section-head {
display: flex;
align-items: center;
@@ -392,6 +428,10 @@
grid-template-columns: 1fr;
}
.action-row.with-transfer {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.action-row .primary-btn,
.action-row .secondary-btn,
.action-row .danger-btn {