This commit is contained in:
@@ -1216,15 +1216,11 @@ Page({
|
||||
const nextDate = event.detail.value
|
||||
const today = dateUtil.formatDate(new Date())
|
||||
if (nextDate < today) {
|
||||
const result = await new Promise(resolve => {
|
||||
wx.showModal({
|
||||
title: '历史日期不能新建预约',
|
||||
content: '之前的日期只能作为历史补单记录,不会校验美甲师排班,也不会占用预约时段。',
|
||||
cancelText: '取消',
|
||||
confirmText: '去补单',
|
||||
success: resolve,
|
||||
fail: () => resolve({ confirm: false })
|
||||
})
|
||||
const result = await showActionModal(this, {
|
||||
title: '历史日期不能新建预约',
|
||||
content: '之前的日期只能作为历史补单记录,不会校验美甲师排班,也不会占用预约时段。',
|
||||
cancelText: '取消',
|
||||
confirmText: '去补单'
|
||||
})
|
||||
if (result.confirm) {
|
||||
const query = [`serviceDate=${encodeURIComponent(nextDate)}`]
|
||||
@@ -1782,14 +1778,12 @@ Page({
|
||||
},
|
||||
|
||||
async showBackfillPrompt(serviceDate, reason = '该日期或时段已过去') {
|
||||
const result = await new Promise(resolve => wx.showModal({
|
||||
const result = await showActionModal(this, {
|
||||
title: '转为历史补单',
|
||||
content: `${reason},普通预约不能使用过去时间。可以前往补录历史订单,或取消继续选择未来时间。`,
|
||||
cancelText: '取消',
|
||||
confirmText: '去补录',
|
||||
success: resolve,
|
||||
fail: () => resolve({ confirm: false })
|
||||
}))
|
||||
confirmText: '去补录'
|
||||
})
|
||||
if (!result.confirm) return
|
||||
const query = [`serviceDate=${encodeURIComponent(serviceDate || dateUtil.formatDate(new Date()))}`]
|
||||
const artistId = this.data.form.artistId || this._pendingHistoricalArtistId
|
||||
@@ -1902,15 +1896,11 @@ Page({
|
||||
try {
|
||||
const matches = await customersApi.matchIdentityForAppointment(name, wechatId || undefined, phone || undefined)
|
||||
if (matches.length > 1) {
|
||||
const choice = await new Promise(resolve => {
|
||||
wx.showModal({
|
||||
title: '找到多个同名客户',
|
||||
content: phone ? '无法确定唯一客户,请选择已有客户或按散客继续。' : '请先补充手机号或选择一个已有客户,也可以按散客继续。',
|
||||
cancelText: '不关联提交',
|
||||
confirmText: '选择客户',
|
||||
success: resolve,
|
||||
fail: () => resolve({ confirm: false })
|
||||
})
|
||||
const choice = await showActionModal(this, {
|
||||
title: '找到多个同名客户',
|
||||
content: phone ? '无法确定唯一客户,请选择已有客户或按散客继续。' : '请先补充手机号或选择一个已有客户,也可以按散客继续。',
|
||||
cancelText: '不关联提交',
|
||||
confirmText: '选择客户'
|
||||
})
|
||||
if (!choice.confirm) {
|
||||
this.setData({ 'form.createCustomerRecord': false })
|
||||
@@ -1925,15 +1915,11 @@ Page({
|
||||
}
|
||||
if (matches.length > 0) {
|
||||
const customer = normalizeCustomer(matches[0])
|
||||
const choice = await new Promise(resolve => {
|
||||
wx.showModal({
|
||||
title: '客户已存在',
|
||||
content: `系统中已有“${name}”${phone ? `(${phone})` : ''},是否使用该客户?`,
|
||||
cancelText: '不关联提交',
|
||||
confirmText: '使用已有',
|
||||
success: resolve,
|
||||
fail: () => resolve({ confirm: false })
|
||||
})
|
||||
const choice = await showActionModal(this, {
|
||||
title: '客户已存在',
|
||||
content: `系统中已有“${name}”${phone ? `(${phone})` : ''},是否使用该客户?`,
|
||||
cancelText: '不关联提交',
|
||||
confirmText: '使用已有'
|
||||
})
|
||||
if (choice.confirm) {
|
||||
this.setData({
|
||||
@@ -1947,15 +1933,11 @@ Page({
|
||||
return true
|
||||
}
|
||||
|
||||
const createChoice = await new Promise(resolve => {
|
||||
wx.showModal({
|
||||
title: '新建客户',
|
||||
content: '系统中没有匹配客户,是否新建到客户档案?',
|
||||
cancelText: '不新建',
|
||||
confirmText: '确认',
|
||||
success: resolve,
|
||||
fail: () => resolve({ confirm: false })
|
||||
})
|
||||
const createChoice = await showActionModal(this, {
|
||||
title: '新建客户',
|
||||
content: '系统中没有匹配客户,是否新建到客户档案?',
|
||||
cancelText: '不新建',
|
||||
confirmText: '确认'
|
||||
})
|
||||
this.setData({ 'form.createCustomerRecord': Boolean(createChoice.confirm) })
|
||||
return true
|
||||
@@ -2019,15 +2001,11 @@ Page({
|
||||
return
|
||||
}
|
||||
if (!form.artistId) {
|
||||
const result = await new Promise(resolve => {
|
||||
wx.showModal({
|
||||
title: '保存为待分配预约',
|
||||
content: '当前未指定美甲师,预约会正常保存,但不会占用美甲师时间。可以稍后在预约详情中分配。',
|
||||
cancelText: '返回选择',
|
||||
confirmText: '继续保存',
|
||||
success: resolve,
|
||||
fail: () => resolve({ confirm: false })
|
||||
})
|
||||
const result = await showActionModal(this, {
|
||||
title: '保存为待分配预约',
|
||||
content: '当前未指定美甲师,预约会正常保存,但不会占用美甲师时间。可以稍后在预约详情中分配。',
|
||||
cancelText: '返回选择',
|
||||
confirmText: '继续保存'
|
||||
})
|
||||
if (!result.confirm) return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user