feat:完成员工管理的导入档案
This commit is contained in:
parent
3316cfafdb
commit
055e5f9b0d
@ -186,20 +186,47 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 上传文件
|
// 上传文件
|
||||||
async handleChange (file) {
|
async handleUpLoad (file) {
|
||||||
console.log('file: ', file)
|
|
||||||
let data = new FormData()
|
let data = new FormData()
|
||||||
data.append('filename', file.raw)
|
data.append('file', file.raw)
|
||||||
this.isUploading = true
|
this.isUploading = true
|
||||||
// return
|
|
||||||
let result = await apiUploadFile(data)
|
let result = await apiUploadFile(data)
|
||||||
this.isUploading = false
|
this.isUploading = false
|
||||||
if (result.code === 0) {
|
if (result.code === 0) {
|
||||||
|
this.$message.success('上传成功!')
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(result.msg)
|
this.$message.error(result.msg)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 确认上传
|
||||||
|
async handleChange (file) {
|
||||||
|
const h = this.$createElement
|
||||||
|
const _this = this
|
||||||
|
this.$msgbox({
|
||||||
|
title: '提示',
|
||||||
|
message: h('p', null, [
|
||||||
|
h('div', { style: 'color: #a96161' }, '文件名:' + file.name),
|
||||||
|
h('span', null, '此操作不可逆,是否上传')
|
||||||
|
]),
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
beforeClose: async (action, instance, done) => {
|
||||||
|
if (action === 'confirm') {
|
||||||
|
instance.confirmButtonLoading = true
|
||||||
|
instance.confirmButtonText = '上传中...'
|
||||||
|
await _this.handleUpLoad(file)
|
||||||
|
instance.confirmButtonLoading = false
|
||||||
|
} else {
|
||||||
|
_this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消上传'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
done()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
async getEmployeesInfo (data) {
|
async getEmployeesInfo (data) {
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user