|
|
|
@ -262,7 +262,7 @@ |
|
|
|
if (this.cacheTimer) { |
|
|
|
clearTimeout(this.cacheTimer); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 设置新的定时器,500ms后执行保存 |
|
|
|
this.cacheTimer = setTimeout(() => { |
|
|
|
try { |
|
|
|
@ -315,7 +315,7 @@ |
|
|
|
init () { |
|
|
|
this.fileList = [] |
|
|
|
this.cacheKey = this.generateCacheKey(); |
|
|
|
|
|
|
|
|
|
|
|
let tempData = { |
|
|
|
username: this.$store.state.user.name, |
|
|
|
} |
|
|
|
@ -329,14 +329,14 @@ |
|
|
|
// 在获取BU列表后尝试加载缓存 |
|
|
|
this.loadFromCache(); |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
getCustomerList({}).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.customerList=data.rows |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 如果没有缓存数据,则初始化为空 |
|
|
|
if (!this.loadFromCache()) { |
|
|
|
this.pageData.customerName='' |
|
|
|
@ -346,7 +346,7 @@ |
|
|
|
this.pageData.overseasAddress='', |
|
|
|
this.pageData.salesArea='' |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.customerPersons=[] |
|
|
|
this.customerAddrs=[] |
|
|
|
// 打开页面 |
|
|
|
@ -481,20 +481,63 @@ |
|
|
|
formData.append("overseasAddress", this.pageData.overseasAddress) |
|
|
|
formData.append("cnative", this.pageData.cnative) |
|
|
|
formData.append("salesArea", this.pageData.salesArea) |
|
|
|
saveEcssCoDelNotifyByExcel(formData).then(({data}) => { |
|
|
|
saveEcssCoDelNotifyByExcel(formData).then(({ data }) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.$message.success(data.msg) |
|
|
|
// 保存成功后清除缓存 |
|
|
|
this.clearCache() |
|
|
|
// 关闭窗口并刷新页面 |
|
|
|
this.closeDialog() |
|
|
|
const { resultMap } = data; |
|
|
|
const successList = resultMap.success || []; |
|
|
|
const failList = resultMap.fail || []; |
|
|
|
|
|
|
|
// 紧凑样式 |
|
|
|
let html = ` |
|
|
|
<div style="max-height:380px;overflow:auto;font-size:12px;line-height:1.4;"> |
|
|
|
`; |
|
|
|
|
|
|
|
if (successList.length > 0) { |
|
|
|
html += `<div style="margin-bottom:6px;"> |
|
|
|
<div style="color:green;font-weight:bold;margin-bottom:3px;"> |
|
|
|
✅ 成功(${successList.length}) |
|
|
|
</div> |
|
|
|
<table border="1" cellspacing="0" cellpadding="2" |
|
|
|
style="border-collapse:collapse;width:100%;"> |
|
|
|
`; |
|
|
|
successList.forEach(item => { |
|
|
|
html += `<tr><td style="color:green;padding:2px 4px;">${item}</td></tr>`; |
|
|
|
}); |
|
|
|
html += `</table></div>`; |
|
|
|
} |
|
|
|
|
|
|
|
if (failList.length > 0) { |
|
|
|
html += `<div> |
|
|
|
<div style="color:red;font-weight:bold;margin-bottom:3px;"> |
|
|
|
❌ 失败(${failList.length}) |
|
|
|
</div> |
|
|
|
<table border="1" cellspacing="0" cellpadding="2" |
|
|
|
style="border-collapse:collapse;width:100%;"> |
|
|
|
`; |
|
|
|
failList.forEach(item => { |
|
|
|
html += `<tr><td style="color:red;padding:2px 4px;">${item}</td></tr>`; |
|
|
|
}); |
|
|
|
html += `</table></div>`; |
|
|
|
} |
|
|
|
|
|
|
|
html += `</div>`; |
|
|
|
|
|
|
|
this.$alert(html, '导入结果', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
callback: () => { |
|
|
|
this.clearCache(); |
|
|
|
this.closeDialog(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
//this.$message.error(data.msg) |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 下载 |
|
|
|
|