|
|
|
|
|
|
|
|
vehiclePlate: "", //车牌 |
|
|
vehiclePlate: "", //车牌 |
|
|
vehiclePlateColor: 0, //车牌颜色 |
|
|
vehiclePlateColor: 0, //车牌颜色 |
|
|
vehicleDimensions: "", |
|
|
vehicleDimensions: "", |
|
|
outlineL: 0, //外廓 长 |
|
|
|
|
|
outlineW: 0, //外廓 宽 |
|
|
|
|
|
outlineH: 0, //外廓 高 |
|
|
|
|
|
wheelCount: 0, //车轮数 |
|
|
wheelCount: 0, //车轮数 |
|
|
vehicleIdNo: "", //车牌号 |
|
|
vehicleIdNo: "", //车牌号 |
|
|
vehiclePlateColorStr: "", |
|
|
vehiclePlateColorStr: "", |
|
|
|
|
|
|
|
|
customerId: "", |
|
|
customerId: "", |
|
|
orderId: "" |
|
|
orderId: "" |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function cmdResult() { |
|
|
|
|
|
const options = { |
|
|
|
|
|
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) |
|
|
|
|
|
data: { |
|
|
|
|
|
orderId: orderInfo.orderId, |
|
|
|
|
|
issueType: state.transfer |
|
|
|
|
|
}, //请求参数 |
|
|
|
|
|
method: "POST", //提交方式(默认POST) |
|
|
|
|
|
showLoading: true, //是否显示加载中(默认显示) |
|
|
|
|
|
}; |
|
|
|
|
|
console.log("options==",options) |
|
|
|
|
|
//BDS-二发指令申请 |
|
|
|
|
|
request('4b001421f5354c248a7759971881b52f', options) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
tools.hideLoadingAlert(); |
|
|
|
|
|
console.log("在线激活 请求"); |
|
|
|
|
|
console.log(stringToJson(res.bizContent)); |
|
|
|
|
|
const datas = stringToJson(res.bizContent); |
|
|
|
|
|
tools.showLoadingAlert("执行指令"); |
|
|
|
|
|
console.log("datas===",datas) |
|
|
|
|
|
bluetoothUtil.transCmd(datas.cmd, datas.cmdType, function(res) { |
|
|
|
|
|
implementCmd(datas.transOrderId,datas.cmd,res,datas.stepNo) |
|
|
|
|
|
}, () => { |
|
|
|
|
|
showModals('在线激活异常') |
|
|
|
|
|
}); |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
});L |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function implementCmd(transOrderId, cmd, cmdResult, stepNo) { |
|
|
|
|
|
const options = { |
|
|
|
|
|
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) |
|
|
|
|
|
data: { |
|
|
|
|
|
transOrderId, //步骤号 |
|
|
|
|
|
cmd, |
|
|
|
|
|
cmdResult, |
|
|
|
|
|
stepNo |
|
|
|
|
|
}, //请求参数 |
|
|
|
|
|
method: "POST", //提交方式(默认POST) |
|
|
|
|
|
showLoading: true, //是否显示加载中(默认显示) |
|
|
|
|
|
}; |
|
|
|
|
|
//BDS-二发指令回传 |
|
|
|
|
|
request('88d98f2db7df4f06b22d58b507db7854', options) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
tools.hideLoadingAlert(); |
|
|
|
|
|
console.log("在线激活 请求"); |
|
|
|
|
|
console.log(stringToJson(res.bizContent)); |
|
|
|
|
|
const datas = stringToJson(res.bizContent); |
|
|
|
|
|
tools.showLoadingAlert("执行指令"); |
|
|
|
|
|
if (datas.stepNo == 100) { |
|
|
|
|
|
msg("激活成功") |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url: "/subpackage/after-sale/deviceInfo/deviceInfo", |
|
|
|
|
|
}); |
|
|
|
|
|
}, 2000) |
|
|
|
|
|
} else { |
|
|
|
|
|
bluetoothUtil.transCmd(datas.cmd, datas.cmdType, function(res) { |
|
|
|
|
|
implementCmd(transOrderId,datas.cmd,res,stepNo) |
|
|
|
|
|
}, () => { |
|
|
|
|
|
showModals('在线激活异常') |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//开始激活 按钮事件 |
|
|
//开始激活 按钮事件 |
|
|
const btn = () => { |
|
|
const btn = () => { |
|
|
state.disabled = false |
|
|
state.disabled = false |
|
|
console.log('orderInfo参数', orderInfo, state.disabled) |
|
|
console.log('orderInfo参数', orderInfo, state.disabled) |
|
|
//0 是原来的激活 1 是过户激活 |
|
|
|
|
|
if (state.transfer) { |
|
|
|
|
|
// 获取cardId |
|
|
|
|
|
getCardId() |
|
|
|
|
|
// 过户激活 1 |
|
|
|
|
|
// 1. 过户激活申请 2.设备升级 3.过户升级(跟过户升级一样) 4.79(BDS-安装申请)(后台数据)- |
|
|
|
|
|
// >76(VFJ-OBU在线激活)(指令接口)->80(BDS-安装确认)->73(BDS-卡签绑定)(指令接口)->51(BDS-写卡指令返回)(指令接口) |
|
|
|
|
|
} else { |
|
|
|
|
|
console.log("=================================") |
|
|
|
|
|
if (orderInfo) { |
|
|
|
|
|
//根据订单详情走相应的断步功能 |
|
|
|
|
|
const cardId = orderInfo.cardId; |
|
|
|
|
|
const cardStatus = orderInfo.cardStatus != null ? orderInfo.cardStatus : '0' |
|
|
|
|
|
const obuId = orderInfo.obuId; |
|
|
|
|
|
const obuStatus = orderInfo.obuStatus != null ? orderInfo.obuStatus : '9' |
|
|
|
|
|
console.log('当前卡签状态', cardId, obuId, cardStatus, obuStatus) |
|
|
|
|
|
console.log('输出内容', obu.obuId, '=======', fileDataStrings.obuId, obu.obuId != fileDataStrings.obuId) |
|
|
|
|
|
if (fileDataStrings.obuId) { |
|
|
|
|
|
if (obu.obuId + '' != fileDataStrings.obuId + '') { |
|
|
|
|
|
tools.showModalAlert("订单设备号信息与当前设备号信息不符!"); |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (!cardId) { //卡发行 |
|
|
|
|
|
getCardId() |
|
|
|
|
|
} else if (cardId && cardStatus == '0') { //卡发行 |
|
|
|
|
|
getCardId() |
|
|
|
|
|
} else if (!obuId) { //OBU发行 |
|
|
|
|
|
getObuApply(); |
|
|
|
|
|
} else if (obuId && obuStatus == '9') { //OBU发行 |
|
|
|
|
|
getObuApply(); |
|
|
|
|
|
} else if (cardId && obuId && (obuStatus == '1' || obuStatus == '11' || obuStatus == '0')) { |
|
|
|
|
|
getInstallApply(); //激活 |
|
|
|
|
|
} else { |
|
|
|
|
|
getCardId() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
cmdResult() |
|
|
|
|
|
// //0 是原来的激活 1 是过户激活 |
|
|
|
|
|
// if (state.transfer) { |
|
|
|
|
|
// // 获取cardId |
|
|
|
|
|
// getCardId() |
|
|
|
|
|
// // 过户激活 1 |
|
|
|
|
|
// // 1. 过户激活申请 2.设备升级 3.过户升级(跟过户升级一样) 4.79(BDS-安装申请)(后台数据)- |
|
|
|
|
|
// // >76(VFJ-OBU在线激活)(指令接口)->80(BDS-安装确认)->73(BDS-卡签绑定)(指令接口)->51(BDS-写卡指令返回)(指令接口) |
|
|
|
|
|
// } else { |
|
|
|
|
|
// console.log("=================================") |
|
|
|
|
|
// if (orderInfo) { |
|
|
|
|
|
// //根据订单详情走相应的断步功能 |
|
|
|
|
|
// const cardId = orderInfo.cardId; |
|
|
|
|
|
// const cardStatus = orderInfo.cardStatus != null ? orderInfo.cardStatus : '0' |
|
|
|
|
|
// const obuId = orderInfo.obuId; |
|
|
|
|
|
// const obuStatus = orderInfo.obuStatus != null ? orderInfo.obuStatus : '9' |
|
|
|
|
|
// console.log('当前卡签状态', cardId, obuId, cardStatus, obuStatus) |
|
|
|
|
|
// console.log('输出内容', obu.obuId, '=======', fileDataStrings.obuId, obu.obuId != fileDataStrings.obuId) |
|
|
|
|
|
// if (fileDataStrings.obuId) { |
|
|
|
|
|
// if (obu.obuId + '' != fileDataStrings.obuId + '') { |
|
|
|
|
|
// tools.showModalAlert("订单设备号信息与当前设备号信息不符!"); |
|
|
|
|
|
// return |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if (!cardId) { //卡发行 |
|
|
|
|
|
// getCardId() |
|
|
|
|
|
// } else if (cardId && cardStatus == '0') { //卡发行 |
|
|
|
|
|
// getCardId() |
|
|
|
|
|
// } else if (!obuId) { //OBU发行 |
|
|
|
|
|
// getObuApply(); |
|
|
|
|
|
// } else if (obuId && obuStatus == '9') { //OBU发行 |
|
|
|
|
|
// getObuApply(); |
|
|
|
|
|
// } else if (cardId && obuId && (obuStatus == '1' || obuStatus == '11' || obuStatus == '0')) { |
|
|
|
|
|
// getInstallApply(); //激活 |
|
|
|
|
|
// } else { |
|
|
|
|
|
// getCardId() |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fileDataStrings.customerTel = orderInfo.customerTel; |
|
|
fileDataStrings.customerTel = orderInfo.customerTel; |
|
|
fileDataStrings.customerId = orderInfo.customerId; |
|
|
fileDataStrings.customerId = orderInfo.customerId; |
|
|
fileDataStrings.orderId = orderInfo.orderId; |
|
|
fileDataStrings.orderId = orderInfo.orderId; |
|
|
let vehicleId = orderInfo.vehiclePlate + "_" + orderInfo.vehiclePlateColor |
|
|
|
|
|
searchVehicleInfoQuery(vehicleId).then((orderInfo) => { |
|
|
|
|
|
console.log("orderInfo1111", orderInfo) |
|
|
|
|
|
fileDataStrings.approvedCount = parseInt(orderInfo.approvedCount); //核载人数 |
|
|
|
|
|
fileDataStrings.vehicleVin = orderInfo.vin; |
|
|
|
|
|
fileDataStrings.vehicleEngineNum = orderInfo.engineNum; |
|
|
|
|
|
fileDataStrings.axleCount = parseInt(orderInfo.axleCount); //轴数 |
|
|
|
|
|
fileDataStrings.engineNum = orderInfo.engineNum; //发动机 |
|
|
|
|
|
fileDataStrings.type = parseInt(orderInfo.type); //类型 |
|
|
|
|
|
fileDataStrings.vehiclePlate = orderInfo.vehiclePlate; //车牌 |
|
|
|
|
|
fileDataStrings.vehiclePlateColor = orderInfo.vehiclePlateColor; //车牌颜色 |
|
|
|
|
|
console.log("车辆信息", orderInfo) |
|
|
|
|
|
fileDataStrings.vehicleDimensions = orderInfo.vehicleDimensions; |
|
|
|
|
|
fileDataStrings.vehicleIdNo = orderInfo.vehicleEngineNum; //车编号 |
|
|
|
|
|
fileDataStrings.vehiclePlateColorStr = getVehiclePlateColor(orderInfo |
|
|
|
|
|
.vehiclePlateColor); |
|
|
|
|
|
console.log("fileDataStrings", fileDataStrings); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
fileDataStrings.vehiclePlateColorStr = getVehiclePlateColor(orderInfo |
|
|
|
|
|
.vehiclePlateColor); |
|
|
|
|
|
fileDataStrings.vehiclePlate = orderInfo.vehiclePlate; //车牌 |
|
|
|
|
|
// let vehicleId = orderInfo.vehiclePlate + "_" + orderInfo.vehiclePlateColor |
|
|
|
|
|
// searchVehicleInfoQuery(vehicleId).then((orderInfo) => { |
|
|
|
|
|
// console.log("orderInfo1111", orderInfo) |
|
|
|
|
|
// fileDataStrings.approvedCount = parseInt(orderInfo.approvedCount); //核载人数 |
|
|
|
|
|
// fileDataStrings.vehicleVin = orderInfo.vin; |
|
|
|
|
|
// fileDataStrings.vehicleEngineNum = orderInfo.engineNum; |
|
|
|
|
|
// fileDataStrings.axleCount = parseInt(orderInfo.axleCount); //轴数 |
|
|
|
|
|
// fileDataStrings.engineNum = orderInfo.engineNum; //发动机 |
|
|
|
|
|
// fileDataStrings.type = parseInt(orderInfo.type); //类型 |
|
|
|
|
|
// fileDataStrings.vehiclePlate = orderInfo.vehiclePlate; //车牌 |
|
|
|
|
|
// fileDataStrings.vehiclePlateColor = orderInfo.vehiclePlateColor; //车牌颜色 |
|
|
|
|
|
// console.log("车辆信息", orderInfo) |
|
|
|
|
|
// fileDataStrings.vehicleDimensions = orderInfo.vehicleDimensions; |
|
|
|
|
|
// fileDataStrings.vehicleIdNo = orderInfo.vehicleEngineNum; //车编号 |
|
|
|
|
|
// fileDataStrings.vehiclePlateColorStr = getVehiclePlateColor(orderInfo |
|
|
|
|
|
// .vehiclePlateColor); |
|
|
|
|
|
// console.log("fileDataStrings", fileDataStrings); |
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cancelOrderRequest(orderInfo.orderId) |
|
|
cancelOrderRequest(orderInfo.orderId) |