[update] 处理流程中人员信息
This commit is contained in:
@@ -205,7 +205,7 @@
|
||||
<!-- 人员信息 -->
|
||||
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
|
||||
<process-detail-list>
|
||||
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNode + ''"></personnel-info>
|
||||
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNodeName"></personnel-info>
|
||||
</process-detail-list>
|
||||
</div>
|
||||
<!-- 操作按钮 -->
|
||||
@@ -258,7 +258,9 @@ import {
|
||||
enterprisePlanApprovalReject,
|
||||
enterprisePlanApprovalSave,
|
||||
enterprisePlanApproval,
|
||||
getProcessDataById
|
||||
getProcessDataById,
|
||||
getNodeList,
|
||||
getProcessNodeList
|
||||
} from '@/api/workCenter'
|
||||
import ApprovalBaseInfo from './modules/ApprovalBaseInfo'
|
||||
import FinishTimeChangeBaseInfo from './modules/FinishTimeChangeBaseInfo'
|
||||
@@ -266,10 +268,11 @@ import ProcessDetailList from '@/components/ProcessDetailList'
|
||||
import JobEndBaseInfo from './modules/JobEndBaseInfo'
|
||||
import DutyDepartChangeBaseInfo from './modules/DutyDepartChangeBaseInfo'
|
||||
import MergeBaseInfo from './modules/MergeBaseInfo'
|
||||
import { ProjectType, ApplicationCategory } from '@/enums/commonEnums'
|
||||
import { ProjectType, ApplicationCategory, ProcessKey } from '@/enums/commonEnums'
|
||||
import Vue from 'vue'
|
||||
import { USER_INFO } from '@/store/mutation-types'
|
||||
import pick from 'lodash.pick'
|
||||
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
|
||||
|
||||
// 标准立项的人员信息
|
||||
const approvalPersonalInfo = [ // 人员信息的数据
|
||||
@@ -416,9 +419,10 @@ export default {
|
||||
InternalDetailPage,
|
||||
UserSelection
|
||||
},
|
||||
mixins: [WorkCenterMixin],
|
||||
computed: {
|
||||
pageTitle () {
|
||||
return this.$t('flowCenter') + this.$route.meta.title
|
||||
return this.$t('flowCenter') + this.$route.meta.title + '(' + this.currentNodeName + ')'
|
||||
},
|
||||
// 流程名称是否不可填写
|
||||
processNameDisabled () {
|
||||
@@ -452,12 +456,14 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
console.log(this.$route.query.taskId)
|
||||
// 查询流程定义列表,通过查出的数据获取到流程定义id,如果已经发起过流程,用这个id和流程实例id去查人员信息数据
|
||||
this.getPersonInfoStructure(ProcessKey.ES_INIT_CHANGE.value)
|
||||
if (this.$route.query.taskId) {
|
||||
this.currentNodeName = this.$route.query.taskName
|
||||
// 有流程id说明是从流程中心来的,需要初始化数据
|
||||
this.getProcessData(this.$route.query.taskId)
|
||||
} else {
|
||||
// 没有taskId说明是新建进来的,初始化人员信息
|
||||
this.personnelInfoData = approvalPersonalInfo
|
||||
this.currentNodeName = '主起草人发起'
|
||||
}
|
||||
// 如果是查看进入的,不可编辑,不可操作
|
||||
if (this.$route.query.onlyLook) {
|
||||
@@ -474,6 +480,7 @@ export default {
|
||||
disabled: false,
|
||||
onlyLook: false, // 是否仅查看
|
||||
currentNode: 1, // 当前节点
|
||||
currentNodeName: '', // 当前节点名称
|
||||
model: [],
|
||||
processInfoForm: this.$form.createForm(this),
|
||||
labelCol: {
|
||||
@@ -556,6 +563,25 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 查询人员信息结构数据
|
||||
getPersonInfoStructure (key) {
|
||||
console.log('-----------getPersonInfoStructure-------', key)
|
||||
const param = {}
|
||||
param.processDefinitionKey = key
|
||||
if (this.$route.query.processInstanceId) {
|
||||
param.processInstanceId = this.$route.query.processInstanceId
|
||||
}
|
||||
console.log(param)
|
||||
getProcessNodeList(param).then(res => {
|
||||
if (res.success) {
|
||||
console.log(res.result)
|
||||
// 处理人员信息数据
|
||||
// 筛选出是立项、责任部门变更,其他变更
|
||||
// 每个节点是否能选人
|
||||
this.personnelInfoData = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据流程id获取数据并回显
|
||||
getProcessData (taskId) {
|
||||
getProcessDataById(taskId).then(res => {
|
||||
@@ -592,8 +618,11 @@ export default {
|
||||
this.currentNode = 7
|
||||
} else if (taskName === '相关人员会签') {
|
||||
this.currentNode = 8
|
||||
} else {
|
||||
} else if (taskName === '抄送主起草人确认') {
|
||||
this.currentNode = 9
|
||||
} else {
|
||||
// 预留加签节点
|
||||
this.currentNode = 999
|
||||
}
|
||||
}
|
||||
console.log(this.currentNode)
|
||||
@@ -690,6 +719,34 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取人员信息数据
|
||||
getPersonInfoData () {
|
||||
const param = {}
|
||||
param.processDefinitionId = this.processDefinitionId
|
||||
// 有流程实例id就需要传流程实例id
|
||||
if (this.$route.query.processInstanceId) {
|
||||
param.processInstanceId = this.$route.query.processInstanceId
|
||||
}
|
||||
getNodeList(param).then(res => {
|
||||
if (res.success) {
|
||||
console.log(res.result)
|
||||
// 处理人员信息数据
|
||||
if (this.formInline.applicationCategory) {
|
||||
// 有申请类型,根据申请类型返回不同的人员信息,区分【立项、普通变更、责任部门变更(责任部门变更时某些节点不可跳过)】
|
||||
if (this.formInline.applicationCategory === ApplicationCategory.INITIATION.value) {
|
||||
// 是立项,从result中拿出立项有的人员信息
|
||||
} else if (this.formInline.applicationCategory === ApplicationCategory.CHANGE.value) {
|
||||
// 是变更
|
||||
if (this.formInline.projectType === ProjectType.RESPONSIBLE_DEPT_CHANGE.value) {
|
||||
// 是责任部门变更,从result中拿出责任部门变更有的人员信息
|
||||
} else {
|
||||
// 是别的变更,从result中拿出需要的人员信息
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 头部tab改变
|
||||
switchChange (value) {
|
||||
this.switchValue = value
|
||||
|
||||
Reference in New Issue
Block a user