This commit is contained in:
2025-01-20 12:10:22 +08:00
parent 1dc15aae3b
commit 69d5cbfa73

View File

@@ -52,7 +52,9 @@
"
>
<a-form-item label="实付款金额" name="payPrice">
<span class="ele-text-warning">¥{{ formatNumber(data.payPrice) }}</span>
<span class="ele-text-warning"
>¥{{ formatNumber(data.payPrice) }}</span
>
</a-form-item>
</a-col>
<a-col
@@ -213,22 +215,18 @@
v-if="Number(record.equipmentCategory) === 10"
color="success"
>销售
</a-tag
>
</a-tag>
<a-tag v-if="Number(record.equipmentCategory) === 20" color="red"
>分期
</a-tag
>
</a-tag>
<a-tag
v-if="Number(record.equipmentCategory) === 30"
color="orange"
>以租代购
</a-tag
>
</a-tag>
<a-tag v-if="Number(record.equipmentCategory) === 40" color="blue"
>租赁
</a-tag
>
</a-tag>
</template>
<template v-if="column.key === 'more'">
<div v-if="record.periodsType > 0">
@@ -258,13 +256,11 @@
</a-card>
<a-card title="换电记录" class="order-card">
<a-spin :spinning="loading">
<a-table
:data-source="EquipmentRecordList"
:columns="columns3"
:pagination="true"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'batteryModel'">
<div>电池租金:¥{{ record.batteryRent }}</div>
@@ -278,7 +274,6 @@
<template v-if="column.key === 'duration'">
<span class="ele-text-danger">{{ countDuration(record) }}</span>
</template>
</template>
</a-table>
</a-spin>
@@ -292,10 +287,15 @@
:pagination="true"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'orderNo'">
<span :class="[record.isAdminRenew === 1 ? 'ele-text-primary' : '']">{{ record.orderNo }}</span>
</template>
<template v-if="column.key === 'batteryModel'">
<div :class="[record.isAdminRenew === 1 ? 'ele-text-primary' : '']">
<div>电池租金:¥{{ record.batteryRent }}</div>
<div>电池押金:¥{{ record.batteryDeposit }}</div>
<div>电池保险:¥{{ record.batteryInsurance }}</div>
</div>
</template>
<template v-if="column.key === 'expirationTime'">
<div>{{ record.startTime }}</div>
@@ -306,11 +306,10 @@
</template>
<template v-if="column.key === 'action'">
<view>
<a-button
@click="openOrderOnline(record)"
>续费该设备</a-button>
<a-button @click="openOrderOnline(record)"
>续费该设备
</a-button>
</view>
</template>
@@ -318,16 +317,17 @@
<view v-if="record.orderSource === 10">
<span>一次性购买</span>
</view>
<view v-else>
<view
v-else
:class="[record.isAdminRenew === 1 ? 'ele-text-primary' : '']"
>
<span>第{{ record.currPeriods }}期</span>
<view v-if="record.isAdminRenew === 1">
<span> (后台续费)</span>
</view>
</view>
</template>
</template>
</a-table>
</a-spin>
</a-card>
@@ -388,7 +388,6 @@
<span>{{ data.address }}</span>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col
@@ -431,7 +430,6 @@
:data="current"
@done="getRenewOrder"
/>
</ele-modal>
</template>
@@ -449,7 +447,10 @@ import {listEquipmentOrderGoods} from '@/api/apps/equipment/order/goods';
import { EquipmentOrderGoods } from '@/api/apps/equipment/order/goods/model';
import * as EquipmentApi from '@/api/apps/equipment';
import * as EquipmentRecordApi from '@/api/apps/equipment/record';
import {ColumnItem, DatasourceFunction} from 'ele-admin-pro/es/ele-pro-table/types';
import {
ColumnItem,
DatasourceFunction
} from 'ele-admin-pro/es/ele-pro-table/types';
import { listOrder, listOrderPay } from '@/api/order';
import { CopyOutlined } from '@ant-design/icons-vue';
import { EquipmentRecord } from '@/api/apps/equipment/record/model';
@@ -641,7 +642,7 @@ const columns2 = ref<ColumnItem[]>([
align: 'center',
fixed: 'left',
hideInSetting: true
},
}
]);
const columns3 = ref<ColumnItem[]>([
{
@@ -743,7 +744,6 @@ const getEquipmentOrderGoods = () => {
});
};
/* 线下缴费 */
const openOrderOnline = (row?: Order) => {
current.value = row ?? null;
@@ -780,7 +780,6 @@ const getRenewOrder = () => {
loading.value = false;
});
}
};
const getEquipmentRecordList = () => {
@@ -813,7 +812,7 @@ const expirationDay = (order) => {
const setTime = new Date(order.expirationTime);
const nowTime = new Date();
const restSec = setTime.getTime() - nowTime.getTime();
console.log("计算剩余天数");
console.log('计算剩余天数');
console.log(restSec);
// 剩余天数
const day = parseInt(String(restSec / (60 * 60 * 24 * 1000)));
@@ -822,12 +821,13 @@ const expirationDay = (order) => {
}
};
const countDuration = (equipmentRecord) =>{//计算使用时间
if (equipmentRecord.eventType ==="电池解绑"){
const countDuration = (equipmentRecord) => {
//计算使用时间
if (equipmentRecord.eventType === '电池解绑') {
if (equipmentRecord.duration !== null) {
return equipmentRecord.duration+'天'
return equipmentRecord.duration + '天';
}
return '0天'
return '0天';
} else {
if (equipmentRecord.duration !== null) {
return equipmentRecord.duration + '天';
@@ -835,7 +835,7 @@ const countDuration = (equipmentRecord) =>{//计算使用时间
return '';
}
}
}
};
const getFiles = () => {
if (order.orderSourceData != '') {
@@ -851,8 +851,7 @@ const getFiles = () => {
};
/* 保存编辑 */
const save = () => {
};
const save = () => {};
watch(
() => props.visible,