|
|
@@ -107,7 +107,9 @@ |
|
|
|
cardRenewal, |
|
|
|
writeCardBack, |
|
|
|
cardModifyConfirm, |
|
|
|
obuRenewal |
|
|
|
obuRenewal, |
|
|
|
modifyObuVehicleInfo, |
|
|
|
obuActivation |
|
|
|
} from "@/utils/network/api.js"; |
|
|
|
const cmd = require("../../../static/etcUtil/cmdConfig.js"); |
|
|
|
|
|
|
@@ -121,6 +123,7 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js"); |
|
|
|
showPopup: false, |
|
|
|
flag: false |
|
|
|
}) |
|
|
|
let cmdRandNum = ''; |
|
|
|
const orderInfos = reactive({ |
|
|
|
orderId: "", |
|
|
|
ownerName: "", |
|
|
@@ -253,7 +256,7 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js"); |
|
|
|
getCommandBack(result.command, cosRecordId, response); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
getCardModifyConfirm(cosRecordId); |
|
|
|
getCardModifyConfirm(cosRecordId) |
|
|
|
} |
|
|
|
}) |
|
|
|
}; |
|
|
@@ -272,7 +275,6 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js"); |
|
|
|
}; |
|
|
|
request(cardModifyConfirm, options).then((res) => { |
|
|
|
getObuRenewal() |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
@@ -305,7 +307,7 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js"); |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
var str = res[3].substring(res[3].length - 4, res[3].length); |
|
|
|
if (str == "9000") { |
|
|
|
let cmdRandNum = res[3].substring(0, res[3].length - 4); |
|
|
|
cmdRandNum = res[3].substring(0, res[3].length - 4); |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
@@ -316,17 +318,25 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js"); |
|
|
|
showLoading: true, |
|
|
|
}; |
|
|
|
request(obuRenewal, options).then((res) => { |
|
|
|
let result = stringToJson(res.bizContent); |
|
|
|
let cmdArray = result.command.split(","); |
|
|
|
console.log("899",result,cmdArray); |
|
|
|
console.log(result.cosRecordId); |
|
|
|
if (cmdArray.length > 0) { |
|
|
|
tools.showLoadingAlert("正在执行指令"); |
|
|
|
bluetoothUtil.transCmd(cmdArray, "20", function(res) { |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
state.showPopup = true; |
|
|
|
}) |
|
|
|
} |
|
|
|
let datas = stringToJson(res.bizContent); |
|
|
|
// let cmdArray = result.command.split(","); |
|
|
|
console.log("899",datas,datas.data.APDU); |
|
|
|
// if (datas.data.APDU) { |
|
|
|
// tools.showLoadingAlert("正在执行指令"); |
|
|
|
// bluetoothUtil.transCmd([datas.data.APDU], "20", function(res) { |
|
|
|
// tools.hideLoadingAlert(); |
|
|
|
// console.log("res=====",res,res[0]) |
|
|
|
// // var str = res[3].substring(res[3].length - 4, res[3].length); |
|
|
|
// if (res[0] == "9000") { |
|
|
|
// cmdRandNum = res[3].substring(0, res[3].length - 4); |
|
|
|
// getFileData((demos) => { |
|
|
|
// modifyVehicle(demos); |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// tools.alertF("RANDOM_NUMBER指令长度不符" + res[1]); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } |
|
|
|
}) |
|
|
|
} else { |
|
|
|
tools.alertF("RANDOM_NUMBER指令长度不符" + res[1]); |
|
|
@@ -334,6 +344,78 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js"); |
|
|
|
}) |
|
|
|
} |
|
|
|
}; |
|
|
|
/** |
|
|
|
* 修改车辆信息 请求 |
|
|
|
*/ |
|
|
|
const modifyVehicle = (ites) => { |
|
|
|
tools.showLoadingAlert("加载中"); |
|
|
|
console.log('======修改车辆信息======', ites) |
|
|
|
let options = { |
|
|
|
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) |
|
|
|
data: { |
|
|
|
Status: "0", |
|
|
|
random: cmdRandNum, |
|
|
|
obuSerailNo: orderInfos.obuId, |
|
|
|
fileData: ites, |
|
|
|
orderId: orderInfos.orderId, |
|
|
|
}, //请求参数 |
|
|
|
method: "POST", //提交方式(默认POST) |
|
|
|
showLoading: true, //是否显示加载中(默认显示) |
|
|
|
}; |
|
|
|
//调用方式 |
|
|
|
request(modifyObuVehicleInfo, options) |
|
|
|
.then((res) => { |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
const datas = stringToJson(res.bizContent); |
|
|
|
console.log("modifyObuVehicleInfo",modifyObuVehicleInfo,datas) |
|
|
|
tools.showLoadingAlert("正在执行指令"); |
|
|
|
if (datas.data.APDU) { |
|
|
|
bluetoothUtil.transCmd([datas.data.APDU], "20", function(res) { |
|
|
|
console.log('执行指令结果', res) |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
if (res[0] == "9000") { |
|
|
|
getObuActivation(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
}; |
|
|
|
/** |
|
|
|
* VFJ-OBU在线激活 请求 |
|
|
|
*/ |
|
|
|
const getObuActivation = () => { |
|
|
|
console.log('======VFJ-OBU在线激活======') |
|
|
|
tools.showLoadingAlert("加载中"); |
|
|
|
let options = { |
|
|
|
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) |
|
|
|
data: { |
|
|
|
random: cmdRandNum, |
|
|
|
obuSerailNo: orderInfos.obuId, |
|
|
|
orderId: orderInfos.orderId, |
|
|
|
}, //请求参数 |
|
|
|
method: "POST", //提交方式(默认POST) |
|
|
|
showLoading: true, //是否显示加载中(默认显示) |
|
|
|
}; |
|
|
|
//调用方式 |
|
|
|
request(obuActivation, options) |
|
|
|
.then((res) => { |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
console.log("在线激活 请求"); |
|
|
|
console.log(stringToJson(res.bizContent)); |
|
|
|
const datas = stringToJson(res.bizContent); |
|
|
|
tools.showLoadingAlert("执行指令"); |
|
|
|
bluetoothUtil.transCmd([datas.data.APDU], "20", function(res) { |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
console.log(res); |
|
|
|
if (res[0] == "9000") { |
|
|
|
state.showPopup = true; |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err); |
|
|
|
}); |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style> |