processList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. <template>
  2. <view class="processWrapper ">
  3. <view style="height:100rpx"></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&&!TabCur" class="cu-tag badge">
  9. <block class="cu-tag badge">{{alarmUntreatedCount}} </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" style="width:450rpx">
  21. <view class="pro-title">
  22. <view class="cut inOneLine">{{item.measName}}</view>
  23. </view>
  24. <view class="pro-des ">
  25. <view class="text-cut inOneLine">
  26. {{item.digitalValue!=0?"动作":"复归"}}
  27. </view>
  28. </view>
  29. <view class="pro-date ">{{item.soeTime}}</view>
  30. </view>
  31. <view class="action" style="z-index:99;width:170rpx;text-align:right">
  32. <view class="unProcess" @tap="type==1?goUnprocessDetail(item):goVideoUnprocessDetail(item)">未处理<text
  33. class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text></view>
  34. </view>
  35. </view>
  36. <view class=" text-center margin-top" v-if="alarmUntreatedCount == 0">暂无数据...</view>
  37. <view v-show="isLoadMore&&alarmUntreatedCount!= 0">
  38. <uni-load-more :status="loadStatus"></uni-load-more>
  39. </view>
  40. </view>
  41. </view>
  42. </block>
  43. <!-- 已处理start -->
  44. <block v-if="TabCur==1">
  45. <view class="processList">
  46. <!-- 电力监测筛选 start -->
  47. <view v-if="this.type==1 " class=" padding-bottom-xs" style="border-bottom:1rpx solid rgba(221,221,221,.3)">
  48. <view class="cu-bar search filter-section">
  49. <view class="search-form border-gray round bg-white">
  50. <select name="" id="" v-model="handleStatus">
  51. <option value="0">全部</option>
  52. <option value="1">已处理</option>
  53. <option value="2">待确认</option>
  54. <option value="3">自动恢复</option>
  55. <option value="4">过期失效</option>
  56. </select>
  57. </view>
  58. <view class="action" v-if="this.handleStatus==2">
  59. <view>
  60. <checkbox-group class="block " @change="allChoose">
  61. <view class="cu-form-group">
  62. <checkbox value="all" class='round blue' :class="{'checked':allChecked}"
  63. :checked="allChecked?true:false">
  64. </checkbox>
  65. <view class="title">批量处理</view>
  66. </view>
  67. </checkbox-group>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 电力监测筛选end -->
  73. <checkbox-group @change="changeCheckbox">
  74. <view class="cu-list menu-avatar " :class="this.handleStatus==2?'handle2scroll':''">
  75. <view class="cu-item" v-for="(item,index) in porcessedList" :key="index">
  76. <view class="cu-form-group checkPos">
  77. <checkbox :value="String(item.id)" class='round blue '
  78. :class="{'checked':checkedArr.includes(String(item.id))}"
  79. :checked="checkedArr.includes(String(item.id))">
  80. </checkbox>
  81. </view>
  82. <view class="cu-avatar lg" :style="{'left':handleStatus==2 ? '60rpx':'0'}"
  83. style="background-image:url(../../static/processed-icon.png);"></view>
  84. <view class="content" style="width:400rpx" :style="{'left':handleStatus==2 ? '180rpx':'120rpx'}">
  85. <view class="pro-title">
  86. <view class="cut inOneLine">{{item.measName}}</view>
  87. </view>
  88. <view class="pro-des ">
  89. <view class="text-cut inOneLine">
  90. {{item.digitalValue!=0?"动作":"复归"}}
  91. </view>
  92. </view>
  93. <view class="pro-date ">{{item.soeTime}}</view>
  94. </view>
  95. <view class="action" style="z-index:99;width:180rpx;text-align:right">
  96. <view class="processed" v-if="item.handling_status==1"
  97. @tap="type==1?goProcessedDetail(item):goVideoProcessedDetail(item)">
  98. 已处理
  99. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  100. </view>
  101. <view style="color:#FF8125" v-if="item.handling_status==2"
  102. @tap="goProcessedDetail(item)">待确认
  103. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  104. </view>
  105. <view style="color:#4274E7" v-if="item.handling_status==3"
  106. @tap="goProcessedDetail(item)">自动回复
  107. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  108. </view>
  109. <view style="color:#999999" v-if="item.handling_status==4"
  110. @tap="goProcessedDetail(item)">过期失效
  111. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  112. </view>
  113. </view>
  114. </view>
  115. <view class="text-center margin-top" v-if="alarmUntreatedCount1 == 0">暂无数据...</view>
  116. <view v-show="isLoadMore&&alarmUntreatedCount1 != 0&&this.currentPage>1" :style="{'padding-top':this.handleStatus==2 ? '50rpx':'','padding-bottom':this.handleStatus==2 ? '180rpx':''}" >
  117. <uni-load-more :status="loadStatus"></uni-load-more>
  118. </view>
  119. </view>
  120. <view v-if="this.handleStatus==2" class="btn-area submitBottomBtn padding-lr-sm">
  121. <button class="bg-blue round margin-top" @click="$noMultipleClicks(quickConfirm)">快速确认 </button>
  122. </view>
  123. </checkbox-group>
  124. </view>
  125. </block>
  126. <!-- 已处理end -->
  127. </view>
  128. </template>
  129. <script>
  130. import json from '../../data/json.js';
  131. export default {
  132. data() {
  133. return {
  134. noClick:true,
  135. allChecked: false,
  136. checkbox: [{
  137. value: 'A',
  138. checked: true
  139. }, {
  140. value: 'B',
  141. checked: true
  142. }, {
  143. value: 'C',
  144. checked: false
  145. }],
  146. handleStatus: 0,
  147. checkedArr: [],
  148. unporcessList: [],
  149. porcessedList: [],
  150. type: '0',
  151. modalName: null,
  152. listTouchStart: 0,
  153. listTouchDirection: null,
  154. CustomBar: this.CustomBar,
  155. TabCur: 0,
  156. tabNav: ['未处理', '已处理'],
  157. companyCode: '',
  158. alarmUntreatedCount: '',
  159. alarmUntreatedCount1: '',
  160. processingStatus: 0,
  161. currentPage: 1,
  162. size: 10,
  163. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  164. isLoadMore: false, //是否加载中
  165. };
  166. },
  167. watch: {
  168. handleStatus(val) {
  169. console.log('下拉框切换')
  170. this.currentPage=1;
  171. this.porcessedList=[]
  172. // this.porcessedList={};
  173. if(val==0){
  174. val='1,2,3,4'
  175. }
  176. this.processingStatus=val
  177. console.log(this.processingStatus)
  178. this.getProcessData({
  179. "companyCode": this.companyCode,
  180. "type": this.type,
  181. "processingStatus": val,
  182. "currentPage": this.currentPage,
  183. "size": this.size,
  184. }, this.TabCur);
  185. }
  186. },
  187. computed: {
  188. },
  189. onReachBottom() { //上拉触底函数
  190. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  191. this.isLoadMore = true
  192. this.currentPage += 1;
  193. this.getProcessData({
  194. "companyCode": this.companyCode,
  195. "type": this.type,
  196. "processingStatus": this.processingStatus,
  197. "currentPage": this.currentPage,
  198. "size": this.size,
  199. }, this.TabCur);
  200. }
  201. },
  202. onLoad: function(option) {
  203. this.type=option.type;
  204. this.companyCode=option.companyCode;
  205. console.log(option.type);
  206. console.log(option.companyCode);
  207. if (option.type == 1) {
  208. uni.setNavigationBarTitle({
  209. title: '电力检测'
  210. });
  211. } else {
  212. uni.setNavigationBarTitle({
  213. title: '视频告警'
  214. });
  215. }
  216. this.loadData()
  217. },
  218. methods: {
  219. loadData(){
  220. this.getProcessData({
  221. "companyCode": this.companyCode,
  222. "type": this.type,
  223. "processingStatus": this.processingStatus,
  224. "currentPage": this.currentPage,
  225. "size": this.size,
  226. }, this.TabCur);
  227. },
  228. quickConfirm(){
  229. if (!this.checkedArr.length) {
  230. uni.showToast({
  231. title: "请至少选择一条需要确认的数据",
  232. icon: "none"
  233. });
  234. return
  235. }
  236. console.log(this.checkedArr)
  237. this.quickConfirmRes({
  238. "id": this.checkedArr.toString(),
  239. "companyCode": this.companyCode,
  240. })
  241. },
  242. // 请求
  243. async quickConfirmRes(ming = {}) {
  244. const res = await this.$myRequest({
  245. url: 'IntegratedAlarm/setBatchProcessing',
  246. data: ming
  247. })
  248. if (!res.data.flag) {
  249. uni.showToast({
  250. title: "添加失败",
  251. icon: "none"
  252. });
  253. } else {
  254. uni.showToast({
  255. title: "添加成功",
  256. });
  257. }
  258. setTimeout(() => {
  259. uni.navigateTo({
  260. url: '/pages/processList/processList?companyCode=' + this.companyCode +
  261. '&type=1'
  262. });
  263. }, 1000);
  264. },
  265. // 全选事件
  266. allChoose(e) {
  267. let chooseItem = e.detail.value;
  268. // 全选
  269. if (chooseItem[0] == 'all') {
  270. this.allChecked = true;
  271. for (let item of this.porcessedList) {
  272. let itemVal = String(item.id);
  273. if (!this.checkedArr.includes(itemVal)) {
  274. this.checkedArr.push(itemVal);
  275. }
  276. }
  277. } else {
  278. // 取消全选
  279. this.allChecked = false;
  280. this.checkedArr = [];
  281. }
  282. },
  283. changeCheckbox(e) {
  284. this.checkedArr = e.detail.value;
  285. // 如果选择的数组中有值,并且长度等于列表的长度,就是全选
  286. if (this.checkedArr.length > 0 && this.checkedArr.length == this.porcessedList.length) {
  287. this.allChecked = true;
  288. } else {
  289. this.allChecked = false;
  290. }
  291. },
  292. async getProcessData(ming = {}, whichTab) {
  293. console.log('请求接口')
  294. const res = await this.$myRequest({
  295. url: 'IntegratedAlarm/getElectricAlarmUntreated',
  296. data: ming,
  297. showLoading: true
  298. })
  299. // if (whichTab ==0) {
  300. // this.unporcessList = res.data.data;
  301. // this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
  302. // } else {
  303. // this.porcessedList = res.data.data;
  304. // this.alarmUntreatedCount1 = parseInt(res.data.alarmUntreatedCount)
  305. // }
  306. // console.log(this.porcessedList)
  307. if (res.data.data.length) {
  308. if (whichTab == 0) {
  309. this.unporcessList = this.unporcessList.concat(res.data.data)
  310. this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
  311. } else {
  312. this.porcessedList = this.porcessedList.concat(res.data.data);
  313. this.alarmUntreatedCount1 = parseInt(res.data.alarmUntreatedCount)
  314. console.log(this.alarmUntreatedCount1)
  315. }
  316. if (res.data.data.length < this.size) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
  317. this.isLoadMore = true
  318. this.loadStatus = 'nomore'
  319. } else {
  320. this.isLoadMore = false
  321. }
  322. } else {
  323. this.isLoadMore = true
  324. this.loadStatus = 'nomore'
  325. }
  326. },
  327. tabSelect(e) { //已处理未处理切换
  328. console.log('已处理未处理切换')
  329. this.currentPage=1;
  330. this.porcessedList=[];
  331. this.unporcessList=[];
  332. console.log(e.currentTarget);
  333. this.TabCur = e.currentTarget.dataset.id;
  334. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  335. // this.handleStatus=0;
  336. this.processingStatus=!e.currentTarget.dataset.id ? e.currentTarget.dataset.id : '1,2,3,4',
  337. console.log(this.processingStatus)
  338. this.loadData()
  339. },
  340. // 页面跳转
  341. goUnprocessDetail(item) {
  342. uni.navigateTo({
  343. url: '/pages/processDetailEle/processDetailEle?companyCode=' + this.companyCode +
  344. '&id=' + item.id +
  345. '&type=1',
  346. });
  347. },
  348. goProcessedDetail(item) {
  349. uni.navigateTo({
  350. url: '/pages/processDetailEle/processDetailEle?companyCode=' + this.companyCode +
  351. '&id=' + item.id + '&type=1',
  352. });
  353. },
  354. goVideoUnprocessDetail(item) {
  355. uni.navigateTo({
  356. url: '/pages/processDetailVideo/processDetailVideo?companyCode=' + this.companyCode +
  357. '&id=' + item.id +
  358. '&type=2',
  359. });
  360. },
  361. goVideoProcessedDetail(item) {
  362. uni.navigateTo({
  363. url: '/pages/processDetailVideo/processDetailVideo?companyCode=' + this.companyCode +
  364. '&id=' + item.id +
  365. '&type=2',
  366. });
  367. },
  368. InputFocus(e) {
  369. this.InputBottom = e.detail.height
  370. },
  371. InputBlur(e) {
  372. this.InputBottom = 0
  373. },
  374. }
  375. }
  376. </script>
  377. <style lang="scss">
  378. .handle2scroll {
  379. // height: calc(100vh - 400rpx);
  380. // overflow-y: scroll;
  381. }
  382. //已处理未处理消息个数样式
  383. .nav .cu-item.cur {
  384. position: relative;
  385. border-bottom: 8rpx solid;
  386. }
  387. .cu-tag.badge {
  388. top: 14rpx;
  389. right: 96rpx;
  390. }
  391. .nav .cu-item {
  392. width: 50%;
  393. margin: 0;
  394. .text-blue,
  395. .line-blue,
  396. .lines-blue {
  397. color: #4274E7
  398. }
  399. }
  400. </style>