Files
wxapp_companion/pages/order/orderEdit.wxml
T
lik c8bcc79865 feat(admin): 新增陪诊员入驻申请与全局角色守卫
- 新增 pages/apply 入驻申请页:填写资料、上传证件、查看审核状态
- 新增 utils/role.js 统一角色解析与管理端页面守卫
- app.js 包装 Page 构造器集中做 onShow 守卫,无身份用户重定向至申请页
- 订单、客户、档案、统计等按角色区分能力:陪诊员不请求档案接口,改用订单快照
- 订单列表支持待取消订单一键同意取消;新增订单价格由服务目录决定只读展示
2026-11-08 12:01:48 +08:00

191 lines
9.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--pages/order/orderEdit.wxml-->
<view class="page">
<!-- 未选择档案时的占位提示 -->
<view class="profile-brief profile-empty" wx:if="{{needPickProfile}}" bindtap="openProfilePicker">
<view class="profile-empty-main">
<text class="profile-empty-title">尚未选择健康档案</text>
<text class="profile-empty-sub">患者信息将取自所选档案</text>
</view>
<view class="profile-empty-btn">选择档案</view>
</view>
<!-- 健康档案简要信息 -->
<view class="profile-brief" wx:if="{{profileId || profileSummary}}">
<!-- 有关联档案:统一按档案ID加载(不读缓存,直接请求最新),患者信息以档案为准 -->
<patient-info
wx:if="{{profileId}}"
profile-id="{{profileId}}"
use-cache="{{false}}"
bindloaded="onProfileLoaded"
/>
<!-- 无关联档案(如订单未关联档案):使用订单快照 -->
<patient-info
wx:else
name="{{profileSummary.name}}"
sex-label="{{profileSummary.sexLabel}}"
age-text="{{profileSummary.ageText}}"
mobile="{{profileSummary.mobile}}"
location-text="{{profileSummary.locationText}}"
/>
<view class="brief-tags" wx:if="{{profileSummary.bloodType || profileSummary.height || profileSummary.weight}}">
<text wx:if="{{profileSummary.bloodType}}" class="brief-tag">血型 {{profileSummary.bloodType}}</text>
<text wx:if="{{profileSummary.height}}" class="brief-tag">身高 {{profileSummary.height}}cm</text>
<text wx:if="{{profileSummary.weight}}" class="brief-tag">体重 {{profileSummary.weight}}kg</text>
</view>
<text wx:if="{{profileSummary.remark}}" class="brief-remark">备注:{{profileSummary.remark}}</text>
<!-- 档案未关联客户:订单归属留空,管理员可后期在订单编辑中补录 -->
<text wx:if="{{profileOwnerMissing}}" class="field-tip">该档案未关联客户,订单归属将留空,可后期在订单编辑中补录</text>
</view>
<view class="form">
<!-- 就诊信息 -->
<view class="section">
<view class="section-title">就诊信息</view>
<view class="info-card">
<view class="field">
<text class="field-label">省份</text>
<picker class="field-picker" mode="selector" range="{{provinces}}" value="{{provinceIndex}}" bindchange="onProvinceChange">
<view class="field-value {{form.hospital.province ? '' : 'placeholder'}}">
{{form.hospital.province || '请选择省份'}}
<text class="arrow">›</text>
</view>
</picker>
</view>
<view class="field">
<text class="field-label">医院</text>
<input class="field-input" placeholder="请输入医院名称" value="{{form.hospital.name}}" data-key="hospital.name" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">科室</text>
<input class="field-input" placeholder="请输入科室" value="{{form.hospital.department}}" data-key="hospital.department" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">医生姓名</text>
<input class="field-input" placeholder="请输入医生姓名(选填)" value="{{form.hospital.doctor}}" data-key="hospital.doctor" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">就诊日期</text>
<picker class="field-picker" mode="date" value="{{form.schedule.date}}" start="{{today}}" bindchange="onDateChange">
<view class="field-value {{form.schedule.date ? '' : 'placeholder'}}">
{{form.schedule.date || '请选择就诊日期'}}
<text class="arrow">›</text>
</view>
</picker>
</view>
<view class="field">
<text class="field-label">开始时间</text>
<picker class="field-picker" mode="time" value="{{form.schedule.startTime}}" bindchange="onTimeChange">
<view class="field-value {{form.schedule.startTime ? '' : 'placeholder'}}">
{{form.schedule.startTime || '请选择开始时间(选填)'}}
<text class="arrow">›</text>
</view>
</picker>
</view>
</view>
</view>
<!-- 服务信息 -->
<view class="section">
<view class="section-title">服务信息</view>
<view class="info-card">
<view class="field">
<text class="field-label">服务名称</text>
<picker class="field-picker" mode="selector" range="{{serviceOptions}}" range-key="title" bindchange="onServiceChange">
<view class="field-value {{form.escort.serviceName ? '' : 'placeholder'}}">
{{form.escort.serviceName || '请选择服务'}}
<text class="arrow">›</text>
</view>
</picker>
</view>
<view class="field">
<text class="field-label">费用(元)</text>
<!-- 新增:价格由服务目录决定,只读展示;编辑:管理员可改价 -->
<text wx:if="{{!isEdit}}" class="field-value">{{servicePrice ? servicePrice : '选择服务后自动带出'}}</text>
<block wx:else>
<input class="field-input" type="digit" placeholder="请输入服务费用" value="{{form.payment.totalFee}}" data-key="payment.totalFee" bindinput="onInput" disabled="{{amountLocked}}" />
<text class="field-tip" wx:if="{{paymentLocked}}">已收款订单支付信息已锁定,退款请走取消流程</text>
<text class="field-tip" wx:elif="{{amountLocked}}">存在未支付流水,金额已锁定</text>
</block>
</view>
<!-- 支付状态与方式仅编辑时维护:新增订单固定为未支付,收款由编辑页补记 -->
<view class="field" wx:if="{{isEdit}}">
<text class="field-label">是否已支付</text>
<view class="field-switch">
<text class="switch-label {{form.payment.paid ? 'paid' : 'unpaid'}}">{{form.payment.paid ? '已支付' : '未支付'}}</text>
<switch checked="{{form.payment.paid}}" color="#C26A2E" disabled="{{paymentLocked}}" bindchange="onPaidChange" />
</view>
</view>
<view class="field" wx:if="{{isEdit}}">
<text class="field-label">支付方式</text>
<picker class="field-picker" mode="selector" range="{{methodOptions}}" range-key="label" disabled="{{paymentLocked}}" bindchange="onMethodChange">
<view class="field-value">
{{methodLabel || '未记录'}}
<text class="arrow">›</text>
</view>
</picker>
</view>
<view class="field field-textarea">
<text class="field-label">病历</text>
<textarea class="field-area" placeholder="请输入病历信息(选填)" value="{{form.inquiry.medicalHistory}}" data-key="inquiry.medicalHistory" bindinput="onInput" />
</view>
<view class="field field-textarea">
<text class="field-label">诉求</text>
<textarea class="field-area" placeholder="请输入陪诊诉求(选填)" value="{{form.inquiry.demand}}" data-key="inquiry.demand" bindinput="onInput" />
</view>
<view class="field field-textarea">
<text class="field-label">备注</text>
<textarea class="field-area" placeholder="请输入备注信息(选填)" value="{{form.notes.patientNote}}" data-key="notes.patientNote" bindinput="onInput" />
</view>
</view>
</view>
<!-- 提交 -->
<view class="submit-btn" bindtap="onSubmit">{{isEdit ? '保存修改' : '提交订单'}}</view>
</view>
<!-- 健康档案选择弹层 -->
<view class="picker-mask" wx:if="{{showProfilePicker}}" bindtap="closeProfilePicker">
<view class="picker-sheet" catchtap="noop">
<view class="picker-head">
<text class="picker-title">选择健康档案</text>
<text class="picker-close" bindtap="closeProfilePicker">✕</text>
</view>
<view class="picker-search">
<input class="picker-search-input" placeholder="搜索姓名 / 手机号" value="{{profileKeyword}}" bindinput="onProfileSearch" />
</view>
<scroll-view scroll-y class="picker-list">
<view
class="picker-item"
wx:for="{{filteredProfiles}}"
wx:key="id"
data-id="{{item.id}}"
bindtap="onProfileSelect"
>
<view class="picker-avatar">
<text>{{item.name[0]}}</text>
</view>
<view class="picker-item-main">
<view class="picker-item-name-row">
<text class="picker-item-name">{{item.name}}</text>
<text class="picker-item-sub">{{item.sexLabel}}{{item.sexLabel ? ' · ' : ''}}{{item.ageText}}</text>
</view>
<text class="picker-item-mobile">{{item.mobile || '暂无电话'}}</text>
</view>
<text class="picker-arrow">›</text>
</view>
<view class="picker-empty" wx:if="{{filteredProfiles.length === 0}}">未找到匹配的档案</view>
</scroll-view>
</view>
</view>
</view>