|
@@ -84,7 +84,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="btn">
|
|
|
- <el-button style="width: 100%;height: 30px" type="primary">保存志愿表</el-button>
|
|
|
+ <el-button style="width: 100%;height: 30px" type="primary" @click="save">保存志愿表</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</transition>
|
|
@@ -94,7 +94,7 @@
|
|
|
<script>
|
|
|
import FilterForm from '@/views/career/components/FilterForm';
|
|
|
import ZhiyuanList from '@/views/career/zhiyuan/components/zhiyuan-list';
|
|
|
-import { allMajor,getRecommendVoluntary,getVoluntaryMarjors,getVoluntaryHeaders } from '@/api/webApi/professlib'
|
|
|
+import { allMajor,getRecommendVoluntary,getVoluntaryMarjors,getVoluntaryHeaders,saveZhiyuan } from '@/api/webApi/professlib'
|
|
|
export default {
|
|
|
props: {
|
|
|
formSubject: {
|
|
@@ -150,6 +150,15 @@ export default {
|
|
|
handler(){
|
|
|
this.getList()
|
|
|
}
|
|
|
+ },
|
|
|
+ selectedList:{
|
|
|
+ deep:true,
|
|
|
+ handler(selectedList){
|
|
|
+ const index= selectedList.findIndex(item => { return item.majors.filter(major =>{ return major.selected }).length <= 0 })
|
|
|
+ if(index != -1) {
|
|
|
+ this.selectedList.splice(index,1)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -203,6 +212,42 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ save(){
|
|
|
+ const wishes = this.selectedList.map(item =>{
|
|
|
+ return {
|
|
|
+ universityId:item.university.id,
|
|
|
+ collegeCode: item.recruitPlan.collegeCode,
|
|
|
+ code:item.university.code,
|
|
|
+ name:item.university.name,
|
|
|
+ majors:item.majors.filter(major => {return major.selected}).map(major=> {
|
|
|
+ return {
|
|
|
+ id: major.id,
|
|
|
+ code: major.marjorBelongs,
|
|
|
+ name: major.marjorName,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const data = {
|
|
|
+ batch: this.batch.batch,
|
|
|
+ detail:{
|
|
|
+ batch:{
|
|
|
+ batch:this.batch.batch,
|
|
|
+ name:this.batch.name,
|
|
|
+ recommand: true,
|
|
|
+ scores:[],
|
|
|
+ wishes:wishes,
|
|
|
+ },
|
|
|
+ mode:`${this.formSubject.firstSubject},${this.formSubject.lastSubject}`,
|
|
|
+ score:this.batch.score1
|
|
|
+ },
|
|
|
+ id: 0,
|
|
|
+ name: ''
|
|
|
+ }
|
|
|
+ saveZhiyuan(data).then(res =>{
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
apply(item,index) {
|
|
|
// 有无院校 ?
|
|
|
const codeFlag = this.selectedList.find(item => item.recruitPlan.collegeCode == this.rows[index].recruitPlan.collegeCode)
|
|
@@ -211,7 +256,6 @@ export default {
|
|
|
this.selectedList.push(this.rows[index])
|
|
|
}
|
|
|
item.selected = !item.selected
|
|
|
-
|
|
|
},
|
|
|
deleteMajor(major){
|
|
|
major.selected = false
|
|
@@ -265,7 +309,22 @@ export default {
|
|
|
item.majors = []
|
|
|
return item
|
|
|
})
|
|
|
- this.rows = rows
|
|
|
+ // 回显
|
|
|
+ if(this.selectedList.length) {
|
|
|
+ this.rows = rows.map(row => {
|
|
|
+ const flagIndex = this.selectedList.findIndex(selected => {
|
|
|
+ return selected.recruitPlan.collegeCode == row.recruitPlan.collegeCode
|
|
|
+ })
|
|
|
+ if(flagIndex == -1) {
|
|
|
+ return row
|
|
|
+ }else {
|
|
|
+ return this.selectedList[flagIndex]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.rows = rows
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
getVoluntaryMarjors(item) {
|