From 7f2a02d6ca6e263643654cbe275043d79ef83d74 Mon Sep 17 00:00:00 2001 From: zhaichao Date: Thu, 24 Sep 2026 16:07:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E5=8A=9E=E5=AE=A1=E6=89=B9=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/todo/detail.vue | 7 +++++-- pages/todo/list.vue | 5 +++-- utils/format.js | 28 ++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/pages/todo/detail.vue b/pages/todo/detail.vue index 603f9ab..382e94c 100644 --- a/pages/todo/detail.vue +++ b/pages/todo/detail.vue @@ -5,7 +5,7 @@ {{ row.typeLabel || row.type || '审批' }} - {{ row.status || '待处理' }} + {{ statusText }} {{ row.title || row.no }} {{ row.submitter || '' }} @@ -69,7 +69,7 @@ import FyHeader from '../../components/fy-header.vue' import FyFiles from '../../components/fy-files.vue' import { store } from '../../utils/store.js' import { oaGet } from '../../utils/api.js' -import { toast } from '../../utils/format.js' +import { flowStatus, toast } from '../../utils/format.js' import { collectFiles, fileId } from '../../utils/files.js' const LABELS = { @@ -124,6 +124,9 @@ export default { const logs = (this.row && this.row.logs) || [] return Array.isArray(logs) ? [...logs].reverse() : [] }, + statusText() { + return flowStatus(this.row && this.row.status) + }, canAct() { if (!this.row) return false const st = String(this.row.status || '') diff --git a/pages/todo/list.vue b/pages/todo/list.vue index 3692124..863e5dc 100644 --- a/pages/todo/list.vue +++ b/pages/todo/list.vue @@ -17,7 +17,7 @@ {{ r.title || r.no }} {{ r.submitter || r.assigneeName || '' }} - {{ r.status || '待处理' }} + {{ statusText(r) }} @@ -29,7 +29,7 @@ import FyHeader from '../../components/fy-header.vue' import FyScroll from '../../components/fy-scroll.vue' import { store } from '../../utils/store.js' -import { asList } from '../../utils/format.js' +import { asList, flowStatus } from '../../utils/format.js' import { oaGet } from '../../utils/api.js' export default { @@ -82,6 +82,7 @@ export default { this.loading = false } }, + statusText(r) { return flowStatus(r && r.status) }, open(r) { if (r.source === 'work' || r.taskId) { uni.navigateTo({ url: '/pages/coop/detail?id=' + encodeURIComponent(r.id || r.taskId) }) diff --git a/utils/format.js b/utils/format.js index 9dccdf9..e2fa60d 100644 --- a/utils/format.js +++ b/utils/format.js @@ -148,6 +148,34 @@ export function convType(s) { return 'direct' } +const FLOW_STATUS = { + pending: '待审批', + waiting: '待处理', + processing: '审批中', + reviewing: '审阅中', + review: '待审阅', + approved: '已通过', + passed: '已通过', + rejected: '已驳回', + refused: '已拒绝', + denied: '已拒绝', + cancelled: '已撤销', + canceled: '已撤销', + withdrawn: '已撤回', + draft: '草稿', + done: '已完成', + completed: '已完成', + handled: '已处理', + reviewed: '已审阅', + running: '进行中' +} + +export function flowStatus(status) { + const raw = String(status || '').trim() + if (!raw) return '待处理' + return FLOW_STATUS[raw.toLowerCase()] || raw +} + export function toast(title, icon = 'none') { uni.showToast({ title: String(title || ''), icon, duration: 2200 }) }