<el-upload ref="upload" class="upload-demo" style="display: inline-block" accept=".xlsx,.xls" :auto-upload="true" :show-file-list="false" :before-upload="handleBeforeUpload">
<el-button type="primary" plain style="margin: 0 10px">excel导入</el-button>
</el-upload>
handleBeforeUpload(file) {
var File = file;
let formDataObj = new FormData();
formDataObj.append("file", File);
console.log("导出:", formDataObj);
axios({
method: "post",
url: process.env.VUE_APP_BASE_API + "/pop/import",
data: formDataObj,
headers: {
"Content-Type": "multipart/form-data",
},
params: {
sysCityCode: "370100000000",
sysCountyCode: "",
},
}).then((res) => {
});
return false;
},