monthReport.vue 1.4 KB

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