|
@@ -90,6 +90,10 @@
|
|
|
@click="ChangeModel(0)">自动选电</view>
|
|
|
<view class="leftBtn Rbtn" :class="[pamars.batChooseMode===1 ? 'active' : '']"
|
|
|
@click="ChangeModel(1)">手动选电</view>
|
|
|
+ </view>
|
|
|
+ <view class="freeze">
|
|
|
+ <view class="active" @click="HandleFreeze(1)">冻结</view>
|
|
|
+ <view @click="HandleFreeze(0)">解冻</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -507,6 +511,45 @@
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ //冻结、解冻
|
|
|
+ HandleFreeze(isFree) {
|
|
|
+ let that=this
|
|
|
+ const text = isFree === 1 ? '冻结' : '解冻'
|
|
|
+ if (this.BatterySelectAllArr.length !== 1 || this.BatterySelectAllArr[0].storeState!==1) {
|
|
|
+ this.ExchangeMessage('warn',`请选择一个电池进行${text}!`)
|
|
|
+ }
|
|
|
+ else if(isFree === 1 && this.BatterySelectAllArr[0].freezeState==1){
|
|
|
+ this.ExchangeMessage('warn',`选择电池已冻结,无需再次冻结!`)
|
|
|
+ }
|
|
|
+ else if(isFree === 0 && !this.BatterySelectAllArr[0].freezeState){
|
|
|
+ this.ExchangeMessage('warn',`选择电池已冻结,无需再次冻结!`)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ const pamars={
|
|
|
+ code:this.BatterySelectAllArr[0].storeCode,
|
|
|
+ type:isFree
|
|
|
+ }
|
|
|
+ uni.showModal({
|
|
|
+ title: `请确认${text}【${this.BatterySelectAllArr[0].storeCode}】号电池?`,
|
|
|
+ content: '',
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ that.$http.batteryfreeze(pamars).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ that.clearStore()
|
|
|
+ that.ExchangeMessage('warn',isFree===1?'冻结成功':'解冻成功')
|
|
|
+ }else{
|
|
|
+ that.ExchangeMessage('warn',isFree===1?'冻结失败':'解冻失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (res.cancel) {
|
|
|
+ return false
|
|
|
+ //用户点击取消按钮触发
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
//开始换电
|
|
|
BeginChangePower() {
|
|
@@ -1197,7 +1240,28 @@
|
|
|
padding-top: 5px;
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
-
|
|
|
+ .freeze{
|
|
|
+ margin-left: auto;
|
|
|
+ display: flex;
|
|
|
+ view{
|
|
|
+ padding: 3px 0;
|
|
|
+ width: 48px;
|
|
|
+ text-align: center;
|
|
|
+ background: #263042;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #FFFFFF;
|
|
|
+ font-size: 14px;
|
|
|
+ height: 24px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ line-height: 18px;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin-right: 12px;
|
|
|
+ }
|
|
|
+ .active{
|
|
|
+ background: #91FDB9;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ }
|
|
|
.switch {
|
|
|
margin-left: auto;
|
|
|
color: white;
|