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 <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-08-12 18:16:55 +08:00
1 parent ef6d0ef175
commit 828ada6ac3
1 file changed
+83 -57
+83 -57
View File
@@ -31,80 +31,65 @@
<OaProgressTimeline :items="timelineItems" />
</div>
<footer class="oa-detail__ft">
<van-button class="oa-detail__btn oa-detail__btn--close" @click="onClose">
关闭
</van-button>
<van-button
class="oa-detail__btn oa-detail__btn--ghost oa-detail__btn--print"
:loading="printing"
:disabled="acting || printing"
@click="onPrint"
>
打印
</van-button>
<template v-if="canApprove">
<van-button
class="oa-detail__btn oa-detail__btn--ghost"
:loading="acting"
:disabled="acting"
@click="openComment('reject')"
class="oa-detail__btn oa-detail__btn--more"
:disabled="acting || printing"
aria-label="更多"
@click="openMore"
>
拒绝
⋯
</van-button>
<van-button
v-if="detail?.allowReturn !== false"
class="oa-detail__btn oa-detail__btn--ghost"
:loading="acting"
:disabled="acting"
:disabled="acting || printing"
@click="openComment('return')"
>
打回
</van-button>
<van-button
v-if="detail?.allowAddSign !== false"
class="oa-detail__btn oa-detail__btn--ghost"
:loading="acting"
:disabled="acting"
@click="openAddSign"
>
加签
</van-button>
<van-button
class="oa-detail__btn oa-detail__btn--ghost"
:loading="acting"
:disabled="acting"
@click="openTransfer"
>
转交
</van-button>
<van-button
class="oa-detail__btn oa-detail__btn--primary"
type="primary"
:loading="acting"
:disabled="acting"
:disabled="acting || printing"
@click="openComment('approve')"
>
同意
</van-button>
</template>
<van-button
v-if="canWithdraw"
class="oa-detail__btn oa-detail__btn--ghost"
:loading="acting"
:disabled="acting"
@click="withdraw"
>
撤销
</van-button>
<van-button
v-if="canCopyRestart"
class="oa-detail__btn oa-detail__btn--primary"
type="primary"
:disabled="acting"
@click="goCopyRestart"
>
复制并重新发起
</van-button>
<template v-else>
<van-button class="oa-detail__btn oa-detail__btn--close" @click="onClose">
关闭
</van-button>
<van-button
class="oa-detail__btn oa-detail__btn--ghost oa-detail__btn--print"
:loading="printing"
:disabled="acting || printing"
@click="onPrint"
>
打印
</van-button>
<van-button
v-if="canWithdraw"
class="oa-detail__btn oa-detail__btn--ghost"
:loading="acting"
:disabled="acting"
@click="withdraw"
>
撤销
</van-button>
<van-button
v-if="canCopyRestart"
class="oa-detail__btn oa-detail__btn--primary"
type="primary"
:disabled="acting"
@click="goCopyRestart"
>
复制并重新发起
</van-button>
</template>
</footer>
</template>
@@ -193,6 +178,14 @@
</div>
</div>
</van-popup>
<van-action-sheet
v-model:show="moreVisible"
:actions="moreActions"
cancel-text="取消"
close-on-click-action
@select="onMoreSelect"
/>
</div>
</template>
@@ -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;
}