Commit cc4925b6 authored by FangYuePeng's avatar FangYuePeng

Merge remote-tracking branch 'origin/1.0' into 1.0

parents fd61eb08 4ecee3e9
......@@ -66,3 +66,13 @@ export function exportTeaTrialCourse(query) {
responseType: 'blob'
})
}
export function batchAddTeaTrialCourse(data) {
return request({
url: '/teatrialcourse/batchAdd',
method: 'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
})
}
......@@ -109,7 +109,21 @@
<!-- 开课类型-->
<el-table-column label="开课类型" prop="isPay" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.isPay === 0 ? '试用' : '付费' }}
<!-- {{ scope.row.isPay === 0 ? '试用' : '付费' }}-->
<span v-if="scope.row.flag === '0'">{{ scope.row.isPay === 0 ? '试用' : '付费' }}</span>
<el-select
v-if="scope.row.flag === '1'"
v-model="scope.row.isPay"
filterable
style="width: 160px"
>
<el-option
v-for="(items,index) in isPayList"
:key="index"
:label="items.label"
:value="items.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="单位名称" prop="applicantUnitName" :show-overflow-tooltip="true">
......@@ -124,12 +138,38 @@
</el-table-column>
<el-table-column label="岗位分类" prop="jobClassification" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ getJobClassificationName(scope.row.jobClassification) || '-' }}
<span v-if="scope.row.flag === '0'"> {{ getJobClassificationName(scope.row.jobClassification) || '-' }}</span>
<el-select
v-if="scope.row.flag === '1'"
v-model="scope.row.jobClassification"
filterable
style="width: 160px"
>
<el-option
v-for="(items,index) in valueOptions"
:key="index"
:label="items.dictLabel"
:value="items.dictValue"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="技术分类" prop="value" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ getCourseDirectionName(scope.row.technicalClassification) || '-' }}
<span v-if="scope.row.flag === '0'"> {{ getCourseDirectionName(scope.row.technicalClassification) || '-' }}</span>
<el-select
v-if="scope.row.flag === '1'"
v-model="scope.row.technicalClassification"
filterable
style="width: 160px"
>
<el-option
v-for="(items,index) in courseDirection"
:key="index"
:label="items.dictLabel"
:value="items.dictValue"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="开始日期" prop="value2" :show-overflow-tooltip="true">
......@@ -163,8 +203,16 @@
<!-- 备注-->
<el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.remarks || '-' }}
</template>
<span v-if="scope.row.flag === '0'"> {{ scope.row.remarks || '-' }}</span>
<el-input
v-if="scope.row.flag === '1'"
v-model="scope.row.remarks"
placeholder="备注"
clearable
:maxlength="30"
size="small"
/>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="200px">
<template slot-scope="scope">
......@@ -216,10 +264,10 @@
<div>
<el-form-item
label="单位"
prop="unit"
prop="applicantUnit"
>
<el-select
v-model="addForm.unitId"
v-model="addForm.applicantUnit"
:disabled="unitDisplay"
filterable
style="width: 160px"
......@@ -390,10 +438,10 @@
</el-table-column>
<el-table-column label="开始日期" prop="createTime">
<template slot-scope="scope">
<span v-if="scope.row.flag === '0'">{{ scope.row.beginDate || '-' }}</span>
<span v-if="scope.row.flag === '0'">{{ scope.row.beginTrialTime || '-' }}</span>
<el-date-picker
v-if="scope.row.flag === '1'"
v-model="scope.row.beginDate"
v-model="scope.row.beginTrialTime"
type="date"
placeholder="-"
:editable="false"
......@@ -404,10 +452,10 @@
</el-table-column>
<el-table-column label="结束日期" prop="endTime">
<template slot-scope="scope">
<span v-if="scope.row.flag === '0'">{{ scope.row.endDate || '-' }}</span>
<span v-if="scope.row.flag === '0'">{{ scope.row.endTrialTime || '-' }}</span>
<el-date-picker
v-if="scope.row.flag === '1'"
v-model="scope.row.endDate"
v-model="scope.row.endTrialTime"
type="date"
placeholder="-"
:editable="false"
......@@ -472,17 +520,20 @@
</template>
<script>
import { getDataCache, setDataCache } from '@/assets/js/filterData'
import commonField from '@/utils/commonField'
import {
batchAddUnitLesson,
deleteUnitLesson,
queryOpenCourseByUnit,
update,
validOpenCourse
} from '@/api/classManagement'
import { listCourseAll, listUnitAll } from '@/api/sysUnit'
import { listTeaTrialCourse } from '@/api/try/teaTrialCourse'
import {
batchAddTeaTrialCourse,
delTeaTrialCourse,
listTeaTrialCourse,
updateTeaTrialCourse
} from '@/api/try/teaTrialCourse'
import dict from '@/views/system/dict/index.vue'
import { getDict } from '@/api/system/dict/data'
export default {
......@@ -574,7 +625,8 @@ export default {
jobClassification: '',
technicalClassification: '',
beginTrialTime: '',
endTrialTime: ''
endTrialTime: '',
applicantType: 1
},
// 开课类型list
isPayList: [
......@@ -610,15 +662,15 @@ export default {
return commonField
}
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
setDataCache(this.$route.path, this.queryParams)
next()
},
// /** 路由离开前存储筛选条件*/
// beforeRouteLeave(to, from, next) {
// setDataCache(this.$route.path, this.queryParams)
// next()
// },
created() {
this.getUnitOptions()
this.getClassOptions()
this.queryParams = JSON.parse(getDataCache(this.$route.path)) // 获取存储的筛选项
// this.queryParams = JSON.parse(getDataCache(this.$route.path)) // 获取存储的筛选项
this.getList() // 列表查询
this.getCourseDirection()
this.getJobClassification()
......@@ -744,9 +796,9 @@ export default {
/**
* 1.根据单位和课程验重
* **/
if (this.addForm.unitId && this.addForm.unitId !== '' && this.addForm.unitId !== undefined && this.addForm.lessonId && this.addForm.lessonId !== '' && this.addForm.lessonId !== undefined) {
if (this.addForm.applicantUnit && this.addForm.applicantUnit !== '' && this.addForm.applicantUnit !== undefined && this.addForm.lessonId && this.addForm.lessonId !== '' && this.addForm.lessonId !== undefined) {
const obj = {
unitId: this.addForm.unitId,
unitId: this.addForm.applicantUnit,
lessonId: this.addForm.lessonId
}
validOpenCourse(obj).then(res => {
......@@ -757,17 +809,17 @@ export default {
const obj = {
applyPost: null,
flag: '0',
beginDate: this.addForm.beginDate,
endDate: this.addForm.endDate,
beginTrialTime: this.addForm.beginDate,
endTrialTime: this.addForm.endDate,
lessonName: this.addForm.lessonName,
teDirection: null,
unitName: this.addForm.unitName,
unitId: this.addForm.unitId,
applicantUnit: this.addForm.applicantUnit,
lessonId: this.addForm.lessonId,
jobClassification: this.addForm.jobClassification,
technicalClassification: this.addForm.technicalClassification,
isPay: this.addForm.isPay,
remarks: this.addForm.remarks
remarks: this.addForm.remarks,
applicantType: 1
}
this.form.settingList.push(obj)
} else {
......@@ -776,7 +828,7 @@ export default {
}
})
} else {
if (!this.addForm.unitId || this.addForm.unitId === '' || this.addForm.unitId === undefined) {
if (!this.addForm.applicantUnit || this.addForm.applicantUnit === '' || this.addForm.applicantUnit === undefined) {
return this.$message.error('请选择单位')
}
if (!this.addForm.lessonId || this.addForm.lessonId === '' || this.addForm.lessonId === undefined) {
......@@ -912,12 +964,14 @@ export default {
handleSave(index) {
const obj = {
businessId: this.dateList[index].businessId,
unitId: this.dateList[index].unitId,
lessonId: this.dateList[index].lessonId,
beginDate: this.dateList[index].beginDate,
endDate: this.dateList[index].endDate
beginTrialTime: this.dateList[index].beginTrialTime,
endTrialTime: this.dateList[index].endTrialTime,
jobClassification: this.dateList[index].jobClassification,
technicalClassification: this.dateList[index].technicalClassification,
remarks: this.dateList[index].remarks,
isPay: this.dateList[index].isPay
}
update(obj).then(res => {
updateTeaTrialCourse(obj).then(res => {
if (res.code === 200) {
this.dateList[index].flag = '0'
this.$message.success('保存成功')
......@@ -928,28 +982,27 @@ export default {
/** 提交按钮 */
submitForm: function() {
if (this.form.settingList.length > 0) {
console.log('this.form.settingList', this.form.settingList)
// batchAddUnitLesson(this.form).then(res => {
// console.log('添加开课信息', res)
// if (res.code === 200) {
// this.resetAddFrom()
// this.open = false
// this.getList()
// }
// })
console.log('this.form', this.form)
batchAddTeaTrialCourse(this.form).then(res => {
console.log('添加开课信息', res)
if (res.code === 200) {
this.resetAddFrom()
this.open = false
this.getList()
}
})
} else {
return this.$message.error('请添加列表数据')
}
},
/** 删除按钮操作 */
handleDelete(row) {
const roleIds = row.businessId || this.ids
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return deleteUnitLesson(roleIds)
return delTeaTrialCourse(row.businessId)
}).then(() => {
this.getList()
this.$message({
......
......@@ -148,7 +148,7 @@
<el-form-item label="难度等级" prop="value2">
<el-select v-model="form.value2" placeholder="难度等级" clearable>
<el-option
v-for="item in value2Options"
v-for="item in valueOptions"
:key="item.value"
:label="item.label"
:value="item.value"
......
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