123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- <template>
- <view class="billall">
- <u-cell-group class="toptemplate">
- <u-cell :title="mytitle" @click="floorchange">
- <u-icon slot="icon" size="40" color="#fff" name="map"></u-icon>
- <u-icon slot="right-icon" size="40" color="#fff" name="search"></u-icon>
- </u-cell>
- </u-cell-group>
- <view class="u-listdata">
- <view style="padding:10rpx 0 0 30rpx">
- 共有 <span style="color: red">{{totalnumber}}</span>条记录
- </view>
- <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
- <u-list-item v-for="(item, index) in indexList" :key="index">
- <view class="companylist" >
- <h3>{{item.deviceName}}</h3>
- <view class="Currentamount">
- 空间信息:跨境电商大厦-{{ item.positionInfo }}
- </view>
- <view class="Currentamount">
- 设备编号: {{ item.deviceId }}
- </view>
- <view class="Currentamount">
- 告警原因: <span>{{item.alertConfigName}}</span>
- </view>
- <view class="Currentamount">
- 告警内容: {{item.content}}
- </view>
- </view>
- </u-list-item>
- </u-list>
- </view>
- <u-picker :itemHeight="80" :show="showfloor" ref="uPicker" :loading="loading" @confirm="confirmfloor" @cancel='cancelfloor'
- :columns="columns" keyName="orgName" @change="changeHandler"></u-picker>
- <u-notify ref="uNotify" :show="showdct" message="服务器请求失败"></u-notify>
- </view>
- </template>
- <script>
-
- export default {
- components: {
- },
- data() {
- return {
- totalnumber: 0,
- setyesno: true,
- indexList: [],
- dataList: [],
- dataForm: {
- buildingId: "",
- storeyId: "",
-
-
- },
- pd: true,
- showtype: false,
- showdct: false,
- mytitle: '',
- alldata: [],
- showfloor: false,
- loading: false,
- columns: [],
- columnData: [],
- myday: '',
- mytype: '全部',
- showPicker: false,
-
- columnstype: [
- ],
- }
- },
-
- onLoad() {
-
-
-
-
-
-
-
- this.getfloor();
-
- },
-
- onReady() {
-
- },
-
- onHide() {},
-
- onResize() {},
-
- onUnload() {},
-
- onPullDownRefresh() {},
- methods: {
- scrolltolower() {
- if (this.pd) {
- this.getalldata();
- } else {
- return
- }
- },
- getalldata() {
- this.$api.get('/home/actualAlertList', this.dataForm)
- .then(res => {
-
- if(res.data.code==0){
- console.log('111111111111111111',res.data.data)
- if(res.data.data==null){
- this.totalnumber=0;
- this.indexList=[];
- }else{
- this.totalnumber=res.data.data.length;
- this.indexList=res.data.data;
- }
- }else{
- uni.showToast({
- title: res.data.msg,
- icon: 'none',
- duration: 1500
- })
- }
-
-
-
-
-
-
-
-
-
-
-
-
- })
- },
- getfloor() {
- this.$api.get('/control/getOrgStructureTree/', {})
- .then(res => {
- if (res.data.code == 0) {
-
- this.mytitle = res.data.data[0].orgName;
- this.alldata = res.data.data[0].childrenList;
-
- this.columns = [
- res.data.data[0].childrenList,
- res.data.data[0].childrenList[0].childrenList
- ]
- let allfloor = [];
- for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
- allfloor.push(res.data.data[0].childrenList[i].childrenList)
- }
-
- this.columnData = allfloor;
-
- this.getalldata();
- } else {
- this.showdct = true
- }
- })
- },
- floorchange() {
- this.showfloor = true;
- },
- changeHandler(e) {
- const {
- columnIndex,
- index,
-
- picker = this.$refs.uPicker
- } = e
- if (columnIndex === 0) {
- this.loading = true
- picker.setColumnValues(1, this.columnData[index])
- this.loading = false
- }
-
- },
- confirmfloor(e) {
- console.log('222222', e.value)
- this.mytitle = e.value[0].orgName + e.value[1].orgName;
- this.dataForm.buildingId = e.value[0].orgId;
- this.dataForm.storeyId = e.value[1].orgId;
- this.showfloor = false;
- this.getalldata();
- },
- cancelfloor() {
- this.showfloor = false;
- },
- }
- }
- </script>
- <style lang="scss">
- .Currentamount {
- padding-left: 30rpx;
- height: 50rpx;
- line-height: 50rpx;
- color: #BCB3A7;
- span {
- color: #FA5555;
- padding-left: 9rpx;
- }
- }
- .Callfee {
- width: 100rpx;
- height: 45rpx;
- text-align: center;
- line-height: 45rpx;
- color: #5C8FFF;
- border: 1px solid #5C8FFF;
- font-size: 22rpx;
- position: absolute;
- bottom: 10rpx;
- right: 10px;
- font-weight: bold;
- }
- .companylist {
- margin: 20rpx 30rpx;
- background: #fff;
- height: 280rpx;
- border-radius: 10px;
- position: relative;
- h3 {
- height: 70rpx;
- line-height: 70rpx;
- padding-left: 30rpx;
- }
- }
- .settled {
- background-color: #09C700;
- width: 100rpx;
- height: 40rpx;
- text-align: center;
- line-height: 40rpx;
- color: #fff;
- font-size: 14rpx;
- position: absolute;
- top: 0px;
- right: 0px;
- border-top-right-radius: 10rpx;
- border-bottom-left-radius: 10rpx;
- }
- .outstanding {
- background-color: #30D3A2;
- width: 100rpx;
- height: 40rpx;
- text-align: center;
- line-height: 40rpx;
- color: #fff;
- font-size: 14rpx;
- position: absolute;
- top: 0px;
- right: 0px;
- border-top-right-radius: 10rpx;
- border-bottom-left-radius: 10rpx;
- }
- .billall {}
- .topbill {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100rpx;
- background-color: #e6e6e6;
- }
- .topbilledit {
- display: flex;
- justify-content: space-around;
- align-items: center;
- }
- .changetime1 {
- padding-right: 10rpx;
- }
- </style>
|