This commit is contained in:
messi
2024-08-20 18:45:41 +08:00
parent 0885d828e6
commit 4c5ffb4c8a
7 changed files with 226 additions and 53 deletions

View File

@@ -258,11 +258,12 @@
</a-card>
<a-card title="换电记录" class="order-card">
<a-spin :spinning="loading">
<ele-pro-table
:datasource="datasource3"
<a-table
:datasource="EquipmentRecordList"
:columns="columns3"
ref="tableRef3"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'batteryModel'">
<div>电池租金:¥{{ record.batteryRent }}</div>
@@ -278,7 +279,7 @@
</template>
</template>
</ele-pro-table>
</a-table>
</a-spin>
</a-card>
<a-card title="缴费记录" class="order-card">
@@ -446,8 +447,9 @@ const isUpdate = ref(false);
const maxAble = ref(true);
const EquipmentOrderGoodsList = ref<EquipmentOrderGoods[]>([]);
const renewOrderList = ref<Order[]>([]);
const equipmentRecordList = ref<EquipmentRecord[]>([]);
const EquipmentRecordList = ref<EquipmentRecord[]>([]);
const bindEquipmentCode = ref<string>();
const files = ref<any[]>();
// 步骤条
@@ -732,31 +734,31 @@ const getRenewOrder = () => {
};
// const getEquipmentRecordList = () => {
// EquipmentRecordApi.pageEquipmentRecord({
// orderId: order.orderId,
// userId: order.userId
// }).then((data) => {
// });
// };
const getEquipmentRecordList = () => {
EquipmentRecordApi.pageEquipmentRecord({
orderId: order.orderId,
userId: order.userId
}).then((data) => {
EquipmentRecordList.value = data.list;
});
};
// 表格数据源
const datasource3: DatasourceFunction = ({
page,
limit,
where,
orders
}) => {
where.orderId = order.orderId
where.userId = order.userId
return EquipmentRecordApi.pageEquipmentRecord({
...where,
...orders,
page,
limit
});
};
// const datasource3: DatasourceFunction = ({
// page,
// limit,
// where,
// orders
// }) => {
// where.orderId = order.orderId
// where.userId = order.userId
// return EquipmentRecordApi.pageEquipmentRecord({
// ...where,
// ...orders,
// page,
// limit
// });
// };
const expirationDay = (order) => {
const setTime = new Date(order.expirationTime);
@@ -815,7 +817,7 @@ watch(
getEquipmentOrderGoods();
getRenewOrder();
getEquipment();
// getEquipmentRecordList();
getEquipmentRecordList();
}
} else {
resetFields();