fix(client): hide batch import row identifiers
This commit is contained in:
@@ -352,6 +352,9 @@ test('distills order creation into the confirmed prototype sections with server
|
|||||||
assert.match(source, /直接选择模板内的中文下拉项,不需要填写英文代码或内部编号/)
|
assert.match(source, /直接选择模板内的中文下拉项,不需要填写英文代码或内部编号/)
|
||||||
assert.match(source, /选择木制品时,模板会要求同步选择需要商检/)
|
assert.match(source, /选择木制品时,模板会要求同步选择需要商检/)
|
||||||
assert.match(source, /下载 Excel 错误报告/)
|
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, /batchImportError[\s\S]*requestId[\s\S]*traceId/)
|
||||||
assert.match(source, /添加行[\s\S]*删除所选行/)
|
assert.match(source, /添加行[\s\S]*删除所选行/)
|
||||||
assert.doesNotMatch(source, /货物明细导入模板\.xls/)
|
assert.doesNotMatch(source, /货物明细导入模板\.xls/)
|
||||||
|
|||||||
@@ -1494,6 +1494,11 @@ function openBatchImport() {
|
|||||||
batchImportOpen.value = true
|
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) {
|
function selectBatchImportFile(event: Event) {
|
||||||
const input = event.target as HTMLInputElement
|
const input = event.target as HTMLInputElement
|
||||||
const file = input.files?.[0]
|
const file = input.files?.[0]
|
||||||
@@ -2025,8 +2030,8 @@ async function searchOrders(model: QueryModel) {
|
|||||||
<el-button type="danger" plain :loading="batchErrorReportDownloading" @click="downloadBatchErrorReport"><Download :size="16" />下载 Excel 错误报告</el-button>
|
<el-button type="danger" plain :loading="batchErrorReportDownloading" @click="downloadBatchErrorReport"><Download :size="16" />下载 Excel 错误报告</el-button>
|
||||||
</div>
|
</div>
|
||||||
<ul v-if="batchImportResult.result.failed">
|
<ul v-if="batchImportResult.result.failed">
|
||||||
<li v-for="item in batchImportResult.result.items.filter((row) => !row.success)" :key="`${item.index}-${item.clientRowId}`">
|
<li v-for="item in batchImportResult.result.items.filter((row) => !row.success)" :key="item.index">
|
||||||
第 {{ item.index + 1 }} 行({{ item.clientRowId || '未填写行标识' }}):{{ item.errorMessage || item.errorCode || '导入失败' }}
|
Excel 第 {{ batchImportExcelRow(item) }} 行:{{ item.errorMessage || item.errorCode || '导入失败' }}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Reference in New Issue
Block a user