|
@@ -9,7 +9,12 @@
|
|
|
<image class="img" src="@/assets/img/refresh-line.svg" @click="getList(true)"></image>
|
|
|
</view>
|
|
|
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
+ <u-select title="" v-model="tabsFrom.show1" :defaultValue="[current2]"
|
|
|
+ :list="childList" value-name="id" label-name="name"
|
|
|
+ @confirm="selector1confirm" >
|
|
|
+ </u-select>
|
|
|
+
|
|
|
<u-picker-select title="日期选择" v-model="tabsFrom.show2" :defaultTime="tabsFrom.show2Index" :endYear="endYear"
|
|
|
mode="time" :params="params" :noselect="false" @confirm="selector2confirm" @cancel="selector2cancel"
|
|
|
@reset="selector2reset"></u-picker-select>
|
|
@@ -44,11 +49,23 @@
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
|
|
|
-
|
|
|
+ <view class="electronicMonitoring-title"
|
|
|
+ @click="titleCk"
|
|
|
+ v-if="childList&&childList.length>0" >
|
|
|
+ <view>
|
|
|
+ {{childListName}}
|
|
|
+ </view>
|
|
|
+ <view v-show="childList.length>1">
|
|
|
+ <u-icon name="arrow-down" color="#fff"></u-icon>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
|
|
|
<!-- 全部标签 -->
|
|
|
- <view class="main" v-show="current==0" >
|
|
|
- <view class="item" v-for="(item, index) in kWhListHome" :key="item.index" v-if="current==0"
|
|
|
+ <view class="main" >
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <view class="item" v-for="(item, index) in kWhList" :key="item.index"
|
|
|
@click="toElectronicMonitoring(item)">
|
|
|
<view class="item-content">
|
|
|
<view class="equipment">
|
|
@@ -101,110 +118,9 @@
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
- <u-divider v-show="current==0" :isnone="kWhListHome.length==0" nonetext="暂无数据" border-color="#CFD2D5">已经到底了</u-divider>
|
|
|
+ <u-divider :isnone="kWhList.length==0" nonetext="暂无数据" border-color="#CFD2D5">已经到底了</u-divider>
|
|
|
|
|
|
- <view class="content" v-show="kWhList.length==1" style="padding: 0;">
|
|
|
-
|
|
|
- <electronicMonitoring v-show="kWhList.length" :ref="'refMyEm'+companyId"></electronicMonitoring>
|
|
|
-
|
|
|
- <u-divider :isnone="kWhList.length==0" nonetext="暂无数据" border-color="#CFD2D5">已经到底了</u-divider>
|
|
|
-
|
|
|
- </view>
|
|
|
|
|
|
- <view v-show="kWhList.length!=1">
|
|
|
- <!-- 子项标签 -->
|
|
|
- <view class="content"
|
|
|
- v-if="!getHomePageManageshowLoading&¤t!=0">
|
|
|
-
|
|
|
- <div class="uni-toast" style="display: flex;font-size: 60rpx; color: rgb(192, 196, 204);" >
|
|
|
- <i class="uni-icon_toast uni-loading"
|
|
|
- style="
|
|
|
- width: 80rpx;
|
|
|
- height: 80rpx;
|
|
|
-
|
|
|
- "
|
|
|
- ></i><p class="uni-toast__content"> </p>加载中...</div>
|
|
|
-
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="content" v-else-if="getHomePageManageshowLoading&&meterList.length == 0&¤t!=0">
|
|
|
- <u-divider :isnone="true" nonetext="无记录"
|
|
|
- border-color="#fff"></u-divider>
|
|
|
- </view>
|
|
|
- <view class="statistics-manage" v-show="current!=0&&getHomePageManageshowLoading" >
|
|
|
-
|
|
|
-
|
|
|
- <!-- 图表 -->
|
|
|
- <view class="chart">
|
|
|
- <view class="u-subsection">
|
|
|
- <u-subsection :list="list" :current="homePageManageType" @change="sectionChange" font-size="24"></u-subsection>
|
|
|
- </view>
|
|
|
- <view class="incomeExpenditureClass" v-show="companyType!=4&&homePageManageObj.showPark" >
|
|
|
- <view class="income1">
|
|
|
- <view class="income11">
|
|
|
- 电费支出 (元)
|
|
|
- </view>
|
|
|
- <view class="income12">
|
|
|
- {{incomeExpenditureObj.expenditureFee}}
|
|
|
- <span class="income121" v-if="!incomeExpenditureObj.id">加载中...</span>
|
|
|
-
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="income1">
|
|
|
- <view class="income11">
|
|
|
- 电费收入 (元)
|
|
|
- </view>
|
|
|
- <view class="income12">
|
|
|
- {{incomeExpenditureObj.incomeFee}}
|
|
|
- <span class="income121" v-if="!incomeExpenditureObj.id">加载中...</span>
|
|
|
-
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="income1">
|
|
|
- <view class="income11">
|
|
|
- 收支情况 (元)
|
|
|
- </view>
|
|
|
- <view class="income12" :style="incomeExpenditureObj.differenceFee>=0?'color:red':'color:#52b8aa'">
|
|
|
- {{incomeExpenditureObj.differenceFee}}
|
|
|
- <span class="income121" v-if="!incomeExpenditureObj.id">加载中...</span>
|
|
|
-
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- </view>
|
|
|
- <view class="chat-box" id="barEcharts-statistics" v-show="companyType!=4&&homePageManageObj.showPark">
|
|
|
-
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="search" v-if="0">
|
|
|
- <view class="switch">
|
|
|
- <u-switch v-model="checked" size="40"></u-switch><text>只看离线表</text>
|
|
|
- </view>
|
|
|
- <view class="search-box" >
|
|
|
- <input type="text" placeholder="请输入电表查询" />
|
|
|
- <view class="icon">
|
|
|
- <img src="@/assets/img/riLine-search-line 1.svg" alt="" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 电表统计 -->
|
|
|
- <Tree-Body :meterList="meterList" ref="mytree"
|
|
|
- @query="getHomePageManageChildMeter"
|
|
|
- :showPark="homePageManageObj.showPark"
|
|
|
- v-if="getHomePageManageReady"
|
|
|
- :role="codes&&codes.indexOf('switch')!=-1"
|
|
|
- @switchBtn="switchBtnApi"
|
|
|
- ></Tree-Body>
|
|
|
-
|
|
|
-
|
|
|
- </view>
|
|
|
-
|
|
|
- <u-divider nonetext="无记录" v-show="current!=0&&getHomePageManageshowLoading"
|
|
|
- border-color="#CFD2D5">已经到底了</u-divider>
|
|
|
- </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -249,7 +165,7 @@
|
|
|
meterListShow:{},
|
|
|
queryDate: '',
|
|
|
kWhList: [], //设备
|
|
|
- kWhListHome: [], //设备
|
|
|
+
|
|
|
companyId: '',
|
|
|
popShow: false,
|
|
|
current: 0,
|
|
@@ -307,13 +223,26 @@
|
|
|
utabsone:true,
|
|
|
companyType:0,
|
|
|
incomeExpenditureObj:{},
|
|
|
- opCompanyId: '',
|
|
|
+ opCompanyId: '',
|
|
|
+ childList:[],
|
|
|
+ companyListMain:[],
|
|
|
+ current2:0,
|
|
|
+ childInfo:{},
|
|
|
+ companyInfo:{}
|
|
|
}
|
|
|
},
|
|
|
onReady() {
|
|
|
|
|
|
|
|
|
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ childListName(){
|
|
|
+ return this.childInfo.name;
|
|
|
+ },
|
|
|
+ companyType(){
|
|
|
+ return this.companyInfo.type;
|
|
|
+ }
|
|
|
},
|
|
|
onLoad(op) {
|
|
|
this.endYear = new Date().getFullYear();
|
|
@@ -325,19 +254,38 @@
|
|
|
this.companyId=op.companyId
|
|
|
|
|
|
}
|
|
|
- // else{
|
|
|
- // this.getCompanyInfoList();
|
|
|
- // }
|
|
|
+ else{
|
|
|
+ this.getCompanyInfoList();
|
|
|
+ }
|
|
|
this.getList();
|
|
|
|
|
|
},
|
|
|
onReachBottom() {
|
|
|
- if (this.current==0&&this.kWhListHome.length < this.recordsTotal) {
|
|
|
+ if (this.kWhList.length < this.recordsTotal) {
|
|
|
this.myLoadmore();
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
+ titleCk() {
|
|
|
+ if(this.childList.length>1){
|
|
|
+ this.tabsFrom.show1 = true
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ selector1confirm(e) {
|
|
|
+ //this.getHomePageKwh()
|
|
|
+
|
|
|
+ console.log(e)
|
|
|
+ this.companyId=e[0].value
|
|
|
+
|
|
|
+ this.current2=e[0].i
|
|
|
+
|
|
|
+ this.childInfo=this.childList[this.current2];
|
|
|
+ uni.showLoading()
|
|
|
+
|
|
|
+ this.merchantChangeApi()
|
|
|
+ },
|
|
|
companyIdSet(val,item){
|
|
|
|
|
|
this.companyType= 0
|
|
@@ -395,11 +343,12 @@
|
|
|
console.log(node,key)
|
|
|
},
|
|
|
refreshList() {
|
|
|
- if (this.current != 0) {
|
|
|
- this.getList(true);
|
|
|
- } else {
|
|
|
- this.getCompanyInfoList();
|
|
|
- }
|
|
|
+ // if (this.current != 0) {
|
|
|
+
|
|
|
+ // } else {
|
|
|
+ // this.getCompanyInfoList();
|
|
|
+ // }
|
|
|
+ this.getList(true);
|
|
|
},
|
|
|
companyChange(item, index) {
|
|
|
this.current = index + 1;
|
|
@@ -412,9 +361,15 @@
|
|
|
this.companyKwhList = [];
|
|
|
|
|
|
API.deviceCompanyList().then((response) => {
|
|
|
- var list = response.data.companyInfoList;
|
|
|
+ var list = response.data.companyInfoList;
|
|
|
+ this.companyListMain=response.data.companyInfoList;
|
|
|
+ if(list.length==1&&list[0].childList&&list[0].childList.length){
|
|
|
+ list=list[0].childList
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
this.companyList = list;
|
|
|
-
|
|
|
+
|
|
|
var mList1 = [];
|
|
|
var mList2 = [];
|
|
|
mList1.push({
|
|
@@ -435,8 +390,8 @@
|
|
|
this.merchantList1 = mList1;
|
|
|
this.merchantList2 = mList2;
|
|
|
this.companyId = mList1[0].id;
|
|
|
- this.companyIdSet(this.companyId)
|
|
|
- this.getList();
|
|
|
+ //this.companyIdSet(this.companyId)
|
|
|
+ //this.getList();
|
|
|
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
@@ -456,7 +411,7 @@
|
|
|
mask: true,
|
|
|
})
|
|
|
if (bl) {
|
|
|
- this.kWhListHome = [];
|
|
|
+ this.kWhList = [];
|
|
|
this.pageIndex = 1;
|
|
|
}
|
|
|
var data = {
|
|
@@ -466,8 +421,8 @@
|
|
|
};
|
|
|
API.homePageKwh(data).then((res) => {
|
|
|
uni.hideLoading();
|
|
|
- this.kWhListHome = [
|
|
|
- ...this.kWhListHome,
|
|
|
+ this.kWhList = [
|
|
|
+ ...this.kWhList,
|
|
|
...res.data.data
|
|
|
];
|
|
|
this.recordsTotal = res.data.recordsTotal;
|
|
@@ -480,59 +435,39 @@
|
|
|
},
|
|
|
getHomePageKwh(companyId) {
|
|
|
|
|
|
- uni.showLoading({
|
|
|
- title: "加载中",
|
|
|
- mask: true,
|
|
|
- })
|
|
|
|
|
|
- var data = {
|
|
|
- pageIndex: this.pageIndex,
|
|
|
- pageSize: 20,
|
|
|
- companyId: companyId
|
|
|
- };
|
|
|
- API.homePageKwh(data).then((res) => {
|
|
|
- uni.hideLoading();
|
|
|
- this.kWhList =res.data.data;
|
|
|
- //this.recordsTotal = res.data.recordsTotal;
|
|
|
- if(this.kWhList.length==1){
|
|
|
-
|
|
|
- var item=this.kWhList[0];
|
|
|
- this.$refs['refMyEm'+companyId].init({
|
|
|
- id:item.id,
|
|
|
- name:item.name,
|
|
|
- companyId:item.companyId,
|
|
|
- ref:1,
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.getHomePageManage(1)
|
|
|
- //this.getDeviceStatus()
|
|
|
- //this.getAbnormalAlarmRecord();
|
|
|
- }
|
|
|
-
|
|
|
- }).catch(error => {
|
|
|
- uni.showToast({
|
|
|
- title: error,
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- })
|
|
|
},
|
|
|
merchantChange(item, index) {
|
|
|
- if(this.current==0){
|
|
|
- this.current=1;
|
|
|
- }
|
|
|
- this.utabsone=false
|
|
|
- var m = item;
|
|
|
- var n = this.merchantList1[this.current];
|
|
|
- this.merchantList1[this.current] = m;
|
|
|
- this.merchantList2[index] = n;
|
|
|
- this.companyId = item.id;
|
|
|
- this.companyIdSet(this.companyId)
|
|
|
+ if(this.current==0){
|
|
|
+ this.current=1;
|
|
|
+ }
|
|
|
+ var m = company;
|
|
|
+ var n = this.merchantList1[this.current];
|
|
|
+ this.merchantList1[this.current] = m;
|
|
|
+ this.merchantList2[index] = n;
|
|
|
+ //this.$forceUpdate()
|
|
|
+ this.utabsone=false
|
|
|
+ this.companyId = company.id;
|
|
|
+
|
|
|
+ this.companyInfo=company
|
|
|
+
|
|
|
+
|
|
|
+ if(company.id!=''){
|
|
|
+ this.childList=company.childList;
|
|
|
+ if(this.childList&&this.childList.length){
|
|
|
+ this.companyId = this.childList[0].id;
|
|
|
+ this.childInfo=this.childList[0]
|
|
|
+ }else{
|
|
|
+ this.childList=[]
|
|
|
+ this.companyId =company.id
|
|
|
+ this.childInfo=company
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.companyId =''
|
|
|
+ }
|
|
|
+
|
|
|
+ this.merchantChangeApi()
|
|
|
this.popShow = false;
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.utabsone=true
|
|
|
- })
|
|
|
- //this.getList(true);
|
|
|
- this.merchantChangeApi()
|
|
|
|
|
|
},
|
|
|
|
|
@@ -856,22 +791,33 @@
|
|
|
merchantChangeApi() {
|
|
|
|
|
|
this.popShow=false
|
|
|
- if (this.companyId) {
|
|
|
-
|
|
|
- this.getHomePageKwh(this.companyId)
|
|
|
-
|
|
|
-
|
|
|
- }else{
|
|
|
- this.kWhList=[]
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
+ this.getList(true)
|
|
|
|
|
|
},
|
|
|
change(index) {
|
|
|
- this.current = index;
|
|
|
- this.companyId = this.merchantList1[index].id;
|
|
|
- this.companyIdSet(this.companyId)
|
|
|
+ this.current = index;
|
|
|
+ this.current2=0;
|
|
|
+ this.childList=[]
|
|
|
+ var company= this.merchantList1[index]
|
|
|
+ if(company.id!=''){
|
|
|
+ this.childList=company.childList;
|
|
|
+ if(this.childList&&this.childList.length){
|
|
|
+ this.companyId = this.childList[0].id;
|
|
|
+ this.childInfo=this.childList[0]
|
|
|
+ }else{
|
|
|
+ this.childList=[]
|
|
|
+ this.companyId =company.id
|
|
|
+ this.childInfo=company
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.companyId =''
|
|
|
+
|
|
|
+ }
|
|
|
+ this.companyInfo=company;
|
|
|
+
|
|
|
this.merchantChangeApi()
|
|
|
},
|
|
|
backStatistics() {
|
|
@@ -1394,5 +1340,17 @@
|
|
|
margin-top: 24rpx;
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+ .electronicMonitoring-title{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0px 32rpx;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 120rpx;
|
|
|
+ font-size: 36rpx;
|
|
|
+background-color: rgba(22,119,255,1);
|
|
|
+color:#fff;
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
</style>
|