招生
This commit is contained in:
227
src/views/recruit/recruitplanmajor/majorGroupByDept.vue
Normal file
227
src/views/recruit/recruitplanmajor/majorGroupByDept.vue
Normal file
@@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="招生计划专业调整"
|
||||
append-to-body
|
||||
width="90%"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" ref="dataForm" label-width="140px">
|
||||
<el-form-item label="招生计划名称" prop="groupName">
|
||||
<el-input v-model="dataForm.groupName" placeholder="招生计划名称" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-tabs v-model="activiName" @tab-click="handleChange">
|
||||
<el-tab-pane v-for="item in deptList"
|
||||
:key="item.deptCode"
|
||||
:label="item.deptName"
|
||||
:name="item.deptCode">
|
||||
<div class="avue-crud">
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
stripe
|
||||
v-loading="dataListLoading">
|
||||
<el-table-column
|
||||
prop="zymc"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="专业"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span >{{ scope.row.zymc+' || '+scope.row.zydm+' || '+scope.row.xz+' 年制'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="planStudentNum"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="计划总数"
|
||||
width="180px"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number style="width: 80%" v-model="scope.row.planStudentNum" :min="0" :max="999" @change="updateMajor(scope.row)" width="100px"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="needStudentNum"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="控制数"
|
||||
width="180px"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number style="width: 80%" v-model="scope.row.needStudentNum" :min="0" :max="999"
|
||||
@change="updateMajor(scope.row)"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="needStudentOverNum"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="预留"
|
||||
width="180px"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number style="width: 80%" v-model="scope.row.needStudentOverNum" :min="0" :max="999"
|
||||
@change="updateMajor(scope.row)"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="scoreLine"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="录取线"
|
||||
width="180px"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number style="width: 80%" v-model="scope.row.scoreLine" :min="0" :max="999"
|
||||
@change="updateMajor(scope.row)"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="degreeOfEducation"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="生源">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.degreeOfEducation" placeholder="请选择生源" style=" width: 100%;text-align:center" multiple
|
||||
@change="updateMajor(scope.row)">
|
||||
<el-option
|
||||
v-for="item in degreeOfEducationList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {list, delObj} from '@/api/recruit/recruitplanmajor'
|
||||
import {putObj} from '@/api/recruit/recruitstudentplan'
|
||||
|
||||
import {mapGetters} from 'vuex'
|
||||
import global from '@/components/tools/commondict'
|
||||
import {fetchSecondTree} from "@/api/basic/basicdept";
|
||||
import {getDictByType} from "@/api/contract/contract";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataForm: {
|
||||
groupId: "",
|
||||
groupName: "",
|
||||
deptCode: "11",
|
||||
},
|
||||
activiName: "11",
|
||||
global: global,
|
||||
dataList: [],
|
||||
deptList: [],
|
||||
degreeOfEducationList:[],
|
||||
dataListLoading: false,
|
||||
visible: false,
|
||||
tableLoading: false,
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['permissions'])
|
||||
},
|
||||
methods: {
|
||||
init(row) {
|
||||
this.visible = true;
|
||||
this.dataForm.deptCode = "11";
|
||||
this.dataForm.groupName = row.groupName;
|
||||
this.dataForm.groupId = row.id;
|
||||
this.initData()
|
||||
this.getDepartment();
|
||||
this.getDataList()
|
||||
},
|
||||
initData(){
|
||||
this.degreeOfEducationList=[];
|
||||
//获取数据字典
|
||||
getDictByType("finance_student_source").then(res => {
|
||||
this.degreeOfEducationList = res.data.data
|
||||
})
|
||||
},
|
||||
getDepartment() {
|
||||
fetchSecondTree().then(res => {
|
||||
this.deptList = res.data.data
|
||||
})
|
||||
},
|
||||
updateMajor(row) {
|
||||
if(row.degreeOfEducation.length!=0){
|
||||
row.degreeOfEducations = row.degreeOfEducation.join(",");
|
||||
}else{
|
||||
row.degreeOfEducations="";
|
||||
}
|
||||
putObj({
|
||||
id: row.planId,
|
||||
planStudentNum: row.planStudentNum,
|
||||
planStudentBoyNum: row.planStudentBoyNum,
|
||||
planStudentGirlNum: row.planStudentGirlNum,
|
||||
needStudentNum: row.needStudentNum,
|
||||
needStudentOverNum:row.needStudentOverNum,
|
||||
scoreLine: row.scoreLine,
|
||||
scoreMinLine: row.scoreMinLine,
|
||||
degreeOfEducations: row.degreeOfEducations
|
||||
}).then(res => {
|
||||
this.$notify.success('修改成功')
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleChange(tab, event) {
|
||||
this.dataForm.deptCode = tab.name;
|
||||
this.getDataList()
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataList = []
|
||||
this.dataListLoading = true
|
||||
if (this.dataForm.deptCode == '') {
|
||||
this.dataForm.deptCode = "11";
|
||||
}
|
||||
list({groupId: this.dataForm.groupId, deptCode: this.dataForm.deptCode}).then(response => {
|
||||
this.dataList = response.data.data
|
||||
this.dataList.forEach(e=>{
|
||||
if(e.degreeOfEducation){
|
||||
e.degreeOfEducation = e.degreeOfEducation.split(",")
|
||||
}
|
||||
})
|
||||
})
|
||||
this.dataListLoading = false
|
||||
},
|
||||
|
||||
// 删除
|
||||
deleteHandle(id) {
|
||||
this.$confirm('是否确认删除本条数据?请谨慎操作', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(function () {
|
||||
return delObj(id)
|
||||
}).then(data => {
|
||||
this.$message.success('删除成功')
|
||||
this.getDataList()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user