Files
JayuCloud/JY-Salon-WeChat/pages/employee-detail/index.wxml
T

195 lines
8.8 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.
<view class="page no-tab">
<view wx:if="{{loadError}}" class="empty card detail-error">
<text>{{loadError}}</text>
<button class="secondary-btn retry-btn" bindtap="loadDetail">重试</button>
</view>
<view wx:else class="card employee-head">
<view wx:if="{{employee.avatar}}" class="avatar image-avatar">
<image src="{{employee.avatar}}" mode="aspectFill"></image>
</view>
<view wx:else class="avatar" style="background: {{employee.color}};">{{employee.shortName}}</view>
<view>
<text class="employee-name">{{employee.name}}</text>
<view class="head-tag-row">
<text class="tag" style="background: {{employee.color}}; color: #fff;">{{employee.roleText}}</text>
<text class="tag ghost">员工色</text>
</view>
</view>
</view>
<view wx:if="{{!loadError}}" class="stats">
<view class="card stat">
<text class="stat-value">{{employee.monthOrders}}</text>
<text class="stat-label">本月订单</text>
</view>
<view class="card stat">
<text class="stat-value">¥{{employee.monthAmount}}</text>
<text class="stat-label">本月营业额</text>
</view>
<view class="card stat">
<text class="stat-value">¥{{employee.avgAmount}}</text>
<text class="stat-label">平均客单价</text>
</view>
</view>
<view wx:if="{{!loadError}}" class="section">
<view class="section-title">基础信息</view>
<view class="card info-card">
<view class="info-row">
<text class="info-label">姓名</text>
<text class="info-value">{{employee.name}}</text>
</view>
<view class="info-row">
<text class="info-label">角色</text>
<text class="info-value">{{employee.roleText}}</text>
</view>
<view class="info-row">
<text class="info-label">联系电话</text>
<text class="info-value">{{employee.contactPhoneText}}</text>
</view>
<view class="info-row">
<text class="info-label">当前状态</text>
<text class="info-value">{{employee.currentStatusText}}</text>
</view>
<view class="info-row">
<text class="info-label">参与制作美甲</text>
<text class="info-value">{{employee.participateProductionText}}</text>
</view>
<view class="info-more-toggle {{moreInfoVisible ? 'open' : ''}}" bindtap="toggleMoreInfo">
<text>更多资料</text>
<text class="info-more-arrow">{{moreInfoVisible ? '收起' : '展开'}}</text>
</view>
<view wx:if="{{moreInfoVisible}}" class="info-more-body">
<view class="info-row">
<text class="info-label">登录账号</text>
<text class="info-value">{{employee.accountText}}</text>
</view>
<view class="info-row">
<text class="info-label">手机号</text>
<text class="info-value">{{employee.phoneText}}</text>
</view>
<view class="info-row">
<text class="info-label">微信号</text>
<text class="info-value">{{employee.wechatIdText}}</text>
</view>
<view class="info-row">
<text class="info-label">身份</text>
<text class="info-value">{{employee.identityText}}</text>
</view>
</view>
</view>
</view>
<view wx:if="{{!loadError}}" class="card status-card">
<view class="status-copy">
<text class="status-title">账号状态</text>
<text class="status-desc">停用会同步账号管理中的停用状态,并使该员工账号无法登录;休假仍通过请假/排班管理控制。</text>
</view>
<button class="status-btn {{employee.currentStatusCode === 'DISABLED' ? 'enable' : 'disable'}}" loading="{{statusUpdating}}" disabled="{{statusUpdating}}" bindtap="requestToggleStatus">
{{employee.currentStatusCode === 'DISABLED' ? '恢复正常' : '停用账号'}}
</button>
</view>
<view wx:if="{{!loadError}}" class="section">
<view class="menu-grid">
<view class="card menu-card" data-url="/pages/schedule-setting/index" bindtap="go">
<text>排班设置</text>
<text class="menu-arrow">›</text>
</view>
<view class="card menu-card" data-url="/pages/leave-management/index" bindtap="go">
<text>工时管理</text>
<text class="menu-arrow">›</text>
</view>
<view class="card menu-card" data-url="/pages/color-setting/index" bindtap="go">
<text>颜色设置</text>
<text class="menu-arrow">›</text>
</view>
<view class="card menu-card" data-url="/pages/employee-orders/index" bindtap="go">
<text>订单记录</text>
<text class="menu-arrow">›</text>
</view>
</view>
</view>
<view wx:if="{{!loadError}}" class="card reset-card">
<view class="reset-row">
<text class="reset-title">重置登录密码</text>
<button class="reset-btn" loading="{{resettingPassword}}" disabled="{{resettingPassword}}" bindtap="requestResetPassword">重置</button>
</view>
</view>
<view wx:if="{{!loadError}}" class="card delete-card">
<view class="danger-summary" bindtap="toggleDangerZone">
<view class="danger-summary-main">
<view class="delete-icon">!</view>
<view>
<text class="delete-title">危险操作</text>
<text class="danger-summary-desc">删除员工与当前店铺的关系</text>
</view>
</view>
<text class="danger-summary-arrow">{{dangerExpanded ? '收起' : '展开'}}</text>
</view>
<view wx:if="{{dangerExpanded}}" class="danger-body">
<text class="delete-desc">登录账号和历史订单会继续保留,删除后仅解除该员工与当前店铺的关系。</text>
<view class="delete-facts">
<view class="delete-fact">
<text class="delete-fact-label">员工列表</text>
<text class="delete-fact-value">移除</text>
</view>
<view class="delete-fact">
<text class="delete-fact-label">登录账号</text>
<text class="delete-fact-value">保留</text>
</view>
</view>
<button class="delete-btn" loading="{{deletingEmployee}}" disabled="{{deletingEmployee}}" bindtap="requestDeleteEmployee">删除员工</button>
</view>
</view>
<view wx:if="{{deleteConfirmVisible}}" class="delete-confirm-mask" bindtap="closeDeleteConfirm">
<view class="delete-confirm-panel" catchtap="stopTap">
<view class="delete-confirm-icon">!</view>
<text class="delete-confirm-title">确认删除员工</text>
<text class="delete-confirm-desc">删除后该员工会从当前店铺员工列表移除,但登录账号不会被删除。</text>
<view class="delete-confirm-facts">
<view class="delete-confirm-fact">
<text>员工列表</text>
<text>移除</text>
</view>
<view class="delete-confirm-fact">
<text>登录账号</text>
<text>保留</text>
</view>
</view>
<view class="delete-confirm-actions">
<button class="delete-confirm-cancel" disabled="{{deletingEmployee}}" bindtap="closeDeleteConfirm">取消</button>
<button class="delete-confirm-submit" loading="{{deletingEmployee}}" disabled="{{deletingEmployee}}" bindtap="confirmDeleteEmployee">确认删除</button>
</view>
</view>
</view>
<view wx:if="{{resetConfirmVisible}}" class="delete-confirm-mask" bindtap="closeResetConfirm">
<view class="delete-confirm-panel" catchtap="stopTap">
<view class="delete-confirm-icon">!</view>
<text class="delete-confirm-title">确认重置密码</text>
<text class="delete-confirm-desc">重置后当前员工需要使用系统默认密码登录。</text>
<view class="delete-confirm-actions">
<button class="delete-confirm-cancel" disabled="{{resettingPassword}}" bindtap="closeResetConfirm">取消</button>
<button class="delete-confirm-submit" loading="{{resettingPassword}}" disabled="{{resettingPassword}}" bindtap="confirmResetPassword">确认重置</button>
</view>
</view>
</view>
<view wx:if="{{statusConfirmVisible}}" class="delete-confirm-mask" bindtap="closeStatusConfirm">
<view class="delete-confirm-panel" catchtap="stopTap">
<view class="delete-confirm-icon">!</view>
<text class="delete-confirm-title">确认修改账号状态</text>
<text class="delete-confirm-desc">{{pendingStatusValue === 0 ? '停用后该员工账号将无法登录店务系统。' : '恢复后该员工账号将重新可登录。'}}</text>
<view class="delete-confirm-actions">
<button class="delete-confirm-cancel" disabled="{{statusUpdating}}" bindtap="closeStatusConfirm">取消</button>
<button class="delete-confirm-submit" loading="{{statusUpdating}}" disabled="{{statusUpdating}}" bindtap="confirmToggleStatus">{{pendingStatusText}}</button>
</view>
</view>
</view>
</view>