Merge remote-tracking branch 'origin/release/test' into dev

This commit is contained in:
2026-09-03 19:23:54 +08:00
2 changed files with 10 additions and 2 deletions
@@ -352,6 +352,9 @@ test('distills order creation into the confirmed prototype sections with server
assert.match(source, /直接选择模板内的中文下拉项,不需要填写英文代码或内部编号/)
assert.match(source, /选择木制品时,模板会要求同步选择需要商检/)
assert.match(source, /下载 Excel 错误报告/)
assert.match(source, /\^excel-row-\(\\d\+\)\$[\s\S]*item\.index \+ 3/)
assert.match(source, /Excel 第 \{\{ batchImportExcelRow\(item\) \}\} 行/)
assert.doesNotMatch(source, /未填写行标识/)
assert.match(source, /batchImportError[\s\S]*requestId[\s\S]*traceId/)
assert.match(source, /添加行[\s\S]*删除所选行/)
assert.doesNotMatch(source, /货物明细导入模板\.xls/)
@@ -1495,6 +1495,11 @@ function openBatchImport() {
batchImportOpen.value = true
}
function batchImportExcelRow(item: { index: number; clientRowId: string }) {
const matched = /^excel-row-(\d+)$/.exec(item.clientRowId)
return matched ? Number(matched[1]) : item.index + 3
}
function selectBatchImportFile(event: Event) {
const input = event.target as HTMLInputElement
const file = input.files?.[0]
@@ -2027,8 +2032,8 @@ async function searchOrders(model: QueryModel) {
<el-button type="danger" plain :loading="batchErrorReportDownloading" @click="downloadBatchErrorReport"><Download :size="16" />下载 Excel 错误报告</el-button>
</div>
<ul v-if="batchImportResult.result.failed">
<li v-for="item in batchImportResult.result.items.filter((row) => !row.success)" :key="`${item.index}-${item.clientRowId}`">
第 {{ item.index + 1 }} 行({{ item.clientRowId || '未填写行标识' }}):{{ item.errorMessage || item.errorCode || '导入失败' }}
<li v-for="item in batchImportResult.result.items.filter((row) => !row.success)" :key="item.index">
Excel 第 {{ batchImportExcelRow(item) }} 行:{{ item.errorMessage || item.errorCode || '导入失败' }}
</li>
</ul>
</section>