|
|
|
@ -162,7 +162,7 @@
|
|
|
|
|
</div> |
|
|
|
|
</el-row> |
|
|
|
|
<el-dialog title="客户导入" append-to-body v-model="excelBox" width="555px"> |
|
|
|
|
<avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"> |
|
|
|
|
<!-- <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"> |
|
|
|
|
<template #excelTemplate> |
|
|
|
|
<a |
|
|
|
|
href="http://47.108.51.143:9000/logpm/other/%E5%AE%A2%E6%88%B7%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx" |
|
|
|
@ -173,7 +173,38 @@
|
|
|
|
|
</el-button> |
|
|
|
|
</a> |
|
|
|
|
</template> |
|
|
|
|
</avue-form> |
|
|
|
|
</avue-form> --> |
|
|
|
|
|
|
|
|
|
<div> |
|
|
|
|
<el-divider content-position="left">客户导入</el-divider> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="flex-c-sb"> |
|
|
|
|
<P>请确认传入的文件为Excel文件格式</P> |
|
|
|
|
|
|
|
|
|
<a |
|
|
|
|
href="http://47.108.51.143:9000/logpm/other/%E5%AE%A2%E6%88%B7%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx" |
|
|
|
|
download="客户模板.xlsx" |
|
|
|
|
> |
|
|
|
|
<el-button type="primary" icon="Download"> 点击下载 </el-button> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div v-loading="loadingObj.UploadLoadong"> |
|
|
|
|
<el-upload |
|
|
|
|
class="upload-demo" |
|
|
|
|
drag |
|
|
|
|
:headers="headers" |
|
|
|
|
action="/api/logpm-basicdata/basicdataClient/import-basicDataClient" |
|
|
|
|
:before-upload="handleBeforeUpload" |
|
|
|
|
:on-success="handleSuccess" |
|
|
|
|
:on-error="handleClose" |
|
|
|
|
multiple |
|
|
|
|
> |
|
|
|
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon> |
|
|
|
|
<div class="el-upload__text">拖拽文件或 <em>点击上传</em></div> |
|
|
|
|
</el-upload> |
|
|
|
|
</div> |
|
|
|
|
</el-dialog> |
|
|
|
|
<!-- 表单模块 --> |
|
|
|
|
<el-dialog |
|
|
|
@ -696,7 +727,7 @@ export default {
|
|
|
|
|
view: false, |
|
|
|
|
viewEntd: true, |
|
|
|
|
viewClientEntd: false, |
|
|
|
|
CustomerEntd:false, |
|
|
|
|
CustomerEntd: false, |
|
|
|
|
// 查询信息 |
|
|
|
|
query: {}, |
|
|
|
|
//查询时间 |
|
|
|
@ -818,6 +849,8 @@ export default {
|
|
|
|
|
], |
|
|
|
|
loadingObj: { |
|
|
|
|
submitLoading: false, |
|
|
|
|
/** 上传文件 */ |
|
|
|
|
UploadLoadong: false, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
@ -834,11 +867,11 @@ export default {
|
|
|
|
|
}); |
|
|
|
|
return ids.join(','); |
|
|
|
|
}, |
|
|
|
|
// headers() { |
|
|
|
|
// return { |
|
|
|
|
// 'Blade-Auth': 'Bearer ' + getToken(), |
|
|
|
|
// }; |
|
|
|
|
// }, |
|
|
|
|
headers() { |
|
|
|
|
return { |
|
|
|
|
'Blade-Auth': 'Bearer ' + getToken(), |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
// action() { |
|
|
|
|
// return '/api/blade-resource/oss/endpoint/put-file'; |
|
|
|
|
// // return '/api/blade-resource/oss/endpoint/put-file-attach' |
|
|
|
@ -846,6 +879,8 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
uploadAfter(res, done, loading, column) { |
|
|
|
|
res.data && this.$message.success(res.data.msg); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
window.console.log(column); |
|
|
|
|
this.excelBox = false; |
|
|
|
|
// this.refreshChange(); |
|
|
|
@ -986,7 +1021,7 @@ export default {
|
|
|
|
|
setTimeout(async () => { |
|
|
|
|
const response = { valid: false }; // 假设校验通过 |
|
|
|
|
await $_getListlistName({ name: a }).then(res => { |
|
|
|
|
console.log("客户名称校验",res.data); |
|
|
|
|
console.log('客户名称校验', res.data); |
|
|
|
|
if (res.data.data.length > 0) { |
|
|
|
|
reject(new Error('客户名称已存在')); // 校验不通过,调用 reject() 并传递错误信息 |
|
|
|
|
} else { |
|
|
|
@ -1314,7 +1349,7 @@ export default {
|
|
|
|
|
this.distriType = false; |
|
|
|
|
this.viewEntd = false; |
|
|
|
|
this.viewClientEntd = true; |
|
|
|
|
this.CustomerEntd=true; |
|
|
|
|
this.CustomerEntd = true; |
|
|
|
|
getDetail(row.id).then(res => { |
|
|
|
|
this.form = res.data.data; |
|
|
|
|
if (this.form.detailedly == '0' || this.form.detailedly == '-1') { |
|
|
|
@ -1633,6 +1668,43 @@ export default {
|
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
/** 上传文件 */ |
|
|
|
|
handleBeforeUpload(file) { |
|
|
|
|
console.log('file :>> ', file); |
|
|
|
|
this.loadingObj.UploadLoadong = true; |
|
|
|
|
|
|
|
|
|
// 获取文件类型 |
|
|
|
|
const _fileNameArr = file.name.split('.'); |
|
|
|
|
const _fileType = _fileNameArr[_fileNameArr.length - 1]; |
|
|
|
|
|
|
|
|
|
const whiteArr = ['xls', 'xlsx']; |
|
|
|
|
|
|
|
|
|
console.log('whiteArr.indexOf(_fileType) :>> ', whiteArr.indexOf(_fileType)); |
|
|
|
|
|
|
|
|
|
if (whiteArr.indexOf(_fileType) !== -1) return true; |
|
|
|
|
|
|
|
|
|
this.$message.warning('请传入xls或xlsx格式的文件'); |
|
|
|
|
this.loadingObj.UploadLoadong = false; |
|
|
|
|
return false; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** 长传成功 */ |
|
|
|
|
handleSuccess(res) { |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
this.loadingObj.UploadLoadong = false; |
|
|
|
|
if (res.code !== 200) return this.$message.warning('上传失败'); |
|
|
|
|
this.$message.success('上传成功'); |
|
|
|
|
onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** 上传失败 */ |
|
|
|
|
handleClose(res) { |
|
|
|
|
this.loadingObj.UploadLoadong = false; |
|
|
|
|
// UploadAjaxError |
|
|
|
|
const msg = res.msg ? res.data.msg || '上传失败' : '上传失败'; |
|
|
|
|
|
|
|
|
|
this.$message.warning(res.msg || '上传失败'); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
@ -1667,4 +1739,11 @@ export default {
|
|
|
|
|
:deep(.el-select) { |
|
|
|
|
width: 100% !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 标题 |
|
|
|
|
:deep(.el-divider__text.is-left) { |
|
|
|
|
font-size: 20px; |
|
|
|
|
font-weight: bold; |
|
|
|
|
color: var(--el-color-primary); |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|