撤回转交: recall接口删除子任务恢复父WIP + 前端canRecall判断 + 红色撤回按钮

This commit is contained in:
2026-08-06 11:39:22 +08:00
parent 8be06bcd43
commit 57884d7baa
4 changed files with 68 additions and 0 deletions

View File

@ -90,6 +90,10 @@
<button v-if="lockedTask.status === 'PENDING'" class="footer-btn footer-reject"
@tap="$emit('action', { task: lockedTask, type: 'reject' })"><text class="btn-icon">❌</text><text class="btn-txt">驳回任务</text></button>
</view>
<view v-else-if="lockedTask.status === 'PENDING' && canRecall" class="footer-actions">
<button class="footer-btn footer-recall"
@tap="$emit('action', { task: lockedTask, type: 'recall' })"><text class="btn-icon">🔄</text><text class="btn-txt">撤回转交</text></button>
</view>
<view v-else class="footer-actions footer-readonly">
<text class="readonly-hint">🔒 非当前任务指派人,仅可查看</text>
</view>
@ -132,6 +136,7 @@ export default {
},
lockedTask() { return this.focusTasks.find(t => t.id === this.lockedTaskId) || null; },
isAssignee() { if (!this.lockedTask) return false; return this.lockedTask.assignee_id == this.currentUserId || this.lockedTask.assignee_id == this.currentUsername; },
canRecall() { if (!this.lockedTask || !this.lockedTask.parent_task_id) return false; const parent = this.taskMap[this.lockedTask.parent_task_id]; return parent && (parent.assignee_id == this.currentUserId || parent.assignee_id == this.currentUsername); },
branchLabelsMap() {
const map = {};
if (!this.product || !this.product.task_tree) return map;
@ -223,4 +228,5 @@ export default {
.footer-reject { background: #fce4ec; color: #dc2626; }
.footer-end { background: #fef3c7; color: #b45309; }
.footer-spawn { background: #ede9fe; color: #7c3aed; }
.footer-recall { background: #fef2f2; color: #dc2626; }
</style>