processList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  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. if(val==0){
  159. val='1,2,3,4'
  160. }
  161. this.getProcessData({
  162. "companyCode": this.companyCode,
  163. "type": this.type,
  164. "processingStatus": val
  165. }, this.TabCur);
  166. }
  167. },
  168. computed: {
  169. },
  170. onLoad: function(option) {
  171. console.log(option.type);
  172. console.log(option.companyCode);
  173. if (option.type == 1) {
  174. uni.setNavigationBarTitle({
  175. title: '电力检测'
  176. });
  177. } else {
  178. uni.setNavigationBarTitle({
  179. title: '视频告警'
  180. });
  181. }
  182. this.getProcessData({
  183. "companyCode": option.companyCode,
  184. "type": option.type,
  185. "processingStatus": "0"
  186. }, 0);
  187. console.log('onload里')
  188. this.companyCode = option.companyCode;
  189. this.processingStatus = 1
  190. this.type = option.type;
  191. },
  192. methods: {
  193. quickConfirm(){
  194. // alert( this.formMess.start_time)
  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(id) {
  286. uni.navigateTo({
  287. url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode +
  288. '&processingStatus=0&id=' + id +
  289. '&type=1',
  290. success: res => {},
  291. fail: () => {},
  292. complete: () => {}
  293. });
  294. },
  295. goVideoUnprocessDetail(id) {
  296. uni.navigateTo({
  297. url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode +
  298. '&processingStatus=0&id=' + id +
  299. '&type=2',
  300. success: res => {},
  301. fail: () => {},
  302. complete: () => {}
  303. });
  304. },
  305. goProcessedDetail(item) {
  306. uni.navigateTo({
  307. url: '/pages/processedDetail/processedDetail?companyCode=' + this.companyCode +
  308. '&handling_status=' + item.handling_status +
  309. '&id=' + item.id + '&type=1',
  310. success: res => {},
  311. fail: () => {},
  312. complete: () => {}
  313. });
  314. },
  315. goVideoProcessedDetail(id) {
  316. uni.navigateTo({
  317. url: '/pages/processedDetail/processedDetail?companyCode=' + this.companyCode +
  318. '&processingStatus=' + this.processingStatus +
  319. '&id=' + id + '&type=2',
  320. success: res => {},
  321. fail: () => {},
  322. complete: () => {}
  323. });
  324. },
  325. InputFocus(e) {
  326. this.InputBottom = e.detail.height
  327. },
  328. InputBlur(e) {
  329. this.InputBottom = 0
  330. },
  331. }
  332. }
  333. </script>
  334. <style lang="scss">
  335. .handle2scroll {
  336. height: calc(100vh - 400rpx);
  337. overflow: scroll;
  338. }
  339. //已处理未处理消息个数样式
  340. .nav .cu-item.cur {
  341. position: relative;
  342. border-bottom: 8rpx solid;
  343. }
  344. .cu-tag.badge {
  345. top: 14rpx;
  346. right: 96rpx;
  347. }
  348. .nav .cu-item {
  349. width: 50%;
  350. margin: 0;
  351. .text-blue,
  352. .line-blue,
  353. .lines-blue {
  354. color: #4274E7
  355. }
  356. }
  357. </style>