diff --git a/src/pages/match/add/set.vue b/src/pages/match/add/set.vue index 58fca1e..4c44bad 100644 --- a/src/pages/match/add/set.vue +++ b/src/pages/match/add/set.vue @@ -278,6 +278,7 @@ export default { }, // 返回 back () { + this.$emit('update:form', this.$parent.curOriginForm) this.$emit('hideSet') } } diff --git a/src/pages/match/add/step1.vue b/src/pages/match/add/step1.vue index 3dcd36e..022019b 100644 --- a/src/pages/match/add/step1.vue +++ b/src/pages/match/add/step1.vue @@ -694,8 +694,9 @@ export default { if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) form.competitionScope = 1 } this.$parent.showLoad() - delete form.publishStatus - if (status === 1) form.publishStatus = 1 + // delete form.publishStatus + // if (status === 1) form.publishStatus = 1 + form.publishStatus = status form.ztOpen = form.id ? form.ztOpen : (status ? 0 : 1) // 保存则禁用,发布则启用 form.releaseType = releaseType diff --git a/src/pages/match/add/step2.vue b/src/pages/match/add/step2.vue index c5aa71c..218783d 100644 --- a/src/pages/match/add/step2.vue +++ b/src/pages/match/add/step2.vue @@ -8,7 +8,7 @@ label-width="170px" label-suffix=":" size="small" - :disabled="!editing && id"> + :disabled="!!(!editing && id)"> {{ step1.completeCompetitionSetup.competitionType ? '团队赛(' + step1.completeCompetitionSetup.minTeamSize + '-' + step1.completeCompetitionSetup.maxTeamSize + '人/队)' : '个人赛' }} (如需修改,请返回上一步。) diff --git a/src/pages/match/add/step3.vue b/src/pages/match/add/step3.vue index b703a38..f52096c 100644 --- a/src/pages/match/add/step3.vue +++ b/src/pages/match/add/step3.vue @@ -7,7 +7,7 @@ + :disabled="!!(!editing && id)">
@@ -188,7 +188,8 @@ export default { form: [], setVisible: false, curStep: 0, - pass: 0 + pass: 0, + curOriginForm: {}, }; }, components: { @@ -268,6 +269,7 @@ export default { }, // 显示设置页面 toSet (i) { + this.curOriginForm = JSON.parse(JSON.stringify(this.form[i])) this.curStep = i this.$parent.showBtns = false this.setVisible = true diff --git a/src/pages/match/manage/matchArchList.vue b/src/pages/match/manage/matchArchList.vue index 2ed5446..2bc3d66 100644 --- a/src/pages/match/manage/matchArchList.vue +++ b/src/pages/match/manage/matchArchList.vue @@ -103,7 +103,11 @@ + align="center"> + +
+ + 停止导入 + @@ -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, diff --git a/src/pages/student/list/index.vue b/src/pages/student/list/index.vue index e42a0ae..0c00889 100644 --- a/src/pages/student/list/index.vue +++ b/src/pages/student/list/index.vue @@ -664,31 +664,27 @@ export default { }); }, getOrgStudentData () { // 根据组织架构筛选学生列表 - let params = { + this.$post(this.api.organizationalStudentList, { architectureId: this.architectureId, level: this.orgLevel, keyWord: this.keyWord, pageNum: this.page, pageSize: this.pageSize - }; - this.$post(this.api.organizationalStudentList, params).then(res => { + }).then(res => { this.listData = res.page; this.total = res.total; - }).catch(err => { - }); + }).catch(err => { }); }, getData () { // 学生列表 - let data = { + this.$post(this.api.studentList, { type: this.studentType, keyWord: this.keyWord, pageNum: this.page, pageSize: this.pageSize - }; - this.$post(this.api.studentList, data).then(res => { + }).then(res => { this.listData = res.page; this.total = res.total; - }).catch(err => { - }); + }).catch(err => { }); }, currentChange (val) { // 切换页码 this.page = val; @@ -715,21 +711,40 @@ export default { this.getData(); }, delAllSelection () { // 批量删除 - const len = this.multipleSelection.length - const list = len ? this.multipleSelection : this.listData + let list = this.multipleSelection + const len = list.length this.$confirm(len ? '确定要删除选中学生吗?' : '是否要删除当前列表所有学生?', '提示', { type: "warning" - }).then(() => { - this.$post(`${this.api.delStudent}?accountIds=${list.map(e => e.accountId).toString()}`).then(res => { - this.multipleSelection = []; - this.$refs.table.clearSelection(); - util.successMsg("删除成功"); + }).then(async () => { + // 没有选,则查询所有数据再删 + if (!len) { if (this.studentType) { - this.getData(); + const { page } = await this.$post(this.api.studentList, { + type: this.studentType, + pageNum: 1, + pageSize: 1000 + }) + list = page; } else { - this.getOrgStudentData(); + const { page } = await this.$post(this.api.organizationalStudentList, { + architectureId: this.architectureId, + level: this.orgLevel, + pageNum: 1, + pageSize: 1000 + }) + list = page; } - }).catch(res => { }); + } + + await this.$post(`${this.api.delStudent}?accountIds=${list.map(e => e.accountId).toString()}`) + this.multipleSelection = []; + this.$refs.table.clearSelection(); + util.successMsg("删除成功"); + if (this.studentType) { + this.getData(); + } else { + this.getOrgStudentData(); + } if (this.multipleSelection.length === this.listData.length && this.page > 1) { this.currentChange(this.page - 1) }