2 Commits aa09a6ee45 ... ba2e980763

Author SHA1 Message Date
  123456 ba2e980763 Merge branch 'pika_shangjia2.0' of http://git.zhiqiyun.com/xionghaojie/pika_shangjia into pika_shangjia2.0 1 year ago
  123456 1dd25740df 优化 1 year ago

+ 98 - 7
machineAndCell/BMS/BMS.vue

@@ -68,6 +68,12 @@
 						<text>充电电流:</text>
 						<text class="bms-row-data">{{info.State.CPowerA}}A </text>
 					</view>
+				</view>
+				<view class="bms-row ddflex">
+					<view class="fflex ddflex">
+						<text>放电电流:</text>
+						<text class="bms-row-data">{{info.State.DPowerA}}A </text>
+					</view>
 				</view>
 				<view class="bms-row ddflex">
 					<view class="fflex ddflex">
@@ -80,18 +86,36 @@
 						<text>充电保护状态:</text>
 						<text class="bms-row-data">{{info.State.CPStatus==1?'硬控保护':info.State.CPStatus==2?'软控保护':'正常'}} </text>
 					</view>
+				</view>
+				<view class="bms-row ddflex">
+					<view class="fflex ddflex">
+						<text>充电保护次数:</text>
+						<text class="bms-row-data">{{info.State.CPCount}} </text>
+					</view>
 				</view>
 				<view class="bms-row ddflex">
 					<view class="fflex ddflex">
 						<text>放电保护状态:</text>
 						<text class="bms-row-data">{{info.State.DPStatus==1?'硬控保护':info.State.DPStatus==2?'软控保护':'正常'}} </text>
 					</view>
+				</view>
+				<view class="bms-row ddflex">
+					<view class="fflex ddflex">
+						<text>放电保护次数:</text>
+						<text class="bms-row-data">{{info.State.DPCount}} </text>
+					</view>
 				</view>
 				<view class="bms-row ddflex">
 					<view class="fflex ddflex">
 						<text>短路保护:</text>
 						<text class="bms-row-data">{{info.State.SCProtect==1?'保护':'正常'}} </text>
 					</view>
+				</view>
+				<view class="bms-row ddflex">
+					<view class="fflex ddflex">
+						<text>短路保护次数:</text>
+						<text class="bms-row-data">{{info.State.SCPCount}} </text>
+					</view>
 				</view>
 				<view class="bms-row ddflex">
 					<view class="fflex ddflex">
@@ -108,13 +132,43 @@
 				<view class="bms-row ddflex">
 					<view class="fflex ddflex">
 						<text>保护板温度:</text>
-						<text class="bms-row-data">{{info.State.TC_T}}°C </text>
+						<text class="bms-row-data">{{info.State.TC_T}}°C</text>
 					</view>
-				</view>
+				</view>
+				<view class="bms-row ddflex">
+					<view class="fflex ddflex">
+						<text>电池温度:</text>
+						<text class="bms-row-data">{{info.State.TC_B_1}}°C</text>
+					</view>
+				</view>
+				<view class="bms-row ddflex">
+					<view class="fflex ddflex">
+						<text>充电过温次数:</text>
+						<text class="bms-row-data">{{info.State.CPSuperheat}}</text>
+					</view>
+				</view>
+				<view class="bms-row ddflex">
+					<view class="fflex ddflex">
+						<text>充电低温次数:</text>
+						<text class="bms-row-data">{{info.State.CPSubcooled}}</text>
+					</view>
+				</view>
+				<view class="bms-row ddflex">
+					<view class="fflex ddflex">
+						<text>放电过温次数:</text>
+						<text class="bms-row-data">{{info.State.DPSuperheat}}</text>
+					</view>
+				</view>
+				<view class="bms-row ddflex">
+					<view class="fflex ddflex">
+						<text>放电低温次数:</text>
+						<text class="bms-row-data">{{info.State.DPSubcooled}}</text>
+					</view>
+				</view>
 				<view class="bms-row ddflex">
 					<view class="fflex ddflex">
 						<text>出厂日期:</text>
