Commit 082468d6 authored by ztf's avatar ztf

新建、编辑项目关联合同

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