更新
This commit is contained in:
parent
777e07a5b0
commit
77f1637046
@ -94,10 +94,6 @@ public class HitCompetitionStudentInfo implements Serializable {
|
||||
@Excel(name = "个人选拔赛分数",type = IMPORT)
|
||||
@ApiModelProperty(value = "个人选拔赛分数")
|
||||
private BigDecimal trialsScore;
|
||||
|
||||
@Excel(name = "赛道",readConverterExp = "1=常规赛道,2=产业赛道,3=国际赛道")
|
||||
private Integer racetrack;
|
||||
|
||||
// @Excel(name = "是否被选为参加地区选拔赛人员", readConverterExp = "false=待审核,true=已入选",type = EXPORT)
|
||||
@ApiModelProperty(value = "是否被选为参加初赛人员 (0: 否, 1: 是)")
|
||||
private Boolean isPreliminary;
|
||||
|
@ -3,6 +3,7 @@ package com.ruoyi.cms.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -72,6 +73,9 @@ public class HitRegInfo extends BaseEntity
|
||||
//团队分
|
||||
private BigDecimal score;
|
||||
|
||||
@Excel(name = "赛道",readConverterExp = "1=本科生赛道,2=产业赛道,3=国际赛道")
|
||||
private String racetrack;
|
||||
|
||||
/** 逻辑删除0未删除1真删除 */
|
||||
private Long delFlag;
|
||||
@TableField(exist = false)
|
||||
|
@ -56,6 +56,8 @@ public class Preliminary {
|
||||
@Excel(name = "附件")
|
||||
private String uploadFile;
|
||||
|
||||
private String racetrack;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -473,6 +473,10 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService {
|
||||
throw new RuntimeException("请输入正确的手机号");
|
||||
}
|
||||
}
|
||||
// 判断赛事中不包括1 就设置地址为空
|
||||
if (!hitRegInfo.getCompetition().contains("1")) {
|
||||
hitRegInfo.setSampleAddress("");
|
||||
}
|
||||
hitRegInfo.setCreateTime(null);
|
||||
hitRegInfo.setAuditStatus(null);
|
||||
hitRegInfo.setCreateTime(new Date());
|
||||
@ -513,9 +517,9 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService {
|
||||
Map<String, Long> mobileToUserIdMap = hitCompetitionStudentInfos.stream()
|
||||
.collect(Collectors.toMap(
|
||||
HitCompetitionStudentInfo::getPhoneNumber,
|
||||
HitCompetitionStudentInfo::getUserId
|
||||
HitCompetitionStudentInfo::getUserId,
|
||||
(oldValue, newValue) -> newValue // 遇到重复时保留新值
|
||||
));
|
||||
|
||||
// 根据手机号将userId赋值给hitList
|
||||
hitList.forEach(hit -> {
|
||||
Long userId = mobileToUserIdMap.get(hit.getMobile());
|
||||
|
@ -95,6 +95,7 @@ public class HitTeamsServiceImpl extends ServiceImpl<HitTeamsMapper, HitTeams> i
|
||||
HitCompetitionStudentInfo hitStu = hitCompetitionStudentInfoMapper.selectOne(queryWrapper);
|
||||
HitRegInfo hitRegInfo = new HitRegInfo();
|
||||
hitRegInfo.setSchoolName(preliminary.getSchoolName());
|
||||
hitRegInfo.setRacetrack(preliminary.getRacetrack());
|
||||
hitRegInfo.setCollegeName(hitStu.getCollegeName());
|
||||
hitRegInfo.setDivision(preliminary.getDivision());
|
||||
hitRegInfo.setTeamName(preliminary.getTeamName());
|
||||
|
@ -34,13 +34,7 @@
|
||||
|
||||
<select id="selectHitCompetitionStudentInfoList" parameterType="HitCompetitionStudentInfo"
|
||||
resultType="com.ruoyi.cms.domain.HitCompetitionStudentInfo">
|
||||
select *,
|
||||
CASE
|
||||
WHEN racetrack = '1' THEN '常规赛道'
|
||||
WHEN racetrack = '2' THEN '产业赛道'
|
||||
WHEN racetrack = '3' THEN '国际赛道'
|
||||
ELSE ''
|
||||
END racetrackStr
|
||||
select *
|
||||
from hit_competition_student_info
|
||||
<where>
|
||||
<if test="hitRegId != null and hitRegId != ''">and hit_reg_id = #{hitRegId}</if>
|
||||
@ -57,7 +51,6 @@
|
||||
<if test="email != null and email != ''">and email = #{email}</if>
|
||||
<if test="studentIdCard != null and studentIdCard != ''">and student_id_card = #{studentIdCard}</if>
|
||||
<if test="trialsScore != null ">and trials_score = #{trialsScore}</if>
|
||||
<if test="racetrack != null ">and racetrack = #{racetrack}</if>
|
||||
<if test="isPreliminary != null ">and is_preliminary = #{isPreliminary}</if>
|
||||
<if test="year != null ">and create_time like concat(#{year},'%')</if>
|
||||
</where>
|
||||
|
@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="auditStatus" column="audit_status" />
|
||||
<result property="uploadFile" column="upload_file" />
|
||||
<result property="dsFile" column="ds_file" />
|
||||
<result property="racetrack" column="racetrack" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
@ -25,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHitRegInfoVo">
|
||||
select id, school_name, college_name, division, team_name, sample_concat, sample_number,audit_status, sample_address, remark, upload_file,ds_file,score, del_flag, create_time, create_by, update_time, update_by,competition from hit_reg_info
|
||||
select id, school_name, college_name, division, team_name, sample_concat, sample_number,audit_status, sample_address, remark, upload_file,ds_file,score, racetrack,del_flag, create_time, create_by, update_time, update_by,competition from hit_reg_info
|
||||
</sql>
|
||||
|
||||
<select id="selectHitRegInfoList" parameterType="HitRegInfo" resultMap="HitRegInfoResult">
|
||||
@ -41,6 +42,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="uploadFile != null and uploadFile != ''"> and upload_file = #{uploadFile}</if>
|
||||
<if test="createTime != null " > and create_time LIKE concat('%', date_format(#{createTime}, '%Y'), '%')</if>
|
||||
<if test="year != null " > and create_time LIKE concat(#{year}, '%')</if>
|
||||
<if test="racetrack != null and racetrack != ''">
|
||||
and FIND_IN_SET(#{racetrack}, racetrack)
|
||||
</if>
|
||||
</where>
|
||||
order by audit_status asc,create_time desc
|
||||
</select>
|
||||
|
@ -29,6 +29,16 @@
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="赛道" prop="year">
|
||||
<el-select v-model="queryParams.racetrack" placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in dict.type.com_racetrack"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="大赛年份" prop="competitionYear">-->
|
||||
<!-- <el-select v-model="queryParams.createTime" placeholder="请选择">-->
|
||||
<!-- <el-option v-for="item in yearList" :key="item.value" :label="item.label" :value="item.value">-->
|
||||
@ -140,6 +150,7 @@
|
||||
<el-table-column label="学校名称" align="center" prop="schoolName"/>
|
||||
<el-table-column label="院系名称" align="center" prop="collegeName"/>
|
||||
<el-table-column label="团队名称" align="center" prop="teamName"/>
|
||||
<el-table-column label="赛道" align="center" prop="racetrackLabel" width="180px"/>
|
||||
<el-table-column label="盲样邮寄地址" align="center" prop="sampleAddress"/>
|
||||
<el-table-column label="收件人" align="center" prop="sampleConcat"/>
|
||||
<el-table-column label="联系电话" align="center" prop="sampleNumber"/>
|
||||
@ -151,9 +162,9 @@
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名时间" align="center" prop="createTime">
|
||||
<el-table-column label="报名时间" align="center" prop="createTime" width="100px">
|
||||
<template slot-scope="props">
|
||||
{{ props.row.createTime.substring(0, 11) }}
|
||||
{{ props.row.createTime.substring(0, 10) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -231,8 +242,36 @@
|
||||
<!-- 修改团队信息弹出层 对话框 -->
|
||||
<el-dialog :visible.sync="editDialogVisible" title="编辑信息">
|
||||
<el-form :model="currentRow">
|
||||
<el-form-item label="所属赛区">
|
||||
<el-input v-model="currentRow.division"></el-input>
|
||||
<!-- <el-form-item label="所属赛区">-->
|
||||
<!-- <el-input v-model="currentRow.division"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="所属赛区" prop="division">
|
||||
<el-select v-model="currentRow.division" filterable allow-create default-first-option
|
||||
placeholder="请选择所属赛区"
|
||||
>
|
||||
<el-option v-for="item in dict.type.com_region" :key="item.value" :label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="赛道" prop="racetrackArr">
|
||||
<el-checkbox-group v-model="currentRow.racetrackArr" @change="changeUpdateTeamRacetrack()">
|
||||
<el-checkbox
|
||||
v-for="item in dict.type.com_racetrack"
|
||||
:key="item.value"
|
||||
:label="item.value"
|
||||
:checked="checked" @change="checked=!checked"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="赛事" prop="competition" v-if="showCompetition">
|
||||
<el-checkbox-group v-model="currentRow.competitionArr" @change="changeCompetition()">
|
||||
<el-checkbox label="1" :checked="competitionChecked" @change="competitionChecked=!competitionChecked">化验赛</el-checkbox>
|
||||
<el-checkbox label="2" :checked="competitionChecked" @change="competitionChecked=!competitionChecked">虚拟赛</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="学校名称">
|
||||
<el-input v-model="currentRow.schoolName"></el-input>
|
||||
@ -253,7 +292,7 @@
|
||||
<el-input v-model="currentRow.sampleNumber"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item labe l="附件">
|
||||
<FileUpload :file-type="['doc','zip', 'docx', 'pdf']" v-model="currentRow.uploadFile"></FileUpload>
|
||||
<FileUpload :file-type="['doc','zip', 'docx', 'pdf']" limit="1" v-model="currentRow.uploadFile"></FileUpload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
@ -314,15 +353,15 @@ import {
|
||||
getTeachInfoByIds,
|
||||
adminUpdateTeamInformation
|
||||
} from '@/api/hit/registrationStudentInfo'
|
||||
import { selectBaseInfo, editStatus } from '@/api/cms/baseInfo'
|
||||
import { getHitRegistrationTeachInfoByUserId, selectByUserId } from '@/api/hit/teacherInfo'
|
||||
import { editRegUser } from '@/api/officialWebsite/registerStudent'
|
||||
import { mapState } from 'vuex'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import {selectBaseInfo, editStatus} from '@/api/cms/baseInfo'
|
||||
import {getHitRegistrationTeachInfoByUserId, selectByUserId} from '@/api/hit/teacherInfo'
|
||||
import {editRegUser} from '@/api/officialWebsite/registerStudent'
|
||||
import {mapState} from 'vuex'
|
||||
import {getToken} from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
name: 'HitRegistrationStudentInfo',
|
||||
dicts: ['sys_user_sex', 'competition_type'],
|
||||
dicts: ['sys_user_sex', 'competition_type', 'com_racetrack','com_region'],
|
||||
data() {
|
||||
return {
|
||||
yearList: [],
|
||||
@ -348,6 +387,8 @@ export default {
|
||||
total: 0,
|
||||
// 报名信息表格数据
|
||||
HitRegistrationStudentInfoList: [],
|
||||
showCompetition: false,
|
||||
competitionChecked: false,
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
@ -357,7 +398,10 @@ export default {
|
||||
registrationInformation: {},
|
||||
// 修改对话框是否显示
|
||||
editDialogVisible: false,
|
||||
currentRow: {},
|
||||
currentRow: {
|
||||
racetrackArr: [],
|
||||
competitionArr: [],
|
||||
},
|
||||
upload: {
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
@ -368,11 +412,11 @@ export default {
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
headers: {Authorization: 'Bearer ' + getToken()},
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/system/hit_reg_info/importData'
|
||||
},
|
||||
importType:"student",
|
||||
importType: "student",
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
@ -394,31 +438,32 @@ export default {
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
checked: false,
|
||||
// 表单校验
|
||||
rules: {
|
||||
competitionId: [
|
||||
{ required: true, message: '大赛ID不能为空', trigger: 'blur' }
|
||||
{required: true, message: '大赛ID不能为空', trigger: 'blur'}
|
||||
],
|
||||
stuName: [
|
||||
{ required: true, message: '学生姓名不能为空', trigger: 'blur' }
|
||||
{required: true, message: '学生姓名不能为空', trigger: 'blur'}
|
||||
],
|
||||
stuGender: [
|
||||
{ required: true, message: '学生性别不能为空', trigger: 'blur' }
|
||||
{required: true, message: '学生性别不能为空', trigger: 'blur'}
|
||||
],
|
||||
stuMajor: [
|
||||
{ required: true, message: '学生专业不能为空', trigger: 'blur' }
|
||||
{required: true, message: '学生专业不能为空', trigger: 'blur'}
|
||||
],
|
||||
stuNumber: [
|
||||
{ required: true, message: '学生手机号不能为空', trigger: 'blur' }
|
||||
{required: true, message: '学生手机号不能为空', trigger: 'blur'}
|
||||
],
|
||||
schoolName: [
|
||||
{ required: true, message: '学校及院系名称不能为空', trigger: 'blur' }
|
||||
{required: true, message: '学校及院系名称不能为空', trigger: 'blur'}
|
||||
],
|
||||
division: [
|
||||
{ required: true, message: '所属赛区不能为空', trigger: 'blur' }
|
||||
{required: true, message: '所属赛区不能为空', trigger: 'blur'}
|
||||
],
|
||||
delFlag: [
|
||||
{ required: true, message: '逻辑删除0未删除1真删除不能为空', trigger: 'blur' }
|
||||
{required: true, message: '逻辑删除0未删除1真删除不能为空', trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -447,6 +492,20 @@ export default {
|
||||
this.loading = false
|
||||
}
|
||||
console.log('报名信息', this.HitRegistrationStudentInfoList)
|
||||
this.HitRegistrationStudentInfoList.map(row => {
|
||||
const values = Array.isArray(row.racetrack)
|
||||
? row.racetrack
|
||||
: String(row.racetrack || '').split(',');
|
||||
|
||||
row.racetrackLabel = values
|
||||
.map(val => {
|
||||
const match = this.dict.type.com_racetrack.find(item => item.value === val);
|
||||
return match ? match.label : val;
|
||||
})
|
||||
.join(',');
|
||||
|
||||
return row;
|
||||
});
|
||||
//for循环this.HitRegistrationStudentInfoList
|
||||
if (this.HitRegistrationStudentInfoList.length != 0) {
|
||||
for (let i = 0; i < this.HitRegistrationStudentInfoList.length; i++) {
|
||||
@ -486,6 +545,27 @@ export default {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
changeUpdateTeamRacetrack() {
|
||||
//将数组转换为字符串
|
||||
this.currentRow.racetrack = this.arrayToString(this.currentRow.racetrackArr)
|
||||
console.log('字符串', this.currentRow.racetrack)
|
||||
console.log('数组', this.currentRow.racetrackArr)
|
||||
// 判断赛道中是否包含1
|
||||
if (this.currentRow.racetrackArr.includes('1')) {
|
||||
this.showCompetition = true
|
||||
} else {
|
||||
this.showCompetition = false
|
||||
this.currentRow.competition = ''
|
||||
this.currentRow.competitionArr = []
|
||||
}
|
||||
console.log('competitionArr', this.currentRow.competitionArr)
|
||||
},
|
||||
changeCompetition() {
|
||||
//将数组转换为字符串
|
||||
this.currentRow.competition = this.arrayToString(this.currentRow.competitionArr)
|
||||
console.log('字符串', this.currentRow.competition)
|
||||
console.log('数组', this.currentRow.competitionArr)
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport(e) {
|
||||
this.upload.title = '用户导入'
|
||||
@ -541,7 +621,7 @@ export default {
|
||||
this.upload.open = false
|
||||
this.upload.isUploading = false
|
||||
this.$refs.upload.clearFiles()
|
||||
this.$alert('<div style=\'overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;\'>' + response.msg + '</div>', '导入结果', { dangerouslyUseHTMLString: true })
|
||||
this.$alert('<div style=\'overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;\'>' + response.msg + '</div>', '导入结果', {dangerouslyUseHTMLString: true})
|
||||
this.getList()
|
||||
},
|
||||
//将数组转为字符串
|
||||
@ -606,6 +686,7 @@ export default {
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.queryParams.createTime = null
|
||||
this.queryParams.racetrack = null
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
@ -661,7 +742,7 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除报名信息编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal.confirm('是否确认删除报名信息编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delHitRegistrationStudentInfo(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
@ -708,8 +789,28 @@ export default {
|
||||
return years.sort((a, b) => b.label - a.label)
|
||||
},
|
||||
editData(row) {
|
||||
this.currentRow = { ...row }
|
||||
this.currentRow = {...row}
|
||||
this.editDialogVisible = true
|
||||
if (this.currentRow) {
|
||||
//将字符串转为数组
|
||||
if (this.currentRow.competition){
|
||||
|
||||
this.currentRow.competitionArr = this.currentRow.competition.split(',')
|
||||
}else {
|
||||
this.currentRow.competitionArr = []
|
||||
}
|
||||
console.log('这是数组', this.currentRow.competitionArr)
|
||||
if (this.currentRow.racetrack) {
|
||||
this.currentRow.racetrackArr = this.currentRow.racetrack.split(',')
|
||||
if (this.currentRow.racetrackArr.includes('1')) {
|
||||
this.showCompetition = true
|
||||
} else {
|
||||
this.showCompetition = false
|
||||
this.currentRow.competitionArr = []
|
||||
this.currentRow.competition = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
saveData() {
|
||||
console.log('保存数据', this.currentRow)
|
||||
|
@ -30,16 +30,16 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="赛道" prop="year">
|
||||
<el-select v-model="queryParams.racetrack" placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in racetrack"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="赛道" prop="year">-->
|
||||
<!-- <el-select v-model="queryParams.racetrack" placeholder="请选择" clearable>-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in dict.type.com_racetrack"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@ -80,8 +80,6 @@
|
||||
|
||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
|
||||
|
||||
<el-table-column label="学生姓名" align="center" prop="stuName" />
|
||||
<el-table-column label="学校名称" align="center" prop="schoolName" />
|
||||
<el-table-column label="院系名称" align="center" prop="collegeName" />
|
||||
@ -89,7 +87,13 @@
|
||||
<el-table-column label="所属赛区" align="center" prop="division" />
|
||||
<el-table-column label="手机号" align="center" prop="phoneNumber" />
|
||||
<el-table-column label="邮箱" align="center" prop="email" />
|
||||
<el-table-column label="赛道" align="center" prop="racetrackStr" />
|
||||
<!-- <el-table-column-->
|
||||
<!-- label="赛道"-->
|
||||
<!-- align="center"-->
|
||||
<!-- prop="racetrackLabel"-->
|
||||
<!-- width="180px"-->
|
||||
<!-- />-->
|
||||
|
||||
<el-table-column label="学生证" align="center" prop="studentIdCard">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.studentIdCard" :width="50" :height="50" />
|
||||
@ -156,7 +160,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="所属赛区" prop="division">
|
||||
<el-select v-model="form.division" filterable allow-create default-first-option
|
||||
placeholder="请选择学校名称">
|
||||
placeholder="请选择所属赛区">
|
||||
<el-option v-for="item in dict.type.com_region" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
@ -229,7 +233,7 @@ import {listInfo, getInfo, delInfo, addInfo, updateInfo, updateTime, byId, editI
|
||||
import { getToken } from "@/utils/auth";
|
||||
export default {
|
||||
name: "Info",
|
||||
dicts: ["sys_user_sex", "school_name", "com_region"],
|
||||
dicts: ["sys_user_sex", "school_name", "com_region","com_racetrack"],
|
||||
data() {
|
||||
return {
|
||||
selectedTime: null, // 用户选择的个人赛截止时间
|
||||
@ -239,20 +243,6 @@ export default {
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
racetrack: [
|
||||
{
|
||||
label: '常规赛道',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '产业赛道',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '国际赛道',
|
||||
value: 3
|
||||
},
|
||||
],
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
@ -353,10 +343,36 @@ export default {
|
||||
this.queryParams.year = new Date(this.queryParams.year).getFullYear().toString()
|
||||
listInfo(this.queryParams).then(response => {
|
||||
this.infoList = response.rows;
|
||||
// this.infoList.map(row => {
|
||||
// const values = Array.isArray(row.racetrack)
|
||||
// ? row.racetrackStr
|
||||
// : String(row.racetrack || '').split(',');
|
||||
//
|
||||
// row.racetrackLabel = values
|
||||
// .map(val => {
|
||||
// const match = this.dict.type.com_racetrack.find(item => item.value === val);
|
||||
// return match ? match.label : val;
|
||||
// })
|
||||
// .join(',');
|
||||
//
|
||||
// return row;
|
||||
// });
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
formatRacetrack(row) {
|
||||
const values = Array.isArray(row.racetrack)
|
||||
? row.racetrack
|
||||
: String(row.racetrackStr || '').split(',');
|
||||
|
||||
return values
|
||||
.map(val => {
|
||||
const match = this.dict.type.com_racetrack.find(item => item.value === val);
|
||||
return match ? match.label : val;
|
||||
})
|
||||
.join(','); // 中文逗号连接多个
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
@ -404,7 +420,7 @@ export default {
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null
|
||||
updateBy: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -415,6 +431,23 @@ export default {
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
hitRegId: null,
|
||||
stuName: null,
|
||||
schoolName: null,
|
||||
collegeName: null,
|
||||
major: null,
|
||||
division: null,
|
||||
phoneNumber: null,
|
||||
email: null,
|
||||
studentIdCard: null,
|
||||
trialsScore: null,
|
||||
isPreliminary: null,
|
||||
year: new Date().getFullYear().toString(),
|
||||
racetrack: null
|
||||
}
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
@ -77,7 +77,7 @@
|
||||
<el-button type="primary" @click="submitLogin">登 录</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog title="注册" :close-on-click-modal="false" :visible.sync="registerDialog" width="30%" :modal="false">
|
||||
<el-dialog title="网站注册" :close-on-click-modal="false" :visible.sync="registerDialog" width="30%" :modal="false">
|
||||
<div>
|
||||
<el-form :model="registerForm" :rules="registerRules" ref="registerForm">
|
||||
<el-form-item prop="userType">
|
||||
|
@ -60,8 +60,23 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属赛区" prop="division">
|
||||
<!-- 把这段html摆放到正确的位置,就完成了tooltip提示 -->
|
||||
<span>
|
||||
<el-tooltip placement="top">
|
||||
<div slot="content">
|
||||
东北赛区:黑龙江、吉林、辽宁、内蒙古<br>
|
||||
华北赛区:北京、天津、河北、河南、山东、山西<br>
|
||||
华东赛区:上海、湖北、湖南、江苏、江西、浙江、安徽<br>
|
||||
华南赛区:广东、广西、福建、海南、云南<br>
|
||||
西部赛区:重庆、甘肃、陕西、四川、新疆、贵州、青海、宁夏、西藏<br>
|
||||
</div>
|
||||
<!-- elementui图标库:显示黑色的问号图标 -->
|
||||
<i class="el-icon-question"/>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
|
||||
<el-select v-model="signUpForm.division" filterable allow-create default-first-option
|
||||
placeholder="请选择学校名称"
|
||||
placeholder="请选择所属赛区"
|
||||
>
|
||||
<el-option v-for="item in dict.type.com_region" :key="item.value" :label="item.label"
|
||||
:value="item.value"
|
||||
@ -79,16 +94,6 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="赛道" prop="racetrack">
|
||||
<el-select v-model="signUpForm.racetrack" filterable allow-create default-first-option
|
||||
placeholder="请选择学校名称"
|
||||
>
|
||||
<el-option v-for="item in racetrack" :key="item.value" :label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="院系名称" prop="collegeName">
|
||||
<el-input v-model="signUpForm.collegeName"></el-input>
|
||||
@ -109,6 +114,19 @@
|
||||
<image-upload :limit="1" v-model="signUpForm.studentIdCard"></image-upload>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<!-- <el-form-item label="国籍" label-width="80px" prop="nationality">-->
|
||||
<!-- <el-select v-model="signUpForm.nationality" filterable allow-create default-first-option-->
|
||||
<!-- @change="changeNationality"-->
|
||||
<!-- placeholder="请选择国籍"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option v-for="item in dict.type.com_nationality" :key="item.value" :label="item.label"-->
|
||||
<!-- :value="item.value"-->
|
||||
<!-- >-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" style="z-index: 99999" @click="trialsSubmitForm">提交</el-button>
|
||||
</el-form-item>
|
||||
@ -149,6 +167,19 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="d-s">
|
||||
<el-form-item label="赛道" prop="racetrackArr">
|
||||
<el-checkbox-group v-model="preliminaryForm.racetrackArr" @change="changeRacetrack()">
|
||||
<el-checkbox
|
||||
v-for="item in dict.type.com_racetrack"
|
||||
:key="item.value"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="d-s" v-if="showCompetition">
|
||||
<el-form-item label="赛事" prop="competition">
|
||||
<el-checkbox-group v-model="preliminaryForm.competition">
|
||||
<el-checkbox label="1">化验赛</el-checkbox>
|
||||
@ -356,7 +387,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="所属赛区" prop="division">
|
||||
<el-select v-model="studentForm.division" filterable allow-create default-first-option
|
||||
placeholder="请选择学校名称"
|
||||
placeholder="请选择所属赛区"
|
||||
>
|
||||
<el-option v-for="item in dict.type.com_region" :key="item.value" :label="item.label"
|
||||
:value="item.value"
|
||||
@ -400,14 +431,15 @@
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="团队信息" name="edit-team" v-if="teamForm" label-position="left">
|
||||
<el-form :model="teamForm" label-width="100px" :rules="preliminaryFormRules">
|
||||
<el-form :model="teamForm" ref="form" label-position="left" label-width="100px"
|
||||
:rules="teamFormRules">
|
||||
<h3>修改团队信息</h3>
|
||||
<el-form-item label="团队名称" prop="teamName">
|
||||
<el-input disabled v-model="teamForm.teamName" style="width: 300px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属赛区" prop="division">
|
||||
<el-select v-model="teamForm.division" filterable allow-create default-first-option
|
||||
placeholder="请选择学校名称"
|
||||
placeholder="请选择所属赛区"
|
||||
>
|
||||
<el-option v-for="item in dict.type.com_region" :key="item.value" :label="item.label"
|
||||
:value="item.value"
|
||||
@ -425,7 +457,19 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="赛事" prop="competition">
|
||||
<el-form-item label="赛道" prop="racetrackArr">
|
||||
<el-checkbox-group v-model="teamForm.racetrackArr" @change="changeUpdateTeamRacetrack()">
|
||||
<el-checkbox
|
||||
v-for="item in dict.type.com_racetrack"
|
||||
:key="item.value"
|
||||
:label="item.value"
|
||||
:checked="checked" @change="checked=!checked"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="赛事" prop="competition" v-if="showCompetition">
|
||||
<el-checkbox-group v-model="teamForm.competition">
|
||||
<el-checkbox label="1">化验赛</el-checkbox>
|
||||
<el-checkbox label="2">虚拟赛</el-checkbox>
|
||||
@ -517,6 +561,7 @@ import {
|
||||
} from '@/api/officialWebsite/registerStudent'
|
||||
import {getTab, getbanner} from '@/api/gw/home'
|
||||
import {getToken} from '@/utils/auth'
|
||||
import log from "@/views/monitor/job/log.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -526,37 +571,34 @@ export default {
|
||||
SwiperSlide,
|
||||
'page-util': PageUtil
|
||||
},
|
||||
dicts: ['sys_user_sex', 'school_name', 'com_region'],
|
||||
dicts: ['sys_user_sex', 'school_name', 'com_region', 'com_racetrack'],
|
||||
name: 'HelloWorld',
|
||||
|
||||
data() {
|
||||
return {
|
||||
currentUser: '',
|
||||
checked: false,
|
||||
// 成绩查询的tab
|
||||
activeTab: 'scores',
|
||||
active: 0,//当前激活的tab
|
||||
msg: 8,
|
||||
msg: '8',
|
||||
registerStatus: 0,
|
||||
imgurl: process.env.VUE_APP_BASE_API,
|
||||
//修改学生信息
|
||||
studentForm: {},
|
||||
racetrack: [
|
||||
{
|
||||
label: '常规赛道',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '产业赛道',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '国际赛道',
|
||||
value: 3
|
||||
},
|
||||
],
|
||||
//修改团队信息
|
||||
teamForm: {
|
||||
competition: []
|
||||
teamName: '',
|
||||
division: '',
|
||||
schoolName: '',
|
||||
teammateOne: '',
|
||||
teammateTwo: '',
|
||||
leaderTeacher: '',
|
||||
teacherOne: '',
|
||||
teacherTwo: '',
|
||||
racetrackArr: [],
|
||||
competition: [],
|
||||
racetrack: '',
|
||||
},
|
||||
//个人选拔赛表
|
||||
signUpForm: {
|
||||
@ -570,8 +612,11 @@ export default {
|
||||
major: '',
|
||||
hitRegId: '',
|
||||
trialsScore: '',
|
||||
isPreliminary: ''
|
||||
isPreliminary: '',
|
||||
racetrack: '',
|
||||
// racetrackArr: []
|
||||
},
|
||||
showCompetition: false,
|
||||
//初赛表
|
||||
preliminaryForm: {
|
||||
teamName: '',
|
||||
@ -582,7 +627,9 @@ export default {
|
||||
leaderTeacher: '',
|
||||
teacherOne: '',
|
||||
teacherTwo: '',
|
||||
competition: []
|
||||
racetrackArr: [],
|
||||
competition: [],
|
||||
racetrack: '',
|
||||
},
|
||||
//队员
|
||||
teammateInfo: {
|
||||
@ -625,17 +672,76 @@ export default {
|
||||
],
|
||||
competition: [
|
||||
{required: true, message: '赛事不能为空', trigger: 'blur'}
|
||||
],
|
||||
racetrack: [
|
||||
{required: true, message: '赛道不能为空', trigger: 'blur'}
|
||||
]
|
||||
|
||||
},
|
||||
preliminaryFormRules: {
|
||||
racetrackArr: [
|
||||
{
|
||||
type: 'array',
|
||||
required: true,
|
||||
message: '请至少选择一个赛道',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
competition: [
|
||||
{required: true, message: '请选择至少一个赛事', trigger: 'change', type: 'array'}
|
||||
],
|
||||
divisionLabel: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
division: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
schoolName: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
'ldTeacherInfo.teacherName': [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
teamName: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
teammateOne: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
teammateTwo: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
teacherOne: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
// teacherTwo: [
|
||||
// { required: true, message: "不能为空", trigger: "blur" }
|
||||
// ],
|
||||
sampleConcat: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
sampleNumber: [
|
||||
// 校验手机号
|
||||
{required: true, message: '不能为空', trigger: 'blur'},
|
||||
{pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur'}
|
||||
],
|
||||
|
||||
sampleAddress: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
uploadFile: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
teamFormRules: {
|
||||
racetrackArr: [
|
||||
{
|
||||
type: 'array',
|
||||
required: false,
|
||||
message: '请至少选择一个赛道1211',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
competition: [
|
||||
{required: true, message: '请选择至少一个赛事', trigger: 'change', type: 'array'}
|
||||
],
|
||||
divisionLabel: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
@ -696,6 +802,10 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
console.log('组件创建')
|
||||
// 使用 JSON 穿透 Observer 查看原始值
|
||||
console.log('获取字典值', this.dict.type.com_racetrack)
|
||||
console.log('字典原始数据:', JSON.parse(JSON.stringify(this.dict.type.com_racetrack)))
|
||||
console.log('当前值原始数据:', JSON.parse(JSON.stringify(this.preliminaryForm.racetrackArr)))
|
||||
// 页面加载完毕调用
|
||||
this.initPageData()
|
||||
// 在组件挂载后添加滚动监听
|
||||
@ -770,16 +880,33 @@ export default {
|
||||
fetchRegistrationInformation() {
|
||||
getStudentInfoByStuId(this.signUpForm.studentId)
|
||||
.then(response => {
|
||||
this.preliminaryForm = response.data
|
||||
this.preliminaryForm.competition = ['1']
|
||||
this.teamForm.competition = ['1']
|
||||
// 或使用 Vue.set 保持响应式
|
||||
// 避免直接覆盖整个对象,采用属性级赋值
|
||||
this.preliminaryForm = {
|
||||
...this.preliminaryForm, // 保留原有结构
|
||||
...response.data, // 合并新数据
|
||||
racetrackArr: response.data.racetrackArr || [] // 确保数组类型
|
||||
}
|
||||
console.log('报名后的数据', this.preliminaryForm)
|
||||
this.preliminaryForm.competition = []
|
||||
|
||||
|
||||
this.updateSignUpForm(response.data)
|
||||
this.studentForm = response.data
|
||||
this.teamForm = response.data.hitRegInfo
|
||||
this.teamForm.racetrackArr = []
|
||||
if (this.teamForm) {
|
||||
//将字符串转为数组
|
||||
this.teamForm.competition = this.teamForm.competition.split(',')
|
||||
if (this.teamForm.racetrack) {
|
||||
this.teamForm.racetrackArr = this.teamForm.racetrack.split(',')
|
||||
if (this.teamForm.racetrackArr.includes('1')) {
|
||||
this.showCompetition = true
|
||||
} else {
|
||||
this.showCompetition = false
|
||||
this.teamForm.competition = []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log('报名信息:', this.signUpForm)
|
||||
@ -811,6 +938,7 @@ export default {
|
||||
this.active = 5
|
||||
}
|
||||
} else if (data.zdStatus == '9') {
|
||||
console.log('执行同意界面')
|
||||
this.active = 2
|
||||
this.preliminaryForm.hitRegInfo = data.hitRegInfo
|
||||
} else if (data.id == null) {
|
||||
@ -927,6 +1055,58 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
changeRacetrack() {
|
||||
//将数组转换为字符串
|
||||
this.preliminaryForm.racetrack = this.arrayToString(this.preliminaryForm.racetrackArr)
|
||||
// 判断赛道中是否包含1
|
||||
if (this.preliminaryForm.racetrackArr.includes('1')) {
|
||||
this.showCompetition = true
|
||||
} else {
|
||||
this.showCompetition = false
|
||||
this.preliminaryForm.competition = []
|
||||
}
|
||||
console.log(this.preliminaryForm.racetrack)
|
||||
},
|
||||
changeUpdateTeamRacetrack() {
|
||||
//将数组转换为字符串
|
||||
this.teamForm.racetrack = this.arrayToString(this.teamForm.racetrackArr)
|
||||
console.log('字符串', this.teamForm.racetrack)
|
||||
console.log('数组', this.teamForm.racetrackArr)
|
||||
// 判断赛道中是否包含1
|
||||
if (this.teamForm.racetrackArr.includes('1')) {
|
||||
this.showCompetition = true
|
||||
} else {
|
||||
this.showCompetition = false
|
||||
this.teamForm.competition = []
|
||||
}
|
||||
},
|
||||
// changeNationality() {
|
||||
// console.log(this.dict.type.com_nationality)
|
||||
// //将选择的赛道数组设置为空
|
||||
// this.signUpForm.racetrackArr = []
|
||||
// this.signUpForm.racetrack = ''
|
||||
// //判断是否是中国
|
||||
// if (this.signUpForm.nationality == '中国') {
|
||||
// //this.dict.type.com_nationality找出value为3的 并将diabled设为true
|
||||
// this.dict.type.com_racetrack.forEach(item => {
|
||||
// if (item.value == 3) {
|
||||
// item.disabled = true
|
||||
// } else {
|
||||
// item.disabled = false
|
||||
// }
|
||||
// })
|
||||
// console.log(this.dict.type.com_racetrack)
|
||||
// } else {
|
||||
// //将1和2设为false
|
||||
// this.dict.type.com_racetrack.forEach(item => {
|
||||
// if (item.value == 1 || item.value == 2) {
|
||||
// item.disabled = true
|
||||
// } else {
|
||||
// item.disabled = false
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
//修改学生信息
|
||||
editStudentInfo() {
|
||||
this.studentForm.competition = null
|
||||
@ -961,12 +1141,24 @@ export default {
|
||||
updateTeamInfo() {
|
||||
const data = JSON.parse(JSON.stringify(this.teamForm))
|
||||
data.competition = this.arrayToString(data.competition)
|
||||
//判断赛道是否为空
|
||||
if (data.racetrackArr.length === 0) {
|
||||
this.$modal.msgError('赛道不能为空')
|
||||
return
|
||||
}
|
||||
// 假设表单绑定 :model="formData"
|
||||
const formData = this.$refs['form'].model;
|
||||
console.log('formData', formData); // 输出所有表单字段值
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
updateRegInfo(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess('团队成功')
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.fetchRegistrationInformation()
|
||||
} else {
|
||||
this.$modal.msgError('报名失败')
|
||||
this.$modal.msgError('修改失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user