-						<text class="bms-row-data">{{info.State.CCXX}} </text>
+						<text class="bms-row-data">{{info.State.CCXX}}</text>
 					</view>
 				</view>
 				<view class="bms-row ddflex">
@@ -135,13 +189,13 @@
 						<text>刷新</text>
 					</view>
 				</view>
-				<!-- <view class="ddflex state">
+				<view class="ddflex state">
 					<view class="ddflex">
 						<view>充电开关:</view>
 						<view style="color: #A8A5A5;">{{info.Seting.CHON==1?'开启':'关闭'}}</view>
 					</view>
-					<switch style="transform: scale(0.7);" :checked="info.Seting.CHON" color="#FF753A"></switch>
-				</view> -->
+					<switch style="transform: scale(0.7);" :checked="info.Seting.CHON==1?true:false" color="#FF753A" @change="switchChangeC"></switch>
+				</view>
 				<view class="ddflex state">
 					<view class="ddflex">
 						<view>放电开关:</view>
@@ -221,7 +275,7 @@
 							uni.showLoading({
 								title:event.detail.value?'开启中':'关闭中',
 							})
-							req.postRequest('/admin/v2/battery/bmsSend',{batteryId:this.id,type:event.detail.value},res=>{
+							req.postRequest('/admin/v2/battery/bmsSend',{batteryId:this.id,type:event.detail.value,operateType:1},res=>{
 								uni.hideLoading()
 								if(res){
 									// req.msg(event.detail.value?'开启成功':'关闭成功')
@@ -245,6 +299,43 @@
 						
 					}
 				})
+			},
+			switchChangeC(event){
+				event.detail.value = event.detail.value?1:0
+				this.info.Seting.CHON = event.detail.value
+				let that = this
+				uni.showModal({
+					title:'提示',
+					content:event.detail.value?'确定开启充电开关?':'确定关闭充电开关?',
+					success: (r) => {
+						if(r.confirm){
+							uni.showLoading({
+								title:event.detail.value?'开启中':'关闭中',
+							})
+							req.postRequest('/admin/v2/battery/bmsSend',{batteryId:this.id,type:event.detail.value,operateType:2},res=>{
+								uni.hideLoading()
+								if(res){
+									// req.msg(event.detail.value?'开启成功':'关闭成功')
+									uni.showModal({
+										title:'提示',
+										content:'操作成功,该操作会有延迟,请稍候查看最新状态',
+										showCancel:false,
+										success() {
+											that.getData()
+										}
+									})
+								}else {
+									req.msg(event.detail.value?'开启失败':'关闭失败')
+									this.info.Seting.CHON = this.info.Seting.CHON==1?0:1
+								}
+							})
+						}else{
+							this.info.Seting.CHON = this.info.Seting.CHON==1?0:1
+							// this.getData()
+						}
+						
+					}
+				})
 			},
 		},
 		mounted() {

+ 66 - 0
machineAndCell/machineItemManage/machineItemManage - 副本.css

@@ -0,0 +1,66 @@
+page{
+	/* background-color: #fff; */
+}
+.option-box{
+	background: #FFFFFF;
+	border-radius: 10rpx 10rpx 10rpx 10rpx;
+	opacity: 1;
+	margin: 30rpx;
+	padding: 36rpx 20rpx;
+}
+.option-time{
+	font-size: 24rpx;
+	font-weight: 500;
+	color: #A8A5A5;
+	line-height: 36rpx;
+	justify-content: space-between;
+	padding-bottom:16rpx ;
+	border-bottom: 1rpx solid #E6E6E6;
+}
+.refresh{
+	font-size: 28rpx;
+}
+.refresh image{
+	width: 32rpx;
+	height: 32rpx;
+	margin-right: 8rpx;
+}
+.state{
+	justify-content: space-between;
+	font-size: 28rpx;
+	margin-top: 10rpx;
+	font-weight: 500;
+	color: #666464;
+}
+.note{
+	line-height: 36rpx;
+	font-size: 24rpx;
+	font-family: Source Han Sans CN-Regular, Source Han Sans CN;
+	font-weight: 400;
+	color: #A8A5A5;
+	margin: 13rpx 61rpx;
+}
+
+/* 按钮 */
+.bottom-btns{
+	position: fixed;
+	left: 0;
+	right: 0;
+	bottom: 0;
+	background: #FFFFFF;
+	box-shadow: 0rpx -5rpx 15rpx 1rpx rgba(0,0,0,0.05);
+	border-radius: 0rpx 0rpx 0rpx 0rpx;
+	opacity: 1;
+	z-index: 10;
+}
+.btn{
+	margin: 30rpx;
+	line-height: 76rpx;
+	background: #EB5C20;
+	border-radius: 38rpx;
+	opacity: 1;
+	color: #fff;
+	text-align: center;
+	font-weight: 500;
+	font-size: 28rpx;
+}

+ 117 - 0
machineAndCell/machineItemManage/machineItemManage - 副本.vue

@@ -0,0 +1,117 @@
+<template>
+	<view>
+		<view class="option-box">
+			<view class="option-time ddflex">
+				<view>更新时间: {{time}}</view>
+				<view class="refresh ddflex" @click="getState()">
+					<image src="../../static/pages/images/refresh.png"></image>
+					<text>刷新</text>
+				</view>
+			</view>
+			<view class="ddflex state">
+				<view class="ddflex">
+					<view>仓位状态:</view>
+					<view style="color: #A8A5A5;">{{doorInfo.boxEnable==1?'启用':'禁用'}}</view>
+				</view>
+				<switch style="transform: scale(0.7);" :checked="doorInfo.boxEnable" color="#FF753A" @change="boxEnableChange"></switch>
+			</view>
+		</view>
+		<view class="note">关闭后,仓门将禁用,用户无法打开</view>
+		
+		
+		<view style="height: 165rpx;" class="savepadding"></view>
+		<view class="bottom-btns savepadding">
+			<view class="btn" @click="open">一键开门</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	const app = getApp();
+	const req = require("../../utils/request.js");
+	const utils = require("../../utils/util");
+
+	export default {
+		components: {},
+		props: {},
+		data() {
+			return {
+				id:null,//仓门id
+				devId:null,//机柜id
+				doorInfo:{},
+				time:''
+			}
+		},
+		async onLoad(options) {
+			this.id = options.id
+			this.devId = options.devId
+			await this.getState()
+		},
+		onShow() {
+			
+		},
+		methods: {
+			getState(){
+				return new Promise((r,j)=>{
+					uni.showLoading({
+						title:'加载中'
+					})
+					req.getRequest('/admin/v2/door/info',{devId:this.devId,doorId:this.id},res=>{
+						this.doorInfo = res
+						this.time = utils.formatTime(new Date()).t1
+						uni.hideLoading()
+					})
+				})
+			},
+			boxEnableChange(event){
+				this.doorInfo.boxEnable = event.detail.value
+				uni.showModal({
+					title:'提示',
+					content:event.detail.value?'确定启用该仓门?':'确定禁用该仓门?',
+					success: (r) => {
+						if(r.confirm){
+							uni.showLoading({
+								title:event.detail.value?'启用中':'禁用中',
+							})
+							req.postRequest('/admin/v2/cab/ableDoor',{devId:this.devId,doorId:this.id,cabEnable:event.detail.value?1:0},res=>{
+								uni.hideLoading()
+								if(res){
+									req.msg(event.detail.value?'启用成功':'禁用成功')
+								}else {
+									req.msg(event.detail.value?'启用失败':'禁用失败')
+									this.doorInfo.boxEnable = !this.doorInfo.boxEnable
+								}
+							})
+						}else{
+							this.doorInfo.boxEnable = !this.doorInfo.boxEnable
+						}
+						
+					}
+				})
+			},
+			open(){
+				uni.showLoading({
+					title:'开门中',
+				})
+				req.postRequest('/admin/v2/cab/openDoor',{devId:this.devId,doorId:this.id},res=>{
+					uni.hideLoading()
+					if(res){
+						req.msg('操作成功')
+					}else {
+						req.msg('操作失败')
+					}
+				})
+			}
+		},
+		mounted() {
+			
+		},
+		onPageScroll: function(e) {
+			
+		}
+	}
+</script>
+
+<style>
+	@import "./machineItemManage.css";
+</style>

+ 104 - 38
machineAndCell/machineItemManage/machineItemManage.css

@@ -1,46 +1,107 @@
-page{
-	/* background-color: #fff; */
+page {
+	background-color: #fff;
 }
-.option-box{
-	background: #FFFFFF;
-	border-radius: 10rpx 10rpx 10rpx 10rpx;
+
+.input-box {
+	padding: 30rpx 30rpx 0;
+}
+
+.input-box .input {
+	width: 615rpx;
+	height: 76rpx;
+	line-height: 76rpx;
+	background: #F8F8F8;
+	border-radius: 20rpx 20rpx 20rpx 20rpx;
 	opacity: 1;
-	margin: 30rpx;
-	padding: 36rpx 20rpx;
+	padding: 0 32rpx;
 }
-.option-time{
-	font-size: 24rpx;
-	font-weight: 500;
-	color: #A8A5A5;
-	line-height: 36rpx;
+
+.input-box .input input {
+	width: 100%;
+	height: 100%;
+}
+
+.saoma {
+	width: 39rpx;
+	height: 36rpx;
+	margin-left: 35rpx;
+}
+
+
+.item {
+	padding: 35rpx 0rpx;
 	justify-content: space-between;
-	padding-bottom:16rpx ;
 	border-bottom: 1rpx solid #E6E6E6;
-}
-.refresh{
+	;
+	margin: 0 30rpx;
+	line-height: 41rpx;
 	font-size: 28rpx;
+	font-family: Source Han Sans CN-Medium, Source Han Sans CN;
+	font-weight: 500;
 }
-.refresh image{
-	width: 32rpx;
-	height: 32rpx;
-	margin-right: 8rpx;
+.item:last-child{
+	border-bottom: none;
 }
 .state{
-	justify-content: space-between;
-	font-size: 28rpx;
-	margin-top: 10rpx;
-	font-weight: 500;
+	width: 73rpx;
+	line-height: 36rpx;
+	border-radius: 5rpx 5rpx 5rpx 5rpx;
+	opacity: 1;
+	border: 2rpx solid #0FCB27;
+	font-size: 22rpx;
+	font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
+	font-weight: normal;
+	color: #0FCB27;
+	text-align: center;
+	margin-left: 10rpx;
+}
+.label {
 	color: #666464;
+	margin-right: 30rpx;
 }
-.note{
-	line-height: 36rpx;
-	font-size: 24rpx;
-	font-family: Source Han Sans CN-Regular, Source Han Sans CN;
-	font-weight: 400;
+
+.item-input {
 	color: #A8A5A5;
-	margin: 13rpx 61rpx;
+	text-align: right;
+	justify-content: flex-end;
 }
 
+
+/* 保存按钮 */
+.submit-box{
+	height: 140rpx;
+	background: #FFFFFF;
+	box-shadow: 0rpx -5rpx 15rpx 1rpx rgba(0,0,0,0.05);
+	border-radius: 0rpx 0rpx 0rpx 0rpx;
+	opacity: 1;
+	position: fixed;
+	left: 0;
+	right: 0;
+	bottom: 0;
+}
+.submit-btn{
+	width: 556rpx;
+	line-height: 76rpx;
+	background: #EB5C20;
+	border-radius: 38rpx 38rpx 38rpx 38rpx;
+	opacity: 1;
+	font-size: 28rpx;
+	font-family: Source Han Sans CN-Medium, Source Han Sans CN;
+	font-weight: 500;
+	color: #FFFFFF;
+	text-align: center;
+	margin:30rpx auto;
+}
+
+.refresh{
+	font-size: 28rpx;
+	margin-left: 20rpx;
+}
+.refresh image{
+	width: 32rpx;
+	height: 32rpx;
+	margin-right: 8rpx;
+}
 /* 按钮 */
 .bottom-btns{
 	position: fixed;
@@ -51,16 +112,21 @@ page{
 	box-shadow: 0rpx -5rpx 15rpx 1rpx rgba(0,0,0,0.05);
 	border-radius: 0rpx 0rpx 0rpx 0rpx;
 	opacity: 1;
-	z-index: 10;
-}
-.btn{
-	margin: 30rpx;
+	z-index: 10;
+	padding: 20rpx 0;
+}
+.btn{
 	line-height: 76rpx;
-	background: #EB5C20;
-	border-radius: 38rpx;
 	opacity: 1;
-	color: #fff;
+	color: #EB5C20;
 	text-align: center;
 	font-weight: 500;
-	font-size: 28rpx;
-}
+	font-size: 28rpx;
+	width: 33.33%;
+}
+.gray{color: #666;}
+.bms{width: 120rpx;line-height: 60rpx;
+	background-color: #EB5C20;
+	text-align: center;
+	color: #fff;
+	font-size: 24rpx;margin-left: 20rpx;border-radius: 30rpx;}

+ 109 - 34
machineAndCell/machineItemManage/machineItemManage.vue

@@ -1,27 +1,90 @@
 <template>
 	<view>
-		<view class="option-box">
-			<view class="option-time ddflex">
-				<view>更新时间: {{time}}</view>
-				<view class="refresh ddflex" @click="getState()">
-					<image src="../../static/pages/images/refresh.png"></image>
-					<text>刷新</text>
-				</view>
-			</view>
-			<view class="ddflex state">
-				<view class="ddflex">
-					<view>仓位状态:</view>
-					<view style="color: #A8A5A5;">{{doorInfo.boxEnable==1?'启用':'禁用'}}</view>
-				</view>
-				<switch style="transform: scale(0.7);" :checked="doorInfo.boxEnable" color="#FF753A" @change="boxEnableChange"></switch>
-			</view>
-		</view>
-		<view class="note">关闭后,仓门将禁用,用户无法打开</view>
-		
-		
-		<view style="height: 165rpx;" class="savepadding"></view>
-		<view class="bottom-btns savepadding">
-			<view class="btn" @click="open">一键开门</view>
+		<view>
+			<view class="item ddflex">
+				<view class="label">箱体编号</view>
+				<view class="item-input fflex ddflex">
+					<view>{{doorInfo.doorId}}</view>
+				</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">机柜名称</view>
+				<view class="item-input fflex ddflex">
+					<view>{{doorInfo.devName}}</view>
+				</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">机柜编号</view>
+				<view class="item-input fflex">
+					{{doorInfo.devId}}
+				</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">电池电压</view>
+				<view class="item-input fflex">
+					<block v-if="doorInfo.batVol">{{doorInfo.batVol}}V</block>
+					<view v-else>未知</view>
+				</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">电池温度</view>
+				<view class="item-input fflex">
+					<block v-if="doorInfo.batTemp">{{doorInfo.batTemp}}℃</block>
+					<view v-else>未知</view>
+				</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">电池编号</view>
+				<view class="item-input fflex">
+					{{doorInfo.batteryId}}
+				</view>
+				<view class="bms" @click="jumpUrl('/machineAndCell/BMS/BMS?id='+doorInfo.batteryId)">BMS分析</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">bms告警</view>
+				<view class="item-input fflex">
+					<block v-if="doorInfo.bmsAlarm">{{doorInfo.bmsAlarm}}</block>
+					<view v-else>未知</view>
+				</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">更新时间</view>
+				<view class="item-input fflex">
+					{{doorInfo.updateTime ? doorInfo.updateTime : time}}
+				</view>
+				<view class="refresh ddflex" @click="getState()">
+					<image src="../../static/pages/images/refresh.png"></image>
+					<text>刷新</text>
+				</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">电池类型</view>
+				<view class="item-input fflex">
+					<block v-if="doorInfo.model">{{doorInfo.model}}</block>
+					<view v-else>未知</view>
+				</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">仓门状态</view>
+				<view class="item-input fflex">
+					{{doorInfo.doorStatus == 1 ? '开启':'关闭'}}
+				</view>
+			</view>
+			<view class="item ddflex">
+				<view class="label">仓内温度</view>
+				<view class="item-input fflex">
+					<block v-if="doorInfo.boxTemp">{{doorInfo.boxTemp}}℃</block>
+					<view v-else>未知</view>
+				</view>
+			</view>
+		</view>
+		<view style="height: 165rpx;" class="savepadding"></view>
+		<view class="bottom-btns">
+			<view class="savepadding dflex">
+				<view :class="'btn'+(doorInfo.boxEnable==1?'':' gray')" @click="boxEnableChange(false)">禁用</view>
+				<view :class="'btn'+(doorInfo.boxEnable==1?' gray':'')" @click="boxEnableChange(true)">启用</view>
+				<view class="btn" @click="open">一键开门</view>
+			</view>
 		</view>
 	</view>
 </template>
@@ -50,7 +113,12 @@
 		onShow() {
 			
 		},
-		methods: {
+		methods: {
+			jumpUrl(url){
+				uni.navigateTo({
+					url:url
+				})
+			},
 			getState(){
 				return new Promise((r,j)=>{
 					uni.showLoading({
@@ -63,28 +131,35 @@
 					})
 				})
 			},
-			boxEnableChange(event){
-				this.doorInfo.boxEnable = event.detail.value
+			boxEnableChange(type){
+				let that = this;
+				if(type){
+					if(this.doorInfo.boxEnable == 1) return false;
+				}else{
+					if(this.doorInfo.boxEnable == 0) return false;
+				}
 				uni.showModal({
 					title:'提示',
-					content:event.detail.value?'确定启用该仓门?':'确定禁用该仓门?',
+					content:type?'确定启用该仓门?':'确定禁用该仓门?',
 					success: (r) => {
 						if(r.confirm){
 							uni.showLoading({
-								title:event.detail.value?'启用中':'禁用中',
+								title:type?'启用中':'禁用中',
 							})
-							req.postRequest('/admin/v2/cab/ableDoor',{devId:this.devId,doorId:this.id,cabEnable:event.detail.value?1:0},res=>{
+							req.postRequest('/admin/v2/cab/ableDoor',{devId:this.devId,doorId:this.id,cabEnable:type?1:0},res=>{
 								uni.hideLoading()
 								if(res){
-									req.msg(event.detail.value?'启用成功':'禁用成功')
+									req.msg(type?'启用成功':'禁用成功');
+									that.getState();
 								}else {
-									req.msg(event.detail.value?'启用失败':'禁用失败')
+									req.msg(type?'启用失败':'禁用失败')
 									this.doorInfo.boxEnable = !this.doorInfo.boxEnable
-								}
+								}
 							})
-						}else{
-							this.doorInfo.boxEnable = !this.doorInfo.boxEnable
-						}
+						}
+						// else{
+						// 	this.doorInfo.boxEnable = !this.doorInfo.boxEnable
+						// }
 						
 					}
 				})