项目管理更新

This commit is contained in:
Yjhon 2021-12-03 16:18:34 +08:00
parent 9aef31c7cb
commit 174a4314ac
10 changed files with 432 additions and 418 deletions

View File

@ -9,8 +9,8 @@ const questionApi = {
// list: '/courseManagement/course/listPage', // list: '/courseManagement/course/listPage',
// coursewareList:'/courseManagement/course/courseware/details', // coursewareList:'/courseManagement/course/courseware/details',
// questionList:'/courseManagement/course/questionList', // questionList:'/courseManagement/course/questionList',
importTemplate: "courseManagement/question/importTemplate" importTemplate: "courseManagement/question/importTemplate",
getQuestionNumByCourseIds: '/courseManagement/question/getQuestionNumByCourseIds',
} }
@ -22,6 +22,15 @@ export function questionAdd (params) {
data: params data: params
}) })
} }
// 题目数量
export function getQuestionNumByCourseIds(params) {
return request({
url: questionApi.add,
method: 'post',
data: params
})
}
// export function menuGet (params) { // export function menuGet (params) {
// return request({ // return request({
// url: menuApi.get, // url: menuApi.get,
@ -63,5 +72,3 @@ export function importTemplate (params) {
params: params params: params
}) })
} }

View File

@ -1,4 +1,8 @@
<template> <template>
<a-card :bordered="false" title="终端培训详情">
<template slot="extra">
<a-button size="small" @click="close">返回</a-button>
</template>
<page-header-wrapper title="项目基础信息"> <page-header-wrapper title="项目基础信息">
<template v-slot:content> <template v-slot:content>
<a-descriptions size="small" :column="isMobile ? 1 : 2"> <a-descriptions size="small" :column="isMobile ? 1 : 2">
@ -11,24 +15,24 @@
<a-descriptions-item label="培训时间">XX 服务</a-descriptions-item> <a-descriptions-item label="培训时间">XX 服务</a-descriptions-item>
<a-descriptions-item label="练习类型">2017-07-07</a-descriptions-item> <a-descriptions-item label="练习类型">2017-07-07</a-descriptions-item>
<a-descriptions-item label="考试时间">2017-07-07</a-descriptions-item> <a-descriptions-item label="考试时间">2017-07-07</a-descriptions-item>
<a-descriptions-item label="补考"> <!-- <a-descriptions-item label="补考">
<a-radio :default-checked="false" :disabled="disabled"> Disabled </a-radio> <a-radio :default-checked="false" :disabled="disabled"> Disabled </a-radio>
<a-radio default-checked :disabled="disabled"> Disabled </a-radio> <a-radio default-checked :disabled="disabled"> Disabled </a-radio>
</a-descriptions-item> </a-descriptions-item> -->
<a-descriptions-item label="备注">请于两个工作日内确认</a-descriptions-item> <a-descriptions-item label="备注">请于两个工作日内确认</a-descriptions-item>
</a-descriptions> </a-descriptions>
</template> </template>
<template v-slot:extraContent> <!-- <template v-slot:extraContent>
<a-row class="status-list"> <a-row class="status-list">
<a-col :xs="12" :sm="12"> <a-col :xs="12" :sm="12">
<div class="text">状态</div> <div class="text">状态</div>
<div class="heading">待审批</div> <div class="heading">待审批</div>
</a-col> </a-col>
</a-row> </a-row>
</template> </template> -->
<a-card :bordered="false" title="流程进度"> <!-- <a-card :bordered="false" title="流程进度">
<a-steps :direction="(isMobile && 'vertical') || 'horizontal'" :current="1" progressDot> <a-steps :direction="(isMobile && 'vertical') || 'horizontal'" :current="1" progressDot>
<a-step> <a-step>
<template v-slot:title> <template v-slot:title>
@ -36,7 +40,8 @@
</template> </template>
<template v-slot:description> <template v-slot:description>
<div class="antd-pro-pages-profile-advanced-style-stepDescription"> <div class="antd-pro-pages-profile-advanced-style-stepDescription">
曲丽丽<a-icon type="dingding" style="margin-left: 8px" /> 曲丽丽
<a-icon type="dingding" style="margin-left: 8px" />
<div>2016-12-12 12:32</div> <div>2016-12-12 12:32</div>
</div> </div>
</template> </template>
@ -47,7 +52,8 @@
</template> </template>
<template v-slot:description> <template v-slot:description>
<div class="antd-pro-pages-profile-advanced-style-stepDescription"> <div class="antd-pro-pages-profile-advanced-style-stepDescription">
周毛毛<a-icon type="dingding" style="color: rgb(0, 160, 233); margin-left: 8px" /> 周毛毛
<a-icon type="dingding" style="color: rgb(0, 160, 233); margin-left: 8px" />
<div><a>催一下</a></div> <div><a>催一下</a></div>
</div> </div>
</template> </template>
@ -55,7 +61,7 @@
<a-step title="财务复核" /> <a-step title="财务复核" />
<a-step title="完成" /> <a-step title="完成" />
</a-steps> </a-steps>
</a-card> </a-card> -->
<a-card style="margin-top: 24px" :bordered="false" title="用户信息"> <a-card style="margin-top: 24px" :bordered="false" title="用户信息">
<a-descriptions> <a-descriptions>
@ -79,16 +85,13 @@
<a-descriptions-item label="角色码">1234567</a-descriptions-item> <a-descriptions-item label="角色码">1234567</a-descriptions-item>
<a-descriptions-item label="所属部门">XX公司-YY部</a-descriptions-item> <a-descriptions-item label="所属部门">XX公司-YY部</a-descriptions-item>
<a-descriptions-item label="过期时间">2018-08-08</a-descriptions-item> <a-descriptions-item label="过期时间">2018-08-08</a-descriptions-item>
<a-descriptions-item label="描述" <a-descriptions-item label="描述">这段描述很长很长很长很长很长很长很长很长很长很长很长很长很长很长...</a-descriptions-item>
>这段描述很长很长很长很长很长很长很长很长很长很长很长很长很长很长...</a-descriptions-item
>
</a-descriptions> </a-descriptions>
<a-divider style="margin: 16px 0" /> <a-divider style="margin: 16px 0" />
<a-descriptions title="组名称" size="small" :col="1"> <a-descriptions title="组名称" size="small" :col="1">
<a-descriptions-item label="学名"> <a-descriptions-item label="学名">
Citrullus lanatus (Thunb.) Matsum. et Citrullus lanatus (Thunb.) Matsum. et
Nakai一年生蔓生藤本枝粗壮具明显的棱卷须较粗..</a-descriptions-item Nakai一年生蔓生藤本枝粗壮具明显的棱卷须较粗..</a-descriptions-item>
>
</a-descriptions> </a-descriptions>
<a-divider style="margin: 16px 0" /> <a-divider style="margin: 16px 0" />
<a-descriptions title="组名称" size="small" :col="2"> <a-descriptions title="组名称" size="small" :col="2">
@ -99,53 +102,35 @@
</a-card> </a-card>
<a-card style="margin-top: 24px" :bordered="false" title="用户近半年来电记录"> <a-card style="margin-top: 24px" :bordered="false" title="用户近半年来电记录">
<div class="no-data"><a-icon type="frown-o" />暂无数据</div> <div class="no-data">
<a-icon type="frown-o" />暂无数据
</div>
</a-card> </a-card>
<!-- 操作 --> <!-- 操作 -->
<a-card <a-card style="margin-top: 24px" :bordered="false" :tabList="operationTabList" :activeTabKey="operationActiveTabKey" @tabChange="
style="margin-top: 24px"
:bordered="false"
:tabList="operationTabList"
:activeTabKey="operationActiveTabKey"
@tabChange="
(key) => { (key) => {
this.operationActiveTabKey = key this.operationActiveTabKey = key
} }
" ">
> <a-table v-if="operationActiveTabKey === '1'" :columns="operationColumns" :dataSource="operation1" :pagination="false">
<a-table
v-if="operationActiveTabKey === '1'"
:columns="operationColumns"
:dataSource="operation1"
:pagination="false"
>
<template slot="status" slot-scope="status"> <template slot="status" slot-scope="status">
<a-badge :status="status | statusTypeFilter" :text="status | statusFilter" /> <a-badge :status="status | statusTypeFilter" :text="status | statusFilter" />
</template> </template>
</a-table> </a-table>
<a-table <a-table v-if="operationActiveTabKey === '2'" :columns="operationColumns" :dataSource="operation2" :pagination="false">
v-if="operationActiveTabKey === '2'"
:columns="operationColumns"
:dataSource="operation2"
:pagination="false"
>
<template slot="status" slot-scope="status"> <template slot="status" slot-scope="status">
<a-badge :status="status | statusTypeFilter" :text="status | statusFilter" /> <a-badge :status="status | statusTypeFilter" :text="status | statusFilter" />
</template> </template>
</a-table> </a-table>
<a-table <a-table v-if="operationActiveTabKey === '3'" :columns="operationColumns" :dataSource="operation3" :pagination="false">
v-if="operationActiveTabKey === '3'"
:columns="operationColumns"
:dataSource="operation3"
:pagination="false"
>
<template slot="status" slot-scope="status"> <template slot="status" slot-scope="status">
<a-badge :status="status | statusTypeFilter" :text="status | statusFilter" /> <a-badge :status="status | statusTypeFilter" :text="status | statusFilter" />
</template> </template>
</a-table> </a-table>
</a-card> </a-card>
</page-header-wrapper> </page-header-wrapper>
</a-card>
</template> </template>
<script> <script>

