forked from liweijie/education
Compare commits
3 Commits
7fa8041bf7
...
0d3c89a0c4
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d3c89a0c4 | |||
| 2adb096ebe | |||
| d7d138b8ef |
@@ -16,12 +16,38 @@
|
||||
</el-col>
|
||||
<el-col :xs="24" :md="8">
|
||||
<el-form-item label="培训类型">
|
||||
<el-input v-model="searchForm.pxlx" placeholder="请输入培训类型" clearable />
|
||||
<el-select
|
||||
v-model="searchForm.pxlx"
|
||||
placeholder="请选择培训类型"
|
||||
clearable
|
||||
filterable
|
||||
class="w-full"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in trainingTypeOptions"
|
||||
:key="item.dictCode || item.dictValue"
|
||||
:label="item.dictLabel"
|
||||
:value="item.dictLabel"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :md="8">
|
||||
<el-form-item label="培训层次">
|
||||
<el-input v-model="searchForm.pxcc" placeholder="请输入培训层次" clearable />
|
||||
<el-select
|
||||
v-model="searchForm.pxcc"
|
||||
placeholder="请选择培训层次"
|
||||
clearable
|
||||
filterable
|
||||
class="w-full"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in trainingLevelOptions"
|
||||
:key="item.dictCode || item.dictValue"
|
||||
:label="item.dictLabel"
|
||||
:value="item.dictLabel"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :md="8">
|
||||
@@ -142,12 +168,36 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="培训层次" prop="pxcc">
|
||||
<el-input v-model="dialog.form.pxcc" placeholder="请输入培训层次" />
|
||||
<el-select
|
||||
v-model="dialog.form.pxcc"
|
||||
placeholder="请选择培训层次"
|
||||
filterable
|
||||
class="training-dict-select"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in trainingLevelOptions"
|
||||
:key="item.dictCode || item.dictValue"
|
||||
:label="item.dictLabel"
|
||||
:value="item.dictLabel"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="培训类型" prop="pxlx">
|
||||
<el-input v-model="dialog.form.pxlx" placeholder="请输入培训类型" />
|
||||
<el-select
|
||||
v-model="dialog.form.pxlx"
|
||||
placeholder="请选择培训类型"
|
||||
filterable
|
||||
class="training-dict-select"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in trainingTypeOptions"
|
||||
:key="item.dictCode || item.dictValue"
|
||||
:label="item.dictLabel"
|
||||
:value="item.dictLabel"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -275,6 +325,10 @@ import {
|
||||
getTraining,
|
||||
listTraining
|
||||
} from '@/api/teachBusiness/training'
|
||||
import { getDicts } from '@/api/system/dict/data'
|
||||
|
||||
const TRAINING_TYPE_DICT_CODE = 'train_type'
|
||||
const TRAINING_LEVEL_DICT_CODE = 'train_level'
|
||||
|
||||
export default {
|
||||
name: 'TrainingPlan',
|
||||
@@ -288,6 +342,8 @@ export default {
|
||||
pxlx: '',
|
||||
pxcc: ''
|
||||
},
|
||||
trainingTypeOptions: [],
|
||||
trainingLevelOptions: [],
|
||||
// 列表
|
||||
tableData: [],
|
||||
total: 0,
|
||||
@@ -314,15 +370,32 @@ export default {
|
||||
zydh: [{ required: true, message: '请输入专业代号', trigger: 'blur' }],
|
||||
zymc: [{ required: true, message: '请输入专业名称', trigger: 'blur' }],
|
||||
zydm: [{ required: true, message: '请输入专业代码', trigger: 'blur' }],
|
||||
pxcc: [{ required: true, message: '请输入培训层次', trigger: 'blur' }],
|
||||
pxlx: [{ required: true, message: '请输入培训类型', trigger: 'blur' }]
|
||||
pxcc: [{ required: true, message: '请选择培训层次', trigger: 'change' }],
|
||||
pxlx: [{ required: true, message: '请选择培训类型', trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadTrainingDictionaries()
|
||||
this.fetchList()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 从系统字典加载培训类型和培训层次,提交标签以匹配现有业务数据。
|
||||
*/
|
||||
loadTrainingDictionaries() {
|
||||
return Promise.all([
|
||||
getDicts(TRAINING_TYPE_DICT_CODE),
|
||||
getDicts(TRAINING_LEVEL_DICT_CODE)
|
||||
]).then(([typeResponse, levelResponse]) => {
|
||||
this.trainingTypeOptions = typeResponse.data || []
|
||||
this.trainingLevelOptions = levelResponse.data || []
|
||||
}).catch(() => {
|
||||
this.trainingTypeOptions = []
|
||||
this.trainingLevelOptions = []
|
||||
})
|
||||
},
|
||||
|
||||
/* ---------- 列表加载 ---------- */
|
||||
fetchList() {
|
||||
this.loading = true
|
||||
@@ -596,4 +669,8 @@ export default {
|
||||
color: #f78989;
|
||||
}
|
||||
}
|
||||
|
||||
.training-dict-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -100,11 +100,6 @@
|
||||
:close-on-click-modal="false">
|
||||
<el-form ref="classroomForm" :model="dialog.form" :rules="rules" label-width="110px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="教室编号" prop="jsbh">
|
||||
<el-input v-model="dialog.form.jsbh" placeholder="请输入教室编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="教室名称" prop="jsmc">
|
||||
<el-input v-model="dialog.form.jsmc" placeholder="请输入教室名称" />
|
||||
@@ -135,7 +130,15 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="面积">
|
||||
<el-input-number v-model="dialog.form.mj" :min="0" :precision="1" controls-position="right" class="w-full" />
|
||||
<div class="number-unit-field">
|
||||
<el-input-number
|
||||
v-model="dialog.form.mj"
|
||||
:min="0"
|
||||
:precision="1"
|
||||
controls-position="right"
|
||||
/>
|
||||
<span class="number-unit">㎡</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -148,11 +151,6 @@
|
||||
<el-input-number v-model="dialog.form.ewyxkbs" :min="0" controls-position="right" class="w-full" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="序号">
|
||||
<el-input v-model="dialog.form.xh" placeholder="请输入序号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="拼音">
|
||||
<el-input v-model="dialog.form.py" placeholder="请输入拼音" />
|
||||
@@ -227,7 +225,6 @@ export default {
|
||||
form: this.createEmptyForm()
|
||||
},
|
||||
rules: {
|
||||
jsbh: [{ required: true, message: '请输入教室编号', trigger: 'blur' }],
|
||||
jsmc: [{ required: true, message: '请输入教室名称', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
@@ -324,7 +321,7 @@ export default {
|
||||
|
||||
/* ---------- 新增 / 编辑 ---------- */
|
||||
handleAdd() {
|
||||
this.dialog.title = '新增教室'
|
||||
this.dialog.title = '新增教学场地'
|
||||
this.dialog.form = this.createEmptyForm()
|
||||
this.dialog.visible = true
|
||||
this.$nextTick(() => {
|
||||
@@ -332,7 +329,7 @@ export default {
|
||||
})
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.dialog.title = '编辑教室'
|
||||
this.dialog.title = '编辑教学场地'
|
||||
this.dialog.form = Object.assign({}, this.createEmptyForm(), row)
|
||||
this.dialog.visible = true
|
||||
this.$nextTick(() => {
|
||||
@@ -455,6 +452,28 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.number-unit-field {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
|
||||
.el-input-number {
|
||||
flex: 1;
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.number-unit {
|
||||
display: inline-flex;
|
||||
flex: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 36px;
|
||||
color: #606266;
|
||||
}
|
||||
}
|
||||
|
||||
.danger-text-btn {
|
||||
color: #f56c6c;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user