EquipmentException.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <view class="billall">
  3. <u-cell-group class="toptemplate">
  4. <u-cell :title="mytitle" @click="floorchange">
  5. <u-icon slot="icon" size="40" color="#fff" name="map"></u-icon>
  6. <u-icon slot="right-icon" size="40" color="#fff" name="search"></u-icon>
  7. </u-cell>
  8. </u-cell-group>
  9. <view class="u-listdata">
  10. <view style="padding:16rpx 0 16rpx 32rpx">
  11. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  12. </view>
  13. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
  14. <u-list-item v-for="(item, index) in indexList" :key="index">
  15. <view class="companylist">
  16. <h3>{{item.deviceName}}</h3>
  17. <view class="Currentamount">
  18. 空间信息:跨境电商大厦-{{ item.positionInfo }}
  19. </view>
  20. <view class="Currentamount">
  21. 设备编号: {{ item.deviceId }}
  22. </view>
  23. <view class="Currentamount">
  24. 告警原因: <span>{{item.alertConfigName}}</span>
  25. </view>
  26. <view class="Currentamount">
  27. 告警内容: {{item.content}}
  28. </view>
  29. </view>
  30. </u-list-item>
  31. </u-list>
  32. </view>
  33. <u-picker :itemHeight="80" :show="showfloor" ref="uPicker" :loading="loading" @confirm="confirmfloor"
  34. @cancel='cancelfloor' :columns="columns" keyName="orgName" @change="changeHandler"></u-picker>
  35. <u-notify ref="uNotify" :show="showdct" message="服务器请求失败"></u-notify>
  36. </view>
  37. </template>
  38. <script>
  39. //import { isEmpty, getDictDataList } from "@/utils/index";
  40. export default {
  41. components: {
  42. },
  43. data() {
  44. return {
  45. totalnumber: 0,
  46. setyesno: true,
  47. indexList: [],
  48. dataList: [],
  49. dataForm: {
  50. buildingId: "",
  51. storeyId: "",
  52. // page: 1,
  53. // limit: 10,
  54. },
  55. pd: true,
  56. showtype: false,
  57. showdct: false,
  58. mytitle: '',
  59. alldata: [],
  60. showfloor: false,
  61. loading: false,
  62. columns: [],
  63. columnData: [],
  64. myday: '',
  65. mytype: '全部',
  66. showPicker: false,
  67. //myday: currentDate,
  68. columnstype: [
  69. ],
  70. }
  71. },
  72. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  73. onLoad() {
  74. // let getDictDataList = uni.getStorageSync('getDictDataList');
  75. //
  76. // for (let i = 0; i < getDictDataList.length; i++) {
  77. // if (getDictDataList[i].dictType == 'PayType') {
  78. // this.columnstype = [getDictDataList[i].dataList]
  79. // }
  80. // }
  81. this.getfloor();
  82. // this.loadmore();
  83. },
  84. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  85. onReady() {
  86. // 微信小程序需要用此写法
  87. },
  88. //监听页面隐藏
  89. onHide() {},
  90. //监听窗口尺寸变化
  91. onResize() {},
  92. //监听页面卸载
  93. onUnload() {},
  94. //监听用户下拉动作,一般用于下拉刷新
  95. onPullDownRefresh() {},
  96. methods: {
  97. scrolltolower() {
  98. if (this.pd) {
  99. this.getalldata();
  100. } else {
  101. return
  102. }
  103. },
  104. getalldata() {
  105. this.$api.get('/home/actualAlertList', this.dataForm)
  106. .then(res => {
  107. if (res.data.code == 0) {
  108. if (res.data.data == null) {
  109. this.totalnumber = 0;
  110. this.indexList = [];
  111. } else {
  112. this.totalnumber = res.data.data.length;
  113. this.indexList = res.data.data;
  114. }
  115. } else {
  116. uni.showToast({
  117. title: res.data.msg,
  118. icon: 'none',
  119. duration: 1500
  120. })
  121. }
  122. })
  123. },
  124. getfloor() {
  125. this.$api.get('/control/getOrgStructureTree/', {})
  126. .then(res => {
  127. if (res.data.code == 0) {
  128. this.mytitle = res.data.data[0].orgName;
  129. this.alldata = res.data.data[0].childrenList;
  130. this.columns = [
  131. res.data.data[0].childrenList,
  132. res.data.data[0].childrenList[0].childrenList
  133. ]
  134. let allfloor = [];
  135. for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
  136. allfloor.push(res.data.data[0].childrenList[i].childrenList)
  137. }
  138. this.columnData = allfloor;
  139. this.getalldata();
  140. } else {
  141. this.showdct = true
  142. }
  143. })
  144. },
  145. floorchange() {
  146. this.showfloor = true;
  147. },
  148. changeHandler(e) {
  149. const {
  150. columnIndex,
  151. index,
  152. // 微信小程序无法将picker实例传出来,只能通过ref操作
  153. picker = this.$refs.uPicker
  154. } = e
  155. if (columnIndex === 0) {
  156. this.loading = true
  157. picker.setColumnValues(1, this.columnData[index])
  158. this.loading = false
  159. }
  160. // this.getalldata();
  161. },
  162. confirmfloor(e) {
  163. console.log('222222', e.value)
  164. this.mytitle = e.value[0].orgName + e.value[1].orgName;
  165. this.dataForm.buildingId = e.value[0].orgId;
  166. this.dataForm.storeyId = e.value[1].orgId;
  167. this.showfloor = false;
  168. this.getalldata();
  169. },
  170. cancelfloor() {
  171. this.showfloor = false;
  172. },
  173. }
  174. }
  175. </script>
  176. <style lang="scss">
  177. .companylist {
  178. margin: 0 32rpx 24rpx;
  179. background: #fff;
  180. padding: 24rpx 32rpx;
  181. border-radius: 8rpx;
  182. position: relative;
  183. h3 {
  184. margin-bottom: 24rpx;
  185. }
  186. .Currentamount {
  187. margin-bottom: 4rpx;
  188. color: #999;
  189. span {
  190. color: #FA5555;
  191. padding-left: 9rpx;
  192. }
  193. }
  194. .outstanding{
  195. position: absolute;
  196. width:96rpx;
  197. height: 48rpx;
  198. border-radius: 0 8rpx 0 20rpx;
  199. right:0;
  200. line-height: 48rpx;
  201. text-align: center;
  202. top:0;
  203. z-index: 1;
  204. font-size: 22rpx;
  205. background-color:#30D3A2 ;
  206. color: #fff;
  207. &.PropertyFee{
  208. background-color:#30D3A2 ;
  209. }
  210. }
  211. }
  212. .topbill {
  213. display: flex;
  214. justify-content:center;
  215. align-items: center;
  216. height: 100rpx;
  217. background-color: #fff;
  218. .topbilledit {
  219. display: flex;
  220. justify-content: space-around;
  221. align-items: center;
  222. .changetime1 {
  223. padding-right: 10rpx;
  224. }
  225. }
  226. }
  227. </style>