|
@@ -6,15 +6,23 @@
|
|
|
</u-picker-select>
|
|
|
|
|
|
<!-- 导航栏 -->
|
|
|
- <view class="navbar">
|
|
|
- <view class="title">
|
|
|
+ <view class="navbar">
|
|
|
+ <view class="title" v-if="companyInfotype==4">
|
|
|
+ 能源管理
|
|
|
+ <span style="padding-left: 4px;" >
|
|
|
+ |
|
|
|
+ </span>
|
|
|
+ <span style="padding-left: 4px;" >
|
|
|
+ {{companyInfo.name}}
|
|
|
+ </span>
|
|
|
+ </view>
|
|
|
+ <view class="title" v-else>
|
|
|
能源管理
|
|
|
<span style="padding-left: 4px;" v-if="companyList.length>=1&¤t!=0">
|
|
|
- -
|
|
|
+ |
|
|
|
</span>
|
|
|
<span style="padding-left: 4px;" v-if="companyList.length>=1&¤t!=0">
|
|
|
|
|
|
-
|
|
|
<template v-if="kWhList.length==1">
|
|
|
{{kWhList[0].name}}
|
|
|
</template>
|
|
@@ -22,14 +30,23 @@
|
|
|
{{merchantList1[current].name}}
|
|
|
</template>
|
|
|
</span>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
+ <view class="tabs-box tabs-box2" v-if="companyInfotype==4&&readingMeterNum&&monitorMeterNum" >
|
|
|
+
|
|
|
+ <view class="tabs2" :class="'tabs-len-2'"
|
|
|
+ :style="{width: '100%', }">
|
|
|
+ <u-tabs-one :gutter="32"
|
|
|
+ :list="companyInfotypeList" :is-scroll="false" active-color="#fff" inactive-color="#CCE2FF"
|
|
|
+ bg-color="#1677FF" :current="1" @change="companyInfotypeChange"></u-tabs-one>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- 标签 -->
|
|
|
- <view class="tabs-box" >
|
|
|
+ <view class="tabs-box" v-else >
|
|
|
|
|
|
<view class="tabs" :class="'tabs-len-'+merchantList1.length" v-show="companyList.length>1"
|
|
|
:style="{width: companyList.length>3 ? '' : '100%'}">
|
|
@@ -463,7 +480,17 @@
|
|
|
codes: '', // 判断:reading用电量 detector设备数据检测
|
|
|
merchantList1: [], // 商户
|
|
|
merchantList2: [],
|
|
|
- companyList: [],
|
|
|
+ companyList: [],
|
|
|
+ companyInfo:{},
|
|
|
+ companyInfotypeCurrent:1,
|
|
|
+ companyInfotypeList:[
|
|
|
+ {
|
|
|
+ name: '变压器巡检仪'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '费控电表剂量仪'
|
|
|
+ }
|
|
|
+ ],
|
|
|
popShow: false,
|
|
|
popShowtest: true,
|
|
|
current: 0,
|
|
@@ -535,7 +562,10 @@
|
|
|
companyType:0,
|
|
|
incomeExpenditureObj:{},
|
|
|
getHomePageKwhshowLoading:false,
|
|
|
- getHomePageManageshowLoading:false,
|
|
|
+ getHomePageManageshowLoading:false,
|
|
|
+ companyInfotype:0,
|
|
|
+ readingMeterNum:0, //计量仪
|
|
|
+ monitorMeterNum:0, //巡检仪
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -546,7 +576,7 @@
|
|
|
this.endYear = new Date().getFullYear();
|
|
|
this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
|
|
|
|
|
|
-
|
|
|
+ this.getfindByOpenId();
|
|
|
this.getCompanyInfoList();
|
|
|
|
|
|
|
|
@@ -578,6 +608,40 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //绑定权限
|
|
|
+ getfindByOpenId() {
|
|
|
+
|
|
|
+ API_index.findByOpenId({
|
|
|
+ openId: this.carhelp.getOpenId()
|
|
|
+ }).then((response) => {
|
|
|
+ if(response.data&&response.data.companyInfo){
|
|
|
+ this.companyInfo=response.data.companyInfo
|
|
|
+ this.companyInfotype = response.data.companyInfo.type;
|
|
|
+ if(this.companyInfotype==4){
|
|
|
+ this.getFindMeterList()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getFindMeterList(){
|
|
|
+
|
|
|
+ API.findMeterList().then((response) => {
|
|
|
+ //readingMeterNum 计量仪
//monitorMeterNum 巡检仪
|
|
|
+ this.readingMeterNum=response.data.readingMeterNum
|
|
|
+ this.monitorMeterNum=response.data.monitorMeterNum
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
companyIdSet(val,item){
|
|
|
this.companyType= 0
|
|
|
if(val&&item){
|
|
@@ -801,6 +865,25 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+ },
|
|
|
+ companyInfotypeChange(index){
|
|
|
+ if(index!=this.companyInfotypeCurrent){
|
|
|
+ var url=""
|
|
|
+ if(process.car.NODE_ENV=='dev'){
|
|
|
+
|
|
|
+ url='http://localhost:8081/#/'
|
|
|
+
|
|
|
+ }else if(process.car.NODE_ENV=='test'){
|
|
|
+
|
|
|
+ url='https://dgj.hbjp.com.cn/charging-prod/jp-housekeep-electric-test/#/'
|
|
|
+
|
|
|
+ }else{
|
|
|
+ url='https://dgj.hbjp.com.cn/charging-prod/jp-housekeep-electric/#/'
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ window.location.href=url+"pages/statistics/statistics"
|
|
|
+ }
|
|
|
},
|
|
|
change(index) {
|
|
|
this.current = index;
|
|
@@ -1256,11 +1339,14 @@
|
|
|
max-width: 26% !important;
|
|
|
flex: none !important;
|
|
|
}
|
|
|
- }
|
|
|
- /deep/.u-tab-item:first-child {
|
|
|
- width: 20% !important;
|
|
|
- flex: none !important;
|
|
|
}
|
|
|
+ .tabs{
|
|
|
+ /deep/.u-tab-item:first-child {
|
|
|
+ width: 20% !important;
|
|
|
+ flex: none !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// /deep/.u-tab-item2 {
|
|
|
// width: 33% !important;
|
|
|
// flex: none !important;
|