|
@@ -16,7 +16,9 @@ const connectorCode = ref()
|
|
|
onLoad((options: any) => {
|
|
onLoad((options: any) => {
|
|
|
connectorCode.value = options.connectorCode
|
|
connectorCode.value = options.connectorCode
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
|
|
+onShow(() => {
|
|
|
|
|
+ queryVehicleList()
|
|
|
|
|
+})
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
opcity.value = 0
|
|
opcity.value = 0
|
|
|
getConnectorDetail()
|
|
getConnectorDetail()
|
|
@@ -33,6 +35,25 @@ async function getConnectorDetail() {
|
|
|
connectorDetailInfo.value = res.data
|
|
connectorDetailInfo.value = res.data
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 获取车辆列表判断是否提示用户添加车辆
|
|
|
|
|
+const defaultPlateNumber = ref('')
|
|
|
|
|
+const vehicleList = ref<any[]>([])
|
|
|
|
|
+async function queryVehicleList() {
|
|
|
|
|
+ const res = await Apis.charge.vehicleList({})
|
|
|
|
|
+ vehicleList.value = res.data || []
|
|
|
|
|
+ const defaultVehicle = res.data.find(item => item.isDefault === 1) || res.data[0]
|
|
|
|
|
+ defaultPlateNumber.value = defaultVehicle?.licensePlate || ''
|
|
|
|
|
+ if (res.data.length === 0) {
|
|
|
|
|
+ useGlobalMessage().confirm({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ msg: '您还未绑定车牌,绑定车牌可享免费停车',
|
|
|
|
|
+ success: () => {
|
|
|
|
|
+ router.push({ name: 'charge-plate-list' })
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const fromData = ref<Api.invokeChargeList>({
|
|
const fromData = ref<Api.invokeChargeList>({
|
|
|
equipmentId: 0,
|
|
equipmentId: 0,
|
|
|
stationId: 0,
|
|
stationId: 0,
|
|
@@ -40,14 +61,31 @@ const fromData = ref<Api.invokeChargeList>({
|
|
|
powerStationName: '',
|
|
powerStationName: '',
|
|
|
consigneeName: userInfo.value?.nickName,
|
|
consigneeName: userInfo.value?.nickName,
|
|
|
consigneeMobile: userInfo.value?.mobile,
|
|
consigneeMobile: userInfo.value?.mobile,
|
|
|
|
|
+ plateNum: '',
|
|
|
})
|
|
})
|
|
|
async function launchCharge() {
|
|
async function launchCharge() {
|
|
|
// router.push({ name: 'chargeing' })
|
|
// router.push({ name: 'chargeing' })
|
|
|
// return
|
|
// return
|
|
|
|
|
+ if (vehicleList.value.length > 1) {
|
|
|
|
|
+ useGlobalMessage().confirm({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ msg: `系统默认充电车牌"${defaultPlateNumber.value}",请确认当前车牌后再进行充电。`,
|
|
|
|
|
+ success: () => {
|
|
|
|
|
+ beginLaunchCharge()
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ beginLaunchCharge()
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+async function beginLaunchCharge() {
|
|
|
fromData.value.equipmentId = connectorDetailInfo.value?.equipmentId
|
|
fromData.value.equipmentId = connectorDetailInfo.value?.equipmentId
|
|
|
fromData.value.stationId = connectorDetailInfo.value?.stationId
|
|
fromData.value.stationId = connectorDetailInfo.value?.stationId
|
|
|
fromData.value.connectorId = connectorDetailInfo.value?.connectorCode
|
|
fromData.value.connectorId = connectorDetailInfo.value?.connectorCode
|
|
|
fromData.value.powerStationName = connectorDetailInfo.value?.stationName
|
|
fromData.value.powerStationName = connectorDetailInfo.value?.stationName
|
|
|
|
|
+ fromData.value.plateNum = defaultPlateNumber.value
|
|
|
const res = await Apis.charge.invokeCharge({ data: fromData.value })
|
|
const res = await Apis.charge.invokeCharge({ data: fromData.value })
|
|
|
if (res.code === '00000') {
|
|
if (res.code === '00000') {
|
|
|
router.push({ name: 'chargeing', params: { orderNo: res.data } })
|
|
router.push({ name: 'chargeing', params: { orderNo: res.data } })
|