R73-A3 优化轻交互 OCR 前端处理
这个提交包含在:
@@ -1,3 +1,5 @@
|
||||
import { formatInvoiceOcrFieldLabels } from "../lib/invoiceOcr";
|
||||
|
||||
function readStringList(value: unknown): string[] {
|
||||
if (!Array.isArray(value)) {
|
||||
return [];
|
||||
@@ -189,6 +191,14 @@ export function mapApiErrorMessage(
|
||||
return "当前环境未开启 OCR,请联系管理员或切换到 mock/tencent。";
|
||||
}
|
||||
|
||||
if (details?.ocr === "missing_required_fields") {
|
||||
const labels = formatInvoiceOcrFieldLabels(readStringList(details?.missingFields));
|
||||
if (labels.length) {
|
||||
return `票据仍缺少关键字段:${labels.join("、")},补齐后才能标记为可用。`;
|
||||
}
|
||||
return "票据仍缺少关键字段,补齐后才能标记为可用。";
|
||||
}
|
||||
|
||||
|
||||
if (details?.verification === "disabled") {
|
||||
return "当前环境未开启发票验真。";
|
||||
|
||||
在新工单中引用
屏蔽一个用户