科目选择修改

master
chen 2022-03-05 16:42:19 +08:00
parent aec17529bd
commit 25d3f18c8a
1 changed files with 83 additions and 36 deletions

View File

@ -61,7 +61,7 @@
</li>
</ul>
</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-item" v-show="isAddr">
@ -213,7 +213,6 @@
that.getSubjectArray();
});
},
//
getDate(){
const date = new Date();
@ -226,7 +225,6 @@
this.dateArray = newArray;
this.dateValue = this.dateArray[this.dateIndex];
},
//
openAddr(){
this.isAddr=!this.isAddr;
@ -234,12 +232,12 @@
getAddrValue(index,item){
this.addrValue = item.code;
this.addrIndex = index;
this.isAddr=false;
this.isAddr = false;
// ----id
this.temporaryCode = [];
//
this.getSubjectArray();
console.log(this.addrData[this.addrIndex],3636)
},
//
openSex(){
this.isSex=!this.isSex;
@ -249,7 +247,6 @@
this.sexIndex = index;
this.isSex=false;
},
//
openDate(){
this.isDate=!this.isDate;
@ -259,7 +256,6 @@
this.dateIndex = index;
this.isDate=false;
},
//
openCategory(){
this.isCategory=!this.isCategory;
@ -269,8 +265,6 @@
this.categoryIndex = index;
this.isCategory=false;
},
//
getSubjectArray() {
let that = this;
@ -298,34 +292,87 @@
that.subjectArray =newArray;
});
},
//
onChange(index,number) {
// let that = this;
let id = number;
let indexes = index + 1;
console.log(indexes,id,123)
},
//
getStudentInfo() {
let that =this;
let data = {
student_name: that.studentName,//
student_gender: that.sexIndex==0 ? 1 : 2,//
student_native: that.addrData[that.addrIndex].code, //
student_native_str: that.addrData[that.addrIndex].name,//
// student_subject: this.temporaryCode.join(','),//ID
student_exam_year: that.dateValue,//
is_art: that.dateIndex==1?1:0,//
is_PE:that.dateIndex==2?1:0,//
achievement_expect: that.achievementExpect,//
province_ranking: that.provinceRanking,///
achievement_high: '',//-1-1
onChange(index,subId) {
let existSubid = this.temporaryCode.indexOf(subId);
let existsubIndex = this.subjectArray.findIndex(item=>item.id==subId);
console.log(existSubid,existsubIndex,299);
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){
// idid
console.log('选择科目冲突');
} else {
// idid
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,'数据');
},
//
setStudentInfo() {
let that =this;
if(this.temporaryCode.length != this.addrData[this.addrIndex].subject_max){
console.log('弹框提示,必须选择多少个科目');
} else {
let data = {
student_name: that.studentName,//
student_gender: that.sexIndex==0 ? 1 : 2,//
student_native: that.addrData[that.addrIndex].code, //
student_native_str: that.addrData[that.addrIndex].name,//
// student_subject: this.temporaryCode.join(','),//ID
student_exam_year: that.dateValue,//
is_art: that.dateIndex==1?1:0,//
is_PE:that.dateIndex==2?1:0,//
achievement_expect: that.achievementExpect,//
province_ranking: that.provinceRanking,///
achievement_high: '',//-1-1
}
console.log(data)
}
console.log(data)
// let that = this;
// this.axios
// .post(this.HOME + "/api/area/index", {