route.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. import { createRouter, createWebHashHistory } from 'vue-router'
  2. const router = createRouter({
  3. history: createWebHashHistory(),
  4. routes: [
  5. {
  6. path: '/',
  7. redirect: '/purchaseOrder/create/0',
  8. },
  9. {
  10. name: 'purchaseOrder',
  11. path: '/purchaseOrder',
  12. component: () => import('@/pages/purchase-order/index.vue'),
  13. // redirect: 'create',
  14. children: [
  15. {
  16. path: 'create/:id',
  17. name: 'purchaseOrderEdit',
  18. component: () => import('@/pages/purchase-order/edit.vue'),
  19. },
  20. ],
  21. },
  22. {
  23. name: 'paymentRecord',
  24. path: '/payment-record',
  25. component: () => import('@/pages/payment-record/index.vue'),
  26. },
  27. {
  28. name: 'paymentRecord2',
  29. path: '/payment-record2',
  30. component: () => import('@/pages/payment-record2/index.vue'),
  31. },
  32. {
  33. name: 'paymentRecord3',
  34. path: '/payment-record3',
  35. component: () => import('@/pages/payment-record3/index.vue'),
  36. },
  37. // {
  38. // name: 'paymentRecord4',
  39. // path: '/payment-record4',
  40. // component: () => import('@/pages/payment-record3/index.vue'),
  41. // },
  42. {
  43. name: 'wecomApproval',
  44. path: '/wecom-approval/:id',
  45. component: () => import('@/pages/wecom-approval/index.vue'),
  46. },
  47. {
  48. name: 'wecomAdminPortal',
  49. path: '/wecom-admin-portal',
  50. component: () => import('@/pages/wecom-approval/admin-portal.vue'),
  51. },
  52. {
  53. name: 'indentManage',
  54. path: '/indent-manage',
  55. component: () => import('@/pages/indent-manage/index.vue'),
  56. children: [
  57. {
  58. path: 'indent',
  59. name: 'indent',
  60. component: () => import('@/pages/indent-manage/indent/index.vue'),
  61. children: [
  62. {
  63. path: 'list',
  64. name: 'list',
  65. component: () => import('@/pages/indent-manage/indent/list.vue'),
  66. },
  67. ],
  68. },
  69. {
  70. path: 'product',
  71. name: 'indent-product',
  72. component: () => import('@/pages/indent-manage/product/index.vue'),
  73. children: [
  74. {
  75. path: 'list',
  76. name: 'indent-product-list',
  77. component: () => import('@/pages/indent-manage/product/list.vue'),
  78. },
  79. {
  80. path: 'cagegoryList',
  81. name: 'indent-category-list',
  82. component: () =>
  83. import('@/pages/indent-manage/product/category/index.vue'),
  84. },
  85. ],
  86. },
  87. {
  88. path: 'supplier',
  89. name: 'indent-supplier',
  90. component: () => import('@/pages/indent-manage/supplier/index.vue'),
  91. children: [
  92. {
  93. path: 'list',
  94. name: 'indent-supplier-list',
  95. component: () =>
  96. import('@/pages/indent-manage/supplier/list.vue'),
  97. },
  98. ],
  99. },
  100. {
  101. path: 'user',
  102. name: 'indent-user',
  103. component: () => import('@/pages/indent-manage/user/index.vue'),
  104. },
  105. {
  106. path: 'login',
  107. name: 'indent-user-login',
  108. component: () => import('@/pages/indent-manage/login.vue'),
  109. },
  110. ],
  111. },
  112. {
  113. name: 'soSearch',
  114. path: '/so-search',
  115. component: () => import('@/pages/so-search/index.vue'),
  116. },
  117. {
  118. name: 'cargoConsolidationRequest',
  119. path: '/cargo-consolidation-request',
  120. component: () => import('@/pages/cargo-consolidation-request/index.vue'),
  121. },
  122. {
  123. path: '/:pathMatch(.*)*',
  124. name: 'pageNotFound',
  125. component: () => import('@/pages/404.vue'),
  126. },
  127. ],
  128. scrollBehavior(to, from, savedPosition) {
  129. if (savedPosition) {
  130. return savedPosition
  131. } else {
  132. return { left: 0, top: 0 }
  133. }
  134. },
  135. })
  136. export default router