|
|
|
@ -0,0 +1,632 @@
|
|
|
|
|
<template>
|
|
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="formRef"
|
|
|
|
|
:model="formData"
|
|
|
|
|
:rules="formRules"
|
|
|
|
|
label-width="100px"
|
|
|
|
|
v-loading="formLoading"
|
|
|
|
|
label-position="top"
|
|
|
|
|
>
|
|
|
|
|
<el-row type="flex" justify="space-around">
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="换电站编码" prop="stationNo">
|
|
|
|
|
<el-select v-model="formData.stationNo" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
:label="item.stationName"
|
|
|
|
|
:value="item.stationNo"
|
|
|
|
|
v-for="(item, index) in stationinfoList"
|
|
|
|
|
:key="index"
|
|
|
|
|
/>
|
|
|
|
|
</el-select> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="充电流水号" prop="chargeSeriaNumber">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.chargeSeriaNumber"
|
|
|
|
|
placeholder="请输入充电流水号"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="充电订单号" prop="chargeOrder">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.chargeOrder"
|
|
|
|
|
placeholder="请输入充电订单号"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="充电枪编号" prop="chargerGunNo">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.chargerGunNo"
|
|
|
|
|
placeholder="请输入充电枪编号"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="电池序列号" prop="batteryId">
|
|
|
|
|
<el-input v-model="formData.batteryId" placeholder="请输入电池序列号" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="开始时间" prop="startTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="formData.startTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="x"
|
|
|
|
|
placeholder="选择开始时间"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="结束时间" prop="endTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="formData.endTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="x"
|
|
|
|
|
placeholder="选择结束时间"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="开始SOC" prop="startSoc">
|
|
|
|
|
<el-input v-model="formData.startSoc" placeholder="请输入开始SOC" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="结束SOC" prop="endSoc">
|
|
|
|
|
<el-input v-model="formData.endSoc" placeholder="请输入结束SOC" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="开始SOE" prop="startSoe">
|
|
|
|
|
<el-input v-model="formData.startSoe" placeholder="请输入开始SOE" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="结束SOE" prop="endSoe">
|
|
|
|
|
<el-input v-model="formData.endSoe" placeholder="请输入结束SOE" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="充电电量" prop="chargingCapacity">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.chargingCapacity"
|
|
|
|
|
placeholder="请输入充电电量"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="充电时长" prop="chargingTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="formData.chargingTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="x"
|
|
|
|
|
placeholder="选择充电时长"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="车架号VIN" prop="vin">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.vin"
|
|
|
|
|
placeholder="请输入车架号: 车辆/电池包 VIN"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="状态" prop="status">
|
|
|
|
|
<el-select v-model="formData.status" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.OUTCHARGSTATUS)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="优惠前总费用" prop="totalFeeBeforeDiscount">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.totalFeeBeforeDiscount"
|
|
|
|
|
placeholder="请输入优惠前总费用"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="优惠金额" prop="discountFee">
|
|
|
|
|
<el-input v-model="formData.discountFee" placeholder="请输入优惠金额" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="总费用" prop="totalFee">
|
|
|
|
|
<el-input v-model="formData.totalFee" placeholder="请输入总费用" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="实际支付金额" prop="actualPay">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.actualPay"
|
|
|
|
|
placeholder="请输入实际支付金额"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="尖时段电量(直流)" prop="theTipElectric">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.theTipElectric"
|
|
|
|
|
placeholder="请输入尖时段电量(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="尖时段单价(直流)" prop="theTipPrice">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.theTipPrice"
|
|
|
|
|
placeholder="请输入尖时段单价(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="尖时段电费(直流)" prop="theTipExpense">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.theTipExpense"
|
|
|
|
|
placeholder="请输入尖时段电费(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="峰时段电量(直流)" prop="peakElectric">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.peakElectric"
|
|
|
|
|
placeholder="请输入峰时段电量(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="峰时段单价(直流)" prop="peakPrice">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.peakPrice"
|
|
|
|
|
placeholder="请输入峰时段单价(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="峰时段电费(直流)" prop="peakExpense">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.peakExpense"
|
|
|
|
|
placeholder="请输入峰时段电费(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="平时段电量(直流)" prop="flatElectric">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.flatElectric"
|
|
|
|
|
placeholder="请输入平时段电量(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="平时段单价(直流)" prop="flatPrice">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.flatPrice"
|
|
|
|
|
placeholder="请输入平时段单价(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="平时段电费(直流)" prop="flatExpense">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.flatExpense"
|
|
|
|
|
placeholder="请输入平时段电费(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="谷时段电量(直流)" prop="theValleyElectric">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.theValleyElectric"
|
|
|
|
|
placeholder="请输入谷时段电量(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="谷时段单价(直流)" prop="theValleyPrice">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.theValleyPrice"
|
|
|
|
|
placeholder="请输入谷时段单价(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="谷时段电费(直流)" prop="theValleyExpense">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.theValleyExpense"
|
|
|
|
|
placeholder="请输入谷时段电费(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="修正充电量(直流)" prop="amendElectric">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.amendElectric"
|
|
|
|
|
placeholder="请输入修正充电量(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="修正电费(直流)" prop="amendExpense">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.amendExpense"
|
|
|
|
|
placeholder="请输入修正电费(直流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="尖时段电量(交流)" prop="theTipElectricAcMeter">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.theTipElectricAcMeter"
|
|
|
|
|
placeholder="请输入尖时段电量(交流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="峰时段电量(交流)" prop="peakElectricAcMeter">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.peakElectricAcMeter"
|
|
|
|
|
placeholder="请输入峰时段电量(交流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="平时段电量(交流)" prop="flatElectricAcMeter">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.flatElectricAcMeter"
|
|
|
|
|
placeholder="请输入平时段电量(交流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="谷时段电量(交流)" prop="theValleyElectricAcMeter">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.theValleyElectricAcMeter"
|
|
|
|
|
placeholder="请输入谷时段电量(交流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="尖时段电费(交流)" prop="theTipExpenseAcMeter">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.theTipExpenseAcMeter"
|
|
|
|
|
placeholder="请输入尖时段电费(交流)"
|
|
|
|
|
type="number"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="峰时段电费(交流)" prop="peakExpenseAcMeter">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.peakExpenseAcMeter"
|
|
|
|
|
placeholder="请输入峰时段电费(交流)"
|
|
|
|
|
type="number"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="平时段电费(交流)" prop="flatExpenseAcMeter">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.flatExpenseAcMeter"
|
|
|
|
|
placeholder="请输入平时段电费(交流)"
|
|
|
|
|
type="number"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="谷时段电费(交流)" prop="theValleyExpenseAcMeter">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.theValleyExpenseAcMeter"
|
|
|
|
|
placeholder="请输入谷时段电费(交流)"
|
|
|
|
|
type="number"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="修正充电量(交流)" prop="amendElectricAcMeter">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.amendElectricAcMeter"
|
|
|
|
|
placeholder="请输入修正充电量(交流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="修正电费(交流)" prop="amendExpenseAcMeter">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.amendExpenseAcMeter"
|
|
|
|
|
placeholder="请输入修正电费(交流)"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="充电前交流表电量" prop="beforeChargingElectric">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.beforeChargingElectric"
|
|
|
|
|
placeholder="请输入充电前交流表电量"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="充电后交流表电量" prop="afterChargingElectric">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.afterChargingElectric"
|
|
|
|
|
placeholder="请输入充电后交流表电量"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="套餐优惠电量度数" prop="freeCharge">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.freeCharge"
|
|
|
|
|
placeholder="请输入套餐优惠电量度数"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="上报方式" prop="reportingMode">
|
|
|
|
|
<el-select v-model="formData.reportingMode" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.OUTREPORTINGMODE)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="是否有效" prop="orderStatus">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formData.orderStatus"
|
|
|
|
|
placeholder="请选择是否有效"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.OUTORDERSTATUS)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="电池编码" prop="batteryNo">
|
|
|
|
|
<el-input v-model="formData.batteryNo" placeholder="请输入" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11"
|
|
|
|
|
><el-form-item label="是否补单" prop="replenishmentFlag">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formData.replenishmentFlag"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.OUTREPLENISHMENTFLAG)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="用户编号" prop="userId">
|
|
|
|
|
<el-input v-model="formData.userId" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="11" />
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
|
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</Dialog>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { OutChargeOrderApi, OutChargeOrderVO } from '@/api/biz/outchargeorder'
|
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
|
|
|
|
|
/** 站外充电订单 表单 */
|
|
|
|
|
defineOptions({ name: 'OutChargeOrderForm' })
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
stationinfoList: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
|
|
const formData = ref({
|
|
|
|
|
id: undefined,
|
|
|
|
|
stationNo: undefined,
|
|
|
|
|
chargeSeriaNumber: undefined,
|
|
|
|
|
chargeOrder: undefined,
|
|
|
|
|
chargerGunNo: undefined,
|
|
|
|
|
batteryId: undefined,
|
|
|
|
|
startTime: undefined,
|
|
|
|
|
endTime: undefined,
|
|
|
|
|
startSoc: undefined,
|
|
|
|
|
endSoc: undefined,
|
|
|
|
|
startSoe: undefined,
|
|
|
|
|
endSoe: undefined,
|
|
|
|
|
chargingCapacity: undefined,
|
|
|
|
|
chargingTime: undefined,
|
|
|
|
|
vin: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
|
totalFeeBeforeDiscount: undefined,
|
|
|
|
|
discountFee: undefined,
|
|
|
|
|
totalFee: undefined,
|
|
|
|
|
actualPay: undefined,
|
|
|
|
|
theTipElectric: undefined,
|
|
|
|
|
theTipPrice: undefined,
|
|
|
|
|
theTipExpense: undefined,
|
|
|
|
|
peakElectric: undefined,
|
|
|
|
|
peakPrice: undefined,
|
|
|
|
|
peakExpense: undefined,
|
|
|
|
|
flatElectric: undefined,
|
|
|
|
|
flatPrice: undefined,
|
|
|
|
|
flatExpense: undefined,
|
|
|
|
|
theValleyElectric: undefined,
|
|
|
|
|
theValleyPrice: undefined,
|
|
|
|
|
theValleyExpense: undefined,
|
|
|
|
|
amendElectric: undefined,
|
|
|
|
|
amendExpense: undefined,
|
|
|
|
|
theTipElectricAcMeter: 0,
|
|
|
|
|
peakElectricAcMeter: 0,
|
|
|
|
|
flatElectricAcMeter: 0,
|
|
|
|
|
theValleyElectricAcMeter: undefined,
|
|
|
|
|
theTipExpenseAcMeter: undefined,
|
|
|
|
|
peakExpenseAcMeter: undefined,
|
|
|
|
|
flatExpenseAcMeter: 0,
|
|
|
|
|
theValleyExpenseAcMeter: undefined,
|
|
|
|
|
amendElectricAcMeter: undefined,
|
|
|
|
|
amendExpenseAcMeter: undefined,
|
|
|
|
|
beforeChargingElectric: undefined,
|
|
|
|
|
afterChargingElectric: undefined,
|
|
|
|
|
freeCharge: undefined,
|
|
|
|
|
reportingMode: undefined,
|
|
|
|
|
orderStatus: undefined,
|
|
|
|
|
epm: undefined,
|
|
|
|
|
replenishmentFlag: undefined,
|
|
|
|
|
priceId: undefined,
|
|
|
|
|
dateId: undefined,
|
|
|
|
|
timeId: undefined,
|
|
|
|
|
userId: undefined,
|
|
|
|
|
batteryNo: undefined
|
|
|
|
|
})
|
|
|
|
|
const formRules = reactive({
|
|
|
|
|
// stationNo: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
stationNo: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
chargeSeriaNumber: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
chargeOrder: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
chargerGunNo: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
batteryId: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
startTime: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
endTime: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
startSoc: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
endSoc: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
startSoe: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
endSoe: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
chargingCapacity: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
chargingTime: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
vin: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
status: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
totalFeeBeforeDiscount: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
discountFee: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
totalFee: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
actualPay: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
theTipElectric: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
theTipPrice: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
theTipExpense: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
peakElectric: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
peakPrice: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
peakExpense: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
flatElectric: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
flatPrice: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
flatExpense: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
theValleyElectric: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
theValleyPrice: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
theValleyExpense: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
amendElectric: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
amendExpense: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
theTipElectricAcMeter: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
peakElectricAcMeter: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
flatElectricAcMeter: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
theValleyElectricAcMeter: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
theTipExpenseAcMeter: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
peakExpenseAcMeter: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
flatExpenseAcMeter: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
theValleyExpenseAcMeter: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
amendElectricAcMeter: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
amendExpenseAcMeter: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
beforeChargingElectric: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
afterChargingElectric: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
freeCharge: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
reportingMode: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
orderStatus: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
epm: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
replenishmentFlag: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
priceId: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
dateId: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
timeId: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
userId: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
|
|
batteryNo: [{ required: true, message: '不能为空', trigger: 'blur' }]
|
|
|
|
|
})
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
|
|
|
|
|
/** 打开弹窗 */
|
|
|
|
|
const open = async (type: string, id?: number) => {
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
dialogTitle.value = t('action.' + type)
|
|
|
|
|
formType.value = type
|
|
|
|
|
resetForm()
|
|
|
|
|
// 修改时,设置数据
|
|
|
|
|
if (id) {
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
try {
|
|
|
|
|
formData.value = await OutChargeOrderApi.getOutChargeOrder(id)
|
|
|
|
|
} finally {
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
|
|
|
|
|
|
|
/** 提交表单 */
|
|
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
|
|
const submitForm = async () => {
|
|
|
|
|
// 校验表单
|
|
|
|
|
await formRef.value.validate()
|
|
|
|
|
// 提交请求
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const data = formData.value as unknown as OutChargeOrderApi.OutChargeOrderVO
|
|
|
|
|
if (formType.value === 'create') {
|
|
|
|
|
await OutChargeOrderApi.createOutChargeOrder(data)
|
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|
|
} else {
|
|
|
|
|
await OutChargeOrderApi.updateOutChargeOrder(data)
|
|
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
|
|
}
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
// 发送操作成功的事件
|
|
|
|
|
emit('success')
|
|
|
|
|
} finally {
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 重置表单 */
|
|
|
|
|
const resetForm = () => {
|
|
|
|
|
formData.value = {
|
|
|
|
|
id: undefined,
|
|
|
|
|
stationNo: undefined,
|
|
|
|
|
chargeSeriaNumber: undefined,
|
|
|
|
|
chargeOrder: undefined,
|
|
|
|
|
chargerGunNo: undefined,
|
|
|
|
|
batteryId: undefined,
|
|
|
|
|
startTime: undefined,
|
|
|
|
|
endTime: undefined,
|
|
|
|
|
startSoc: undefined,
|
|
|
|
|
endSoc: undefined,
|
|
|
|
|
startSoe: undefined,
|
|
|
|
|
endSoe: undefined,
|
|
|
|
|
chargingCapacity: undefined,
|
|
|
|
|
chargingTime: undefined,
|
|
|
|
|
vin: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
|
totalFeeBeforeDiscount: undefined,
|
|
|
|
|
discountFee: undefined,
|
|
|
|
|
totalFee: undefined,
|
|
|
|
|
actualPay: undefined,
|
|
|
|
|
theTipElectric: undefined,
|
|
|
|
|
theTipPrice: undefined,
|
|
|
|
|
theTipExpense: undefined,
|
|
|
|
|
peakElectric: undefined,
|
|
|
|
|
peakPrice: undefined,
|
|
|
|
|
peakExpense: undefined,
|
|
|
|
|
flatElectric: undefined,
|
|
|
|
|
flatPrice: undefined,
|
|
|
|
|
flatExpense: undefined,
|
|
|
|
|
theValleyElectric: undefined,
|
|
|
|
|
theValleyPrice: undefined,
|
|
|
|
|
theValleyExpense: undefined,
|
|
|
|
|
amendElectric: undefined,
|
|
|
|
|
amendExpense: undefined,
|
|
|
|
|
theTipElectricAcMeter: 0,
|
|
|
|
|
peakElectricAcMeter: 0,
|
|
|
|
|
flatElectricAcMeter: 0,
|
|
|
|
|
theValleyElectricAcMeter: undefined,
|
|
|
|
|
theTipExpenseAcMeter: undefined,
|
|
|
|
|
peakExpenseAcMeter: undefined,
|
|
|
|
|
flatExpenseAcMeter: 0,
|
|
|
|
|
theValleyExpenseAcMeter: undefined,
|
|
|
|
|
amendElectricAcMeter: undefined,
|
|
|
|
|
amendExpenseAcMeter: undefined,
|
|
|
|
|
beforeChargingElectric: undefined,
|
|
|
|
|
afterChargingElectric: undefined,
|
|
|
|
|
freeCharge: undefined,
|
|
|
|
|
reportingMode: undefined,
|
|
|
|
|
orderStatus: undefined,
|
|
|
|
|
epm: undefined,
|
|
|
|
|
replenishmentFlag: undefined,
|
|
|
|
|
priceId: undefined,
|
|
|
|
|
dateId: undefined,
|
|
|
|
|
timeId: undefined
|
|
|
|
|
}
|
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
|
}
|
|
|
|
|
</script>
|