feat: 借库归还日期贯穿申请/审批/扫码借库;BOM 套餐添加与打印、缺货写入申请原因

This commit is contained in:
yueli
2026-09-02 18:39:17 +08:00
parent bf7b2cc6d3
commit ec9aafbe51
3 changed files with 194 additions and 8 deletions

View File

@ -76,6 +76,15 @@
</template>
</el-table-column>
<el-table-column label="归还期限" width="130" align="center">
<template #default="{ row }">
<span v-if="getReturnDeadline(row)" :style="row?.items?.[0]?.is_indefinite ? 'color:#E6A23C;font-weight:bold;' : ''">
{{ getReturnDeadline(row) }}
</span>
<span v-else style="color: #909399;">未填写</span>
</template>
</el-table-column>
<el-table-column prop="created_at" label="申请时间" width="170" />
<el-table-column label="状态" width="100" align="center">
@ -219,6 +228,14 @@ const getApplicantName = (id: number | null) => {
return userNameCache.value[id] ?? `用户 #${id}`
}
// 从申请单明细快照中读取归还期限(旧申请单无此字段时返回空串)
const getReturnDeadline = (row: any) => {
const first = row?.items?.[0]
if (first?.is_indefinite) return '长期借用'
if (first?.expected_return_time) return first.expected_return_time
return ''
}
const getApproverName = (id: number | null) => {
if (!id) return '-'
return userNameCache.value[id] ?? `用户 #${id}`