feat: 审批功能优化和拒绝原因弹窗

后端改动:
- ApprovalService: 添加调试日志,简化详情页 URL 生成逻辑
- BusinessTripService: 优化出差审批详情展示

前端改动:
- approval/detail: 审批详情页优化,支持查看完整审批流程
- approval/reject: 新增拒绝原因弹窗组件
- business-trip/detail: 出差详情页增强,展示审批状态和操作

功能特性:
- 审批详情页显示完整审批流程和记录
- 拒绝操作支持填写拒绝原因
- 出差申请详情页优化展示

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-02-27 17:57:56 +08:00
parent b1ca2c58b7
commit 1004aea725
5 changed files with 329 additions and 31 deletions
+5 -12
View File
@@ -72,9 +72,12 @@ class ApprovalService
}
$currentNodeIds = $order->current_nodes ?? [];
error_log("🔍 当前节点 IDs: " . json_encode($currentNodeIds));
$currentNode = ApprovalNode::whereIn('id', $currentNodeIds)->first();
if (!$currentNode) {
error_log("❌ 未找到节点,IDs: " . json_encode($currentNodeIds));
throw new \Exception('当前节点不存在');
}
@@ -501,18 +504,8 @@ class ApprovalService
{
$baseUrl = 'https://xsm.dev.hnxinyouhe.com';
switch ($order->business_type) {
case 'business_trip':
return "{$baseUrl}/business-trip/detail/{$order->business_id}";
case 'expense':
return "{$baseUrl}/expense/detail/{$order->business_id}";
case 'leave':
return "{$baseUrl}/leave/detail/{$order->business_id}";
case 'purchase':
return "{$baseUrl}/purchase/detail/{$order->business_id}";
default:
return "{$baseUrl}/approval/detail/{$order->id}";
}
// 统一使用审批详情页,不再跳转到具体业务模块的详情页
return "{$baseUrl}/approval/detail/{$order->id}";
}
/**