processList.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. keyWords:''
  87. };
  88. },
  89. onLoad: function(option) {
  90. this.type=option.type;
  91. if(option.type==1){
  92. this.keyWords='人工督察单';
  93. uni.setNavigationBarTitle({
  94. title: "消防支队人工督察单",
  95. });
  96. }else{
  97. this.keyWords='电子督察单';
  98. uni.setNavigationBarTitle({
  99. title: "消防支队电子督察单",
  100. });
  101. }
  102. this.getProcessData({
  103. "company_code": uni.getStorageSync('selectedCode'),
  104. "clzt": 0
  105. }, 0);
  106. },
  107. onNavigationBarButtonTap(e) {
  108. console.log(e)
  109. uni.navigateTo({
  110. url: '/pages/export/export?keywords='+this.keyWords,
  111. success: res => {},
  112. fail: () => {},
  113. complete: () => {}
  114. });
  115. },
  116. methods: {
  117. async getProcessData(params = {}, whichTab) {
  118. const res = await this.$myRequest({
  119. url: this.type==1?'FireInspector/getManualInspectorList':'FireInspector/getElectronicInspectorList',
  120. data: params,
  121. showLoading: true
  122. })
  123. this.unporcessList = res.data.data;
  124. if (whichTab == 0) {
  125. this.unporcessList = res.data.data;
  126. this.record_count = parseInt(res.data.record_count)
  127. } else {
  128. this.porcessedList = res.data.data;
  129. this.record_count1 = parseInt(res.data.record_count)
  130. }
  131. },
  132. tabSelect(e) {
  133. this.unporcessList = [],
  134. this.porcessedList = [],
  135. console.log(e.currentTarget);
  136. this.TabCur = e.currentTarget.dataset.id;
  137. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  138. this.getProcessData({
  139. "company_code": uni.getStorageSync('selectedCode'),
  140. "clzt": e.currentTarget.dataset.id
  141. }, this.TabCur);
  142. },
  143. // 页面跳转
  144. goUnprocessDetail(item) {
  145. uni.navigateTo({
  146. url: '/pages/inspectList/unprocessDetail/unprocessDetail?id='+item.id+'&type='+this.type,
  147. success: res => {},
  148. fail: () => {},
  149. complete: () => {}
  150. });
  151. },
  152. goProcessedDetail(item) {
  153. uni.navigateTo({
  154. url: '/pages/inspectList/processedDetail/processedDetail?id='+item.id+'&type='+this.type,
  155. success: res => {},
  156. fail: () => {},
  157. complete: () => {}
  158. });
  159. },
  160. }
  161. }
  162. </script>
  163. <style lang="scss">
  164. //已处理未处理消息个数样式
  165. .nav .cu-item.cur {
  166. position: relative;
  167. border-bottom: 8rpx solid;
  168. }
  169. .cu-tag.badge {
  170. top: 14rpx;
  171. right: 96rpx;
  172. }
  173. .nav .cu-item {
  174. width: 50%;
  175. margin: 0;
  176. .text-blue,
  177. .line-blue,
  178. .lines-blue {
  179. color: #4274E7
  180. }
  181. }
  182. </style>