index.vue 9.5 KB

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