From eb897b781bfc18df4f87a8c78babd3834b2d269f Mon Sep 17 00:00:00 2001
From: yz <yz_0812@outlook.com>
Date: 星期五, 05 三月 2021 01:53:08 +0800
Subject: [PATCH] 修改bug
---
src/views/user/Informationinput.vue | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/src/views/user/Informationinput.vue b/src/views/user/Informationinput.vue
index 09c2376..46cc155 100644
--- a/src/views/user/Informationinput.vue
+++ b/src/views/user/Informationinput.vue
@@ -549,9 +549,11 @@
<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"
>
@@ -2857,6 +2859,25 @@
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) {
--
Gitblit v1.8.0