|
|
@@ -137,9 +137,9 @@
|
|
|
<view class="detail-info-card__title">申请附件</view>
|
|
|
<view v-if="attachments.length" class="att-grid">
|
|
|
<view
|
|
|
- v-for="file in attachments"
|
|
|
+ v-for="(file, idx) in attachments"
|
|
|
:key="file.id"
|
|
|
- class="att-img"
|
|
|
+ class="att-img att-img--with-name"
|
|
|
@click="previewAtt(file)"
|
|
|
>
|
|
|
<image
|
|
|
@@ -150,6 +150,7 @@
|
|
|
<view v-else class="detail-section-empty" style="border: none; padding: 8px">
|
|
|
文件
|
|
|
</view>
|
|
|
+ <text class="att-img__name">{{ attachmentDisplayName(file, idx) }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-else class="detail-section-empty">暂无申请附件</view>
|
|
|
@@ -239,6 +240,7 @@ import {
|
|
|
} from '@/utils/bxFormat'
|
|
|
import { getSafeAreaStyle } from '@/utils/safeArea'
|
|
|
import { useUserStore } from '@/stores/user'
|
|
|
+import { buildApplyAttachmentDisplayName } from '@/utils/bxAttachmentDisplayName'
|
|
|
|
|
|
const safeAreaStyle = getSafeAreaStyle()
|
|
|
const userStore = useUserStore()
|
|
|
@@ -298,6 +300,14 @@ function previewAtt(file) {
|
|
|
uni.previewImage({ urls: [file.previewUrl], current: file.previewUrl })
|
|
|
}
|
|
|
|
|
|
+function attachmentDisplayName(file, index) {
|
|
|
+ return buildApplyAttachmentDisplayName({
|
|
|
+ remark: detail.value?.remark || '',
|
|
|
+ originalFileName: file.fileName || '',
|
|
|
+ index1: index + 1
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
async function loadExpenseFlat() {
|
|
|
try {
|
|
|
const res = await expenseItemApi.tree()
|
|
|
@@ -340,7 +350,11 @@ async function loadDetail() {
|
|
|
|
|
|
try {
|
|
|
const attRes = await attachmentApi.listByBiz('reimburse_apply', id)
|
|
|
- const list = (attRes.data || []).map((a) => ({ ...a, previewUrl: '' }))
|
|
|
+ const list = (attRes.data || []).map((a) => ({
|
|
|
+ ...a,
|
|
|
+ fileName: a.fileName || a.file_name || '',
|
|
|
+ previewUrl: ''
|
|
|
+ }))
|
|
|
await Promise.all(
|
|
|
list
|
|
|
.filter((a) => (a.fileType || '').startsWith('image/'))
|