Commit f806f19f authored by zhuangXW's avatar zhuangXW

修改个人开课,企业开课

parent d8957ae6
......@@ -112,7 +112,7 @@ export function importExcel(data) {
// 根据查询参数分页查询可开课的课程
export function queryBLessonWithTrial(query) {
return request({
url: '/blesson/queryBLessonWithTrial',
url: '/teatrialcourse/queryNoSchoolBegins',
method: 'get',
params: query
})
......
......@@ -289,7 +289,8 @@
prop="applicantUnit"
>
<el-select
v-model="queryLessonParams.applicantUnit"
v-model="form.applicantUnit"
placeholder="请选择开课单位"
filterable
style="width: 400px"
>
......@@ -308,7 +309,8 @@
prop="lessonType"
>
<el-select
v-model="queryLessonParams.lessonType"
v-model="form.lessonType"
placeholder="请选择课程类型"
filterable
style="width: 400px"
@change="handleLessonTypeChange"
......@@ -331,8 +333,9 @@
prop="classPlan"
>
<el-select
v-model="queryLessonParams.classPlan"
v-model="form.classPlan"
filterable
placeholder="请选择课程方案"
style="width: 400px"
>
<el-option
......@@ -346,7 +349,7 @@
</div>
<div>
<el-form-item label="难度等级" prop="difficultyClassify">
<el-select v-model="queryLessonParams.difficultyClassify" placeholder="难度等级" clearable style="width: 400px">
<el-select v-model="form.difficultyClassify" placeholder="请选择难度等级" clearable style="width: 400px">
<el-option
v-for="item in difficultyOptions"
:key="item.dictValue"
......@@ -364,17 +367,18 @@
<div>
<el-form-item
label="开始时间"
prop="createTime"
prop="beginDate"
>
<span>
<el-date-picker
v-model="addLessonForm.beginDate"
v-model="form.beginDate"
style="width: 400px"
type="date"
placeholder="-"
placeholder="请选择开始时间"
:editable="false"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
:picker-options="pickerOptionsBegin"
/>
</span>
</el-form-item>
......@@ -382,17 +386,18 @@
<div>
<el-form-item
label="结束时间"
prop="endTime"
prop="endDate"
>
<span>
<el-date-picker
v-model="addLessonForm.endDate"
v-model="form.endDate"
style="width: 400px"
type="date"
placeholder="-"
placeholder="请选择结束时间"
:editable="false"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
/>
</span>
</el-form-item>
......@@ -406,8 +411,9 @@
prop="isPay"
>
<el-select
v-model="addLessonForm.isPay"
v-model="form.isPay"
filterable
placeholder="请选择开课类型"
style="width: 400px"
>
<el-option
......@@ -430,9 +436,9 @@
prop="remarks"
>
<el-input
v-model="addLessonForm.remarks"
v-model="form.remarks"
style="width: 1100px"
placeholder="备注"
placeholder="请输入备注"
clearable
:maxlength="30"
size="small"
......@@ -450,6 +456,7 @@
<el-table ref="multipleTable" class="DBXXClass" border :data="lessonList" :row-key="getRoKey" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
:reserve-selection="true"
/>
<el-table-column
......@@ -457,7 +464,6 @@
type="index"
width="70"
align="center"
:reserve-selection="true"
/>
<el-table-column label="课程名称" prop="lessonName" show-overflow-tooltip>
<template slot-scope="scope">
......@@ -466,43 +472,45 @@
</el-table-column>
<el-table-column label="开课单位" prop="applicantUnit" show-overflow-tooltip>
{{ getUnitName(queryLessonParams.applicantUnit) }}
{{ getUnitName(form.applicantUnit) }}
</el-table-column>
<el-table-column label="课程类型" prop="lessonType" show-overflow-tooltip>
{{ queryLessonParams.lessonType === '0' ? '企业课程' : '院校课程' }}
{{ form.lessonType === '0' ? '企业课程' : '院校课程' }}
</el-table-column>
<el-table-column label="课程方案" prop="class" show-overflow-tooltip>
<el-table-column label="课程方案" prop="classPlan" show-overflow-tooltip>
{{ getClassPlanName(queryLessonParams.classPlan) }}
{{ getClassPlanName(form.classPlan) }}
</el-table-column>
<el-table-column label="难度等级" prop="class" show-overflow-tooltip>
<el-table-column label="难度等级" prop="difficultyClassify" show-overflow-tooltip>
{{ getDifficultyLevelName(queryLessonParams.difficultyClassify) }}
<template slot-scope="scope">
{{ getDifficultyLevelName(scope.row.difficultyClassify) }}
</template>
</el-table-column>
<el-table-column label="开始日期" prop="createTime" show-overflow-tooltip>
<el-table-column label="开始日期" prop="beginDate" show-overflow-tooltip>
<template>
{{ addLessonForm.beginDate }}
{{ form.beginDate }}
</template>
</el-table-column>
<el-table-column label="结束日期" prop="endTime" show-overflow-tooltip>
<el-table-column label="结束日期" prop="endDate" show-overflow-tooltip>
<template>
{{ addLessonForm.endDate }}
{{ form.endDate }}
</template>
</el-table-column>
<el-table-column label="开课类型" prop="isPay" :show-overflow-tooltip="true">
{{ addLessonForm.isPay === 0 ? '试用' : '付费' }}
{{ form.isPay === 0 ? '试用' : '付费' }}
</el-table-column>
<el-table-column label="备注" prop="remarks" show-overflow-tooltip>
<template>
{{ addLessonForm.remarks }}
{{ form.remarks }}
</template>
</el-table-column>
......@@ -512,7 +520,7 @@
:total="total1"
:page.sync="queryLessonParams.page"
:limit.sync="queryLessonParams.rows"
@pagination="handleLessonQuery"
@pagination="handleLessonQueryPage"
/>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="handleClose">取 消</el-button>
......@@ -892,6 +900,20 @@ export default {
dicts: ['tec_classify', 'job_classify'],
data() {
return {
pickerOptions: {
disabledDate: (time) => {
if (this.form.beginDate) {
return time.getTime() <= new Date(this.form.beginDate).getTime()
}
}
},
pickerOptionsBegin: {
disabledDate: (time) => {
if (this.form.endDate) {
return time.getTime() >= new Date(this.form.endDate).getTime()
}
}
},
total1: 0,
lessonList: [],
difficultyOptions: [],
......@@ -1061,7 +1083,26 @@ export default {
},
deptOptions: [],
rules: {}
rules: {
applicantUnit: [
{ required: true, message: '请选择开课单位' }
],
lessonType: [
{ required: true, message: '请选择课程类型' }
],
classPlan: [
{ required: true, message: '请选择课程方案' }
],
beginDate: [
{ required: true, message: '请选择开始时间', trigger: 'change' }
],
endDate: [
{ required: true, message: '请选择结束时间', trigger: 'change' }
],
isPay: [
{ required: true, message: '请选择开课类型' }
]
}
}
},
computed: {
......@@ -1110,7 +1151,7 @@ export default {
console.log(this.multipleSelection)
},
getRoKey(row) {
return row.id
return row.businessId
},
// 获取课程类型
getLessonType() {
......@@ -1211,35 +1252,42 @@ export default {
/** 查找可以开课的课程*/
handleLessonQuery() {
this.$refs.lessonRef.validate(valid => {
if (valid) {
const query = {
page: 1,
rows: 10,
applicantUnit: this.queryLessonParams.applicantUnit,
classPlan: this.queryLessonParams.classPlan,
lessonType: this.queryLessonParams.lessonType,
applicantUnit: this.form.applicantUnit,
classPlan: this.form.classPlan,
lessonType: this.form.lessonType,
applicantType: '2',
difficultyClassify: this.queryLessonParams.difficultyClassify
difficultyClassify: this.form.difficultyClassify
}
queryBLessonWithTrial(query).then(res => {
this.lessonList = res.rows
this.lessonList = res.records
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)
}
})
},
handleLessonQueryPage() {
this.$refs.lessonRef.validate(valid => {
if (valid) {
const query = {
page: this.queryLessonParams.page,
rows: this.queryLessonParams.rows,
applicantUnit: this.form.applicantUnit,
classPlan: this.form.classPlan,
lessonType: this.form.lessonType,
applicantType: '2',
difficultyClassify: this.form.difficultyClassify
}
queryBLessonWithTrial(query).then(res => {
this.lessonList = res.records
this.total1 = res.total
})
}
})
},
/** 3.当用户选中单位时将单位选择框禁用**/
handleUnitChange(value) {
......@@ -1277,28 +1325,25 @@ export default {
},
handleLessonClear() {
this.resetQueryLesson()
this.resetAddLessonForm()
},
resetAddLessonForm() {
this.addLessonForm = {
this.form = {
unitId: '',
unitName: '',
applicant: '',
lessonId: '',
lessonName: '',
beginDate: null,
endDate: null
endDate: null,
isPay: '',
jobClassification: '',
technicalClassification: '',
remarks: ''
}
this.lessonList = []
this.total1 = 0
this.resetQueryLesson()
},
resetQueryLesson() {
this.queryLessonParams = {
coursePlan: '',
lessonType: ''
}
this.form.settingList = []
this.$refs.lessonRef.resetFields()
this.total1 = 0
this.lessonList = []
},
/** 5.关闭时请表单想和列表数据清空**/
handleClose() {
......@@ -1312,15 +1357,10 @@ export default {
},
/** 6.重置方法**/
resetAddFrom() {
this.addForm = {
unitId: '',
unitName: '',
lessonId: '',
lessonName: '',
beginDate: null,
endDate: null
}
this.form.settingList = []
this.$refs.lessonRef.resetFields()
this.total1 = 0
this.lessonList = []
this.multipleSelection = []
},
/** 7.当课程有值是将课程label查询*/
handleLessonChange(value) {
......@@ -1551,17 +1591,21 @@ export default {
/** 提交按钮 */
submitForm: function() {
if (this.multipleSelection.length === 0) {
return this.$message.error('请选择课程')
}
console.log('提交')
const form = this.multipleSelection
form.forEach(item => {
item.applicantUnit = this.queryLessonParams.applicantUnit
item.applicantUnit = this.form.applicantUnit
item.lessonId = item.businessId
item.remarks = this.addLessonForm.remarks
item.remarks = this.form.remarks
item.applicantType = 2
item.isPay = this.addLessonForm.isPay
item.beginTrialTime = this.addLessonForm.beginDate
item.endTrialTime = this.addLessonForm.endDate
item.isPay = this.form.isPay
item.beginTrialTime = this.form.beginDate
item.endTrialTime = this.form.endDate
item.businessId = null
item.tecClassify = null
item.flag = '0'
item.jobClassification = item.jobClassify
item.technicalClassification = item.tecClassify
......@@ -1570,7 +1614,7 @@ export default {
const addForm = {
settingList: form,
applicantUnit: this.addLessonForm.applicantUnit,
applicantUnit: this.form.applicantUnit,
applicantType: 2
}
batchAddTeaTrialCourse(addForm).then(res => {
......@@ -1580,6 +1624,8 @@ export default {
this.open1 = false
this.getList()
this.$message.success('添加成功')
} else {
this.$message.error(res.message)
}
})
......
......@@ -1269,8 +1269,14 @@ export default {
}
findVideoUrl(params).then(res => {
// this.playerOptions.sources[0].src = 'http://vjs.zencdn.net/v/oceans.mp4'
if (res.data) {
this.videoList = res.data.ossInfoList[0] === null ? [] : res.data.ossInfoList
}
if (res.data) {
this.playerOptions.sources[0].src = urlDecrypt(res.data.videoUrl)
} else {
this.playerOptions.sources[0].src = urlDecrypt(null)
}
console.log('111111', urlDecrypt(res.data.videoUrl))
})
this.firstUpload = false
......
......@@ -52,7 +52,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="form.lessonType === '0'" label="课程方案:" prop="classPlan" :rules="[{ required: status !== '3', message: '请选择课程方案', trigger: 'change' }]">
<el-form-item label="课程方案:" prop="classPlan" :rules="[{ required: status !== '3', message: '请选择课程方案', trigger: 'change' }]">
<el-select
v-model="form.classPlan"
filterable
......@@ -60,7 +60,7 @@
class="normalSelct"
>
<el-option
v-for="(items,index) in coursePlanOptions"
v-for="(items,index) in form.lessonType === '0' ?coursePlanOptions : coursePlanOptionsC"
:key="index"
:label="items.dictLabel"
:value="items.dictValue"
......@@ -68,21 +68,6 @@
</el-select>
</el-form-item>
<el-form-item v-else label="课程方案:" prop="classPlan" :rules="[{ required: status !== '3', message: '请选择课程方案', trigger: 'change' }]">
<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-row>
......
......@@ -602,7 +602,8 @@
prop="applicant"
>
<el-select
v-model="queryLessonParams.applicant"
v-model="form.applicant"
placeholder="请选择申请人"
filterable
style="width: 400px"
>
......@@ -622,9 +623,10 @@
prop="lessonType"
>
<el-select
v-model="queryLessonParams.lessonType"
v-model="form.lessonType"
filterable
style="width: 400px"
placeholder="请选择课程类型"
@change="handleLessonTypeChange"
>
<el-option
......@@ -645,9 +647,10 @@
prop="classPlan"
>
<el-select
v-model="queryLessonParams.classPlan"
v-model="form.classPlan"
filterable
style="width: 400px"
placeholder="请选择课程方案"
>
<el-option
v-for="item in coursePlanOptions"
......@@ -660,7 +663,7 @@
</div>
<div>
<el-form-item label="难度等级" prop="difficultyClassify">
<el-select v-model="queryLessonParams.difficultyClassify" placeholder="难度等级" clearable style="width: 400px">
<el-select v-model="form.difficultyClassify" placeholder="请选择难度等级" clearable style="width: 400px">
<el-option
v-for="item in difficultyOptions"
:key="item.dictValue"
......@@ -678,17 +681,18 @@
<div>
<el-form-item
label="开始时间"
prop="createTime"
prop="beginDate"
>
<span>
<el-date-picker
v-model="addLessonForm.beginDate"
v-model="form.beginDate"
style="width: 400px"
type="date"
placeholder="-"
placeholder="请选择开始时间"
:editable="false"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
:picker-options="pickerOptionsBegin"
/>
</span>
</el-form-item>
......@@ -696,17 +700,18 @@
<div>
<el-form-item
label="结束时间"
prop="endTime"
prop="endDate"
>
<span>
<el-date-picker
v-model="addLessonForm.endDate"
v-model="form.endDate"
style="width: 400px"
type="date"
placeholder="-"
placeholder="请选择结束时间"
:editable="false"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
/>
</span>
</el-form-item>
......@@ -720,8 +725,9 @@
prop="isPay"
>
<el-select
v-model="addLessonForm.isPay"
v-model="form.isPay"
filterable
placeholder="请选择开课类型"
style="width: 400px"
>
<el-option
......@@ -744,9 +750,9 @@
prop="remarks"
>
<el-input
v-model="addLessonForm.remarks"
v-model="form.remarks"
style="width: 1100px"
placeholder="备注"
placeholder="请输入备注"
clearable
:maxlength="30"
size="small"
......@@ -764,6 +770,7 @@
<el-table ref="multipleTable" class="DBXXClass" border :data="lessonList" :row-key="getRoKey" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
reserve-selection
/>
<el-table-column
......@@ -771,7 +778,6 @@
type="index"
width="70"
align="center"
:reserve-selection="true"
/>
<el-table-column label="开课名称" prop="lessonName" show-overflow-tooltip>
<template slot-scope="scope">
......@@ -780,43 +786,46 @@
</el-table-column>
<el-table-column label="申请人" prop="applicantUnit" show-overflow-tooltip>
{{ getUserName(queryLessonParams.applicant) || '-' }}
{{ getUserName(form.applicant) || '-' }}
</el-table-column>
<el-table-column label="课程类型" prop="lessonType" show-overflow-tooltip>
{{ queryLessonParams.lessonType === '0' ? '企业课程' : '院校课程' }}
{{ form.lessonType === '0' ? '企业课程' : '院校课程' }}
</el-table-column>
<el-table-column label="课程方案" prop="class" show-overflow-tooltip>
{{ getClassPlanName(queryLessonParams.classPlan) }}
{{ getClassPlanName(form.classPlan) }}
</el-table-column>
<el-table-column label="难度等级" prop="class" show-overflow-tooltip>
{{ getDifficultyLevelName(queryLessonParams.difficultyClassify) }}
<!-- {{ getDifficultyLevelName(form.difficultyClassify) }}-->
<template slot-scope="scope">
{{ getDifficultyLevelName(scope.row.difficultyClassify) }}
</template>
</el-table-column>
<el-table-column label="开始日期" prop="createTime" show-overflow-tooltip>
<template>
{{ addLessonForm.beginDate }}
{{ form.beginDate }}
</template>
</el-table-column>
<el-table-column label="结束日期" prop="endTime" show-overflow-tooltip>
<template>
{{ addLessonForm.endDate }}
{{ form.endDate }}
</template>
</el-table-column>
<el-table-column label="开课类型" prop="isPay" :show-overflow-tooltip="true">
{{ addLessonForm.isPay === 0 ? '试用' : '付费' }}
{{ form.isPay === 0 ? '试用' : '付费' }}
</el-table-column>
<el-table-column label="备注" prop="remarks" show-overflow-tooltip>
<template>
{{ addLessonForm.remarks }}
{{ form.remarks }}
</template>
</el-table-column>
......@@ -826,7 +835,7 @@
:total="total1"
:page.sync="queryLessonParams.page"
:limit.sync="queryLessonParams.rows"
@pagination="handleLessonQuery"
@pagination="handleLessonPage"
/>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="handleClose">取 消</el-button>
......@@ -858,6 +867,20 @@ export default {
name: 'TryoutApplication',
data() {
return {
pickerOptions: {
disabledDate: (time) => {
if (this.form.beginDate) {
return time.getTime() <= new Date(this.form.beginDate).getTime()
}
}
},
pickerOptionsBegin: {
disabledDate: (time) => {
if (this.form.endDate) {
return time.getTime() >= new Date(this.form.endDate).getTime()
}
}
},
total1: 0,
lessonList: [],
// 查询参数
......@@ -877,6 +900,7 @@ export default {
difficultyOptions: [],
lessonTypeOptions: [],
coursePlanOptions: [],
multipleSelection: [],
coursePlanOptionsC: [],
addLessonForm: {
applicant: '',
......@@ -901,7 +925,24 @@ export default {
dialogVisible: false,
// 表单验证
rules: {
applicant: [
{ required: true, message: '请选择申请人' }
],
lessonType: [
{ required: true, message: '请选择课程类型' }
],
classPlan: [
{ required: true, message: '请选择课程方案' }
],
beginDate: [
{ required: true, message: '请选择开始时间', trigger: 'change' }
],
endDate: [
{ required: true, message: '请选择结束时间', trigger: 'change' }
],
isPay: [
{ required: true, message: '请选择开课类型' }
]
},
tableData: [],
valueOptions: [
......@@ -916,6 +957,7 @@ export default {
},
// 表单参数
form: {
applicant: null,
settingList: []
},
open: false,
......@@ -992,6 +1034,15 @@ export default {
this.getDifficultyLevel()
},
methods: {
handleStartDateChange(value) {
if (this.addLessonForm.endDate) {
const startDate = new Date(value).getTime()
const endDate = new Date(this.addLessonForm.endDate).getTime()
if (startDate > endDate) {
this.addLessonForm.endDate = value
}
}
},
// 获取难度等级
getDifficultyLevel() {
getDict('difficulty_grade').then(res => {
......@@ -1024,11 +1075,10 @@ export default {
console.log(this.multipleSelection)
},
getRoKey(row) {
return row.id
return row.businessId
},
handleLessonClear() {
this.resetQueryLesson()
this.resetAddLessonForm()
},
resetAddLessonForm() {
this.addLessonForm = {
......@@ -1044,11 +1094,9 @@ export default {
},
resetQueryLesson() {
this.queryLessonParams = {
coursePlan: '',
lessonType: ''
}
this.form.settingList = []
this.$refs.lessonRef.resetFields()
this.total1 = 0
this.lessonList = []
},
getLessonType() {
getDict('lesson_type').then(res => {
......@@ -1058,23 +1106,41 @@ export default {
},
/** 查找可以开课的课程*/
handleLessonQuery() {
this.$refs.lessonRef.validate(valid => {
if (valid) {
const query = {
page: 1,
rows: 10,
applicant: this.queryLessonParams.applicant,
classPlan: this.queryLessonParams.classPlan,
lessonType: this.queryLessonParams.lessonType,
applicant: this.form.applicant,
classPlan: this.form.classPlan,
lessonType: this.form.lessonType,
applicantType: '1',
difficultyClassify: this.queryLessonParams.difficultyClassify
difficultyClassify: this.form.difficultyClassify
}
console.log(query)
queryBLessonWithTrial(query).then(res => {
this.lessonList = res.rows
this.lessonList = res.records
this.total1 = res.total
})
}
})
},
handleLessonPage() {
this.$refs.lessonRef.validate(valid => {
if (valid) {
const query = {
page: this.queryLessonParams.page,
rows: this.queryLessonParams.rows,
applicant: this.form.applicant,
classPlan: this.form.classPlan,
lessonType: this.form.lessonType,
applicantType: '1',
difficultyClassify: this.form.difficultyClassify
}
queryBLessonWithTrial(query).then(res => {
this.lessonList = res.records
this.total1 = res.total
console.log(res)
console.log(this.lessonList)
})
}
})
},
/** 处理课程类型变化*/
......@@ -1146,7 +1212,6 @@ export default {
/** 5.关闭时请表单想和列表数据清空**/
handleClose() {
this.resetAddFrom()
this.handleLessonClear()
this.open = false
this.open1 = false
this.$nextTick().then(() => {
......@@ -1484,26 +1549,28 @@ export default {
},
/** 提交按钮 */
submitForm: function() {
if (this.multipleSelection.length === 0) {
return this.$message.error('请选择课程')
}
console.log('提交')
const form = this.multipleSelection
form.forEach(item => {
item.applicant = this.queryLessonParams.applicant
item.applicant = this.form.applicant
item.lessonId = item.businessId
item.remarks = this.addLessonForm.remarks
item.remarks = this.form.remarks
item.applicantType = 1
item.isPay = this.addLessonForm.isPay
item.beginTrialTime = this.addLessonForm.beginDate
item.endTrialTime = this.addLessonForm.endDate
item.isPay = this.form.isPay
item.beginTrialTime = this.form.beginDate
item.endTrialTime = this.form.endDate
item.businessId = null
item.tecClassify = null
item.flag = '0'
item.jobClassification = item.jobClassify
item.technicalClassification = item.tecClassify
})
console.log(form)
const addForm = {
settingList: form,
applicant: this.addLessonForm.applicant,
applicant: this.form.applicant,
applicantType: 1
}
batchAddTeaTrialCourse(addForm).then(res => {
......@@ -1513,6 +1580,8 @@ export default {
this.open1 = false
this.loadData()
this.$message.success('添加成功')
} else {
this.$message.error(res.message)
}
})
......@@ -1551,9 +1620,10 @@ export default {
},
/** 6.重置方法**/
resetAddFrom() {
this.addForm = {
this.form = {
unitId: '',
unitName: '',
applicant: '',
lessonId: '',
lessonName: '',
beginDate: null,
......@@ -1564,6 +1634,9 @@ export default {
remarks: ''
}
this.form.settingList = []
this.lessonList = []
this.multipleSelection = []
this.total1 = 0
}
}
......
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