From d7d8789d1ad0ed6d1837171fc8e838cba018e444 Mon Sep 17 00:00:00 2001 From: chenxing Date: Tue, 20 Oct 2026 00:16:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(p3.5):=20=E6=88=91=E7=9A=84=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E6=89=A9=E5=9B=9B=E9=A1=B5=E7=AD=BE=E2=80=94=E2=80=94?= =?UTF-8?q?=E6=88=91=E5=B7=B2=E5=AE=A1=E6=89=B9/=E6=8A=84=E9=80=81?= =?UTF-8?q?=E6=88=91=E7=9A=84=EF=BC=88=E8=A1=8C=E6=98=A0=E5=B0=84=E4=B8=8E?= =?UTF-8?q?=E6=BC=82=E7=A7=BB=E7=99=BB=E8=AE=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - types 增 DoneTask/CcRow 行契约与 api.done/cc;列表组件 tabs 扩 'done'|'cc' (done=我办理的节点+办理时间;cc=抄送节点+抄送时间;行详情跳转只用本行 bizId 构造) - ApprovalApi.done/cc + adapter 映射;页头文案更新 - 门禁:vue-tsc 18 零新增+build 绿(Stage S5/P3.5) --- src/api/module/approvalAdapter.ts | 2 + src/api/module/svc.ts | 8 ++ .../flow-approval/FlowApprovalList.vue | 106 ++++++++++++++++-- src/components/flow-approval/types.ts | 30 +++++ src/views/MyApprovals.vue | 4 +- 5 files changed, 141 insertions(+), 9 deletions(-) diff --git a/src/api/module/approvalAdapter.ts b/src/api/module/approvalAdapter.ts index eaffeaa..645a2ce 100644 --- a/src/api/module/approvalAdapter.ts +++ b/src/api/module/approvalAdapter.ts @@ -16,6 +16,8 @@ export const svcFlowApprovalApi: FlowApprovalApi = { approvalApi .my(p?.page ?? 1, p?.size ?? 10, p?.flowStatus ?? null) .send(), + done: (p) => approvalApi.done(p?.page ?? 1, p?.size ?? 10).send(), + cc: (p) => approvalApi.cc(p?.page ?? 1, p?.size ?? 10).send(), byBiz: (bizId) => approvalApi.byBiz(Number(bizId)).send(), trace: (bizId) => applyApi.progress(Number(bizId)).send(), approve: (taskId, opinion, edgeName, bizId) => diff --git a/src/api/module/svc.ts b/src/api/module/svc.ts index 3118422..8bcdd18 100644 --- a/src/api/module/svc.ts +++ b/src/api/module/svc.ts @@ -132,6 +132,14 @@ class ApprovalApi { todo(page?: number, size?: number) { return get(`${APPROVAL}/Todo`, { page, size }); } + /** 我已审批(P3.5;中心 done,过滤=签名方应用身份在中心侧) */ + done(page?: number, size?: number) { + return get(`${APPROVAL}/Done`, { page, size }); + } + /** 抄送我的(P3.5;中心 cc,同上) */ + cc(page?: number, size?: number) { + return get(`${APPROVAL}/Cc`, { page, size }); + } /** 我提交的(本地办件;后端做 {total,list}→FlowPage 信封映射;flowStatus 空=全部) */ my(page?: number, size?: number, flowStatus?: number | null) { return get(`${APPROVAL}/My`, { page, size, flowStatus: flowStatus ?? undefined }); diff --git a/src/components/flow-approval/FlowApprovalList.vue b/src/components/flow-approval/FlowApprovalList.vue index 8e839e4..6aea6d1 100644 --- a/src/components/flow-approval/FlowApprovalList.vue +++ b/src/components/flow-approval/FlowApprovalList.vue @@ -23,6 +23,42 @@ + +
+
+ + + +
+
+
+ +
+
+ + +
+
+ + + +
+
+
+ +
+
+
@@ -93,15 +129,15 @@ */ import { computed, onMounted, ref } from "vue"; import { Message } from "view-ui-plus"; -import type { ByBizTask, FlowApprovalApi, FlowPage, MyApplyRow, TodoTask } from "./types"; +import type { ByBizTask, CcRow, DoneTask, FlowApprovalApi, FlowPage, MyApplyRow, TodoTask } from "./types"; import { INSTANCE_STATUS_TAG, INSTANCE_STATUS_TEXT } from "./types"; const props = withDefaults( defineProps<{ api: FlowApprovalApi; - tabs?: Array<"todo" | "my">; + tabs?: Array<"todo" | "my" | "done" | "cc">; }>(), - { tabs: () => ["todo", "my"] } + { tabs: () => ["todo", "my", "done", "cc"] } ); const emit = defineEmits<{ @@ -112,7 +148,7 @@ const emit = defineEmits<{ (e: "open-detail", applyId: number): void; }>(); -const innerTab = ref<"todo" | "my">(props.tabs[0] || "todo"); +const innerTab = ref<"todo" | "my" | "done" | "cc">(props.tabs[0] || "todo"); const loading = ref(false); const acting = ref(false); @@ -120,6 +156,10 @@ const todoRows = ref>([]); const todoPage = ref({ total: 0, pageIndex: 1, pageSize: 10 }); const myRows = ref([]); const myPage = ref({ total: 0, pageIndex: 1, pageSize: 10 }); +const doneRows = ref([]); +const donePage = ref({ total: 0, pageIndex: 1, pageSize: 10 }); +const ccRows = ref([]); +const ccPage = ref({ total: 0, pageIndex: 1, pageSize: 10 }); /** -1=全部(本地哨兵;0 在 hall 语义里是"待提交",禁止当"全部"用) */ const myStatus = ref(-1); @@ -134,7 +174,7 @@ const targetBizId = ref(""); const chosenOutlets = computed(() => targetTask.value?.outlets || []); -const TAB_LABELS: Record = { todo: "待我审批", my: "我提交的" }; +const TAB_LABELS: Record = { todo: "待我审批", my: "我提交的", done: "我已审批", cc: "抄送我的" }; function tabLabel(t: string) { return TAB_LABELS[t] || t; } @@ -147,6 +187,22 @@ const todoCols = [ { title: "操作", slot: "action", width: 240, align: "center" }, ]; +const doneCols = [ + { title: "办件", key: "bizTitle", minWidth: 220, ellipsis: true, tooltip: true }, + { title: "办结状态", slot: "instStatus", minWidth: 100 }, + { title: "我办理的节点", key: "nodeName", minWidth: 130 }, + { title: "办理时间", key: "handleTime", minWidth: 170, render: fmtTime }, + { title: "操作", slot: "doneAction", width: 110, align: "center" }, +]; + +const ccCols = [ + { title: "办件", key: "bizTitle", minWidth: 220, ellipsis: true, tooltip: true }, + { title: "办件状态", slot: "ccStatus", minWidth: 100 }, + { title: "抄送节点", key: "nodeName", minWidth: 130 }, + { title: "抄送时间", key: "sentTime", minWidth: 170, render: fmtTime }, + { title: "操作", slot: "ccAction", width: 110, align: "center" }, +]; + const myCols = [ { title: "事项", key: "itemTitle", minWidth: 220, ellipsis: true, tooltip: true }, { title: "状态", slot: "status", minWidth: 100 }, @@ -178,7 +234,7 @@ function parseSummary(task: TodoTask): string { } function switchTab(name: any) { - innerTab.value = String(name) as "todo" | "my"; + innerTab.value = String(name) as "todo" | "my" | "done" | "cc"; load(); } @@ -229,8 +285,44 @@ async function loadMy(page = 1) { } } +async function loadDone(page = 1) { + if (!props.api.done) { + doneRows.value = []; + return; + } + loading.value = true; + try { + const res: FlowPage = await props.api.done({ page, size: donePage.value.pageSize }); + donePage.value = { total: res.total ?? 0, pageIndex: res.pageIndex ?? page, pageSize: res.pageSize ?? donePage.value.pageSize }; + doneRows.value = res.content || []; + } catch (e: any) { + Message.error(e?.msg || e?.message || "已办列表加载失败"); + } finally { + loading.value = false; + } +} + +async function loadCc(page = 1) { + if (!props.api.cc) { + ccRows.value = []; + return; + } + loading.value = true; + try { + const res: FlowPage = await props.api.cc({ page, size: ccPage.value.pageSize }); + ccPage.value = { total: res.total ?? 0, pageIndex: res.pageIndex ?? page, pageSize: res.pageSize ?? ccPage.value.pageSize }; + ccRows.value = res.content || []; + } catch (e: any) { + Message.error(e?.msg || e?.message || "抄送列表加载失败"); + } finally { + loading.value = false; + } +} + function load() { if (innerTab.value === "todo") loadTodo(1); + else if (innerTab.value === "done") loadDone(1); + else if (innerTab.value === "cc") loadCc(1); else loadMy(1); } @@ -347,7 +439,7 @@ function reset() { } onMounted(load); -defineExpose({ load, loadTodo, loadMy }); +defineExpose({ load, loadTodo, loadMy, loadDone, loadCc });