<template>
|
<div>
|
<h4 class="font-weight-bold py-3 mb-2 d-flex flex-wrap justify-content-between align-items-center pt-2">
|
<div>
|
<router-link to="/personnel">
|
<span class="text-muted font-weight-light">人员管理 /</span>
|
</router-link>
|
人员导入 -- {{uploadInfo.officeName}}
|
</div>
|
<div class="mb-2">
|
<b-btn variant="primary" @click="handleBack">返回</b-btn>
|
</div>
|
</h4>
|
<b-card style="font-family: '微软雅黑'">
|
<h3 class="text-center font-weight-light my-5">人员导入说明</h3>
|
<div class="row">
|
<div class="col-md-1"></div>
|
<div class="col-md-5">
|
<h4 class="mb-2 font-weight-light">照片要求</h4>
|
<hr />
|
<h5 class="mb-2 ui-company-text text-muted">1、所用相片必须是近期正面免冠彩色头像</h5>
|
<h5 class="mb-2 ui-company-text text-muted">2、头部占照片尺寸的2/3</h5>
|
<h5 class="mb-2 ui-company-text text-muted">3、白色背景无边框,人像清晰,层次丰富,神态自然,无明显畸变</h5>
|
<h5 class="mb-2 ui-company-text text-muted">4、电子照片尺寸 358像素(宽)×441像素(高),分辨率350dpi</h5>
|
</div>
|
<div class="col-md-5">
|
<h4 class="mb-2 font-weight-light">Excel要求</h4>
|
<hr />
|
<h5 style="text-indent: 2" class="mb-2 ui-company-text text-muted">1、Excel中插入图片时,取消压缩功能,步骤:文件 - 选项 - 高级 - [图片大小和质量] 选择 不压缩文件中的图像</h5>
|
<h5 class="mb-2 ui-company-text text-muted">2、照片不要溢出 Excel 单元格</h5>
|
<h5 class="mb-2 ui-company-text text-muted">3、确保Excel中的部门都已创建</h5>
|
<h5 class="mb-2 ui-company-text text-muted">4、单个Excel文件不要大于20M</h5>
|
</div>
|
<div class="col-md-1"></div>
|
</div>
|
<div class="flex-center">
|
<UpLoad
|
:isList="false"
|
limitSize="20M"
|
:uploadInfo="uploadInfo"
|
uploadBtntext="导入学生"
|
@res="fetchResult"
|
class="mr10"
|
/>
|
<UpLoad
|
:isList="false"
|
limitSize="20M"
|
:uploadInfo="uploadInfo"
|
uploadBtntext="导入教师"
|
@res="fetchResult"
|
class="ml10"
|
/>
|
</div>
|
</b-card>
|
<b-card v-if="errorMsg.length">
|
<div class="row">
|
<div class="col-md-1 mb-2"></div>
|
<h4 class="font-weight-light">错误详情</h4>
|
<hr />
|
</div>
|
<div class="row">
|
<div class="col-md-1"></div>
|
<div class="col-md-5">
|
<h5
|
class="mb-2 ui-company-text text-muted py-2"
|
v-for="(item, index) in errorMsgLeft"
|
>
|
{{index + 1}}、 {{item}}
|
</h5>
|
</div>
|
<div class="col-md-5">
|
<h5
|
class="mb-2 ui-company-text text-muted py-2"
|
v-for="(item) in errorMsgRight"
|
>
|
{{item}}
|
</h5>
|
</div>
|
<div class="col-md-1"></div>
|
</div>
|
</b-card>
|
</div>
|
</template>
|
|
<script>
|
import UpLoad from './uploadCommon'
|
|
export default {
|
data: () => ({
|
errorMsg: []
|
}),
|
computed: {
|
uploadInfo() {
|
return JSON.parse(sessionStorage.getItem('uploadInfo'))
|
},
|
errorMsgLeft() {
|
return this.errorMsg.filter((item, index) => index % 2 === 0)
|
},
|
errorMsgRight() {
|
return this.errorMsg.filter((item, index) => index % 2 === 1)
|
}
|
},
|
methods: {
|
// * 打印错误信息或者成功返回列表页面
|
fetchResult(res) {
|
if (res && res.data.code - 0 === 0) {
|
this.$toast({
|
type: 'success',
|
message: '上传成功'
|
})
|
this.$router.push({
|
path: '/personnel'
|
})
|
} else {
|
let errMsg = res.data && res.data.message ? res.data.message : ''
|
if (errMsg && Array.isArray(errMsg)) {
|
this.errorMsg = [ ...errMsg ]
|
} else {
|
this.$toast({
|
type: 'error',
|
message: '错误:' + errMsg,
|
toastDuration: 3000
|
})
|
}
|
}
|
},
|
// * 返回回调
|
handleBack() {
|
this.$router.push('/personnel')
|
}
|
},
|
components: {
|
UpLoad
|
}
|
}
|
</script>
|