|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view>
|
|
|
|
|
|
|
+ <view style="overflow: hidden;">
|
|
|
<view class="top-box">
|
|
<view class="top-box">
|
|
|
<view class="top-title ddflex">
|
|
<view class="top-title ddflex">
|
|
|
<view :style="'height: '+ systems.navigationHeight+'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'" class="ddflex" @click="goback">
|
|
<view :style="'height: '+ systems.navigationHeight+'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'" class="ddflex" @click="goback">
|
|
@@ -11,46 +11,95 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view v-else :style="'height: '+ systems.navigationHeight + 'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'+'line-height: '+ systems.navigationHeight + 'rpx;'">设备</view>
|
|
<view v-else :style="'height: '+ systems.navigationHeight + 'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'+'line-height: '+ systems.navigationHeight + 'rpx;'">设备</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="search-box ddflex">
|
|
|
|
|
- <image class="search-saoma" src="../../static/pages/images/saoma.png" @click="saomaFn()"></image>
|
|
|
|
|
- <view class="search-input ddflex fflex">
|
|
|
|
|
- <image class="search-input-icon" src="../../static/pages/images/search.png"></image>
|
|
|
|
|
- <input class="fflex" v-model="searchValue" confirm-type="search" @confirm="searchFn" placeholder="请输入编号查询"/>
|
|
|
|
|
- <view class="search-btn" @click="searchFn">搜索</view>
|
|
|
|
|
|
|
+ <view class="tab-box ddflex">
|
|
|
|
|
+ <view class="fflex ddflex">
|
|
|
|
|
+ <view :class="'tab-item fflex '+(queryType==''?'tab-item-active':'')" @click="queryTypeChange(-1)">
|
|
|
|
|
+ <view>全部</view>
|
|
|
|
|
+ <image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view :class="'tab-item fflex '+(queryType==2?'tab-item-active':'')" @click="queryTypeChange(2)">
|
|
|
|
|
+ <view>未租</view>
|
|
|
|
|
+ <image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view :class="'tab-item fflex '+(queryType==1?'tab-item-active':'')" @click="queryTypeChange(1)">
|
|
|
|
|
+ <view>已租</view>
|
|
|
|
|
+ <image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="ddflex">
|
|
|
|
|
+ <image class="saoma" src="../../static/pages/images/saoma.png" @click="saomaFn()"></image>
|
|
|
|
|
+ <image class="sousuo" src="../../static/pages/images/search.png" @click="jumpUrl('/machineAndCell/cellSearch/cellSearch?storeId='+actMerchant.id+'&type='+queryType)"></image>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <view :style="'height: '+ (systems.navigationHeight+systems.ktxStatusHeight+134) + 'rpx;'"></view>
|
|
|
|
|
|
|
+ <view :style="'height: '+ (systems.navigationHeight+systems.ktxStatusHeight+106) + 'rpx;'"></view>
|
|
|
|
|
|
|
|
- <!-- 机柜 -->
|
|
|
|
|
- <view class="machine-item" v-for="item,index in groupList" @click="jumpUrl('/machineAndCell/machineInfo/machineInfo?id='+item.devId)">
|
|
|
|
|
- <view class="ddflex" style="justify-content: space-between;">
|
|
|
|
|
- <view class="machine-title fflex tover">{{item.devName}}</view>
|
|
|
|
|
- <!-- <view class="state">在线</view> -->
|
|
|
|
|
|
|
+ <view class="ddflex state-box">
|
|
|
|
|
+ <view class="state-item">
|
|
|
|
|
+ <view class="ddflex">
|
|
|
|
|
+ <view class="icon"></view>
|
|
|
|
|
+ <view class="state-label">租赁中</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="ddflex state-data">
|
|
|
|
|
+ <view>{{count.leaseCount?count.leaseCount:0}}</view>
|
|
|
|
|
+ <view>{{getP(1)}}%</view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="machine-number">机柜编号:{{item.devId}}</view>
|
|
|
|
|
- <view class="machine-info ddflex">
|
|
|
|
|
|
|
+ <view class="state-item">
|
|
|
<view class="ddflex">
|
|
<view class="ddflex">
|
|
|
- <view class="margin-r40">温度:{{item.cabTemp?item.cabTemp:0}}℃</view>
|
|
|
|
|
- <view class="margin-r40">仓门数:{{item.doorCount?item.doorCount:0}}</view>
|
|
|
|
|
- <view class="margin-r40">电池数:{{item.batNum?item.batNum:0}}</view>
|
|
|
|
|
|
|
+ <view class="icon" style="background: #0FCB27;"></view>
|
|
|
|
|
+ <view class="state-label">空闲</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="fflex tover" style="color: #2A82E4;text-align: right;">
|
|
|
|
|
- {{item.storeName?item.storeName:''}}
|
|
|
|
|
|
|
+ <view class="ddflex fflex state-data">
|
|
|
|
|
+ <view>{{count.noLeaseCount?count.noLeaseCount:0}}</view>
|
|
|
|
|
+ <view>{{getP(2)}}%</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="address-box ddflex">
|
|
|
|
|
- <image class="address-icon" src="../../static/pages/images/address-icon.png"></image>
|
|
|
|
|
- <view class="fflex tover">{{item.address}}</view>
|
|
|
|
|
- <image @click.stop="toLocation(item)" class="daohang" src="../../static/pages/images/daohang.png"></image>
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 电池 -->
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <view class="cell-box" v-for="item,index in groupList">
|
|
|
|
|
+ <view class="ddflex">
|
|
|
|
|
+ <view style="margin-right: 35rpx;">
|
|
|
|
|
+ <cell :width="99" :height="197" :soc="item.leaseStatus==1?50:100" :showsoc="false"></cell>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="cell-info fflex">
|
|
|
|
|
+ <view class="ddflex">
|
|
|
|
|
+ <view class="cell-title">{{item.model}}</view>
|
|
|
|
|
+ <view class="cell-state" :style="item.leaseStatus==1?'':'background-color: #0FCB27;'">{{item.leaseStatus==1?'已租':'空闲'}}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="cell-info ddflex">
|
|
|
|
|
+ <view>电池Id:</view>
|
|
|
|
|
+ <view>{{item.batteryId}}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="cell-info ddflex">
|
|
|
|
|
+ <view>设备编号:</view>
|
|
|
|
|
+ <view>{{item.number}}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="cell-info ddflex">
|
|
|
|
|
+ <view>门店:</view>
|
|
|
|
|
+ <view>{{item.storeName}}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="cell-info ddflex">
|
|
|
|
|
+ <view>到期时间:</view>
|
|
|
|
|
+ <view>{{item.blockDate}}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="cell-option ddflex">
|
|
|
|
|
+ <view class="fflex" @click="jumpUrl('/machineAndCell/map/map?id='+item.batteryId)">定位</view>
|
|
|
|
|
+ <view class="fflex" @click="jumpUrl('/machineAndCell/BMS/BMS?id='+item.batteryId)">BMS</view>
|
|
|
|
|
+ <view class="fflex" @click="jumpUrl('/machineAndCell/cellDetail/cellDetail?id='+item.batteryId)">详情</view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view v-if="groupList.length==0">
|
|
<view v-if="groupList.length==0">
|
|
|
<view class="nodata">
|
|
<view class="nodata">
|
|
|
<image :src="picUrlss+'empty.png'"></image>
|
|
<image :src="picUrlss+'empty.png'"></image>
|
|
|
- <text>暂无设备~</text>
|
|
|
|
|
|
|
+ <text>暂无电池~</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -76,10 +125,12 @@
|
|
|
<script>
|
|
<script>
|
|
|
const app = getApp();
|
|
const app = getApp();
|
|
|
const req = require("../../utils/request.js");
|
|
const req = require("../../utils/request.js");
|
|
|
|
|
+ import cell from "../../components/cell/index";
|
|
|
import leftPop from "../../components/left-pop/index";
|
|
import leftPop from "../../components/left-pop/index";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
|
|
+ cell,
|
|
|
leftPop
|
|
leftPop
|
|
|
},
|
|
},
|
|
|
props: {},
|
|
props: {},
|
|
@@ -101,6 +152,8 @@
|
|
|
searchValue:'',
|
|
searchValue:'',
|
|
|
isQuerying:false,//正在查询数据
|
|
isQuerying:false,//正在查询数据
|
|
|
|
|
|
|
|
|
|
+ queryType:'',
|
|
|
|
|
+
|
|
|
merchantList: [],
|
|
merchantList: [],
|
|
|
merchantPage: 1,
|
|
merchantPage: 1,
|
|
|
merchantLimit: 10,
|
|
merchantLimit: 10,
|
|
@@ -108,7 +161,9 @@
|
|
|
actMerchant:null,//当前门店
|
|
actMerchant:null,//当前门店
|
|
|
|
|
|
|
|
merchantId:null,
|
|
merchantId:null,
|
|
|
- storeId:null
|
|
|
|
|
|
|
+ storeId:null,
|
|
|
|
|
+
|
|
|
|
|
+ count:{}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
@@ -124,6 +179,7 @@
|
|
|
id:this.storeId
|
|
id:this.storeId
|
|
|
}
|
|
}
|
|
|
this.getMachineList()
|
|
this.getMachineList()
|
|
|
|
|
+ this.getTopNum()
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
|
this.getMachineList()
|
|
this.getMachineList()
|
|
@@ -150,6 +206,23 @@
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ getP(type){
|
|
|
|
|
+ let p = 0
|
|
|
|
|
+ console.log('111')
|
|
|
|
|
+ if(type==1){
|
|
|
|
|
+ if(this.count.leaseCount == 0 || this.count.leaseCount == undefined){}
|
|
|
|
|
+ else{
|
|
|
|
|
+ return (this.count.leaseCount/(this.count.leaseCount+(this.count.noLeaseCount?this.count.noLeaseCount:0))).toFixed(4)*100
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(type==2){
|
|
|
|
|
+ if(this.count.noLeaseCount == 0 || this.count.noLeaseCount == undefined){}
|
|
|
|
|
+ else{
|
|
|
|
|
+ return (this.count.noLeaseCount/(this.count.leaseCount+(this.count.noLeaseCount?this.count.noLeaseCount:0))).toFixed(4)*100
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return p*100
|
|
|
|
|
+ },
|
|
|
jumpUrl(url){
|
|
jumpUrl(url){
|
|
|
if(req.isLogins(true)){
|
|
if(req.isLogins(true)){
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -157,6 +230,12 @@
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ queryTypeChange(val) {
|
|
|
|
|
+ if (this.queryType == val) return false
|
|
|
|
|
+ this.queryType = val
|
|
|
|
|
+ this.queryType = val==-1?'':val
|
|
|
|
|
+ this.getMachineList()
|
|
|
|
|
+ },
|
|
|
// 弹窗弹出
|
|
// 弹窗弹出
|
|
|
openPop(item) {
|
|
openPop(item) {
|
|
|
this.tempData = JSON.parse(JSON.stringify(item))
|
|
this.tempData = JSON.parse(JSON.stringify(item))
|
|
@@ -170,7 +249,18 @@
|
|
|
this.closePop()
|
|
this.closePop()
|
|
|
this.getMachineList()
|
|
this.getMachineList()
|
|
|
},
|
|
},
|
|
|
- // 获取机柜列表
|
|
|
|
|
|
|
+ // 电池数量
|
|
|
|
|
+ getTopNum(){
|
|
|
|
|
+ console.log('getTopNum')
|
|
|
|
|
+ req.getRequest(
|
|
|
|
|
+ '/admin/v2/battery/count',
|
|
|
|
|
+ {storeId:this.actMerchant.id},
|
|
|
|
|
+ data => {
|
|
|
|
|
+ this.count = data
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取电池列表
|
|
|
getMachineList(isPage){
|
|
getMachineList(isPage){
|
|
|
if(!this.actMerchant||!this.actMerchant.id) return
|
|
if(!this.actMerchant||!this.actMerchant.id) return
|
|
|
if(this.isQuerying) return
|
|
if(this.isQuerying) return
|
|
@@ -183,11 +273,14 @@
|
|
|
limit: this.limit,
|
|
limit: this.limit,
|
|
|
}
|
|
}
|
|
|
if(this.searchValue){
|
|
if(this.searchValue){
|
|
|
- queryParams.devId=this.searchValue
|
|
|
|
|
|
|
+ queryParams.number=this.searchValue
|
|
|
|
|
+ }
|
|
|
|
|
+ if(this.queryType){
|
|
|
|
|
+ queryParams.type = this.queryType
|
|
|
}
|
|
}
|
|
|
queryParams.storeId = this.actMerchant.id
|
|
queryParams.storeId = this.actMerchant.id
|
|
|
req.getRequest(
|
|
req.getRequest(
|
|
|
- '/admin/v2/cab/page',
|
|
|
|
|
|
|
+ '/admin/v2/battery/page',
|
|
|
queryParams,
|
|
queryParams,
|
|
|
data => {
|
|
data => {
|
|
|
if (data != null && data.list.length > 0) {
|
|
if (data != null && data.list.length > 0) {
|
|
@@ -272,8 +365,7 @@
|
|
|
console.log('条码类型:' + res.scanType);
|
|
console.log('条码类型:' + res.scanType);
|
|
|
console.log('条码内容:' + res.result);
|
|
console.log('条码内容:' + res.result);
|
|
|
// did设备id
|
|
// did设备id
|
|
|
- this.searchValue = res.result
|
|
|
|
|
- this.searchFn()
|
|
|
|
|
|
|
+ this.jumpUrl('/machineAndCell/cellSearch/cellSearch?storeId='+this.actMerchant.id+'&searchValue='+res.result+'&type='+this.queryType)
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|