processList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="processWrapper ">
  3. <view style="height:98rpx"></view>
  4. <view class="ding">
  5. <scroll-view scroll-x class="bg-white nav text-center">
  6. <view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabNav"
  7. :key="index" @tap="tabSelect" :data-id="index">
  8. <view v-if="TabCur==index" class="cu-tag badge">
  9. <block class="cu-tag badge">{{TabCur? unporcessList.length:record_count}} </block>
  10. </view>
  11. {{item}}
  12. </view>
  13. </scroll-view>
  14. </view>
  15. <block v-if="TabCur==0">
  16. <view class="processList">
  17. <view class="cu-list menu-avatar">
  18. <view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
  19. <view class="cu-avatar lg" style="background-image:url(../../../static/process-icon.png);">
  20. </view>
  21. <view class="content">
  22. <view class="pro-title">
  23. <view class="cut">{{item.artificial_code}}</view>
  24. </view>
  25. <view class="pro-des ">
  26. <view class="text-cut">
  27. {{item.content}}
  28. </view>
  29. </view>
  30. <view class="pro-date ">{{item.timestamp}}</view>
  31. </view>
  32. <view class="action" style="z-index:99">
  33. <view class="unProcess" @tap="goUnprocessDetail(item)">未处理</view>
  34. </view>
  35. </view>
  36. <view class=" text-center margin-top" v-if="record_count === 0">暂无数据...</view>
  37. </view>
  38. </view>
  39. </block>
  40. <block v-if="TabCur==1">
  41. <view class="processList">
  42. <view class="cu-list menu-avatar ">
  43. <view class="cu-item" v-for="(item,index) in porcessedList" :key="index">
  44. <view class="cu-avatar lg" style="background-image:url(../../../static/processed-icon.png);">
  45. </view>
  46. <view class="content">
  47. <view class="pro-title">
  48. <view class="cut">{{item.artificial_code}}</view>
  49. </view>
  50. <view class="pro-des ">
  51. <view class="text-cut">
  52. {{item.content}}
  53. </view>
  54. </view>
  55. <view class="pro-date ">{{item.timestamp}}</view>
  56. </view>
  57. <view class="action" style="z-index:99">
  58. <view class="processed" @tap="goProcessedDetail(item)">已处理</view>
  59. </view>
  60. </view>
  61. <view class="text-center margin-top" v-if="record_count1 === 0">暂无数据...</view>
  62. </view>
  63. </view>
  64. </block>
  65. </view>
  66. </template>
  67. <script>
  68. import json from '../../../data/json.js';
  69. export default {
  70. data() {
  71. return {
  72. unporcessList: [],
  73. porcessedList: [],
  74. type: '0',
  75. modalName: null,
  76. listTouchStart: 0,
  77. listTouchDirection: null,
  78. CustomBar: this.CustomBar,
  79. TabCur: 0,
  80. tabNav: ['未处理', '已处理'],
  81. record_count: '',
  82. record_count1: ''
  83. };
  84. },
  85. onLoad: function(option) {
  86. this.getProcessData({
  87. "company_code": uni.getStorageSync('selectedCode'),
  88. "clzt": 0
  89. }, 0);
  90. },
  91. onNavigationBarButtonTap(e) {
  92. console.log(e)
  93. uni.navigateTo({
  94. url: '/pages/export/export',
  95. success: res => {},
  96. fail: () => {},
  97. complete: () => {}
  98. });
  99. },
  100. methods: {
  101. async getProcessData(params = {}, whichTab) {
  102. const res = await this.$myRequest({
  103. url: 'FireInspector/getManualInspectorList',
  104. data: params,
  105. showLoading: true
  106. })
  107. this.unporcessList = res.data.data;
  108. console.log(this.unporcessList)
  109. if (whichTab == 0) {
  110. this.unporcessList = res.data.data;
  111. this.record_count = parseInt(res.data.record_count)
  112. } else {
  113. this.porcessedList = res.data.data;
  114. this.record_count1 = parseInt(res.data.record_count)
  115. }
  116. },
  117. tabSelect(e) {
  118. this.unporcessList = [],
  119. this.porcessedList = [],
  120. console.log(e.currentTarget);
  121. this.TabCur = e.currentTarget.dataset.id;
  122. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  123. this.getProcessData({
  124. "company_code": uni.getStorageSync('selectedCode'),
  125. "clzt": e.currentTarget.dataset.id
  126. }, this.TabCur);
  127. },
  128. // 页面跳转
  129. goUnprocessDetail(item) {
  130. uni.navigateTo({
  131. url: '/pages/inspectList/unprocessDetail/unprocessDetail?id='+item.id,
  132. success: res => {},
  133. fail: () => {},
  134. complete: () => {}
  135. });
  136. },
  137. goProcessedDetail(item) {
  138. uni.navigateTo({
  139. url: '/pages/inspectList/processedDetail/processedDetail?id='+item.id,
  140. success: res => {},
  141. fail: () => {},
  142. complete: () => {}
  143. });
  144. },
  145. goVideoProcessedDetail(id) {
  146. uni.navigateTo({
  147. url: '/pages/processedDetail/processedDetail?companyCode=' + this.companyCode +
  148. '&processingStatus=' + this.processingStatus +
  149. '&id=' + id + '&type=2',
  150. success: res => {},
  151. fail: () => {},
  152. complete: () => {}
  153. });
  154. }
  155. }
  156. }
  157. </script>
  158. <style lang="scss">
  159. //已处理未处理消息个数样式
  160. .nav .cu-item.cur {
  161. position: relative;
  162. border-bottom: 8rpx solid;
  163. }
  164. .cu-tag.badge {
  165. top: 14rpx;
  166. right: 96rpx;
  167. }
  168. .nav .cu-item {
  169. width: 50%;
  170. margin: 0;
  171. .text-blue,
  172. .line-blue,
  173. .lines-blue {
  174. color: #4274E7
  175. }
  176. }
  177. </style>