新增专业信息的时候设置下拉选项
This commit is contained in:
@@ -296,7 +296,21 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="人培编号">
|
<el-form-item label="人培编号">
|
||||||
<el-input v-model="form.rpbh" placeholder="请输入人培编号" />
|
<el-select
|
||||||
|
v-model="form.rpbh"
|
||||||
|
:loading="trainingOptionsLoading"
|
||||||
|
placeholder="请选择人培编号"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
class="w-full"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in trainingOptions"
|
||||||
|
:key="item.rpbh"
|
||||||
|
:label="item.zymc ? `${item.zymc}(${item.rpbh})` : item.rpbh"
|
||||||
|
:value="item.rpbh"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -450,6 +464,7 @@ import {
|
|||||||
importMajor
|
importMajor
|
||||||
} from "@/api/subjectMajor/major"
|
} from "@/api/subjectMajor/major"
|
||||||
import { listDiscipline } from '@/api/subjectMajor/discipline'
|
import { listDiscipline } from '@/api/subjectMajor/discipline'
|
||||||
|
import { listTraining } from '@/api/teachBusiness/training'
|
||||||
import { getDicts } from '@/api/system/dict/data'
|
import { getDicts } from '@/api/system/dict/data'
|
||||||
import { optionselect } from '@/api/system/dict/type'
|
import { optionselect } from '@/api/system/dict/type'
|
||||||
|
|
||||||
@@ -496,6 +511,8 @@ export default {
|
|||||||
systemModeOptions: [],
|
systemModeOptions: [],
|
||||||
disciplineOptions: [],
|
disciplineOptions: [],
|
||||||
disciplineOptionsLoading: false,
|
disciplineOptionsLoading: false,
|
||||||
|
trainingOptions: [],
|
||||||
|
trainingOptionsLoading: false,
|
||||||
formRules: {
|
formRules: {
|
||||||
zydh: [{ required: true, message: "专业代号不能为空", trigger: "blur" }],
|
zydh: [{ required: true, message: "专业代号不能为空", trigger: "blur" }],
|
||||||
zymc: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
|
zymc: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
|
||||||
@@ -537,6 +554,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.loadMajorDictionaries()
|
this.loadMajorDictionaries()
|
||||||
this.loadDisciplineOptions()
|
this.loadDisciplineOptions()
|
||||||
|
this.loadTrainingOptions()
|
||||||
this.fetchList()
|
this.fetchList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -592,9 +610,23 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** 加载人才培养方案列表,作为人培编号下拉选项(过滤停用)。 */
|
||||||
|
async loadTrainingOptions() {
|
||||||
|
this.trainingOptionsLoading = true
|
||||||
|
try {
|
||||||
|
const response = await listTraining({ pageNum: 1, pageSize: 500 })
|
||||||
|
const records = (response.data && response.data.records) || []
|
||||||
|
this.trainingOptions = records.filter(item => !item.ty)
|
||||||
|
} catch (error) {
|
||||||
|
this.trainingOptions = []
|
||||||
|
} finally {
|
||||||
|
this.trainingOptionsLoading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
formatDisciplineLabel(item) {
|
formatDisciplineLabel(item) {
|
||||||
const name = item.zymc || item.gfmc || item.zydm || item.bsh
|
const name = item.zymc || item.gfmc || item.zydm || item.bsh
|
||||||
const identifiers = [item.zydm, item.bsh].filter(Boolean).join(' / ')
|
const identifiers = [item.zydm].filter(Boolean).join(' / ')
|
||||||
|
|
||||||
return identifiers && identifiers !== name ? `${name}(${identifiers})` : name
|
return identifiers && identifiers !== name ? `${name}(${identifiers})` : name
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user