164 lines
5.9 KiB
JavaScript
164 lines
5.9 KiB
JavaScript
|
|
"use strict";
|
||
|
|
const common_vendor = require("../../../common/vendor.js");
|
||
|
|
const utils_api = require("../../../utils/api.js");
|
||
|
|
if (!Array) {
|
||
|
|
const _easycom_bikeCodeScan2 = common_vendor.resolveComponent("bikeCodeScan");
|
||
|
|
const _easycom_uni_forms_item2 = common_vendor.resolveComponent("uni-forms-item");
|
||
|
|
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
|
||
|
|
const _easycom_uni_forms2 = common_vendor.resolveComponent("uni-forms");
|
||
|
|
const _easycom_uni_section2 = common_vendor.resolveComponent("uni-section");
|
||
|
|
(_easycom_bikeCodeScan2 + _easycom_uni_forms_item2 + _easycom_uni_easyinput2 + _easycom_uni_forms2 + _easycom_uni_section2)();
|
||
|
|
}
|
||
|
|
const _easycom_bikeCodeScan = () => "../../../components/bikeCodeScan/bikeCodeScan.js";
|
||
|
|
const _easycom_uni_forms_item = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item.js";
|
||
|
|
const _easycom_uni_easyinput = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput.js";
|
||
|
|
const _easycom_uni_forms = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.js";
|
||
|
|
const _easycom_uni_section = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-section/uni-section.js";
|
||
|
|
if (!Math) {
|
||
|
|
(_easycom_bikeCodeScan + _easycom_uni_forms_item + _easycom_uni_easyinput + _easycom_uni_forms + _easycom_uni_section)();
|
||
|
|
}
|
||
|
|
const _sfc_main = {
|
||
|
|
__name: "qrcodereplace",
|
||
|
|
setup(__props) {
|
||
|
|
const ebikeInfo = common_vendor.ref({
|
||
|
|
bikeId: "",
|
||
|
|
oldBikeCode: "",
|
||
|
|
ecuCode: "",
|
||
|
|
voltage: "",
|
||
|
|
positionAt: "",
|
||
|
|
newBikeCode: "",
|
||
|
|
codeState: "",
|
||
|
|
oldBikeCOdeSave: "notSave",
|
||
|
|
ecuId: "",
|
||
|
|
ecuSn: ""
|
||
|
|
});
|
||
|
|
const oldBikeCodeScanChange = (data) => {
|
||
|
|
utils_api.callEbikeInfo("getBikeINfoData?bikeCode=" + data).then((res) => {
|
||
|
|
ebikeInfo.value.ecuCode = res.data.ecuCode;
|
||
|
|
ebikeInfo.value.bikeId = res.data.bikeId;
|
||
|
|
ebikeInfo.value.ecuId = res.data.ecuId;
|
||
|
|
ebikeInfo.value.ecuSn = res.data.ecuSn;
|
||
|
|
const ecuSn = res.data.ecuSn;
|
||
|
|
utils_api.callCoreApi("gps?ecuId=" + res.data.ecuId, {}, "get").then((res2) => {
|
||
|
|
utils_api.callCoreApi("gpsMsg?ecuSn=" + ecuSn, {}, "get").then((res3) => {
|
||
|
|
ebikeInfo.value.positionAt = common_vendor.dayjs(res3.data.timestamp * 1e3).format(
|
||
|
|
"YYYY-MM-DD HH:mm:ss"
|
||
|
|
);
|
||
|
|
ebikeInfo.value.coordinate = "东经:" + res3.data.longitude + "°,北纬:" + res3.data.latitude + "°";
|
||
|
|
ebikeInfo.value.voltage = res3.data.voltage + " mv";
|
||
|
|
});
|
||
|
|
});
|
||
|
|
});
|
||
|
|
ebikeInfo.value.oldBikeCode = data;
|
||
|
|
};
|
||
|
|
const newBikeCodeScanChange = (data) => {
|
||
|
|
ebikeInfo.value.newBikeCode = data;
|
||
|
|
};
|
||
|
|
const unUpdate = () => {
|
||
|
|
common_vendor.index.showModal({
|
||
|
|
title: "提示",
|
||
|
|
content: "确认更换二维码吗?",
|
||
|
|
success: function(res) {
|
||
|
|
if (res.confirm) {
|
||
|
|
utils_api.callEbikeInfo("updateBikeQRCode", ebikeInfo.value).then((res2) => {
|
||
|
|
ebikeInfo.value.ecuCode = res2.data.ecuCode;
|
||
|
|
ebikeInfo.value.ecuCode = res2.data.bikeId;
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
};
|
||
|
|
return (_ctx, _cache) => {
|
||
|
|
return {
|
||
|
|
a: common_vendor.o(oldBikeCodeScanChange),
|
||
|
|
b: common_vendor.p({
|
||
|
|
codeValue: ebikeInfo.value.oldBikeCode
|
||
|
|
}),
|
||
|
|
c: common_vendor.p({
|
||
|
|
label: "车辆编号",
|
||
|
|
name: "oldBikeCode"
|
||
|
|
}),
|
||
|
|
d: common_vendor.o(($event) => ebikeInfo.value.ecuCode = $event),
|
||
|
|
e: common_vendor.p({
|
||
|
|
placeholder: "-",
|
||
|
|
modelValue: ebikeInfo.value.ecuCode
|
||
|
|
}),
|
||
|
|
f: common_vendor.p({
|
||
|
|
label: "中控编号",
|
||
|
|
name: "ecuCode"
|
||
|
|
}),
|
||
|
|
g: common_vendor.o(($event) => ebikeInfo.value.voltage = $event),
|
||
|
|
h: common_vendor.p({
|
||
|
|
placeholder: "-",
|
||
|
|
modelValue: ebikeInfo.value.voltage
|
||
|
|
}),
|
||
|
|
i: common_vendor.p({
|
||
|
|
label: "电压",
|
||
|
|
name: "voltage"
|
||
|
|
}),
|
||
|
|
j: common_vendor.o(($event) => ebikeInfo.value.coordinate = $event),
|
||
|
|
k: common_vendor.p({
|
||
|
|
placeholder: "-",
|
||
|
|
modelValue: ebikeInfo.value.coordinate
|
||
|
|
}),
|
||
|
|
l: common_vendor.p({
|
||
|
|
label: "坐标",
|
||
|
|
name: "coordinate"
|
||
|
|
}),
|
||
|
|
m: common_vendor.o(($event) => ebikeInfo.value.positionAt = $event),
|
||
|
|
n: common_vendor.p({
|
||
|
|
placeholder: "-",
|
||
|
|
modelValue: ebikeInfo.value.positionAt
|
||
|
|
}),
|
||
|
|
o: common_vendor.p({
|
||
|
|
label: "定位时间",
|
||
|
|
name: "positionAt"
|
||
|
|
}),
|
||
|
|
p: common_vendor.sr("oldBikeCodeForm", "64bb515a-1,64bb515a-0"),
|
||
|
|
q: common_vendor.p({
|
||
|
|
rules: _ctx.ebikeInfoRules,
|
||
|
|
modelValue: ebikeInfo.value
|
||
|
|
}),
|
||
|
|
r: common_vendor.p({
|
||
|
|
title: "旧车辆编号",
|
||
|
|
type: "line"
|
||
|
|
}),
|
||
|
|
s: common_vendor.o(newBikeCodeScanChange),
|
||
|
|
t: common_vendor.p({
|
||
|
|
codeValue: ebikeInfo.value.newBikeCode
|
||
|
|
}),
|
||
|
|
v: common_vendor.p({
|
||
|
|
label: "车辆编号",
|
||
|
|
name: "newBikeCode"
|
||
|
|
}),
|
||
|
|
w: common_vendor.o(($event) => ebikeInfo.value.codeState = $event),
|
||
|
|
x: common_vendor.p({
|
||
|
|
placeholder: "-",
|
||
|
|
modelValue: ebikeInfo.value.codeState
|
||
|
|
}),
|
||
|
|
y: common_vendor.p({
|
||
|
|
label: "编号状态",
|
||
|
|
name: "codeState"
|
||
|
|
}),
|
||
|
|
z: common_vendor.p({
|
||
|
|
label: "旧车辆码处理",
|
||
|
|
required: true,
|
||
|
|
name: "oldBikeCOdeSave"
|
||
|
|
}),
|
||
|
|
A: common_vendor.sr("newBikeCodeForm", "64bb515a-13,64bb515a-12"),
|
||
|
|
B: common_vendor.p({
|
||
|
|
rules: _ctx.ebikeEcuInfoRules,
|
||
|
|
modelValue: ebikeInfo.value
|
||
|
|
}),
|
||
|
|
C: common_vendor.p({
|
||
|
|
title: "新车辆编号",
|
||
|
|
type: "line"
|
||
|
|
}),
|
||
|
|
D: common_vendor.o(unUpdate)
|
||
|
|
};
|
||
|
|
};
|
||
|
|
}
|
||
|
|
};
|
||
|
|
wx.createPage(_sfc_main);
|
||
|
|
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/warehouse/qrcodereplace/qrcodereplace.js.map
|