完善店员申请关联与预约页面
This commit is contained in:
@@ -50,6 +50,11 @@ Page({
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (this._waitingForEmployeeCreate) {
|
||||
this._waitingForEmployeeCreate = false
|
||||
this.loadEmployees()
|
||||
if (this.data.reviewExpanded) this.loadReviewApplications()
|
||||
}
|
||||
const app = getApp()
|
||||
if (!this.data.isManager || !app.globalData.openEmployeeReview) return
|
||||
app.globalData.openEmployeeReview = false
|
||||
@@ -128,12 +133,13 @@ Page({
|
||||
})
|
||||
if (!artists.length) {
|
||||
this.setData({ associationSheetVisible: false })
|
||||
await confirmModal({
|
||||
title: '暂时无法通过',
|
||||
content: '当前门店没有未关联微信的美甲师档案,请先新增美甲师,再审核这条申请。',
|
||||
confirmText: '知道了',
|
||||
showCancel: false
|
||||
const result = await confirmModal({
|
||||
title: '需要先新建美甲师',
|
||||
content: '当前门店没有未关联微信的美甲师档案。新建后将自动关联这条申请并通过审核。',
|
||||
confirmText: '去新建',
|
||||
cancelText: '稍后处理'
|
||||
})
|
||||
if (result.confirm) this.createEmployeeForApplication(applicationId, application && application.applicationNo)
|
||||
}
|
||||
} catch (error) {
|
||||
this.setData({ associationError: error.message || '未关联美甲师加载失败' })
|
||||
@@ -291,6 +297,15 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
createEmployeeForApplication(applicationId, applicationNo) {
|
||||
if (!applicationId) return
|
||||
this._waitingForEmployeeCreate = true
|
||||
wx.navigateTo({
|
||||
url: `/pages/employee-create/index?applicationId=${encodeURIComponent(applicationId)}&applicationNo=${encodeURIComponent(applicationNo || '')}`,
|
||||
fail: () => { this._waitingForEmployeeCreate = false }
|
||||
})
|
||||
},
|
||||
|
||||
onEmployeeAvatarError(event) {
|
||||
const index = Number(event.currentTarget.dataset.index)
|
||||
if (!Number.isInteger(index) || !this.data.employees[index]) return
|
||||
|
||||
Reference in New Issue
Block a user