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

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;//当前期数
isAdminRenew?:number;//是否管理员学费
orderPays?: OrderPay[]
}

View File

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