View File

@ -57,7 +57,7 @@
<template> <template>
<a v-if="hasPerm('project:edit')" href="javascript:;" @click="handledCreate(record)">修改</a> <a v-if="hasPerm('project:edit')" href="javascript:;" @click="handledCreate(record)">修改</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a v-if="hasPerm('project:list')" href="javascript:;" @click="handleDetail(record)">详情</a> <a v-if="hasPerm('project:list')" href="javascript:;" @click="getDetail(record)">详情</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-popconfirm title="是否删除?" @confirm="() => handleDelete(record)"> <a-popconfirm title="是否删除?" @confirm="() => handleDelete(record)">
<a v-if="hasPerm('project:del')" href="javascript:;">删除</a> <a v-if="hasPerm('project:del')" href="javascript:;">删除</a>
@ -149,6 +149,17 @@ export default {
}, },
}, },
methods: { methods: {
getDetail(record){
this.$router.push({
path: '/project/detail',
query: {
id: record.id, //
t:this.queryParam.type,
projectId: record.id, //id
projectPageNum: this.$refs.table.localPagination.current, //
},
})
},
// //
handledCreate(record) { handledCreate(record) {
this.$router.push({ this.$router.push({
@ -156,7 +167,6 @@ export default {
query: { query: {
t: this.queryParam.type, // t: this.queryParam.type, //
projectId: record.id, //id projectId: record.id, //id
projectQueryParam: this.queryParam, //
projectPageNum: this.$refs.table.localPagination.current, // projectPageNum: this.$refs.table.localPagination.current, //
}, },
}) })

View File

@ -23,7 +23,7 @@
@executeSave="executeSave" @executeSave="executeSave"
@executeIssue="executeIssue" @executeIssue="executeIssue"
/> />
<result v-if="currentTab === 5" :projectForm="form" @prevStep="prevStep" :projectSaveStatus="status" /> <result v-if="currentTab === 5" :projectForm="form" @prevStep="prevStep" :projectSaveStatus="status" @close="close" />
<!-- </keep-alive> --> <!-- </keep-alive> -->
</div> </div>
</a-card> </a-card>
@ -82,6 +82,7 @@ export default {
type: '', type: '',
form: { form: {
t: this.$route.query.t, t: this.$route.query.t,
projectType: this.$route.query.t === 'sys' ? 0 : 1,
trainWay: '2', trainWay: '2',
totalScore: '100', totalScore: '100',
}, },

View File

@ -105,7 +105,7 @@ export default {
/** 新建的没有项目id传当前的所选的课程id */ /** 新建的没有项目id传当前的所选的课程id */
return getCourseListByCourseIds(Object.assign(parameter, this.queryParam)).then((res) => { return getCourseListByCourseIds(Object.assign(parameter, this.queryParam)).then((res) => {
this.selData = res.data; this.selData = res.data;
console.log('list页面----selData',this.selData) // console.log('list----selData',this.selData)
this.calc(res.data) this.calc(res.data)
return res.data return res.data
}) })
@ -135,12 +135,14 @@ export default {
this.form.lessonIds = [] this.form.lessonIds = []
let ids = this.queryParam.ids.split(',') let ids = this.queryParam.ids.split(',')
ids.forEach((id, index, arr) => { ids.forEach((id, index, arr) => {
console.log('id-----------------------', id) // console.log('id-----------------------', id)
this.form.lessonIds.push({ ids: id, sort: index }) this.form.lessonIds.push({ ids: id, sort: index })
}) })
if(this.form.lessonIds.length > 0){
console.log('ProjectCourseSelect-toNext', this.form)
this.$emit('nextStep', this.form) this.$emit('nextStep', this.form)
}else{
this.$message.warning('培训课程不能为空')
}
}, },
// //
toPrep() { toPrep() {
@ -150,16 +152,16 @@ export default {
this.form.lessonIds.push({ ids: id, sort: index }) this.form.lessonIds.push({ ids: id, sort: index })
}) })
console.log('toPrep', this.form) // console.log('toPrep', this.form)
this.$emit('prevStep', this.form) this.$emit('prevStep', this.form)
}, },
//ids //ids
initIds() { initIds() {
console.log('this.projectForm.lessonIds',this.projectForm.lessonIds) // console.log('this.projectForm.lessonIds',this.projectForm.lessonIds)
let str = []; let str = [];
if(this.projectForm.lessonIds) str = this.projectForm.lessonIds if(this.projectForm.lessonIds) str = this.projectForm.lessonIds
// let str = this.projectForm.lessonIds.join(',') || [] // let str = this.projectForm.lessonIds.join(',') || []
console.log('initIds', str) // console.log('initIds', str)
if (str && str.length > 0) { if (str && str.length > 0) {
let arr = []; let arr = [];
str.forEach((item) => { str.forEach((item) => {

View File

@ -6,17 +6,17 @@
<template slot="extra"> <template slot="extra">
<a-button type="primary" size="default" @click="close">退出</a-button> <a-button type="primary" size="default" @click="close">退出</a-button>
</template> </template>
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" layout="horizontal"> <a-form-model ref="form" :rules="rules" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" layout="horizontal">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="24" :sm="24"> <a-col :md="24" :sm="24">
<a-form-model-item label="项目名称"> <a-form-model-item label="项目名称" prop="projectName">
<a-input v-model="form.projectName" /> <a-input v-model="form.projectName" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="24" :sm="24"> <a-col :md="24" :sm="24">
<a-form-model-item label="培训种类"> <a-form-model-item label="培训种类" prop="trainClass">
<a-select v-model="form.trainClass" placeholder="--请选择--"> <a-select v-model="form.trainClass" placeholder="--请选择--">
<a-select-option v-for="entity in trainClass" :key="entity.value"> {{ entity.name }} </a-select-option> <a-select-option v-for="entity in trainClass" :key="entity.value"> {{ entity.name }} </a-select-option>
</a-select> </a-select>
@ -24,7 +24,7 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="培训类型"> <a-form-model-item label="培训类型" prop="trainType">
<a-select v-model="form.trainType" placeholder="--请选择--"> <a-select v-model="form.trainType" placeholder="--请选择--">
<a-select-option value="1"> 必修课 </a-select-option> <a-select-option value="1"> 必修课 </a-select-option>
<a-select-option value="2"> 选修课 </a-select-option> <a-select-option value="2"> 选修课 </a-select-option>
@ -32,7 +32,7 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="培训方式"> <a-form-model-item label="培训方式" prop="trainWay">
<a-select v-model="form.trainWay" placeholder="--请选择--"> <a-select v-model="form.trainWay" placeholder="--请选择--">
<a-select-option value="1"> 培训 </a-select-option> <a-select-option value="1"> 培训 </a-select-option>
<a-select-option value="2"> 考试 </a-select-option> <a-select-option value="2"> 考试 </a-select-option>
@ -42,7 +42,7 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="人员类型"> <a-form-model-item label="人员类型" prop="personType">
<a-select v-model="form.personType" placeholder="--请选择--"> <a-select v-model="form.personType" placeholder="--请选择--">
<a-select-option v-for="item in personType" :key="item.value"> {{ item.name }} </a-select-option> <a-select-option v-for="item in personType" :key="item.value"> {{ item.name }} </a-select-option>
</a-select> </a-select>
@ -50,59 +50,59 @@
</a-col> </a-col>
<!-- 时间选择器呢 --> <!-- 时间选择器呢 -->
<a-col :span="24"> <a-col :span="24">
<a-form-item label="培训时间" style="margin-bottom: 0"> <a-form-model-item label="培训时间" style="margin-bottom: 0">
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }"> <a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="trainSdate">
<a-date-picker v-model="form.trainSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" /> <a-date-picker v-model="form.trainSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-item> </a-form-model-item>
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span> <span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }"> <a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="trainEdate">
<a-date-picker v-model="form.trainEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" /> <a-date-picker v-model="form.trainEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-item> </a-form-model-item>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<!-- 时间选择器 --> <!-- 时间选择器 -->
<a-col :span="24"> <a-col :span="24">
<a-form-item v-if="['2', '3', '4'].includes(form.trainWay)" label="练习时间" style="margin-bottom: 0"> <a-form-model-item v-if="['2', '3', '4'].includes(form.trainWay)" label="练习时间" style="margin-bottom: 0">
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }"> <a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="practiceSdate">
<a-date-picker v-model="form.practiceSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" /> <a-date-picker v-model="form.practiceSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-item> </a-form-model-item>
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span> <span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }"> <a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="practiceEdate">
<a-date-picker v-model="form.practiceEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" /> <a-date-picker v-model="form.practiceEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-item> </a-form-model-item>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<!-- 时间选择器 --> <!-- 时间选择器 -->
<a-col :span="24"> <a-col :span="24">
<a-form-item v-if="['2', '3', '4'].includes(form.trainWay)" label="考试时间" style="margin-bottom: 0"> <a-form-model-item v-if="['2', '3', '4'].includes(form.trainWay)" label="考试时间" style="margin-bottom: 0">
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }"> <a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="examSdate">
<a-date-picker v-model="form.examSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" /> <a-date-picker v-model="form.examSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-item> </a-form-model-item>
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span> <span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }"> <a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="examEdate">
<a-date-picker v-model="form.examEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" /> <a-date-picker v-model="form.examEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-item> </a-form-model-item>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<!-- 考试次数 --> <!-- 考试次数 -->
<a-col :span="24"> <a-col :span="24">
<a-form-item v-if="['2', '3', '4'].includes(form.trainWay)" label="考试次数" style="margin-bottom: 0"> <a-form-model-item v-if="['2', '3', '4'].includes(form.trainWay)" label="考试次数" style="margin-bottom: 0">
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }"> <a-form-model-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }" prop="examNumber">
<a-input-number v-model="form.examNumber" :min="0" style="width: 100%" /> <a-input-number v-model="form.examNumber" :min="0" style="width: 100%" />
</a-form-item> </a-form-model-item>
<!-- <span> 补考次数: </span> <!-- <span> 补考次数: </span>
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }"> <a-form-model-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
<a-input-number v-model="form.resitNumber" :min="0" style="width: 100%" /> <a-input-number v-model="form.resitNumber" :min="0" style="width: 100%" />
</a-form-item> </a-form-model-item>
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }"> <a-form-model-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
<a-button type="primary" @click="randomResit"> 随机补考 </a-button> <a-button type="primary" @click="randomResit"> 随机补考 </a-button>
</a-form-item> --> </a-form-model-item> -->
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="模拟考试" v-if="['2', '3', '4'].includes(form.trainWay)"> <a-form-model-item label="模拟考试" v-if="['2', '3', '4'].includes(form.trainWay)" prop="mockExam">
<a-radio-group v-model="form.mockExam"> <a-radio-group v-model="form.mockExam">
<a-radio value="1"> 允许 </a-radio> <a-radio value="1"> 允许 </a-radio>
<a-radio value="0"> 不允许 </a-radio> <a-radio value="0"> 不允许 </a-radio>
@ -141,6 +141,21 @@ export default {
confirmLoading: false, confirmLoading: false,
trainClass: [], trainClass: [],
form: this.projectForm, form: this.projectForm,
rules: {
projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
trainClass: [{ required: true, message: '请选择培训分类', trigger: 'blur' }],
trainType: [{ required: true, message: '请选择培训类型', trigger: 'blur' }],
trainWay: [{ required: true, message: '请选择培训方式', trigger: 'biur' }],
personType: [{ required: true, message: '请选择人员类型', trigger: 'blur' }],
trainSdate: [{ required: true, message: '请输入培训开始时间', trigger: 'change' }],
trainEdate: [{ required: true, message: '请输入培训结束时间', trigger: 'change' }],
practiceSdate: [{ required: true, message: '请输入练习开始时间', trigger: 'change' }],
practiceEdate: [{ required: true, message: '请输入练习结束时间', trigger: 'change' }],
examSdate: [{ required: true, message: '请输入考试开始时间', trigger: 'change' }],
examEdate: [{ required: true, message: '请输入考试结束时间', trigger: 'change' }],
examNumber: [{ required: true, message: '请输入考试次数', trigger: 'blur' }],
mockExam: [{ required: true, message: '请选择是否允许模拟考试', trigger: 'change' }],
},
} }
}, },
components: { components: {
@ -156,7 +171,7 @@ export default {
methods: { methods: {
close() { close() {
console.log('Form返回list页面') console.log('Form返回list页面')
this.$emit('close'); this.$emit('close')
}, },
//, //,
fetchTemplateData() { fetchTemplateData() {
@ -171,7 +186,6 @@ export default {
name: r.name, name: r.name,
}) })
}) })
// console.log("111111111111111111111111111",this.personType)
} }
}) })
}, },
@ -197,8 +211,12 @@ export default {
// //
//from //from
toNext() { toNext() {
console.log('toNext', this.form) // console.log('toNext', this.form)
this.$refs.form.validate((validate) => {
if (validate) {
this.$emit('nextStep', this.form) this.$emit('nextStep', this.form)
}
})
}, },
}, },
destroyed() { destroyed() {

View File

@ -129,7 +129,11 @@ export default {
toNext() { toNext() {
this.form.projectPersonLists = this.selectedRows this.form.projectPersonLists = this.selectedRows
this.form.personIds = this.selectedRowKeys this.form.personIds = this.selectedRowKeys
if(this.form.personIds.length > 0){
this.$emit('nextStep', this.form) this.$emit('nextStep', this.form)
}else{
this.$message.warning('培训人员不能为空')
}
}, },
// //
toPrev() { toPrev() {

View File

@ -9,27 +9,27 @@
<template slot="extra"> <template slot="extra">
<a-button type="primary" size="default" @click="toIssue">发布</a-button> <a-button type="primary" size="default" @click="toIssue">发布</a-button>
</template> </template>
<a-form-model :model="form" v-bind="formItemLayout"> <a-form-model :rules="rules" :model="form" v-bind="formItemLayout">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="10" :sm="12"> <a-col :md="10" :sm="12">
<a-form-model-item label="总分"> <a-form-model-item label="总分" prop="totalScore">
<a-input-number v-model="form.totalScore" :disabled="true" /> <a-input-number v-model="form.totalScore" :disabled="true" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :md="14" :sm="12"> <a-col :md="14" :sm="12">
<a-form-model-item label="及格分数"> <a-form-model-item label="及格分数" prop="passScore">
<a-input-number v-model="form.passScore" :min="1" :max="100" /> <a-input-number v-model="form.passScore" :min="1" :max="100" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="10" :sm="12"> <a-col :md="10" :sm="12">
<a-form-model-item label="考试时长"> <a-form-model-item label="考试时长" prop="examTime">
<a-input-number :min="0" v-model="form.examTime" /> <a-input-number :min="0" v-model="form.examTime" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :md="14" :sm="12"> <a-col :md="14" :sm="12">
<a-form-model-item label="默认组卷题量"> <a-form-model-item label="默认组卷题量" prop="topicNumber">
<a-input-number :min="0" v-model="form.topicNumber" /> <a-input-number :min="0" v-model="form.topicNumber" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -37,7 +37,7 @@
<a-row :gutter="24"> <a-row :gutter="24">
<h4>考试开启条件</h4> <h4>考试开启条件</h4>
<a-col :md="10" :sm="12"> <a-col :md="10" :sm="12">
<a-form-model-item label="学时时长"> <a-form-model-item label="学时时长" prop="examOpenCondition">
<a-input-number :min="0" v-model="form.examOpenCondition" /> <a-input-number :min="0" v-model="form.examOpenCondition" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -60,6 +60,7 @@
<script> <script>
// jsjsjson // jsjsjson
// import from '' // import from ''
import { getQuestionNumByCourseIds } from '@/api/course/question/question'
export default { export default {
// import使 // import使
@ -74,6 +75,16 @@ export default {
return { return {
form: this.projectForm, form: this.projectForm,
formItemLayout: { labelCol: { span: 4 }, wrapperCol: { span: 14 } }, formItemLayout: { labelCol: { span: 4 }, wrapperCol: { span: 14 } },
rules: {
totalScore: [{ required: true, message: '请输入组卷总分', trigger: 'blur' }],
trainClass: [{ required: true, message: '请选择培训分类', trigger: 'blur' }],
projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
trainClass: [{ required: true, message: '请选择培训分类', trigger: 'blur' }],
projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
trainClass: [{ required: true, message: '请选择培训分类', trigger: 'blur' }],
projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
trainClass: [{ required: true, message: '请选择培训分类', trigger: 'blur' }],
},
columns: [ columns: [
{ title: '序号', key: 'i', dataIndex: 'i', width: 70, scopedSlots: { customRender: 'serial' } }, { title: '序号', key: 'i', dataIndex: 'i', width: 70, scopedSlots: { customRender: 'serial' } },
{ {
@ -84,6 +95,8 @@ export default {
if (text == 1) return '单选题' if (text == 1) return '单选题'
if (text == 2) return '多选题' if (text == 2) return '多选题'
if (text == 3) return '判断题' if (text == 3) return '判断题'
if (text == 4) return '简答题'
if (text == 5) return '填空题'
}, },
}, },
{ title: '总题量', dataIndex: 'totalNum', key: 'totalNum' }, { title: '总题量', dataIndex: 'totalNum', key: 'totalNum' },
@ -109,32 +122,7 @@ export default {
}, },
}, },
], ],
tableData: this.projectForm.testPaperTactics || [ tableData: this.projectForm.testPaperTactics || [],
{
i: 1,
topicType: 1,
totalNum: 20,
topicNum: 0,
topicScore: 0,
totalScore: 100,
},
{
i: 2,
topicType: 2,
totalNum: 20,
topicNum: 0,
topicScore: 0,
totalScore: 100,
},
{
i: 3,
topicType: 3,
totalNum: 20,
topicNum: 0,
topicScore: 0,
totalScore: 100,
},
],
} }
}, },
// data // data
@ -160,7 +148,13 @@ export default {
}, },
}, },
// - 访this // - 访this
created() {}, created() {
if(this.tableData.length == 0){
getQuestionNumByCourseIds({ids:this.form.lessonIds}).then((res) => {
this.tableData = res.data
})
}
},
// - 访DOM // - 访DOM
mounted() { }, mounted() { },
// - // -

