项目管理Form表单更新
This commit is contained in:
parent
1818eb00ee
commit
ef74dfef4a
|
@ -1,7 +1,7 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
const projectApi = {
|
const projectApi = {
|
||||||
add: 'project/add',
|
add: 'project/addOrUpdate',
|
||||||
getDict:'project/dict/get',
|
getDict:'project/dict/get',
|
||||||
list: 'project/pageList',
|
list: 'project/pageList',
|
||||||
get: 'project/get',
|
get: 'project/get',
|
||||||
|
|
|
@ -350,8 +350,6 @@ export default {
|
||||||
.detail-layout {
|
.detail-layout {
|
||||||
margin-left: unset;
|
margin-left: unset;
|
||||||
}
|
}
|
||||||
.text {
|
|
||||||
}
|
|
||||||
.status-list {
|
.status-list {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,14 @@
|
||||||
<a-button v-if="hasPerm('project:add')" type="primary" icon="plus" @click="handledCreate">新增项目</a-button>
|
<a-button v-if="hasPerm('project:add')" type="primary" icon="plus" @click="handledCreate">新增项目</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
|
|
||||||
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData" :pageNum="Number(this.$route.query.projectPageNum) || 1">
|
<s-table
|
||||||
|
ref="table"
|
||||||
|
size="default"
|
||||||
|
rowKey="id"
|
||||||
|
:columns="columns"
|
||||||
|
:data="loadData"
|
||||||
|
:pageNum="Number(this.$route.query.projectPageNum) || 1"
|
||||||
|
>
|
||||||
<span slot="serial" slot-scope="text, record, index">
|
<span slot="serial" slot-scope="text, record, index">
|
||||||
{{ index + 1 }}
|
{{ index + 1 }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -50,12 +57,11 @@
|
||||||
<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-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>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
<a-divider type="vertical" />
|
|
||||||
<a v-if="hasPerm('project:list')" href="javascript:;" @click="handleDetail(record)">详情</a>
|
|
||||||
<a-divider type="vertical" />
|
|
||||||
</template>
|
</template>
|
||||||
</span>
|
</span>
|
||||||
</s-table>
|
</s-table>
|
||||||
|
@ -129,20 +135,43 @@ export default {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {},
|
//生命周期 - 创建完成
|
||||||
|
created() {
|
||||||
|
this.changeType()
|
||||||
|
},
|
||||||
|
//生命周期 - 销毁完成
|
||||||
|
destroyed() {},
|
||||||
|
// 监控data中的数据变化
|
||||||
|
watch: {
|
||||||
|
$route(to, from) { //to是前往的路由 from是去往的路由 同一个组件只会渲染一次
|
||||||
|
this.changeType(to.path)
|
||||||
|
this.$refs.table.refresh(true)
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 增
|
// 增
|
||||||
handledCreate(record) {
|
handledCreate(record) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/project/projectStepForm',
|
path: '/project/projectStepForm',
|
||||||
query: {
|
query: {
|
||||||
|
t: this.queryParam.type, //自主项目还是系统项目,控制路由跳转
|
||||||
projectId: record.id, //项目id
|
projectId: record.id, //项目id
|
||||||
projectQueryParam: this.queryParam, //查询参数
|
projectQueryParam: this.queryParam, //查询参数
|
||||||
projectPageNum: this.$refs.table.localPagination.current //当前页
|
projectPageNum: this.$refs.table.localPagination.current, //当前页
|
||||||
}
|
},
|
||||||
});
|
})
|
||||||
}
|
},
|
||||||
}
|
//变更类型
|
||||||
|
changeType(path) {
|
||||||
|
var arr = []
|
||||||
|
if(path){
|
||||||
|
arr = path.split('/')
|
||||||
|
}else{
|
||||||
|
arr = this.$route.path.split('/')
|
||||||
|
}
|
||||||
|
this.queryParam.type = arr[arr.length - 1]
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</a-steps>
|
</a-steps>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<!-- <keep-alive exclude="result"> -->
|
<!-- <keep-alive exclude="result"> -->
|
||||||
<step1 v-if="currentTab === 0" :projectForm="form" @nextStep="nextStep" />
|
<step1 v-if="currentTab === 0" :projectForm="form" @nextStep="nextStep" @close="close" />
|
||||||
<step2 v-if="currentTab === 1" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
<step2 v-if="currentTab === 1" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
||||||
<step3 v-if="currentTab === 2" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
<step3 v-if="currentTab === 2" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
||||||
<step4 v-if="currentTab === 3" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
<step4 v-if="currentTab === 3" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
||||||
|
@ -52,7 +52,7 @@ export default {
|
||||||
},
|
},
|
||||||
//生命周期 - 创建完成(可以访问当前this实例)
|
//生命周期 - 创建完成(可以访问当前this实例)
|
||||||
created() {
|
created() {
|
||||||
console.log('分步表单创建完成')
|
console.log('分步表单创建完成',this.$route)
|
||||||
if (this.$route.query.projectId) {
|
if (this.$route.query.projectId) {
|
||||||
getProjectDetail({ id: this.$route.query.projectId }).then((res) => {
|
getProjectDetail({ id: this.$route.query.projectId }).then((res) => {
|
||||||
this.form = res.data
|
this.form = res.data
|
||||||
|
@ -66,6 +66,8 @@ export default {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
currentTab: 0,
|
currentTab: 0,
|
||||||
|
sourcePath: '',
|
||||||
|
t: '',
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 6 },
|
sm: { span: 6 },
|
||||||
|
@ -79,6 +81,7 @@ export default {
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
type: '',
|
type: '',
|
||||||
form: {
|
form: {
|
||||||
|
t: this.$route.query.t,
|
||||||
trainWay: '2',
|
trainWay: '2',
|
||||||
totalScore: '100',
|
totalScore: '100',
|
||||||
},
|
},
|
||||||
|
@ -139,11 +142,13 @@ export default {
|
||||||
},
|
},
|
||||||
//关闭页面,跳转list页面
|
//关闭页面,跳转list页面
|
||||||
close() {
|
close() {
|
||||||
|
console.log('close------', this.$route.query.t)
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/project/list',
|
path: '/project/list/'+this.$route.query.t,
|
||||||
query:{
|
query: {
|
||||||
|
t: this.$route.query.t,
|
||||||
}
|
queryParam: this.$route.query.projectQueryParam,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -155,14 +155,8 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
this.$router.push({
|
console.log('Form返回list页面')
|
||||||
path: '/project/list',
|
this.$emit('close');
|
||||||
})
|
|
||||||
},
|
|
||||||
add(type) {
|
|
||||||
this.modalTitle = '新增菜单'
|
|
||||||
this.visible = true
|
|
||||||
this.formLoading = false
|
|
||||||
},
|
},
|
||||||
//获取字典值,请求查询培训种类
|
//获取字典值,请求查询培训种类
|
||||||
fetchTemplateData() {
|
fetchTemplateData() {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<a-result :status="projectSaveStatus" :title="projectSaveStatus" :sub-title="description">
|
<a-result :status="projectSaveStatus" :title="projectSaveStatus" :sub-title="description">
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<a-button type="primary" @click="toPrev">返回修改</a-button>
|
|
||||||
<a-button type="primary" @click="toProjectList">去列表页</a-button>
|
<a-button type="primary" @click="toProjectList">去列表页</a-button>
|
||||||
</template>
|
</template>
|
||||||
</a-result>
|
</a-result>
|
||||||
|
@ -45,8 +44,12 @@ export default {
|
||||||
},
|
},
|
||||||
toProjectList() {
|
toProjectList() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/project/list',
|
path: '/project/list'+this.$route.query.t,
|
||||||
query: { projectPageNum: 1 },
|
query: {
|
||||||
|
t: this.$route.query.t,
|
||||||
|
projectPageNum: 1 ,
|
||||||
|
queryParam: this.$route.query.projectQueryParam,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue