/*
 *   合同管理/合同签订-路由表
 * */
import layout from '@/components/layout/layout'
export const contractManagement = [
  {
    path: '/contractManagement',
    component: layout,
    children: [
      {
        path: 'contractSigning-list',
        name: 'ContractSigning-list',
        meta: {
          path: 'contractSigning-list'
        },
        component: () => import('@/views/contractManagement/contractSigning/contractSigning-list')
      },
      // 合同审核
      {
        path: 'contractAudit-list',
        name: 'contractAudit-list',
        meta: {
          path: 'contractAudit-list'
        },
        component: () => import('@/views/contractManagement/contractAudit/contractAudit-list')
      },
      // 供应商合同确认
      {
        path: 'contractConfirm-list',
        name: 'contractConfirm-list',
        meta: {
          path: 'contractConfirm-list'
        },
        component: () => import('@/views/contractManagement/contractConfirm/contractConfirm-list')
      },
      // 审核详情页
      {
        path: 'contractAudit-detail',
        name: 'contractAudit-detail',
        meta: {
          path: 'contractAudit-list',
          type: 'audit'
        },
        component: () => import('@/views/contractManagement/contractAudit/contractAudit-detail')
      },
      // 验收
      {
        path: 'acceptanceAdd',
        name: 'acceptanceAdd',
        meta: {
          path: 'contractSigning-list'
        },
        component: () => import('@/views/contractManagement/contractSigning/acceptance/acceptance-add')
      },
      // 付款
      {
        path: 'contractPaymentAdd',
        name: 'contractPaymentAdd',
        meta: {
          path: 'contractSigning-list'
        },
        component: () => import('@/views/contractManagement/contractSigning/contractPayment/contractPayment-add')
      },
      {
        path: 'contractSigningStepAdd',
        name: 'ContractSigningStepAdd',
        component: () => import('@views/contractManagement/contractSigning/contractSigning/contractSigningStep-add'),
        meta: { path: 'contractSigning-list' },
        redirect: '/contractManagement/contractSigningStepAdd/contractSigning',
        children: [
          // 合同签订页
          {
            path: 'contractSigning',
            name: 'ContractSigning',
            component: () => import('@/views/contractManagement/contractSigning/contractSigningInfo/contractSigning')
          },
          // 合同供应内容/价格
          {
            path: 'contractContentAndPriceAdd',
            name: 'ContractContentAndPriceAdd',
            component: () => import('@/views/contractManagement/contractSigning/contractContentAndPrice/contractContentAndPrice-add')
          },
          // 合同付款条款
          {
            path: 'contractPaymentProvisionAdd',
            name: 'ContractPaymentProvisionAdd',
            // component: () => import('@/views/contractManagement/contractSigning/contractPaymentProvision/contractPaymentProvisionSingle-add')
            // component: () => import('@/views/contractManagement/contractSigning/contractPaymentProvision/contractPaymentProvisionBuyMore-add.vue')
            component: () => import('@/views/contractManagement/contractSigning/contractPaymentProvision/contractPaymentProvision-add.vue')
          },
          // 合同文件列表
          {
            path: 'contractDocumentsAdd',
            name: 'ContractDocumentsAdd',
            component: () => import('@/views/contractManagement/contractSigning/contractDocuments/contractDocuments-add')
          }
        ]
      },
      // // 合同签订页
      // {
      //   path: 'contractSigning',
      //   name: 'ContractSigning',
      //   meta: { path: 'contractSigning-list' },
      //   component: () => import('@/views/contractManagement/contractSigning/contractSigningInfo/contractSigning')
      // },
      // // 合同供应内容/价格
      // {
      //   path: 'contractContentAndPriceAdd',
      //   name: 'contractContentAndPriceAdd',
      //   meta: { path: 'contractSigning-list' },
      //   component: () => import('@/views/contractManagement/contractSigning/contractContentAndPrice/contractContentAndPrice-add')
      // },
      // // 合同付款条款
      // {
      //   path: 'contractPaymentProvisionAdd',
      //   name: 'contractPaymentProvisionAdd',
      //   meta: {
      //     path: 'contractSigning-list'
      //   },
      //   component: () => import('@/views/contractManagement/contractSigning/contractPaymentProvision/contractPaymentProvisionSingle-add')
      // },
      // // 合同文件列表
      // {
      //   path: 'contractDocumentsAdd',
      //   name: 'contractDocumentsAdd',
      //   meta: {
      //     path: 'contractSigning-list'
      //   },
      //   component: () => import('@/views/contractManagement/contractSigning/contractDocuments/contractDocuments-add')
      // },
      // 工具制作合同
      {
        path: 'toolMake',
        name: 'toolMake',
        meta: {
          path: 'contractSigning-list'
        },
        component: () => import('@/views/contractManagement/contractSigning/toolMake')
      },
      // 合同签订详情页
      {
        path: 'contractSigningDetail',
        name: 'ContractSigningDetail',
        meta: {
          path: 'contractSigning-list'
        },
        component: () => import('@/views/contractManagement/contractSigning/contractSigningInfo/contractSigning-detail')
      },
      // 合同附件详情页
      {
        path: 'contractPdfDetail',
        name: 'ContractPdfDetail',
        meta: {
          path: 'contractSigning-list'
        },
        component: () => import('@/views/contractManagement/contractSigning/contractSigningInfo/contractPdf-detail')
      }
    ]
  },
  /* 领导监察 */
  {
    path: '/leaderContractManagement',
    component: layout,
    children: [
      {
        path: 'leaderContractSigning-list',
        name: 'LeaderContractSigning-list',
        meta: {
          path: 'leaderContractSigning-list'
        },
        component: () => import('@/views/contractManagement/contractSigning/contractSigning-list')
      },
      // 合同签订详情页
      {
        path: 'leaderContractSigningDetail',
        name: 'LeaderContractSigningDetail',
        meta: {
          path: 'leaderContractSigning-list'
        },
        component: () => import('@/views/contractManagement/contractSigning/contractSigningInfo/contractSigning-detail')
      },
      // 合同附件详情页
      {
        path: 'leaderContractPdfDetail',
        name: 'LeaderContractPdfDetail',
        meta: {
          path: 'leaderContractSigning-list'
        },
        component: () => import('@/views/contractManagement/contractSigning/contractSigningInfo/contractPdf-detail')
      }
    ]
  }
]
export const contractAuditFlow = [
  // 采购业务员办结或者部门负责人审批进入
  {
    path: 'contractSignFlowAuditDetail',
    meta: {
      contractSource: '00',
      type: 'audit'
    },
    component: () =>
      import('@/views/contractManagement/contractAudit/contractAuditFlow-detail')
  },
  // 采购业务员驳回撤回处理进入
  {
    path: 'contractSignFlowDetail',
    component: () => import('@views/contractManagement/contractSigning/contractSigning/contractSigningStep-add'),
    redirect: '/contractManagement/contractSigningStepAdd/contractSigning'
  }
]
export default [
  ...contractManagement,
  ...contractAuditFlow
]
