feat(电子发票): 优化发票应用状态提示
build.yaml / build (push) Successful in 44s

This commit is contained in:
xiaoqidun committed 2026-10-16 19:30:52 +08:00
1 parent 06714b7150
commit e7a8bf89de
1 file changed
+8 -3
+8 -3
View File
@@ -5744,6 +5744,10 @@ function invoiceSetValue(invoice, field, item, value) {
}
function invoiceIssues(issues, details = false) {
const codes = {
"appearance-not-synchronized": "票面未同步",
"signature-review-required": "修改后需重新验签"
};
const messages = {
"unsupported invoice XML root or version": "暂不支持此发票格式或版本",
"unsupported eInvoice namespace or version": "暂不支持此发票格式或版本",
@@ -5754,7 +5758,7 @@ function invoiceIssues(issues, details = false) {
const message = typeof issue === "string" ? issue : issue.message || issue.code;
if (typeof issue === "string") return details ? message : messages[message] || message;
if (details) return [issue.source?.fileLoc || issue.source?.id || issue.source?.kind, issue.source?.nodePath, issue.field, message].filter(Boolean).join(":");
return [issue.field, messages[message] || message].filter(Boolean).join(":");
return [issue.field, codes[issue.code] || messages[message] || message].filter(Boolean).join(":");
}).filter(Boolean))].join("\n");
}
@@ -6420,8 +6424,9 @@ async function commitInvoice(draft, request) {
await loadDocumentSettings();
const warning = invoiceIssues(result?.issues);
if (warning) {
if (invoiceCurrent()) invoiceCurrent().status = warning;
settingsElements.Status.textContent = warning;
const status = "已保存;" + warning;
if (invoiceCurrent()) invoiceCurrent().status = status;
settingsElements.Status.textContent = status;
}
} finally {
settings.busy = false;