Merge branch 'master' of http://git.scdxtc.com/tangyi/zycp-demo
commit
990d9f7536
|
@ -61,7 +61,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="information-btn" @click="getStudentInfo()">确认</div>
|
<div class="information-btn" @click="setStudentInfo()">确认</div>
|
||||||
<!-- 地址弹出框 -->
|
<!-- 地址弹出框 -->
|
||||||
<div class="addr-select-bg" v-show="isAddr" @click="isAddr=!isAddr"></div>
|
<div class="addr-select-bg" v-show="isAddr" @click="isAddr=!isAddr"></div>
|
||||||
<div class="addr-select-item" v-show="isAddr">
|
<div class="addr-select-item" v-show="isAddr">
|
||||||
|
@ -213,7 +213,6 @@
|
||||||
that.getSubjectArray();
|
that.getSubjectArray();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取考试时间
|
// 获取考试时间
|
||||||
getDate(){
|
getDate(){
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
|
@ -226,7 +225,6 @@
|
||||||
this.dateArray = newArray;
|
this.dateArray = newArray;
|
||||||
this.dateValue = this.dateArray[this.dateIndex];
|
this.dateValue = this.dateArray[this.dateIndex];
|
||||||
},
|
},
|
||||||
|
|
||||||
// 城市选择
|
// 城市选择
|
||||||
openAddr(){
|
openAddr(){
|
||||||
this.isAddr=!this.isAddr;
|
this.isAddr=!this.isAddr;
|
||||||
|
@ -235,11 +233,11 @@
|
||||||
this.addrValue = item.code;
|
this.addrValue = item.code;
|
||||||
this.addrIndex = index;
|
this.addrIndex = index;
|
||||||
this.isAddr = false;
|
this.isAddr = false;
|
||||||
|
// 每次选择城市----清空待提交科目id数组
|
||||||
|
this.temporaryCode = [];
|
||||||
// 查询科目
|
// 查询科目
|
||||||
this.getSubjectArray();
|
this.getSubjectArray();
|
||||||
console.log(this.addrData[this.addrIndex],3636)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选择性别
|
// 选择性别
|
||||||
openSex(){
|
openSex(){
|
||||||
this.isSex=!this.isSex;
|
this.isSex=!this.isSex;
|
||||||
|
@ -249,7 +247,6 @@
|
||||||
this.sexIndex = index;
|
this.sexIndex = index;
|
||||||
this.isSex=false;
|
this.isSex=false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选择时间
|
// 选择时间
|
||||||
openDate(){
|
openDate(){
|
||||||
this.isDate=!this.isDate;
|
this.isDate=!this.isDate;
|
||||||
|
@ -259,7 +256,6 @@
|
||||||
this.dateIndex = index;
|
this.dateIndex = index;
|
||||||
this.isDate=false;
|
this.isDate=false;
|
||||||
},
|
},
|
||||||
|
|
||||||
//选择考生类别
|
//选择考生类别
|
||||||
openCategory(){
|
openCategory(){
|
||||||
this.isCategory=!this.isCategory;
|
this.isCategory=!this.isCategory;
|
||||||
|
@ -269,8 +265,6 @@
|
||||||
this.categoryIndex = index;
|
this.categoryIndex = index;
|
||||||
this.isCategory=false;
|
this.isCategory=false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// 获取选科组合列表
|
// 获取选科组合列表
|
||||||
getSubjectArray() {
|
getSubjectArray() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -298,20 +292,72 @@
|
||||||
that.subjectArray =newArray;
|
that.subjectArray =newArray;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选科组合选择事件
|
// 选科组合选择事件
|
||||||
onChange(index,number) {
|
onChange(index,subId) {
|
||||||
// let that = this;
|
let existSubid = this.temporaryCode.indexOf(subId);
|
||||||
let id = number;
|
let existsubIndex = this.subjectArray.findIndex(item=>item.id==subId);
|
||||||
let indexes = index + 1;
|
console.log(existSubid,existsubIndex,299);
|
||||||
console.log(indexes,id,123)
|
if(this.addrData[this.addrIndex].subject_max!=1){
|
||||||
|
// 多选
|
||||||
|
if(this.temporaryCode.length < this.addrData[this.addrIndex].subject_max){
|
||||||
|
// 没有超过限制选择的科目数量
|
||||||
|
if(existSubid==-1){
|
||||||
|
if(this.addrData[this.addrIndex].subject_radio_group_list.length) {
|
||||||
|
// 存在限制的科目id
|
||||||
|
let limitSubid = this.addrData[this.addrIndex].subject_radio_group_list[0].findIndex(item=>item==subId);
|
||||||
|
let date = this.temporaryCode.findIndex(item => this.addrData[this.addrIndex].subject_radio_group_list[0].indexOf(item) > -1)
|
||||||
|
if(limitSubid!=-1 && date!=-1){
|
||||||
|
// 待提交科目数组id存在限制科目的id
|
||||||
|
console.log('选择科目冲突');
|
||||||
|
} else {
|
||||||
|
// 待提交科目数组id不存在限制科目的id
|
||||||
|
this.subjectArray[index].isActive = !this.subjectArray[index].isActive;
|
||||||
|
this.setSubList(index,subId);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 不存在限制的科目的id
|
||||||
|
this.subjectArray[index].isActive = !this.subjectArray[index].isActive;
|
||||||
|
this.setSubList(index,subId);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.temporaryCode.splice(existSubid,1);
|
||||||
|
this.subjectArray[existsubIndex].isActive = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 超过了限制选择科目的数量
|
||||||
|
if(existSubid!=-1){
|
||||||
|
// 如果选中的科目id在待提交的数组里存在,则删除当前选中的科目
|
||||||
|
this.temporaryCode.splice(existSubid,1);
|
||||||
|
this.subjectArray[existsubIndex].isActive = false;
|
||||||
|
} else {
|
||||||
|
console.log('提示框:xxxx');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 单选
|
||||||
|
|
||||||
|
// 清空暂存编号
|
||||||
|
this.temporaryCode = [];
|
||||||
|
// 取消所有选中项
|
||||||
|
this.subjectArray.forEach(item=>{item.isActive = false;})
|
||||||
|
// 调用设置科目列表事件
|
||||||
|
this.setSubList(index,subId);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 设置科目列表事件
|
||||||
|
setSubList(index,id){
|
||||||
|
// 设置选中项
|
||||||
|
this.subjectArray[index].isActive = true;
|
||||||
|
// 储存选中项的id到待提交数组里
|
||||||
|
this.temporaryCode.push(id);
|
||||||
|
console.log(this.temporaryCode,'数据');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 获取考生信息
|
// 获取考生信息
|
||||||
getStudentInfo() {
|
setStudentInfo() {
|
||||||
let that =this;
|
let that =this;
|
||||||
|
if(this.temporaryCode.length != this.addrData[this.addrIndex].subject_max){
|
||||||
|
console.log('弹框提示,必须选择多少个科目');
|
||||||
|
} else {
|
||||||
let data = {
|
let data = {
|
||||||
student_name: that.studentName,//姓名
|
student_name: that.studentName,//姓名
|
||||||
student_gender: that.sexIndex==0 ? 1 : 2,//性别
|
student_gender: that.sexIndex==0 ? 1 : 2,//性别
|
||||||
|
@ -326,6 +372,7 @@
|
||||||
achievement_high: '',//高考成绩,-1表示未考(用户留空时默认传值为-1)
|
achievement_high: '',//高考成绩,-1表示未考(用户留空时默认传值为-1)
|
||||||
}
|
}
|
||||||
console.log(data)
|
console.log(data)
|
||||||
|
}
|
||||||
// let that = this;
|
// let that = this;
|
||||||
// this.axios
|
// this.axios
|
||||||
// .post(this.HOME + "/api/area/index", {
|
// .post(this.HOME + "/api/area/index", {
|
||||||
|
|
Loading…
Reference in New Issue