修复缴费记录逾期天数问题

This commit is contained in:
2025-08-07 23:20:20 +08:00
parent a1a681c84e
commit 5146d52e46
2 changed files with 70 additions and 47 deletions

View File

@@ -119,6 +119,7 @@ export interface OrderPay {
currPeriods?:number;//当前期数 currPeriods?:number;//当前期数
isAdminRenew?:number;//是否管理员学费 isAdminRenew?:number;//是否管理员学费
orderPays?: OrderPay[]
} }

View File

@@ -31,10 +31,10 @@
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'restDay'"> <template v-if="column.key === 'restDay'">
<strong v-if="record.restDay < 0" :style="{ color: 'red' }">{{ <strong v-if="record.restDay < 0" :style="{ color: 'red' }">{{
record.restDay record.restDay
}}</strong> }}</strong>
<span v-else-if="record.restDay >= 0">{{ record.restDay }}</span> <span v-else-if="record.restDay >= 0">{{ record.restDay }}</span>
<span> </span> <span v-if="record.restDay !== ''"> </span>
</template> </template>
<template v-if="column.key === 'merchantName'"> <template v-if="column.key === 'merchantName'">
<div style="display: flex; flex-direction: column"> <div style="display: flex; flex-direction: column">
@@ -52,7 +52,8 @@
<form-outlined <form-outlined
v-if="record.payStatus === 10" v-if="record.payStatus === 10"
@click="onEdit('totalPayPrice', record.totalPrice, record)" @click="onEdit('totalPayPrice', record.totalPrice, record)"
/></p> />
</p>
<p class="ele-text-placeholder" <p class="ele-text-placeholder"
>(含运费{{ record.expressPrice }})</p >(含运费{{ record.expressPrice }})</p
> >
@@ -66,17 +67,17 @@
</template> </template>
<template v-if="column.key === 'payMethod'"> <template v-if="column.key === 'payMethod'">
<a-tag v-if="record.payMethod === '10'" color="orange" <a-tag v-if="record.payMethod === '10'" color="orange"
>余额支付</a-tag >余额支付
> </a-tag>
<a-tag v-if="record.payMethod === '20'" color="green" <a-tag v-if="record.payMethod === '20'" color="green"
>微信支付</a-tag >微信支付
> </a-tag>
<a-tag v-if="record.payMethod === '30'" color="blue" <a-tag v-if="record.payMethod === '30'" color="blue"
>支付宝</a-tag >支付宝
> </a-tag>
<a-tag v-if="record.payMethod === '40'" color="purple" <a-tag v-if="record.payMethod === '40'" color="purple"
>通联支付</a-tag >通联支付
> </a-tag>
</template> </template>
<template v-if="column.key === 'deliveryType'"> <template v-if="column.key === 'deliveryType'">
<span v-if="record.deliveryType === 10">快递配送</span> <span v-if="record.deliveryType === 10">快递配送</span>
@@ -88,37 +89,37 @@
<a-tag <a-tag
v-if="record.payStatus === 10" v-if="record.payStatus === 10"
@click="onAlipayQuery(record.orderId)" @click="onAlipayQuery(record.orderId)"
>未付款</a-tag >未付款
> </a-tag>
<a-tag v-if="record.payStatus === 20" color="green" <a-tag v-if="record.payStatus === 20" color="green"
>已付款</a-tag >已付款
> </a-tag>
</div> </div>
<div class="ele-text-placeholder"> <div class="ele-text-placeholder">
<!-- 发货状态--> <!-- 发货状态-->
<a-tag v-if="record.deliveryStatus === 10">未发货</a-tag> <a-tag v-if="record.deliveryStatus === 10">未发货</a-tag>
<a-tag v-else-if="record.deliveryStatus === 20" color="success" <a-tag v-else-if="record.deliveryStatus === 20" color="success"
>已发货</a-tag >已发货
> </a-tag>
</div> </div>
<div class="ele-text-placeholder"> <div class="ele-text-placeholder">
<!-- 收货状态--> <!-- 收货状态-->
<a-tag v-if="record.receiptStatus === 10">未收货</a-tag> <a-tag v-if="record.receiptStatus === 10">未收货</a-tag>
<a-tag v-else-if="record.receiptStatus === 20" color="success" <a-tag v-else-if="record.receiptStatus === 20" color="success"
>已收货</a-tag >已收货
> </a-tag>
<a-tag v-else-if="record.receiptStatus === 21" color="purple" <a-tag v-else-if="record.receiptStatus === 21" color="purple"
>退租中</a-tag >退租中
> </a-tag>
<a-tag v-else-if="record.receiptStatus === 30" color="error" <a-tag v-else-if="record.receiptStatus === 30" color="error"
>已退租</a-tag >已退租
> </a-tag>
</div> </div>
<div class="ele-text-placeholder" v-if="record.orderSource != 10"> <div class="ele-text-placeholder" v-if="record.orderSource != 10">
<!-- 分期状态--> <!-- 分期状态-->
<a-tag v-if="record.fenqiStatus == 1" color="success" <a-tag v-if="record.fenqiStatus == 1" color="success"
>已完成</a-tag >已完成
> </a-tag>
<!-- <a-tag v-else-if="record.expirationDay < 0" color="error">逾期{{ record.expirationDay }}</a-tag> --> <!-- <a-tag v-else-if="record.expirationDay < 0" color="error">逾期{{ record.expirationDay }}</a-tag> -->
<!-- <a-tag v-else-if="record.expirationDay >= 0" color="warning">剩余{{ record.expirationDay }}</a-tag> --> <!-- <a-tag v-else-if="record.expirationDay >= 0" color="warning">剩余{{ record.expirationDay }}</a-tag> -->
</div> </div>
@@ -155,20 +156,20 @@
</template> </template>
<template v-if="column.key === 'orderSource'"> <template v-if="column.key === 'orderSource'">
<a-tag v-if="Number(record.orderSource) === 10" color="success" <a-tag v-if="Number(record.orderSource) === 10" color="success"
>销售</a-tag >销售
> </a-tag>
<a-tag v-if="Number(record.orderSource) === 20" color="red" <a-tag v-if="Number(record.orderSource) === 20" color="red"
>分期</a-tag >分期
> </a-tag>
<a-tag v-if="Number(record.orderSource) === 30" color="orange" <a-tag v-if="Number(record.orderSource) === 30" color="orange"
>以租代购</a-tag >以租代购
> </a-tag>
<a-tag v-if="Number(record.orderSource) === 40" color="blue" <a-tag v-if="Number(record.orderSource) === 40" color="blue"
>租赁</a-tag >租赁
> </a-tag>
<a-tag v-if="Number(record.orderSource) === 50" color="success" <a-tag v-if="Number(record.orderSource) === 50" color="success"
>续租</a-tag >续租
> </a-tag>
</template> </template>
<template v-if="column.key === 'nickname'"> <template v-if="column.key === 'nickname'">
<User :record="record" /> <User :record="record" />
@@ -179,26 +180,34 @@
<template v-if="column.key === 'equipmentCode'"> <template v-if="column.key === 'equipmentCode'">
{{ record.equipment?.equipmentCode }} {{ record.equipment?.equipmentCode }}
</template> </template>
<template v-if="column.key === 'expirationTime'">
{{
record.orderPays && record.orderPays.length > 0
? record.orderPays[record.orderPays.length - 1].expirationTime
: record.expirationTime
}}
</template>
<template v-if="column.key === 'createTime'"> <template v-if="column.key === 'createTime'">
{{ record.createTime }} {{ record.createTime }}
</template> </template>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<a-space> <a-space>
<a-button class="ele-text-primary" @click="openInfo(record)" <a-button class="ele-text-primary" @click="openInfo(record)"
>详情</a-button >详情
> </a-button>
</a-space> </a-space>
<view v-if="record.deliveryStatus == 40"> <view v-if="record.deliveryStatus == 40">
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-button class="ele-text-danger" @click="openChange(record)" <a-button class="ele-text-danger" @click="openChange(record)"
>换电</a-button >换电
> </a-button>
</view> </view>
<view v-if="record.receiptStatus === 20"> <view v-if="record.receiptStatus === 20">
<a-button <a-button
class="ele-text-danger" class="ele-text-danger"
@click="openOrderRefund(record)" @click="openOrderRefund(record)"
>退租</a-button> >退租
</a-button>
</view> </view>
</template> </template>
</template> </template>
@@ -270,6 +279,7 @@
import { getDictionaryOptions } from '@/utils/common'; import { getDictionaryOptions } from '@/utils/common';
import { Equipment } from '@/api/apps/equipment/model'; import { Equipment } from '@/api/apps/equipment/model';
import { utils, writeFile } from 'xlsx'; import { utils, writeFile } from 'xlsx';
import dayjs from "dayjs";
// 当前用户信息 // 当前用户信息
// const userStore = useUserStore(); // const userStore = useUserStore();
@@ -312,10 +322,10 @@
sorter: true sorter: true
}, },
/* { /* {
title: '商品编号', title: '商品编号',
dataIndex: 'goodsId', dataIndex: 'goodsId',
key: 'goodsId' key: 'goodsId'
}, */ }, */
{ {
title: '电池型号', title: '电池型号',
dataIndex: 'batteryModel', dataIndex: 'batteryModel',
@@ -341,7 +351,6 @@
}, },
{ {
title: '到期时间', title: '到期时间',
dataIndex: 'expirationTime',
key: 'expirationTime', key: 'expirationTime',
sorter: true sorter: true
}, },
@@ -477,7 +486,7 @@
const showAdvancedSearch = ref(false); const showAdvancedSearch = ref(false);
// 表格数据源 // 表格数据源
const datasource: DatasourceFunction = ({ const datasource: DatasourceFunction = async ({
page, page,
limit, limit,
where, where,
@@ -500,12 +509,17 @@
where.tenantId = localStorage.getItem('tenantId'); where.tenantId = localStorage.getItem('tenantId');
where.isRenew = 0; where.isRenew = 0;
where.isFreeze = 1; where.isFreeze = 1;
return pageOrder({ const res = await pageOrder({
...where, ...where,
...orders, ...orders,
page, page,
limit limit
}); });
res.list.map(item => {
item.restDay = calRestDay(item);
return item
})
return res
}; };
// 导出 // 导出
const handleExport = () => { const handleExport = () => {
@@ -600,6 +614,11 @@
showEdit.value = true; showEdit.value = true;
}; };
const calRestDay = (row: Order) => {
if (!row.orderPays || row.orderPays.length == 0) return ''
return dayjs(row.orderPays[row.orderPays.length - 1].expirationTime).diff(dayjs(), 'd')
};
const onEditContent = (name, text, item) => { const onEditContent = (name, text, item) => {
orderId.value = item.orderId; orderId.value = item.orderId;
field.value = name; field.value = name;
@@ -716,6 +735,7 @@
p { p {
line-height: 0.8; line-height: 0.8;
} }
.sys-org-table :deep(.ant-table-body) { .sys-org-table :deep(.ant-table-body) {
overflow: auto !important; overflow: auto !important;
overflow: overlay !important; overflow: overlay !important;
@@ -725,9 +745,11 @@
padding: 0 4px; padding: 0 4px;
margin-bottom: 0; margin-bottom: 0;
} }
.price-edit { .price-edit {
padding-right: 5px; padding-right: 5px;
} }
.comments { .comments {
max-width: 200px; max-width: 200px;
} }