项目管理表单更新
This commit is contained in:
parent
55aefae2e6
commit
f1097f3fc6
|
@ -1,4 +1,11 @@
|
|||
<template>
|
||||
<a-card :bordered="false" title="项目课程信息">
|
||||
<template slot="extra">
|
||||
<a-button type="primary" size="default" @click="toNext">下一步</a-button>
|
||||
</template>
|
||||
<template slot="extra">
|
||||
<a-button type="primary" size="default" @click="toPrep">上一步</a-button>
|
||||
</template>
|
||||
<a-space direction="vertical" style="width: 100%">
|
||||
<a-space direction="horizontal">
|
||||
<span>总课时:{{ totalHours }}, 总学时要求:{{ totalLearnHours }}, 总题目数量:{{ totalTopicNum }} </span>
|
||||
|
@ -39,12 +46,9 @@
|
|||
</template>
|
||||
</span>
|
||||
</s-table>
|
||||
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
|
||||
<a-button type="primary" @click="toNext"> 下一步 </a-button>
|
||||
<a-button style="margin-left: 10px" @click="toPrep"> 上一步 </a-button>
|
||||
</a-form-model-item>
|
||||
<project-course-select ref="CourseSelect"></project-course-select>
|
||||
</a-space>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -97,7 +101,6 @@ export default {
|
|||
} else {
|
||||
/** 新建的没有项目id,传当前的所选的课程id */
|
||||
return getCourseListByCourseIds(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||
|
||||
return res.data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
<template>
|
||||
<!-- <page-header-wrapper :title="新增项目">
|
||||
v-decorator="['form.XXX', { rules: [{ required: true, message: '项目名称为必填' }] }]"-->
|
||||
<a-card :bordered="false" title="项目基本信息">
|
||||
<template slot="extra">
|
||||
<a-button type="primary" size="default" @click="toNext">下一步</a-button>
|
||||
</template>
|
||||
<template slot="extra">
|
||||
<a-button type="primary" size="default" @click="close">退出</a-button>
|
||||
</template>
|
||||
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" layout="horizontal">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24" :sm="24">
|
||||
|
@ -109,13 +114,9 @@
|
|||
<a-input v-model="form.remark" type="textarea" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
|
||||
<a-button type="primary" @click="toNext"> 下一步 </a-button>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
</a-card>
|
||||
<!-- </page-header-wrapper> -->
|
||||
<!-- <class-list ref="ClassList"></class-list> -->
|
||||
</template>
|
||||
|
@ -153,6 +154,11 @@ export default {
|
|||
this.getTrainClass()
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$router.push({
|
||||
path: '/project/list',
|
||||
})
|
||||
},
|
||||
add(type) {
|
||||
this.modalTitle = '新增菜单'
|
||||
this.visible = true
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<template>
|
||||
<div>
|
||||
<a-card :bordered="false" title="项目人员信息">
|
||||
<template slot="extra">
|
||||
<a-button type="primary" size="default" @click="toNext">下一步</a-button>
|
||||
</template>
|
||||
<template slot="extra">
|
||||
<a-button type="primary" size="default" @click="toPrev">上一步</a-button>
|
||||
</template>
|
||||
<a-row type="flex" justify="center" align="top">
|
||||
<a-col :span="4" id="tree">
|
||||
<a-page-header title="单位列表" sub-title="" />
|
||||
|
@ -58,9 +64,7 @@
|
|||
</a-col>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-button type="primary" @click="toNext">下一步</a-button>
|
||||
<a-button type="primary" @click="toPrev">上一步</a-button>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -81,7 +85,7 @@ export default {
|
|||
props: {
|
||||
projectForm: {
|
||||
type: Object,
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
// 这里存放数据
|
||||
|
@ -93,8 +97,8 @@ export default {
|
|||
expandedKeys: [],
|
||||
autoExpandParent: true,
|
||||
defaultExpandedKeys: [],
|
||||
selectedRowKeys: [],
|
||||
selectedRows: [],
|
||||
selectedRowKeys: this.projectForm.personIds || [],
|
||||
selectedRows: this.projectForm.projectPersonLists || [],
|
||||
orgTree: [],
|
||||
orgId: '',
|
||||
orgType: 1,
|
||||
|
@ -123,11 +127,13 @@ export default {
|
|||
methods: {
|
||||
//下一步
|
||||
toNext() {
|
||||
this.form.projectPersonLists = this.selectedRows
|
||||
this.form.personIds = this.selectedRowKeys
|
||||
this.$emit('nextStep', this.form)
|
||||
},
|
||||
//上一步
|
||||
toPrev() {
|
||||
this.form.projectPersonLists = this.selectedRows
|
||||
this.form.personIds = this.selectedRowKeys
|
||||
this.$emit('prevStep', this.form)
|
||||
},
|
||||
|
@ -186,7 +192,6 @@ export default {
|
|||
//编辑时初始化人员列表初始化
|
||||
initPersonList() {
|
||||
if (this.form.personIds) {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
<template>
|
||||
<div>
|
||||
<a-form-model :model="form" v-bind="formItemLayout">
|
||||
<a-card :bordered="false" title="组卷策略信息">
|
||||
<template slot="extra">
|
||||
<a-button type="primary" size="default" @click="toPrev">上一步</a-button>
|
||||
</template>
|
||||
<template slot="extra">
|
||||
<a-button type="primary" size="default" @click="toSave">保存</a-button>
|
||||
</template>
|
||||
<template slot="extra">
|
||||
<a-button type="primary" size="default" @click="toIssue">发布</a-button>
|
||||
</template>
|
||||
<a-form-model :model="form" v-bind="formItemLayout">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="10" :sm="12">
|
||||
<a-form-model-item label="总分">
|
||||
|
@ -9,7 +17,7 @@
|
|||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :md="14" :sm="12">
|
||||
<a-form-model-item label="及格分">
|
||||
<a-form-model-item label="及格分数">
|
||||
<a-input-number v-model="form.passScore" :min="1" :max="100" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
|
@ -34,10 +42,9 @@
|
|||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
|
||||
<a-card :bordered="false" title="组卷策略详情">
|
||||
<a-table :columns="columns" :data-source="tableData" bordered>
|
||||
<a-table :columns="columns" :data-source="tableData" bordered :position="{ disabled: false }">
|
||||
<template slot="topicNum" slot-scope="text, record">
|
||||
<a-input-number style="margin: -5px 0" v-model="record.topicNum" />
|
||||
</template>
|
||||
|
@ -47,25 +54,12 @@
|
|||
</a-table>
|
||||
</a-card>
|
||||
</a-form-model>
|
||||
<a-button type="primary" @click="toSave">保 存</a-button>
|
||||
<a-button type="primary" @click="toIssue">发 布</a-button>
|
||||
<a-button type="primary" @click="toPrev">上一步</a-button>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
||||
// 例如:import 《组件名称》 from '《组件路径》'
|
||||
const renderContent = (value, row, index) => {
|
||||
const obj = {
|
||||
children: value,
|
||||
attrs: {},
|
||||
}
|
||||
if (index === 4) {
|
||||
obj.attrs.colSpan = 0
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
export default {
|
||||
// import引入的组件需要注入到对象中才能使用
|
||||
|
@ -115,8 +109,7 @@ export default {
|
|||
},
|
||||
},
|
||||
],
|
||||
tableData: this.projectForm.testPaperTactics ||
|
||||
[
|
||||
tableData: this.projectForm.testPaperTactics || [
|
||||
{
|
||||
i: 1,
|
||||
topicType: 1,
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
<template>
|
||||
<a-form-model :model="form">
|
||||
<!-- showSearch -->
|
||||
<!-- height: '500px',overflowY: 'auto' -->
|
||||
|
||||
<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">
|
||||
<a-button type="primary" size="default" @click="toPrep">上一步</a-button>
|
||||
</template>
|
||||
<template type="primary" v-if="form.trainWay === '1'" slot="extra">
|
||||
<a-button size="default" @click="close">完成</a-button>
|
||||
</template>
|
||||
<a-transfer
|
||||
class="tree-transfer"
|
||||
:data-source="dataSource"
|
||||
|
@ -14,8 +22,7 @@
|
|||
:filter-option="filterOption"
|
||||
@change="onChange"
|
||||
>
|
||||
<template slot="children" slot-scope="{ props: { direction, selectedKeys }, on: { itemSelect } }">
|
||||
<!-- checkStrictly -->
|
||||
<template slot="children" slot-scope="{ props: { direction, selectedKeys }, on: { itemSelect, itemSelectAll } }">
|
||||
<a-tree
|
||||
v-if="direction === 'left'"
|
||||
blockNode
|
||||
|
@ -36,66 +43,16 @@
|
|||
/>
|
||||
</template>
|
||||
</a-transfer>
|
||||
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
|
||||
<a-button type="primary" @click="toNext"> 下一步 </a-button>
|
||||
<a-button style="margin-left: 10px" @click="toPrep">上一步</a-button>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
const treeData = [
|
||||
{
|
||||
title: '三峡大学',
|
||||
key: '0001',
|
||||
children: [
|
||||
{ title: '三峡大学文学院', key: '00010001' },
|
||||
{
|
||||
title: '三峡大学水利学院',
|
||||
key: '00010002',
|
||||
children: [
|
||||
{ title: '三峡大学水利学院第一学院', key: '000100020001' },
|
||||
{ title: '三峡大学水利学院第二学院', key: '000100020002' },
|
||||
{ title: '三峡大学水利学院第三学院', key: '000100020003' },
|
||||
{ title: '三峡大学水利学院第四学院', key: '000100020004' },
|
||||
{ title: '三峡大学水利学院第五学院', key: '000100020005' },
|
||||
{ title: '三峡大学水利学院第六学院', key: '000100020006' },
|
||||
{ title: '三峡大学水利学院第一学院', key: '000100020007' },
|
||||
{ title: '三峡大学水利学院第二学院', key: '000100020008' },
|
||||
{ title: '三峡大学水利学院第三学院', key: '000100020009' },
|
||||
{ title: '三峡大学水利学院第四学院', key: '000100020010' },
|
||||
{ title: '三峡大学水利学院第五学院', key: '000100020011' },
|
||||
{ title: '三峡大学水利学院第六学院', key: '000100020012' },
|
||||
{ title: '三峡大学水利学院第一学院', key: '000100020013' },
|
||||
{ title: '三峡大学水利学院第二学院', key: '000100020014' },
|
||||
{ title: '三峡大学水利学院第三学院', key: '000100020015' },
|
||||
{ title: '三峡大学水利学院第四学院', key: '000100020016' },
|
||||
{ title: '三峡大学水利学院第五学院', key: '000100020017' },
|
||||
{ title: '三峡大学水利学院第六学院', key: '000100020018' },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
const transferDataSource = []
|
||||
function flatten(list = []) {
|
||||
// console.log('执行了flatten函数:list', list)
|
||||
list.forEach((item) => {
|
||||
transferDataSource.push(item)
|
||||
flatten(item.children)
|
||||
})
|
||||
}
|
||||
flatten(JSON.parse(JSON.stringify(treeData)))
|
||||
|
||||
function isChecked(selectedKeys, eventKey) {
|
||||
// console.log('执行了isChecked函数:', eventKey, selectedKeys)
|
||||
return selectedKeys.indexOf(eventKey) !== -1
|
||||
}
|
||||
import { orgList } from '@/api/org/org'
|
||||
import { listToTree } from '@/utils/util'
|
||||
|
||||
//复制过来的方法
|
||||
function handleTreeData(data, targetKeys = []) {
|
||||
// console.log('执行了handleTreeData函数:', data, targetKeys)
|
||||
data.forEach((item) => {
|
||||
item['disabled'] = targetKeys.includes(item.key)
|
||||
if (item.children) {
|
||||
|
@ -105,6 +62,10 @@ function handleTreeData(data, targetKeys = []) {
|
|||
return data
|
||||
}
|
||||
|
||||
function isChecked(selectedKeys, eventKey) {
|
||||
return selectedKeys.indexOf(eventKey) !== -1;
|
||||
}
|
||||
|
||||
export default {
|
||||
props: {
|
||||
projectForm: {
|
||||
|
@ -115,41 +76,47 @@ export default {
|
|||
return {
|
||||
form: this.projectForm,
|
||||
targetKeys: [],
|
||||
dataSource: transferDataSource,
|
||||
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadData: (parameter) => {
|
||||
console.log('加载数据方法', parameter)
|
||||
return transferDataSource
|
||||
// return getProjectList(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||
// return res
|
||||
// })
|
||||
},
|
||||
dataSource: [],
|
||||
treeData: [],
|
||||
checkedKeys:[],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log('第2个表单创建了')
|
||||
this.getSourceList()
|
||||
},
|
||||
computed: {
|
||||
treeData() {
|
||||
treeDataComputed() {
|
||||
return handleTreeData(treeData, this.targetKeys)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
//获取数据源
|
||||
getSourceList(orgType) {
|
||||
return orgList({ orgType: orgType || 1 }).then((res) => {
|
||||
if (res.data) {
|
||||
res.data.forEach((item) => {
|
||||
this.dataSource.push({
|
||||
key: item.id,
|
||||
title: item.name,
|
||||
children: [],
|
||||
pid: item.pid
|
||||
})
|
||||
})
|
||||
console.log('dataSource', this.dataSource)
|
||||
this.treeData = listToTree(this.dataSource, [], 0)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//下一步
|
||||
toNext() {
|
||||
this.form.unitIds = this.targetKeys
|
||||
console.log('toNext', this.form)
|
||||
this.$emit('nextStep', this.form)
|
||||
// const {
|
||||
// form: { validateFields },
|
||||
// } = this
|
||||
// // 先校验,通过表单校验后,才进入下一步
|
||||
// validateFields((err, values) => {
|
||||
// if (!err) {
|
||||
// this.$emit('nextStep',this.form)
|
||||
// }
|
||||
// })
|
||||
},
|
||||
|
||||
//上一步
|
||||
toPrep() {
|
||||
this.form.unitIds = this.targetKeys
|
||||
console.log('toPrep', this.form)
|
||||
|
|
Loading…
Reference in New Issue