功能:支持待分配预约与首次排班引导
This commit is contained in:
@@ -7,6 +7,7 @@ Page({
|
||||
appointment: {},
|
||||
avatarText: '',
|
||||
timeText: '',
|
||||
isUnassigned: false,
|
||||
loadError: ''
|
||||
},
|
||||
|
||||
@@ -32,6 +33,7 @@ Page({
|
||||
applyAppointment(appointment) {
|
||||
this.setData({
|
||||
appointment,
|
||||
isUnassigned: appointment.assignmentStatus === 'UNASSIGNED' || !appointment.artistId,
|
||||
avatarText: String(appointment.customerName || '客').slice(0, 1),
|
||||
timeText: `${(appointment.startTime || '').slice(0, 16)} - ${(appointment.endTime || '').slice(11, 16)}`,
|
||||
loadError: ''
|
||||
@@ -39,6 +41,10 @@ Page({
|
||||
},
|
||||
|
||||
async updateStatus(status) {
|
||||
if (status !== 3 && this.data.isUnassigned) {
|
||||
wx.showToast({ title: '请先分配员工', icon: 'none' })
|
||||
return
|
||||
}
|
||||
try {
|
||||
await planningApi.updateStatus(this.data.appointment.orderId, status)
|
||||
markPlanningRefresh()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</view>
|
||||
<view class="detail-actions">
|
||||
<text class="tag">{{appointment.statusText}}</text>
|
||||
<button class="small-action" bindtap="goTransfer">改派</button>
|
||||
<button class="small-action" bindtap="goTransfer">{{isUnassigned ? '分配员工' : '改派'}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-grid">
|
||||
@@ -25,7 +25,7 @@
|
||||
</view>
|
||||
<view>
|
||||
<text class="label">美甲师</text>
|
||||
<text class="value">{{appointment.artistName}}</text>
|
||||
<text class="value">{{isUnassigned ? '待分配' : appointment.artistName}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="label">时间</text>
|
||||
@@ -44,8 +44,8 @@
|
||||
</view>
|
||||
|
||||
<view wx:if="{{!loadError}}" class="fixed-bottom action-row">
|
||||
<button class="secondary-btn" bindtap="confirm">确认</button>
|
||||
<button class="primary-btn" bindtap="complete">完成</button>
|
||||
<button class="secondary-btn" disabled="{{isUnassigned}}" bindtap="confirm">{{isUnassigned ? '待分配' : '确认'}}</button>
|
||||
<button class="primary-btn" disabled="{{isUnassigned}}" bindtap="complete">完成</button>
|
||||
<button class="danger-btn" bindtap="cancel">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user