record.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="">
  3. <view class="cu-list menu-avatar">
  4. <view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in this.getData"
  5. :key="index" :data-target="'move-box-' + index" @tap="goDetail(item)">
  6. <view class="content" style="left:0;width:80%">
  7. <view class="pro-title">
  8. <view class="cut">计划:{{item.plan_name}}</view>
  9. </view>
  10. <view class="pro-des ">
  11. <view class="text-cut">
  12. 点位:{{item.spot_name}}
  13. </view>
  14. </view>
  15. <view class="pro-date ">{{item.wc_time}}</view>
  16. </view>
  17. <view class="nav-right num margin-right-sm">
  18. <view class="text-grey">
  19. <button class="cu-btn radius bg-green sm" v-if="item.spot_abnormal==0">正常</button>
  20. <button class="cu-btn radius bg-orange sm" v-if="item.spot_abnormal==1">异常</button>
  21. <button class="cu-btn radius bg-red sm" v-if="item.spot_abnormal==2">故障</button>
  22. <button class="cu-btn radius bg-orange sm" v-if="item.spot_abnormal==3">其他</button>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import json from '../../../data/json.js';
  31. export default {
  32. data() {
  33. return {
  34. modalName: null,
  35. getData:[]
  36. };
  37. },
  38. onLoad:function(option){
  39. this.goRecordList({'company_code':uni.getStorageSync('selectedCode')})
  40. },
  41. onNavigationBarButtonTap(e) {
  42. console.log(e)
  43. uni.navigateTo({
  44. url: '/pages/export/export',
  45. });
  46. },
  47. methods: {
  48. // 巡检记录列表数据请求
  49. async goRecordList(params = {}) {
  50. const res = await this.$myRequest({
  51. url: 'Inspection/getInspectionRecordList',
  52. data:params,
  53. showLoading: true
  54. })
  55. this.getData=res.data.data;
  56. console.log(this.getData);
  57. },
  58. // 页面跳转
  59. goDetail(item) {
  60. uni.navigateTo({
  61. url: '/pages/xunJian/recordDetail/recordDetail?id='+item.id,
  62. });
  63. },
  64. }
  65. }
  66. </script>
  67. <style lang="scss">
  68. .cu-item{
  69. height:180rpx!important
  70. }
  71. </style>