|
|
@@ -107,6 +107,7 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import BillingStrategyAPI from "@/api/operationsManage/billing-strategy-api";
|
|
|
+import { ElLoading } from "element-plus";
|
|
|
defineOptions({ name: "ChargeOrderInfo" });
|
|
|
import ChargeOrderInfoAPI, {
|
|
|
ChargeOrderInfoForm,
|
|
|
@@ -185,10 +186,10 @@ const searchConfig: ISearchConfig = reactive({
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
- label: "充电桩编号",
|
|
|
- prop: "equipmentId",
|
|
|
+ label: "终端编号",
|
|
|
+ prop: "connectorId",
|
|
|
attrs: {
|
|
|
- placeholder: "充电桩编号",
|
|
|
+ placeholder: "终端编号",
|
|
|
clearable: true,
|
|
|
style: { width: "200px" },
|
|
|
},
|
|
|
@@ -320,6 +321,7 @@ const contentConfig: IContentConfig<ChargeOrderInfoPageQuery> = reactive({
|
|
|
{ label: "充电站名称", prop: "stationName" },
|
|
|
{ label: "设备名称", prop: "connectorName" },
|
|
|
{ label: "充电桩编号", prop: "equipmentId" },
|
|
|
+ { label: "终端编号", prop: "connectorId" },
|
|
|
{ label: "充电开始时间", prop: "startTime" },
|
|
|
{ label: "充电结束时间", prop: "endTime" },
|
|
|
{
|
|
|
@@ -328,6 +330,7 @@ const contentConfig: IContentConfig<ChargeOrderInfoPageQuery> = reactive({
|
|
|
templet: "custom",
|
|
|
slotName: "chargeTime",
|
|
|
},
|
|
|
+ { label: "车辆实时充电电量", prop: "soc" },
|
|
|
{
|
|
|
label: "订单状态", //0待启动 1 充电中 2 结算中 3 已完成, 5未成功充电
|
|
|
prop: "status",
|
|
|
@@ -361,7 +364,18 @@ const contentConfig: IContentConfig<ChargeOrderInfoPageQuery> = reactive({
|
|
|
label: "操作",
|
|
|
prop: "operation",
|
|
|
templet: "tool",
|
|
|
- operat: ["edit"],
|
|
|
+ operat: [
|
|
|
+ "edit",
|
|
|
+ {
|
|
|
+ name: "fixes",
|
|
|
+ text: "修复",
|
|
|
+ attrs: {
|
|
|
+ type: "danger",
|
|
|
+ link: true,
|
|
|
+ size: "small",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
],
|
|
|
});
|
|
|
@@ -434,6 +448,35 @@ const handleOperateClick = (data: IObject) => {
|
|
|
return await ChargeOrderInfoAPI.getFormData(data.row.id);
|
|
|
});
|
|
|
}
|
|
|
+ if (data.name === "fixes") {
|
|
|
+ ElMessageBox.confirm(`确认要修复充电订单 ${data.row.chargeOrderNo} 吗?`, "修复订单确认", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ const loading = ElLoading.service({
|
|
|
+ lock: true,
|
|
|
+ text: "正在修复订单...",
|
|
|
+ background: "rgba(0, 0, 0, 0.7)",
|
|
|
+ });
|
|
|
+ ChargeOrderInfoAPI.orderFixes(data.row.chargeOrderNo)
|
|
|
+ .then((res: any) => {
|
|
|
+ ElMessage.success(res);
|
|
|
+ // 刷新列表,保持在当前分页
|
|
|
+ contentRef.value?.handleRefresh(false);
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ ElMessage.error(error?.message || "订单修复失败");
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // 用户取消操作,不做任何提示
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
// 处理工具栏按钮点击(删除等)
|
|
|
@@ -443,10 +486,10 @@ const handleToolbarClick = (name: string) => {
|
|
|
|
|
|
// 格式化秒数为时分秒
|
|
|
const formatSeconds = (seconds: number) => {
|
|
|
- if (!seconds && seconds !== 0) return '-';
|
|
|
+ if (!seconds && seconds !== 0) return "-";
|
|
|
const hours = Math.floor(seconds / 3600);
|
|
|
const minutes = Math.floor((seconds % 3600) / 60);
|
|
|
const secs = seconds % 60;
|
|
|
- return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(secs).padStart(2, '0')}`;
|
|
|
+ return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}:${String(secs).padStart(2, "0")}`;
|
|
|
};
|
|
|
</script>
|