Commit a424c7ee authored by FangYuePeng's avatar FangYuePeng

个人开课和单位开课新增操作

parent 664c861c
...@@ -108,3 +108,13 @@ export function importExcel(data) { ...@@ -108,3 +108,13 @@ export function importExcel(data) {
data data
}) })
} }
// 根据查询参数分页查询可开课的课程
export function queryBLessonWithTrial(query) {
return request({
url: '/blesson/queryBLessonWithTrial',
method: 'get',
params: query
})
}
...@@ -105,6 +105,17 @@ ...@@ -105,6 +105,17 @@
@click="handleAdd" @click="handleAdd"
>{{ commonField.addName }}</el-button> >{{ commonField.addName }}</el-button>
</el-form-item> </el-form-item>
<el-form-item>
<!-- //新增按钮-->
<el-button
v-hasPermi="hasAddPerm"
:class="commonField.addClass"
:type="commonField.typePrimary"
:icon="commonField.addIcon"
:size="commonField.smallSize"
@click="handleAdd1"
> 测试 </el-button>
</el-form-item>
<!-- //导入按钮--> <!-- //导入按钮-->
<el-button <el-button
...@@ -267,6 +278,248 @@ ...@@ -267,6 +278,248 @@
:limit.sync="queryParams.rows" :limit.sync="queryParams.rows"
@pagination="getList" @pagination="getList"
/> />
<el-dialog :title="title" :visible.sync="open1" width="1300px" :close-on-click-modal="false" append-to-body @close="handleClose">
<el-form ref="lessonRef" :model="form" :rules="rules" size="small" label-width="auto">
<div style="display: flex;justify-content: space-between;align-items: center">
<div>
<el-form-item
label="开课单位"
prop="applicantUnit"
>
<el-select
v-model="queryLessonParams.applicantUnit"
filterable
style="width: 400px"
>
<el-option
v-for="(items,index) in unitOptions"
:key="index"
:label="items.unitName"
:value="items.businessId"
/>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item
label="课程类型"
prop="lessonType"
>
<el-select
v-model="queryLessonParams.lessonType"
filterable
style="width: 400px"
@change="handleLessonTypeChange"
>
<el-option
v-for="item in lessonTypeOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
</div>
</div>
<div style="display: flex;justify-content: space-between;align-items: center">
<div>
<el-form-item
label="课程方案"
prop="classPlan"
>
<el-select
v-model="queryLessonParams.classPlan"
filterable
style="width: 400px"
>
<el-option
v-for="item in coursePlanOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="难度等级" prop="difficultyClassify">
<el-select v-model="queryLessonParams.difficultyClassify" placeholder="难度等级" clearable style="width: 400px">
<el-option
v-for="item in difficultyOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
</div>
</div>
<el-divider />
<div style="display: flex;justify-content: space-between;align-items: center">
<div>
<el-form-item
label="开始时间"
prop="createTime"
>
<span>
<el-date-picker
v-model="addLessonForm.beginDate"
style="width: 400px"
type="date"
placeholder="-"
:editable="false"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
/>
</span>
</el-form-item>
</div>
<div>
<el-form-item
label="结束时间"
prop="endTime"
>
<span>
<el-date-picker
v-model="addLessonForm.endDate"
style="width: 400px"
type="date"
placeholder="-"
:editable="false"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
/>
</span>
</el-form-item>
</div>
</div>
<div style="display: flex;justify-content: space-between;align-items: center">
<div>
<el-form-item
label="开课类型"
prop="isPay"
>
<el-select
v-model="addLessonForm.isPay"
filterable
style="width: 400px"
>
<el-option
v-for="(items,index) in isPayList"
:key="index"
:label="items.label"
:value="items.value"
/>
</el-select>
</el-form-item>
</div>
<div />
</div>
<div style="display: flex;justify-content: space-between;align-items: center">
<div>
<el-form-item
label="备注"
prop="remarks"
>
<el-input
v-model="addLessonForm.remarks"
style="width: 1100px"
placeholder="备注"
clearable
:maxlength="30"
size="small"
/>
</el-form-item>
</div>
</div>
</el-form>
<div style="padding: 20px;text-align: center">
<el-button class="fourWordsBtn" type="primary" icon="el-icon-search" size="mini" @click="handleLessonQuery">查询</el-button>
<el-button class="fourWordsBtn" icon="el-icon-refresh" size="mini" @click="handleLessonClear">重置</el-button>
</div>
<!-- <el-table class="DBXXClass" border :data="form.settingList" @selection-change="handleSelectionChange ">-->
<el-table ref="multipleTable" class="DBXXClass" border :data="lessonList" :row-key="getRoKey" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
/>
<el-table-column
label="序号"
type="index"
width="70"
align="center"
:reserve-selection="true"
/>
<el-table-column label="课程名称" prop="lessonName" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.lessonName }}
</template>
</el-table-column>
<el-table-column label="开课单位" prop="applicantUnit" show-overflow-tooltip>
{{ getUnitName(queryLessonParams.applicantUnit) }}
</el-table-column>
<el-table-column label="课程类型" prop="lessonType" show-overflow-tooltip>
{{ queryLessonParams.lessonType === '0' ? '企业课程' : '院校课程' }}
</el-table-column>
<el-table-column label="课程方案" prop="class" show-overflow-tooltip>
{{ getClassPlanName(queryLessonParams.classPlan) }}
</el-table-column>
<el-table-column label="难度等级" prop="class" show-overflow-tooltip>
{{ getDifficultyLevelName(queryLessonParams.difficultyClassify) }}
</el-table-column>
<el-table-column label="开始日期" prop="createTime" show-overflow-tooltip>
<template>
{{ addLessonForm.beginDate }}
</template>
</el-table-column>
<el-table-column label="结束日期" prop="endTime" show-overflow-tooltip>
<template>
{{ addLessonForm.endDate }}
</template>
</el-table-column>
<el-table-column label="开课类型" prop="isPay" :show-overflow-tooltip="true">
{{ addLessonForm.isPay === 0 ? '试用' : '付费' }}
</el-table-column>
<el-table-column label="备注" prop="remarks" show-overflow-tooltip>
<template>
{{ addLessonForm.remarks }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total1>0"
:total="total1"
:page.sync="queryLessonParams.page"
:limit.sync="queryLessonParams.rows"
@pagination="handleLessonQuery"
/>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="handleClose">取 消</el-button>
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div>
</el-dialog>
<!-- 添加或修改角色配置对话框 --> <!-- 添加或修改角色配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1100px" :close-on-click-modal="false" append-to-body @close="handleClose"> <el-dialog :title="title" :visible.sync="open" width="1100px" :close-on-click-modal="false" append-to-body @close="handleClose">
<el-form ref="form" :model="form" size="small" label-width="auto"> <el-form ref="form" :model="form" size="small" label-width="auto">
...@@ -628,16 +881,21 @@ import { ...@@ -628,16 +881,21 @@ import {
delTeaTrialCourse, importTemplateTrialCourse, listALLTeaTrialCourse, delTeaTrialCourse, importTemplateTrialCourse, listALLTeaTrialCourse,
listTeaTrialCourse, listTeaTrialCourse,
updateTeaTrialCourse, updateTeaTrialCourse,
importExcel importExcel, queryBLessonWithTrial
} from '@/api/try/teaTrialCourse' } from '@/api/try/teaTrialCourse'
import dict from '@/views/system/dict/index.vue' import dict from '@/views/system/dict/index.vue'
import { getDict } from '@/api/system/dict/data' import { getDict } from '@/api/system/dict/data'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
export default { export default {
name: 'Role', name: 'Role',
dicts: ['tec_classify', 'job_classify'], dicts: ['tec_classify', 'job_classify'],
data() { data() {
return { return {
total1: 0,
lessonList: [],
difficultyOptions: [],
multipleSelection: [],
// 开始日期数组 // 开始日期数组
dateRangeBegin: [], dateRangeBegin: [],
...@@ -682,10 +940,15 @@ export default { ...@@ -682,10 +940,15 @@ export default {
dateList: [], dateList: [],
unitOptions: [], unitOptions: [],
classOptions: [], classOptions: [],
lessonTypeOptions: [],
coursePlanOptions: [],
coursePlanOptionsC: [],
// 弹出层标题 // 弹出层标题
title: '', title: '',
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
open1: false,
// 日期范围 // 日期范围
// dateRange: [], // dateRange: [],
// 菜单表格数据 // 菜单表格数据
...@@ -747,19 +1010,46 @@ export default { ...@@ -747,19 +1010,46 @@ export default {
endTrialTime: '', endTrialTime: '',
applicantType: 2 applicantType: 2
}, },
// 查询参数
queryLessonParams: {
applicantUnit: '',
classPlan: '',
lessonType: '',
difficultyClassify: '',
page: 1,
rows: 10
},
// 开课类型list // 开课类型list
isPayList: [ isPayList: [
{ label: '试用', value: 0 }, { label: '试用', value: 0 },
{ label: '付费', value: 1 } { label: '付费', value: 1 }
], ],
courseDirection: [], courseDirection: [],
addLessonForm: {
applicantUnit: '',
unitId: '',
unitName: '',
lessonId: '',
lessonName: '',
beginDate: null,
endDate: null,
classPlan: '',
lessonType: '',
remarks: '',
isPay: ''
},
addForm: { addForm: {
unitId: '', unitId: '',
unitName: '', unitName: '',
lessonId: '', lessonId: '',
lessonName: '', lessonName: '',
beginDate: null, beginDate: null,
endDate: null endDate: null,
classPlan: '',
lessonType: ''
}, },
// 表单参数 // 表单参数
form: { form: {
...@@ -770,7 +1060,8 @@ export default { ...@@ -770,7 +1060,8 @@ export default {
label: 'label' label: 'label'
}, },
deptOptions: [] deptOptions: [],
rules: {}
} }
}, },
computed: { computed: {
...@@ -793,8 +1084,55 @@ export default { ...@@ -793,8 +1084,55 @@ export default {
this.getList() // 列表查询 this.getList() // 列表查询
this.getCourseDirection() this.getCourseDirection()
this.getJobClassification() this.getJobClassification()
this.getLessonType()
this.getCoursePlan()
this.getDifficultyLevel()
}, },
methods: { methods: {
// 获取难度等级
getDifficultyLevel() {
getDict('difficulty_grade').then(res => {
this.difficultyOptions = res.data
})
},
// 根据难度等级的id获取难度等级的名称
getDifficultyLevelName(dictValue) {
let name = ''
this.difficultyOptions.forEach(item => {
if (item.dictValue === dictValue) {
name = item.dictLabel
}
})
return name
},
handleSelectionChange(val) {
this.multipleSelection = val
console.log(this.multipleSelection)
},
getRoKey(row) {
return row.id
},
// 获取课程类型
getLessonType() {
getDict('lesson_type').then(res => {
this.lessonTypeOptions = res.data
console.log('课程类型', this.lessonTypeOptions)
})
},
// 获取课程方案
getCoursePlan() {
getDict('class_plan').then(res => {
this.coursePlanOptions = res.data
console.log('课程方案', this.coursePlanOptions)
})
},
// 获取课程方案(院校)
getCoursePlanC() {
getDict('class_plan_C').then(res => {
this.coursePlanOptionsC = res.data
console.log('课程方案', this.addForm.coursePlanOptionsC)
})
},
/** 1.获取全部单位**/ /** 1.获取全部单位**/
getUnitOptions() { getUnitOptions() {
const obj = { const obj = {
...@@ -814,6 +1152,17 @@ export default { ...@@ -814,6 +1152,17 @@ export default {
}) })
return name return name
}, },
getClassPlanName(dictValue) {
// 根据难度等级的id获取难度等级的名称
let name = ''
this.coursePlanOptions.forEach(item => {
if (item.dictValue === dictValue) {
name = item.dictLabel
}
})
return name
},
// 获取岗位类型 // 获取岗位类型
getJobClassification() { getJobClassification() {
// const obj = { // const obj = {
...@@ -859,6 +1208,39 @@ export default { ...@@ -859,6 +1208,39 @@ export default {
this.classOptions = res.data this.classOptions = res.data
}) })
}, },
/** 查找可以开课的课程*/
handleLessonQuery() {
const query = {
page: 1,
rows: 10,
applicantUnit: this.queryLessonParams.applicantUnit,
classPlan: this.queryLessonParams.classPlan,
lessonType: this.queryLessonParams.lessonType,
applicantType: '2',
difficultyClassify: this.queryLessonParams.difficultyClassify
}
queryBLessonWithTrial(query).then(res => {
this.lessonList = res.rows
this.total1 = res.total
console.log(res)
console.log(this.lessonList)
})
// if (res.code == 200) {
// this.lessonList = res.rows
// this.total1 = res.total
// console.log("res1111")
// } else {
// console.log("res2222211")
// }
//
// })
// console.log("res",this.setList)
},
/** 3.当用户选中单位时将单位选择框禁用**/ /** 3.当用户选中单位时将单位选择框禁用**/
handleUnitChange(value) { handleUnitChange(value) {
if (value && value !== '' && value !== undefined) { if (value && value !== '' && value !== undefined) {
...@@ -893,10 +1275,40 @@ export default { ...@@ -893,10 +1275,40 @@ export default {
this.resetAddFrom() this.resetAddFrom()
this.unitDisplay = false this.unitDisplay = false
}, },
handleLessonClear() {
this.resetQueryLesson()
this.resetAddLessonForm()
},
resetAddLessonForm() {
this.addLessonForm = {
unitId: '',
unitName: '',
lessonId: '',
lessonName: '',
beginDate: null,
endDate: null
}
this.lessonList = []
this.total1 = 0
},
resetQueryLesson() {
this.queryLessonParams = {
coursePlan: '',
lessonType: ''
}
this.form.settingList = []
},
/** 5.关闭时请表单想和列表数据清空**/ /** 5.关闭时请表单想和列表数据清空**/
handleClose() { handleClose() {
this.resetAddFrom() this.resetAddFrom()
this.handleLessonClear()
this.open = false this.open = false
this.open1 = false
this.$nextTick().then(() => {
this.$refs.lessonRef.clearValidate()
})
}, },
/** 6.重置方法**/ /** 6.重置方法**/
resetAddFrom() { resetAddFrom() {
...@@ -1039,6 +1451,7 @@ export default { ...@@ -1039,6 +1451,7 @@ export default {
this.total = response.total this.total = response.total
this.loading = false this.loading = false
}) })
console.log('dateList', this.dateList)
}, },
/** 查询菜单列表 */ /** 查询菜单列表 */
getMenuList(roleId) { getMenuList(roleId) {
...@@ -1088,6 +1501,17 @@ export default { ...@@ -1088,6 +1501,17 @@ export default {
this.handleQuery() this.handleQuery()
}, },
/** 处理课程类型变化*/
handleLessonTypeChange(value) {
if (value === '1') {
getDict('class_plan_C').then(res => {
this.coursePlanOptions = res.data
})
} else {
this.getCoursePlan()
}
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset() this.reset()
...@@ -1095,6 +1519,13 @@ export default { ...@@ -1095,6 +1519,13 @@ export default {
this.unitDisplay = false this.unitDisplay = false
this.title = '开课新增' this.title = '开课新增'
}, },
/** 新增按钮操作 */
handleAdd1() {
this.reset()
this.open1 = true
this.unitDisplay = false
this.title = '开课新增'
},
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(index) { handleUpdate(index) {
this.dateList[index].flag = '1' this.dateList[index].flag = '1'
...@@ -1120,33 +1551,65 @@ export default { ...@@ -1120,33 +1551,65 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
if (this.form.settingList.length > 0) { console.log('提交')
// 克隆form const form = this.multipleSelection
const form = { form.forEach(item => {
settingList: this.form.settingList, item.applicantUnit = this.queryLessonParams.applicantUnit
applicantUnit: this.addForm.applicantUnit, item.lessonId = item.businessId
item.remarks = this.addLessonForm.remarks
item.applicantType = 2
item.isPay = this.addLessonForm.isPay
item.beginTrialTime = this.addLessonForm.beginDate
item.endTrialTime = this.addLessonForm.endDate
item.businessId = null
item.flag = '0'
item.jobClassification = item.jobClassify
item.technicalClassification = item.tecClassify
})
console.log(form)
const addForm = {
settingList: form,
applicantUnit: this.addLessonForm.applicantUnit,
applicantType: 2 applicantType: 2
} }
// 判断form的每一项flag是否为0 batchAddTeaTrialCourse(addForm).then(res => {
for (let i = 0; i < form.settingList.length; i++) {
if (form.settingList[i].flag === '1') {
return this.$message.error('请保存列表数据')
}
}
console.log('this.form', this.form)
console.log('this.addForm', this.addForm)
batchAddTeaTrialCourse(form).then(res => {
console.log('添加开课信息', res) console.log('添加开课信息', res)
if (res.code === 200) { if (res.code === 200) {
this.resetAddFrom() this.resetAddFrom()
this.open = false this.open1 = false
this.getList() this.getList()
this.$message.success('添加成功') this.$message.success('添加成功')
} }
}) })
} else {
return this.$message.error('请添加列表数据') // if (this.form.settingList.length > 0) {
} // // 克隆form
// const form = {
// settingList: this.form.settingList,
// applicantUnit: this.addForm.applicantUnit,
// applicantType: 2
// }
// // 判断form的每一项flag是否为0
// for (let i = 0; i < form.settingList.length; i++) {
// if (form.settingList[i].flag === '1') {
// return this.$message.error('请保存列表数据')
// }
// }
// console.log('this.form', this.form)
// console.log('this.addForm', this.addForm)
// batchAddTeaTrialCourse(form).then(res => {
// console.log('添加开课信息', res)
// if (res.code === 200) {
// this.resetAddFrom()
// this.open = false
// this.getList()
// this.$message.success('添加成功')
// }
// })
// } else {
// return this.$message.error('请添加列表数据')
// }
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
......
...@@ -7,6 +7,17 @@ ...@@ -7,6 +7,17 @@
<el-form-item label="课程名称" prop="lessonName"> <el-form-item label="课程名称" prop="lessonName">
<el-input v-model="queryParams.lessonName" placeholder="课程名称" :maxlength="15" style="width: 200px" /> <el-input v-model="queryParams.lessonName" placeholder="课程名称" :maxlength="15" style="width: 200px" />
</el-form-item> </el-form-item>
<!-- 课程类型-->
<el-form-item label="课程类型" prop="lessonType">
<el-select v-model="queryParams.lessonType" placeholder="课程类型" clearable>
<el-option
v-for="item in lessonTypeOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
<!-- 课程方案--> <!-- 课程方案-->
<el-form-item label="课程方案" prop="classPlan"> <el-form-item label="课程方案" prop="classPlan">
<el-select v-model="queryParams.classPlan" class="selectWidth" placeholder="课程方案" clearable> <el-select v-model="queryParams.classPlan" class="selectWidth" placeholder="课程方案" clearable>
...@@ -79,9 +90,9 @@ ...@@ -79,9 +90,9 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 企业精品课--> <!-- 精品课-->
<el-form-item label="企业精品课" prop="entQualityLesson"> <el-form-item label="精品课" prop="entQualityLesson">
<el-select v-model="queryParams.entQualityLesson" placeholder="企业精品课" clearable> <el-select v-model="queryParams.qualityLesson" placeholder="精品课" clearable>
<el-option <el-option
v-for="(item,index) in entQualityLessonList" v-for="(item,index) in entQualityLessonList"
:key="index" :key="index"
...@@ -90,17 +101,7 @@ ...@@ -90,17 +101,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 院校精品课-->
<el-form-item label="院校精品课" prop="schoolQualityLesson">
<el-select v-model="queryParams.schoolQualityLesson" placeholder="院校精品课" clearable>
<el-option
v-for="item in entQualityLessonList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<!-- //查询按钮--> <!-- //查询按钮-->
<el-button <el-button
...@@ -148,6 +149,18 @@ ...@@ -148,6 +149,18 @@
<el-form-item label="课程方案" prop="name"> <el-form-item label="课程方案" prop="name">
<el-input v-model="form.name" auto-complete="off" placeholder="课时数" :maxlength="15" /> <el-input v-model="form.name" auto-complete="off" placeholder="课时数" :maxlength="15" />
</el-form-item> </el-form-item>
<el-form-item label="课程类型" >
<el-select v-model="form.lessonType" placeholder="课程类型" clearable>
<el-option
v-for="item in lessonTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="岗位分类" prop="value"> <el-form-item label="岗位分类" prop="value">
<el-select v-model="form.value" placeholder="适用岗位" clearable> <el-select v-model="form.value" placeholder="适用岗位" clearable>
<el-option <el-option
...@@ -286,6 +299,11 @@ ...@@ -286,6 +299,11 @@
<span>{{ scope.row.classHour }}</span> <span>{{ scope.row.classHour }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="课程类型" prop="lessonType" min-width="120px" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ getLessonTypeName( scope.row.lessonType) }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="课程方案" prop="classPlan" min-width="120px" :show-overflow-tooltip="true"> <el-table-column align="center" label="课程方案" prop="classPlan" min-width="120px" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getCoursePlanName( scope.row.classPlan) }}</span> <span>{{ getCoursePlanName( scope.row.classPlan) }}</span>
...@@ -343,26 +361,26 @@ ...@@ -343,26 +361,26 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="企业精品课" prop="entQualityLesson" min-width="100px" :show-overflow-tooltip="true"> <el-table-column align="center" label="精品课" prop="qualityLesson" min-width="100px" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.entQualityLesson" v-model="scope.row.qualityLesson"
active-value="1" active-value="1"
inactive-value="0" inactive-value="0"
@change="handleEntQualityChange(scope.row)" @change="handleEntQualityChange(scope.row)"
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="院校精品课" prop="schoolQualityLesson" min-width="100px" :show-overflow-tooltip="true"> <!-- <el-table-column align="center" label="院校精品课" prop="schoolQualityLesson" min-width="100px" :show-overflow-tooltip="true">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<el-switch <!-- <el-switch-->
v-model="scope.row.schoolQualityLesson" <!-- v-model="scope.row.schoolQualityLesson"-->
active-value="1" <!-- active-value="1"-->
inactive-value="0" <!-- inactive-value="0"-->
@change="handleSchoolQualityChange(scope.row)" <!-- @change="handleSchoolQualityChange(scope.row)"-->
/> <!-- />-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column align="left" label="课程介绍" prop="lessonDescription" min-width="150px" :show-overflow-tooltip="true"> <el-table-column align="left" label="课程介绍" prop="lessonDescription" min-width="150px" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.lessonDescription }}</span> <span>{{ scope.row.lessonDescription }}</span>
...@@ -370,7 +388,7 @@ ...@@ -370,7 +388,7 @@
</el-table-column> </el-table-column>
<el-table-column align="left" label="课程评分" prop="lessonScore" min-width="150px" :show-overflow-tooltip="true"> <el-table-column align="left" label="课程评分" prop="lessonScore" min-width="150px" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" v-if="scope.row.lessonScore!==0" @click="handleCheckScore(scope.row.businessId, scope.row.lessonScore)">{{ scope.row.lessonScore}}</el-link> <el-link v-if="scope.row.lessonScore!==0" type="primary" @click="handleCheckScore(scope.row.businessId, scope.row.lessonScore)">{{ scope.row.lessonScore }}</el-link>
<div v-else>-</div> <div v-else>-</div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -547,7 +565,7 @@ ...@@ -547,7 +565,7 @@
> >
<div style="padding: 50px"> <div style="padding: 50px">
<div class="scoreTitle"> <div class="scoreTitle">
综合评分:<span style="color: red; margin: 0 50px 0 30px; font-size: 20px">{{ scoreAvg}}分</span> 综合评分:<span style="color: red; margin: 0 50px 0 30px; font-size: 20px">{{ scoreAvg }}分</span>
评价总数:<span style="color: red;margin-left: 30px;font-size: 20px"> {{ scoreTotal }}条</span> 评价总数:<span style="color: red;margin-left: 30px;font-size: 20px"> {{ scoreTotal }}条</span>
</div> </div>
<el-table <el-table
...@@ -566,10 +584,10 @@ ...@@ -566,10 +584,10 @@
匿名用户 匿名用户
</div> </div>
<div v-else-if="scope.row.unitName===''"> <div v-else-if="scope.row.unitName===''">
{{ scope.row.userName}} {{ scope.row.userName }}
</div> </div>
<div v-else> <div v-else>
{{ scope.row.userName+'-'+scope.row.unitName}} {{ scope.row.userName+'-'+scope.row.unitName }}
</div> </div>
</template> </template>
...@@ -679,7 +697,7 @@ export default { ...@@ -679,7 +697,7 @@ export default {
} }
return { return {
// 评分列表 // 评分列表
//平均分 // 平均分
scoreAvg: 0, scoreAvg: 0,
scoreTable: [], scoreTable: [],
// 评论总数 // 评论总数
...@@ -747,6 +765,8 @@ export default { ...@@ -747,6 +765,8 @@ export default {
{ value: '1', label: '已发布' }, { value: '1', label: '已发布' },
{ value: '0', label: '未发布' } { value: '0', label: '未发布' }
], ],
// 课程类型List
lessonTypeOptions: [],
// 课程方向 // 课程方向
courseDirection: [], courseDirection: [],
valueOptions: [ valueOptions: [
...@@ -806,11 +826,12 @@ export default { ...@@ -806,11 +826,12 @@ export default {
lessonPrice: '', lessonPrice: '',
homeDisplay: '', homeDisplay: '',
flag: '', flag: '',
schoolQualityLesson: '', qualityLesson: '',
entQualityLesson: '' lessonType: ''
}, },
coursePlanOptions: [], coursePlanOptions: [],
coursePlanOptionsC: [],
// pagination // pagination
total: 0, total: 0,
...@@ -872,6 +893,7 @@ export default { ...@@ -872,6 +893,7 @@ export default {
this.getCourseDirection() this.getCourseDirection()
this.getJobClassification() this.getJobClassification()
this.getDifficultyLevel() this.getDifficultyLevel()
this.getLessonType()
this.getCoursePlan() this.getCoursePlan()
this.getTeacher() this.getTeacher()
this.loadData() this.loadData()
...@@ -880,9 +902,9 @@ export default { ...@@ -880,9 +902,9 @@ export default {
/** /**
* 点击分数 * 点击分数
***/ ***/
handleCheckScore(id,scoreAvg) { handleCheckScore(id, scoreAvg) {
this.drawer = true this.drawer = true
this.scoreAvg =scoreAvg this.scoreAvg = scoreAvg
this.getScoreList(id) this.getScoreList(id)
}, },
/** /**
...@@ -1022,10 +1044,10 @@ export default { ...@@ -1022,10 +1044,10 @@ export default {
}, },
// 修改是否企业精品课 // 修改是否企业精品课
handleEntQualityChange(row) { handleEntQualityChange(row) {
const text = row.entQualityLesson === '1' ? '显示' : '不显示' const text = row.qualityLesson === '1' ? '显示' : '不显示'
const params = { const params = {
businessId: row.businessId, businessId: row.businessId,
entQualityLesson: row.entQualityLesson qualityLesson: row.qualityLesson
} }
this.$confirm('是否确认操作?', '警告', { this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -1089,6 +1111,8 @@ export default { ...@@ -1089,6 +1111,8 @@ export default {
flag: _this.queryParams.flag, flag: _this.queryParams.flag,
schoolQualityLesson: _this.queryParams.schoolQualityLesson, schoolQualityLesson: _this.queryParams.schoolQualityLesson,
entQualityLesson: _this.queryParams.entQualityLesson, entQualityLesson: _this.queryParams.entQualityLesson,
qualityLesson: _this.queryParams.qualityLesson,
lessonType: _this.queryParams.lessonType,
sort: 'create_date desc' sort: 'create_date desc'
} }
queryBLessonsByPagination(params).then(res => { queryBLessonsByPagination(params).then(res => {
...@@ -1142,6 +1166,14 @@ export default { ...@@ -1142,6 +1166,14 @@ export default {
console.log('课程方案', this.coursePlanOptions) console.log('课程方案', this.coursePlanOptions)
}) })
}, },
// 获取课程方案(院校版)
getCoursePlanC() {
getDict('class_plan_c').then(res => {
this.coursePlanOptionsC = res.data
console.log('课程方案', this.coursePlanOptionsC)
})
},
// 获取岗位类型 // 获取岗位类型
getJobClassification() { getJobClassification() {
getDict('job_classify').then(res => { getDict('job_classify').then(res => {
...@@ -1154,6 +1186,13 @@ export default { ...@@ -1154,6 +1186,13 @@ export default {
this.courseDirection = res.data this.courseDirection = res.data
}) })
}, },
// 获取课程类型
getLessonType() {
getDict('lesson_type').then(res => {
this.lessonTypeOptions = res.data
})
},
// 根据岗位的id获取岗位的名称 // 根据岗位的id获取岗位的名称
getJobClassificationName(dictValue) { getJobClassificationName(dictValue) {
if (!dictValue) { if (!dictValue) {
...@@ -1198,6 +1237,16 @@ export default { ...@@ -1198,6 +1237,16 @@ export default {
}) })
return name return name
}, },
// 根据课程类型的id获取类型的名称
getLessonTypeName(dictValue) {
let name = ''
this.lessonTypeOptions.forEach(item => {
if (item.dictValue === dictValue) {
name = item.dictLabel
}
})
return name
},
// 根据id获取课程方案的名称 // 根据id获取课程方案的名称
getCoursePlanName(dictValue) { getCoursePlanName(dictValue) {
if (!dictValue) { if (!dictValue) {
......
...@@ -19,6 +19,24 @@ ...@@ -19,6 +19,24 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="精品课:" prop="qualityLesson">
<el-radio-group v-model="form.qualityLesson">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="课程类型" prop="lessonType">
<el-radio-group v-model="form.lessonType">
<el-radio label="0">企业课程</el-radio>
<el-radio label="1">院校课程</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100"> <el-row :gutter="100">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="课时数:" prop="classHour" :rules="[{ required: status !== '3', message: '请输入课时数', trigger: 'blur' }]"> <el-form-item label="课时数:" prop="classHour" :rules="[{ required: status !== '3', message: '请输入课时数', trigger: 'blur' }]">
...@@ -34,7 +52,7 @@ ...@@ -34,7 +52,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="课程方案:" prop="classPlan" :rules="[{ required: status !== '3', message: '请选择课程方案', trigger: 'blur' }]"> <el-form-item v-if="form.lessonType === '0'" label="课程方案:" prop="classPlan" :rules="[{ required: status !== '3', message: '请选择课程方案', trigger: 'blur' }]">
<el-select <el-select
v-model="form.classPlan" v-model="form.classPlan"
filterable filterable
...@@ -49,11 +67,29 @@ ...@@ -49,11 +67,29 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-else label="课程方案:" prop="classPlan" :rules="[{ required: status !== '3', message: '请选择课程方案', trigger: 'blur' }]">
<el-select
v-model="form.classPlan"
filterable
multiple
class="normalSelct"
>
<el-option
v-for="(items,index) in coursePlanOptionsC"
:key="index"
:label="items.dictLabel"
:value="items.dictValue"
/>
</el-select>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="100"> <el-row :gutter="100">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="岗位分类:" prop="jobClassify">
<el-form-item v-if="form.classPlan[0]=== '1'" label="岗位分类:" prop="jobClassify">
<el-select <el-select
v-model="form.jobClassify" v-model="form.jobClassify"
class="normalSelct" class="normalSelct"
...@@ -69,7 +105,7 @@ ...@@ -69,7 +105,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="技术分类:" prop="tecClassify"> <el-form-item v-if="form.classPlan[0]!== '1'" label="技术分类:" prop="tecClassify">
<el-select <el-select
v-model="form.tecClassify" v-model="form.tecClassify"
multiple multiple
...@@ -135,24 +171,7 @@ ...@@ -135,24 +171,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="企业精品课:" prop="entQualityLesson">
<el-radio-group v-model="form.entQualityLesson">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="院校精品课" prop="schoolQualityLesson">
<el-radio-group v-model="form.schoolQualityLesson">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100"> <el-row :gutter="100">
<el-col span="12"> <el-col span="12">
<el-form-item label="课程封面" prop="totalStuHours"> <el-form-item label="课程封面" prop="totalStuHours">
...@@ -209,10 +228,7 @@ ...@@ -209,10 +228,7 @@
import { uploadPublic } from '@/api/contentManagement/sysContest' import { uploadPublic } from '@/api/contentManagement/sysContest'
import { import {
blessonAdd, blessonAdd,
detailBLesson, detailBLesson
queryTeaLessonJobs,
queryTeaLessonTecs,
updateBLesson
} from '@/api/courseManagement/indexApi' } from '@/api/courseManagement/indexApi'
import { getDict } from '@/api/system/dict/data' import { getDict } from '@/api/system/dict/data'
import { listCmsLecturer } from '@/api/courseManagement/cmsLecturer' import { listCmsLecturer } from '@/api/courseManagement/cmsLecturer'
...@@ -222,6 +238,8 @@ export default { ...@@ -222,6 +238,8 @@ export default {
name: 'Index', name: 'Index',
data() { data() {
return { return {
// 岗位能力
cP: ['1'],
// 方案集合 // 方案集合
optionList: [], optionList: [],
...@@ -267,6 +285,7 @@ export default { ...@@ -267,6 +285,7 @@ export default {
valueOptions: [], valueOptions: [],
courseDirection: [], courseDirection: [],
coursePlanOptions: [], coursePlanOptions: [],
coursePlanOptionsC: [],
form: { form: {
// 课程名称 // 课程名称
lessonName: '', lessonName: '',
...@@ -288,10 +307,10 @@ export default { ...@@ -288,10 +307,10 @@ export default {
difficultyClassify: '', difficultyClassify: '',
// 首页显示 // 首页显示
homeDisplay: '0', homeDisplay: '0',
// 企业精品课 // 精品课
entQualityLesson: '0', qualityLesson: '0',
// 院校精品课 // 院校精品课
schoolQualityLesson: '0', lessonType: '0',
// 课程介绍 // 课程介绍
lessonDescription: '', lessonDescription: '',
flag: '1', flag: '1',
...@@ -322,6 +341,7 @@ export default { ...@@ -322,6 +341,7 @@ export default {
this.getJobClassification() this.getJobClassification()
this.getCourseDirection() this.getCourseDirection()
this.getTeacher() this.getTeacher()
this.getCoursePlanC()
}, },
getDifficultyLevlList() { getDifficultyLevlList() {
getDict('difficulty_grade').then(res => { getDict('difficulty_grade').then(res => {
...@@ -340,6 +360,13 @@ export default { ...@@ -340,6 +360,13 @@ export default {
console.log('课程方案', this.coursePlanOptions) console.log('课程方案', this.coursePlanOptions)
}) })
}, },
// 获取课程方案(院校)
getCoursePlanC() {
getDict('class_plan_C').then(res => {
this.coursePlanOptionsC = res.data
console.log('课程方案', this.coursePlanOptionsC)
})
},
// 获取岗位类型 // 获取岗位类型
getJobClassification() { getJobClassification() {
getDict('job_classify').then(res => { getDict('job_classify').then(res => {
......
...@@ -116,6 +116,17 @@ ...@@ -116,6 +116,17 @@
@click="handleAdd" @click="handleAdd"
>{{ commonField.addName }}</el-button> >{{ commonField.addName }}</el-button>
</el-form-item> </el-form-item>
<el-form-item>
<!-- //新增按钮-->
<el-button
:class="commonField.addClass"
:type="commonField.typePrimary"
:icon="commonField.addIcon"
:size="commonField.smallSize"
@click="handleAdd1"
> 测试 </el-button>
</el-form-item>
</div> </div>
</el-form> </el-form>
</div> </div>
...@@ -580,7 +591,248 @@ ...@@ -580,7 +591,248 @@
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button> <el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :title="title" :visible.sync="open1" width="1300px" :close-on-click-modal="false" append-to-body @close="handleClose">
<el-form ref="lessonRef" :model="form" :rules="rules" size="small" label-width="auto">
<div style="display: flex;justify-content: space-between;align-items: center">
<div>
<el-form-item
label="申请人"
prop="applicant"
>
<el-select
v-model="queryLessonParams.applicant"
filterable
style="width: 400px"
>
<el-option
v-for="(items,index) in userOptions"
:key="index"
:label="items.nickName"
:value="items.businessId"
/>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item
label="课程类型"
prop="lessonType"
>
<el-select
v-model="queryLessonParams.lessonType"
filterable
style="width: 400px"
@change="handleLessonTypeChange"
>
<el-option
v-for="item in lessonTypeOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
</div>
</div>
<div style="display: flex;justify-content: space-between;align-items: center">
<div>
<el-form-item
label="课程方案"
prop="classPlan"
>
<el-select
v-model="queryLessonParams.classPlan"
filterable
style="width: 400px"
>
<el-option
v-for="item in coursePlanOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="难度等级" prop="difficultyClassify">
<el-select v-model="queryLessonParams.difficultyClassify" placeholder="难度等级" clearable style="width: 400px">
<el-option
v-for="item in difficultyOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
</div>
</div>
<el-divider />
<div style="display: flex;justify-content: space-between;align-items: center">
<div>
<el-form-item
label="开始时间"
prop="createTime"
>
<span>
<el-date-picker
v-model="addLessonForm.beginDate"
style="width: 400px"
type="date"
placeholder="-"
:editable="false"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
/>
</span>
</el-form-item>
</div>
<div>
<el-form-item
label="结束时间"
prop="endTime"
>
<span>
<el-date-picker
v-model="addLessonForm.endDate"
style="width: 400px"
type="date"
placeholder="-"
:editable="false"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
/>
</span>
</el-form-item>
</div>
</div>
<div style="display: flex;justify-content: space-between;align-items: center">
<div>
<el-form-item
label="开课类型"
prop="isPay"
>
<el-select
v-model="addLessonForm.isPay"
filterable
style="width: 400px"
>
<el-option
v-for="(items,index) in isPayList"
:key="index"
:label="items.label"
:value="items.value"
/>
</el-select>
</el-form-item>
</div>
<div />
</div>
<div style="display: flex;justify-content: space-between;align-items: center">
<div>
<el-form-item
label="备注"
prop="remarks"
>
<el-input
v-model="addLessonForm.remarks"
style="width: 1100px"
placeholder="备注"
clearable
:maxlength="30"
size="small"
/>
</el-form-item>
</div>
</div>
</el-form>
<div style="padding: 20px;text-align: center">
<el-button class="fourWordsBtn" type="primary" icon="el-icon-search" size="mini" @click="handleLessonQuery">查询</el-button>
<el-button class="fourWordsBtn" icon="el-icon-refresh" size="mini" @click="handleLessonClear">重置</el-button>
</div>
<!-- <el-table class="DBXXClass" border :data="form.settingList" @selection-change="handleSelectionChange ">-->
<el-table ref="multipleTable" class="DBXXClass" border :data="lessonList" :row-key="getRoKey" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
/>
<el-table-column
label="序号"
type="index"
width="70"
align="center"
:reserve-selection="true"
/>
<el-table-column label="开课名称" prop="lessonName" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.lessonName }}
</template>
</el-table-column>
<el-table-column label="申请人" prop="applicantUnit" show-overflow-tooltip>
{{ getUserName(queryLessonParams.applicant) || '-' }}
</el-table-column>
<el-table-column label="课程类型" prop="lessonType" show-overflow-tooltip>
{{ queryLessonParams.lessonType === '0' ? '企业课程' : '院校课程' }}
</el-table-column>
<el-table-column label="课程方案" prop="class" show-overflow-tooltip>
{{ getClassPlanName(queryLessonParams.classPlan) }}
</el-table-column>
<el-table-column label="难度等级" prop="class" show-overflow-tooltip>
{{ getDifficultyLevelName(queryLessonParams.difficultyClassify) }}
</el-table-column>
<el-table-column label="开始日期" prop="createTime" show-overflow-tooltip>
<template>
{{ addLessonForm.beginDate }}
</template>
</el-table-column>
<el-table-column label="结束日期" prop="endTime" show-overflow-tooltip>
<template>
{{ addLessonForm.endDate }}
</template>
</el-table-column>
<el-table-column label="开课类型" prop="isPay" :show-overflow-tooltip="true">
{{ addLessonForm.isPay === 0 ? '试用' : '付费' }}
</el-table-column>
<el-table-column label="备注" prop="remarks" show-overflow-tooltip>
<template>
{{ addLessonForm.remarks }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total1>0"
:total="total1"
:page.sync="queryLessonParams.page"
:limit.sync="queryLessonParams.rows"
@pagination="handleLessonQuery"
/>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="handleClose">取 消</el-button>
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -588,31 +840,57 @@ ...@@ -588,31 +840,57 @@
import commonField from '@/utils/commonField' import commonField from '@/utils/commonField'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { import {
getById, upadteBatch
listTeaExamExaminationPaper, upadteBatch
} from '@/api/examination/teaExamExaminationPaper' } from '@/api/examination/teaExamExaminationPaper'
import { delTeaExamQuestions } from '@/api/examination/teaExamQuestions' import { delApplicationTrial } from '@/api/try/applicationTrial'
import { delApplicationTrial, listApplicationTrial } from '@/api/try/applicationTrial'
import { delSysContentNewsInformation } from '@/api/contentManagement/sysContentNewsInformation'
import { import {
batchAddTeaTrialCourse, batchAddTeaTrialCourse,
delTeaTrialCourse, listALLTeaTrialCourse, delTeaTrialCourse, listALLTeaTrialCourse,
listTeaTrialCourse, listTeaTrialCourse, queryBLessonWithTrial,
updateTeaTrialCourse updateTeaTrialCourse
} from '@/api/try/teaTrialCourse' } from '@/api/try/teaTrialCourse'
import { getDict } from '@/api/system/dict/data' import { getDict } from '@/api/system/dict/data'
import { queryOpenCourseByUnit, validOpenCourse } from '@/api/classManagement' import { validOpenCourse } from '@/api/classManagement'
import { getListUser, listUser } from '@/api/system/user' import { listUser } from '@/api/system/user'
import { listCourseAll } from '@/api/sysUnit' import { listCourseAll } from '@/api/sysUnit'
export default { export default {
name: 'TryoutApplication', name: 'TryoutApplication',
data() { data() {
return { return {
total1: 0,
lessonList: [],
// 查询参数
queryLessonParams: {
applicant: '',
classPlan: '',
lessonType: '',
difficultyClassify: '',
page: 1,
rows: 10
},
// 开始日期数组 // 开始日期数组
dateRangeBegin: [], dateRangeBegin: [],
// 结束日期 // 结束日期
dateRangeEnd: [], dateRangeEnd: [],
unitOptions: [],
difficultyOptions: [],
lessonTypeOptions: [],
coursePlanOptions: [],
coursePlanOptionsC: [],
addLessonForm: {
applicant: '',
unitId: '',
unitName: '',
lessonId: '',
lessonName: '',
beginDate: null,
endDate: null,
classPlan: '',
lessonType: '',
remarks: '',
isPay: ''
},
// 显示开关 // 显示开关
showSwitch: { showSwitch: {
courseContent: true, courseContent: true,
...@@ -641,6 +919,7 @@ export default { ...@@ -641,6 +919,7 @@ export default {
settingList: [] settingList: []
}, },
open: false, open: false,
open1: false,
title: '', title: '',
courseDirection: [], courseDirection: [],
classOptions: [], classOptions: [],
...@@ -708,8 +987,120 @@ export default { ...@@ -708,8 +987,120 @@ export default {
this.getClassOptions() this.getClassOptions()
this.getUserList() this.getUserList()
this.loadData() this.loadData()
this.getLessonType()
this.getCoursePlan()
this.getDifficultyLevel()
}, },
methods: { methods: {
// 获取难度等级
getDifficultyLevel() {
getDict('difficulty_grade').then(res => {
this.difficultyOptions = res.data
})
},
// 根据难度等级的id获取难度等级的名称
getDifficultyLevelName(dictValue) {
let name = ''
this.difficultyOptions.forEach(item => {
if (item.dictValue === dictValue) {
name = item.dictLabel
}
})
return name
},
getClassPlanName(dictValue) {
// 根据难度等级的id获取难度等级的名称
let name = ''
this.coursePlanOptions.forEach(item => {
if (item.dictValue === dictValue) {
name = item.dictLabel
}
})
return name
},
handleSelectionChange(val) {
this.multipleSelection = val
console.log(this.multipleSelection)
},
getRoKey(row) {
return row.id
},
handleLessonClear() {
this.resetQueryLesson()
this.resetAddLessonForm()
},
resetAddLessonForm() {
this.addLessonForm = {
unitId: '',
unitName: '',
lessonId: '',
lessonName: '',
beginDate: null,
endDate: null
}
this.lessonList = []
this.total1 = 0
},
resetQueryLesson() {
this.queryLessonParams = {
coursePlan: '',
lessonType: ''
}
this.form.settingList = []
},
getLessonType() {
getDict('lesson_type').then(res => {
this.lessonTypeOptions = res.data
console.log('课程类型', this.lessonTypeOptions)
})
},
/** 查找可以开课的课程*/
handleLessonQuery() {
const query = {
page: 1,
rows: 10,
applicant: this.queryLessonParams.applicant,
classPlan: this.queryLessonParams.classPlan,
lessonType: this.queryLessonParams.lessonType,
applicantType: '1',
difficultyClassify: this.queryLessonParams.difficultyClassify
}
console.log(query)
queryBLessonWithTrial(query).then(res => {
this.lessonList = res.rows
this.total1 = res.total
console.log(res)
console.log(this.lessonList)
})
},
/** 处理课程类型变化*/
handleLessonTypeChange(value) {
if (value === '1') {
getDict('class_plan_C').then(res => {
this.coursePlanOptions = res.data
})
} else {
this.getCoursePlan()
}
},
// 获取课程方案
getCoursePlan() {
getDict('class_plan').then(res => {
this.coursePlanOptions = res.data
console.log('课程方案', this.coursePlanOptions)
})
},
// 获取课程方案(院校)
getCoursePlanC() {
getDict('class_plan_C').then(res => {
this.coursePlanOptionsC = res.data
console.log('课程方案', this.addForm.coursePlanOptionsC)
})
},
// 状态转换 // 状态转换
statusChange(status) { statusChange(status) {
if (status === '0') { if (status === '0') {
...@@ -755,7 +1146,12 @@ export default { ...@@ -755,7 +1146,12 @@ export default {
/** 5.关闭时请表单想和列表数据清空**/ /** 5.关闭时请表单想和列表数据清空**/
handleClose() { handleClose() {
this.resetAddFrom() this.resetAddFrom()
this.handleLessonClear()
this.open = false this.open = false
this.open1 = false
this.$nextTick().then(() => {
this.$refs.lessonRef.clearValidate()
})
}, },
/** 7.当课程有值是将课程label查询*/ /** 7.当课程有值是将课程label查询*/
handleLessonChange(value) { handleLessonChange(value) {
...@@ -1078,36 +1474,76 @@ export default { ...@@ -1078,36 +1474,76 @@ export default {
this.unitDisplay = false this.unitDisplay = false
this.title = '开课新增' this.title = '开课新增'
}, },
/** 新增按钮操作 */
handleAdd1() {
this.reset()
this.open1 = true
this.unitDisplay = false
this.title = '开课新增'
},
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
if (this.form.settingList.length > 0) { console.log('提交')
// 克隆form const form = this.multipleSelection
const form = { form.forEach(item => {
settingList: this.form.settingList, item.applicant = this.queryLessonParams.applicant
applicant: this.addForm.applicant, item.lessonId = item.businessId
item.remarks = this.addLessonForm.remarks
item.applicantType = 1
item.isPay = this.addLessonForm.isPay
item.beginTrialTime = this.addLessonForm.beginDate
item.endTrialTime = this.addLessonForm.endDate
item.businessId = null
item.flag = '0'
item.jobClassification = item.jobClassify
item.technicalClassification = item.tecClassify
})
console.log(form)
const addForm = {
settingList: form,
applicant: this.addLessonForm.applicant,
applicantType: 1 applicantType: 1
} }
// 判断form的每一项flag是否为0 batchAddTeaTrialCourse(addForm).then(res => {
for (let i = 0; i < form.settingList.length; i++) { console.log('添加开课信息', res)
if (form.settingList[i].flag === '1') {
return this.$message.error('请保存列表数据')
}
}
console.log('this.form', this.form)
batchAddTeaTrialCourse(form).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.resetAddFrom() this.resetAddFrom()
this.open = false this.open1 = false
this.loadData() this.loadData()
this.$message({ this.$message.success('添加成功')
message: '新增成功',
type: 'success'
})
} }
}) })
} else {
return this.$message.error('请添加列表数据') // if (this.form.settingList.length > 0) {
} // // 克隆form
// const form = {
// settingList: this.form.settingList,
// applicant: this.addForm.applicant,
// applicantType: 1
// }
// // 判断form的每一项flag是否为0
// for (let i = 0; i < form.settingList.length; i++) {
// if (form.settingList[i].flag === '1') {
// return this.$message.error('请保存列表数据')
// }
// }
// console.log('this.form', this.form)
// batchAddTeaTrialCourse(form).then(res => {
// if (res.code === 200) {
// this.resetAddFrom()
// this.open = false
// this.loadData()
// this.$message({
// message: '新增成功',
// type: 'success'
// })
// }
// })
// } else {
// return this.$message.error('请添加列表数据')
// }
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(index) { handleUpdate(index) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment