招生
This commit is contained in:
292
src/views/recruit/recruitplanmajor/detaiform.vue
Normal file
292
src/views/recruit/recruitplanmajor/detaiform.vue
Normal file
@@ -0,0 +1,292 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||
label-width="140px">
|
||||
|
||||
<el-form-item label="招生计划" prop="groupId">
|
||||
<el-select v-model="dataForm.groupId" filterable placeholder="请选择招生计划" size="small" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in planList"
|
||||
:key="item.id"
|
||||
:label="item.groupName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="专业代码" prop="zydm">
|
||||
<el-input v-model="dataForm.zydm" placeholder="专业代码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="专业名称" prop="zymc">
|
||||
<el-input v-model="dataForm.zymc" placeholder="专业名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="专业规范名称" prop="zygfmc">
|
||||
<el-input v-model="dataForm.zygfmc" placeholder="专业规范名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属学院" prop="deptCode">
|
||||
<el-select v-model="dataForm.deptCode" filterable placeholder="请选择" size="small" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:key="item.deptCode"
|
||||
:label="item.deptName"
|
||||
:value="item.deptCode">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学制" prop="xz">
|
||||
<el-select v-model="dataForm.xz" filterable placeholder="请选择学制" size="small" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in majorYears"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="层次" prop="cc">
|
||||
<el-select v-model="dataForm.cc" filterable placeholder="请选择层次" size="small" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in ccList"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.label">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="中德班" prop="isZd">
|
||||
<el-radio-group v-model="dataForm.isZd">
|
||||
<el-radio label="1">是</el-radio>
|
||||
<el-radio label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单班" prop="isOrder">
|
||||
<el-radio-group v-model="dataForm.isOrder">
|
||||
<el-radio label="1">是</el-radio>
|
||||
<el-radio label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="联院班" prop="isUnion">
|
||||
<el-radio-group v-model="dataForm.isUnion">
|
||||
<el-radio label="1">是</el-radio>
|
||||
<el-radio label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="正式专业代码" prop="offcialZydm">
|
||||
<el-select v-model="dataForm.offcialZydm" filterable placeholder="请选择正式专业代码" size="small" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in offcialZydmList"
|
||||
:key="item.majorCode"
|
||||
:label="item.majorCodeAndName"
|
||||
:value="item.majorCode">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="市平台代码" prop="cityPlanId">
|
||||
<el-select v-model="dataForm.cityPlanId" filterable placeholder="请选择市平台代码" size="small" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in cityPlanIdList"
|
||||
:key="item.id"
|
||||
:label="item.schoolMajorName+' | '+item.educational"
|
||||
:value="item.id"
|
||||
:disabled="isCityDisable(item.id)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number :min="0" :max="999" v-model="dataForm.sort" placeholder="排序"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input type="textarea" :rows="3" placeholder="请输入备注信息" v-model="dataForm.remarks"
|
||||
style="width: 100%;margin-top: 10px"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="canSubmit">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addObj, getObj, putObj,getCityPlan} from '@/api/recruit/recruitplanmajor'
|
||||
import {getDeptList} from "@/api/basic/basicclass";
|
||||
import {getDictByType} from "@/api/contract/contract";
|
||||
import {list} from "@/api/recruit/recruitstudentplangroup";
|
||||
import {getMajorNameList} from "@/api/basic/major";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
canSubmit: false,
|
||||
dataForm: {
|
||||
id: "",
|
||||
groupId: "",
|
||||
zydm: "",
|
||||
zymc: "",
|
||||
zygfmc: "",
|
||||
deptCode: "",
|
||||
xz: "",
|
||||
cc: "",
|
||||
isZd: "0",
|
||||
isOrder: "0",
|
||||
remarks: "",
|
||||
offcialZydm: "",
|
||||
isUnion:"0",
|
||||
tuitionFee:0,
|
||||
cityPlanId:null
|
||||
},
|
||||
cityPlanIdList:[],
|
||||
offcialZydmList: [],
|
||||
planList: [],
|
||||
yeNoList: [],
|
||||
deptList: [],
|
||||
ccList: [],
|
||||
majorYears: [],
|
||||
dataRule: {
|
||||
zydm: [
|
||||
{required: true, message: '专业代码不能为空', trigger: 'blur'},
|
||||
{min: 1, max: 6, message: '专业代码长度不大于6个字符', trigger: 'blur'}
|
||||
],
|
||||
tuitionFee: [
|
||||
{required: true, message: '学费不能为空', trigger: 'blur'}
|
||||
],
|
||||
zymc: [
|
||||
{required: true, message: '专业名称不能为空', trigger: 'blur'},
|
||||
{min: 1, max: 200, message: '专业名称长度不大于200个字符', trigger: 'blur'}
|
||||
|
||||
],
|
||||
zygfmc: [
|
||||
{required: true, message: '专业规范名称不能为空', trigger: 'blur'},
|
||||
{min: 1, max: 200, message: '专业规范名称长度不大于200个字符', trigger: 'blur'}
|
||||
],
|
||||
groupId: [
|
||||
{required: true, message: '招生计划不能为空', trigger: 'blur'}
|
||||
],
|
||||
xz: [
|
||||
{required: true, message: '学制不能为空', trigger: 'blur'}
|
||||
],
|
||||
deptCode: [
|
||||
{required: true, message: '学院不能为空', trigger: 'blur'}
|
||||
],
|
||||
cc: [
|
||||
{required: true, message: '层次不能为空', trigger: 'blur'}
|
||||
],
|
||||
isOrder: [
|
||||
{required: true, message: '订单班不能为空', trigger: 'blur'}
|
||||
],
|
||||
isZd: [
|
||||
{required: true, message: '订单班不能为空', trigger: 'blur'}
|
||||
],
|
||||
isUnion: [
|
||||
{required: true, message: '联院班不能为空', trigger: 'blur'}
|
||||
],
|
||||
remarks: [
|
||||
{min: 1, max: 100, message: '备注长度不大于100个字符', trigger: 'blur'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || null;
|
||||
this.visible = true;
|
||||
this.canSubmit = true;
|
||||
this.initData();
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
getObj(this.dataForm.id).then(response => {
|
||||
this.dataForm = response.data.data
|
||||
//获取市平台对应年份下的招生计划
|
||||
getCityPlan({id:this.dataForm.id}).then(data =>{
|
||||
this.cityPlanIdList = data.data.data
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 判断市平台招生专业是否占用,占用不可选
|
||||
* @param notBedNo
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isCityDisable(id){
|
||||
var returnFlag = false;
|
||||
this.dataForm.cityPlanIds.forEach(e=>{
|
||||
if(e == id){
|
||||
returnFlag = true;
|
||||
}
|
||||
})
|
||||
return returnFlag;
|
||||
},
|
||||
initData() {
|
||||
//查询二级学院信息
|
||||
getDeptList().then(data => {
|
||||
this.deptList = data.data.data
|
||||
})
|
||||
list().then(data => {
|
||||
this.planList = data.data.data
|
||||
if (!this.dataForm.id) {
|
||||
this.dataForm.groupId = this.planList[0].id;
|
||||
}
|
||||
});
|
||||
getMajorNameList().then(data =>{
|
||||
this.offcialZydmList = data.data.data
|
||||
})
|
||||
//获取数据字典
|
||||
getDictByType("yes_no").then(res => {
|
||||
this.yesNoList = res.data.data
|
||||
})
|
||||
getDictByType("basic_major_years").then(res => {
|
||||
this.majorYears = res.data.data
|
||||
})
|
||||
getDictByType("basic_major_level").then(res => {
|
||||
this.ccList = res.data.data
|
||||
})
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
if(this.dataForm.cityPlanId !=null){
|
||||
this.cityPlanIdList.forEach(e=>{
|
||||
if(e.id == this.dataForm.cityPlanId){
|
||||
this.dataForm.cityPlanName = e.schoolMajorName;
|
||||
this.dataForm.cityPlanYear = e.educational;
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.canSubmit = false;
|
||||
if (this.dataForm.id) {
|
||||
putObj(this.dataForm).then(data => {
|
||||
this.$notify.success('修改成功')
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}).catch(() => {
|
||||
this.canSubmit = true;
|
||||
});
|
||||
} else {
|
||||
addObj(this.dataForm).then(data => {
|
||||
this.$notify.success('添加成功')
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}).catch(() => {
|
||||
this.canSubmit = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
340
src/views/recruit/recruitplanmajor/index.vue
Normal file
340
src/views/recruit/recruitplanmajor/index.vue
Normal file
@@ -0,0 +1,340 @@
|
||||
<!--
|
||||
- Copyright (c) 2018-2025, cyweb All rights reserved.
|
||||
-
|
||||
- Redistribution and use in source and binary forms, with or without
|
||||
- modification, are permitted provided that the following conditions are met:
|
||||
-
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
- this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
- notice, this list of conditions and the following disclaimer in the
|
||||
- documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of the pig4cloud.com developer nor the names of its
|
||||
- contributors may be used to endorse or promote products derived from
|
||||
- this software without specific prior written permission.
|
||||
-
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<!-- 搜索表单 -->
|
||||
<el-form :model="queryForm" inline class="mb-4" ref="searchFormRef">
|
||||
<el-form-item label="招生计划" prop="groupId">
|
||||
<el-select v-model="queryForm.groupId" filterable clearable placeholder="请选择招生计划">
|
||||
<el-option
|
||||
v-for="item in planList"
|
||||
:key="item.id"
|
||||
:label="item.groupName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学院" prop="deptCode">
|
||||
<el-select v-model="queryForm.deptCode" filterable clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:key="item.deptCode"
|
||||
:label="item.deptName"
|
||||
:value="item.deptCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="专业序号" prop="zydm">
|
||||
<el-input v-model="queryForm.zydm" placeholder="专业序号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="专业名称" prop="zymc">
|
||||
<el-input v-model="queryForm.zymc" placeholder="专业名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学制" prop="xz">
|
||||
<el-input v-model="queryForm.xz" placeholder="学制" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="getDataList">查询</el-button>
|
||||
<el-button type="primary" plain icon="Refresh" class="ml10" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<div class="mb15">
|
||||
<el-button
|
||||
v-if="permissions.recruit_recruitplanmajor_add"
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="addOrUpdateHandle"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
stripe
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="groupId" label="招生计划名称" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ getPlanName(scope.row.groupId) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="zydm" label="专业序号" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="zymc" label="专业名称" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="zygfmc" label="专业规范名称" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="deptCode" label="学院" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ getDeptName(scope.row.deptCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="xz" label="学制" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="cc" label="层次" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="isOrder" label="订单班" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ getYesNoLabel(scope.row.isOrder) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isZd" label="中德班" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ getYesNoLabel(scope.row.isZd) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isUnion" label="联院班" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ getYesNoLabel(scope.row.isUnion) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sm" label="色盲不可录" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.sm"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="changeSm(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="offcialZydm" label="正式专业代码" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ getMajorCodeName(scope.row.offcialZydm) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cityPlanId" label="市平台招生计划" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ scope.row.cityPlanName != undefined ? (scope.row.cityPlanName + '|' + scope.row.cityPlanYear) : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="permissions.recruit_recruitplanmajor_edit"
|
||||
type="primary"
|
||||
link
|
||||
icon="EditPen"
|
||||
@click="addOrUpdateHandle(scope.row.id)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="permissions.recruit_recruitplanmajor_del"
|
||||
type="danger"
|
||||
link
|
||||
icon="Delete"
|
||||
@click="deleteHandle(scope.row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
v-bind="state.pagination"
|
||||
@current-change="currentChangeHandle"
|
||||
@size-change="sizeChangeHandle"
|
||||
/>
|
||||
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<table-form v-if="addOrUpdateVisible" ref="addOrUpdateRef" @refreshDataList="getDataList" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="recruitplanmajor">
|
||||
import { ref, reactive, computed, onMounted, nextTick, defineAsyncComponent } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message'
|
||||
import { list } from '/@/api/recruit/recruitstudentplangroup'
|
||||
import { fetchList, putObj, delObj } from '/@/api/recruit/recruitplanmajor'
|
||||
import { getDeptList } from '/@/api/basic/basicclass'
|
||||
import { getMajorNameList } from '/@/api/basic/major'
|
||||
// @ts-ignore
|
||||
import global from '@/components/tools/commondict'
|
||||
|
||||
const TableForm = defineAsyncComponent(() => import('./detaiform.vue'))
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
|
||||
// 表格引用
|
||||
const tableRef = ref()
|
||||
const searchFormRef = ref()
|
||||
const addOrUpdateRef = ref()
|
||||
|
||||
// 弹窗状态
|
||||
const addOrUpdateVisible = ref(false)
|
||||
|
||||
// 数据
|
||||
const planList = ref<any[]>([])
|
||||
const deptList = ref<any[]>([])
|
||||
const offcialZydmList = ref<any[]>([])
|
||||
|
||||
// 查询表单
|
||||
const queryForm = reactive({
|
||||
groupId: '',
|
||||
deptCode: '',
|
||||
zydm: '',
|
||||
zymc: '',
|
||||
xz: ''
|
||||
})
|
||||
|
||||
// 获取计划名称
|
||||
const getPlanName = (groupId: string) => {
|
||||
const item = planList.value.find(item => item.id === groupId)
|
||||
return item ? item.groupName : ''
|
||||
}
|
||||
|
||||
// 获取学院名称
|
||||
const getDeptName = (deptCode: string) => {
|
||||
const item = deptList.value.find(item => item.deptCode === deptCode)
|
||||
return item ? item.deptName : ''
|
||||
}
|
||||
|
||||
// 获取是/否标签
|
||||
const getYesNoLabel = (value: string) => {
|
||||
return global.getLabelValue(global.YES_OR_NO, value)
|
||||
}
|
||||
|
||||
// 获取专业代码名称
|
||||
const getMajorCodeName = (majorCode: string) => {
|
||||
const item = offcialZydmList.value.find(item => item.majorCode === majorCode)
|
||||
return item ? item.majorCodeAndName : ''
|
||||
}
|
||||
|
||||
// 表格状态
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: queryForm,
|
||||
pageList: async (params: any) => {
|
||||
const response = await fetchList(params)
|
||||
return {
|
||||
data: {
|
||||
records: response.data.data.records,
|
||||
total: response.data.data.total
|
||||
}
|
||||
}
|
||||
},
|
||||
createdIsNeed: false
|
||||
})
|
||||
|
||||
// 使用 table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state)
|
||||
|
||||
// 初始化
|
||||
const init = async () => {
|
||||
try {
|
||||
// 查询二级学院信息
|
||||
const deptData = await getDeptList()
|
||||
deptList.value = deptData.data.data || []
|
||||
|
||||
// 获取招生计划列表
|
||||
const planData = await list()
|
||||
planList.value = planData.data.data || []
|
||||
if (planList.value.length > 0) {
|
||||
queryForm.groupId = planList.value[0].id
|
||||
}
|
||||
|
||||
// 获取专业名称列表
|
||||
const majorData = await getMajorNameList()
|
||||
offcialZydmList.value = majorData.data.data || []
|
||||
|
||||
getDataList()
|
||||
} catch (error) {
|
||||
console.error('初始化失败', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 修改开关
|
||||
const changeSm = async (row: any) => {
|
||||
try {
|
||||
await putObj(row)
|
||||
message.success('修改成功')
|
||||
} catch (error: any) {
|
||||
message.error(error.msg || '修改失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 新增 / 修改
|
||||
const addOrUpdateHandle = (id?: string) => {
|
||||
addOrUpdateVisible.value = true
|
||||
nextTick(() => {
|
||||
addOrUpdateRef.value?.init(id)
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
const deleteHandle = async (id: string) => {
|
||||
try {
|
||||
await messageBox.confirm('是否确认删除本条数据?请谨慎操作')
|
||||
await delObj(id)
|
||||
message.success('删除成功')
|
||||
getDataList()
|
||||
} catch {
|
||||
// 用户取消
|
||||
}
|
||||
}
|
||||
|
||||
// 重置查询
|
||||
const resetQuery = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
queryForm.groupId = ''
|
||||
queryForm.deptCode = ''
|
||||
queryForm.zydm = ''
|
||||
queryForm.zymc = ''
|
||||
queryForm.xz = ''
|
||||
if (planList.value.length > 0) {
|
||||
queryForm.groupId = planList.value[0].id
|
||||
}
|
||||
getDataList()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
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