reconditionAlarm.vue 3.6 KB

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