processList.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <template>
  2. <view class="processWrapper ">
  3. <view class="ding">
  4. <scroll-view scroll-x class="bg-white nav text-center">
  5. <view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabNav" :key="index" @tap="tabSelect"
  6. :data-id="index">
  7. <view v-if="TabCur==index&&!TabCur" class="cu-tag badge">
  8. <block class="cu-tag badge">{{alarmUntreatedCount}} </block>
  9. </view>
  10. {{item}}
  11. </view>
  12. </scroll-view>
  13. </view>
  14. <block v-if="TabCur==0">
  15. <view class="processList">
  16. <view class="cu-list menu-avatar">
  17. <view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
  18. <view class="cu-avatar lg" style="background-image:url(../../static/process-icon.png);"></view>
  19. <view class="content">
  20. <view class="pro-title">
  21. <view class="cut">{{item.measName}}</view>
  22. </view>
  23. <view class="pro-des ">
  24. <view class="text-cut">
  25. {{item.digitalValue!=0?"动作":"复归"}}
  26. </view>
  27. </view>
  28. <view class="pro-date ">{{item.soeTime}}</view>
  29. </view>
  30. <view class="action" style="z-index:99;width:170rpx;text-align:right">
  31. <view class="unProcess" @tap="goUnprocessDetail(item.id)">未处理<text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text></view>
  32. </view>
  33. </view>
  34. <view class=" text-center margin-top" v-if="alarmUntreatedCount === 0">暂无数据...</view>
  35. </view>
  36. </view>
  37. </block>
  38. <block v-if="TabCur==1">
  39. <view class="processList">
  40. <!-- 筛选 start -->
  41. <view class=" padding-bottom-xs" style="border-bottom:1rpx solid rgba(221,221,221,.3)">
  42. <view class="cu-bar search filter-section">
  43. <view class="search-form border-gray round bg-white">
  44. <select name="" id="" v-model="handleStatus">
  45. <option value="0">全部</option>
  46. <option value="1">已处理</option>
  47. <option value="2">待确认</option>
  48. <option value="3">自动恢复</option>
  49. <option value="4">过期失效</option>
  50. </select>
  51. </view>
  52. <view class="action" v-if="this.handleStatus==2">
  53. <view>
  54. <checkbox-group class="block " @change="allChoose">
  55. <view class="cu-form-group">
  56. <checkbox value="all" class='round blue' :class="{'checked':allChecked}" :checked="allChecked?true:false">
  57. </checkbox>
  58. <view class="title">批量处理</view>
  59. </view>
  60. </checkbox-group>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 筛选end -->
  66. <checkbox-group @change="changeCheckbox">
  67. <view class="cu-list menu-avatar ">
  68. <view class="cu-item" v-for="(item,index) in porcessedList" :key="index">
  69. <view class="cu-form-group checkPos">
  70. <!-- <checkbox :value="String(item.owner_code)" :checked="checkedArr.includes(String(item.owner_code))"
  71. :class="{'checked':checkedArr.includes(String(item.owner_code))}"></checkbox> -->
  72. <checkbox :value="String(item.id)" class='round blue ' :class="{'checked':checkedArr.includes(String(item.id))}" :checked="checkedArr.includes(String(item.id))">
  73. </checkbox>
  74. </view>
  75. <view class="cu-avatar lg" :style="{'left':handleStatus==2 ? '60rpx':'0'}" style="background-image:url(../../static/processed-icon.png);"></view>
  76. <view class="content" :style="{'left':handleStatus==2 ? '180rpx':'120rpx'}">
  77. <view class="pro-title">
  78. <view class="cut">{{item.measName}}</view>
  79. </view>
  80. <view class="pro-des ">
  81. <view class="text-cut">
  82. {{item.digitalValue!=0?"动作":"复归"}}
  83. </view>
  84. </view>
  85. <view class="pro-date ">{{item.soeTime}}</view>
  86. </view>
  87. <view class="action" style="z-index:99;width:180rpx;text-align:right">
  88. <view class="processed" v-if="item.handling_status==1" @tap="goProcessedDetail(item.id)">
  89. 已处理
  90. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  91. </view>
  92. <view style="color:#FF8125" v-if="item.handling_status==2" @tap="goProcessedDetail(item.id)">待确认
  93. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  94. </view>
  95. <view style="color:#4274E7" v-if="item.handling_status==3" @tap="goProcessedDetail(item.id)">自动回复
  96. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  97. </view>
  98. <view style="color:#999999" v-if="item.handling_status==4" @tap="goProcessedDetail(item.id)">过期失效
  99. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  100. </view>
  101. </view>
  102. </view>
  103. <view class="text-center margin-top" v-if="alarmUntreatedCount1 === 0">暂无数据...</view>
  104. </view>
  105. </checkbox-group>
  106. </view>
  107. </block>
  108. </view>
  109. </template>
  110. <script>
  111. import json from '../../data/json.js';
  112. export default {
  113. data() {
  114. return {
  115. allChecked:false,
  116. checkbox: [{
  117. value: 'A',
  118. checked: true
  119. }, {
  120. value: 'B',
  121. checked: true
  122. }, {
  123. value: 'C',
  124. checked: false
  125. }],
  126. handleStatus:0,
  127. checkedArr:[],
  128. // unporcessList: json.unprocessList,
  129. unporcessList: [],
  130. porcessedList: [],
  131. type: '0',
  132. modalName: null,
  133. listTouchStart: 0,
  134. listTouchDirection: null,
  135. CustomBar: this.CustomBar,
  136. TabCur: 0,
  137. tabNav: ['未处理', '已处理'],
  138. companyCode: '',
  139. alarmUntreatedCount: '',
  140. alarmUntreatedCount1: '',
  141. processingStatus: '',
  142. };
  143. },
  144. watch:{
  145. handleStatus(val){
  146. // this.porcessedList={};
  147. this.getProcessData({
  148. "companyCode": this.companyCode,
  149. "type": this.type,
  150. "processingStatus": val
  151. }, 0);
  152. }
  153. },
  154. computed: {
  155. },
  156. onLoad: function(option) {
  157. console.log(option.type);
  158. console.log(option.companyCode);
  159. if (option.type == 1) {
  160. uni.setNavigationBarTitle({
  161. title: '电力检测'
  162. });
  163. } else {
  164. uni.setNavigationBarTitle({
  165. title: '视频告警'
  166. });
  167. }
  168. this.getProcessData({
  169. "companyCode": option.companyCode,
  170. "type": option.type,
  171. "processingStatus": "0"
  172. }, 0);
  173. console.log('onload里')
  174. this.companyCode = option.companyCode;
  175. this.processingStatus = 1
  176. this.type = option.type;
  177. },
  178. methods: {
  179. // 全选事件
  180. allChoose(e) {
  181. let chooseItem = e.detail.value;
  182. // 全选
  183. if (chooseItem[0] == 'all') {
  184. this.allChecked = true;
  185. for (let item of this.porcessedList) {
  186. let itemVal = String(item.id);
  187. if (!this.checkedArr.includes(itemVal)) {
  188. this.checkedArr.push(itemVal);
  189. }
  190. }
  191. } else {
  192. // 取消全选
  193. this.allChecked = false;
  194. this.checkedArr = [];
  195. }
  196. },
  197. changeCheckbox(e){
  198. this.checkedArr = e.detail.value;
  199. // 如果选择的数组中有值,并且长度等于列表的长度,就是全选
  200. if (this.checkedArr.length > 0 && this.checkedArr.length == this.porcessedList.length) {
  201. this.allChecked = true;
  202. } else {
  203. this.allChecked = false;
  204. }
  205. },
  206. async getProcessData(ming = {}, whichTab) {
  207. const res = await this.$myRequest({
  208. url: 'IntegratedAlarm/getElectricAlarmUntreated',
  209. data: ming,
  210. showLoading:true
  211. })
  212. if (whichTab == 0) {
  213. this.unporcessList = res.data.data;
  214. this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
  215. } else {
  216. this.porcessedList = res.data.data;
  217. console.log(this.porcessedList)
  218. this.alarmUntreatedCount1 = parseInt(res.data.alarmUntreatedCount)
  219. }
  220. // console.log(res.data)
  221. },
  222. tabSelect(e) {
  223. console.log(e.currentTarget);
  224. this.TabCur = e.currentTarget.dataset.id;
  225. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  226. this.getProcessData({
  227. "companyCode": this.companyCode,
  228. "type": this.type,
  229. "processingStatus": !e.currentTarget.dataset.id?e.currentTarget.dataset.id:'1,2,3,4'
  230. }, this.TabCur);
  231. },
  232. // 页面跳转
  233. goUnprocessDetail(id) {
  234. uni.navigateTo({
  235. url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode + '&processingStatus=0&id=' + id +
  236. '&type=1',
  237. success: res => {},
  238. fail: () => {},
  239. complete: () => {}
  240. });
  241. },
  242. goVideoUnprocessDetail(id) {
  243. uni.navigateTo({
  244. url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode + '&processingStatus=0&id=' + id +
  245. '&type=2',
  246. success: res => {},
  247. fail: () => {},
  248. complete: () => {}
  249. });
  250. },
  251. goProcessedDetail(id) {
  252. uni.navigateTo({
  253. url: '/pages/processedDetail/processedDetail?companyCode=' + this.companyCode + '&processingStatus=' + this.processingStatus +
  254. '&id=' + id + '&type=1',
  255. success: res => {},
  256. fail: () => {},
  257. complete: () => {}
  258. });
  259. },
  260. goVideoProcessedDetail(id) {
  261. uni.navigateTo({
  262. url: '/pages/processedDetail/processedDetail?companyCode=' + this.companyCode + '&processingStatus=' + this.processingStatus +
  263. '&id=' + id + '&type=2',
  264. success: res => {},
  265. fail: () => {},
  266. complete: () => {}
  267. });
  268. },
  269. InputFocus(e) {
  270. this.InputBottom = e.detail.height
  271. },
  272. InputBlur(e) {
  273. this.InputBottom = 0
  274. },
  275. }
  276. }
  277. </script>
  278. <style lang="scss">
  279. //已处理未处理消息个数样式
  280. .nav .cu-item.cur {
  281. position: relative;
  282. border-bottom: 8rpx solid;
  283. }
  284. .cu-tag.badge {
  285. top: 14rpx;
  286. right: 96rpx;
  287. }
  288. .nav .cu-item {
  289. width: 50%;
  290. margin: 0;
  291. .text-blue,
  292. .line-blue,
  293. .lines-blue {
  294. color: #4274E7
  295. }
  296. }
  297. </style>