View File

@ -1,44 +1,25 @@
<template> <template>
<a-card :bordered="false" title="选择培训单位"> <a-card :bordered="false" title="选择培训单位">
<template slot="extra">
<a-button type="primary" v-if="['2', '3', '4'].includes(form.trainWay)" size="default" @click="toNext"
>下一步</a-button
>
</template>
<template slot="extra"> <template slot="extra">
<a-button type="primary" size="default" @click="toPrep">上一步</a-button> <a-button type="primary" size="default" @click="toPrep">上一步</a-button>
</template> </template>
<template type="primary" v-if="form.trainWay === '1'" slot="extra"> <template slot="extra">
<a-button size="default" @click="close">完成</a-button> <a-button type="primary" v-if="['2', '3', '4'].includes(form.trainWay)" size="default" @click="toNext">下一步</a-button>
</template> </template>
<a-transfer <template type="primary" v-if="form.trainWay === '1'" slot="extra">
class="tree-transfer" <a-button size="default" @click="handleSubmit">保存</a-button>
:data-source="dataSource" </template>
:target-keys="targetKeys" <a-transfer class="tree-transfer" :data-source="dataSource" :target-keys="targetKeys" :render="(item) => item.title" :show-select-all="false" @change="onChange">
:render="(item) => item.title"
:show-select-all="false"
@change="onChange"
>
<template slot="children" slot-scope="{ props: { direction, selectedKeys }, on: { itemSelect } }"> <template slot="children" slot-scope="{ props: { direction, selectedKeys }, on: { itemSelect } }">
<a-tree <a-tree v-if="direction === 'left'" blockNode checkable checkStrictly defaultExpandAll :checkedKeys="[...selectedKeys, ...targetKeys]" :treeData="treeData" @check="
v-if="direction === 'left'"
blockNode
checkable
checkStrictly
defaultExpandAll
:checkedKeys="[...selectedKeys, ...targetKeys]"
:treeData="treeData"
@check="
(_, props) => { (_, props) => {
onChecked(_, props, [...selectedKeys, ...targetKeys], itemSelect) onChecked(_, props, [...selectedKeys, ...targetKeys], itemSelect)
} }
" " @select="
@select="
(_, props) => { (_, props) => {
onChecked(_, props, [...selectedKeys, ...targetKeys], itemSelect) onChecked(_, props, [...selectedKeys, ...targetKeys], itemSelect)
} }
" " />
/>
</template> </template>
</a-transfer> </a-transfer>
</a-card> </a-card>
@ -50,18 +31,18 @@
import { orgList } from '@/api/org/org' import { orgList } from '@/api/org/org'
import { listToTree } from '@/utils/util' import { listToTree } from '@/utils/util'
const treeData = [ const treeData = []
{ key: '0-0', title: '0-0' }, // { key: '0-0', title: '0-0' },
{ // {
key: '0-1', // key: '0-1',
title: '0-1', // title: '0-1',
children: [ // children: [
{ key: '0-1-0', title: '0-1-0' }, // { key: '0-1-0', title: '0-1-0' },
{ key: '0-1-1', title: '0-1-1' }, // { key: '0-1-1', title: '0-1-1' },
], // ],
}, // },
{ key: '0-2', title: '0-3' }, // { key: '0-2', title: '0-3' },
] // ]
const transferDataSource = [] const transferDataSource = []
@ -99,7 +80,7 @@ export default {
targetKeys: this.projectForm.unitIds || [], targetKeys: this.projectForm.unitIds || [],
dataSource: transferDataSource, dataSource: transferDataSource,
// treeData() {return handleTreeData(treeData, this.targetKeys)}, // treeData() {return handleTreeData(treeData, this.targetKeys)},
treeData: [] treeData: [],
} }
}, },
// data // data
@ -139,8 +120,11 @@ export default {
// //
toNext() { toNext() {
this.form.unitIds = this.targetKeys this.form.unitIds = this.targetKeys
console.log('toNext', this.form) if (this.form.unitIds.length > 0) {
this.$emit('nextStep', this.form) this.$emit('nextStep', this.form)
} else {
this.$message.warning('请选择培训单位')
}
}, },
// //
toPrep() { toPrep() {
@ -148,12 +132,21 @@ export default {
console.log('toPrep', this.form) console.log('toPrep', this.form)
this.$emit('prevStep', this.form) this.$emit('prevStep', this.form)
}, },
//
handleSubmit() {
this.form.unitIds = this.targetKeys
if (this.form.unitIds.length > 0) {
this.$emit('executeSave', this.form)
} else {
this.$message.warning('请选择培训单位')
}
},
}, },
// - 访this // - 访this
created() { created() {
console.log('第2个表单创建了') // console.log('2')
this.getSourceList() this.getSourceList()
console.log('form',this.form) // console.log('form', this.form)
}, },
// - 访DOM // - 访DOM

View File

@ -102,7 +102,7 @@ const vueConfig = {
// 如果需要开启代理请移除mockjs /src/main.jsL11 // 如果需要开启代理请移除mockjs /src/main.jsL11
proxy: { proxy: {
'/dawa': { // 捕获API的标志如果API中有这个字符串那么就开始匹配代理 '/dawa': { // 捕获API的标志如果API中有这个字符串那么就开始匹配代理
target: 'http://localhost:8080/', // 地址可以是域名也可以是IP地址。比如API请求/api/getList, 会被代理到请求http://www.baidu.com/api/getList 。 target: 'http://localhost:8000/', // 地址可以是域名也可以是IP地址。比如API请求/api/getList, 会被代理到请求http://www.baidu.com/api/getList 。
ws: false, ws: false,
changeOrigin: true // 如果target是域名需要额外添加一个参数changeOrigin: true否则会代理失败。 changeOrigin: true // 如果target是域名需要额外添加一个参数changeOrigin: true否则会代理失败。
, pathRewrite: { , pathRewrite: {