This commit is contained in:
zhoutianchi
2026-01-14 10:52:06 +08:00
parent 8c1f4ec05e
commit d0c8ea0223
140 changed files with 16969 additions and 11469 deletions

View File

@@ -0,0 +1,263 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
append-to-body
>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="140px">
<el-form-item label="模拟学生" prop="serialNumber">
<el-select
v-model="dataForm.serialNumber"
@change="changeStu"
filterable
remote
clearable
reserve-keyword
:disabled="!dataForm.id ? false : true" placeholder="请选择唯一号" size="small" style="width: 100%"
:remote-method="remoteTeacherByQuery"
>
<el-option
v-for="item in serialNumberList"
:key="item.serialNumber"
:label="item.name+'('+item.serialNumber+')'"
:value="item.serialNumber">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="来源" prop="isOut">
<el-select v-model="dataForm.isOut" filterable disabled placeholder="请选择来源" size="small" style="width: 100%" >
<el-option
v-for="item in isOutList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="拟报专业1" prop="wishMajorOne">
<el-select v-model="dataForm.wishMajorOne" filterable placeholder="请选择拟报专业1" size="small" style="width: 100%">
<el-option
v-for="item in planMajorList"
:key="item.zydm"
:label="item.zymc+' | '+item.xz+'年 | '+item.zydm"
:value="item.zydm"
:disabled="isDisable(item.zydm)"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="拟报专业2" prop="wishMajorTwo">
<el-select v-model="dataForm.wishMajorTwo" filterable placeholder="请选择拟报专业2" size="small" style="width: 100%">
<el-option
v-for="item in planMajorList"
:key="item.zydm"
:label="item.zymc+' | '+item.xz+'年 | '+item.zydm"
:value="item.zydm"
:disabled="isDisable(item.zydm)"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="拟报专业3" prop="wishMajorThree">
<el-select v-model="dataForm.wishMajorThree" filterable placeholder="请选择拟报专业3" size="small" style="width: 100%">
<el-option
v-for="item in planMajorList"
:key="item.zydm"
:label="item.zymc+' | '+item.xz+'年 | '+item.zydm"
:value="item.zydm"
:disabled="isDisable(item.zydm)"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="录取专业" prop="confirmedMajor">
<el-select v-model="dataForm.confirmedMajor" filterable placeholder="请选择录取专业" size="small" style="width: 100%">
<el-option
v-for="item in planMajorEduList"
:key="item.zydm"
:label="item.zymc+' | '+item.xz+'年 | '+item.zydm"
:value="item.zydm">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="canSubmit">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import {addMNObj, getMNObj, putMNObj} from '@/api/recruit/recruitImitateAdjustBatch'
import {getList} from "@/api/recruit/recruitstudentsignup";
import {list as planMajor, listByEdu} from "@/api/recruit/recruitplanmajor";
import {queryTeacherStationInfo} from "@/api/professional/teacherbase";
export default {
data () {
return {
visible: false,
canSubmit: false,
dataForm: {
id:"",
serialNumber:"",
groupId:"",
wishMajorOne:'',
wishMajorTwo:'',
wishMajorThree:'',
confirmedMajor:'',
isOut:'',
degreeOfEducation:"",
name:"",
gender:"",
idNumber:"",
},
disabled:false,
serialNumberList:[],
planMajorEduList:[],
isOutList:[{label:"学校",value:"0"},{label:"市平台",value:"1"}],
planMajorList:[],
dataRule: {
serialNumber: [
{ required: true, message: '模拟学生不能为空', trigger: 'blur' },
],
confirmedMajor: [
{ required: true, message: '录取专业不能为空', trigger: 'blur' },
],
}
}
},
created () {
},
methods: {
init (id,groupId,batchNo) {
this.dataForm.id = id || null;
this.dataForm.batchNo = batchNo;
this.dataForm.groupId= groupId;
this.visible = true;
this.canSubmit = true;
this.planMajorEduList = [];
this.initData();
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
getMNObj(this.dataForm.id).then(response => {
this.dataForm = response.data.data
this.getMajorListByEdu();
})
}else{
this.disabled = true;
}
})
},
/**
* 判断拟报专业是否已经占用,占用不可选
* @param notBedNo
* @returns {boolean}
*/
isDisable(zydm){
if(zydm == this.dataForm.wishMajorOne
|| zydm == this.dataForm.wishMajorTwo
|| zydm == this.dataForm.wishMajorThree
){
return true
}else {
return false
}
},
initData() {
this.planMajorList=[];
this.serialNumberList=[];
planMajor({groupId: this.dataForm.groupId}).then(data =>{
this.planMajorList = data.data.data;
});
// getList({groupId:this.dataForm.groupId}).then(data =>{
// this.serialNumberList = data.data.data
// });
},
remoteTeacherByQuery(query) {
this.serialNumberList = []
if (query !== '') {
setTimeout(() => {
getList({groupId:this.dataForm.groupId,name:query}).then(response => {
this.serialNumberList = response.data.data
})
}, 200);
}
},
changeStu(){
let _this = this;
_this.planMajorEduList = [];
_this.dataForm.wishMajorOne='';
_this.dataForm.wishMajorTwo='';
_this.dataForm.wishMajorThree='';
_this.dataForm.degreeOfEducation = "";
_this.dataForm.oldConfirmedMajor = "";
_this.dataForm.name = "";
_this.dataForm.idNumber = "";
_this.dataForm.confirmedMajor = "";
_this.dataForm.gender = "";
_this.dataForm.isOut = "";
console.log(_this.dataForm);
_this.serialNumberList.forEach(e=>{
if(e.serialNumber == _this.dataForm.serialNumber){
_this.dataForm.wishMajorOne = e.wishMajorOne;
_this.dataForm.wishMajorTwo = e.wishMajorTwo;
_this.dataForm.wishMajorThree = e.wishMajorThree;
_this.dataForm.degreeOfEducation = e.degreeOfEducation;
_this.dataForm.name = e.name;
_this.dataForm.idNumber = e.idNumber;
_this.dataForm.gender = e.gender;
_this.dataForm.isOut = e.isOut;
_this.dataForm.confirmedMajor = e.confirmedMajor;
_this.dataForm.oldConfirmedMajor = e.confirmedMajor;
_this.getMajorListByEdu();
}
})
},
getMajorListByEdu(){
this.planMajorEduList=[];
listByEdu({groupId: this.dataForm.groupId,degreeOfEducation:this.dataForm.degreeOfEducation}).then(res=> {
this.planMajorEduList = res.data.data;
});
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
if(this.dataForm.oldConfirmedMajor == this.dataForm.confirmedMajor){
this.$notify.error('模拟调整的专业不能和原录取专业相同,请检查');
return
}
this.canSubmit = false;
if (this.dataForm.id) {
putMNObj(this.dataForm).then(data => {
this.$notify.success('修改成功')
this.visible = false
this.$emit('refreshDataList')
}).catch(() => {
this.canSubmit = true;
});
} else {
addMNObj(this.dataForm).then(data => {
this.$notify.success('添加成功')
this.visible = false
this.$emit('refreshDataList')
}).catch(() => {
this.canSubmit = true;
});
}
}
})
}
}
}
</script>