|
|
@ -71,9 +71,8 @@ |
|
|
|
<!-- 头部左侧按钮模块 --> |
|
|
|
<!-- 头部左侧按钮模块 --> |
|
|
|
<div class="avue-crud__left"> |
|
|
|
<div class="avue-crud__left"> |
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新 增</el-button> |
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新 增</el-button> |
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain |
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain >删 除</el-button > |
|
|
|
>删 除</el-button |
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleImport">导 入 </el-button> |
|
|
|
> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 头部右侧按钮模块 --> |
|
|
|
<!-- 头部右侧按钮模块 --> |
|
|
|
<div class="avue-crud__right"> |
|
|
|
<div class="avue-crud__right"> |
|
|
@ -173,6 +172,15 @@ |
|
|
|
</el-pagination> |
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-dialog title="客户导入" append-to-body v-model="excelBox" width="555px"> |
|
|
|
|
|
|
|
<avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"> |
|
|
|
|
|
|
|
<template #excelTemplate> |
|
|
|
|
|
|
|
<el-button type="primary" @click="handleTemplate"> |
|
|
|
|
|
|
|
点击下载<i class="el-icon-download el-icon--right"></i> |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</avue-form> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
<!-- 表单模块 --> |
|
|
|
<!-- 表单模块 --> |
|
|
|
<el-dialog |
|
|
|
<el-dialog |
|
|
|
:title="title" |
|
|
|
:title="title" |
|
|
@ -457,6 +465,8 @@ import { getToken } from '@/utils/auth'; |
|
|
|
import globalc from '@/api/basicdata/globalc'; |
|
|
|
import globalc from '@/api/basicdata/globalc'; |
|
|
|
import { Base64 } from 'js-base64'; |
|
|
|
import { Base64 } from 'js-base64'; |
|
|
|
import dayjs from 'dayjs'; |
|
|
|
import dayjs from 'dayjs'; |
|
|
|
|
|
|
|
import { exportBlob } from '@/api/common'; |
|
|
|
|
|
|
|
import { downloadXls } from '@/utils/util'; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
components: { |
|
|
@ -464,6 +474,34 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
excelForm: {}, |
|
|
|
|
|
|
|
excelBox: false, |
|
|
|
|
|
|
|
excelOption: { |
|
|
|
|
|
|
|
submitBtn: false, |
|
|
|
|
|
|
|
emptyBtn: false, |
|
|
|
|
|
|
|
column: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '文件上传', |
|
|
|
|
|
|
|
prop: 'excelFile', |
|
|
|
|
|
|
|
type: 'upload', |
|
|
|
|
|
|
|
drag: true, |
|
|
|
|
|
|
|
loadText: '文件上传,请稍等', |
|
|
|
|
|
|
|
span: 24, |
|
|
|
|
|
|
|
propsHttp: { |
|
|
|
|
|
|
|
res: 'data', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
tip: '请上传 .xls,.xlsx 标准格式文件', |
|
|
|
|
|
|
|
action: '/api/logpm-basicdata/basicdataClient/import-basicDataClient', |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '模板下载', |
|
|
|
|
|
|
|
prop: 'excelTemplate', |
|
|
|
|
|
|
|
formslot: true, |
|
|
|
|
|
|
|
span: 24, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}, |
|
|
|
columnList: [ |
|
|
|
columnList: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
prop: '', |
|
|
|
prop: '', |
|
|
@ -717,17 +755,36 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
return ids.join(','); |
|
|
|
return ids.join(','); |
|
|
|
}, |
|
|
|
}, |
|
|
|
headers() { |
|
|
|
// headers() { |
|
|
|
return { |
|
|
|
// return { |
|
|
|
'Blade-Auth': 'Bearer ' + getToken(), |
|
|
|
// 'Blade-Auth': 'Bearer ' + getToken(), |
|
|
|
}; |
|
|
|
// }; |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// action() { |
|
|
|
|
|
|
|
// return '/api/blade-resource/oss/endpoint/put-file'; |
|
|
|
|
|
|
|
// // return '/api/blade-resource/oss/endpoint/put-file-attach' |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
uploadAfter(res, done, loading, column) { |
|
|
|
|
|
|
|
window.console.log(column); |
|
|
|
|
|
|
|
this.excelBox = false; |
|
|
|
|
|
|
|
// this.refreshChange(); |
|
|
|
|
|
|
|
done(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
action() { |
|
|
|
refreshChange() { |
|
|
|
return '/api/blade-resource/oss/endpoint/put-file'; |
|
|
|
this.onLoad(this.page, this.query); |
|
|
|
// return '/api/blade-resource/oss/endpoint/put-file-attach' |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
handleImport() { |
|
|
|
|
|
|
|
this.excelBox = true; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleTemplate() { |
|
|
|
|
|
|
|
exportBlob( |
|
|
|
|
|
|
|
`/api/logpm-basicdata/basicdataClient/import-basicDataClient?${this.website.tokenHeader}=${getToken()}` |
|
|
|
|
|
|
|
).then(res => { |
|
|
|
|
|
|
|
downloadXls(res.data, '用户数据模板.xlsx'); |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
showdrawer(value) { |
|
|
|
showdrawer(value) { |
|
|
|
this.drawerShow = value; |
|
|
|
this.drawerShow = value; |
|
|
|
}, |
|
|
|
}, |
|
|
|