Commit 5a44b68a authored by xioln's avatar xioln

行动项信息查看

parent 680a80c2
<template>
<div class="action-item">
<van-collapse
v-if="historyInfo.length > 0"
v-model="activeNames"
>
<van-collapse-item
v-for="(item, index) in historyInfo"
:key="index"
:title="item.deliverName"
:name="item.id"
icon="orders-o"
>
<b>工作类型: </b>{{dictObj['WorkType'] && findDictValue('WorkType', item.workType) }}<br />
<b>交付物名称: </b>{{ item.deliverName }}<br />
<b>产品名称: </b>{{ item.productName }}<br />
<b>责任单位: </b>{{ item.responsibleUnitName }}<br />
<b>计划完成日期: </b>{{ item.planCompleteTime }}<br />
<b>任务完成日期: </b>{{ item.taskCompleteTime }}<br />
<b>状态: </b>{{dictObj['ObjStatus'] && findDictValue('ObjStatus', item.state) }}<br />
<b>工作内容: </b>{{ item.workContent }}<br />
</van-collapse-item>
</van-collapse>
<van-empty v-else description="数据为空" />
</div>
</template>
<script>
import { getDictListByCode } from '@/api/taskDetail'
export default {
props: {
basicData: {
type: Object,
default: () => {}
},
flowType: {
type: String,
default: ''
}
},
components: {},
data () {
return {
historyInfo: [],
activeNames: [],
dictObj: {}
}
},
watch: {
},
created () {
this.getData()
this.getDictListByCode('WorkType')
this.getDictListByCode('ObjStatus')
},
mounted () {
},
computed: {},
methods: {
getData () {
const params = {
searchItems: {
children: [],
items: [
{
fieldName: 'sourceId',
operator: 'EQ',
value: this.basicData.id
}
],
operator: 'AND'
},
openProps: [{ name: 'source' }, { name: 'target', openProps: [{ name: 'responsibleUnit' }] }]
}
this.$api.searchApi('ExtActionInfoItemLink', params).then(res => {
this.$nextTick(() => {
const datas = res.items.content.map(items => {
return {
id: items.targetId,
workType: items.target.workType,
workContent: items.target.workContent,
deliverName: items.target.deliverName,
productName: items.target.productName,
responsibleUnitName: items.target?.responsibleUnit?.name,
planCompleteTime: items.target.planCompleteTime,
taskCompleteTime: items.target.taskCompleteTime,
state: items.target.state
}
})
this.historyInfo = datas
})
})
},
async getDictListByCode(code) {
const res = await getDictListByCode(code)
if (!res || !res.items) {
return ''
}
this.$set(this.dictObj, code, res.items.content)
},
findDictValue(dict, value) {
// 在对象数组中查找对应的字典值
return this.dictObj[dict].find(item => item.dictKey === value)?.dictValue || ''
}
}
}
</script>
<style lang="scss" scoped>
.action-item {
.van-cell {
font-size: 14px;
}
.van-collapse-item__content {
// padding: 2.2vw 8.266667vw;
}
.van-collapse-item__content {
font-size: 12px;
}
}
</style>
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
<div v-if="activeTab === 'pdf'" class="pdf-detail"> <div v-if="activeTab === 'pdf'" class="pdf-detail">
<pdf :basicData="form" /> <pdf :basicData="form" />
</div> </div>
<div v-if="activeTab === 'ActionItem'">
<ActionItem :basicData="form" />
</div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</div> </div>
...@@ -22,13 +25,15 @@ ...@@ -22,13 +25,15 @@
<script> <script>
import Pdf from '@/components/pdf/index' import Pdf from '@/components/pdf/index'
import ActionItem from '@/components/actionItem/index'
import { getInstancePbo, getLayOut } from '@/api/taskDetail' import { getInstancePbo, getLayOut } from '@/api/taskDetail'
import DeeForm from '@/components/form/form' import DeeForm from '@/components/form/form'
export default { export default {
components: { components: {
Pdf, Pdf,
DeeForm DeeForm,
ActionItem
}, },
data () { data () {
return { return {
...@@ -47,13 +52,15 @@ export default { ...@@ -47,13 +52,15 @@ export default {
}, },
async mounted () { async mounted () {
console.log('this.$route.query.type', this.$route.query.type)
if (this.$route.query.type === 'ISTART') { if (this.$route.query.type === 'ISTART') {
this.tabs = [{ title: '基本信息', key: 'baseInfo' }] this.tabs = [{ title: '基本信息', key: 'baseInfo' }]
this.activeTab = 'baseInfo' this.activeTab = 'baseInfo'
await this.getIstartFormData() await this.getIstartFormData()
} else if (['ExtActionItem', 'ExtActionInfo'].includes(this.$route.query.dxClassname)) { } else if (['ExtActionItem', 'ExtActionInfo'].includes(this.$route.query.dxClassname)) {
this.tabs = [{ title: '基本信息', key: 'baseInfo' }] this.tabs = [
{ title: '基本信息', key: 'baseInfo' },
{ title: '行动项信息', key: 'ActionItem' }
]
this.activeTab = 'baseInfo' this.activeTab = 'baseInfo'
await this.getFormData() await this.getFormData()
await this.getForm() await this.getForm()
...@@ -160,7 +167,6 @@ export default { ...@@ -160,7 +167,6 @@ export default {
fiiterData (formData) { fiiterData (formData) {
console.log('formData', formData) console.log('formData', formData)
formData.forEach(item => { formData.forEach(item => {
console.log('item.title', item.title)
if (item.title && item.title !== '关联文档' && item.title !== '附件') { if (item.title && item.title !== '关联文档' && item.title !== '附件') {
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const that = this const that = this
...@@ -305,8 +311,8 @@ export default { ...@@ -305,8 +311,8 @@ export default {
padding-right: 8px; padding-right: 8px;
} }
} }
.van-icon-arrow { // .van-icon-arrow {
display: none; // display: none;
} // }
} }
</style> </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