| | |
| | | import productApi from '@/api/productApi' |
| | | import sysUserService from "@/api/sysUser"; |
| | | import workFlowApi from "@/api/workFlowApi"; |
| | | import {queryUserDetail} from "@/api/userInfo"; |
| | | |
| | | const route = useRoute() |
| | | const router = useRouter() |
| | |
| | | return [...detail.items, summaryRow] |
| | | }) |
| | | |
| | | const taskId = computed(() => { |
| | | return String(route.params.taskId || '') |
| | | }) |
| | | |
| | | // 状态映射(后端中文 -> 前端枚举) |
| | | const statusServerToUi: Record<string, string> = { |
| | | '待上传文件': 'WAIT_UPLOAD', |
| | |
| | | |
| | | onMounted(async () => { |
| | | const orderId = String(route.params.id || '') |
| | | console.log(route.params.taskId) |
| | | if (!orderId) return |
| | | |
| | | |
| | | // 获取用户信息 |
| | | if (!userStore.getUserId) { |
| | | try { |
| | | const res: any = await queryUserDetail() |
| | | if (res?.code === 200 && res.data) { |
| | | userStore.updateUserDetail(res.data) |
| | | } else { |
| | | ElMessage.error(res?.msg || '无法获取用户信息,请先登录') |
| | | return |
| | | } |
| | | } catch (e) { |
| | | console.error('获取用户详情失败:', e) |
| | | ElMessage.error('获取用户信息失败,请稍后重试') |
| | | return |
| | | } |
| | | } |
| | | |
| | | try { |
| | | // 并行获取订单详情和协议类型检查 |
| | | const [orderRes, agreementRes] = await Promise.all([ |
| | |
| | | }) |
| | | |
| | | const orderId = String(route.params.id || '') |
| | | const userId = userStore.getUserId ? Number(userStore.getUserId) : undefined |
| | | console.log(String(route.params.taskId || '')) |
| | | const taskId1 = taskId.value |
| | | const userId = userStore.getUserId ? userStore.getUserId : undefined |
| | | const comments = approvalForm.comments.trim() |
| | | |
| | | if (!orderId || !userId) { |
| | |
| | | // 调用审批通过API |
| | | const result = await approveOrder({ |
| | | orderId: orderId, |
| | | taskId: taskId1, |
| | | approvalOpinion: comments, |
| | | approverId: userId, |
| | | approverName: userStore.getUserDetail || '管理员', |
| | |
| | | }) |
| | | |
| | | const orderId = String(route.params.id || '') |
| | | const userId = userStore.getUserId ? Number(userStore.getUserId) : undefined |
| | | const userId = userStore.getUserId ? userStore.getUserId : undefined |
| | | const comments = approvalForm.comments.trim() |
| | | const taskId1 = String(route.params.taskId || '') |
| | | |
| | | if (!orderId || !userId) { |
| | | ElMessage.error('订单ID或用户ID不能为空') |
| | |
| | | orderId: orderId, |
| | | approvalOpinion: comments, |
| | | approverId: userId, |
| | | taskId: taskId1, |
| | | approverName: userStore.getUserDetail || '管理员', |
| | | approvalType: isAgreementOrder.value ? '审批' : '授权', |
| | | approvalResult: '驳回' |
| | |
| | | // 检查响应格式 |
| | | const responseData = previewResponse as any |
| | | if (responseData && responseData.code === 200 && responseData.data) { |
| | | previewUrl = responseData.data |
| | | previewUrl = responseData.data.replaceAll('http://192.168.20.52:9000',import.meta.env.VITE_FILE_PREVIEW_URL) |
| | | console.log('使用预览URL:', previewUrl) |
| | | } else { |
| | | console.log('预览URL获取失败,使用下载方式') |