feat: support indefinite borrow period for long-term asset allocation

This commit is contained in:
DXC
2026-03-18 10:57:21 +08:00
parent 79d4a365e0
commit 1e38696e68
2 changed files with 33 additions and 6 deletions

View File

@ -46,6 +46,9 @@
<el-tag type="success" size="small">实际</el-tag>
{{ row.return_time || '-' }}
</div>
<div v-else-if="!row.expected_return_time">
<el-tag type="primary" size="small">无限期</el-tag>
</div>
<div v-else>
<el-tag type="info" size="small">预计</el-tag>
{{ formatExpectedTime(row.expected_return_time).text }}
@ -163,7 +166,7 @@ const handlePage = (val: number) => {
// ★ 新增:格式化预计归还时间及倒计时逻辑
const formatExpectedTime = (timeStr: string) => {
if (!timeStr) return { text: '-', diffText: '', cssClass: '' }
if (!timeStr) return { text: '无限期', diffText: '', cssClass: '' }
// 后端返回的可能是 YYYY-MM-DD HH:mm:ss,我们只取日期部分比较
const expected = dayjs(timeStr).startOf('day')