人才培养方案新增下拉框
This commit is contained in:
@@ -94,6 +94,18 @@ export function downloadTrainingProgramTemplate() {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 教学管理机构下拉选项
|
||||
* GET /training/teaching-organizations
|
||||
* 返回:[{ bh, mc }]
|
||||
*/
|
||||
export function listTeachingOrganizations() {
|
||||
return request({
|
||||
url: '/training/teaching-organizations',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入培养方案 Excel(multipart,字段名 file)
|
||||
* POST /training/import
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
<el-descriptions-item label="专业版本">{{ fmtVal(detail.data.zybb) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="主干专业">{{ fmtYesNo(detail.data.zgzy) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="自定义分类">{{ fmtVal(detail.data.zdyfl) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="教学管理机构">{{ fmtVal(detail.data.jxgljgbh) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="教学管理机构">{{ fmtOrg(detail.data.jxgljgbh) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="规范名称">{{ fmtVal(detail.data.gfmc) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业规范">{{ fmtVal(detail.data.zygf) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="简称">{{ fmtVal(detail.data.jc) }}</el-descriptions-item>
|
||||
@@ -356,7 +356,8 @@ import {
|
||||
listTraining,
|
||||
exportTrainingProgram,
|
||||
downloadTrainingProgramTemplate,
|
||||
importTrainingProgram
|
||||
importTrainingProgram,
|
||||
listTeachingOrganizations
|
||||
} from '@/api/teachBusiness/training'
|
||||
import { getDicts } from '@/api/system/dict/data'
|
||||
import { optionselect } from '@/api/system/dict/type'
|
||||
@@ -416,27 +417,31 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 从系统字典加载表单下拉选项;文本业务字段提交标签,机构字段提交编号。
|
||||
* 从系统字典加载表单下拉选项;文本业务字段提交标签。
|
||||
* 教学管理机构来自业务表,提交编号、展示名称。
|
||||
*/
|
||||
async loadTrainingDictionaries() {
|
||||
const emptyResponse = { data: [] }
|
||||
const [typeResponse, levelResponse, dictTypeResponse] = await Promise.all([
|
||||
const [typeResponse, levelResponse, dictTypeResponse, organizationResponse] = await Promise.all([
|
||||
getDicts(TRAINING_TYPE_DICT_CODE).catch(() => emptyResponse),
|
||||
getDicts(TRAINING_LEVEL_DICT_CODE).catch(() => emptyResponse),
|
||||
optionselect().catch(() => emptyResponse)
|
||||
optionselect().catch(() => emptyResponse),
|
||||
listTeachingOrganizations().catch(() => emptyResponse)
|
||||
])
|
||||
this.trainingTypeOptions = typeResponse.data || []
|
||||
this.trainingLevelOptions = levelResponse.data || []
|
||||
this.teachingOrganizationOptions = (organizationResponse.data || []).map(item => ({
|
||||
dictLabel: item.mc,
|
||||
dictValue: item.bh
|
||||
}))
|
||||
|
||||
const dictTypes = dictTypeResponse.data || []
|
||||
const [directionOptions, categoryOptions, organizationOptions] = await Promise.all([
|
||||
const [directionOptions, categoryOptions] = await Promise.all([
|
||||
this.loadNamedDictionary(dictTypes, '专业方向'),
|
||||
this.loadNamedDictionary(dictTypes, '学员类别'),
|
||||
this.loadNamedDictionary(dictTypes, '教学管理机构')
|
||||
this.loadNamedDictionary(dictTypes, '学员类别')
|
||||
])
|
||||
this.majorDirectionOptions = directionOptions
|
||||
this.studentCategoryOptions = categoryOptions
|
||||
this.teachingOrganizationOptions = organizationOptions
|
||||
this.mergeExistingSelectOptions()
|
||||
},
|
||||
async loadNamedDictionary(dictTypes, dictName) {
|
||||
@@ -673,6 +678,13 @@ export default {
|
||||
},
|
||||
fmtVal(val) {
|
||||
return val === '' || val === null || val === undefined ? '-' : val
|
||||
},
|
||||
fmtOrg(bh) {
|
||||
if (bh === '' || bh === null || bh === undefined) {
|
||||
return '-'
|
||||
}
|
||||
const matched = this.teachingOrganizationOptions.find(item => String(item.dictValue) === String(bh))
|
||||
return matched ? matched.dictLabel : bh
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user