项目管理表单调整
This commit is contained in:
parent
d966101089
commit
1dd3235872
|
@ -4,7 +4,8 @@ const projectApi = {
|
|||
add: 'project/add',
|
||||
getDict:'project/dict/get',
|
||||
list: 'project/pageList',
|
||||
projectCourseList: ''
|
||||
get: 'project/get',
|
||||
projectCourseList: '',
|
||||
}
|
||||
|
||||
export function projectAdd (params) {
|
||||
|
@ -21,6 +22,7 @@ export function dictGet (params) {
|
|||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function getProjectList (params) {
|
||||
return request({
|
||||
url: projectApi.list,
|
||||
|
@ -28,3 +30,13 @@ export function getProjectList (params) {
|
|||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function getProjectDetail (params) {
|
||||
return request({
|
||||
url: projectApi.get,
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -48,13 +48,13 @@
|
|||
</span>
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<template>
|
||||
<a v-if="hasPerm('project:edit')" href="javascript:;" @click="$refs.projectStepForm.edit(record)">修改</a>
|
||||
<a v-if="hasPerm('project:edit')" href="javascript:;" @click="handledCreate(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="是否删除?" @confirm="() => handleDelete(record)">
|
||||
<a v-if="hasPerm('project:del')" href="javascript:;">删除</a>
|
||||
</a-popconfirm>
|
||||
<a-divider type="vertical" />
|
||||
<a href="javascript:;" @click="handleDetail(record)">详情</a>
|
||||
<a v-if="hasPerm('project:list')" href="javascript:;" @click="handleDetail(record)">详情</a>
|
||||
<a-divider type="vertical" />
|
||||
</template>
|
||||
</span>
|
||||
|
@ -136,9 +136,9 @@ export default {
|
|||
this.$router.push({
|
||||
path: '/project/projectStepForm',
|
||||
query: {
|
||||
id: record.id,
|
||||
projectQueryParam: this.queryParam,
|
||||
projectPageNum: this.$refs.table.localPagination.current
|
||||
projectId: record.id, //项目id
|
||||
projectQueryParam: this.queryParam, //查询参数
|
||||
projectPageNum: this.$refs.table.localPagination.current //当前页
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
//页面
|
||||
import Step1 from './form/ProjectForm'
|
||||
import Step2 from './form/ProjectUnitSelect'
|
||||
import Step3 from './form/ProjectCourseList'
|
||||
|
@ -37,6 +38,9 @@ import Step4 from './form/ProjectPersonForm'
|
|||
import step5 from './form/ProjectTestPaperFormationStrategy'
|
||||
import result from './form/Result'
|
||||
|
||||
//api
|
||||
import { projectAdd, getProjectDetail } from '@/api/project/project'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Step1,
|
||||
|
@ -49,6 +53,11 @@ export default {
|
|||
//生命周期 - 创建完成(可以访问当前this实例)
|
||||
created() {
|
||||
console.log('分步表单创建完成')
|
||||
if (this.$route.query.projectId) {
|
||||
getProjectDetail({ id: this.$route.query.projectId }).then((res) => {
|
||||
this.form = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
console.log('分步表单销毁了。。。。。')
|
||||
|
@ -78,37 +87,32 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
// 新增打开页面初始化
|
||||
add(type) {
|
||||
this.modalTitle = '新增项目'
|
||||
this.visible = true
|
||||
this.formLoading = false
|
||||
},
|
||||
// 编辑打开页面初始化
|
||||
edit(record) {
|
||||
console.log(record)
|
||||
this.modalTitle = '编辑项目'
|
||||
this.visible = true
|
||||
this.formLoading = false
|
||||
},
|
||||
|
||||
//保存项目
|
||||
executeSave(childValue) {
|
||||
console.log('保存项目', childValue)
|
||||
if (true) {
|
||||
this.status = 'success'
|
||||
this.currentTab = 5
|
||||
}
|
||||
this.form = childValue
|
||||
this.saveData()
|
||||
},
|
||||
|
||||
//保存并发布项目
|
||||
executeIssue(childValue) {
|
||||
console.log('保存并发布项目', childValue)
|
||||
if (true) {
|
||||
this.status = 'error'
|
||||
this.currentTab = 5
|
||||
this.result = false
|
||||
}
|
||||
this.form = childValue
|
||||
this.saveData()
|
||||
},
|
||||
|
||||
//发送请求保存数据
|
||||
saveData() {
|
||||
projectAdd(Object.assign({}, this.form)).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.status = 'success'
|
||||
this.currentTab = 5
|
||||
} else {
|
||||
this.status = 'error'
|
||||
this.result = false
|
||||
this.currentTab = 5
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//下一步
|
||||
|
@ -133,13 +137,14 @@ export default {
|
|||
}
|
||||
console.log('ProjectStepForm表单数据', this.form)
|
||||
},
|
||||
//关闭页面,跳转list页面
|
||||
close() {
|
||||
this.$router.push({
|
||||
path: '/project/list',
|
||||
query:{
|
||||
|
||||
finish() {
|
||||
this.currentTab = 0
|
||||
},
|
||||
handleSubmit() {},
|
||||
handleCancel() {
|
||||
this.visible = false
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
</span>
|
||||
</s-table>
|
||||
</a-space>
|
||||
<project-course-select ref="CourseSelect" @selectKeyDataSubmit="selectKeyDataChange"></project-course-select>
|
||||
<project-course-select ref="CourseSelect" @selectKeyDataSubmit="selectKeyDataChange" :selectRows="selData"></project-course-select>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
|
@ -73,6 +73,7 @@ export default {
|
|||
//这里存放数据
|
||||
return {
|
||||
form: this.projectForm,
|
||||
selData:[],
|
||||
labelCol: {},
|
||||
wrapperCol: {},
|
||||
vertical: 'vertical',
|
||||
|
@ -80,11 +81,11 @@ export default {
|
|||
totalLearnHours: 0, //总学时
|
||||
totalTopicNum: 0, //题目数量
|
||||
queryParam: {
|
||||
ids: '1,2,3',
|
||||
ids: '',
|
||||
}, //查询数据
|
||||
columns: [
|
||||
{ title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } },
|
||||
{ title: '课程编号', dataIndex: 'courseNo', key: 'courseNo' },
|
||||
{ title: '课程编号', dataIndex: 'courseCode', key: 'courseCode' },
|
||||
{ title: '课程名称', dataIndex: 'courseName', key: 'courseName' },
|
||||
{ title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + 'H' },
|
||||
{ title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + 'H' },
|
||||
|
@ -96,12 +97,15 @@ export default {
|
|||
if (this.$route.query.projectId) {
|
||||
/** 编辑进来的有项目id */
|
||||
return getCourseList(this.$route.query.projectId).then((res) => {
|
||||
this.selData = res.data;
|
||||
this.calc(res.data)
|
||||
return res.data
|
||||
})
|
||||
} else {
|
||||
/** 新建的没有项目id,传当前的所选的课程id */
|
||||
return getCourseListByCourseIds(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||
this.selData = res.data;
|
||||
console.log('list页面----selData',this.selData)
|
||||
this.calc(res.data)
|
||||
return res.data
|
||||
})
|
||||
|
@ -152,12 +156,16 @@ export default {
|
|||
//初始化ids
|
||||
initIds() {
|
||||
console.log('this.projectForm.lessonIds',this.projectForm.lessonIds)
|
||||
let str = '';
|
||||
if(this.projectForm.lessonIds) str = this.projectForm.lessonIds.join(',')
|
||||
let str = [];
|
||||
if(this.projectForm.lessonIds) str = this.projectForm.lessonIds
|
||||
// let str = this.projectForm.lessonIds.join(',') || []
|
||||
console.log('initIds', str)
|
||||
if (str) {
|
||||
this.queryParam.ids = str
|
||||
if (str && str.length > 0) {
|
||||
let arr = [];
|
||||
str.forEach((item) => {
|
||||
arr.push(item.ids)
|
||||
})
|
||||
this.queryParam.ids = arr.join(',')
|
||||
}
|
||||
},
|
||||
//选择课程完毕,提交到list页面
|
||||
|
|
|
@ -72,7 +72,11 @@ export default {
|
|||
components: {
|
||||
STable,
|
||||
},
|
||||
props: {},
|
||||
props: {
|
||||
selectRows: {
|
||||
type: Array,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
// 这里存放数据
|
||||
return {
|
||||
|
@ -117,16 +121,21 @@ export default {
|
|||
console.log('课程选择打开了', record)
|
||||
this.modalTitle = '选择课程'
|
||||
this.visible = true
|
||||
console.log('selectRows-------------', this.selectRows)
|
||||
if (this.selectRows) {
|
||||
this.selectedRows = this.selectRows;
|
||||
this.selectedRowKeys = this.selectedRows.map((value) => value.id)
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
console.log('课程选择关闭')
|
||||
this.visible = false
|
||||
},
|
||||
handleSubmit() {
|
||||
console.log('课程选择提交了',this.selectedRowKeys)
|
||||
console.log('课程选择提交了', this.selectedRowKeys)
|
||||
this.visible = false
|
||||
if (this.selectedRowKeys) this.$emit('selectKeyDataSubmit',this.selectedRowKeys.join(','));
|
||||
else this.$emit('selectKeyDataSubmit','');
|
||||
if (this.selectedRowKeys) this.$emit('selectKeyDataSubmit', this.selectedRowKeys.join(','))
|
||||
else this.$emit('selectKeyDataSubmit', '')
|
||||
},
|
||||
|
||||
/** 表格行选中后触发 */
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
<a-row :gutter="24">
|
||||
<a-col :md="10" :sm="12">
|
||||
<a-form-model-item label="考试时长">
|
||||
<a-input-number v-model="form.examTime" />
|
||||
<a-input-number :min="0" v-model="form.examTime" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :md="14" :sm="12">
|
||||
<a-form-model-item label="默认组卷题量">
|
||||
<a-input-number v-model="form.topicNumber" />
|
||||
<a-input-number :min="0" v-model="form.topicNumber" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
@ -38,7 +38,7 @@
|
|||
<h4>考试开启条件:</h4>
|
||||
<a-col :md="10" :sm="12">
|
||||
<a-form-model-item label="学时时长">
|
||||
<a-input-number v-model="form.examOpenCondition" />
|
||||
<a-input-number :min="0" v-model="form.examOpenCondition" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
|
Loading…
Reference in New Issue