repair.vue 4.2 KB

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