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 @@ ...@@ -6,10 +6,10 @@
layKey: 'defaultEdit' layKey: 'defaultEdit'
}" }"
:form="form" :form="form"
:basic-data="basicDataCmp"
@on-submit="toSubmit" @on-submit="toSubmit"
@on-cancel="cancel" @on-cancel="cancel"
/> />
<!-- -->
</div> </div>
...@@ -28,68 +28,55 @@ export default { ...@@ -28,68 +28,55 @@ export default {
}, },
data() { data() {
return { return {
// eslint-disable-next-line vue/no-dupe-keys
form: {}, form: {},
subTypeName: 'ExtProgram', subTypeName: this.basicData.subTypeName,
projectCategory: '' projectCategory: ''
} }
}, },
computed: { mounted() {
basicDataCmp() { this.getInitData()
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'
}
}
}
}
}, },
methods: { 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() { toSubmit() {
console.log('进来了') if (this.subTypeName === 'ExtProgram') {
if (this.projectCategory === 'program') { const params = { ...this.form, operator: 'MODIFY' }
console.log('是项目群')
const params = this.form
post('/ExtProgram/recursion', params).then(res => { post('/ExtProgram/recursion', params).then(res => {
this.$utils.showMessageSuccess(`添加成功`) this.$utils.showMessageSuccess(`编辑成功`)
this.$emit('completeEven') this.$emit('completeEven')
}) })
} else if (this.projectCategory === 'project') { } else if (this.subTypeName === 'DxContext') {
console.log('是项目') const id = this.form.extProgramProjectLinks[0].id
const id = this.form.extProgram.id delete this.form.extProgramProjectLinks
delete this.form.extProgram
delete this.form.dxType delete this.form.dxType
const params = { const params = {
subTypeName: 'DxContextProject', subTypeName: 'DxContextProject',
id: id, id: id,
extProgramProjectLinks: [{ extProgramProjectLinks: [{
operator: 'ADD', operator: 'MODIFY',
target: { target: {
dxType: 'project',
...this.form, ...this.form,
operator: 'ADD', dxType: 'project',
operator: 'MODIFY',
parentId: 0, parentId: 0,
parentName: 'Root', parentName: 'Root',
state: 'edit' state: 'edit'
...@@ -98,12 +85,12 @@ export default { ...@@ -98,12 +85,12 @@ export default {
operator: 'NO_CHANGE' operator: 'NO_CHANGE'
} }
post('/ExtProgram/recursion', params).then(res => { post('/ExtProgram/recursion', params).then(res => {
this.$utils.showMessageSuccess(`添加成功`) this.$utils.showMessageSuccess(`编辑成功`)
this.$emit('completeEven') this.$emit('completeEven')
}) })
} else if (this.projectCategory === 'childProject') { } else if (this.subTypeName === 'DxContextProject') {
console.log('是子项') console.log('是子项')
const parentId = this.form.extProject.id const parentId = this.form.parentId
delete this.form.extProgram delete this.form.extProgram
delete this.form.extProject delete this.form.extProject
delete this.form.dxType delete this.form.dxType
...@@ -111,13 +98,13 @@ export default { ...@@ -111,13 +98,13 @@ export default {
const params = { const params = {
parentId: parentId, parentId: parentId,
subTypeName: 'DxContextProject', subTypeName: 'DxContextProject',
operator: 'ADD', operator: 'MODIFY',
state: 'edit', state: 'edit',
modelName: 'DxContextProject', modelName: 'DxContextProject',
...this.form ...this.form
} }
post('/DxContextProject/recursion', params).then(res => { post('/DxContextProject/recursion', params).then(res => {
this.$utils.showMessageSuccess(`添加成功`) this.$utils.showMessageSuccess(`编辑成功`)
this.$emit('completeEven') this.$emit('completeEven')
}) })
} }
......
<template> <template>
<div :class="currentValue.class" @click="ToRelatedPage">{{ currentValue.name }}</div> <div :class="className" @click="ToRelatedPage">{{ currentValue }}</div>
</template> </template>
<script> <script>
...@@ -32,22 +32,24 @@ export default { ...@@ -32,22 +32,24 @@ export default {
data() { data() {
return { return {
// //
currentValue: this.value ? this.value.number || this.value : null,
className: this.scope.row.subTypeName === 'ExtProgram' ? 'default' : 'link',
form: null form: null
} }
}, },
computed: { computed: {
currentValue() { // currentValue() {
if (!this.form) { // if (!this.form) {
return { name: null, class: 'link' } // return { name: null, class: 'link' }
} // }
const isExtProgram = this.form.subTypeName === 'ExtProgram' // const isExtProgram = this.form.subTypeName === 'ExtProgram'
const className = isExtProgram ? 'default' : 'link' // const className = isExtProgram ? 'default' : 'link'
const name = this.value ? this.value.number || this.value : null // const name = this.value ? this.value.number || this.value : null
return { // return {
name, // name,
class: className // class: className
} // }
} // }
}, },
watch: { watch: {
'scope.row': { 'scope.row': {
...@@ -55,37 +57,23 @@ export default { ...@@ -55,37 +57,23 @@ export default {
deep: true, deep: true,
handler(val) { handler(val) {
this.form = val this.form = val
console.log('this.form', this.form) // console.log('this.form', this.form)
} }
} }
}, },
mounted() { mounted() {
// this.getCurrentValue()
}, },
methods: { 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() { ToRelatedPage() {
if (this.form.subTypeName !== 'ExtProgram') { if (this.form.subTypeName !== 'ExtProgram') {
console.log('this.form列表数据', this.form) // console.log('this.form列表数据', this.form)
const name = this.form.name const name = this.form.name
const id = this.form.id const id = this.form.id
const pageNumber = '7cbdc38f-0122-4e78-b162-57601a33bb7a' const pageNumber = '7cbdc38f-0122-4e78-b162-57601a33bb7a'
const title = '项目要素' const title = '项目要素'
const subTypeName = this.form.subTypeName
this.$router.push({ 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 } query: { name: name, id: id }
}) })
} }
......
...@@ -59,15 +59,16 @@ export default { ...@@ -59,15 +59,16 @@ export default {
treeData: [], treeData: [],
isEdit: false, isEdit: false,
basicData: null, basicData: null,
projectTitle: `${this.$route.query.projectCode} - ${this.$route.query.name}`, projectTitle: `${this.$route.query.name}`,
isShowTooltip: false, isShowTooltip: false,
planDetail: { planDetail: {
subTypeName: this.$route.query.type,
name: this.projectTitle, name: this.projectTitle,
disabled: false, disabled: false,
planId: this.$route.query.id, id: this.$route.query.id,
componentType: 'formConfig', componentType: 'formConfig',
formConfigType: 'page', 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 @@ ...@@ -2,7 +2,7 @@
* @Author: zhangtianfeng 3232807530@qq.com * @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-09-02 09:44:58 * @Date: 2024-09-02 09:44:58
* @LastEditors: zhangtianfeng 3232807530@qq.com * @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-09-06 17:35:03 * @LastEditTime: 2024-09-12 18:44:44
*/ */
export default { export default {
props: {}, props: {},
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
{ {
disabled: false, disabled: false,
name: '计划', name: '计划',
planId: this.$route.query.id, id: this.$route.query.id,
icon: '/icons/dee-project/plan.png', icon: '/icons/dee-project/plan.png',
componentType: 'formConfig', componentType: 'formConfig',
formConfigType: 'page', formConfigType: 'page',
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
children: [ children: [
{ {
name: '进度计划', name: '进度计划',
planId: this.$route.query.id, id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png', icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig', componentType: 'formConfig',
formConfigType: 'page', formConfigType: 'page',
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
}, },
{ {
name: '采购计划', name: '采购计划',
planId: this.$route.query.id, id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png', icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig', componentType: 'formConfig',
formConfigType: 'page', formConfigType: 'page',
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
}, },
{ {
name: 'IED计划', name: 'IED计划',
planId: this.$route.query.id, id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png', icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig', componentType: 'formConfig',
formConfigType: 'page', formConfigType: 'page',
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
}, },
{ {
name: '接口计划', name: '接口计划',
planId: this.$route.query.id, id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png', icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig', componentType: 'formConfig',
formConfigType: 'page', formConfigType: 'page',
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
}, },
{ {
name: '团队', name: '团队',
planId: this.$route.query.id, id: this.$route.query.id,
componentName: 'PlanTeam', componentName: 'PlanTeam',
icon: '/icons/dee-project/team.png', icon: '/icons/dee-project/team.png',
componentType: 'formConfig', componentType: 'formConfig',
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
}, },
{ {
name: '经费', name: '经费',
planId: this.$route.query.id, id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png', icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig', componentType: 'formConfig',
formConfigType: 'page', formConfigType: 'page',
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
}, },
{ {
name: '基线', name: '基线',
planId: this.$route.query.id, id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png', icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig', componentType: 'formConfig',
formConfigType: 'page', formConfigType: 'page',
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
{ {
name: '文档', name: '文档',
planId: this.$route.query.id, id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png', icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig', componentType: 'formConfig',
formConfigType: 'page', formConfigType: 'page',
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
}, },
{ {
name: '归档', name: '归档',
planId: this.$route.query.id, id: this.$route.query.id,
icon: '/icons/dee-project/baseline.png', icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig', componentType: 'formConfig',
formConfigType: 'page', formConfigType: 'page',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zhangtianfeng 3232807530@qq.com * @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-08-29 11:42:37 * @Date: 2024-08-29 11:42:37
* @LastEditors: zhangtianfeng 3232807530@qq.com * @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-09-12 09:21:12 * @LastEditTime: 2024-09-12 18:59:27
--> -->
<template> <template>
<div> <div>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/> />
</el-select> --> </el-select> -->
<!--input输入--> <!--input输入-->
<el-input v-model="project" placeholder="请输入" @input="handleChange" /> <el-input v-model="form.name" placeholder="请输入" @input="handleChange" />
<img <img
v-if="showIcon" v-if="showIcon"
class="icon" class="icon"
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
}, },
data() { data() {
return { return {
project: '', // project: '',
dialogShow: false, dialogShow: false,
showIcon: false, showIcon: false,
projectList: [], projectList: [],
...@@ -64,7 +64,8 @@ export default { ...@@ -64,7 +64,8 @@ export default {
}, },
watch: { watch: {
value(val) { value(val) {
this.project = val // this.project = val
console.log('val', val)
this.$emit('input', val) this.$emit('input', val)
}, },
'form.projectCategory': { 'form.projectCategory': {
...@@ -79,6 +80,9 @@ export default { ...@@ -79,6 +80,9 @@ export default {
} }
}, },
mounted() {
console.log('form', this.form)
},
methods: { methods: {
handleClickOpen() { handleClickOpen() {
this.dialogShow = true 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