Commit 082468d6 authored by ztf's avatar ztf

新建、编辑项目关联合同

parent 0a491a52
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
* @Author: zhangtianfeng 3232807530@qq.com * @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-09-11 11:05:24 * @Date: 2024-09-11 11:05:24
* @LastEditors: zhangtianfeng 3232807530@qq.com * @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-10-16 09:15:46 * @LastEditTime: 2024-10-17 17:22:33
--> -->
<template> <template>
<div> <div>
<el-select v-model="project" placeholder="请选择" @change="handleChange"> <el-select v-model="project" placeholder="请选择" @change="handleChange">
<el-option <el-option
v-for="item in projectList" v-for="item in projectList"
:key="item.value" :key="item.id"
:label="item.name" :label="item.name"
:value="item.name" :value="item"
/> />
</el-select></div> </el-select></div>
</template> </template>
...@@ -45,7 +45,6 @@ export default { ...@@ -45,7 +45,6 @@ export default {
immediate: true, immediate: true,
deep: true, deep: true,
handler(val) { handler(val) {
console.log('项目群id', val)
if (val) { if (val) {
this.getProjectList(val) this.getProjectList(val)
} }
...@@ -74,21 +73,12 @@ export default { ...@@ -74,21 +73,12 @@ export default {
post(`/DxContextProject/search`, params).then((res) => { post(`/DxContextProject/search`, params).then((res) => {
if (res.items.content) { if (res.items.content) {
this.projectList = res.items.content this.projectList = res.items.content
console.log('res.items.content', res.items.content)
// res.items.content.forEach(list => {
// list.extProgramProjectLinks.forEach(item => {
// this.projectList.push(item.target)
// })
// })
} }
}) })
}, },
handleChange(val) { handleChange(val) {
console.log('projectList', this.projectList) this.$emit('input', val)
const valObj = this.projectList.find((item) => { return item.name === val }) console.log('emit出去的值', val)
console.log('点击事件', valObj)
this.$emit('input', valObj.id)
console.log(' val.id', valObj.id)
} }
} }
} }
......
...@@ -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-10-17 10:32:07 * @LastEditTime: 2024-10-17 18:02:23
--> -->
<template> <template>
<div> <div>
...@@ -71,9 +71,22 @@ export default { ...@@ -71,9 +71,22 @@ export default {
showSelect: false, showSelect: false,
selectRow: {}, selectRow: {},
tableData: [], tableData: [],
itemNumber: null, // itemsNumber: null,
programId: null, projectClass: null,
projectId: null projectNumber: null,
programNumber: null,
editNumber: null
}
},
computed: {
itemNumber() {
if (this.projectClass === 'project') {
return this.programNumber
}
if (this.projectClass === 'childProject') {
return this.projectNumber
}
return null
} }
}, },
watch: { watch: {
...@@ -84,83 +97,49 @@ export default { ...@@ -84,83 +97,49 @@ export default {
immediate: true, immediate: true,
deep: true, deep: true,
handler(val) { handler(val) {
console.log('监听项目分类选择合同', val)
if (val) { if (val) {
console.log('进来了') this.projectClass = val
this.showIcon = val !== 'program' this.showIcon = val !== 'program'
} }
} }
}, },
// 监听这个的id,判断当前选择项目或者项目群下面的合同
'form.extProgram': { 'form.extProgram': {
immediate: true, immediate: true,
deep: true, deep: true,
handler(val) { handler(val) {
if (val) { if (val) {
console.log('项目群id', val) this.programNumber = this.form.extProgram.number
this.programId = val.id console.log(' this.programNumber', this.programNumber)
}
}
},
'form.extProject': {
immediate: true,
deep: true,
handler(val) {
if (val) {
this.projectNumber = this.form.extProject.number
console.log(' this.projectNumber', this.projectNumber)
} }
} }
} }
// 'form.extProject': {
// immediate: true,
// deep: true,
// handler(val) {
// if (val) {
// console.log('val所属项目', val)
// this.getData(val.id)
// // this.showIcon = val !== 'program'
// // this.showSelect = val === 'childProject'
// }
// }
// }
}, },
mounted() { mounted() {
console.log('basicData', this.basicData) // console.log('this.basicData', this.basicData)
}, },
methods: { methods: {
getProjectNumber() {
const params = {
'pageFrom': 1,
'pageSize': 10,
'searchItems': {
'children': [],
'items': [
{
'fieldName': 'id',
'operator': 'EQ',
'value': this.programId || this.projectId
}
], async handleClickOpen() {
'operator': 'AND'
},
'openProps': [],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('/DxContextProject/search', params).then(res => {
if (res.items) {
this.itemNumber = res.items.content[0].number
console.log('this.itemNumber', this.itemNumber)
}
})
},
handleClickOpen() {
this.dialogShow = true this.dialogShow = true
if (this.basicData && this.basicData.parentId) {
await this.getProject(this.basicData.parentId)
}
this.getContractList() this.getContractList()
}, },
handleChange(val) { handleChange(val) {
this.$emit('input', val) this.$emit('input', val)
console.log('val', val)
console.log('this.form', this.form)
}, },
radioCurrentChange(data) { radioCurrentChange(data) {
this.selectRow = data.row this.selectRow = data.row
...@@ -202,7 +181,7 @@ export default { ...@@ -202,7 +181,7 @@ export default {
{ {
'fieldName': 'itemNumber', 'fieldName': 'itemNumber',
'operator': 'EQ', 'operator': 'EQ',
'value': this.itemNumber 'value': this.editNumber || this.itemNumber
} }
], ],
'operator': 'AND' 'operator': 'AND'
...@@ -220,6 +199,35 @@ export default { ...@@ -220,6 +199,35 @@ export default {
this.tableData = res.items.content this.tableData = res.items.content
} }
}) })
},
async getProject(parentId) {
const params = {
'pageFrom': 1,
'pageSize': 10,
'searchItems': {
'children': [],
'items': [
{
'fieldName': 'id',
'operator': 'EQ',
'value': parentId
}
],
'operator': 'AND'
},
'openProps': [],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
await post('/DxContextProject/search', params).then(res => {
if (res.items) {
this.editNumber = res.items.content[0].number
}
})
} }
} }
......
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