| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="培训讲师:" prop="trainingLecturerId"> |
| | | <el-select v-model="trainingPlan.trainingLecturerId" |
| | | clearable filterable |
| | | placeholder="请选择" size="small" style="width: 100%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | <div style="display: flex; align-items: center; gap: 8px; width: 100%;"> |
| | | <el-radio-group v-model="lecturerType" size="small" @change="handleLecturerTypeChange"> |
| | | <el-radio-button label="internal">内部人员</el-radio-button> |
| | | <el-radio-button label="external">外聘讲师</el-radio-button> |
| | | </el-radio-group> |
| | | <el-select v-if="lecturerType === 'internal'" v-model="trainingPlan.trainingLecturerId" |
| | | clearable filterable |
| | | placeholder="请选择" size="small" style="flex: 1;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input v-else v-model="trainingPlan.trainingLecturerName" clearable |
| | | placeholder="请输入外聘讲师姓名" size="small" style="flex: 1;"></el-input> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | return { |
| | | addTrainingPlanDia: false, |
| | | submitAddLoading: false, |
| | | lecturerType: 'internal', |
| | | trainingPlan: { |
| | | planId: '', |
| | | id: '', |
| | |
| | | participants: '', |
| | | trainingContent: '', |
| | | trainingLecturerId: '', |
| | | trainingLecturerName: '', |
| | | trainingMode: '', |
| | | holdingDepartment: '', |
| | | remarks: '', |
| | |
| | | trainingPlanRules: { |
| | | trainingDate: [{ required: true, message: '请选择培训日期', trigger: 'change' }], |
| | | trainingContent: [{ required: true, message: '请输入培训内容', trigger: 'blur' }], |
| | | trainingLecturerId: [{ required: true, message: '请选择培训讲师', trigger: 'blur' }], |
| | | }, |
| | | responsibleOptions: [], |
| | | operationType: '' |
| | |
| | | this.operationType = type |
| | | if (this.operationType === 'edit') { |
| | | this.trainingPlan = this.HaveJson(row) |
| | | this.lecturerType = row.trainingLecturerId ? 'internal' : (row.trainingLecturerName ? 'external' : 'internal') |
| | | } else { |
| | | this.lecturerType = 'internal' |
| | | this.trainingPlan = { |
| | | id: '', |
| | | trainingDate: '', |
| | |
| | | this.trainingPlan.planId = id |
| | | this.getUserList() |
| | | }, |
| | | handleLecturerTypeChange(type) { |
| | | if (type === 'internal') { |
| | | this.trainingPlan.trainingLecturerName = '' |
| | | } else { |
| | | this.trainingPlan.trainingLecturerId = null |
| | | } |
| | | }, |
| | | // 提交新增 |
| | | submitAdd() { |
| | | this.$refs.trainingPlanForm.validate((valid) => { |
| | | if (valid) { |
| | | if (this.lecturerType === 'internal' && !this.trainingPlan.trainingLecturerId) { |
| | | this.$message.warning('请选择培训讲师') |
| | | return |
| | | } |
| | | if (this.lecturerType === 'external') { |
| | | const lecturerName = (this.trainingPlan.trainingLecturerName || '').trim() |
| | | if (!lecturerName) { |
| | | this.$message.warning('请输入外聘讲师姓名') |
| | | return |
| | | } |
| | | this.trainingPlan.trainingLecturerId = null |
| | | this.trainingPlan.trainingLecturerName = lecturerName |
| | | } else { |
| | | this.trainingPlan.trainingLecturerName = null |
| | | } |
| | | this.submitAddLoading = true |
| | | this.trainingPlan.planId = this.currentChangeRow.id |
| | | const personTrainingDetailed = this.trainingPlan |