更新密码找回uniapp

This commit is contained in:
hero920103 committed 2026-11-16 17:22:50 +08:00
1 parent 7f9a66da0f
commit 3fdda89833
1304 files changed
+3503 -26132

No files matched your search

-29
View File
@@ -1,9 +1,7 @@
<template>
<view class="page">
<!-- 系统导航栏已带返回按钮 + 标题,无需自定义 header -->
<scroll-view class="body" scroll-y :show-scrollbar="false">
<!-- 顶部摘要 -->
<view class="summary">
<view class="summary-main">
<text class="summary-title">{{ item.biz_title || '审批详情' }}</text>
@@ -18,7 +16,6 @@
</view>
</view>
<!-- 基本信息 -->
<view class="card">
<text class="card-title">基本信息</text>
<view class="info-row">
@@ -47,7 +44,6 @@
</view>
</view>
<!-- 审批流程 -->
<view class="card">
<text class="card-title">审批流程</text>
<view v-if="!timeline.length" class="timeline-empty">暂无流程节点</view>
@@ -82,20 +78,16 @@
<view class="bottom-space" />
</scroll-view>
<!-- 底部操作栏:只有有操作权限时才显示 -->
<view v-if="showActionBar" class="action-bar">
<!-- 当前审批人:通过 + 驳回 -->
<view v-if="canApprove" class="btn-row">
<view class="btn-reject" hover-class="btn-active" @tap="openApprove(false)">驳回</view>
<view class="btn-pass" hover-class="btn-active" @tap="openApprove(true)">通过</view>
</view>
<!-- 发起人:仅撤回(不能审批自己的单子) -->
<view v-else-if="canWithdraw" class="btn-row">
<view class="btn-withdraw" hover-class="btn-active" @tap="doWithdraw">撤回审批</view>
</view>
</view>
<!-- 审批意见弹窗 -->
<view v-if="showApprove" class="modal-overlay" @tap="hideApprove">
<view class="modal-container" @tap.stop>
<view class="modal-head">
@@ -158,7 +150,6 @@ const approveForm = ref({ pass: true, comment: '' })
const showActionBar = computed(() => canApprove.value || canWithdraw.value)
// 当前节点名(审批弹窗展示用)
const currentNodeLabel = computed(() => {
const cur = timeline.value.find(t => t.is_current)
return cur ? (cur.node_name || cur.node_key) : ''
@@ -187,24 +178,20 @@ async function loadDetail(id) {
canWithdraw.value = !!data.canWithdraw
currentTaskID.value = data.currentTaskID || 0
} catch (e) {
// request.js 已 toast
} finally {
loading.value = false
}
}
/** 头像文字:取姓名字首字 */
function avatarText(task) {
const name = String(task.approver_name || '').trim()
return name ? name.slice(0, 1) : '系'
}
/** 头像底色:审批人蓝色,结束节点灰色 */
function avatarClass(task) {
return task.node_type === 3 ? 'avatar-end' : ''
}
/** 状态角标配色:进行中橙 / 已通过绿 / 已驳回红 / 其它灰 */
function badgeClass(task) {
if (task.is_current) return 'badge-running'
if (task.status === 1) return 'badge-pass'
@@ -219,21 +206,18 @@ function badgeIcon(task) {
return '—'
}
/** 主标题:申请人带「(申请人)」标识,末尾固定「流程结束」 */
function nodeTitle(task) {
if (task.node_type === 1) return `${task.approver_name || '发起人'}(申请人)`
if (task.node_type === 3) return '流程结束'
return task.approver_name || task.node_name || '审批节点'
}
/** 副标题:部门/角色,缺失时回退节点名 */
function nodeSub(task) {
if (task.node_type === 1) return '提交申请'
if (task.node_type === 3) return task.status_label || ''
return task.approver_sub || task.node_name || '审批'
}
/** 时间只展示到分钟,保持与设计稿一致的紧凑排版 */
function nodeTime(task) {
const value = task.finish_time || task.create_time || ''
return value ? String(value).slice(0, 16) : ''
@@ -250,8 +234,6 @@ function hideApprove() {
async function doApprove() {
if (approving.value) return
// currentTaskID 为 0 表示当前用户不是审批人(典型:发起人视角),
// 仍然把请求交给后端判定:后端会返回 403「您无权处理该任务」并由 request.js 弹 toast。
approving.value = true
try {
await approveTask({
@@ -265,8 +247,6 @@ async function doApprove() {
})
hideApprove()
// 如果是报销单审批,跳转回报销详情页并触发刷新事件
// (biz_type 兼容新写法 reimburse 与早期按模块记录的 oa)
if (['reimburse', 'oa'].includes(item.value.biz_type) && item.value.biz_id) {
uni.$emit('expense-updated', { id: item.value.biz_id })
uni.redirectTo({
@@ -277,7 +257,6 @@ async function doApprove() {
loadDetail(item.value.id)
} catch (e) {
// request.js 已 toast
} finally {
approving.value = false
}
@@ -297,7 +276,6 @@ async function doWithdraw() {
uni.showToast({ title: '已撤回', icon: 'success' })
loadDetail(item.value.id)
} catch (e) {
// request.js 已 toast
}
}
})
@@ -321,7 +299,6 @@ async function doWithdraw() {
padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
}
/* ====== 摘要区 ====== */
.summary {
@include card;
margin-bottom: 20rpx;
@@ -358,7 +335,6 @@ async function doWithdraw() {
padding-top: 4rpx;
}
/* ====== 卡片 ====== */
.card {
@include card;
margin-bottom: 20rpx;
@@ -374,7 +350,6 @@ async function doWithdraw() {
color: $color-text;
margin-bottom: 24rpx;
/* 左侧蓝色竖条标识(与设计稿一致) */
&::before {
content: '';
position: absolute;
@@ -412,21 +387,18 @@ async function doWithdraw() {
word-break: break-all;
}
/* ====== 时间线 ====== */
.timeline-empty {
font-size: 24rpx;
color: $color-text-muted;
padding: 16rpx 0 8rpx;
}
/* 审批流时间线(公共 mixin,与报销详情的审批记录同一套样式) */
@include flow-timeline;
.bottom-space {
height: 40rpx;
}
/* ====== 底部操作栏 ====== */
.action-bar {
flex-shrink: 0;
background: $color-card;
@@ -471,7 +443,6 @@ async function doWithdraw() {
.btn-active { opacity: 0.85; }
/* ====== 审批弹窗 ====== */
.modal-overlay {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
-8
View File
@@ -1,6 +1,5 @@
<template>
<view class="page">
<!-- 顶部工具栏(系统导航栏已带返回按钮 + 标题,这里只放搜索/筛选) -->
<view class="toolbar">
<view class="search-box">
<FaIcon name="magnifying-glass" color="#94a3b8" :size="16" />
@@ -15,7 +14,6 @@
</view>
</view>
<!-- 状态筛选 -->
<scroll-view class="tab-scroll" scroll-x :show-scrollbar="false">
<view class="tab-list">
<view
@@ -30,10 +28,8 @@
</view>
</scroll-view>
<!-- 说明:审批单据由各业务模块提交后进入此处,这里不提供新增 -->
<text class="page-tip">审批由各业务模块提交后在此查看与处理</text>
<!-- 列表 -->
<scroll-view class="list-scroll" scroll-y :show-scrollbar="false" @scrolltolower="loadMore">
<view v-if="loading && !list.length" class="state-box">
<text class="state-text">加载中...</text>
@@ -93,7 +89,6 @@ import { isLoggedIn } from '@/utils/auth.js'
const PAGE_SIZE = 20
/** 状态 tab(首个为「全部」,不展示「草稿」) */
const statusTabs = [
{ value: '', label: '全部' },
...APPROVAL_INSTANCE_STATUS_OPTIONS.filter(o => o.value !== 0)
@@ -189,7 +184,6 @@ function openDetail(id) {
flex-direction: column;
}
/* ====== 顶部搜索 ====== */
.toolbar {
position: relative;
z-index: 10;
@@ -221,7 +215,6 @@ function openDetail(id) {
}
}
/* ====== 状态筛选 tab ====== */
.tab-scroll {
flex-shrink: 0;
white-space: nowrap;
@@ -257,7 +250,6 @@ function openDetail(id) {
color: $color-text-muted;
}
/* ====== 列表 ====== */
.list-scroll {
flex: 1;
height: 0;
-7
View File
@@ -1,6 +1,5 @@
<template>
<view class="page">
<!-- 顶部:搜索(系统导航栏已带返回按钮 + 标题) -->
<view class="toolbar">
<view class="search-box">
<FaIcon name="magnifying-glass" color="#94a3b8" :size="16" />
@@ -19,7 +18,6 @@
<text class="stat-text">共 {{ total }} 条待办</text>
</view>
<!-- 待办列表 -->
<scroll-view class="list-scroll" scroll-y :show-scrollbar="false" @scrolltolower="loadMore">
<view v-if="loading && !list.length" class="state-box">
<text class="state-text">加载中...</text>
@@ -54,8 +52,6 @@
<view class="card-meta" v-if="task.deadline">
<text class="meta-text">截止:{{ task.deadline }}</text>
</view>
<!-- card-actions 不接管 tap,只把"查看详情"按钮的 tap 单独拦在按钮层,
这样 card 主体其它区域的 tap 仍能正常冒泡到 .todo-card 触发跳转 -->
<view class="card-actions">
<view class="op-btn op-view" hover-class="btn-active" @tap.stop="openDetail(task.instance)">查看详情</view>
</view>
@@ -167,7 +163,6 @@ function openDetail(instance) {
flex-direction: column;
}
/* ====== 顶部搜索 ====== */
.toolbar {
flex-shrink: 0;
padding: 20rpx $page-padding-x;
@@ -197,7 +192,6 @@ function openDetail(instance) {
}
}
/* ====== 计数条 ====== */
.stat-bar {
flex-shrink: 0;
padding: 16rpx $page-padding-x;
@@ -210,7 +204,6 @@ function openDetail(instance) {
color: $color-text-secondary;
}
/* ====== 列表 ====== */
.list-scroll {
flex: 1;
height: 0;