From 418594d0a3e441eeb7df2abbd70e54a0c72284c6 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期五, 30 十月 2026 16:35:46 +0800
Subject: [PATCH] feat(order): 添加送样日期校验和权限刷新机制 - 在委托单新增表单中为送样日期添加占位提示和保存校验 - 在检验审核、检验任务、报告编制、样品接收、报告结果、用印台账等页面添加送样时间列 - 加载委托模板时清空送样日期并清除校验状态
---
src/utils/reportDocxLayout.js | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/utils/reportDocxLayout.js b/src/utils/reportDocxLayout.js
index ff2ae3f..8b081a6 100644
--- a/src/utils/reportDocxLayout.js
+++ b/src/utils/reportDocxLayout.js
@@ -164,6 +164,21 @@
return changed ? documentXml : null
}
+function clearDefaultSequenceUnderlines(xml) {
+ return xml.replace(resultTablePattern, table => {
+ if (!table.includes('搴忓彿') || !/(妫�娴嬬粨鏋渱妫�楠岀粨鏋�)/.test(table)) return table
+ return table.replace(tableRowPattern, row => row.replace(tableCellPattern, (cell, offset) => {
+ if (offset !== row.indexOf('<w:tc')) return cell
+ const text = [...cell.matchAll(/<w:t\b(?![^>]*\/>)[^>]*>([\s\S]*?)<\/w:t>/g)]
+ .map(match => match[1]).join('').trim()
+ if (!/^\d+$/.test(text)) return cell
+ // 鏃ф姤鍛婁腑鐨� <w:u w:color="auto"/> 榛樿浼氳瑙i噴鎴愬崟涓嬪垝绾裤��
+ // 鏄惧紡璁剧疆浜嗙被鍨嬬殑涓嬪垝绾夸繚鐣欙紝鍏佽鐢ㄦ埛鑷淇敼搴忓彿鏍煎紡銆�
+ return cell.replace(/<w:u\b[^>]*\/>/g, tag => /\bw:val=/.test(tag) ? tag : '')
+ }))
+ })
+}
+
export async function normalizeReportDocxForEditor(blob, reportCode) {
const zip = await JSZip.loadAsync(blob)
const documentPart = zip.file('word/document.xml')
@@ -173,6 +188,7 @@
const themeXml = themePart ? await themePart.async('string') : ''
const themeFonts = { major: chineseThemeFont(themeXml, 'major'), minor: chineseThemeFont(themeXml, 'minor') }
let normalizedXml = alignResultTable(documentXml) || documentXml
+ normalizedXml = clearDefaultSequenceUnderlines(normalizedXml)
normalizedXml = fitCoverCustomer(normalizedXml) || normalizedXml
normalizedXml = materializeChineseThemeFonts(normalizedXml, themeFonts) || normalizedXml
let changed = normalizedXml !== documentXml
--
Gitblit v1.9.3