index.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. import Vue from "vue";
  2. import VueRouter from "vue-router";
  3. import layout from "@/layout/index.vue";
  4. const originalPush = VueRouter.prototype.push;
  5. VueRouter.prototype.push = function push(location) {
  6. return originalPush.call(this, location).catch(err => err);
  7. };
  8. Vue.use(VueRouter);
  9. const router = new VueRouter({
  10. // mode:"history",
  11. // mode:process.env.NODE_ENV !==
  12. // "production" ? "hash" : "history",
  13. mode:"history",
  14. scrollBehavior(to, from, savedPosition) {
  15. if (savedPosition) {
  16. return savedPosition;
  17. } else {
  18. return { x: 0, y: 0 };
  19. }
  20. },
  21. base: '/mobile/',
  22. routes: [
  23. {
  24. path: "/",
  25. component: layout,
  26. redirect: "/home",
  27. children: [
  28. {
  29. path: "/home",
  30. name: "home",
  31. component: () => import("@/views/home/index.vue")
  32. },
  33. {
  34. path: "/reportingRate",
  35. name: "reportingRate",
  36. component: () => import("@/views/home/reportingRate.vue")
  37. },
  38. {
  39. path: "/err",
  40. name: "err",
  41. component: () => import("@/views/home/err.vue")
  42. },
  43. {
  44. path: "/login",
  45. name: "login",
  46. component: () => import("@/views/home/login.vue")
  47. },
  48. {
  49. path: "/clew",
  50. name: "clew",
  51. component: () => import("@/views/clew/index.vue")
  52. },
  53. {
  54. path: "/clewent",
  55. name: "clew",
  56. component: () => import("@/views/clew/clewent.vue")
  57. },
  58. // {
  59. // path: "/logincs",
  60. // name: "logincs",
  61. // component: () => import("@/views/home/logincs.vue")
  62. // }
  63. ]
  64. },
  65. {
  66. path: "/storemanagementlist",
  67. component: layout,
  68. redirect: "/storemanagement/index",
  69. children: [
  70. {
  71. path: "/storemanagement/index",
  72. name: "storeManagement",
  73. component: () => import("@/views/storeManagement/index.vue")
  74. },
  75. {
  76. path: "/storeDetail",
  77. name: "storeDetail",
  78. component: () => import("@/views/storeManagement/storeDetail.vue")
  79. },
  80. {
  81. path: "/storeAdd",
  82. name: "storeAdd",
  83. component: () => import("@/views/storeManagement/storeAdd.vue")
  84. },
  85. {
  86. path: "/storeAddress",
  87. name: "storeAddress",
  88. component: () => import("@/views/storeManagement/storeAddress.vue")
  89. },
  90. {
  91. path: "/odersuccess",
  92. name: "storeAdd",
  93. component: () => import("@/views/deviceOutside/oderSuccess.vue")
  94. },
  95. {
  96. path: "/storeEdit",
  97. name: "storeEdit",
  98. component: () => import("@/views/storeManagement/storeEdit.vue")
  99. },
  100. {
  101. path: "/success",
  102. name: "success",
  103. component: () => import("@/views/storeManagement/success.vue")
  104. }
  105. ]
  106. },
  107. {
  108. path: "/outsidelist",
  109. component: layout,
  110. redirect: "/outsidelist/index",
  111. children: [
  112. {
  113. path: "/outsidelist/index",
  114. name: "outsidelist",
  115. component: () => import("@/views/deviceOutside/index.vue")
  116. },
  117. {
  118. path: "/ai",
  119. name: "ai",
  120. component: () => import("@/views/intelligence/index.vue")
  121. },
  122. {
  123. path: "/topStore",
  124. name: "topStore",
  125. component: () => import("@/views/deviceOutside/topStore.vue")
  126. },
  127. {
  128. path: "/pItem",
  129. name: "pItem",
  130. component: () => import("@/views/deviceOutside/productItem.vue")
  131. },
  132. {
  133. path: "/suishenbangOutstoreVisit",
  134. name: "suishenbangOutstoreVisit",
  135. component: () => import("@/views/deviceOutside/suishenbangOutstoreVisit.vue")
  136. },
  137. {
  138. path: "/projectOut",
  139. name: "projectOut",
  140. component: () => import("@/views/deviceOutside/projectOut.vue")
  141. },
  142. {
  143. path: "/rangeStore",
  144. name: "rangeStore",
  145. component: () => import("@/views/deviceOutside/rangeStore.vue")
  146. },
  147. {
  148. path: "/outstoreVisit",
  149. name: "outstoreVisit",
  150. component: () => import("@/views/deviceOutside/outstoreVisit.vue")
  151. },
  152. {
  153. path: "/taskList",
  154. name: "taskList",
  155. component: () => import("@/views/deviceOutside/taskList.vue")
  156. },
  157. {
  158. path: "/storeGroup",
  159. name: "storeGroup",
  160. component: () => import("@/views/deviceOutside/storeGroup.vue")
  161. },
  162. {
  163. path: "/outabnormalVisit",
  164. name: "outabnormalVisit",
  165. component: () => import("@/views/deviceOutside/outabnormalVisit.vue")
  166. }
  167. ]
  168. },
  169. {
  170. path: "/historicalVisit",
  171. component: layout,
  172. redirect: "/historicalVisit/index",
  173. children: [
  174. {
  175. path: "/historicalVisit/index",
  176. name: "historicalVisit",
  177. component: () => import("@/views/historicalVisit/index.vue")
  178. },
  179. {
  180. path: "/historAllVisit",
  181. name: "historAllVisit",
  182. component: () => import("@/views/historicalVisit/historAllVisit.vue")
  183. },
  184. {
  185. path: "/historicalDetails",
  186. name: "historicalDetails",
  187. component: () => import("@/views/historicalVisit/historicalDetails.vue")
  188. },
  189. {
  190. path: "/historiStoreVisit",
  191. name: "historiStoreVisit",
  192. component: () => import("@/views/historicalVisit/hisvistdeils.vue")
  193. }
  194. ]
  195. },
  196. {
  197. path: "/deviceWithin",
  198. component: layout,
  199. redirect: "/deviceWithin/index",
  200. children: [
  201. {
  202. path: "/deviceWithin/index",
  203. name: "deviceWithin",
  204. component: () => import("@/views/deviceWithin/index.vue")
  205. },
  206. {
  207. path: "/storeVisitpage",
  208. name: "storeVisitpage",
  209. component: () => import("@/views/deviceWithin/storeVisit.vue")
  210. },
  211. {
  212. path: "/addStoreVisit",
  213. name: "addStoreVisit",
  214. component: () => import("@/views/deviceWithin/addStoreVisit.vue")
  215. },
  216. {
  217. path: "/addStoreVisitd",
  218. name: "addStoreVisitd",
  219. component: () => import("@/views/deviceWithin/addStoreVisitd.vue")
  220. },
  221. {
  222. path: "/addStoreVisitP",
  223. name: "addStoreVisitP",
  224. component: () => import("@/views/deviceWithin/addStoreVisitP.vue")
  225. },
  226. {
  227. path: "/abnormalVisit",
  228. name: "abnormalVisit",
  229. component: () => import("@/views/deviceWithin/abnormalVisit.vue")
  230. }
  231. ,
  232. {
  233. path: "/sign",
  234. name: "sign",
  235. component: () => import("@/views/sign/index.vue")
  236. } ,
  237. {
  238. path: "/signApprovalList",
  239. name: "signApproval",
  240. component: () => import("@/views/signApproval/index.vue")
  241. },
  242. {
  243. path: "/signApproval",
  244. name: "signApproval",
  245. component: () => import("@/views/signApproval/signApproval.vue")
  246. }
  247. ]
  248. },
  249. {
  250. path: "/My",
  251. component: layout,
  252. redirect: "/My/index",
  253. children: [
  254. {
  255. path: "/My/index",
  256. name: "MyList",
  257. component: () => import("@/views/week/index.vue")
  258. },
  259. {
  260. path: "/myInventory",
  261. name: "myInventory",
  262. component: () => import("@/views/my/myInventory.vue")
  263. },
  264. {
  265. path: "/material",
  266. name: "material",
  267. component: () => import("@/views/my/material.vue")
  268. },
  269. {
  270. path: "/subordinateHistoricalDaily",
  271. name: "subordinateHistoricalDaily",
  272. component: () => import("@/views/week/dailyHistorical.vue")
  273. }, {
  274. path: "/subordinateHistoricalWeekly",
  275. name: "subordinateHistoricalWeekly",
  276. component: () => import("@/views/week/weeklyHistorical.vue")
  277. }, {
  278. path: "/myHistoricalDaily",
  279. name: "myHistoricalDaily",
  280. component: () => import("@/views/week/myHistoricalDaily.vue")
  281. },
  282. {
  283. path: "/weeklyApproval",
  284. name: "weeklyApproval",
  285. component: () => import("@/views/week/weeklyApproval.vue")
  286. },
  287. {
  288. path: "/weeklyApprovalDetils",
  289. name: "weeklyApprovalDetils",
  290. component: () => import("@/views/week/weeklyApprovalDetils.vue")
  291. },
  292. {
  293. path: "/myComment",
  294. name: "myComment",
  295. component: () => import("@/views/week/myComment.vue")
  296. },
  297. {
  298. path: "/doubleWeeklyDetils",
  299. name: "doubleWeeklyDetils",
  300. component: () => import("@/views/week/doubleWeeklyDetils.vue")
  301. },
  302. {
  303. path: "/daily",
  304. name: "daily",
  305. component: () => import("@/views/week/daily.vue")
  306. }, {
  307. path: "/dailyApprovalList",
  308. name: "dailyApprovalList",
  309. component: () => import("@/views/week/dailyApprovalList.vue")
  310. },
  311. {
  312. path: "/dailyApproval",
  313. name: "dailyApproval",
  314. component: () => import("@/views/week/dailyApproval.vue")
  315. },
  316. {
  317. path: "/dailyDetails",
  318. name: "dailyDetails",
  319. component: () => import("@/views/week/dailyDetails.vue")
  320. },
  321. {
  322. path: "/weeklyApproval",
  323. name: "weeklyApproval",
  324. component: () => import("@/views/week/weeklyApproval.vue")
  325. },
  326. {
  327. path: "/weekly",
  328. name: "weekly",
  329. component: () => import("@/views/week/weekly.vue")
  330. },
  331. {
  332. path: "/doubleWeekly",
  333. name: "doubleWeekly",
  334. component: () => import("@/views/week/doubleWeekly.vue")
  335. },
  336. {
  337. path: "/doubleWeeklyApproval",
  338. name: "doubleWeeklyApproval",
  339. component: () => import("@/views/week/doubleWeeklyApproval.vue")
  340. },
  341. {
  342. path: "/doubleWeeklyHistorical",
  343. name: "doubleWeeklyHistorical",
  344. component: () => import("@/views/week/doubleWeeklyHistorical.vue")
  345. },
  346. {
  347. path: "/dailyHistoricalDetails",
  348. name: "dailyHistoricalDetails",
  349. component: () => import("@/views/week/dailyHistoricalDetails.vue")
  350. },
  351. {
  352. path: "/doubleHistoricalWeeklyDetils",
  353. name: "doubleHistoricalWeeklyDetils",
  354. component: () => import("@/views/week/doubleHistoricalWeeklyDetils.vue")
  355. },
  356. {
  357. path: "/weeklyHistoricalDetils",
  358. name: "weeklyHistoricalDetils",
  359. component: () => import("@/views/week/weeklyHistoricalDetils.vue")
  360. },
  361. {
  362. path: "/VisitSummary",
  363. name: "VisitSummary",
  364. component: () => import("@/views/week/VisitSummary.vue")
  365. },
  366. {
  367. path: "/VisitSummaryMy",
  368. name: "VisitSummaryMy",
  369. component: () => import("@/views/week/VisitSummaryMy.vue")
  370. },
  371. {
  372. path: "/VisitSummaryAdd",
  373. name: "VisitSummaryAdd",
  374. component: () => import("@/views/week/VisitSummaryAdd.vue")
  375. },
  376. {
  377. path: "/VisitSummaryDetail",
  378. name: "VisitSummaryDetail",
  379. component: () => import("@/views/week/VisitSummaryDetail.vue")
  380. },
  381. ]
  382. }
  383. ]
  384. });
  385. export default router;