planInnerList.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view>
  3. <view style="height:30rpx"></view>
  4. <view class="bg-white plan-sec text-center" style="margin:0rpx 30rpx 30rpx 30rpx">
  5. <view class="plan-tit padding-top-lg">{{getData.plan_name}}</view>
  6. <br>
  7. <chart2 :bindData="this.getData" v-if=" JSON.stringify(getData) != '{}'"></chart2>
  8. </view>
  9. <view class="margin bg-white plan-sec">
  10. <view class="info-tit margin-left-xs">
  11. <text class="cuIcon-titles margin-right-xs"></text>
  12. 维保详情
  13. </view>
  14. <view class="cu-list menu-avatar">
  15. <view class="cu-item deviceTypeItem" v-for="(item,index) in planList" :key="index"
  16. @tap="goDetailPage(item)">
  17. <view class="content" style="left:0!important;width:80%">
  18. <view class="title">{{item.spot_name}}</view>
  19. </view>
  20. <view class="nav-right num">
  21. <view class="text-grey">
  22. <span class="online" v-if="item.data3==2">已执行</span>
  23. <span class="error" v-if="item.data3==1">未执行</span>
  24. <text class="icon iconfont margin-right-xs ">&#xe629;</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import chart from './components/chart.vue';
  34. import chart2 from './components/chart2.vue';
  35. import json from '../../../data/json.js';
  36. export default {
  37. components: {
  38. chart,chart2
  39. },
  40. data() {
  41. return {
  42. inspectList: json.weiBaoPlan,
  43. getData:{},
  44. planList:[]
  45. };
  46. },
  47. onBackPress(event) {
  48. uni.reLaunch({
  49. url: "/"
  50. })
  51. return true;
  52. },
  53. onLoad:function(option){
  54. this.getPlanList({'company_code':uni.getStorageSync('selectedCode'),"id":option.id})
  55. },
  56. methods: {
  57. // 维保计划列表数据请求
  58. async getPlanList(params = {}) {
  59. const res = await this.$myRequest({
  60. url: 'Maintenance/getMaintenanceDetails',
  61. data:params,
  62. showLoading: true
  63. })
  64. this.getData=res.data.data[0];
  65. this.planList=this.getData.point;
  66. console.log(this.planList)
  67. },
  68. goDetailPage(item) {
  69. if (item.data3==2) {
  70. uni.navigateTo({
  71. url: "/pages/weiBao/planDetailDone/planDetailDone?id="+item.id+'&zb_id='+this.getData.id,
  72. })
  73. } else {
  74. uni.navigateTo({
  75. url: "/pages/weiBao/planDetail/planDetail?id="+item.id+'&zb_id='+this.getData.id,
  76. })
  77. }
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss">
  83. page {
  84. background-color: #F4F5F7;
  85. }
  86. </style>