Commit 13ac7392 authored by ztf's avatar ztf

修改项目状态,项目跳转至项目要素页面相关组件修改

parent ab2b5e19
<template>
<div class="project">
<dee-as-com
:lay-config="layConfig"
:basic-data="projectObj"
/>
</div>
</template>
<script>
export default {
name: 'ChangeProjectState',
componentName: '修改项目状态333',
props: {
basicData: {
type: Object,
default: () => ({})
}
},
data() {
return {
}
},
computed: {
projectObj() {
return this.basicData && this.basicData.id ? this.basicData : { id: '' }
},
currentModelName() {
return this.basicData.subTypeName
},
layConfig() {
const configMap = {
'ExtProgram': { typeName: 'ExtProgram', layKey: 'updateState' },
'DxContext': { typeName: 'DxContext', layKey: 'updateState' },
'DxContextProject': { typeName: 'DxContextProject', layKey: 'updateState' }
}
return configMap[this.currentModelName] || {}
}
},
mounted() {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<div class="project">
<dee-as-com
:lay-config="{
typeName: 'ExtProgram',
layKey: 'updateState'
}"
:form="form"
@on-submit="toSubmit"
@on-cancel="cancel"
/>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
name: 'ChangeProjectState',
componentName: '修改项目状态',
props: {
basicData: {
type: Object,
default: () => ({})
}
},
data() {
return {
form: {},
subTypeName: this.basicData.subTypeName
}
},
mounted() {
this.getInitData()
},
methods: {
getInitData() {
const subTypeName = this.basicData.subTypeName
const id = this.basicData.id
const params = {
'searchItems': {
'children': [],
'items': [{
'fieldName': 'id',
'operator': 'EQ',
'value': id
}],
'operator': 'AND'
}
}
post(`/${subTypeName}/search`, params).then(res => {
this.form = res.items.content[0]
})
},
toSubmit() {
const id = this.form.id
const status = this.form.state
if (this.subTypeName === 'ExtProgram') {
post(`/ExtProgram/lifecycle/changeStatus?id=${id}&status=${status}&isValid=true`).then(res => {
this.$emit('completeEven')
})
} else if (this.subTypeName === 'DxContext' || this.subTypeName === 'DxContextProject') {
post(`/DxContextProject/lifecycle/changeStatus?id=${id}&status=${status}&isValid=true`).then(res => {
// this.$utils.showMessageSuccess(`修改状态成功`)
this.$emit('completeEven')
})
}
},
cancel() {
this.$emit('cancel')
}
}
}
</script>
<style lang="scss" scoped>
</style>
......@@ -6,10 +6,10 @@
layKey: 'defaultEdit'
}"
:form="form"
:basic-data="basicDataCmp"
@on-submit="toSubmit"
@on-cancel="cancel"
/>
<!-- -->
</div>
......@@ -28,68 +28,55 @@ export default {
},
data() {
return {
// eslint-disable-next-line vue/no-dupe-keys
form: {},
subTypeName: 'ExtProgram',
subTypeName: this.basicData.subTypeName,
projectCategory: ''
}
},
computed: {
basicDataCmp() {
return {
secretCode: this.basicData.secretCode,
id: this.basicData.id,
subTypeName: this.basicData.subTypeName,
// dxPlanId: this.basicData.dxPlanId,
// dxContextId: this.basicData.dxProjectItem && this.basicData.dxProjectItem.dxContextId,
// lifecycleTemplateId: this.basicData.lifecycleTemplateId,
state: this.basicData.state
}
}
},
watch: {
'form.projectCategory': {
immediate: true,
deep: true,
handler(val) {
//
console.log('监听项目分类', val)
if (val) {
if (val === 'program') {
this.projectCategory = 'program'
} else if (val === 'project') {
this.projectCategory = 'project'
} else if (val === 'childProject') {
this.projectCategory = 'childProject'
}
}
}
}
mounted() {
this.getInitData()
},
methods: {
getInitData() {
const id = this.basicData.id
const params = {
'searchItems': {
'children': [],
'items': [{
'fieldName': 'id',
'operator': 'EQ',
'value': id
}],
'operator': 'AND'
},
'openProps': [
{ 'name': 'extProgramProjectLinks', 'openProps': [{ 'name': 'target' }] }]
}
post(`/${this.subTypeName}/search`, params).then(res => {
this.form = res.items.content[0]
console.log('this.form', this.form)
})
},
toSubmit() {
console.log('进来了')
if (this.projectCategory === 'program') {
console.log('是项目群')
const params = this.form
if (this.subTypeName === 'ExtProgram') {
const params = { ...this.form, operator: 'MODIFY' }
post('/ExtProgram/recursion', params).then(res => {
this.$utils.showMessageSuccess(`添加成功`)
this.$utils.showMessageSuccess(`编辑成功`)
this.$emit('completeEven')
})
} else if (this.projectCategory === 'project') {
console.log('是项目')
const id = this.form.extProgram.id
delete this.form.extProgram
} else if (this.subTypeName === 'DxContext') {
const id = this.form.extProgramProjectLinks[0].id
delete this.form.extProgramProjectLinks
delete this.form.dxType
const params = {
subTypeName: 'DxContextProject',
id: id,
extProgramProjectLinks: [{
operator: 'ADD',
operator: 'MODIFY',
target: {
dxType: 'project',
...this.form,
operator: 'ADD',
dxType: 'project',
operator: 'MODIFY',
parentId: 0,
parentName: 'Root',
state: 'edit'
......@@ -98,12 +85,12 @@ export default {
operator: 'NO_CHANGE'
}
post('/ExtProgram/recursion', params).then(res => {
this.$utils.showMessageSuccess(`添加成功`)
this.$utils.showMessageSuccess(`编辑成功`)
this.$emit('completeEven')
})
} else if (this.projectCategory === 'childProject') {
} else if (this.subTypeName === 'DxContextProject') {
console.log('是子项')
const parentId = this.form.extProject.id
const parentId = this.form.parentId
delete this.form.extProgram
delete this.form.extProject
delete this.form.dxType
......@@ -111,13 +98,13 @@ export default {
const params = {
parentId: parentId,
subTypeName: 'DxContextProject',
operator: 'ADD',
operator: 'MODIFY',
state: 'edit',
modelName: 'DxContextProject',
...this.form
}
post('/DxContextProject/recursion', params).then(res => {
this.$utils.showMessageSuccess(`添加成功`)
this.$utils.showMessageSuccess(`编辑成功`)
this.$emit('completeEven')
})
}
......
<template>
<div :class="currentValue.class" @click="ToRelatedPage">{{ currentValue.name }}</div>
<div :class="className" @click="ToRelatedPage">{{ currentValue }}</div>
</template>
<script>
......@@ -32,22 +32,24 @@ export default {
data() {
return {
//
currentValue: this.value ? this.value.number || this.value : null,
className: this.scope.row.subTypeName === 'ExtProgram' ? 'default' : 'link',
form: null
}
},
computed: {
currentValue() {
if (!this.form) {
return { name: null, class: 'link' }
}
const isExtProgram = this.form.subTypeName === 'ExtProgram'
const className = isExtProgram ? 'default' : 'link'
const name = this.value ? this.value.number || this.value : null
return {
name,
class: className
}
}
// currentValue() {
// if (!this.form) {
// return { name: null, class: 'link' }
// }
// const isExtProgram = this.form.subTypeName === 'ExtProgram'
// const className = isExtProgram ? 'default' : 'link'
// const name = this.value ? this.value.number || this.value : null
// return {
// name,
// class: className
// }
// }
},
watch: {
'scope.row': {
......@@ -55,37 +57,23 @@ export default {
deep: true,
handler(val) {
this.form = val
console.log('this.form', this.form)
// console.log('this.form', this.form)
}
}
},
mounted() {
// this.getCurrentValue()
},
methods: {
// getCurrentValue() {
// if (this.form.subTypeName !== 'ExtProgram') {
// this.currentValue = {
// name: this.value ? this.value.number || this.value : null,
// class: 'link'
// }
// } else {
// this.currentValue = {
// name: this.value ? this.value.number || this.value : null,
// class: 'default'
// }
// }
// },
ToRelatedPage() {
if (this.form.subTypeName !== 'ExtProgram') {
console.log('this.form列表数据', this.form)
// console.log('this.form列表数据', this.form)
const name = this.form.name
const id = this.form.id
const pageNumber = '7cbdc38f-0122-4e78-b162-57601a33bb7a'
const title = '项目要素'
const subTypeName = this.form.subTypeName
this.$router.push({
path: `/page/${pageNumber}/${id}?title=${title}&id=${id}&name=${name}`,
path: `/page/${pageNumber}/${id}?type=${subTypeName}&title=${title}&id=${id}&name=${name}`,
query: { name: name, id: id }
})
}
......
......@@ -59,15 +59,16 @@ export default {
treeData: [],
isEdit: false,
basicData: null,
projectTitle: `${this.$route.query.projectCode} - ${this.$route.query.name}`,
projectTitle: `${this.$route.query.name}`,
isShowTooltip: false,
planDetail: {
subTypeName: this.$route.query.type,
name: this.projectTitle,
disabled: false,
planId: this.$route.query.id,
id: this.$route.query.id,
componentType: 'formConfig',
formConfigType: 'page',
pageKey: '1cab3884-adf2-4b58-acab-2b3d50df78e3'
pageKey: this.$route.query.type === 'DxContext' ? '79edd06e-3a7d-440e-bb4f-4b7691f7a641' : 'e32bab11-07c1-42b9-9ce7-d00d12c3b680'
}
}
},
......
......@@ -2,7 +2,7 @@
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-09-02 09:44:58
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-09-06 17:35:03
* @LastEditTime: 2024-09-12 18:44:44
*/
export default {
props: {},
......@@ -17,7 +17,7 @@ export default {
{
disabled: false,
name: '计划',
planId: this.$route.query.id,
id: this.$route.query.id,
icon: '/icons/dee-project/plan.png',
componentType: 'formConfig',
formConfigType: 'page',
......@@ -25,7 +25,7 @@ export default {
children: [
{
name: '进度计划',
planId: this.$route.query.id,
id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
......@@ -34,7 +34,7 @@ export default {
},
{
name: '采购计划',
planId: this.$route.query.id,
id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
......@@ -43,7 +43,7 @@ export default {
},
{
name: 'IED计划',
planId: this.$route.query.id,
id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
......@@ -52,7 +52,7 @@ export default {
},
{
name: '接口计划',
planId: this.$route.query.id,
id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
......@@ -62,7 +62,7 @@ export default {
},
{
name: '团队',
planId: this.$route.query.id,
id: this.$route.query.id,
componentName: 'PlanTeam',
icon: '/icons/dee-project/team.png',
componentType: 'formConfig',
......@@ -72,7 +72,7 @@ export default {
},
{
name: '经费',
planId: this.$route.query.id,
id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
......@@ -80,7 +80,7 @@ export default {
},
{
name: '基线',
planId: this.$route.query.id,
id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
......@@ -89,7 +89,7 @@ export default {
{
name: '文档',
planId: this.$route.query.id,
id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
......@@ -97,7 +97,7 @@ export default {
},
{
name: '归档',
planId: this.$route.query.id,
id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
......
......@@ -2,7 +2,7 @@
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-08-29 11:42:37
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-09-12 09:21:12
* @LastEditTime: 2024-09-12 18:59:27
-->
<template>
<div>
......@@ -18,7 +18,7 @@
/>
</el-select> -->
<!--input输入-->
<el-input v-model="project" placeholder="请输入" @input="handleChange" />
<el-input v-model="form.name" placeholder="请输入" @input="handleChange" />
<img
v-if="showIcon"
class="icon"
......@@ -55,7 +55,7 @@ export default {
},
data() {
return {
project: '',
// project: '',
dialogShow: false,
showIcon: false,
projectList: [],
......@@ -64,7 +64,8 @@ export default {
},
watch: {
value(val) {
this.project = val
// this.project = val
console.log('val', val)
this.$emit('input', val)
},
'form.projectCategory': {
......@@ -79,6 +80,9 @@ export default {
}
},
mounted() {
console.log('form', this.form)
},
methods: {
handleClickOpen() {
this.dialogShow = true
......
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