| | |
| | | <el-upload |
| | | ref="upload" |
| | | class="upload-demo" |
| | | action="http://127.0.0.1:8301/hr/empBaseInfo/importEmp" |
| | | action="http://120.24.23.155:8301/hr/empBaseInfo/importEmp" |
| | | accept=".xls, .xlsx, .excel" |
| | | :headers="headers()" |
| | | :on-success="importHandleAvatarSuccess" |
| | | :on-error="importHandleAvatarError" |
| | | :file-list="fileList" |
| | | :auto-upload="false" |
| | | > |
| | |
| | | this.isShow(false, 0) |
| | | }, |
| | | methods: { |
| | | importHandleAvatarError() { |
| | | this.$notify.error({ |
| | | title: '错误', |
| | | message: '导入失败' |
| | | }) |
| | | }, |
| | | importHandleAvatarSuccess(res, file) { |
| | | if (res.data === null) { |
| | | this.$notify({ |
| | | title: '成功', |
| | | message: '导入成功!', |
| | | type: 'success' |
| | | }) |
| | | } else { |
| | | this.$alert(JSON.stringify(res.data), '导入失败原因', { |
| | | confirmButtonText: '确定' |
| | | }) |
| | | } |
| | | }, |
| | | headers() { |
| | | const token = getToken() |
| | | if (token) { |