|
@@ -115,6 +115,7 @@ export default {
|
|
|
showStart: false ,// 启动弹框提示
|
|
|
showStop: false, // 急停提示
|
|
|
washCarType: '', // 洗车服务类型,不同的类型对应的时间不一样
|
|
|
+ washDuration: 0, // 机器运行时间
|
|
|
orderNo: '',// 订单编号
|
|
|
};
|
|
|
},
|
|
@@ -124,6 +125,7 @@ export default {
|
|
|
let orderInfo = this.$store.state.vuex_orderInfo
|
|
|
this.washCarType = orderInfo.itemCode
|
|
|
this.orderNo = orderInfo.orderNo
|
|
|
+ this.washDuration = orderInfo.duration
|
|
|
|
|
|
// 监听消息
|
|
|
uni.$on('wsMessage',(e)=>{
|
|
@@ -131,7 +133,9 @@ export default {
|
|
|
// 进度消息
|
|
|
// 错误消息
|
|
|
// 启动成功
|
|
|
+ this.startWashCarSuccess()
|
|
|
// 紧急停止成功
|
|
|
+ this.stopWashCarSuccess()
|
|
|
// 复位成功
|
|
|
})
|
|
|
},
|
|
@@ -143,35 +147,39 @@ export default {
|
|
|
// 操作按钮
|
|
|
startWork() {
|
|
|
let _this = this
|
|
|
+ let cmd = {
|
|
|
+ orderNo: this.orderNo, // 订单编号
|
|
|
+ washType: this.washCarType,// 洗车模式
|
|
|
+ }
|
|
|
// 启动
|
|
|
if (this.status == 'start') {
|
|
|
- _this.startWashCar()
|
|
|
+ cmd.operateType = 'start' //操作命令
|
|
|
+ this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
|
|
|
}
|
|
|
// 急停
|
|
|
if (this.status == 'working') {
|
|
|
- _this.stopWashCar()
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定紧急停止洗车机?',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ cmd.operateType = 'stop' //操作命令
|
|
|
+ _this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
- // 开始启动机器洗车
|
|
|
- startWashCar(){
|
|
|
- // 启动命令
|
|
|
- let cmd = {
|
|
|
- orderNo: this.orderNo, // 订单编号
|
|
|
- operateType: 'start', //操作命令
|
|
|
- washType: this.washCarType,// 洗车模式
|
|
|
- }
|
|
|
- this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
|
|
|
-
|
|
|
+ // 启动成功
|
|
|
+ startWashCarSuccess(){
|
|
|
this.step= 0;
|
|
|
this.showStart = true;
|
|
|
- // 启动成功
|
|
|
setTimeout(() => {
|
|
|
this.status = 'working';
|
|
|
this.curWorkStutesText='设备已启动';
|
|
|
this.showStart = false;
|
|
|
// 进度条,服务时间根据不同的服务类型而不同
|
|
|
- let serverTime = 7
|
|
|
- console.log(this.step,'step')
|
|
|
+ let serverTime = this.washDuration/60
|
|
|
this.interId = setInterval(()=>{
|
|
|
// 小于60时说明洗车机正在工作中
|
|
|
if(this.step<=60){
|
|
@@ -183,34 +191,18 @@ export default {
|
|
|
},1000*serverTime)
|
|
|
}, 3000);
|
|
|
},
|
|
|
- // 紧急停止
|
|
|
- stopWashCar(){
|
|
|
- let _this = this
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '确定紧急停止洗车机?',
|
|
|
- success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
- // 停止命令
|
|
|
- let cmd = {
|
|
|
- orderNo: _this.orderNo, // 订单编号
|
|
|
- operateType: 'stop', //操作命令
|
|
|
- washType: _this.washCarType,// 洗车模式
|
|
|
- }
|
|
|
- _this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
|
|
|
- // 显示急停提示弹框
|
|
|
- _this.showStop = true;
|
|
|
- _this.status = 'stop';
|
|
|
- _this.curWorkStutesText='设备正在紧急停止';
|
|
|
- _this.resetLoadingStatus();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ // 紧急停止成功
|
|
|
+ stopWashCarSuccess(){
|
|
|
+ // 显示急停提示弹框
|
|
|
+ this.showStop = true;
|
|
|
+ this.status = 'stop';
|
|
|
+ this.curWorkStutesText='设备已紧急停止';
|
|
|
+ this.resetLoadingStatus();
|
|
|
},
|
|
|
// 洗车完成
|
|
|
washCarSuccess(){
|
|
|
this.status = "success";
|
|
|
- this.curWorkStutesText='洗车完成';
|
|
|
+ this.curWorkStutesText='洗车已完成';
|
|
|
this.resetLoadingStatus();
|
|
|
// 关闭socket
|
|
|
this.$store.commit("$closeWebsocket")
|