a
This commit is contained in:
@@ -2,12 +2,16 @@
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
v-model="visible">
|
||||
v-model="visible"
|
||||
width="600px"
|
||||
destroy-on-close
|
||||
|
||||
>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataFormRef" @keyup.enter="dataFormSubmit"
|
||||
label-width="140px">
|
||||
label-width="120px">
|
||||
|
||||
<el-form-item label="招生计划" prop="groupId">
|
||||
<el-select v-model="dataForm.groupId" filterable placeholder="请选择招生计划" size="small" style="width: 100%">
|
||||
<el-select v-model="dataForm.groupId" filterable placeholder="请选择招生计划">
|
||||
<el-option
|
||||
v-for="item in planList"
|
||||
:key="item.id"
|
||||
@@ -26,7 +30,7 @@
|
||||
<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-select v-model="dataForm.deptCode" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:key="item.deptCode"
|
||||
@@ -36,7 +40,7 @@
|
||||
</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-select v-model="dataForm.xz" filterable placeholder="请选择学制">
|
||||
<el-option
|
||||
v-for="item in majorYears"
|
||||
:key="item.value"
|
||||
@@ -46,7 +50,7 @@
|
||||
</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-select v-model="dataForm.cc" filterable placeholder="请选择层次">
|
||||
<el-option
|
||||
v-for="item in ccList"
|
||||
:key="item.label"
|
||||
@@ -57,24 +61,21 @@
|
||||
</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 v-for="item in yes_no_type" :key="item.value" :label="item.value">{{ item.label }}</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 v-for="item in yes_no_type" :key="item.value" :label="item.value">{{ item.label }}</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 v-for="item in yes_no_type" :key="item.value" :label="item.value">{{ item.label }}</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-select v-model="dataForm.offcialZydm" filterable placeholder="请选择正式专业代码">
|
||||
<el-option
|
||||
v-for="item in offcialZydmList"
|
||||
:key="item.majorCode"
|
||||
@@ -85,7 +86,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="市平台代码" prop="cityPlanId">
|
||||
<el-select v-model="dataForm.cityPlanId" filterable placeholder="请选择市平台代码" size="small" style="width: 100%;">
|
||||
<el-select v-model="dataForm.cityPlanId" filterable placeholder="请选择市平台代码">
|
||||
<el-option
|
||||
v-for="item in cityPlanIdList"
|
||||
:key="item.id"
|
||||
@@ -118,17 +119,21 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, nextTick } from 'vue'
|
||||
import { ElNotification } from 'element-plus'
|
||||
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"
|
||||
import { addObj, getObj, putObj, getCityPlan } from '/@/api/recruit/recruitplanmajor'
|
||||
import { getDeptList } from '/@/api/basic/basicclass'
|
||||
import { list } from '/@/api/recruit/recruitstudentplangroup'
|
||||
import { getMajorNameList } from '/@/api/basic/major'
|
||||
import { getDicts } from '/@/api/admin/dict'
|
||||
import { useDict } from '/@/hooks/dict'
|
||||
|
||||
// Emits
|
||||
const emit = defineEmits<{
|
||||
(e: 'refreshDataList'): void
|
||||
}>()
|
||||
|
||||
// 字典数据
|
||||
const { yes_no_type } = useDict('yes_no_type')
|
||||
|
||||
// 表单引用
|
||||
const dataFormRef = ref()
|
||||
|
||||
@@ -138,7 +143,6 @@ const canSubmit = ref(false)
|
||||
const cityPlanIdList = ref<any[]>([])
|
||||
const offcialZydmList = ref<any[]>([])
|
||||
const planList = ref<any[]>([])
|
||||
const yesNoList = ref<any[]>([])
|
||||
const deptList = ref<any[]>([])
|
||||
const ccList = ref<any[]>([])
|
||||
const majorYears = ref<any[]>([])
|
||||
@@ -233,14 +237,11 @@ const initData = () => {
|
||||
offcialZydmList.value = data.data
|
||||
})
|
||||
// 获取数据字典
|
||||
getDictByType("yes_no").then((res: any) => {
|
||||
yesNoList.value = res.data
|
||||
getDicts('basic_major_years').then((res: any) => {
|
||||
majorYears.value = res.data || []
|
||||
})
|
||||
getDictByType("basic_major_years").then((res: any) => {
|
||||
majorYears.value = res.data
|
||||
})
|
||||
getDictByType("basic_major_level").then((res: any) => {
|
||||
ccList.value = res.data
|
||||
getDicts('basic_major_level').then((res: any) => {
|
||||
ccList.value = res.data || []
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<!-- 搜索表单 -->
|
||||
<el-form :model="queryForm" inline class="mb-4" ref="searchFormRef">
|
||||
<el-form :model="queryForm" inline ref="searchFormRef">
|
||||
<el-form-item label="招生计划" prop="groupId">
|
||||
<el-select v-model="queryForm.groupId" filterable clearable placeholder="请选择招生计划">
|
||||
<el-option
|
||||
@@ -51,7 +51,7 @@
|
||||
</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-button plain icon="Refresh" class="ml10" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
icon="FolderAdd"
|
||||
@click="addOrUpdateHandle"
|
||||
>
|
||||
新增
|
||||
新 增
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
@@ -78,32 +78,32 @@
|
||||
: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>
|
||||
<el-table-column prop="groupId" label="招生计划名称" align="center" min-width="140" 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="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="xz" label="学制" align="center" width="80" 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>
|
||||
<el-table-column prop="isOrder" label="订单班" align="center" width="80" 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>
|
||||
<el-table-column prop="isZd" label="中德班" align="center" width="80" 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>
|
||||
<el-table-column prop="isUnion" label="联院班" align="center" width="80" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ getYesNoLabel(scope.row.isUnion) }}
|
||||
</template>
|
||||
@@ -125,12 +125,12 @@
|
||||
{{ getMajorCodeName(scope.row.offcialZydm) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cityPlanId" label="市平台招生计划" align="center" show-overflow-tooltip>
|
||||
<!-- <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> -->
|
||||
<!-- <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
|
||||
@@ -163,7 +163,7 @@
|
||||
/>
|
||||
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<table-form v-if="addOrUpdateVisible" ref="addOrUpdateRef" @refreshDataList="getDataList" />
|
||||
<table-form ref="addOrUpdateRef" @refreshDataList="getDataList" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -174,12 +174,11 @@ import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message'
|
||||
import { useDict } from '/@/hooks/dict'
|
||||
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'))
|
||||
|
||||
@@ -205,8 +204,8 @@ const tableRef = ref()
|
||||
const searchFormRef = ref()
|
||||
const addOrUpdateRef = ref()
|
||||
|
||||
// 弹窗状态
|
||||
const addOrUpdateVisible = ref(false)
|
||||
// 字典数据
|
||||
const { yes_no_type } = useDict('yes_no_type')
|
||||
|
||||
// 数据
|
||||
const planList = ref<any[]>([])
|
||||
@@ -236,7 +235,8 @@ const getDeptName = (deptCode: string) => {
|
||||
|
||||
// 获取是/否标签
|
||||
const getYesNoLabel = (value: string) => {
|
||||
return global.getLabelValue(global.YES_OR_NO, value)
|
||||
const item = yes_no_type.value.find((item: any) => item.value === value)
|
||||
return item ? item.label : ''
|
||||
}
|
||||
|
||||
// 获取专业代码名称
|
||||
@@ -299,9 +299,8 @@ const changeSm = async (row: any) => {
|
||||
|
||||
// 新增 / 修改
|
||||
const addOrUpdateHandle = (id?: string) => {
|
||||
addOrUpdateVisible.value = true
|
||||
nextTick(() => {
|
||||
addOrUpdateRef.value?.init(id)
|
||||
addOrUpdateRef.value?.init(id || null)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
:key="item.deptCode"
|
||||
:label="item.deptName"
|
||||
:name="item.deptCode">
|
||||
<div class="avue-crud">
|
||||
<div style="margin-top: 20px;">
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
@@ -111,10 +111,10 @@
|
||||
import { ref, reactive } from 'vue'
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message'
|
||||
import { ElNotification } from 'element-plus'
|
||||
import { list, delObj } from '@/api/recruit/recruitplanmajor'
|
||||
import { putObj } from '@/api/recruit/recruitstudentplan'
|
||||
import { fetchSecondTree } from "@/api/basic/basicdept"
|
||||
import { getDictByType } from "@/api/contract/contract"
|
||||
import { list, delObj } from '/@/api/recruit/recruitplanmajor'
|
||||
import { putObj } from '/@/api/recruit/recruitstudentplan'
|
||||
import { fetchSecondTree } from '/@/api/basic/basicdept'
|
||||
import { getDicts } from "/@/api/admin/dict"
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
@@ -141,42 +141,54 @@ const dataForm = reactive({
|
||||
const initData = () => {
|
||||
degreeOfEducationList.value = []
|
||||
// 获取数据字典
|
||||
getDictByType("finance_student_source").then((res: any) => {
|
||||
degreeOfEducationList.value = res.data
|
||||
getDicts("finance_student_source").then((res: any) => {
|
||||
degreeOfEducationList.value = res.data || []
|
||||
}).catch((error: any) => {
|
||||
message.error('获取字典数据失败:' + (error.msg || '未知错误'))
|
||||
degreeOfEducationList.value = []
|
||||
})
|
||||
}
|
||||
|
||||
// 获取部门列表
|
||||
const getDepartment = () => {
|
||||
fetchSecondTree().then((res: any) => {
|
||||
deptList.value = res.data
|
||||
deptList.value = res.data || []
|
||||
}).catch((error: any) => {
|
||||
message.error('获取部门列表失败:' + (error.msg || '未知错误'))
|
||||
deptList.value = []
|
||||
})
|
||||
}
|
||||
|
||||
// 更新专业
|
||||
const updateMajor = (row: any) => {
|
||||
if (row.degreeOfEducation && row.degreeOfEducation.length != 0) {
|
||||
if (!row || !row.planId) {
|
||||
message.error('缺少必要的参数:planId')
|
||||
return
|
||||
}
|
||||
|
||||
if (row.degreeOfEducation && Array.isArray(row.degreeOfEducation) && 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
|
||||
planStudentNum: row.planStudentNum || 0,
|
||||
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(() => {
|
||||
// 错误处理
|
||||
}).catch((error: any) => {
|
||||
message.error('修改失败:' + (error.msg || '未知错误'))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -188,20 +200,26 @@ const handleChange = (tab: any) => {
|
||||
|
||||
// 获取数据列表
|
||||
const getDataList = () => {
|
||||
if (!dataForm.groupId) {
|
||||
dataListLoading.value = false
|
||||
return
|
||||
}
|
||||
|
||||
dataList.value = []
|
||||
dataListLoading.value = true
|
||||
if (dataForm.deptCode == '') {
|
||||
dataForm.deptCode = "11"
|
||||
}
|
||||
list({ groupId: dataForm.groupId, deptCode: dataForm.deptCode }).then((response: any) => {
|
||||
dataList.value = response.data
|
||||
dataList.value.forEach(e => {
|
||||
if (e.degreeOfEducation) {
|
||||
dataList.value = response.data || []
|
||||
dataList.value.forEach((e: any) => {
|
||||
if (e.degreeOfEducation && typeof e.degreeOfEducation === 'string') {
|
||||
e.degreeOfEducation = e.degreeOfEducation.split(",")
|
||||
}
|
||||
})
|
||||
dataListLoading.value = false
|
||||
}).catch(() => {
|
||||
}).catch((error: any) => {
|
||||
message.error('获取数据失败:' + (error.msg || '未知错误'))
|
||||
dataListLoading.value = false
|
||||
})
|
||||
}
|
||||
@@ -220,13 +238,28 @@ const deleteHandle = async (id: string) => {
|
||||
|
||||
// 初始化方法
|
||||
const init = (row: any) => {
|
||||
visible.value = true
|
||||
dataForm.deptCode = "11"
|
||||
dataForm.groupName = row.groupName
|
||||
dataForm.groupId = row.id
|
||||
initData()
|
||||
getDepartment()
|
||||
getDataList()
|
||||
if (!row) {
|
||||
message.error('初始化参数错误')
|
||||
return
|
||||
}
|
||||
|
||||
if (!row.id || !row.groupName) {
|
||||
message.error('缺少必要的参数:id 或 groupName')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
visible.value = true
|
||||
dataForm.deptCode = "11"
|
||||
dataForm.groupName = row.groupName || ''
|
||||
dataForm.groupId = row.id || ''
|
||||
initData()
|
||||
getDepartment()
|
||||
getDataList()
|
||||
} catch (error: any) {
|
||||
message.error('初始化失败:' + (error.message || '未知错误'))
|
||||
visible.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 暴露方法给父组件
|
||||
@@ -237,7 +270,4 @@ defineExpose({
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.avue-crud {
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user