|
@@ -5,12 +5,15 @@
|
|
|
<mx-condition ref="condition" :query-params="queryParams" :require-fields="requireFields" :local-data="localData"
|
|
|
@query="handleQuery"></mx-condition>
|
|
|
</el-card>
|
|
|
- <div v-if="enableOutput" class="text-right mt20">
|
|
|
- <el-button type="primary" icon="el-icon-printer" @click="exportExcel($event,'output-table',outputName)">导出
|
|
|
+ <div v-if="enableOutput||showForceBatch" class="text-right mt20">
|
|
|
+ <el-button v-if="showForceBatch" type="primary" icon="el-icon-edit-outline" @click="handleForceBatch">批量调剂
|
|
|
+ </el-button>
|
|
|
+ <el-button v-if="enableOutput" type="primary" icon="el-icon-printer"
|
|
|
+ @click="exportExcel($event,'output-table',outputName)">导出
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<mx-table :rows="detailTable.rows" :prop-defines="detailTable.columns" border
|
|
|
- id="output-table" class="mt20 elective-flow-table">
|
|
|
+ ref="mxTable" id="output-table" class="mt20 elective-flow-table">
|
|
|
<template #pagedIndex="{$index}">
|
|
|
{{ (queryParams.pageNum - 1) * queryParams.pageSize + $index + 1 }}
|
|
|
</template>
|
|
@@ -63,24 +66,33 @@
|
|
|
<el-dialog :title="'查看分析 '+activeOpt.title" :visible.sync="studentTableVisible" :width="logDialogWidth">
|
|
|
<elective-ai-table :generation="studentGeneration" :optional-majors="studentMajors" readonly></elective-ai-table>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="调剂确认" :visible.sync="forceConfirmVisible">
|
|
|
- <div class="fx-column">
|
|
|
- <div>
|
|
|
- <span>目标组合:</span>
|
|
|
- <el-radio-group v-model="forceConfirmGroupId">
|
|
|
- <el-radio-button v-for="g in prevData.groups" :key="g.groupId" :value="g.groupId"
|
|
|
- :label="g.groupName"></el-radio-button>
|
|
|
+ <el-dialog :visible.sync="forceConfirmVisible">
|
|
|
+ <div slot="title"><i class="el-icon-warning f-warning">调剂确认</i></div>
|
|
|
+ <el-form ref="forceForm" :model="forceForm" :rules="forceRules">
|
|
|
+ <el-form-item prop="studentId" label="目标学生">
|
|
|
+ <el-checkbox-group v-model="forceForm.studentId">
|
|
|
+ <el-checkbox v-for="s in forceConfirmStudents" :key="s.studentId" :label="s.studentId">
|
|
|
+ {{ `${s.studentName}(${s.groupName || '未录取'})` }}
|
|
|
+ </el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="groupId" label="目标组合">
|
|
|
+ <el-radio-group v-model="forceForm.groupId">
|
|
|
+ <el-radio-button v-for="g in prevData.groups" :key="g.groupId"
|
|
|
+ :label="g.groupId">{{ g.groupName }}
|
|
|
+ </el-radio-button>
|
|
|
</el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="reason" label="调剂原因">
|
|
|
+ <el-input v-model="forceForm.reason" type="textarea" :autosize="{minRows:2,maxRows:4}"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="text-right">
|
|
|
+ <el-button @click="forceConfirmVisible=false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="handleForceBatchCommit">确认</el-button>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <span>操作学生:</span>
|
|
|
- {{ forceConfirmStudents.map(s => `${s.studentName}${s.groupName ? `(${s.groupName})` : ''}`).join('、') }}
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <span>调剂原因:</span>
|
|
|
- <el-input v-model="force" type="textarea" autosize></el-input>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -155,7 +167,7 @@ export default {
|
|
|
const queryCategory = this.prevData.queryableCategories.find(i => i.id == this.queryParams.generationQueryCode)
|
|
|
const ignoreGroups = this.prevData.ignoreGroupCategories.includes(this.queryParams.generationQueryCode)
|
|
|
const columns = {
|
|
|
- select: { type: 'selection' },
|
|
|
+ select: { type: 'selection', hidden: !this.showForceBatch },
|
|
|
index: { label: '序号', slot: 'pagedIndex' },
|
|
|
className: { label: '班级' },
|
|
|
studentName: { label: '姓名', slot: 'studentName' },
|
|
@@ -214,6 +226,9 @@ export default {
|
|
|
if (type) params.push(type)
|
|
|
|
|
|
return params.join('-') + '.xlsx'
|
|
|
+ },
|
|
|
+ showForceBatch() {
|
|
|
+ return !!this.detailWrapper?.details?.some(d => d.enableForce)
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -239,9 +254,17 @@ export default {
|
|
|
studentMajors: [],
|
|
|
// force adjust
|
|
|
forceConfirmVisible: false,
|
|
|
- forceConfirmReason: '',
|
|
|
forceConfirmStudents: [],
|
|
|
- forceConfirmGroupId: ''
|
|
|
+ forceForm: {
|
|
|
+ groupId: '',
|
|
|
+ reason: '',
|
|
|
+ studentId: []
|
|
|
+ },
|
|
|
+ forceRules: {
|
|
|
+ studentId: [{ required: true, message: '至少选择1个学生' }],
|
|
|
+ groupId: [{ required: true, message: '调剂组合必选' }],
|
|
|
+ reason: [{ required: true, message: '调剂原因必填' }]
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -352,17 +375,50 @@ export default {
|
|
|
}).finally(() => this.loading = false)
|
|
|
},
|
|
|
handleForceAdjust(group, row) {
|
|
|
- let message = `确认将'${row.studentName}'调剂至'${group.groupName}'?!`
|
|
|
- if (row['disableForceGroupId'] > 0) {
|
|
|
- message += `\n 当前录取组合'${this.translateGroup(row['disableForceGroupId'])}'`
|
|
|
+ this.forceForm.reason = ''
|
|
|
+ this.forceForm.groupId = group.groupId
|
|
|
+ this.forceForm.studentId = [row.studentId]
|
|
|
+ this.forceConfirmStudents = [{
|
|
|
+ studentId: row.studentId,
|
|
|
+ studentName: row.studentName,
|
|
|
+ groupId: row.disableForceGroupId,
|
|
|
+ groupName: this.prevData.groups.find(g => g.groupId == row.disableForceGroupId)?.groupName
|
|
|
+ }]
|
|
|
+ this.forceConfirmVisible = true
|
|
|
+ this.$refs.forceForm?.clearValidate([])
|
|
|
+ },
|
|
|
+ handleForceBatch() {
|
|
|
+ const table = this.$refs.mxTable.$refs.table
|
|
|
+ const selectedList = table.selection
|
|
|
+ if (!selectedList.length) {
|
|
|
+ this.$message.error('请选择要操作的学生')
|
|
|
+ return
|
|
|
}
|
|
|
- this.$confirm(message, '强制调剂提醒', { type: 'warning' }).then(() => {
|
|
|
- enrollByForce(group.groupId, row['studentId']).then(res => {
|
|
|
- this.loadGenerationDetails() // refresh
|
|
|
- EventBus.instance.$emit(consts.keys.electiveGlobalChangeEvent) // global notify for refresh data
|
|
|
- })
|
|
|
- })
|
|
|
- return true
|
|
|
+ this.forceConfirmStudents = selectedList.map(s => ({
|
|
|
+ studentId: s.studentId,
|
|
|
+ studentName: s.studentName,
|
|
|
+ groupId: s.disableForceGroupId,
|
|
|
+ groupName: this.prevData.groups.find(g => g.groupId == s.disableForceGroupId)?.groupName
|
|
|
+ }))
|
|
|
+ this.forceForm.groupId = ''
|
|
|
+ this.forceForm.reason = ''
|
|
|
+ this.forceForm.studentId = this.forceConfirmStudents.map(s => s.studentId)
|
|
|
+ this.forceConfirmVisible = true
|
|
|
+ this.$refs.forceForm?.clearValidate([])
|
|
|
+ },
|
|
|
+ async handleForceBatchCommit() {
|
|
|
+ await this.$refs.forceForm.validate()
|
|
|
+ const commit = {
|
|
|
+ ...this.forceForm,
|
|
|
+ roundId: this.prevData.roundId
|
|
|
+ }
|
|
|
+ commit.studentId = commit.studentId.toString()
|
|
|
+ this.loading = true
|
|
|
+ enrollByForce(commit).then(res => {
|
|
|
+ this.forceConfirmVisible = false
|
|
|
+ this.loadGenerationDetails() // refresh
|
|
|
+ EventBus.instance.$emit(consts.keys.electiveGlobalChangeEvent) // global notify for refresh data
|
|
|
+ }).finally(() => this.loading = false)
|
|
|
}
|
|
|
}
|
|
|
}
|