processList.vue 5.1 KB

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