processList.vue 11 KB

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