Commit 701e0bba authored by 王飞龙's avatar 王飞龙

开课管理新增修改

parent 7d4201c8
...@@ -428,17 +428,17 @@ ...@@ -428,17 +428,17 @@
width="50" width="50"
align="center" align="center"
/> />
<el-table-column label="单位" prop="applicantUnit"> <el-table-column label="单位" prop="applicantUnit" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
{{ getUnitName(scope.row.applicantUnit) || '-' }} {{ getUnitName(scope.row.applicantUnit) || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="课程" prop="class"> <el-table-column label="课程" prop="class" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.lessonName || '-' }} {{ scope.row.lessonName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="开始日期" prop="createTime"> <el-table-column label="开始日期" prop="createTime" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.flag === '0'">{{ scope.row.beginTrialTime || '-' }}</span> <span v-if="scope.row.flag === '0'">{{ scope.row.beginTrialTime || '-' }}</span>
<el-date-picker <el-date-picker
...@@ -452,7 +452,7 @@ ...@@ -452,7 +452,7 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结束日期" prop="endTime"> <el-table-column label="结束日期" prop="endTime" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.flag === '0'">{{ scope.row.endTrialTime || '-' }}</span> <span v-if="scope.row.flag === '0'">{{ scope.row.endTrialTime || '-' }}</span>
<el-date-picker <el-date-picker
...@@ -466,7 +466,7 @@ ...@@ -466,7 +466,7 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="开课类型" prop="isPay"> <el-table-column label="开课类型" prop="isPay" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- {{ scope.row.isPay === 0 ? '试用' : '付费' }}--> <!-- {{ scope.row.isPay === 0 ? '试用' : '付费' }}-->
<span v-if="scope.row.flag === '0'">{{ scope.row.isPay === 0 ? '试用' : '付费' }}</span> <span v-if="scope.row.flag === '0'">{{ scope.row.isPay === 0 ? '试用' : '付费' }}</span>
...@@ -485,7 +485,7 @@ ...@@ -485,7 +485,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="岗位分类" prop="jobClassification"> <el-table-column label="岗位分类" prop="jobClassification" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- {{ getJobClassificationName(scope.row.jobClassification) || '-' }}--> <!-- {{ getJobClassificationName(scope.row.jobClassification) || '-' }}-->
<span v-if="scope.row.flag === '0'"> {{ getJobClassificationName(scope.row.jobClassification) || '-' }}</span> <span v-if="scope.row.flag === '0'"> {{ getJobClassificationName(scope.row.jobClassification) || '-' }}</span>
...@@ -504,7 +504,7 @@ ...@@ -504,7 +504,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="技术分类" prop="teDirection"> <el-table-column label="技术分类" prop="teDirection" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- {{ getCourseDirectionName(scope.row.technicalClassification) || '-' }}--> <!-- {{ getCourseDirectionName(scope.row.technicalClassification) || '-' }}-->
<span v-if="scope.row.flag === '0'"> {{ getCourseDirectionName(scope.row.technicalClassification) || '-' }}</span> <span v-if="scope.row.flag === '0'"> {{ getCourseDirectionName(scope.row.technicalClassification) || '-' }}</span>
...@@ -523,7 +523,7 @@ ...@@ -523,7 +523,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" prop="remarks"> <el-table-column label="备注" prop="remarks" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- {{ scope.row.remarks || '-' }}--> <!-- {{ scope.row.remarks || '-' }}-->
<span v-if="scope.row.flag === '0'"> {{ scope.row.remarks || '-' }}</span> <span v-if="scope.row.flag === '0'"> {{ scope.row.remarks || '-' }}</span>
...@@ -729,7 +729,6 @@ export default { ...@@ -729,7 +729,6 @@ export default {
this.getJobClassification() this.getJobClassification()
}, },
methods: { methods: {
// 获取课程方向
/** 1.获取全部单位**/ /** 1.获取全部单位**/
getUnitOptions() { getUnitOptions() {
const obj = { const obj = {
...@@ -808,7 +807,8 @@ export default { ...@@ -808,7 +807,8 @@ export default {
this.addForm.unitName = null this.addForm.unitName = null
} }
const obj = { const obj = {
applicantUnit: value applicantUnit: value,
applicantType: 2
} }
listALLTeaTrialCourse(obj).then(res => { listALLTeaTrialCourse(obj).then(res => {
console.log('res', res) console.log('res', res)
...@@ -886,7 +886,7 @@ export default { ...@@ -886,7 +886,7 @@ export default {
} }
this.form.settingList.push(obj) this.form.settingList.push(obj)
} else { } else {
return this.$message.error('和列表中数据是否重复') return this.$message.error('列表中已申请该课程')
} }
} }
}) })
...@@ -920,7 +920,7 @@ export default { ...@@ -920,7 +920,7 @@ export default {
console.log('数组中的数据', list) console.log('数组中的数据', list)
console.log('对象', this.addForm) console.log('对象', this.addForm)
list.forEach(item => { list.forEach(item => {
if (item.unitId === this.addForm.unitId && item.lessonId === this.addForm.lessonId) { if (item.applicantUnit === this.addForm.applicantUnit && item.lessonId === this.addForm.lessonId) {
b = true b = true
} }
}) })
...@@ -1036,8 +1036,21 @@ export default { ...@@ -1036,8 +1036,21 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
if (this.form.settingList.length > 0) { 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.form', this.form)
batchAddTeaTrialCourse(this.form).then(res => { 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()
......
...@@ -570,7 +570,7 @@ import { delApplicationTrial, listApplicationTrial } from '@/api/try/application ...@@ -570,7 +570,7 @@ import { delApplicationTrial, listApplicationTrial } from '@/api/try/application
import { delSysContentNewsInformation } from '@/api/contentManagement/sysContentNewsInformation' import { delSysContentNewsInformation } from '@/api/contentManagement/sysContentNewsInformation'
import { import {
batchAddTeaTrialCourse, batchAddTeaTrialCourse,
delTeaTrialCourse, delTeaTrialCourse, listALLTeaTrialCourse,
listTeaTrialCourse, listTeaTrialCourse,
updateTeaTrialCourse updateTeaTrialCourse
} from '@/api/try/teaTrialCourse' } from '@/api/try/teaTrialCourse'
...@@ -736,7 +736,7 @@ export default { ...@@ -736,7 +736,7 @@ export default {
} }
} }
}, },
/** 3.当用户选中单位时将单位选择框禁用**/ /** 3.当用户选中申请人时将单位选择框禁用**/
handleUnitChange(value) { handleUnitChange(value) {
if (value && value !== '' && value !== undefined) { if (value && value !== '' && value !== undefined) {
this.unitDisplay = true this.unitDisplay = true
...@@ -745,14 +745,15 @@ export default { ...@@ -745,14 +745,15 @@ export default {
* 2.根据value值查询该单位所开的课程 * 2.根据value值查询该单位所开的课程
**/ **/
if (this.userOptions.find(item => item.businessId === value)) { if (this.userOptions.find(item => item.businessId === value)) {
this.addForm.unitName = this.userOptions.find(item => item.businessId === value).unitName this.addForm.nickName = this.userOptions.find(item => item.businessId === value).nickName
} else { } else {
this.addForm.unitName = null this.addForm.nickName = null
} }
const obj = { const obj = {
unitId: value applicant: value,
applicantType: 1
} }
queryOpenCourseByUnit(obj).then(res => { listALLTeaTrialCourse(obj).then(res => {
console.log('res', res) console.log('res', res)
if (res.code === 200) { if (res.code === 200) {
this.form.settingList = res.data this.form.settingList = res.data
...@@ -760,7 +761,7 @@ export default { ...@@ -760,7 +761,7 @@ export default {
}) })
} else { } else {
this.unitDisplay = false this.unitDisplay = false
this.addForm.unitName = null this.addForm.nickName = null
this.form.settingList = [] this.form.settingList = []
} }
}, },
...@@ -926,7 +927,7 @@ export default { ...@@ -926,7 +927,7 @@ export default {
} }
this.form.settingList.push(obj) this.form.settingList.push(obj)
} else { } else {
return this.$message.error('和列表中数据是否重复') return this.$message.error('列表中已申请该课程')
} }
} }
}) })
...@@ -1029,8 +1030,20 @@ export default { ...@@ -1029,8 +1030,20 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
if (this.form.settingList.length > 0) { 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) console.log('this.form', this.form)
batchAddTeaTrialCourse(this.form).then(res => { batchAddTeaTrialCourse(form).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.resetAddFrom() this.resetAddFrom()
this.open = false this.open = false
......
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