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