更新密码找回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

-26
View File
@@ -4,7 +4,6 @@
<text class="state-text">加载中...</text>
</view>
<template v-else-if="detail">
<!-- 单据信息 -->
<view class="detail-card">
<view class="head-row">
<text class="head-amount">¥{{ moneyText(detail.total_amount) }}</text>
@@ -35,7 +34,6 @@
</view>
</view>
<!-- 费用明细 -->
<view class="block-card">
<view class="block-head">
<text class="block-title">费用明细</text>
@@ -74,7 +72,6 @@
</view>
</view>
<!-- 审批记录(与审批中心一致的审批流样式) -->
<view class="block-card">
<view class="block-head">
<text class="block-title">审批记录</text>
@@ -112,7 +109,6 @@
</view>
</template>
<!-- 操作按钮:草稿可删除/编辑/提交;审批通过后由报销人确认到账 -->
<view v-if="detail && isDraft" class="footer">
<view class="footer-btn">
<u-button type="error" plain icon="trash" text="删除" @click="onDelete" />
@@ -125,7 +121,6 @@
</view>
</view>
<!-- 审批通过:等待报销人确认款项是否已到账 -->
<view v-else-if="detail && isApproved" class="footer">
<view class="footer-btn">
<u-button type="success" icon="checkmark-circle" text="确认到账" @click="onConfirmPaid" />
@@ -162,7 +157,6 @@ const myTask = ref(null)
const loading = ref(false)
const isDraft = computed(() => Number(detail.value?.status) === EXPENSE_STATUS.DRAFT)
// 审批通过:等待报销人本人确认款项到账
const isApproved = computed(() => Number(detail.value?.status) === EXPENSE_STATUS.APPROVED)
const descText = computed(() => {
@@ -170,7 +164,6 @@ const descText = computed(() => {
return desc || ''
})
/** 审批记录 -> 审批流节点:每条记录一个节点,末尾补「流程结束」节点展示单据当前状态 */
const flowNodes = computed(() => {
const nodes = (records.value || []).map((record, index) => {
const action = Number(record.action)
@@ -199,7 +192,6 @@ const flowNodes = computed(() => {
return nodes
})
/** 末尾「流程结束」节点:显示单据当前状态,让申请人一眼看出流程是否走完 */
function buildEndNode() {
const status = Number(detail.value?.status)
const map = {
@@ -230,7 +222,6 @@ function avatarOf(name) {
return text ? text.slice(0, 1) : '系'
}
/** 动作角标:1提交/2通过 -> 绿✓;3驳回 -> 红✕;4转审 -> 橙;5撤回 -> 灰 */
function badgeClassOfAction(action) {
if (action === 3) return 'badge-reject'
if (action === 1 || action === 2) return 'badge-pass'
@@ -245,7 +236,6 @@ function badgeIconOfAction(action) {
return '—'
}
/** 时间只展示到分钟 */
function shortTime(value) {
if (!value) return ''
return String(value).slice(0, 16)
@@ -262,11 +252,8 @@ onShow(() => {
if (expenseId.value) loadDetail()
})
// 监听审批通过 / 确认到账后的刷新事件。
// 新版 uni-app 已不再导出 onUniAppEvent,改用全局事件总线并在页面卸载时解绑。
function handleExpenseUpdated(data) {
if (data?.id === expenseId.value) {
// 延迟一点刷新,确保后端数据已同步
setTimeout(() => loadDetail(), 300)
}
}
@@ -276,7 +263,6 @@ onUnload(() => {
uni.$off('expense-updated', handleExpenseUpdated)
})
/** 后端时间字段可能为 "YYYY-MM-DD HH:mm:ss" 格式,iOS 需转 T 分隔 */
function formatTime(value) {
if (!value) return ''
return String(value).replace(' ', 'T').slice(0, 16).replace('T', ' ')
@@ -294,7 +280,6 @@ async function loadDetail() {
detail.value = data
items.value = data.items || []
records.value = await fetchExpenseRecords(expenseId.value)
// 审批人视角:审批中的单据查询自己是否有待办任务(非审批人静默返回 null)
try {
myTask.value = Number(data.status) === EXPENSE_STATUS.APPROVING
? await fetchMyApproveTask(expenseId.value)
@@ -309,7 +294,6 @@ async function loadDetail() {
}
}
/** 图片预览:只把图片类发票给 previewImage,PDF 不参与 */
function previewReceipt(receipts, index) {
const current = receipts?.[index]
const urls = (receipts || [])
@@ -320,7 +304,6 @@ function previewReceipt(receipts, index) {
uni.previewImage({ urls, current: current && !isPdfReceipt(current) ? current.url : urls[0] })
}
/** PDF 发票:下载后用文档查看器打开(image 组件无法渲染 PDF,会被 ORB 拦截) */
function openReceiptFile(file) {
if (!file?.url) return
uni.showLoading({ title: '打开中...' })
@@ -354,13 +337,11 @@ function onSubmit() {
uni.showToast({ title: '已提交审批', icon: 'success' })
loadDetail()
} catch (e) {
// request 封装已弹出服务端错误提示
}
}
})
}
/** 报销人确认款项已到账:确认后单据状态变为「已打款」 */
async function onConfirmPaid() {
const confirmed = await new Promise((resolve) => {
uni.showModal({
@@ -379,7 +360,6 @@ async function onConfirmPaid() {
await loadDetail()
uni.$emit('expense-updated', { id: expenseId.value })
} catch (e) {
// request 封装已弹出服务端错误提示
}
}
@@ -394,13 +374,11 @@ function onDelete() {
uni.showToast({ title: '已删除', icon: 'success' })
setTimeout(() => uni.navigateBack(), 400)
} catch (e) {
// request 封装已弹出服务端错误提示
}
}
})
}
/** 通过当前审批节点:成功后按引擎提示刷新(会签等待/流转/完成) */
function onApprove() {
uni.showModal({
title: '通过审批',
@@ -412,13 +390,11 @@ function onApprove() {
uni.showToast({ title: result?.message || '已通过', icon: 'none' })
loadDetail()
} catch (e) {
// request 封装已弹出服务端错误提示
}
}
})
}
/** 驳回报销单:填写审批意见(可空) */
function onReject() {
uni.showModal({
title: '驳回',
@@ -431,7 +407,6 @@ function onReject() {
uni.showToast({ title: '已驳回', icon: 'none' })
loadDetail()
} catch (e) {
// request 封装已弹出服务端错误提示
}
}
})
@@ -627,7 +602,6 @@ function onReject() {
color: $color-text-muted;
}
/* 审批记录沿用审批中心的审批流样式 */
@include flow-timeline;
.footer {