diff --git a/ebike-maintenance/components/ecuCodeScan/ecuCodeScan.vue b/ebike-maintenance/components/ecuCodeScan/ecuCodeScan.vue index 7fb24e4..2b47f54 100644 --- a/ebike-maintenance/components/ecuCodeScan/ecuCodeScan.vue +++ b/ebike-maintenance/components/ecuCodeScan/ecuCodeScan.vue @@ -17,8 +17,9 @@ const inputCodeValue = ref(''); const { - codeValue - } = defineProps(["codeValue"]); + codeValue, + scanValue + } = defineProps(["codeValue", "scanValue"]); inputCodeValue.value = codeValue; const emit = defineEmits(['scan-change']); @@ -45,7 +46,12 @@ imei, sn }; - inputCodeValue.value = imei; + + if (scanValue == "sn") { + inputCodeValue.value = sn; + } else { + inputCodeValue.value = imei; + } emit('scan-change', params); } } @@ -55,10 +61,17 @@ const onInput = (value) => { if (value.detail.value == "") return; inputCodeValue.value = value.detail.value; - emit('scan-change', { - imei: value.detail.value, - sn: "" - }); + if (scanValue == "sn") { + emit('scan-change', { + imei: "", + sn: value.detail.value + }); + } else { + emit('scan-change', { + imei: value.detail.value, + sn: "" + }); + } } const onSetValue = (value) => { diff --git a/ebike-maintenance/pages/warehouse/detectionecu/detectionecu.vue b/ebike-maintenance/pages/warehouse/detectionecu/detectionecu.vue index e3c0822..1a63a57 100644 --- a/ebike-maintenance/pages/warehouse/detectionecu/detectionecu.vue +++ b/ebike-maintenance/pages/warehouse/detectionecu/detectionecu.vue @@ -2,11 +2,11 @@ - + - - + + @@ -526,7 +526,6 @@ ebikeInfo.value.bikeId = res.data.bikeId; ebikeInfo.value.ecuId = res.data.ecuId; ebikeInfo.value.ecuSn = res.data.ecuSn; - detectionInfo.value.online.btuDisabled = false; detectionInfo.value.findEbike.btuDisabled = false; detectionInfo.value.gps.btuDisabled = false; @@ -545,6 +544,18 @@ const ecuCodeScanChange = (data) => { ebikeInfo.value.ecuCode = data["imei"]; ebikeInfo.value.ecuSn = data["sn"]; + detectionInfo.value.online.btuDisabled = false; + detectionInfo.value.findEbike.btuDisabled = false; + detectionInfo.value.gps.btuDisabled = false; + detectionInfo.value.soc.btuDisabled = false; + detectionInfo.value.openBatteryLock.btuDisabled = false; + detectionInfo.value.lock.btuDisabled = false; + detectionInfo.value.unlock.btuDisabled = false; + detectionInfo.value.openHelmet.btuDisabled = false; + detectionInfo.value.voltage.btuDisabled = false; + detectionInfo.value.cancelAntiTheft.btuDisabled = false; + detectionInfo.value.powerOff.btuDisabled = false; + navButtonGroup[0].disable = false }; const socClick = () => { @@ -574,12 +585,12 @@ reqState.value = true; - var paramName = "ecuId"; - var data = ebikeInfo.value.ecuId + var paramName = "ecuSn"; + var data = ebikeInfo.value.ecuSn var bikeId = ebikeInfo.value.bikeId - api.callCoreApi(url['url'] + "?" + paramName + "=" + data + "&bikeId=" + bikeId, {}, 'get').then((res) => { + api.callEcuCoreApi(url['url'] + "?" + paramName + "=" + data + "&bikeId=" + bikeId, {}, 'get').then((res) => { if (url['type']) { - api.callCoreApi("gpsMsg" + "?ecuSn=" + ebikeInfo.value.ecuSn, {}, 'get').then((res) => { + api.callEcuCoreApi("gpsMsg" + "?ecuSn=" + ebikeInfo.value.ecuSn, {}, 'get').then((res) => { detectionInfo.value[url['type']].load = ''; reqState.value = false; detectionInfo.value[url['type']].btuDisable = false; @@ -605,7 +616,6 @@ }); } - const recursionExecDetection = () => { if (urlList.value[0]['type']) { @@ -623,43 +633,44 @@ var paramName = "ecuId"; var data = ebikeInfo.value.ecuId var bikeId = ebikeInfo.value.bikeId - api.callCoreApi(urlList.value[0]['url'] + "?" + paramName + "=" + data+ "&bikeId=" + bikeId, {}, 'get').then((res) => { - if (urlList.value[0]['type']) { - api.callCoreApi("gpsMsg" + "?ecuSn=" + ebikeInfo.value.ecuSn, {}, 'get').then((res) => { - detectionInfo.value[urlList.value[0]['type']].load = ''; + api.callEcuCoreApi(urlList.value[0]['url'] + "?" + paramName + "=" + data + "&bikeId=" + bikeId, {}, 'get') + .then((res) => { + if (urlList.value[0]['type']) { + api.callEcuCoreApi("gpsMsg" + "?ecuSn=" + ebikeInfo.value.ecuSn, {}, 'get').then((res) => { + detectionInfo.value[urlList.value[0]['type']].load = ''; + reqState.value = false; + detectionInfo.value[urlList.value[0]['type']].btuDisable = false; + if (urlList.value[0]['type'] == 'gps') { + detectionInfo.value[urlList.value[0]['type']].msg = "东经:" + res.data + .longitude + "°,北纬:" + + res.data.latitude + "°"; + } else { + detectionInfo.value[urlList.value[0]['type']].msg = res.data[urlList.value[0][ + 'type' + ]]; + } + detectionInfo.value[urlList.value[0]['type']].detectionState = true; + urlList.value.shift(); + if (urlList.value.length > 0) { + recursionExecDetection(); + } + }) + } else { + detectionInfo.value[urlList.value[0]['url']].load = ''; reqState.value = false; - detectionInfo.value[urlList.value[0]['type']].btuDisable = false; - if (urlList.value[0]['type'] == 'gps') { - detectionInfo.value[urlList.value[0]['type']].msg = "东经:" + res.data - .longitude + "°,北纬:" + - res.data.latitude + "°"; + detectionInfo.value[urlList.value[0]['url']].btuDisable = false; + detectionInfo.value[urlList.value[0]['url']].msg = res.data.message; + if (res.data.code == 200) { + detectionInfo.value[urlList.value[0]['url']].detectionState = 'success'; } else { - detectionInfo.value[urlList.value[0]['type']].msg = res.data[urlList.value[0][ - 'type' - ]]; + detectionInfo.value[urlList.value[0]['url']].detectionState = 'error'; } - detectionInfo.value[urlList.value[0]['type']].detectionState = true; urlList.value.shift(); if (urlList.value.length > 0) { recursionExecDetection(); } - }) - } else { - detectionInfo.value[urlList.value[0]['url']].load = ''; - reqState.value = false; - detectionInfo.value[urlList.value[0]['url']].btuDisable = false; - detectionInfo.value[urlList.value[0]['url']].msg = res.data.message; - if (res.data.code == 200) { - detectionInfo.value[urlList.value[0]['url']].detectionState = 'success'; - } else { - detectionInfo.value[urlList.value[0]['url']].detectionState = 'error'; } - urlList.value.shift(); - if (urlList.value.length > 0) { - recursionExecDetection(); - } - } - }); + }); } const autoDetection = () => {