monthReport.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="">
  3. <view class="cu-list menu-avatar">
  4. <view class="cu-item deviceTypeItem" v-for="(item,index) in getData" :key="index" @tap="goReportDetail(item)">
  5. <view class="cu-avatar round" style="background-image:url(../../../static/month-report-icon.png)"></view>
  6. <view class="content">
  7. <view class="title">{{item.company_name}} {{item.event_time}}</view>
  8. </view>
  9. <view class="nav-right num">
  10. <view>
  11. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import json from '../../../data/json.js';
  20. export default {
  21. data() {
  22. return {
  23. deviceType: json.deviceType,
  24. getData:[]
  25. };
  26. },
  27. onLoad: function(option) {
  28. this.getDataList({'company_code':uni.getStorageSync('selectedCode')})
  29. },
  30. methods: {
  31. // 列表数据请求
  32. async getDataList(params = {}) {
  33. const res = await this.$myRequest({
  34. url: 'MonthlyReport/getMonthlyReportList',
  35. data:params,
  36. showLoading: true
  37. })
  38. this.getData=res.data.data;
  39. // console.log(JSON.parse(res))
  40. console.log(this.getData[0].company_name)
  41. },
  42. goReportDetail(item) {
  43. uni.navigateTo({
  44. url: '/pages/analyse/monthDetail/monthDetail?id='+item.id,
  45. });
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss">
  51. </style>