index.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <template>
  2. <view class="index">
  3. <view class="index-header">
  4. <view class="index-header-box">
  5. <view class="index-header-box-1">
  6. <view class="left">
  7. <text>欢迎你!{{ vuex_user.operName }}</text>
  8. </view>
  9. <view class="right">
  10. <u-icon size="21" name="../../static/icons/logout-icon.svg" @click="logout"></u-icon>
  11. </view>
  12. </view>
  13. <view class="index-header-box-2">
  14. <text>普定停车<br />运营中心</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="index-main">
  19. <view class="index-main-menu">
  20. <!-- 数据概览 -->
  21. <view class="index-main-menu-1">
  22. <view class="menu-item" v-for="(item, index) in analysisMenuList" :key="index" @click="jumpPage(item.url)">
  23. <view class="menu-item-icon">
  24. <u-icon size="48" :name="item.icon"></u-icon>
  25. </view>
  26. <view class="menu-item-name">
  27. <text>{{ item.name }}</text>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- 订单管理 -->
  32. <!-- <view class="index-main-menu-2">
  33. <view class="index-main-menu-title">
  34. <text>订单管理</text>
  35. </view>
  36. <view class="menu">
  37. <view class="menu-item" v-for="(item, index) in orderMenuList" :key="index" @click="jumpPage(item.url, {}, true)">
  38. <view class="menu-item-icon" :style="{ width: item.width || '30px' }">
  39. <u--image :src="item.icon" :width="item.width || '30px'"
  40. :height="item.height || '31px'"></u--image>
  41. </view>
  42. <view class="menu-item-name">
  43. <text>{{ item.name }}</text>
  44. </view>
  45. </view>
  46. </view>
  47. </view> -->
  48. <!-- 收费员管理 -->
  49. <view class="index-main-menu-2">
  50. <view class="index-main-menu-title">
  51. <text>收费员管理</text>
  52. </view>
  53. <view class="menu">
  54. <view class="menu-item" v-for="(item, index) in tollCollectorList" :key="index" @click="jumpPage(item.url, {}, item.flag)">
  55. <view class="menu-item-icon" :style="{ width: item.width || '30px' }">
  56. <u--image :src="item.icon" :width="item.width || '30px'"
  57. :height="item.height || '31px'"></u--image>
  58. </view>
  59. <view class="menu-item-name">
  60. <text>{{ item.name }}</text>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 巡检管理 -->
  66. <view class="index-main-menu-2">
  67. <view class="index-main-menu-title">
  68. <text>巡检管理</text>
  69. </view>
  70. <view class="menu">
  71. <view class="menu-item" v-for="(item, index) in patrolMenuList" :key="index" @click="jumpPage(item.url, {}, item.flag)">
  72. <view class="menu-item-icon" :style="{ width: item.width || '30px', height: '33px' }">
  73. <u--image :src="item.icon" :width="item.width || '30px'"
  74. :height="item.height || '30px'"></u--image>
  75. </view>
  76. <view class="menu-item-name">
  77. <text>{{ item.name }}</text>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <u-toast ref="uToast"></u-toast>
  85. </view>
  86. </template>
  87. <script>
  88. export default {
  89. data() {
  90. return {
  91. todayData: {},
  92. analysisMenuList: [{
  93. icon: require('@/static/icons/today-overview-icon.svg'),
  94. name: '今日概况',
  95. url: 'pages/dataOverview/todayOverview/todayOverview'
  96. },
  97. {
  98. icon: require('@/static/icons/operational-analysis-icon.svg'),
  99. name: '运营分析',
  100. url: 'pages/dataOverview/operationalAnalysis/operationalAnalysis'
  101. },
  102. {
  103. icon: require('@/static/icons/statistical-report-icon.svg'),
  104. name: '统计报表',
  105. url: 'pages/dataOverview/statisticalReport/statisticalReport'
  106. }
  107. ],
  108. // 订单管理
  109. orderMenuList: [{
  110. icon: require('@/static/icons/parking-record-icon.svg'),
  111. name: '停车记录',
  112. url: 'pages/orderManagement/parkingRecord/parkingRecord',
  113. width: '28px'
  114. },
  115. {
  116. icon: require('@/static/icons/arrearage-record-icon.svg'),
  117. name: '欠费记录',
  118. url: 'pages/orderManagement/arrearageRecord/arrearageRecord'
  119. },
  120. {
  121. icon: require('@/static/icons/collection-record-icon.svg'),
  122. name: '收款记录',
  123. url: 'pages/orderManagement/collectionRecord/collectionRecord'
  124. },
  125. {
  126. icon: require('@/static/icons/fee-evasion-record-icon.svg'),
  127. name: '逃费记录',
  128. url: 'pages/orderManagement/feeEvasionRecord/feeEvasionRecord',
  129. width: '39px',
  130. height: '31px'
  131. },
  132. {
  133. icon: require('@/static/icons/void-record-icon.svg'),
  134. name: '作废记录',
  135. url: 'pages/orderManagement/voidRecord/voidRecord',
  136. height: '31px'
  137. },
  138. {
  139. icon: require('@/static/icons/recovery-record-icon.svg'),
  140. name: '追缴记录',
  141. url: 'pages/orderManagement/recoveryRecord/recoveryRecord',
  142. height: '31px'
  143. }
  144. ],
  145. // 收费员管理
  146. tollCollectorList: [
  147. {
  148. icon: require('@/static/icons/performance-ranking-icon.svg'),
  149. name: '业绩排名',
  150. url: 'pages/collectorManagement/performanceRanking/performanceRanking',
  151. height: '33px'
  152. },
  153. {
  154. icon: require('@/static/icons/performance-analysis-icon.svg'),
  155. name: '业绩分析',
  156. url: 'pages/collectorManagement/performanceAnalysis/performanceAnalysis',
  157. height: '33px',
  158. width: '33px'
  159. },
  160. {
  161. icon: require('@/static/icons/assessment-ranking-icon.svg'),
  162. name: '考核排名',
  163. url: 'pages/collectorManagement/assessmentRanking/assessmentRanking',
  164. height: '33px',
  165. width: '33px',
  166. flag: true
  167. },
  168. {
  169. icon: require('@/static/icons/assessment-analysis-icon.svg'),
  170. name: '考核分析',
  171. url: 'pages/collectorManagement/assessmentAnalysis/assessmentAnalysis',
  172. height: '32px',
  173. width: '33px',
  174. flag: true
  175. },
  176. {
  177. icon: require('@/static/icons/shift-scheduling-icon.svg'),
  178. name: '排班情况',
  179. url: 'pages/collectorManagement/shiftScheduling/shiftScheduling',
  180. height: '30px',
  181. width: '33px',
  182. flag: true
  183. }
  184. ],
  185. // 巡检管理
  186. patrolMenuList: [{
  187. icon: require('@/static/icons/patrol-manage-icon.svg'),
  188. name: '巡检记录',
  189. url: 'pages/patrolManagement/patrolRecord/patrolRecord',
  190. width: '29px',
  191. height: '31px',
  192. flag: true
  193. },
  194. {
  195. icon: require('@/static/icons/device-error-records-icon.svg'),
  196. name: '设备异常记录',
  197. url: 'pages/patrolManagement/deviceAbnormalRecords/deviceAbnormalRecords',
  198. width: '35px',
  199. height: '31px'
  200. },
  201. {
  202. icon: require('@/static/icons/emergency-disposal-icon.svg'),
  203. name: '应急处置记录',
  204. url: 'pages/patrolManagement/emergencyDisposalRecords/emergencyDisposalRecords',
  205. width: '35px',
  206. height: '31px',
  207. flag: true
  208. }
  209. ]
  210. }
  211. },
  212. onLoad() {
  213. // 为了验证token是否过期
  214. // this.getTodayData();
  215. },
  216. methods: {
  217. /**
  218. * 登出操作
  219. */
  220. logout() {
  221. uni.showModal({
  222. title: '提示',
  223. content: '你确认退出登录?',
  224. success: (res) => {
  225. if (res.confirm) {
  226. uni.$u.api.logoutApi().then(res => {
  227. if (res.code === 200) {
  228. uni.$u.vuex('vuex_token', '');
  229. uni.$u.vuex('vuex_user', {});
  230. uni.$u.vuex('vuex_isLogin', false);
  231. uni.redirectTo({
  232. url: "/pages/login/login"
  233. })
  234. } else {
  235. this.$refs.uToast.show({
  236. message: res.msg || '退出登录失败!',
  237. type: 'error'
  238. })
  239. }
  240. })
  241. }
  242. }
  243. })
  244. },
  245. /**
  246. * 获取今日概况
  247. */
  248. getTodayData() {
  249. uni.$u.api.todayOverviewApi.getTodayDataApi().then(res => {
  250. if (res.code === 200) {
  251. this.todayData = res.data
  252. } else {
  253. this.$refs.uToast.show({
  254. message: res.msg || '获取今日概况失败!',
  255. type: 'error'
  256. })
  257. }
  258. })
  259. },
  260. /**
  261. * 跳转页面
  262. * @param { String } url
  263. * @param { Object } params
  264. */
  265. jumpPage(url, params, flag) {
  266. if (flag) {
  267. // this.$refs.uToast.show({
  268. // message: '功能未开发!',
  269. // type: 'info'
  270. // })
  271. } else {
  272. uni.$u.route({
  273. url,
  274. params
  275. })
  276. }
  277. }
  278. }
  279. }
  280. </script>
  281. <style lang="scss">
  282. page {
  283. background-color: #EFEFEF;
  284. }
  285. </style>
  286. <style lang="scss" scoped>
  287. @import './index.scss';
  288. </style>