|
@@ -135,18 +135,40 @@ export default {
|
|
|
if(e.type == 'xcz'){
|
|
|
// 进度消息
|
|
|
if(e.data.level == 'c'){
|
|
|
- // 启动成功
|
|
|
- this.startWashCarSuccess()
|
|
|
+ this.curWorkStutesText= e.data.message
|
|
|
+ // 洗车完成
|
|
|
+ if(e.data.code=="XCWC"){
|
|
|
+ this.washCarSuccess()
|
|
|
+ }
|
|
|
}
|
|
|
// 错误消息
|
|
|
if(e.data.level == 'f'){
|
|
|
-
|
|
|
+ this.curWorkStutesText= e.data.message
|
|
|
+ this.devError()
|
|
|
+ }
|
|
|
+ // 复位状态
|
|
|
+ if(e.data.leve == 'd'){
|
|
|
+ this.curWorkStutesText= e.data.message
|
|
|
+ // 开始复位
|
|
|
+ if(e.data.code=="FW_START"){
|
|
|
+ this.showStart = true;
|
|
|
+ this.showStop = false;
|
|
|
+ }
|
|
|
+ // 复位成功
|
|
|
+ if(e.data.code=="FW_SUCC"){
|
|
|
+ this.resetRabtSuccess()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 停止
|
|
|
+ if(e.data.level == 'a'){
|
|
|
+ if(e.data.code=="JJTZ"||e.data.code=="XCX_JJTZ"){
|
|
|
+ this.curWorkStutesText= e.data.message
|
|
|
+ this.stopWashCarSuccess()
|
|
|
+ }else{
|
|
|
+ this.devError()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- // 紧急停止成功
|
|
|
- // this.stopWashCarSuccess()
|
|
|
- // 复位成功
|
|
|
- // this.resetRabtSuccess()
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
@@ -172,6 +194,9 @@ export default {
|
|
|
cmd.operateType = 'start' //操作命令
|
|
|
this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
|
|
|
this.showStart = true;
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.startWashCarSuccess()
|
|
|
+ },3000)
|
|
|
}
|
|
|
// 急停
|
|
|
if (this.status == 'working') {
|
|
@@ -182,6 +207,7 @@ export default {
|
|
|
if (res.confirm) {
|
|
|
cmd.operateType = 'stop' //操作命令
|
|
|
_this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
|
|
|
+ // 显示急停提示弹框
|
|
|
_this.showStop = true;
|
|
|
}
|
|
|
}
|
|
@@ -209,12 +235,27 @@ export default {
|
|
|
},
|
|
|
// 紧急停止成功
|
|
|
stopWashCarSuccess(){
|
|
|
- // 显示急停提示弹框
|
|
|
+ // 关闭socket
|
|
|
+ this.$store.commit("$closeWebsocket")
|
|
|
this.status = 'stop';
|
|
|
this.$store.state.vuex_workStatus = 'stop'
|
|
|
this.curWorkStutesText='设备已紧急停止';
|
|
|
this.resetLoadingStatus();
|
|
|
},
|
|
|
+ // 设备异常
|
|
|
+ devError(){
|
|
|
+ this.stopWashCarSuccess();
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '设备异常,请联系客服',
|
|
|
+ showCancel: false,
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.navigateBack()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 洗车完成
|
|
|
washCarSuccess(){
|
|
|
this.status = "success";
|
|
@@ -262,8 +303,6 @@ export default {
|
|
|
washType: this.washCarType,// 洗车模式
|
|
|
}
|
|
|
this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
|
|
|
- this.showStart = true;
|
|
|
- this.showStop = false;
|
|
|
},
|
|
|
// 归位结束后
|
|
|
resetRabtSuccess(){
|