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

开课管理新增修改

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