|
@ -34,7 +34,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div class="resi-row-btn"> |
|
|
<div class="resi-row-btn"> |
|
|
<el-button type="success" @click="handleAdd">新增</el-button> |
|
|
<el-button type="success" @click="handleAdd">新增</el-button> |
|
|
<el-button type="warning" size="small" @click="handleExport">导出</el-button> |
|
|
<el-button type="warning" size="small" :loading="exportBtn" @click="handleExport">{{ exportBtnTitle }}</el-button> |
|
|
<el-upload |
|
|
<el-upload |
|
|
ref="upload" |
|
|
ref="upload" |
|
|
class="upload-demo" |
|
|
class="upload-demo" |
|
@ -197,6 +197,8 @@ export default { |
|
|
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', |
|
|
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', |
|
|
importBtnTitle: '导入人员数据', |
|
|
importBtnTitle: '导入人员数据', |
|
|
importLoading: false, |
|
|
importLoading: false, |
|
|
|
|
|
exportBtn: false, |
|
|
|
|
|
exportBtnTitle: '导出', |
|
|
tableLoading: false, |
|
|
tableLoading: false, |
|
|
btnLoading: false, |
|
|
btnLoading: false, |
|
|
uploading: false, |
|
|
uploading: false, |
|
@ -325,20 +327,20 @@ export default { |
|
|
} |
|
|
} |
|
|
return fileType && isLt1M |
|
|
return fileType && isLt1M |
|
|
}, |
|
|
}, |
|
|
uploadHttpRequest(file) { |
|
|
async uploadHttpRequest(file) { |
|
|
this.importLoading = true |
|
|
this.importLoading = true |
|
|
this.importBtnTitle = '正在上传中...' |
|
|
this.importBtnTitle = '正在上传中...' |
|
|
const formData = new FormData() //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|
|
const formData = new FormData() //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|
|
formData.append('file', file.file) //添加文件对象 |
|
|
formData.append('file', file.file) //添加文件对象 |
|
|
axios({ |
|
|
await axios({ |
|
|
url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icpartymemberstyle/import', |
|
|
url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icpartymemberstyle/import', |
|
|
method: 'post', |
|
|
method: 'post', |
|
|
data: formData, |
|
|
data: formData, |
|
|
responseType: 'blob' |
|
|
responseType: 'blob' |
|
|
}) |
|
|
}) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
this.importLoading = false |
|
|
// this.importLoading = false |
|
|
this.importBtnTitle = '导入人员数据' |
|
|
// this.importBtnTitle = '导入人员数据' |
|
|
// let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) |
|
|
// let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) |
|
|
// console.log('filename', fileName) |
|
|
// console.log('filename', fileName) |
|
|
// let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) |
|
|
// let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) |
|
@ -355,17 +357,23 @@ export default { |
|
|
}) |
|
|
}) |
|
|
.catch( err => { |
|
|
.catch( err => { |
|
|
console.log('失败', err) |
|
|
console.log('失败', err) |
|
|
param.onError() //上传失败的文件会从文件列表中删除 |
|
|
file.onError() //上传失败的文件会从文件列表中删除 |
|
|
|
|
|
this.$message.error('导入失败') |
|
|
}) |
|
|
}) |
|
|
|
|
|
this.importLoading = false |
|
|
|
|
|
this.importBtnTitle = '导入人员数据' |
|
|
|
|
|
this.$refs.upload.clearFiles() |
|
|
}, |
|
|
}, |
|
|
handleExport() { |
|
|
async handleExport() { |
|
|
|
|
|
this.exportBtn = true |
|
|
|
|
|
this.exportBtnTitle = '正在导出...' |
|
|
let params = { |
|
|
let params = { |
|
|
agencyId: this.$store.state.user.agencyId, |
|
|
agencyId: this.$store.state.user.agencyId, |
|
|
pageSize: 9999, |
|
|
pageSize: 9999, |
|
|
pageNo: this.currentPage |
|
|
pageNo: this.currentPage |
|
|
} |
|
|
} |
|
|
// .post('epmetuser/icresiuser/exportExcel', params) |
|
|
// .post('epmetuser/icresiuser/exportExcel', params) |
|
|
axios({ |
|
|
await axios({ |
|
|
url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icpartymemberstyle/export', |
|
|
url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icpartymemberstyle/export', |
|
|
// url: 'epmetuser/icresiuser/exportExcel', |
|
|
// url: 'epmetuser/icresiuser/exportExcel', |
|
|
method: 'post', |
|
|
method: 'post', |
|
@ -389,8 +397,10 @@ export default { |
|
|
}) |
|
|
}) |
|
|
.catch((err) => { |
|
|
.catch((err) => { |
|
|
console.log('获取导出情失败', err) |
|
|
console.log('获取导出情失败', err) |
|
|
return this.$message.error('网络错误') |
|
|
this.$message.error('获取导出失败') |
|
|
}) |
|
|
}) |
|
|
|
|
|
this.exportBtn = false |
|
|
|
|
|
this.exportBtnTitle = '导出' |
|
|
}, |
|
|
}, |
|
|
beforeImgUpload (file) { |
|
|
beforeImgUpload (file) { |
|
|
const isPNG = (file.type === 'image/png') || (file.type === 'image/jpeg') |
|
|
const isPNG = (file.type === 'image/png') || (file.type === 'image/jpeg') |
|
|