Commit 5cb30ea8 authored by 王飞龙's avatar 王飞龙

开课页面添加

parent d1720904
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询试用申请列表
export function listApplicationTrial(query) {
return request({
url: '/applicationtrial/queryApplicationTrialByPagination',
method: 'get',
params: query
})
}
// 2. 查询试用申请详细信息
export function getApplicationTrial(businessId) {
return request({
url: '/applicationtrial/detail/' + businessId,
method: 'get'
})
}
// 3. 新增试用申请
export function addApplicationTrial(data) {
data = Qs.stringify(data)
return request({
url: '/applicationtrial/add',
method: 'post',
data: data
})
}
// 4. 修改试用申请
export function updateApplicationTrial(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/applicationtrial/update/' + businessId,
method: 'put',
data
})
}
// 5. 逻辑删除试用申请
export function delApplicationTrial(businessId) {
return request({
url: '/applicationtrial/deleteLogical/' + businessId,
method: 'delete'
})
}
// 6. 导出试用申请
export function exportApplicationTrial(query) {
return request({
url: '/applicationtrial/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
......@@ -135,28 +135,6 @@
<span>{{ scope.row.nickName }}</span>
</template>
</el-table-column>
<!-- <el-table-column align="left" label="权重" prop="weight" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.weight }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="left" label="板块" prop="plate">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ changPlate (scope.row.plate) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="left" label="状态" prop="flag">-->
<!-- <template slot-scope="scope">-->
<!-- <el-switch-->
<!-- v-model="scope.row.flag"-->
<!-- class="switchDisabledStyle"-->
<!-- inactive-value="0"-->
<!-- active-value="1"-->
<!-- @click.native="handleStatusChange(scope.row)"-->
<!-- />-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="操作" width="150">
<template slot-scope="scope">
<el-button
......
......@@ -2,9 +2,20 @@
<div class="classManagement_module">
<div class="search" style="border-bottom: 14px solid #f4f4f4">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="单位名称" prop="unitName">
<!-- 开课类型-->
<el-form-item label="开课类型" prop="isPay">
<el-select v-model="queryParams.isPay" placeholder="开课类型" clearable>
<el-option
v-for="item in [{label:'试用',value:0},{label:'付费',value:1}]"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="单位名称" prop="applicantUnitName">
<el-input
v-model="queryParams.unitName"
v-model="queryParams.applicantUnitName"
placeholder="单位名称"
clearable
:maxlength="30"
......@@ -22,37 +33,37 @@
/>
</el-form-item>
<el-form-item label="岗位分类" prop="value">
<el-select v-model="queryParams.value" placeholder="岗位分类" clearable>
<el-select v-model="queryParams.jobClassification" placeholder="岗位分类" clearable>
<el-option
v-for="item in valueOptions"
:key="item.value"
:label="item.label"
:value="item.value"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="技术分类" prop="teDirection">
<el-select v-model="queryParams.teDirection" placeholder="技术分类" clearable>
<el-select v-model="queryParams.technicalClassification" placeholder="技术分类" clearable>
<el-option
v-for="item in courseDirection"
:key="item.value"
:label="item.label"
:value="item.value"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="开始日期" prop="beginDate">
<el-form-item label="开始日期" prop="beginTrialTime">
<el-date-picker
v-model="queryParams.beginDate"
v-model="queryParams.beginTrialTime"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="开始日期"
/>
</el-form-item>
<el-form-item label="结束日期" prop="endTime">
<el-form-item label="结束日期" prop="endTrialTime">
<el-date-picker
v-model="queryParams.endDate"
v-model="queryParams.endTrialTime"
value-format="yyyy-MM-dd"
size="small"
type="date"
......@@ -95,9 +106,15 @@
<div class="tableTitle">开课管理列表</div>
<el-table v-loading="loading" border :data="dateList">
<el-table-column type="index" label="序号" width="90" />
<el-table-column label="单位名称" prop="roleName" :show-overflow-tooltip="true">
<!-- 开课类型-->
<el-table-column label="开课类型" prop="isPay" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.unitName || '-' }}
{{ scope.row.isPay === 0 ? '试用' : '付费' }}
</template>
</el-table-column>
<el-table-column label="单位名称" prop="applicantUnitName" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.applicantUnitName || '-' }}
</template>
</el-table-column>
<el-table-column label="课程名称" prop="roleKey" :show-overflow-tooltip="true">
......@@ -105,22 +122,22 @@
{{ scope.row.lessonName || '-' }}
</template>
</el-table-column>
<el-table-column label="岗位分类" prop="roleSort" :show-overflow-tooltip="true">
<el-table-column label="岗位分类" prop="jobClassification" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>后端开发</span>
{{ getJobClassificationName(scope.row.jobClassification) || '-' }}
</template>
</el-table-column>
<el-table-column label="技术分类" prop="value" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.teDirection || '-' }}
{{ getCourseDirectionName(scope.row.technicalClassification) || '-' }}
</template>
</el-table-column>
<el-table-column label="开始日期" prop="value2" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.flag === '0'">{{ scope.row.beginDate |transformDateByFormat('YYYY-MM-DD') }}</span>
<span v-if="scope.row.flag === '0'">{{ scope.row.beginTrialTime |transformDateByFormat('YYYY-MM-DD') }}</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"
......@@ -131,10 +148,10 @@
</el-table-column>
<el-table-column label="结束日期" prop="value3" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.flag === '0'">{{ scope.row.endDate |transformDateByFormat('YYYY-MM-DD') }}</span>
<span v-if="scope.row.flag === '0'">{{ scope.row.endTrialTime |transformDateByFormat('YYYY-MM-DD') }}</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"
......@@ -143,6 +160,12 @@
/>
</template>
</el-table-column>
<!-- 备注-->
<el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.remarks || '-' }}
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="200px">
<template slot-scope="scope">
<!-- //修改-->
......@@ -269,7 +292,80 @@
</div>
<div />
</div>
<!-- </div>-->
<div style="display: flex;justify-content: space-between;align-items: center">
<div>
<el-form-item
label="开课类型"
prop="isPay"
>
<el-select
v-model="addForm.isPay"
filterable
style="width: 160px"
>
<el-option
v-for="(items,index) in isPayList"
:key="index"
:label="items.label"
:value="items.value"
/>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item
label="岗位分类"
prop="jobClassification"
>
<el-select
v-model="addForm.jobClassification"
filterable
style="width: 160px"
>
<el-option
v-for="(items,index) in valueOptions"
:key="index"
:label="items.dictLabel"
:value="items.dictValue"
/>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item
label="技术分类"
prop="teDirection"
>
<el-select
v-model="addForm.technicalClassification"
filterable
style="width: 160px"
>
<el-option
v-for="(items,index) in courseDirection"
:key="index"
:label="items.dictLabel"
:value="items.dictValue"
/>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item
label="备注"
prop="remarks"
>
<el-input
v-model="addForm.remarks"
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-plus" size="mini" @click="handleAddShift">新增</el-button>
......@@ -320,6 +416,26 @@
/>
</template>
</el-table-column>
<el-table-column label="开课类型" prop="isPay">
<template slot-scope="scope">
{{ scope.row.isPay === 0 ? '试用' : '付费' }}
</template>
</el-table-column>
<el-table-column label="岗位分类" prop="jobClassification">
<template slot-scope="scope">
{{ getJobClassificationName(scope.row.jobClassification) || '-' }}
</template>
</el-table-column>
<el-table-column label="技术分类" prop="teDirection">
<template slot-scope="scope">
{{ getCourseDirectionName(scope.row.technicalClassification) || '-' }}
</template>
</el-table-column>
<el-table-column label="备注" prop="remarks">
<template slot-scope="scope">
{{ scope.row.remarks || '-' }}
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -356,21 +472,22 @@
</template>
<script>
import { delRole } from '@/api/system/role'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
import commonField from '@/utils/commonField'
import { queryDirectionsList } from '@/api/courseManagement/indexApi'
import {
batchAddUnitLesson,
deleteUnitLesson,
listClass,
queryOpenCourseByUnit,
update,
validOpenCourse
} from '@/api/classManagement'
import { listCourseAll, listUnitAll } from '@/api/sysUnit'
import { listTeaTrialCourse } from '@/api/try/teaTrialCourse'
import dict from '@/views/system/dict/index.vue'
import { getDict } from '@/api/system/dict/data'
export default {
name: 'Role',
dicts: ['tec_classify', 'job_classify'],
data() {
return {
// 修改页面默认打开的树壮菜单
......@@ -446,19 +563,24 @@ export default {
// 部门列表
tOptions: [],
valueOptions: [
{ value: '1', label: '前端开发' },
{ value: '2', label: '后端开发' }
],
// 查询参数
queryParams: {
unitName: '',
lessonName: '',
teDirection: '',
beginDate: '',
endDate: '',
page: 1,
rows: 10
},
rows: 10,
isPay: '',
applicantUnitName: '',
lessonName: '',
jobClassification: '',
technicalClassification: '',
beginTrialTime: '',
endTrialTime: ''
},
// 开课类型list
isPayList: [
{ label: '试用', value: 0 },
{ label: '付费', value: 1 }
],
courseDirection: [],
addForm: {
unitId: '',
......@@ -481,6 +603,9 @@ export default {
}
},
computed: {
dict() {
return dict
},
commonField() {
return commonField
}
......@@ -496,6 +621,7 @@ export default {
this.queryParams = JSON.parse(getDataCache(this.$route.path)) // 获取存储的筛选项
this.getList() // 列表查询
this.getCourseDirection()
this.getJobClassification()
},
methods: {
// 获取课程方向
......@@ -508,6 +634,42 @@ export default {
this.unitOptions = res.data
})
},
// 获取岗位类型
getJobClassification() {
// const obj = {
// dictType: 'job_classify'
// }
getDict('job_classify').then(res => {
this.valueOptions = res.data
})
},
// 获取技术分类
getCourseDirection() {
getDict('tec_classify').then(res => {
this.courseDirection = res.data
})
},
// 根据岗位的id获取岗位的名称
getJobClassificationName(dictValue) {
let name = ''
this.valueOptions.forEach(item => {
if (item.dictValue === dictValue) {
name = item.dictLabel
}
})
return name
},
// 根据技术分类的id获取技术分类的名称
getCourseDirectionName(dictValue) {
let name = ''
this.courseDirection.forEach(item => {
if (item.dictValue === dictValue) {
name = item.dictLabel
}
})
return name
},
/** 2.获取全部课程 **/
getClassOptions() {
const obj = {
......@@ -601,7 +763,11 @@ export default {
teDirection: null,
unitName: this.addForm.unitName,
unitId: this.addForm.unitId,
lessonId: this.addForm.lessonId
lessonId: this.addForm.lessonId,
jobClassification: this.addForm.jobClassification,
technicalClassification: this.addForm.technicalClassification,
isPay: this.addForm.isPay,
remarks: this.addForm.remarks
}
this.form.settingList.push(obj)
} else {
......@@ -649,29 +815,29 @@ export default {
handleAddFromSave(index) {
this.form.settingList[index].flag = '0'
},
// 获取课程方向
getCourseDirection() {
const that = this
queryDirectionsList().then(res => {
for (let i = 0; i < res.data.length; i++) {
const obj = {}
obj.value = res.data[i].id
obj.label = res.data[i].text
that.courseDirection[i] = obj
}
}).catch((err) => {
that.$notify({
title: '失败',
message: '网络错误,课程方向获取失败',
type: 'error'
})
})
},
// // 获取课程方向
// getCourseDirection() {
// const that = this
// queryDirectionsList().then(res => {
// for (let i = 0; i < res.data.length; i++) {
// const obj = {}
// obj.value = res.data[i].id
// obj.label = res.data[i].text
// that.courseDirection[i] = obj
// }
// }).catch((err) => {
// that.$notify({
// title: '失败',
// message: '网络错误,课程方向获取失败',
// type: 'error'
// })
// })
// },
/** 查询开课列表 */
getList() {
this.loading = true
listClass(this.queryParams).then(response => {
listTeaTrialCourse(this.queryParams).then(response => {
this.dateList = response.rows
this.total = response.total
this.loading = false
......@@ -762,14 +928,15 @@ export default {
/** 提交按钮 */
submitForm: function() {
if (this.form.settingList.length > 0) {
batchAddUnitLesson(this.form).then(res => {
console.log('添加开课信息', res)
if (res.code === 200) {
this.resetAddFrom()
this.open = false
this.getList()
}
})
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()
// }
// })
} else {
return this.$message.error('请添加列表数据')
}
......
......@@ -85,22 +85,22 @@
@click="handleAdd"
>{{ commonField.addName }}</el-button>
<!-- //下载模板按钮-->
<el-button
:class="commonField.importClass"
:type="commonField.typeWarning"
:icon="commonField.importIcon"
:size="commonField.smallSize"
@click="exportmould"
>下载模板</el-button>
<!-- //导入按钮-->
<el-button
:class="commonField.importClass"
:type="commonField.typeWarning"
:icon="commonField.importIcon"
:size="commonField.smallSize"
@click="importmould"
>{{ commonField.importName }}</el-button>
<input id="btn_file" type="file" style="display:none" @change="fileupload">
<!-- <el-button-->
<!-- :class="commonField.importClass"-->
<!-- :type="commonField.typeWarning"-->
<!-- :icon="commonField.importIcon"-->
<!-- :size="commonField.smallSize"-->
<!-- @click="exportmould"-->
<!-- >下载模板</el-button>-->
<!-- &lt;!&ndash; //导入按钮&ndash;&gt;-->
<!-- <el-button-->
<!-- :class="commonField.importClass"-->
<!-- :type="commonField.typeWarning"-->
<!-- :icon="commonField.importIcon"-->
<!-- :size="commonField.smallSize"-->
<!-- @click="importmould"-->
<!-- >{{ commonField.importName }}</el-button>-->
<!-- <input id="btn_file" type="file" style="display:none" @change="fileupload">-->
</el-form-item>
</div>
</el-form>
......
<template>
<div>试用申请</div>
<!-- 中心案例管理 -->
<div id="courseManage">
<div v-show="showSwitch.courseContent" class="courseContent">
<div class="search" style="border-bottom: 14px solid #f4f4f4">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item>
<el-input v-model="queryParams.answerName" placeholder="请输入申请人姓名、登录名、手机号" clearable />
</el-form-item>
<!-- 处理单位-->
<el-form-item>
<el-input v-model="queryParams.applicantUnit" placeholder="请输入申请单位" clearable />
</el-form-item>
<!-- 状态-->
<el-form-item>
<el-select v-model="queryParams.flag" placeholder="请选择状处理状态" clearable>
<el-option label="未处理" value="0" />
<el-option label="已处理" value="1" />
</el-select>
</el-form-item>
<!-- 备注-->
<el-form-item>
<el-input v-model="queryParams.remarks" placeholder="请输入备注" clearable />
</el-form-item>
<el-form-item>
<!-- //查询按钮-->
<el-button
:class="commonField.queryClass"
:type="commonField.typePrimary"
:icon="commonField.queryIcon"
:size="commonField.smallSize"
@click="loadData"
>{{ commonField.queryName }}</el-button>
<!-- //重置按钮-->
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetQuery"
>{{ commonField.resetName }}</el-button>
</el-form-item>
<div style="float: right" />
</el-form>
</div>
<div style="padding:5px 10px">
<div class="tableTitle">试用申请管理</div>
<el-table v-loading="fullscreenLoading" :data="tableData" border sortable="true">
<span slot="empty">{{ tableDataTips }}</span>
<el-table-column align="left" prop="id" label="序号" width="55px">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column prop="userType" label="用户类型" show-overflow-tooltip />
<el-table-column prop="applicant" label="申请人">
<template slot-scope="scope">
{{ scope.row.applicantName }}
</template>
</el-table-column>
<el-table-column prop="applicantUnitName" label="申请单位" show-overflow-tooltip />
<el-table-column prop="phone" label="手机号" show-overflow-tooltip />
<el-table-column prop="aaa" label="申请课程">
<template slot-scope="scope">
{{ scope.row.aaa }}
</template>
</el-table-column>
<el-table-column prop="applicantTime" label="申请时间">
<template slot-scope="scope">
{{ replace(scope.row.applicantTime) }}
</template>
</el-table-column>
<el-table-column prop="flag" label="处理状态">
<template slot-scope="scope">
{{ statusChange(scope.row.flag) }}
<el-switch
v-model="scope.row.flag"
class="switchDisabledStyle"
inactive-value="0"
active-value="1"
@click.native="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column prop="remarks" label="备注" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button
:class="commonField.resetPasClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="removeCourse(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
/>
<footer />
</div>
<!-- 新建题型对话框-->
<el-dialog
title="试卷审批"
:visible.sync="dialogFormVisible"
width="55%"
>
<template>
<el-form ref="form" :model="form" label-width="20px" :rules="rules">
<div v-for="(item, index) in form" :key="index">
<el-row class="elClass">
<el-col :span="24">
<div>{{ index+1 +':' }}{{ item.title }}</div>
</el-col>
</el-row>
<el-row class="elClass">
<el-col :span="24">
<div>作答:
<span :style="{ color: item.isRight ? 'green' : 'red'}">
{{ item.answer }}</span></div>
</el-col>
</el-row>
<el-row class="elClass">
<el-col :span="24">
<div>正确答案:{{ item.standardAnswer }}</div>
</el-col>
</el-row>
<el-row class="elClass">
<el-col :span="1.5" style="padding-top: 15px">得分:</el-col>
<el-col :span="22">
<el-form-item :prop="`${index}.score`" :rules="[{ required: true, message: '请选择得分', trigger: 'change' }]">
<el-radio-group v-model="item.score" :disabled="item.questionType!==4||!submitIsShow">
<el-radio-button label="0" />
<el-radio-button label="1" />
<el-radio-button label="2" />
<el-radio-button label="3" />
<el-radio-button label="4" />
<el-radio-button label="5" />
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row class="elClass">
<el-col :span="1.5" style="padding-top: 15px">
<div>评价:</div>
</el-col>
<el-col :span="22">
<el-form-item prop="remarks">
<el-input v-model="item.remarks" type="textarea" placeholder="请输入评价" :disabled="!submitIsShow" />
</el-form-item>
</el-col>
</el-row>
</div>
<el-form-item>
<div style="margin-left: 680px;margin-top: 30px">
<el-button @click="cancel">取 消</el-button>
<el-button v-if="submitIsShow" type="primary" @click="submit">确 定</el-button>
</div>
</el-form-item>
</el-form>
</template>
</el-dialog>
</div>
</template>
<script>
import commonField from '@/utils/commonField'
import { parseTime } from '@/utils'
import {
getById,
listTeaExamExaminationPaper, upadteBatch
} from '@/api/examination/teaExamExaminationPaper'
import { delTeaExamQuestions } from '@/api/examination/teaExamQuestions'
import { delApplicationTrial, listApplicationTrial, updateApplicationTrial } from '@/api/try/applicationTrial'
import { delSysContentNewsInformation, updateStatus } from '@/api/contentManagement/sysContentNewsInformation'
export default {
name: 'Index'
name: 'TryoutApplication',
data() {
return {
// 显示开关
showSwitch: {
courseContent: true,
curCat: false
},
// 对话框
dialogFormVisible: false,
dialogVisible: false,
// 表单验证
rules: {
},
// 是否显示确认按钮
submitIsShow: true,
teaexamId: '',
lineindex: 0,
teacode: '',
// edit form
labelPosition: 'right',
// search area
courseid: '',
coursename: '',
queryParams: {
page: 1,
rows: 10,
applicantUnit: '',
flag: '',
remarks: ''
},
// pagination
total: 10,
actionUrl: '',
filelist: [],
bussid: [],
fullscreenLoading: false,
curCatForm: {
},
tableDataTips: '加载中'
}
},
computed: {
commonField() {
return commonField
}
},
watch: {
bussinessId: {
handler: function(val) {
this.courseId = val
console.log('bussinessId111111111111111111', val)
},
immediate: true
}
},
created() {
},
mounted: function() {
this.loadData()
},
methods: {
// 状态转换
statusChange(status) {
if (status === '0') {
return '未处理'
} else if (status === '1') {
return '已处理'
}
},
// 日期格式转换
replace(time) {
return parseTime(time, '{y}/{m}/{d}:{h}:{i}')
},
submit() {
console.log('this,form', this.form)
// 表单校验
this.$refs.form.validate(valid => {
if (valid) {
const result = []
// let countScore = 0
// 遍历给定的对象数组
const countScore = this.form.reduce((total, item) => total + Number(item.score), 0)
console.log('totalScore', countScore)
this.form.forEach(item => {
const { score, remarks, questionsId } = item
result.push({ score, remarks, questionsId })
// console.log('this.countScore', countScore)
})
// 新增
upadteBatch({ teaExamExaminationDTOList: result, businessId: this.teaexamId, countScore: countScore }).then(res => {
if (res.code === 200) {
this.$message({
message: '保存成功',
type: 'success'
})
this.cancel()
this.loadData()
}
this.countScore = 0
})
} else {
console.log('校验失败')
}
})
},
cancel() {
this.dialogFormVisible = false
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
page: 1,
rows: 10,
applicantUnit: '',
flag: '',
remarks: ''
}
this.loadData()
},
handleStatusChange(row) {
const text = row.flag === '1' ? '启用' : '停用'
const params = {
businessId: row.businessId,
flag: row.flag,
userType: row.userType,
applicant: row.applicant,
applicantUnit: row.applicantUnit,
phone: row.phone,
applicantTime: row.applicantTime,
remarks: row.remarks
}
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return updateApplicationTrial(params)
}).then(() => {
this.$message({
message: text + '成功',
type: 'success'
})
})
},
removeCourse(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(function() {
return delApplicationTrial(id)
}).then(() => {
this.loadData()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
},
// 难度转换
difficultyChange(difficulty) {
if (difficulty === '1') {
return '简单'
} else if (difficulty === '2') {
return '一般'
} else if (difficulty === '3') {
return '困难'
}
},
loadData() {
// 列表渲染数据
var data = []
const _this = this
this.tableData = []
_this.fullscreenLoading = true
const params = {
page: _this.queryParams.page,
rows: _this.queryParams.rows,
applicantUnit: _this.queryParams.applicantUnit,
flag: _this.queryParams.flag,
remarks: _this.queryParams.remarks
}
listApplicationTrial(params).then(res => {
var pages = res.rows// 查询过来的每页数据
_this.total = res.total// 总记录数
_this.bussid = []
res.rows.forEach(item => {
item.srclist = []
item.srclist.push(item.path)
})
_this.tableData = res.rows
_this.fullscreenLoading = false
if (res.rows.length === 0) {
_this.tableDataTips = '暂无数据'
}
})
},
/** 新增按钮操作 */
handleAdd() {
this.dialogFormVisible = true
},
/** 修改按钮操作 */
handleUpdate(row) {
console.log('row', row)
this.teaexamId = row.businessId
if (row.flag === '1') {
this.submitIsShow = false
} else {
this.submitIsShow = true
}
console.log(this.submitIsShow)
// 查询详情
getById(row.businessId).then(res => {
if (res.code === 200) {
res.data.forEach(item => {
if (item.questionType === 4) {
item.score = ''
} else if (item.answer === item.standardAnswer) {
item.score = item.mark
item.isRight = true
} else {
item.score = 0
item.isRight = false
}
})
this.form = res.data
console.log('this.form', this.form)
}
})
this.dialogFormVisible = true
},
// 查看方法
handleView(row) {
this.dialogFormVisible = true
this.submitIsShow = false
this.teaexamId = row.businessId
// 查询详情
getById(row.businessId).then(res => {
if (res.code === 200) {
res.data.forEach(item => {
if (item.answer === item.standardAnswer) {
item.isRight = true
} else {
item.isRight = false
}
})
this.form = res.data
}
})
}
}
}
</script>
<style scoped lang="scss">
<style lang="scss" scoped>
#courseManage{
/*width:calc(100% - 30px);*/
/*height:calc(100% - 60px);*/
}
.courseContent{
/*padding-left: 15px;*/
width:100%;
height:100%;
::v-deep .el-table th .cell{
justify-content: left!important;
}
::v-deep .el-table td .cell{
margin: 10px 0 10px 0 ;
text-align: left!important;
}
}
.selectClass{
width: 100%;
}
#courseManage .table_box{
margin:0;
height:calc(100% - 175px);
}
#courseManage .el-table{height:100%;}
#courseManage .el-table__body-wrapper{
height:calc(100% - 40px);
overflow-x:hidden;
overflow-y:auto;
}
#courseManage .pages{margin-top:15px;}
#courseManage .breadNav{margin-left:0;}
#courseManage .search_area{margin:1em 0;}
#courseManage .info_change{margin-left:0;}
#courseManage .search_area div{width:190px;}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {-webkit-appearance: none;}
input[type="number"]{-moz-appearance: textfield;}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
margin: 0;
}
::v-deep.elClass{
margin: 10px 20px 10px 20px;
}
::v-deep .el-radio-button__orig-radio:disabled:checked+.el-radio-button__inner {
background-color:#C5FBB7;
}
</style>
<template>
<div>
试用开课
<!-- 中心案例管理 -->
<div id="courseManage">
<div v-show="showSwitch.courseContent" class="courseContent">
<div class="search" style="border-bottom: 14px solid #f4f4f4">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item>
<el-input v-model="queryParams.answerName" placeholder="请输入申请人姓名、登录名、手机号" clearable />
</el-form-item>
<!-- 处理单位-->
<el-form-item>
<el-input v-model="queryParams.applicantUnit" placeholder="请输入申请单位" clearable />
</el-form-item>
<!-- 状态-->
<el-form-item>
<el-select v-model="queryParams.flag" placeholder="请选择状处理状态" clearable>
<el-option label="未处理" value="0" />
<el-option label="已处理" value="1" />
</el-select>
</el-form-item>
<!-- 备注-->
<el-form-item>
<el-input v-model="queryParams.remarks" placeholder="请输入备注" clearable />
</el-form-item>
<el-form-item>
<!-- //查询按钮-->
<el-button
:class="commonField.queryClass"
:type="commonField.typePrimary"
:icon="commonField.queryIcon"
:size="commonField.smallSize"
@click="loadData"
>{{ commonField.queryName }}</el-button>
<!-- //重置按钮-->
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetQuery"
>{{ commonField.resetName }}</el-button>
</el-form-item>
<div style="float: right" />
</el-form>
</div>
<div style="padding:5px 10px">
<div class="tableTitle">试用申请管理</div>
<el-table v-loading="fullscreenLoading" :data="tableData" border sortable="true">
<span slot="empty">{{ tableDataTips }}</span>
<el-table-column align="left" prop="id" label="序号" width="55px">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column prop="applicantName" label="申请人">
<template slot-scope="scope">
{{ scope.row.applicantName }}
</template>
</el-table-column>
<el-table-column prop="applicantUnitName" label="申请单位" show-overflow-tooltip />
<el-table-column prop="phone" label="手机号" show-overflow-tooltip />
<!-- 课程名称-->
<el-table-column prop="lessonName" label="课程名称">
<template slot-scope="scope">
{{ scope.row.lessonName }}
</template>
</el-table-column>
<!-- 岗位分类-->
<el-table-column prop="postClassification" label="岗位分类">
<template slot-scope="scope">
{{ scope.row.jobClassification }}
</template>
</el-table-column>
<!-- 技术分类-->
<el-table-column prop="technicalClassification" label="技术分类">
<template slot-scope="scope">
{{ scope.row.technicalClassification }}
</template>
</el-table-column>
<el-table-column prop="remarks" label="开始试用日期">
<template slot-scope="scope">
{{ replace(scope.row.applicantTime) }}
</template>
</el-table-column>
<el-table-column prop="remarks" label="结束试用日期">
<template slot-scope="scope">
{{ replace(scope.row.applicantEndTime) }}
</template>
</el-table-column>
<el-table-column prop="flag" label="状态">
<template slot-scope="scope">
{{ statusChange(scope.row.flag) }}
</template>
</el-table-column>
<el-table-column prop="remarks" label="备注" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button
:class="commonField.resetPasClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="removeCourse(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
/>
<footer />
</div>
<!-- 新建题型对话框-->
<el-dialog
title="试卷审批"
:visible.sync="dialogFormVisible"
width="55%"
>
<template>
<el-form ref="form" :model="form" label-width="20px" :rules="rules">
<div v-for="(item, index) in form" :key="index">
<el-row class="elClass">
<el-col :span="24">
<div>{{ index+1 +':' }}{{ item.title }}</div>
</el-col>
</el-row>
<el-row class="elClass">
<el-col :span="24">
<div>作答:
<span :style="{ color: item.isRight ? 'green' : 'red'}">
{{ item.answer }}</span></div>
</el-col>
</el-row>
<el-row class="elClass">
<el-col :span="24">
<div>正确答案:{{ item.standardAnswer }}</div>
</el-col>
</el-row>
<el-row class="elClass">
<el-col :span="1.5" style="padding-top: 15px">得分:</el-col>
<el-col :span="22">
<el-form-item :prop="`${index}.score`" :rules="[{ required: true, message: '请选择得分', trigger: 'change' }]">
<el-radio-group v-model="item.score" :disabled="item.questionType!==4||!submitIsShow">
<el-radio-button label="0" />
<el-radio-button label="1" />
<el-radio-button label="2" />
<el-radio-button label="3" />
<el-radio-button label="4" />
<el-radio-button label="5" />
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row class="elClass">
<el-col :span="1.5" style="padding-top: 15px">
<div>评价:</div>
</el-col>
<el-col :span="22">
<el-form-item prop="remarks">
<el-input v-model="item.remarks" type="textarea" placeholder="请输入评价" :disabled="!submitIsShow" />
</el-form-item>
</el-col>
</el-row>
</div>
<el-form-item>
<div style="margin-left: 680px;margin-top: 30px">
<el-button @click="cancel">取 消</el-button>
<el-button v-if="submitIsShow" type="primary" @click="submit">确 定</el-button>
</div>
</el-form-item>
</el-form>
</template>
</el-dialog>
</div>
</template>
<script>
import commonField from '@/utils/commonField'
import { parseTime } from '@/utils'
import {
getById,
listTeaExamExaminationPaper, upadteBatch
} from '@/api/examination/teaExamExaminationPaper'
import { delTeaExamQuestions } from '@/api/examination/teaExamQuestions'
import { delApplicationTrial, listApplicationTrial } from '@/api/try/applicationTrial'
import { delSysContentNewsInformation } from '@/api/contentManagement/sysContentNewsInformation'
import { listTeaTrialCourse } from '@/api/try/teaTrialCourse'
export default {
name: 'Index'
name: 'TryoutApplication',
data() {
return {
// 显示开关
showSwitch: {
courseContent: true,
curCat: false
},
// 对话框
dialogFormVisible: false,
dialogVisible: false,
// 表单验证
rules: {
},
// 是否显示确认按钮
submitIsShow: true,
teaexamId: '',
lineindex: 0,
teacode: '',
// edit form
labelPosition: 'right',
// search area
courseid: '',
coursename: '',
queryParams: {
page: 1,
rows: 10,
applicantUnit: '',
flag: '',
remarks: ''
},
// pagination
total: 10,
actionUrl: '',
filelist: [],
bussid: [],
fullscreenLoading: false,
curCatForm: {
},
tableDataTips: '加载中'
}
},
computed: {
commonField() {
return commonField
}
},
watch: {
bussinessId: {
handler: function(val) {
this.courseId = val
console.log('bussinessId111111111111111111', val)
},
immediate: true
}
},
created() {
},
mounted: function() {
this.loadData()
},
methods: {
// 状态转换
statusChange(status) {
if (status === '0') {
return '未处理'
} else if (status === '1') {
return '已处理'
}
},
// 日期格式转换
replace(time) {
return parseTime(time, '{y}/{m}/{d}:{h}:{i}')
},
submit() {
console.log('this,form', this.form)
// 表单校验
this.$refs.form.validate(valid => {
if (valid) {
const result = []
// let countScore = 0
// 遍历给定的对象数组
const countScore = this.form.reduce((total, item) => total + Number(item.score), 0)
console.log('totalScore', countScore)
this.form.forEach(item => {
const { score, remarks, questionsId } = item
result.push({ score, remarks, questionsId })
// console.log('this.countScore', countScore)
})
// 新增
upadteBatch({ teaExamExaminationDTOList: result, businessId: this.teaexamId, countScore: countScore }).then(res => {
if (res.code === 200) {
this.$message({
message: '保存成功',
type: 'success'
})
this.cancel()
this.loadData()
}
this.countScore = 0
})
} else {
console.log('校验失败')
}
})
},
cancel() {
this.dialogFormVisible = false
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
page: 1,
rows: 10,
applicantUnit: '',
flag: '',
remarks: ''
}
this.loadData()
},
// 题目type转换
typeChange(type) {
if (type === '1') {
return '单选题'
} else if (type === '2') {
return '多选题'
} else if (type === '3') {
return '判断题'
} else if (type === '4') {
return '填空题'
} else if (type === '5') {
return '简答题'
}
},
removeCourse(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(function() {
return delApplicationTrial(id)
}).then(() => {
this.loadData()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
},
// 难度转换
difficultyChange(difficulty) {
if (difficulty === '1') {
return '简单'
} else if (difficulty === '2') {
return '一般'
} else if (difficulty === '3') {
return '困难'
}
},
loadData() {
// 列表渲染数据
var data = []
const _this = this
this.tableData = []
_this.fullscreenLoading = true
const params = {
page: _this.queryParams.page,
rows: _this.queryParams.rows,
applicantUnit: _this.queryParams.applicantUnit,
flag: _this.queryParams.flag,
remarks: _this.queryParams.remarks
}
listTeaTrialCourse(params).then(res => {
var pages = res.rows// 查询过来的每页数据
_this.total = res.total// 总记录数
_this.bussid = []
res.rows.forEach(item => {
item.srclist = []
item.srclist.push(item.path)
})
_this.tableData = res.rows
_this.fullscreenLoading = false
if (res.rows.length === 0) {
_this.tableDataTips = '暂无数据'
}
})
},
/** 新增按钮操作 */
handleAdd() {
this.dialogFormVisible = true
},
/** 修改按钮操作 */
handleUpdate(row) {
console.log('row', row)
this.teaexamId = row.businessId
if (row.flag === '1') {
this.submitIsShow = false
} else {
this.submitIsShow = true
}
console.log(this.submitIsShow)
// 查询详情
getById(row.businessId).then(res => {
if (res.code === 200) {
res.data.forEach(item => {
if (item.questionType === 4) {
item.score = ''
} else if (item.answer === item.standardAnswer) {
item.score = item.mark
item.isRight = true
} else {
item.score = 0
item.isRight = false
}
})
this.form = res.data
console.log('this.form', this.form)
}
})
this.dialogFormVisible = true
},
// 查看方法
handleView(row) {
this.dialogFormVisible = true
this.submitIsShow = false
this.teaexamId = row.businessId
// 查询详情
getById(row.businessId).then(res => {
if (res.code === 200) {
res.data.forEach(item => {
if (item.answer === item.standardAnswer) {
item.isRight = true
} else {
item.isRight = false
}
})
this.form = res.data
}
})
}
}
}
</script>
<style scoped lang="scss">
<style lang="scss" scoped>
#courseManage{
/*width:calc(100% - 30px);*/
/*height:calc(100% - 60px);*/
}
.courseContent{
/*padding-left: 15px;*/
width:100%;
height:100%;
::v-deep .el-table th .cell{
justify-content: left!important;
}
::v-deep .el-table td .cell{
margin: 10px 0 10px 0 ;
text-align: left!important;
}
}
.selectClass{
width: 100%;
}
#courseManage .table_box{
margin:0;
height:calc(100% - 175px);
}
#courseManage .el-table{height:100%;}
#courseManage .el-table__body-wrapper{
height:calc(100% - 40px);
overflow-x:hidden;
overflow-y:auto;
}
#courseManage .pages{margin-top:15px;}
#courseManage .breadNav{margin-left:0;}
#courseManage .search_area{margin:1em 0;}
#courseManage .info_change{margin-left:0;}
#courseManage .search_area div{width:190px;}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {-webkit-appearance: none;}
input[type="number"]{-moz-appearance: textfield;}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
margin: 0;
}
::v-deep.elClass{
margin: 10px 20px 10px 20px;
}
::v-deep .el-radio-button__orig-radio:disabled:checked+.el-radio-button__inner {
background-color:#C5FBB7;
}
</style>
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