Lee-1203 2022-03-05 17:09:41 +08:00
commit 990d9f7536
1 changed files with 83 additions and 36 deletions

View File

@ -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;
@ -234,12 +232,12 @@
getAddrValue(index,item){ getAddrValue(index,item){
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){
// 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,'数据');
}, },
// //
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", {