processList.vue 11 KB

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