repair.vue 4.7 KB

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