|  |  |  | 
|---|
|  |  |  | <p class="tip-warn"><i class="el-icon-warning"></i>导入说明:<br> | 
|---|
|  |  |  | 1.请先下载文件模板,并按照模板要去填写表格内容;<br> | 
|---|
|  |  |  | </p> | 
|---|
|  |  |  | <el-form class="demo-form-inline" > | 
|---|
|  |  |  | <el-form class="demo-form-inline" v-loading="loading"> | 
|---|
|  |  |  | <el-form-item label="线路信息" required> | 
|---|
|  |  |  | <div style="width: 100%;display: flex;align-items: center;"> | 
|---|
|  |  |  | <el-button type="primary"   @click="clickRef">点击上传</el-button> | 
|---|
|  |  |  | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | importing:false, | 
|---|
|  |  |  | fileName: '' | 
|---|
|  |  |  | fileName: '', | 
|---|
|  |  |  | loading: false, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$refs.fileExcel.click() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | result (e) { | 
|---|
|  |  |  | this.loading = true | 
|---|
|  |  |  | const data = new FormData() | 
|---|
|  |  |  | data.append('file', e.target.files[0]) | 
|---|
|  |  |  | importExcel(data) | 
|---|
|  |  |  | 
|---|
|  |  |  | this.fileName = '' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.loading = false | 
|---|
|  |  |  | this.$refs.fileExcel.value = null | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|