From 828ada6ac3744f31b0fe73aedfcbb8481a618610 Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Wed, 12 Aug 2026 18:16:55 +0800 Subject: [PATCH] feat(oa): fold mobile detail approve actions into more sheet Show only return and approve on the footer, move secondary actions to ActionSheet, and prefill default remarks. Co-authored-by: Cursor --- mobile-oa-h5/src/views/OaDetail.vue | 140 +++++++++++++++++----------- 1 file changed, 83 insertions(+), 57 deletions(-) diff --git a/mobile-oa-h5/src/views/OaDetail.vue b/mobile-oa-h5/src/views/OaDetail.vue index 38617762..ef682175 100644 --- a/mobile-oa-h5/src/views/OaDetail.vue +++ b/mobile-oa-h5/src/views/OaDetail.vue @@ -31,80 +31,65 @@
- - 关闭 - - - 打印 - - - 撤销 - - - 复制并重新发起 - +
@@ -193,6 +178,14 @@ + + @@ -213,6 +206,7 @@ import { import { prepareMobileFormSchema } from '../oa/schema-prep.js' import { statusText, statusTone } from '../oa/status-label.js' import { exportOaApprovalPdf } from '../oa/print/exportOaApprovalPdf.js' +import { defaultComment, buildMoreActions } from '../oa/oa-action-defaults.js' import OaProgressTimeline from '../oa/components/OaProgressTimeline.vue' import OaPulseLoading from '../oa/components/OaPulseLoading.vue' import OaPersonSelect from '../oa/components/OaPersonSelect.vue' @@ -242,6 +236,10 @@ const transferVisible = ref(false) const transferUser = ref(null) const transferComment = ref('') +const moreVisible = ref(false) + +const moreActions = computed(() => buildMoreActions(detail.value)) + const instanceId = computed(() => String(route.query.instanceId || '').trim()) const queryTaskId = computed(() => String(route.query.taskId || '').trim()) const wantAutoPrint = computed(() => { @@ -455,10 +453,25 @@ function goCopyRestart() { function openComment(kind) { if (!myPendingTask.value) return commentKind.value = kind - commentText.value = '' + commentText.value = defaultComment(kind) commentVisible.value = true } +function openMore() { + if (acting.value || printing.value) return + moreVisible.value = true +} + +function onMoreSelect(action) { + moreVisible.value = false + const key = action?.key || '' + if (key === 'reject') openComment('reject') + else if (key === 'addSign') openAddSign() + else if (key === 'transfer') openTransfer() + else if (key === 'print') void onPrint() + else if (key === 'close') onClose() +} + function onCommentBeforeClose(action) { if (action !== 'confirm') return true if (commentKind.value === 'return') { @@ -508,7 +521,7 @@ async function submitComment() { function openAddSign() { if (!myPendingTask.value) return addSignUsers.value = [] - addSignComment.value = '' + addSignComment.value = defaultComment('addSign') addSignVisible.value = true } @@ -542,7 +555,7 @@ async function submitAddSign() { function openTransfer() { if (!myPendingTask.value) return transferUser.value = null - transferComment.value = '' + transferComment.value = defaultComment('transfer') transferVisible.value = true } @@ -645,7 +658,7 @@ onMounted(() => { padding: 12px 12px 96px; } .oa-detail__body--approve { - padding-bottom: 128px; + padding-bottom: 96px; } .oa-detail__body--mine-act { padding-bottom: 120px; @@ -727,6 +740,19 @@ onMounted(() => { color: #334155 !important; font-weight: 600; } +.oa-detail__btn--more { + flex: 0 0 auto; + width: 44px; + min-width: 44px; + padding: 0 !important; + border: 1px solid #e2e8f0 !important; + background: #fff !important; + color: #334155 !important; + font-size: 18px; + font-weight: 700; + letter-spacing: 1px; + line-height: 1; +} .oa-detail__btn--close:active { opacity: 0.85; }