fix: 订单详情按状态收敛医院与备注修改入口
后端已限制进行中订单只能改就诊人备注;前端把单一 canEditOrder 拆为 canEditBooking / canEditNote,避免展示必然失败的修改入口。
This commit is contained in:
@@ -90,7 +90,10 @@ Page({
|
|||||||
const service = services.find(entry => entry.id === item.escort?.serviceId) || null
|
const service = services.find(entry => entry.id === item.escort?.serviceId) || null
|
||||||
const record = this.formatRecord(item)
|
const record = this.formatRecord(item)
|
||||||
// 服务已下架时仍可查看历史订单,但不能再按失效规则修改订单。
|
// 服务已下架时仍可查看历史订单,但不能再按失效规则修改订单。
|
||||||
if (!service) record.canEditOrder = false
|
if (!service) {
|
||||||
|
record.canEditBooking = false
|
||||||
|
record.canEditNote = false
|
||||||
|
}
|
||||||
this.setData({ record, service })
|
this.setData({ record, service })
|
||||||
if (service) this.applyBookingConfig(service)
|
if (service) this.applyBookingConfig(service)
|
||||||
if (record.healthProfileId) this.loadProfileSnapshot(record.healthProfileId)
|
if (record.healthProfileId) this.loadProfileSnapshot(record.healthProfileId)
|
||||||
@@ -180,7 +183,9 @@ Page({
|
|||||||
&& (status === 'pending' || status === 'confirmed' || status === 'cancelled')
|
&& (status === 'pending' || status === 'confirmed' || status === 'cancelled')
|
||||||
const canRebook = (status === 'completed' || status === 'cancelled') && item.escort?.serviceId > 0
|
const canRebook = (status === 'completed' || status === 'cancelled') && item.escort?.serviceId > 0
|
||||||
// 终态单据只读:医院预约与陪诊需求不允许回改(就诊人「修改」改的是档案,不在此列)
|
// 终态单据只读:医院预约与陪诊需求不允许回改(就诊人「修改」改的是档案,不在此列)
|
||||||
const canEditOrder = status !== 'completed' && status !== 'cancelled'
|
// 进行中服务已开始:排期与医院不允许用户单方变更,仅保留就诊人备注(与后端字段白名单一致)
|
||||||
|
const canEditBooking = status === 'pending' || status === 'confirmed'
|
||||||
|
const canEditNote = canEditBooking || status === 'in_progress'
|
||||||
|
|
||||||
// 就诊人字段先落到局部变量:摘要行(patientMeta)与首字牌(patientInitial)
|
// 就诊人字段先落到局部变量:摘要行(patientMeta)与首字牌(patientInitial)
|
||||||
// 都从同一批值派生,口径不在 WXML 与 JS 两处各写一份
|
// 都从同一批值派生,口径不在 WXML 与 JS 两处各写一份
|
||||||
@@ -247,7 +252,8 @@ Page({
|
|||||||
canCancel,
|
canCancel,
|
||||||
canDelete,
|
canDelete,
|
||||||
canRebook,
|
canRebook,
|
||||||
canEditOrder,
|
canEditBooking,
|
||||||
|
canEditNote,
|
||||||
// 底栏只在确实有按钮时出现,避免无动作状态空留一条白栏
|
// 底栏只在确实有按钮时出现,避免无动作状态空留一条白栏
|
||||||
showBottomBar: canCancel || canDelete || canRebook,
|
showBottomBar: canCancel || canDelete || canRebook,
|
||||||
createTime: item.meta?.createtime ? formatDateTime(item.meta.createtime) : '',
|
createTime: item.meta?.createtime ? formatDateTime(item.meta.createtime) : '',
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
<view class="section-head">
|
<view class="section-head">
|
||||||
<view class="section-bar"></view>
|
<view class="section-bar"></view>
|
||||||
<text class="section-title">医院预约信息</text>
|
<text class="section-title">医院预约信息</text>
|
||||||
<view class="section-link" wx:if="{{record.canEditOrder}}" bindtap="onEditHospital">
|
<view class="section-link" wx:if="{{record.canEditBooking}}" bindtap="onEditHospital">
|
||||||
<text class="section-link-text">修改</text>
|
<text class="section-link-text">修改</text>
|
||||||
<t-icon name="edit" size="26rpx" color="#6F655C" />
|
<t-icon name="edit" size="26rpx" color="#6F655C" />
|
||||||
</view>
|
</view>
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
<view class="section-head">
|
<view class="section-head">
|
||||||
<view class="section-bar"></view>
|
<view class="section-bar"></view>
|
||||||
<text class="section-title">陪诊需求与症状</text>
|
<text class="section-title">陪诊需求与症状</text>
|
||||||
<view class="section-link" wx:if="{{record.canEditOrder}}" bindtap="onEditPatientNote">
|
<view class="section-link" wx:if="{{record.canEditNote}}" bindtap="onEditPatientNote">
|
||||||
<text class="section-link-text">修改</text>
|
<text class="section-link-text">修改</text>
|
||||||
<t-icon name="edit" size="26rpx" color="#6F655C" />
|
<t-icon name="edit" size="26rpx" color="#6F655C" />
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Reference in New Issue
Block a user