+
@@ -104,7 +111,7 @@
+ accept=".pdf,.jpg,.jpeg,.png" class="row-upload">
@@ -350,26 +357,27 @@ export default {
const res = await ocrReimburseInvoice(ossId)
if (res.code === 200 && res.data) {
const { items, totalAmount, sellerName, invoiceDate, invoiceType } = res.data
- // 拼接发票头部信息作为事由前缀:发票类型 · 销售方 · 开票日期
+ // 发票头部信息(类型 · 销售方 · 开票日期)作为标题前缀,PDF 票据才有
const prefix = [invoiceType, sellerName, invoiceDate].filter(Boolean).join(' · ')
if (items && items.length) {
const startIdx = this.invoiceItems.length
items.forEach((item, i) => {
- const reason = [prefix, item.itemName].filter(Boolean).join(' / ')
+ // 标题 = 识别结果(图片单据直接为 AI 标题;PDF 票据拼接发票头部)
+ const title = [prefix, item.itemName].filter(Boolean).join(' / ')
this.invoiceItems.push({
ossId: ossId,
- itemName: item.itemName || '',
- reason,
+ itemName: title,
+ reason: '', // 事由由用户手动填写
amount: item.amount || 0,
sortNo: startIdx + i
})
})
} else if (totalAmount) {
- // 没有明细时用总金额创建一条,事由取发票头部信息
+ // 没有明细时用总金额创建一条,标题取发票头部信息
this.invoiceItems.push({
ossId: ossId,
- itemName: sellerName || '',
- reason: prefix || '',
+ itemName: prefix || sellerName || '',
+ reason: '',
amount: totalAmount,
sortNo: this.invoiceItems.length
})
@@ -383,10 +391,10 @@ export default {
this.invoiceItems.push({ ossId: ossId, itemName: '', reason: '', amount: 0, sortNo: this.invoiceItems.length })
}
} catch (e) {
- console.error('[Invoice] 解析失败', e)
+ console.error('[Invoice] 识别失败', e)
const msg = (e && e.msg) || (e && e.message) || ''
this.$message.warning(
- '发票解析失败,请确认上传的是开票平台下载的正规 PDF 电子发票(数电票 / 电子普通发票 / 电子专用发票)。' +
+ '单据识别失败,已为你添加空白条目,可手动填写标题、事由与金额。' +
(msg ? ' 错误信息:' + msg : '')
)
this.invoiceItems.push({ ossId: ossId, itemName: '', reason: '', amount: 0, sortNo: this.invoiceItems.length })
@@ -523,8 +531,8 @@ export default {
invoiceItems: this.invoiceItems.map((item, i) => ({
ossId: item.ossId || null,
sortNo: i,
- itemName: item.itemName || '',
- reason: item.reason || item.itemName || '',
+ itemName: item.itemName || '', // 标题
+ reason: item.reason || '', // 事由(手写)
amount: item.amount || 0
}))
}
@@ -661,6 +669,10 @@ export default {
&:last-child { border-bottom: none; }
}
+.col-title {
+ flex: 1;
+}
+
.col-reason {
flex: 1;
}
@@ -685,6 +697,7 @@ export default {
justify-content: center;
}
+.invoice-table-header .col-title { flex: 1; }
.invoice-table-header .col-reason { flex: 1; }
.invoice-table-header .col-amount { width: 140px; }
.invoice-table-header .col-file { width: 64px; }
diff --git a/ruoyi-ui/src/views/hrm/requests/reimburseDetail.vue b/ruoyi-ui/src/views/hrm/requests/reimburseDetail.vue
index e60f0dd..bd96df5 100644
--- a/ruoyi-ui/src/views/hrm/requests/reimburseDetail.vue
+++ b/ruoyi-ui/src/views/hrm/requests/reimburseDetail.vue
@@ -17,11 +17,11 @@
- 发票明细
+ 单据明细
-
+
¥{{ row.amount }}
diff --git a/ruoyi-ui/src/views/oa/task/requirement/index.vue b/ruoyi-ui/src/views/oa/task/requirement/index.vue
index 753c302..0d854e4 100644
--- a/ruoyi-ui/src/views/oa/task/requirement/index.vue
+++ b/ruoyi-ui/src/views/oa/task/requirement/index.vue
@@ -66,13 +66,47 @@
-
-
-
-
-
-
-
+
+
+
+
+ 详情
+ 完成
+ 修改
+ 删除
+
+
+
+
+
+ {{ row.title }}
+
+
+
+
+
+
+ {{ row.requesterNickName }}
+
+
+
+
+
+
+ {{ row.ownerNickName }}
+
+
+
+
+
+
+ {{ row.projectName }}
+
+
+
+
@@ -85,24 +119,21 @@
未关联
-
+
- {{ row.description }}
+
+ {{ row.description }}
+
无
-
+
- {{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}
+ {{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}
+ {{ parseTime(scope.row.deadline, '{y}-{m}-{d}') }}
-
-
- {{ parseTime(scope.row.deadline, '{y}-{m}-{d}') }}
-
-
-
+
@@ -131,7 +162,7 @@
-
+
无
-
-
- 完成
- 修改
- 删除
- 详情
-
-