processList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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">{{type==1?item.artificial_code:item.supervise_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">{{type==1?item.artificial_code:item.supervise_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: 1,
  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. requestUrl:''
  84. };
  85. },
  86. onLoad: function(option) {
  87. this.type=option.type;
  88. if(option.type==1){
  89. uni.setNavigationBarTitle({
  90. title: "消防支队人工督察单",
  91. });
  92. }else{
  93. uni.setNavigationBarTitle({
  94. title: "消防支队电子督察单",
  95. });
  96. }
  97. this.getProcessData({
  98. "company_code": uni.getStorageSync('selectedCode'),
  99. "clzt": 0
  100. }, 0);
  101. },
  102. onNavigationBarButtonTap(e) {
  103. console.log(e)
  104. uni.navigateTo({
  105. url: '/pages/export/export',
  106. success: res => {},
  107. fail: () => {},
  108. complete: () => {}
  109. });
  110. },
  111. methods: {
  112. async getProcessData(params = {}, whichTab) {
  113. const res = await this.$myRequest({
  114. url: this.type==1?'FireInspector/getManualInspectorList':'FireInspector/getElectronicInspectorList',
  115. data: params,
  116. showLoading: true
  117. })
  118. this.unporcessList = res.data.data;
  119. if (whichTab == 0) {
  120. this.unporcessList = res.data.data;
  121. this.record_count = parseInt(res.data.record_count)
  122. } else {
  123. this.porcessedList = res.data.data;
  124. this.record_count1 = parseInt(res.data.record_count)
  125. }
  126. },
  127. tabSelect(e) {
  128. this.unporcessList = [],
  129. this.porcessedList = [],
  130. console.log(e.currentTarget);
  131. this.TabCur = e.currentTarget.dataset.id;
  132. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  133. this.getProcessData({
  134. "company_code": uni.getStorageSync('selectedCode'),
  135. "clzt": e.currentTarget.dataset.id
  136. }, this.TabCur);
  137. },
  138. // 页面跳转
  139. goUnprocessDetail(item) {
  140. uni.navigateTo({
  141. url: '/pages/inspectList/unprocessDetail/unprocessDetail?id='+item.id+'&type='+this.type,
  142. success: res => {},
  143. fail: () => {},
  144. complete: () => {}
  145. });
  146. },
  147. goProcessedDetail(item) {
  148. uni.navigateTo({
  149. url: '/pages/inspectList/processedDetail/processedDetail?id='+item.id+'&type='+this.type,
  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>