Commit 553b5d2c by liangjianmin

fix(createConsignmentRecallOrder): 优化导入失败提示信息

修改导入成功和失败的提示信息,增加失败数据的详细列表展示。
调整样式以改善用户体验,确保信息清晰易读。
parent a8ef4e78
......@@ -451,15 +451,23 @@
handleUploadSuccess(res) {
this.uploadLoading = false;
if (res.code === 0) {
var { success_total = 0, fail_total = 0, fail_list, success_list } = res.data || {};
var failMsg = ''
if(fail_list.length){
failMsg += `失败原因:\n`;
failMsg = fail_list.map(item => item.remark).join(';\n');
}
this.recall_json = success_list
var { success_total = 0, fail_total = 0, fail_list = [], success_list = [] } = res.data || {};
this.recall_json = success_list;
this.$message.success(`导入完成,成功 ${success_total} 条,失败 ${fail_total} 条`);
failMsg && this.$alert(failMsg);
if (fail_list.length) {
var listHtml = fail_list
.map(item => `<li style="margin-bottom:6px;line-height:1.6;word-break:break-all;">${item.remark || ''}</li>`)
.join('');
var html = `
<div style="margin-bottom:8px;color:#f56c6c;font-size:13px;">共 ${fail_list.length} 条数据导入失败:</div>
<ol style="max-height:50vh;overflow-y:auto;margin:0;padding:8px 8px 8px 28px;border:1px solid #ebeef5;border-radius:4px;background:#fafafa;color:#606266;font-size:13px;">${listHtml}</ol>
`;
this.$alert(html, '导入失败明细', {
dangerouslyUseHTMLString: true,
customClass: 'recall-import-error-dialog',
confirmButtonText: '我知道了'
});
}
this.getData();
} else {
this.$message.error(res.msg || '导入失败');
......@@ -567,3 +575,12 @@
}
}
</style>
<style>
.recall-import-error-dialog {
width: 560px !important;
max-width: 90vw;
}
.recall-import-error-dialog .el-message-box__message {
max-height: none;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment