userAlarm.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view>
  3. <!-- @click="openPop(item)" -->
  4. <view class="order-item" v-for="item,index in groupList" >
  5. <view class="ddflex order-item-header">
  6. <view class="order-time">{{item.createDate}}</view>
  7. <block>
  8. <view v-if="item.status!=1" class="order-state">待处理</view>
  9. <view v-else class="order-state" style="color: #0FCB27;border: 2rpx solid #0FCB27;">已处理</view>
  10. </block>
  11. </view>
  12. <view class="order-item-body">
  13. <view class="order-item-content ddflex">
  14. <view class="order-item-content-label">机柜编号</view>
  15. <view class="order-item-content-data fflex tover">{{item.devId}}</view>
  16. </view>
  17. <view class="order-item-content ddflex">
  18. <view class="order-item-content-label">电池ID</view>
  19. <view class="order-item-content-data fflex tover">{{item.batteryId}}</view>
  20. </view>
  21. <view class="order-item-content ddflex">
  22. <view class="order-item-content-label">报障问题</view>
  23. <view class="order-item-content-data fflex tover">{{item.type}}</view>
  24. </view>
  25. </view>
  26. <view class="order-item-body2">
  27. <view class="order-item-content-label">问题补充描述</view>
  28. <view class="order-item-content ddflex" style="font-size: 24rpx;font-weight: 400;">
  29. {{item.content}}
  30. </view>
  31. <view class="images-box ddflex">
  32. <image class="images" v-for="it in imageList" :src="it"></image>
  33. </view>
  34. </view>
  35. <view v-if="item.status!=1" class="order-btns ddflex">
  36. <view style="justify-content: flex-end;" class="ddflex">
  37. <view class="order-btn" @click.stop="deal(item,index)">去处理</view>
  38. </view>
  39. </view>
  40. </view>
  41. <bottom-pop v-if="showPop" :showPop='showPop' :btnColor="'#11BB8B'" :showBtn='false' title="解除提醒"
  42. @closePop="closePop()" @popSubmit="popSubmit()">
  43. <view>
  44. <view>
  45. <image class="nodata-icon" src="../../static/pages/images/alarmUpload.png"></image>
  46. <view class="nodata-note">上传检修记录,恢复正常</view>
  47. </view>
  48. <view class="pop-btns ddflex">
  49. <view class="btn" @click="closePop">取消</view>
  50. <view class="btn2" @click="jumpUrl('warning/userAlarmUpload/userAlarmUpload')">上传检修记录</view>
  51. </view>
  52. </view>
  53. </bottom-pop>
  54. </view>
  55. </template>
  56. <script>
  57. const app = getApp();
  58. const req = require("../../utils/request.js");
  59. import bottomPop from "../../components/bottom-pop/index";
  60. export default {
  61. components: {
  62. bottomPop
  63. },
  64. props: {},
  65. data() {
  66. return {
  67. showPop: false,
  68. tempData: null,
  69. groupList: [],
  70. page: 1,
  71. limit: 10,
  72. searchValue:'',
  73. isQuerying:false,//正在查询数据
  74. }
  75. },
  76. onLoad(options) {
  77. this.getMachineList()
  78. },
  79. onShow() {
  80. },
  81. onReachBottom() {
  82. this.getMachineList(true)
  83. },
  84. methods: {
  85. jumpUrl(url) {
  86. if (!req.isLogin()) return false;
  87. app.globalData.navigateTo(url);
  88. },
  89. // 弹窗弹出
  90. openPop(item) {
  91. this.tempData = JSON.parse(JSON.stringify(item))
  92. this.showPop = true
  93. },
  94. // 弹窗关闭
  95. closePop() {
  96. this.showPop = false
  97. this.tempData = null
  98. },
  99. // 弹窗确认
  100. popSubmit() {
  101. this.closePop()
  102. },
  103. // 获取机柜列表
  104. getMachineList(isPage){
  105. if(this.isQuerying) return
  106. else this.isQuerying = true
  107. if (!isPage) {
  108. this.page = 1
  109. }
  110. let queryParams = {
  111. page: this.page,
  112. limit: this.limit,
  113. }
  114. req.getRequest(
  115. '/admin/v2/alarm/userAlarmPage',
  116. queryParams,
  117. data => {
  118. if (data != null && data.list.length > 0) {
  119. if (!isPage) {
  120. this.groupList = data.list
  121. } else {
  122. this.groupList = this.groupList.concat(data.list)
  123. }
  124. this.page++
  125. } else {
  126. if (!isPage)
  127. this.groupList = data.list
  128. else {}
  129. }
  130. uni.hideLoading()
  131. this.isQuerying = false
  132. }
  133. )
  134. },
  135. // 处理
  136. deal(item,index){
  137. uni.showModal({
  138. title:'提示',
  139. content:'请确认故障是否已解除',
  140. success(res) {
  141. if(res.confirm){
  142. req.getRequest('/admin/v2/alarm/'+item.id,{},data=>{
  143. req.msg('故障已解除')
  144. item.status = 1
  145. })
  146. }
  147. }
  148. })
  149. }
  150. },
  151. mounted() {
  152. },
  153. onPageScroll: function(e) {
  154. }
  155. }
  156. </script>
  157. <style>
  158. @import "./userAlarm.css";
  159. </style>