processList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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" :key="index" @tap="tabSelect"
  7. :data-id="index">
  8. <view v-if="TabCur==index" class="cu-tag badge">
  9. <block class="cu-tag badge">{{TabCur? unporcessList.length:porcessedList.length}} </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);"></view>
  20. <view class="content">
  21. <view class="pro-title">
  22. <view class="cut">{{item.owner_name}}</view>
  23. </view>
  24. <view class="pro-des ">
  25. <view class="text-cut">
  26. {{item.unitinfo}}
  27. </view>
  28. </view>
  29. <view class="pro-date ">{{item.time}}</view>
  30. </view>
  31. <view class="action" style="z-index:99">
  32. <view class="unProcess" @tap="goUnprocessDetail(item)">未处理</view>
  33. </view>
  34. </view>
  35. <view class=" text-center margin-top" v-if="unporcessList.length === 0">暂无数据...</view>
  36. </view>
  37. </view>
  38. </block>
  39. <block v-if="TabCur==1">
  40. <view class="processList">
  41. <view class="cu-list menu-avatar " >
  42. <view class="cu-item" v-for="(item,index) in porcessedList" :key="index">
  43. <view class="cu-avatar lg" style="background-image:url(../../static/processed-icon.png);"></view>
  44. <view class="content">
  45. <view class="pro-title">
  46. <view class="cut">{{item.owner_name}}</view>
  47. </view>
  48. <view class="pro-des ">
  49. <view class="text-cut">
  50. {{item.unitinfo}}
  51. </view>
  52. </view>
  53. <view class="pro-date ">{{item.time}}</view>
  54. </view>
  55. <view class="action" style="z-index:99">
  56. <view class="processed" @tap="goProcessedDetail(item)">已处理</view>
  57. </view>
  58. </view>
  59. <view class="text-center margin-top" v-if="porcessedList.length === 0">暂无数据...</view>
  60. </view>
  61. </view>
  62. </block>
  63. </view>
  64. </template>
  65. <script>
  66. import json from '../../data/json.js';
  67. export default {
  68. data() {
  69. return {
  70. unporcessList: [],
  71. porcessedList: [],
  72. type: '0',
  73. modalName: null,
  74. listTouchStart: 0,
  75. listTouchDirection: null,
  76. CustomBar: this.CustomBar,
  77. TabCur: 0,
  78. tabNav: ['未处理', '已处理'],
  79. };
  80. },
  81. onLoad: function(option) {
  82. this.getProcessData({
  83. "company_code": option.companyCode,
  84. "type": option.type,
  85. "processing_status": 0
  86. },0);
  87. this.companyCode = option.companyCode;
  88. this.processingStatus = 1
  89. this.type = option.type;
  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: 'ComprehensiveAlarm/getIntegratedAlarmList',
  104. data: params,
  105. showLoading:true
  106. })
  107. this.unporcessList = res.data.data;
  108. if (whichTab == 0) {
  109. this.unporcessList = res.data.data;
  110. this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
  111. } else {
  112. this.porcessedList = res.data.data;
  113. this.alarmUntreatedCount1 = parseInt(res.data.alarmUntreatedCount)
  114. }
  115. // console.log(res.data)
  116. },
  117. tabSelect(e) {
  118. console.log(e.currentTarget);
  119. this.TabCur = e.currentTarget.dataset.id;
  120. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  121. this.getProcessData({
  122. "company_code": this.companyCode,
  123. "type": this.type,
  124. "processing_status": e.currentTarget.dataset.id
  125. },1);
  126. },
  127. // 页面跳转
  128. goUnprocessDetail(item) {
  129. if(item.type==1||item.type==3)
  130. uni.navigateTo({
  131. url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode + '&id=' + item.id +'&type='+this.type+'&deviceCode='+item.device_code+'&data2='+item.data2+'&data3='+item.data3+'&data5='+item.data5,
  132. });
  133. },
  134. goProcessedDetail(item) {
  135. uni.navigateTo({
  136. url: '/pages/processedDetail/processedDetail?id=' + item.id + '&type='+item.type,
  137. success: res => {},
  138. fail: () => {},
  139. complete: () => {}
  140. });
  141. },
  142. }
  143. }
  144. </script>
  145. <style lang="scss">
  146. //已处理未处理消息个数样式
  147. .nav .cu-item.cur {
  148. position: relative;
  149. border-bottom: 8rpx solid;
  150. }
  151. .cu-tag.badge {
  152. top: 14rpx;
  153. right: 96rpx;
  154. }
  155. .nav .cu-item {
  156. width: 50%;
  157. margin: 0;
  158. .text-blue,
  159. .line-blue,
  160. .lines-blue {
  161. color: #4274E7
  162. }
  163. }
  164. </style>