|
@@ -143,6 +143,19 @@
|
|
|
@click="but_del_plural()"
|
|
|
:loading="loading"
|
|
|
>删除</el-button>
|
|
|
+ <el-upload
|
|
|
+ style="display: inline-block;margin-left:5px"
|
|
|
+ action=""
|
|
|
+ :on-progress='beforeUpload'
|
|
|
+ :multiple='false'
|
|
|
+ :limit="1"
|
|
|
+ accept=".xls"
|
|
|
+ :show-file-list="false"
|
|
|
+ ><el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ :loading='loading'>导入</el-button>
|
|
|
+ </el-upload>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div style="float:right; text-align: right;">
|
|
@@ -2048,6 +2061,25 @@ export default {
|
|
|
let target = this.focusTarget;
|
|
|
$(target).find('input').focus();
|
|
|
});
|
|
|
+ },
|
|
|
+ // 导入方法
|
|
|
+ beforeUpload (event, file, fileList) {
|
|
|
+ let _this = this
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append('file', file.raw)
|
|
|
+ _this.loading = true
|
|
|
+ this.axios.post('pass/ems/v1/emsgmpcjhs/excelimport/', formData, {
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'}
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code === '200') {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message)
|
|
|
+ }
|
|
|
+ _this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ _this.loading = false
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|