|
|
|
@ -70,11 +70,21 @@ |
|
|
|
|
sortable="custom" |
|
|
|
|
min-width="180" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.school }} |
|
|
|
|
<span v-if="scope.row.schoolStatus" |
|
|
|
|
style="color: #f00">(已删除)</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="realSchool" |
|
|
|
|
label="学生所属院校" |
|
|
|
|
min-width="180" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.realSchool }} |
|
|
|
|
<span v-if="scope.row.realSchoolStatus" |
|
|
|
|
style="color: #f00">(已删除)</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column v-if="info.completeCompetitionSetup.competitionType" |
|
|
|
|
prop="teamName" |
|
|
|
@ -174,6 +184,7 @@ |
|
|
|
|
<el-select v-model="form.schoolId" |
|
|
|
|
filterable |
|
|
|
|
:disabled="!isAdd" |
|
|
|
|
@change="schoolChange" |
|
|
|
|
style="width: 100%"> |
|
|
|
|
<el-option v-for="(item, i) in clients" |
|
|
|
|
:key="i" |
|
|
|
@ -181,8 +192,7 @@ |
|
|
|
|
:value="item.schoolId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item v-if="!schoolDisable" |
|
|
|
|
prop="studentAffiliatedInstitutionId" |
|
|
|
|
<el-form-item prop="studentAffiliatedInstitutionId" |
|
|
|
|
label="学生所属院校"> |
|
|
|
|
<el-select v-model="form.studentAffiliatedInstitutionId" |
|
|
|
|
filterable |
|
|
|
@ -293,6 +303,7 @@ |
|
|
|
|
<el-upload ref="upload" |
|
|
|
|
name="file" |
|
|
|
|
accept=".xls,.xlsx" |
|
|
|
|
:before-upload="beforeUpload" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:on-error="uploadError" |
|
|
|
|
:on-success="uploadSuccess" |
|
|
|
@ -308,6 +319,8 @@ |
|
|
|
|
:headers="headers"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
|
|
|
|
<div slot="tip" |
|
|
|
|
class="el-upload__tip">建议文件数据在5000条以内,导入5000名学生大致需要10分钟</div> |
|
|
|
|
</el-upload> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
@ -317,6 +330,11 @@ |
|
|
|
|
@click="showFaild">部分数据导入失败,查看失败原因</a> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
<span v-if="uploading" |
|
|
|
|
slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button @click="cancelUpload">停止导入</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -416,6 +434,7 @@ export default { |
|
|
|
|
token: util.local.get(Setting.tokenKey) |
|
|
|
|
}, |
|
|
|
|
diffSchool: false, |
|
|
|
|
uploading: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
@ -527,16 +546,18 @@ export default { |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
uploadSuccess ({ data, status }) { |
|
|
|
|
this.uploading = false |
|
|
|
|
this.uploadFaild = false |
|
|
|
|
this.uploadTips = '' |
|
|
|
|
if (status === 200) { |
|
|
|
|
this.init() |
|
|
|
|
const { tip } = data |
|
|
|
|
if (data.exportCode) { |
|
|
|
|
this.exportCode = data.exportCode |
|
|
|
|
this.uploadFaild = true |
|
|
|
|
this.uploadTips = data.tip |
|
|
|
|
this.uploadTips = tip |
|
|
|
|
} else { |
|
|
|
|
util.successMsg(data.tip, 3000) |
|
|
|
|
util[tip.includes('5000') ? 'errorMsg' : 'successMsg'](tip, 3000) |
|
|
|
|
this.importVisible = false |
|
|
|
|
this.keyWord = '' |
|
|
|
|
} |
|
|
|
@ -545,12 +566,16 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
uploadError (err, file, fileList) { |
|
|
|
|
this.uploading = false |
|
|
|
|
this.$message({ |
|
|
|
|
message: "上传出错,请重试!", |
|
|
|
|
type: "error", |
|
|
|
|
center: true |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
beforeUpload (file) { |
|
|
|
|
this.uploading = true |
|
|
|
|
}, |
|
|
|
|
beforeRemove (file, fileList) { |
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`) |
|
|
|
|
}, |
|
|
|
@ -559,15 +584,12 @@ export default { |
|
|
|
|
this.uploadFaild = false |
|
|
|
|
}, |
|
|
|
|
cancelUpload () { |
|
|
|
|
this.uploading = false |
|
|
|
|
this.$refs.upload.abort() |
|
|
|
|
this.init() |
|
|
|
|
this.importVisible = false |
|
|
|
|
this.keyWord = '' |
|
|
|
|
}, |
|
|
|
|
uploadSure () { |
|
|
|
|
this.importVisible = false |
|
|
|
|
this.keyWord = '' |
|
|
|
|
}, |
|
|
|
|
// 新增 |
|
|
|
|
add () { |
|
|
|
|
this.diffSchool = false |
|
|
|
@ -601,6 +623,10 @@ export default { |
|
|
|
|
.catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 学校选择回调 |
|
|
|
|
schoolChange () { |
|
|
|
|
if (!this.form.studentAffiliatedInstitutionId) this.form.studentAffiliatedInstitutionId = this.form.schoolId |
|
|
|
|
}, |
|
|
|
|
// 学号输入完回调。学校和学号都输入完后,调这个接口查询是否有存在的学生,如果有,才能继续输入,如果不能,不让添加 |
|
|
|
|
workNumberChange () { |
|
|
|
|
const { form } = this |
|
|
|
@ -638,6 +664,7 @@ export default { |
|
|
|
|
hrUserAccount: { |
|
|
|
|
...form, |
|
|
|
|
id: form.id, |
|
|
|
|
lastTimeInstitutionId: this.originForm.studentAffiliatedInstitutionId |
|
|
|
|
}, |
|
|
|
|
hrUserInfo: { |
|
|
|
|
userId: form.userId, |
|
|
|
|