Commit 28adbd42 authored by ztf's avatar ztf

设计评审通知相关组件

parent 45d0d0a6
......@@ -3,7 +3,7 @@
<el-select ref="selectCom" v-model="selVal" placeholder="请选择" :multiple="isMultiple" size="mini" :disabled="disabledVal" @change="changeVal">
<el-option
v-for="item in options"
:key="item.value"
:key="item.value.id"
:label="item.label"
:value="item.value"
/>
......@@ -26,6 +26,10 @@ export default {
return {}
}
},
basicData: {
type: Object,
default: () => {}
},
form: {
type: Object,
default: () => {}
......
......@@ -40,7 +40,7 @@ export default {
tabs: [],
dictService: this.$getService('DictData'),
teamService: this.$getService('DxContextTeam'),
projectItemService: this.$getService('DxProjectItem'),
projectItemService: this.$getService('DxContextProject'),
teamMemberService: this.$getService('DxContextTeamMember'),
dxContextId: null,
roleDictData: null,
......@@ -77,6 +77,7 @@ export default {
methods: {
loadDicaData() {
this.dictQuery.recursion().then(items => {
console.log('dictQueryitems', items)
this.roleDictData = items.content.map(n => {
return {
label: n.dictKey,
......@@ -84,16 +85,21 @@ export default {
data: n
}
})
console.log('this.roleDictData', this.roleDictData)
})
},
loadData() {
console.log('this.projectItemQuery', this.projectItemQuery.recursion())
this.projectItemQuery.recursion().then(items => {
// 查询项目所属容器
if (items && items.content[0]) {
this.basicData = items.content[0].dxContext
this.dxContextId = items.content[0].dxContextId
// this.dxContextId = items.content[0].dxContextId
this.dxContextId = items.content[0].id
this.loading = true
this.teamQuery.recursion().then(teamItems => {
console.log('teamItems', teamItems)
this.tabs = []
this.tableData = []
this.teamMembers = []
......@@ -102,6 +108,7 @@ export default {
teamItems.content.forEach(t => {
// 页签赋值
const dictRole = this.roleDictData.find(eve => eve.label === t.teamRole)
if (dictRole) {
t.roleValue = dictRole.value
const oneTab = {
......
<template>
<div>
<div class="edit-unit">
<el-input
v-model="value"
:disabled="true"
/>
</div>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
name: 'EditUnit',
componentName: '编制人单位',
props: {
value: {
type: [Object, Array, String, Number],
default: () => null
},
basicData: {
type: Object,
default: () => { }
},
form: {
type: Object,
default: () => { }
}
},
data() {
return {
}
},
computed: {
},
watch: {
value(val) {
this.$emit('input', val)
}
},
mounted() {
this.getUserInfo()
},
methods: {
getUserInfo() {
const params = {
'searchItems': {
'items': [{
'fieldName': 'id',
'operator': 'EQ',
'value': localStorage.getItem('userId')
}]
},
'openProps': [{
'name': 'targetDxPostMemberLink'
}, {
'name': 'dxOrganization',
'pageFrom': 1,
'pageSize': 9999
}]
}
post('/DxUserInfo/search', params).then(res => {
console.log('res', res.items)
const dxOrganization = res.items.content[0].dxOrganization
this.$set(this.form, 'editUnit', dxOrganization)
console.log('this.form', this.form)
})
}
}
}
</script>
<style lang="scss" scoped>
.edit-unit {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
<template>
<div>
<div class="getProjectName">
<el-input
v-model="value"
:disabled="true"
/>
</div>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
name: 'GetProjectName',
componentName: '设计审查管理-获取项目名称',
props: {
value: {
type: [Object, Array, String, Number],
default: () => null
},
basicData: {
type: Object,
default: () => { }
},
form: {
type: Object,
default: () => { }
}
},
data() {
return {
itemId: null,
funSetTimeout: null
}
},
computed: {
},
watch: {
'form.programCode': {
immediate: true,
deep: true,
handler(newvalue, oldValue) {
if (newvalue !== oldValue) {
console.log('项目群')
this.itemId = newvalue
this.debounce(this.getprojectInfo(newvalue), 1000)
}
}
},
'form.projectCode': {
immediate: true,
deep: true,
handler(newvalue, oldValue) {
if (newvalue !== oldValue) {
console.log('项目')
this.itemId = newvalue
this.debounce(this.getprojectInfo(newvalue), 1000)
}
}
},
'form.childProjectCode': {
immediate: true,
deep: true,
handler(newvalue, oldValue) {
if (newvalue !== oldValue) {
console.log('子项')
this.itemId = newvalue
this.debounce(this.getprojectInfo(newvalue), 1000)
// this.getprojectInfo(newvalue)
}
}
},
value(val) {
this.$emit('input', val)
}
},
mounted() {
// this.getUserInfo()
},
methods: {
// 防抖
debounce(fn, wait) {
console.log('进来了')
if (this.funSetTimeout !== null) {
clearTimeout(this.funSetTimeout)
}
this.funSetTimeout = setTimeout(fn, wait)
},
getprojectInfo(id) {
const params = {
'searchItems': {
'items': [{
'fieldName': 'id',
'operator': 'EQ',
'value': id
}]
}
}
post('/DxContextProject/search', params).then(res => {
console.log('res', res.items)
const result = res.items.content[0]
const proName = result.name
const proCode = result.number
const id = result.id
this.$set(this.form, 'proName', proName)
this.$set(this.form, 'proCode', proCode)
this.$set(this.form, 'dxContextId', id)
console.log('this.form', this.form)
})
}
}
}
</script>
<style lang="scss" scoped>
.getProjectName {
display: flex;
align-items: center;
justify-content: space-between;
}
</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