Commit 23c3e451 authored by ztf's avatar ztf

项目关联合同,子项关联课题相关组件

parent 2a174af4
<template>
<div class="ExtPlanDocLinkAdd">
<dee-as-com
ref="tableRef"
:lay-config="{
layKey:'ExtPlanDocLink-AddList',
typeName:'DxDocument'
}"
@selectionChange="selectionChange"
/>
<div class="btns">
<el-button type="primary" class="submitBTN" :disabled="!isDisable" @click="tosubmit">确定</el-button>
<el-button type="primary" @click="$emit('cancel')">取消</el-button>
</div>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
name: 'ExtPlanDocLinkAdd',
componentName: '进度计划-相关合同-添加',
props: {
parentTableData: {
type: Object,
default: () => {}
},
basicData: {
type: Object,
default: () => {}
},
componentProp: {
type: Object,
default: () => {}
}
},
data() {
return {
selections: []
}
},
computed: {
isDisable() {
return Boolean(this.selections.length)
}
},
mounted() {
console.log('componentProp', this)
console.log('basicData', this.basicData)
},
methods: {
selectionChange(data) {
this.selections = data
},
tosubmit() {
console.log('basicData', this.basicData)
const subId = this.parentTableData.id
const params = this.selections.map(r => {
return {
source: {
id: subId
},
operator: 'ADD',
target: r
}
})
post(`/ExtPlanDocLink/recursions`, params).then(res => {
this.$utils.showMessageSuccess('添加成功!')
this.$emit('completeEven')
})
}
}
}
</script>
<style lang='scss' scoped>
.ExtPlanDocLinkAdd{
height: calc(80%);
.btns{
text-align: center;
margin-top: 30px;
}
.submitBTN{
margin-right: 20px;
}
}
</style>
<template>
<div>
<div class="extProjectContractLink">
<!--input输入-->
<el-input v-model="form.name" placeholder="请输入" @input="handleChange" />
<img class="icon" src="/icons/c-add.png" title="选择合同" @click="handleClickOpen">
<dee-dialog width="60%" class="childProjectTopicResult" :title="`选择课题`" :dialog-visible="dialogShow" @handleClose="dialogShow = false">
<dee-as-com
:lay-config="{
typeName: 'ExtInComeContract',
layKey: 'projectContractResult'
}"
dis-business
:result-data="tableData"
@radio-current-change="radioCurrentChange"
/>
<!-- dis-business
:result-data="tableData" -->
<div class="dialogBtn">
<el-button type="primary" @click="submit">确定</el-button>
<el-button type="default" @click="dialogShow = false">取消</el-button>
</div>
</dee-dialog>
</div>
</div>
</template>
<script>
// 选择当前项目关联的合同下的课题
import { post } from '@/utils/http'
export default {
name: 'ExtProjectContractLink',
componentName: '项目关联合同',
props: {
value: {
type: [Object, Array, String, Number],
default: () => null
},
basicData: {
type: Object,
default: () => { }
},
form: {
type: Object,
default: () => { }
}
},
data() {
return {
// project: '',
dialogShow: false,
projectList: [],
showSelect: false,
selectRow: {},
tableData: [],
// itemsNumber: null,
projectClass: null,
projectNumber: null,
programNumber: null,
editNumber: null
}
},
watch: {
value(val) {
this.$emit('input', val)
},
'form.extProgram': {
immediate: true,
deep: true,
handler(val) {
if (val) {
this.programNumber = this.form.extProgram.number
}
}
}
},
methods: {
async handleClickOpen() {
this.dialogShow = true
this.getContractList()
},
handleChange(val) {
this.$emit('input', val)
},
radioCurrentChange(data) {
this.selectRow = data.row
console.log('data.row', data.row)
},
submit() {
this.$set(this.form, 'customUnit', this.selectRow.supplierName)
this.$set(this.form, 'totalBudget', this.selectRow.contractAmount)
this.$set(this.form, 'extProjectContractLinks', this.selectRow)
this.handleChange(this.selectRow.name)
this.dialogShow = false
},
getContractList() {
const params = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [
{
'fieldName': 'state',
'operator': 'EQ',
'value': 'release'
},
{
'fieldName': 'state',
'operator': 'EQ',
'value': 'release'
},
{
'fieldName': 'checkOuted',
'operator': 'EQ',
'value': false
},
{
'fieldName': 'latest',
'operator': 'EQ',
'value': true
},
{
'fieldName': 'itemNumber',
'operator': 'EQ',
'value': this.programNumber
}
],
'operator': 'AND'
},
'openProps': [],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('/ExtInComeContract/search', params).then(res => {
if (res.items) {
this.tableData = res.items.content
}
})
}
}
}
</script>
<style lang="scss" scoped>
.extProjectContractLink{
display: flex;
align-items: center;
justify-content: space-between;
.icon {
width: 15px;
height: 15px;
margin-left: 6px;
cursor: pointer;
}
.childProjectTopicResult{
height: calc(80%);
}
}
</style>
<template>
<div>
<div class="extProjectTopicLink">
<!--input输入-->
<el-input v-model="form.name" placeholder="请输入" @input="handleChange" />
<img class="icon" src="/icons/c-add.png" title="选择合同" @click="handleClickOpen">
<dee-dialog width="60%" class="childProjectTopicResult" :title="`选择课题`" :dialog-visible="dialogShow" @handleClose="dialogShow = false">
<dee-as-com
:lay-config="{
typeName: 'ExtTopicPreparation',
layKey: 'childProjectTopicResult'
}"
dis-business
:result-data="tableData"
@radio-current-change="radioCurrentChange"
/>
<!-- dis-business
:result-data="tableData" -->
<div class="dialogBtn">
<el-button type="primary" @click="submit">确定</el-button>
<el-button type="default" @click="dialogShow = false">取消</el-button>
</div>
</dee-dialog>
</div>
</div>
</template>
<script>
// 选择当前项目关联的合同下的课题
import { post } from '@/utils/http'
export default {
name: 'ExtProjectTopicLink',
componentName: '子项关联课题',
props: {
value: {
type: [Object, Array, String, Number],
default: () => null
},
basicData: {
type: Object,
default: () => { }
},
form: {
type: Object,
default: () => { }
}
},
data() {
return {
// project: '',
dialogShow: false,
projectList: [],
showSelect: false,
selectRow: {},
tableData: [],
// itemsNumber: null,
projectClass: null,
projectNumber: null,
programNumber: null,
editNumber: null
}
},
watch: {
value(val) {
this.$emit('input', val)
}
// 'form.extProject': {
// immediate: true,
// deep: true,
// handler(val) {
// if (val) {
// this.projectNumber = this.form.extProject.id
// }
// }
// }
},
methods: {
async handleClickOpen() {
this.dialogShow = true
this.getContractId()
},
handleChange(val) {
this.$emit('input', val)
},
radioCurrentChange(data) {
this.selectRow = data.row
console.log('data.row', data.row)
},
submit() {
this.$set(this.form, 'customUnit', this.selectRow.supplierName)
this.$set(this.form, 'totalBudget', this.selectRow.contractAmount)
this.$set(this.form, 'extProjectTopicLinks', this.selectRow)
this.handleChange(this.selectRow.name)
this.dialogShow = false
},
// 获取收入合同的id
getContractId() {
console.log(' this.form.extProject.id', this.form.extProject.id)
const sourceId = this.form.extProject.id
const params = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [
{
'fieldName': 'sourceId',
'operator': 'EQ',
'value': sourceId
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'target'
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('ExtProjectContractLink/search', params).then(res => {
// this.contractId = res.items.content[0].target.id
this.getContractList(res.items.content[0].target.id)
})
},
// 获取合同列表
getContractList(contractId) {
const params = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [
{
'fieldName': 'sourceId',
'operator': 'EQ',
'value': contractId
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'target'
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('/ExtTopicContractLink/search', params).then(res => {
this.tableData = res.items.content
})
}
}
}
</script>
<style lang="scss" scoped>
.extProjectTopicLink{
display: flex;
align-items: center;
justify-content: space-between;
.icon {
width: 15px;
height: 15px;
margin-left: 6px;
cursor: pointer;
}
.childProjectTopicResult{
height: calc(80%);
}
}
</style>
......@@ -2,7 +2,7 @@
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-09-12 09:09:39
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-10-17 14:09:33
* @LastEditTime: 2024-10-23 18:00:02
* @FilePath: \inet-two\applications\dee-project\src\privateComponents\components\createProject\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -41,7 +41,7 @@ export default {
projectClass: '',
baseQuery: {
modelName: 'DxContextProject',
operator: 'AND',
operator: 'ADD',
state: 'edit',
subTypeName: 'DxContextProject'
}
......@@ -60,7 +60,30 @@ export default {
}
},
methods: {
toSubmit() {
// 项目关联合同
saveExtProjectContractLinks(projectId) {
const params = {
sourceId: projectId,
target: this.form.extProjectContractLinks,
operator: 'ADD'
}
post('/ExtProjectContractLink/recursion', params).then(res => {
})
},
// 子项关联课题
saveExtProjectTopicLink(childProjectId) {
const params = {
sourceId: childProjectId,
target: this.form.extProjectTopicLinks,
operator: 'ADD'
}
post('/ExtProjectContractLink/recursion', params).then(res => {
})
},
async toSubmit() {
const createParams = (category) => {
const params = { ...this.form, ...this.baseQuery }
let parentId = 0
......@@ -71,6 +94,8 @@ export default {
parentId = this.form.extProgram.id
delete params.extProgram
delete params.dxType
delete params.extProjectContractLinks
delete params.extProjectTopicLinks
break
case 'childProject':
......@@ -78,6 +103,8 @@ export default {
delete params.extProgram
delete params.extProject
delete params.dxType
delete params.extProjectContractLinks
delete params.extProjectTopicLinks
break
default:
return null
......@@ -87,8 +114,15 @@ export default {
}
const params = createParams(this.projectClass)
console.log('params新建项目', params)
post('/DxContextProject/saveRecursionContext', params)
await post('/DxContextProject/saveRecursionContext', params)
.then(res => {
// 项目和合同的关系
if (this.projectClass === 'project') {
this.saveExtProjectContractLinks(res.items.id)
} else if (this.projectClass === 'childProject') {
// 项目和子项的关系
this.saveExtProjectTopicLink(res.items.id)
}
this.$utils.showMessageSuccess(`添加成功`)
this.$emit('completeEven')
})
......@@ -101,8 +135,8 @@ export default {
</script>
<style lang="scss" scoped>
.project{
height: 500px;
}
</style>
<style lang="scss" scoped>
.project {
height: 500px;
}
</style>
<!--
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-08-29 11:42:37
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-10-18 16:36:59
-->
<template>
<div>
<div class="select-project">
<!-- 这里要判断是项目还是子项,显示的是项目的关联的收入合同里面的 -->
<!-- <el-select v-if="showSelect" v-model="project" placeholder="请选择" @change="handleChange">
<el-option
v-for="item in projectList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<!--input输入-->
<el-input v-model="form.name" placeholder="请输入" @input="handleChange" />
<img v-if="showIcon" class="icon" src="/icons/c-add.png" title="选择合同" @click="handleClickOpen">
......@@ -109,7 +93,6 @@ export default {
handler(val) {
if (val) {
this.programNumber = this.form.extProgram.number
// console.log(' this.programNumber', this.programNumber)
}
}
},
......@@ -119,15 +102,10 @@ export default {
handler(val) {
if (val) {
this.projectNumber = this.form.extProject.number
// console.log(' this.projectNumber', this.projectNumber)
}
}
}
},
mounted() {
// console.log('this.basicData', this.basicData)
},
methods: {
......@@ -148,13 +126,14 @@ export default {
submit() {
this.$set(this.form, 'customUnit', this.selectRow.supplierName)
this.$set(this.form, 'totalBudget', this.selectRow.contractAmount)
this.$set(this.form, 'extProjectContractLinks', this.selectRow)
this.handleChange(this.selectRow.name)
this.dialogShow = false
},
getContractList() {
const params = {
'pageFrom': 1,
'pageSize': 10,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [
......@@ -203,7 +182,7 @@ export default {
async getProject(parentId) {
const params = {
'pageFrom': 1,
'pageSize': 10,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [
......
......@@ -69,6 +69,13 @@
:form="ExtPlanReplyLinkform"
@on-submit="toSubmitExtPlanReply"
/>-->
<dee-as-com
:lay-config="{
typeName: 'ExtPlanDocLink',
layKey: 'relatedDocList'
}"
:basic-data="{id:basicData.businessObject.id}"
/>
<dee-as-com
:lay-config="{
typeName: 'ExtPlanReply',
......@@ -77,6 +84,12 @@
:form="ExtPlanReplyLinkform"
@on-submit="toSubmitExtPlanReply"
/>
<!-- :form="ExtPlanReplyLinkform" -->
<!-- <div class="ExtPlanReplyLink-submitBTN">
<el-button type="primary" @click="ExtPlanReplyLinkform">保存</el-button>
</div> -->
</div>
<div v-if="basicData && basicData.basicInfo && !basicData.basicInfo.forwardFlag && (!isCheckTaskState || (isCheckTaskState && basicData.basicInfo.state==='BE_RESOLVED' && !basicData.basicInfo.parentTaskId))">
<div class="sub-title" style="padding-bottom:12px">任务处理</div>
......@@ -1029,5 +1042,8 @@ export default {
}
}
.ExtPlanReplyLink-submitBTN{
text-align: center;
}
}
</style>
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