process.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. import { useUserStore } from "@/store/modules/user";
  2. const Layout = () => import("@/layout/index.vue");
  3. export default {
  4. path: "/",
  5. name: "/",
  6. component: Layout,
  7. redirect: "/process",
  8. children: [
  9. {
  10. path: "process",
  11. component: () => import("@/views/process/main.vue"),
  12. name: "ProcessMain",
  13. meta: {
  14. title: "process",
  15. },
  16. },
  17. {
  18. path: "pro-steps",
  19. component: () => import("@/views/pro-steps/index.vue"),
  20. name: "ProSteps",
  21. meta: {
  22. title: "",
  23. keepAlive: true,
  24. back: true,
  25. },
  26. children: [
  27. {
  28. path: "dianjian",
  29. component: () => import("@/views/pro-steps/components/dianjian.vue"),
  30. name: "Dianjian",
  31. meta: {
  32. back: true,
  33. },
  34. },
  35. {
  36. path: "duomeiticaiji",
  37. component: () =>
  38. import("@/views/pro-steps/components/duomeiticaiji.vue"),
  39. name: "Duomeiticaiji",
  40. meta: {
  41. back: true,
  42. },
  43. },
  44. {
  45. path: "esop",
  46. component: () => import("@/views/pro-steps/components/ESOP.vue"),
  47. name: "Esop",
  48. meta: {
  49. back: true,
  50. },
  51. },
  52. {
  53. path: "jingu",
  54. component: () => import("@/views/pro-steps/components/jingu.vue"),
  55. name: "Jingu",
  56. meta: {
  57. back: true,
  58. },
  59. },
  60. {
  61. path: "mingpaibangding",
  62. component: () =>
  63. import("@/views/pro-steps/components/mingpaibangding.vue"),
  64. name: "Mingpaibangding",
  65. meta: {
  66. back: true,
  67. },
  68. },
  69. {
  70. path: "jiluxiang",
  71. component: () => import("@/views/pro-steps/components/jiluxiang.vue"),
  72. name: "Jiluxiang",
  73. meta: {
  74. back: true,
  75. keepAlive: true,
  76. },
  77. },
  78. {
  79. path: "shebeijilu",
  80. component: () =>
  81. import("@/views/pro-steps/components/shebeijilu.vue"),
  82. name: "Shebeijilu",
  83. meta: {
  84. back: true,
  85. },
  86. },
  87. {
  88. path: "tiaoshipipei",
  89. component: () =>
  90. import("@/views/pro-steps/components/tiaoshipipei.vue"),
  91. name: "Tiaoshipipei",
  92. meta: {
  93. back: true,
  94. },
  95. },
  96. {
  97. path: "wuliaocaiji",
  98. component: () =>
  99. import("@/views/pro-steps/components/wuliaocaiji.vue"),
  100. name: "Wuliaocaiji",
  101. meta: {
  102. back: true,
  103. keepAlive: true,
  104. },
  105. },
  106. ],
  107. },
  108. {
  109. path: "call-materiel",
  110. component: () => import("@/views/pro-operation/call-materiel/index.vue"),
  111. name: "call-materiel",
  112. meta: {
  113. title: "叫料",
  114. back: true,
  115. },
  116. },
  117. {
  118. path: "drawing",
  119. component: () => import("@/views/pro-operation/drawing/index.vue"),
  120. name: "drawing-list",
  121. meta: {
  122. title: "图纸",
  123. back: true,
  124. },
  125. },
  126. {
  127. path: "appoint",
  128. component: () => import("@/views/pro-operation/appoint-out/index.vue"),
  129. name: "appoint-out",
  130. meta: {
  131. title: "委外",
  132. back: true,
  133. },
  134. },
  135. {
  136. path: "material-flow",
  137. component: () => import("@/views/material-flow/index.vue"),
  138. name: "material-flow",
  139. meta: {
  140. title: "物料流转",
  141. back: true,
  142. },
  143. },
  144. {
  145. path: "station-up-material",
  146. component: () =>
  147. import("@/views/pro-operation/station-up-material/index.vue"),
  148. name: "station-up-material",
  149. meta: {
  150. title: "工位上料",
  151. back: true,
  152. },
  153. },
  154. {
  155. path: "traceability/:id?",
  156. component: () => import("@/views/traceability/index.vue"),
  157. name: "traceability",
  158. meta: {
  159. title: "生产履历",
  160. back: true,
  161. },
  162. },
  163. ],
  164. beforeEnter: (to, from, next) => {
  165. const store = useUserStore();
  166. console.log(store.user.stationType, "222");
  167. if (store.user.stationType == "5") {
  168. next({ path: "/prepare" });
  169. } else {
  170. next();
  171. }
  172. },
  173. };