Commit 4b54e36f authored by xxx's avatar xxx

修改设备号提示

parent f68d317f
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<script> <script>
import { httpGet, httpPostForJson, putForJson } from "@/common/httpBean.js"; import { httpGet, httpPostForJson, putForJson } from "@/common/httpBean.js";
import { login, code, apiEquipmentQuery, vehicleInformationQuery} from "@/axios/api.js"; import { login, code, apiEquipmentQuery, vehicleInformationQuery, personalCenterInforQuery} from "@/axios/api.js";
import { encrypt } from "@/utils/rsaEncrypt.js"; import { encrypt } from "@/utils/rsaEncrypt.js";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { config as appConfig } from "../config.js"; import { config as appConfig } from "../config.js";
...@@ -95,37 +95,37 @@ export default { ...@@ -95,37 +95,37 @@ export default {
//查询车辆表中设备是否与车辆绑定 //查询车辆表中设备是否与车辆绑定
httpGet(vehicleInformationQuery,{equipmentName:that.deviceOAID}).then((resCar) => { httpGet(vehicleInformationQuery,{equipmentName:that.deviceOAID}).then((resCar) => {
if(resCar.code == 200 && resCar.data.totalElements != 0){ if(resCar.code == 200 && resCar.data.totalElements != 0){
that.$message({ // that.$message({
message: "设备检索完毕,可进行登录!", // message: "设备检索完毕,可进行登录!",
type: 'success' // type: 'success'
}); // });
that.bindingStatus = true; that.bindingStatus = true;
}else{ }else{
that.$message({ // that.$message({
message: "请在后台系统中将该设备与车辆绑定后再进行登录!", // message: "请在后台系统中将该设备与车辆绑定后再进行登录!",
type: 'error' // type: 'error'
}); // });
that.$message({ // that.$message({
showClose: true, // showClose: true,
message: "设备号:" + that.deviceOAID, // message: "设备号:" + that.deviceOAID,
type: 'error', // type: 'error',
duration: 0 // duration: 0
}); // });
that.bindingStatus = false; that.bindingStatus = false;
} }
}) })
}else{ }else{
httpPostForJson(apiEquipmentQuery,{name:that.deviceOAID,status:'正常'}).then((res)=>{ httpPostForJson(apiEquipmentQuery,{name:that.deviceOAID,status:'正常'}).then((res)=>{
that.$message({ // that.$message({
message: "请在后台系统中将该设备与车辆绑定后再进行登录!", // message: "请在后台系统中将该设备与车辆绑定后再进行登录!",
type: 'error' // type: 'error'
}); // });
that.$message({ // that.$message({
showClose: true, // showClose: true,
message: "设备号:" + that.deviceOAID, // message: "设备号:" + that.deviceOAID,
type: 'error', // type: 'error',
duration: 0 // duration: 0
}); // });
that.bindingStatus = false; that.bindingStatus = false;
}) })
} }
...@@ -133,10 +133,10 @@ export default { ...@@ -133,10 +133,10 @@ export default {
}, },
fail:function(e){ fail:function(e){
console.log('getDeviceInfo failed: '+JSON.stringify(e)); console.log('getDeviceInfo failed: '+JSON.stringify(e));
that.$message({ // that.$message({
message: "获取设备信息失败,请退出系统并且开启权限后重试!", // message: "获取设备信息失败,请退出系统并且开启权限后重试!",
type: 'error' // type: 'error'
}); // });
that.bindingStatus = false; that.bindingStatus = false;
} }
}) })
...@@ -159,6 +159,13 @@ export default { ...@@ -159,6 +159,13 @@ export default {
}, },
//登录前操作判断 //登录前操作判断
loginBeforeFn() { loginBeforeFn() {
if(!this.deviceOAID){
this.$message({
message: "获取设备信息失败,请退出系统并且开启权限后重试!",
type: 'warning'
});
return
}
httpGet(apiEquipmentQuery,{name:this.deviceOAID}).then((resSheiBei) => { httpGet(apiEquipmentQuery,{name:this.deviceOAID}).then((resSheiBei) => {
if(resSheiBei.code == 200 && resSheiBei.data.totalElements != 0){ if(resSheiBei.code == 200 && resSheiBei.data.totalElements != 0){
//查询车辆表中设备是否与车辆绑定 //查询车辆表中设备是否与车辆绑定
...@@ -170,14 +177,16 @@ export default { ...@@ -170,14 +177,16 @@ export default {
}else{ }else{
this.$message({ this.$message({
message: "请在后台系统中将该设备与车辆绑定后再进行登录!", message: "请在后台系统中将该设备与车辆绑定后再进行登录!",
type: 'error' type: 'warning'
});
this.$message({
showClose: true,
message: "设备号:" + this.deviceOAID,
type: 'error',
duration: 0
}); });
this.$nextTick(()=>{
this.$message({
showClose: true,
message: "设备号:" + this.deviceOAID,
type: 'warning',
duration: 0
});
})
this.bindingStatus = false; this.bindingStatus = false;
} }
}) })
...@@ -185,14 +194,16 @@ export default { ...@@ -185,14 +194,16 @@ export default {
httpPostForJson(apiEquipmentQuery,{name:this.deviceOAID,status:'正常'}).then((res)=>{ httpPostForJson(apiEquipmentQuery,{name:this.deviceOAID,status:'正常'}).then((res)=>{
this.$message({ this.$message({
message: "请在后台系统中将该设备与车辆绑定后再进行登录!", message: "请在后台系统中将该设备与车辆绑定后再进行登录!",
type: 'error' type: 'warning'
});
this.$message({
showClose: true,
message: "设备号:" + this.deviceOAID,
type: 'error',
duration: 0
}); });
this.$nextTick(()=>{
this.$message({
showClose: true,
message: "设备号:" + this.deviceOAID,
type: 'warning',
duration: 0
});
})
this.bindingStatus = false; this.bindingStatus = false;
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment