p-honggang.li
7 天以前 522737d66480d2f42b8e83c2ddde0efa3b740f38
修复审批的问题
4个文件已修改
26 ■■■■ 已修改文件
src/router/modules/approvalManage.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/approveManage/tradeApproval/approve.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/approveManage/tradeApproval/list.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.ts 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/modules/approvalManage.ts
@@ -30,7 +30,7 @@
      },
    },
    {
      path: 'authorization/:id',
      path: 'authorization/:id/:taskId',
      name: 'tradeAuthorization',
      component: () => import('@/views/approveManage/tradeApproval/approve.vue'),
      meta: {
src/views/approveManage/tradeApproval/approve.vue
@@ -312,6 +312,10 @@
  return [...detail.items, summaryRow]
})
const taskId = computed(() => {
  return String(route.params.taskId || '')
})
// 状态映射(后端中文 -> 前端枚举)
const statusServerToUi: Record<string, string> = {
  '待上传文件': 'WAIT_UPLOAD',
@@ -334,6 +338,7 @@
onMounted(async () => {
  const orderId = String(route.params.id || '')
  console.log(route.params.taskId)
  if (!orderId) return
  
  try {
@@ -485,6 +490,8 @@
    })
    
    const orderId = String(route.params.id || '')
    console.log(String(route.params.taskId || ''))
    const taskId1 = taskId.value
    const userId = userStore.getUserId ? Number(userStore.getUserId) : undefined
    const comments = approvalForm.comments.trim()
@@ -497,6 +504,7 @@
    // 调用审批通过API
    const result = await approveOrder({
      orderId: orderId,
      taskId: taskId1,
      approvalOpinion: comments,
      approverId: userId,
      approverName: userStore.getUserDetail || '管理员',
@@ -568,6 +576,7 @@
    const orderId = String(route.params.id || '')
    const userId = userStore.getUserId ? Number(userStore.getUserId) : undefined
    const comments = approvalForm.comments.trim()
    const taskId1 = String(route.params.taskId || '')
    if (!orderId || !userId) {
      ElMessage.error('订单ID或用户ID不能为空')
@@ -580,6 +589,7 @@
      orderId: orderId,
      approvalOpinion: comments,
      approverId: userId,
      taskId: taskId1,
      approverName: userStore.getUserDetail || '管理员',
      approvalType: isAgreementOrder.value ? '审批' : '授权',
      approvalResult: '驳回'
src/views/approveManage/tradeApproval/list.vue
@@ -622,7 +622,8 @@
      status: uiStatus,
      statusName: order.orderStatus || '',
      orderStatus: StatusMapper.toUIStatus(order.orderStatus), // 转换为标准状态枚举
      workFlowId: order.workflowId || ''
      workFlowId: order.workflowId || '',
      taskId: order.taskId || ''
    }
    const subOrders: any[] = Array.isArray(order?.orderDetails)
@@ -725,7 +726,7 @@
// 授权:跳转到授权页面
const toAuthorize = (row: any) => {
  router.push({ name: 'tradeAuthorization', params: { id: row.id } })
  router.push({ name: 'tradeAuthorization', params: { id: row.id, taskId: row.taskId } })
}
onMounted(async ()=>{
vite.config.ts
@@ -22,14 +22,19 @@
      changeOrigin: true,
      // rewrite: (path) => path.replace(/^\/api/, '/'),
    },
    '/api1': {
      target: 'http://36.133.126.111:7099',
      changeOrigin: true,
       rewrite: (path) => path.replace(/^\/api1/, '/api'),
    },
    '/api': {
      // target: 'http://192.168.0.38:8088', // 李
      // target: 'http://10.88.211.191:8088', // 李
      // target:'http://10.209.233.16/admin',//信创正式
      // target: 'http://36.133.126.111:7099/api', //测试
      // target: 'https://zynlpt.ccccltd.cn/admin', // 正式  (要打开changeOrigin和rewrite)
      //    target: 'http://localhost:8080',
         target: 'http://36.133.126.111:7099/trade-api',
         target: 'http://localhost:8089',
      // target: 'http://36.133.126.111:7099/trade-api',
      changeOrigin: true, // 允许跨域
      rewrite: (path) => path.replace(/^\/api/, '/'), //连测试环境要注释这行,连后端个人则打开
    },