zhaosheng
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
v-model="visible"
|
||||
width="600px"
|
||||
width="800px"
|
||||
>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataFormRef" @keyup.enter="dataFormSubmit"
|
||||
label-width="100px">
|
||||
@@ -54,21 +54,31 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="中德班" prop="isZd">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="中德班" prop="isZd">
|
||||
<el-radio-group v-model="dataForm.isZd">
|
||||
<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-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="订单班" prop="isOrder">
|
||||
<el-radio-group v-model="dataForm.isOrder">
|
||||
<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-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联院班" prop="isUnion">
|
||||
<el-radio-group v-model="dataForm.isUnion">
|
||||
<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-col>
|
||||
</el-row>
|
||||
<el-form-item label="正式专业代码" prop="stuworkMajorCode">
|
||||
<el-select v-model="dataForm.stuworkMajorCode" filterable placeholder="请选择正式专业代码">
|
||||
<el-option
|
||||
@@ -79,19 +89,47 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="市平台代码" prop="cityPlanId">-->
|
||||
<!-- <el-select v-model="dataForm.cityPlanId" filterable placeholder="请选择市平台代码">-->
|
||||
<!-- <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-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="初中费用" prop="czFee">
|
||||
<el-input-number
|
||||
v-model="dataForm.czFee"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
:max="999999"
|
||||
:precision="2"
|
||||
placeholder="请输入初中费用"
|
||||
>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="高中费用" prop="gzFee">
|
||||
<el-input-number
|
||||
v-model="dataForm.gzFee"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
:max="999999"
|
||||
:precision="2"
|
||||
placeholder="请输入高中费用"
|
||||
>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="技职校费用" prop="jzxFee">
|
||||
<el-input-number
|
||||
v-model="dataForm.jzxFee"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
:max="999999"
|
||||
:precision="2"
|
||||
placeholder="请输入技职校费用" >
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number :min="0" :max="999" v-model="dataForm.sort" placeholder="排序"></el-input-number>
|
||||
</el-form-item>
|
||||
@@ -139,6 +177,7 @@ const planList = ref<any[]>([])
|
||||
const deptList = ref<any[]>([])
|
||||
const ccList = ref<any[]>([])
|
||||
const majorYears = ref<any[]>([])
|
||||
const tuitionFeeList = ref<any[]>([])
|
||||
|
||||
const dataForm = reactive({
|
||||
id: "",
|
||||
@@ -154,6 +193,9 @@ const dataForm = reactive({
|
||||
stuworkMajorCode: "",
|
||||
isUnion: "0",
|
||||
tuitionFee: 0,
|
||||
czFee: 0,
|
||||
gzFee: 0,
|
||||
jzxFee: 0,
|
||||
sort: 0
|
||||
})
|
||||
|
||||
@@ -190,6 +232,18 @@ const dataRule = {
|
||||
isUnion: [
|
||||
{ required: true, message: '联院班不能为空', trigger: 'blur' }
|
||||
],
|
||||
czFee: [
|
||||
{ required: true, message: '初中费用不能为空', trigger: 'blur' },
|
||||
{ type: 'number', min: 0, message: '初中费用不能小于0', trigger: 'blur' }
|
||||
],
|
||||
gzFee: [
|
||||
{ required: true, message: '高中费用不能为空', trigger: 'blur' },
|
||||
{ type: 'number', min: 0, message: '高中费用不能小于0', trigger: 'blur' }
|
||||
],
|
||||
jzxFee: [
|
||||
{ required: true, message: '技职校费用不能为空', trigger: 'blur' },
|
||||
{ type: 'number', min: 0, message: '技职校费用不能小于0', trigger: 'blur' }
|
||||
],
|
||||
remarks: [
|
||||
{ min: 1, max: 100, message: '备注长度不大于100个字符', trigger: 'blur' }
|
||||
],
|
||||
@@ -205,6 +259,27 @@ const isCityDisable = (id: string) => {
|
||||
return dataForm.cityPlanIds.some(e => e == id)
|
||||
}
|
||||
|
||||
// 设置费用默认值
|
||||
const setFeeDefaults = () => {
|
||||
if (tuitionFeeList.value.length > 0) {
|
||||
// 初中费用:字典值 1
|
||||
const czFeeItem = tuitionFeeList.value.find((item: any) => item.value === '1')
|
||||
if (czFeeItem) {
|
||||
dataForm.czFee = Number(czFeeItem.label) || 0
|
||||
}
|
||||
// 高中费用:字典值 2
|
||||
const gzFeeItem = tuitionFeeList.value.find((item: any) => item.value === '2')
|
||||
if (gzFeeItem) {
|
||||
dataForm.gzFee = Number(gzFeeItem.label) || 0
|
||||
}
|
||||
// 技职校费用:字典值 3
|
||||
const jzxFeeItem = tuitionFeeList.value.find((item: any) => item.value === '3')
|
||||
if (jzxFeeItem) {
|
||||
dataForm.jzxFee = Number(jzxFeeItem.label) || 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化数据
|
||||
const initData = () => {
|
||||
// 查询二级学院信息
|
||||
@@ -218,9 +293,10 @@ const initData = () => {
|
||||
offcialZydmList.value = data.data
|
||||
})
|
||||
// 获取数据字典(一次获取多个)
|
||||
getDictsByTypes(['basic_major_years', 'basic_major_level']).then((res: any) => {
|
||||
getDictsByTypes(['basic_major_years', 'basic_major_level', 'tuition_fee']).then((res: any) => {
|
||||
majorYears.value = res.data?.basic_major_years || []
|
||||
ccList.value = res.data?.basic_major_level || []
|
||||
tuitionFeeList.value = res.data?.tuition_fee || []
|
||||
})
|
||||
}
|
||||
|
||||
@@ -292,12 +368,17 @@ const init = (id: string | null) => {
|
||||
// 错误处理
|
||||
})
|
||||
} else {
|
||||
// 新增模式:设置默认招生计划
|
||||
// 新增模式:设置默认招生计划和费用默认值
|
||||
getList().then((data: any) => {
|
||||
if (data.data && data.data.length > 0) {
|
||||
dataForm.groupId = data.data[0]?.id || ""
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
// 等待字典数据加载完成后设置费用默认值
|
||||
getDictsByTypes(['tuition_fee']).then((res: any) => {
|
||||
tuitionFeeList.value = res.data?.tuition_fee || []
|
||||
setFeeDefaults()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,8 +388,11 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
.el-row {
|
||||
margin-bottom: 18px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -258,7 +258,8 @@ const init = async () => {
|
||||
|
||||
getDataList()
|
||||
} catch (error) {
|
||||
message.error('初始化失败')
|
||||
console.log(error)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,7 +270,8 @@ const changeSm = async (row: any) => {
|
||||
await editQuickField(parmas)
|
||||
message.success('修改成功')
|
||||
} catch (error: any) {
|
||||
message.error(error.msg || '修改失败')
|
||||
console.log(error)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user