1
This commit is contained in:
@@ -1,272 +1,257 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog title="招生计划专业调整" append-to-body width="90%" :close-on-click-modal="false" v-model="visible">
|
||||||
title="招生计划专业调整"
|
<el-form :model="dataForm" ref="dataFormRef" label-width="140px">
|
||||||
append-to-body
|
<el-form-item label="招生计划名称" prop="groupName">
|
||||||
width="90%"
|
<el-input v-model="dataForm.groupName" placeholder="招生计划名称" disabled></el-input>
|
||||||
:close-on-click-modal="false"
|
</el-form-item>
|
||||||
v-model="visible">
|
</el-form>
|
||||||
<el-form :model="dataForm" ref="dataFormRef" label-width="140px">
|
<el-tabs v-model="activiName" @tab-click="handleChange">
|
||||||
<el-form-item label="招生计划名称" prop="groupName">
|
<el-tab-pane v-for="item in deptList" :key="item.deptCode" :label="item.deptName" :name="item.deptCode">
|
||||||
<el-input v-model="dataForm.groupName" placeholder="招生计划名称" disabled></el-input>
|
<div style="margin-top: 20px">
|
||||||
</el-form-item>
|
<el-table :data="dataList" border stripe v-loading="dataListLoading">
|
||||||
</el-form>
|
<el-table-column prop="majorName" header-align="center" align="center" label="专业">
|
||||||
<el-tabs v-model="activiName" @tab-click="handleChange">
|
<template #default="scope">
|
||||||
<el-tab-pane v-for="item in deptList"
|
<span>{{ scope.row.majorName + ' || ' + scope.row.majorCode + ' || ' + scope.row.learnYear + ' 年制' }}</span>
|
||||||
:key="item.deptCode"
|
</template>
|
||||||
:label="item.deptName"
|
</el-table-column>
|
||||||
:name="item.deptCode">
|
<el-table-column prop="planStudentNum" header-align="center" align="center" label="计划总数" width="180px">
|
||||||
<div style="margin-top: 20px;">
|
<template #default="scope">
|
||||||
<el-table
|
<el-input-number
|
||||||
:data="dataList"
|
style="width: 80%"
|
||||||
border
|
v-model="scope.row.planStudentNum"
|
||||||
stripe
|
:min="0"
|
||||||
v-loading="dataListLoading">
|
:max="999"
|
||||||
<el-table-column
|
@change="updateMajor(scope.row, 'planStudentNum')"
|
||||||
prop="majorName"
|
width="100px"
|
||||||
header-align="center"
|
></el-input-number>
|
||||||
align="center"
|
</template>
|
||||||
label="专业"
|
</el-table-column>
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ scope.row.majorName+' || '+scope.row.majorCode+' || '+scope.row.learnYear+' 年制'}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
prop="planStudentNum"
|
|
||||||
header-align="center"
|
|
||||||
align="center"
|
|
||||||
label="计划总数"
|
|
||||||
width="180px"
|
|
||||||
>
|
|
||||||
<template #default="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
|
<!-- <el-table-column-->
|
||||||
prop="needStudentNum"
|
<!-- prop="needStudentNum"-->
|
||||||
header-align="center"
|
<!-- header-align="center"-->
|
||||||
align="center"
|
<!-- align="center"-->
|
||||||
label="控制数"
|
<!-- label="控制数"-->
|
||||||
width="180px"
|
<!-- width="180px"-->
|
||||||
>
|
<!-- >-->
|
||||||
<template #default="scope">
|
<!-- <template #default="scope">-->
|
||||||
<el-input-number style="width: 80%" v-model="scope.row.needStudentNum" :min="0" :max="999"
|
<!-- <el-input-number style="width: 80%" v-model="scope.row.needStudentNum" :min="0" :max="999"-->
|
||||||
@change="updateMajor(scope.row)"></el-input-number>
|
<!-- @change="updateMajor(scope.row)"></el-input-number>-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
</el-table-column>
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
<el-table-column
|
<!-- <el-table-column-->
|
||||||
prop="needStudentOverNum"
|
<!-- prop="needStudentOverNum"-->
|
||||||
header-align="center"
|
<!-- header-align="center"-->
|
||||||
align="center"
|
<!-- align="center"-->
|
||||||
label="预留"
|
<!-- label="预留"-->
|
||||||
width="180px"
|
<!-- width="180px"-->
|
||||||
>
|
<!-- >-->
|
||||||
<template #default="scope">
|
<!-- <template #default="scope">-->
|
||||||
<el-input-number style="width: 80%" v-model="scope.row.needStudentOverNum" :min="0" :max="999"
|
<!-- <el-input-number style="width: 80%" v-model="scope.row.needStudentOverNum" :min="0" :max="999"-->
|
||||||
@change="updateMajor(scope.row)"></el-input-number>
|
<!-- @change="updateMajor(scope.row)"></el-input-number>-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
</el-table-column>
|
<!-- </el-table-column>-->
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column prop="scoreLine" header-align="center" align="center" label="录取线" width="180px">
|
||||||
prop="scoreLine"
|
<template #default="scope">
|
||||||
header-align="center"
|
<el-input-number
|
||||||
align="center"
|
style="width: 80%"
|
||||||
label="录取线"
|
v-model="scope.row.scoreLine"
|
||||||
width="180px"
|
:min="0"
|
||||||
>
|
:max="999"
|
||||||
<template #default="scope">
|
@change="updateMajor(scope.row, 'scoreLine')"
|
||||||
<el-input-number style="width: 80%" v-model="scope.row.scoreLine" :min="0" :max="999"
|
></el-input-number>
|
||||||
@change="updateMajor(scope.row)"></el-input-number>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column prop="degreeOfEducation" header-align="center" align="center" label="生源">
|
||||||
<el-table-column
|
<template #default="scope">
|
||||||
prop="degreeOfEducation"
|
<el-select
|
||||||
header-align="center"
|
v-model="scope.row.degreeOfEducation"
|
||||||
align="center"
|
placeholder="请选择生源"
|
||||||
label="生源">
|
style="width: 100%; text-align: center"
|
||||||
<template #default="scope">
|
multiple
|
||||||
<el-select v-model="scope.row.degreeOfEducation" placeholder="请选择生源" style=" width: 100%;text-align:center" multiple
|
@change="updateMajor(scope.row,'degreeOfEducation')"
|
||||||
@change="updateMajor(scope.row)">
|
>
|
||||||
<el-option
|
<el-option v-for="item in degreeOfEducationList" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
||||||
v-for="item in degreeOfEducationList"
|
</el-select>
|
||||||
:key="item.value"
|
</template>
|
||||||
:label="item.label"
|
</el-table-column>
|
||||||
:value="item.value">
|
</el-table>
|
||||||
</el-option>
|
</div>
|
||||||
</el-select>
|
</el-tab-pane>
|
||||||
</template>
|
</el-tabs>
|
||||||
</el-table-column>
|
</el-dialog>
|
||||||
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue';
|
||||||
import { useMessage, useMessageBox } from '/@/hooks/message'
|
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||||
import { ElNotification } from 'element-plus'
|
import { ElNotification } from 'element-plus';
|
||||||
import { listPlanByCondition as list, delObj ,putObj} from '/@/api/recruit/recruitstudentplan'
|
import { listPlanByCondition as list, delObj, putObj, editQuickField } from '/@/api/recruit/recruitstudentplan';
|
||||||
import { fetchSecondTree } from '/@/api/basic/basicdept'
|
import { fetchSecondTree } from '/@/api/basic/basicdept';
|
||||||
import { getDicts } from "/@/api/admin/dict"
|
import { getDicts } from '/@/api/admin/dict';
|
||||||
|
|
||||||
// 消息提示 hooks
|
// 消息提示 hooks
|
||||||
const message = useMessage()
|
const message = useMessage();
|
||||||
const messageBox = useMessageBox()
|
const messageBox = useMessageBox();
|
||||||
|
|
||||||
// 表单引用
|
// 表单引用
|
||||||
const dataFormRef = ref()
|
const dataFormRef = ref();
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const visible = ref(false)
|
const visible = ref(false);
|
||||||
const activiName = ref("11")
|
const activiName = ref('11');
|
||||||
const dataList = ref<any[]>([])
|
const dataList = ref<any[]>([]);
|
||||||
const deptList = ref<any[]>([])
|
const deptList = ref<any[]>([]);
|
||||||
const degreeOfEducationList = ref<any[]>([])
|
const degreeOfEducationList = ref<any[]>([]);
|
||||||
const dataListLoading = ref(false)
|
const dataListLoading = ref(false);
|
||||||
|
|
||||||
const dataForm = reactive({
|
const dataForm = reactive({
|
||||||
groupId: "",
|
groupId: '',
|
||||||
groupName: "",
|
groupName: '',
|
||||||
deptCode: "11",
|
deptCode: '11',
|
||||||
})
|
});
|
||||||
|
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
const initData = () => {
|
const initData = () => {
|
||||||
degreeOfEducationList.value = []
|
degreeOfEducationList.value = [];
|
||||||
// 获取数据字典
|
// 获取数据字典
|
||||||
getDicts("finance_student_source").then((res: any) => {
|
getDicts('finance_student_source')
|
||||||
degreeOfEducationList.value = res.data || []
|
.then((res: any) => {
|
||||||
}).catch((error: any) => {
|
degreeOfEducationList.value = res.data || [];
|
||||||
message.error('获取字典数据失败:' + (error.msg || '未知错误'))
|
})
|
||||||
degreeOfEducationList.value = []
|
.catch((error: any) => {
|
||||||
})
|
message.error('获取字典数据失败:' + (error.msg || '未知错误'));
|
||||||
}
|
degreeOfEducationList.value = [];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 获取部门列表
|
// 获取部门列表
|
||||||
const getDepartment = () => {
|
const getDepartment = () => {
|
||||||
fetchSecondTree().then((res: any) => {
|
fetchSecondTree()
|
||||||
deptList.value = res.data || []
|
.then((res: any) => {
|
||||||
}).catch((error: any) => {
|
deptList.value = res.data || [];
|
||||||
message.error('获取部门列表失败:' + (error.msg || '未知错误'))
|
})
|
||||||
deptList.value = []
|
.catch((error: any) => {
|
||||||
})
|
message.error('获取部门列表失败:' + (error.msg || '未知错误'));
|
||||||
}
|
deptList.value = [];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 更新专业
|
// 更新专业
|
||||||
const updateMajor = (row: any) => {
|
const updateMajor = (row: any, type: any) => {
|
||||||
if (!row || !row.planId) {
|
if (!row || !row.id) {
|
||||||
message.error('缺少必要的参数:planId')
|
message.error('缺少计划主键');
|
||||||
return
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (row.degreeOfEducation && Array.isArray(row.degreeOfEducation) && row.degreeOfEducation.length != 0) {
|
||||||
|
row.degreeOfEducations = row.degreeOfEducation.join(',');
|
||||||
|
} else {
|
||||||
|
row.degreeOfEducations = '';
|
||||||
|
}
|
||||||
|
let params = {} as any;
|
||||||
|
params.id = row.id;
|
||||||
|
if (type == 'planStudentNum') {
|
||||||
|
params.planStudentNum=row.planStudentNum
|
||||||
|
}
|
||||||
|
if (type == 'scoreLine') {
|
||||||
|
params.scoreLine=row.scoreLine
|
||||||
|
}
|
||||||
|
if (type == 'degreeOfEducation') {
|
||||||
|
params.degreeOfEducation=row.degreeOfEducations
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row.degreeOfEducation && Array.isArray(row.degreeOfEducation) && row.degreeOfEducation.length != 0) {
|
editQuickField(params)
|
||||||
row.degreeOfEducations = row.degreeOfEducation.join(",")
|
.then(() => {
|
||||||
} else {
|
ElNotification.success({
|
||||||
row.degreeOfEducations = ""
|
title: '成功',
|
||||||
}
|
message: '修改成功',
|
||||||
|
});
|
||||||
putObj({
|
})
|
||||||
id: row.planId,
|
.catch((error: any) => {
|
||||||
planStudentNum: row.planStudentNum || 0,
|
message.error('修改失败:' + (error.msg || '未知错误'));
|
||||||
planStudentBoyNum: row.planStudentBoyNum || 0,
|
});
|
||||||
planStudentGirlNum: row.planStudentGirlNum || 0,
|
};
|
||||||
needStudentNum: row.needStudentNum || 0,
|
|
||||||
needStudentOverNum: row.needStudentOverNum || 0,
|
|
||||||
scoreLine: row.scoreLine || 0,
|
|
||||||
scoreMinLine: row.scoreMinLine || 0,
|
|
||||||
degreeOfEducations: row.degreeOfEducations || ""
|
|
||||||
}).then(() => {
|
|
||||||
ElNotification.success({
|
|
||||||
title: '成功',
|
|
||||||
message: '修改成功'
|
|
||||||
})
|
|
||||||
}).catch((error: any) => {
|
|
||||||
message.error('修改失败:' + (error.msg || '未知错误'))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 标签切换
|
// 标签切换
|
||||||
const handleChange = (tab: any) => {
|
const handleChange = (tab: any) => {
|
||||||
dataForm.deptCode = tab.name
|
dataForm.deptCode = tab.paneName;
|
||||||
getDataList()
|
getDataList();
|
||||||
}
|
};
|
||||||
|
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
const getDataList = () => {
|
const getDataList = () => {
|
||||||
if (!dataForm.groupId) {
|
if (!dataForm.groupId) {
|
||||||
dataListLoading.value = false
|
dataListLoading.value = false;
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dataList.value = []
|
dataList.value = [];
|
||||||
dataListLoading.value = true
|
dataListLoading.value = true;
|
||||||
if (dataForm.deptCode == '') {
|
if (dataForm.deptCode == '') {
|
||||||
dataForm.deptCode = "11"
|
dataForm.deptCode = '11';
|
||||||
}
|
}
|
||||||
list({ groupId: dataForm.groupId, deptCode: dataForm.deptCode }).then((response: any) => {
|
list({ groupId: dataForm.groupId, deptCode: dataForm.deptCode })
|
||||||
dataList.value = response.data || []
|
.then((response: any) => {
|
||||||
dataList.value.forEach((e: any) => {
|
dataList.value = response.data || [];
|
||||||
if (e.degreeOfEducation && typeof e.degreeOfEducation === 'string') {
|
dataList.value.forEach((e: any) => {
|
||||||
e.degreeOfEducation = e.degreeOfEducation.split(",")
|
if (e.degreeOfEducation && typeof e.degreeOfEducation === 'string') {
|
||||||
}
|
e.degreeOfEducation = e.degreeOfEducation.split(',');
|
||||||
})
|
}
|
||||||
dataListLoading.value = false
|
});
|
||||||
}).catch((error: any) => {
|
dataListLoading.value = false;
|
||||||
message.error('获取数据失败:' + (error.msg || '未知错误'))
|
})
|
||||||
dataListLoading.value = false
|
.catch((error: any) => {
|
||||||
})
|
message.error('获取数据失败:' + (error.msg || '未知错误'));
|
||||||
}
|
dataListLoading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
const deleteHandle = async (id: string) => {
|
const deleteHandle = async (id: string) => {
|
||||||
try {
|
try {
|
||||||
await messageBox.confirm('是否确认删除本条数据?请谨慎操作')
|
await messageBox.confirm('是否确认删除本条数据?请谨慎操作');
|
||||||
await delObj(id)
|
await delObj(id);
|
||||||
message.success('删除成功')
|
message.success('删除成功');
|
||||||
getDataList()
|
getDataList();
|
||||||
} catch {
|
} catch {
|
||||||
// 用户取消
|
// 用户取消
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// 初始化方法
|
// 初始化方法
|
||||||
const init = (row: any) => {
|
const init = (row: any) => {
|
||||||
if (!row) {
|
if (!row) {
|
||||||
message.error('初始化参数错误')
|
message.error('初始化参数错误');
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!row.id || !row.groupName) {
|
if (!row.id || !row.groupName) {
|
||||||
message.error('缺少必要的参数:id 或 groupName')
|
message.error('缺少必要的参数:id 或 groupName');
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
visible.value = true
|
visible.value = true;
|
||||||
dataForm.deptCode = "11"
|
dataForm.deptCode = '11';
|
||||||
dataForm.groupName = row.groupName || ''
|
dataForm.groupName = row.groupName || '';
|
||||||
dataForm.groupId = row.id || ''
|
dataForm.groupId = row.id || '';
|
||||||
initData()
|
initData();
|
||||||
getDepartment()
|
getDepartment();
|
||||||
getDataList()
|
getDataList();
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
message.error('初始化失败:' + (error.message || '未知错误'))
|
message.error('初始化失败:' + (error.message || '未知错误'));
|
||||||
visible.value = false
|
visible.value = false;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// 暴露方法给父组件
|
// 暴露方法给父组件
|
||||||
defineExpose({
|
defineExpose({
|
||||||
init,
|
init,
|
||||||
deleteHandle
|
deleteHandle,
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped></style>
|
||||||
</style>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user