|
|
@ -3,6 +3,9 @@ |
|
|
<!-- 导入excel模板 --> |
|
|
<!-- 导入excel模板 --> |
|
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" |
|
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" |
|
|
width="400px" @close="close" append-to-body> |
|
|
width="400px" @close="close" append-to-body> |
|
|
|
|
|
|
|
|
|
|
|
<el-button style="margin-bottom:10px" v-if="downloadArr && downloadArr.length>0" type="primary" @click="downloadExcelTemplate">{{$t('template.common.downloadTemplate') }}</el-button> |
|
|
|
|
|
|
|
|
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :disabled="upload.isUploading" action="" |
|
|
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :disabled="upload.isUploading" action="" |
|
|
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag> |
|
|
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag> |
|
|
<i class="el-icon-upload"></i> |
|
|
<i class="el-icon-upload"></i> |
|
|
@ -24,6 +27,14 @@ import * as XLSX from 'xlsx' |
|
|
export default { |
|
|
export default { |
|
|
name: "ImportEccelDialog", |
|
|
name: "ImportEccelDialog", |
|
|
components: {}, |
|
|
components: {}, |
|
|
|
|
|
props:{ |
|
|
|
|
|
downloadArr:{ |
|
|
|
|
|
type:Array, |
|
|
|
|
|
default(){ |
|
|
|
|
|
return [] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
title: this.$t('form.modify'), |
|
|
title: this.$t('form.modify'), |
|
|
@ -91,6 +102,9 @@ export default { |
|
|
|
|
|
|
|
|
reader.readAsArrayBuffer(file[0].raw); |
|
|
reader.readAsArrayBuffer(file[0].raw); |
|
|
}, |
|
|
}, |
|
|
|
|
|
downloadExcelTemplate() { |
|
|
|
|
|
this.$emit('downloadExcelTemplate',this.downloadArr) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|