repair.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="processWrapper repair-page" style="
  3. overflow: scroll;">
  4. <!-- 宫格列表 -->
  5. <view class="bg-white " >
  6. <view class="cu-list grid col-3 no-border" style="padding-bottom:0">
  7. <view class="cu-item justify-center align-center " v-for="(item,index) in repairSquare" @tap=searchType(item)
  8. :key="index">
  9. <view :style="`background:${item.color}`" style="width:90%" class=" repairSquare">
  10. <view class="num">{{item.num}}</view>
  11. <text class="title" style="color:#fff">{{item.title}}</text>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. <block>
  17. <view>
  18. <view class="cu-list menu-avatar ">
  19. <view class="cu-item" v-for="(item,index) in getDataList" :key="index">
  20. <view class="cu-avatar " v-if="item.cl_type==1">
  21. <image class="image-bg" src="/static/repair1.png"/>
  22. </view>
  23. <view class="cu-avatar " v-if="item.cl_type==2">
  24. <image class="image-bg" src="/static/repair2.png"/>
  25. </view>
  26. <view class="cu-avatar " v-if="item.cl_type==3" >
  27. <image class="image-bg" src="/static/repair3.png"/>
  28. </view>
  29. <view class="cu-avatar " v-if="item.cl_type==4" >
  30. <image class="image-bg" src="/static/repair4.png"/>
  31. </view>
  32. <view class="cu-avatar " v-if="item.cl_type==5">
  33. <image class="image-bg" src="/static/repair5.png"/>
  34. </view>
  35. <view class="content">
  36. <view class="pro-title">
  37. <view class="cut">{{item.wx_name}}</view>
  38. </view>
  39. <view class="pro-des ">
  40. <view class="text-cut">
  41. {{item.sj_type==1?'故障':item.sj_type==2?'隐患':'其他'}}
  42. </view>
  43. </view>
  44. </view>
  45. <view class="action margin-right-sm" style="text-align:right;z-index:999" >
  46. <view style="color:#FDCA60" v-if="item.cl_type==1" @tap="goRepairDetail(item)">未处理</view>
  47. <view style="color:#59D1EA" v-if="item.cl_type==2">未审核</view>
  48. <view style="color:#F77070" v-if="item.cl_type==3">未通过</view>
  49. <view style="color:#72D06A" v-if="item.cl_type==4" >已完成</view>
  50. <view style="color:#F7895E" v-if="item.cl_type==5">超时完成</view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </block>
  56. <!-- <view class="btn-area submitBottomBtn padding-lr-sm">
  57. <button class="bg-blue round margin-top" @tap="goRepairDetail">报 修 </button>
  58. </view> -->
  59. </view>
  60. </template>
  61. <script>
  62. import json from '../../data/json.js';
  63. export default {
  64. data() {
  65. return {
  66. unporcessList:json.repair,
  67. repairSquare: json.repairSquare,
  68. modalName: null,
  69. listTouchStart: 0,
  70. listTouchDirection: null,
  71. CustomBar: this.CustomBar,
  72. getData:{},
  73. getDataList:{}
  74. };
  75. },
  76. onLoad:function(option){
  77. this.goRepairList({'company_code':uni.getStorageSync('selectedCode')})
  78. },
  79. methods: {
  80. // 保修列表数据请求
  81. async goRepairList(params = {}) {
  82. const res = await this.$myRequest({
  83. url: 'Repair/getRepairList',
  84. data:params,
  85. showLoading: true
  86. })
  87. this.getData=res.data;
  88. this.getDataList=res.data.data;
  89. this.repairSquare[0].num=res.data.repair_count;
  90. this.repairSquare[1].num=res.data.unprocessed_count;
  91. this.repairSquare[2].num=res.data.not_reviewed_count;
  92. this.repairSquare[3].num=res.data.failed_count;
  93. this.repairSquare[4].num=res.data.completed_count;
  94. this.repairSquare[5].num=res.data.overtime_count;
  95. console.log(this.getData);
  96. },
  97. // 筛选
  98. searchType(item) {
  99. this.goRepairList({'company_code':uni.getStorageSync('selectedCode'),"cl_type":item.cl_type})
  100. },
  101. // 页面跳转
  102. goRepairDetail(item) {
  103. uni.navigateTo({
  104. url: '/pages/repair/repairDetail/repairDetail?id='+item.id,
  105. success: res => {},
  106. fail: () => {},
  107. complete: () => {}
  108. });
  109. },
  110. // 页面跳转
  111. // goRepairDetailDone(item) {
  112. // uni.navigateTo({
  113. // url: '/pages/repair/repairDetailDone/repairDetailDone?id='+item.id,
  114. // success: res => {},
  115. // fail: () => {},
  116. // complete: () => {}
  117. // });
  118. // }
  119. }
  120. }
  121. </script>
  122. <style lang="scss">
  123. .processList{
  124. position:static;
  125. }
  126. </style>