[update] 修改年度制修订标准化发起流程

This commit is contained in:
lideqin
2023-12-08 18:51:56 +08:00
parent e36acc7d2c
commit 57a9ab4592
4 changed files with 78 additions and 30 deletions
@@ -241,7 +241,7 @@ export default {
// 说明是已发起流程
this.currentNodeName = this.$route.query.taskName
} else {
this.currentNodeName = '发起人发起'
this.currentNodeName = '标准化工程师发起'
}
// 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) {
@@ -85,8 +85,8 @@
<!-- 人员信息 -->
<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>
<process-detail-list :processKey="ProcessKey.ES_ANNUAL_INIT.value">
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNodeName"></personnel-info>
</process-detail-list>
</div>
@@ -144,11 +144,12 @@ import {
standardizationInitTurnTo,
standardizationInitAgree,
standardizationInitReject,
standardizationInitGetDataById
standardizationInitGetDataById,
standardizationInitGetDataDraft
} from '@/api/workCenter'
import pick from 'lodash.pick'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { ProcessKey } from '../../../enums/commonEnums'
import { ProcessKey, EsRevisionPlanStandardizationInitNodes } from '@/enums/commonEnums'
export default {
name: 'RevisionPlanStandardizationInitFlow',
@@ -173,40 +174,61 @@ export default {
}
},
mounted () {
// 获取人员信息结构
this.getPersonInfoStructure(ProcessKey.ES_ANNUAL_INIT.value)
if (this.$route.query.taskId) {
this.currentNodeName = this.$route.query.taskName
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData(this.$route.query.taskId)
} else {
this.currentNodeName = '标准化工程师发起'
}
// 初始化节点
const taskName = this.$route.query.taskName
if (taskName) {
if (taskName === '标准化工程师发起') {
const nodeId = this.$route.query.nodeId
if (nodeId) {
if (nodeId === EsRevisionPlanStandardizationInitNodes.standardizationStart.value) {
// 标准化工程师发起
this.currentNode = 1
} else if (taskName === '各部所联络人 填写/下发任务') {
} else if (nodeId === EsRevisionPlanStandardizationInitNodes.contactSelectApprover.value) {
// 部所联络人选取审批人
this.currentNode = 2
} else if (taskName === '主起草单位主管级领导审批下发') {
} else if (nodeId === EsRevisionPlanStandardizationInitNodes.mainDrafterLeaderSend.value) {
// 主起草单位主管级领导审批下发
this.currentNode = 3
} else if (taskName === '主起草人填写信息') {
} else if (nodeId === EsRevisionPlanStandardizationInitNodes.mainDrafterEnterInfo.value) {
// 主起草人填写信息
this.currentNode = 4
} else if (taskName === '部所联络人汇总') {
} else if (nodeId === EsRevisionPlanStandardizationInitNodes.contactsApproval.value) {
// 部所联络人汇总
this.currentNode = 5
} else if (taskName === '主起草单位主管级领导批准') {
} else if (nodeId === EsRevisionPlanStandardizationInitNodes.mainDrafterLeaderApproval.value) {
// 主起草单位主管级领导批准
this.currentNode = 6
} else if (taskName === '标准化归档') {
} else if (nodeId === EsRevisionPlanStandardizationInitNodes.standardizationSumUp.value) {
// 标准化归档
this.currentNode = 7
} else {
// 预留加签节点
this.currentNode = 999
}
}
// 如果不是第一个节点,人员信息全部不可选
if (this.currentNode !== 1) {
this.initPersonInfoData()
// 获取人员信息结构
this.getPersonInfoStructure(ProcessKey.ES_ANNUAL_INIT.value, () => {
if (this.$route.query.processInstanceId) {
if (this.currentNode === 1) {
this.disabled = false
this.initPersonInfoData(true)
} else {
this.disabled = true
// 如果不是第一个节点,人员信息全部不可选
this.initPersonInfoData(false)
}
}
})
if (this.$route.query.taskId && !this.$route.query.draftId) {
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData('todo', { taskId: this.$route.query.taskId })
}
if (this.$route.query.draftId) {
// 有草稿id,说明是从流程中心-草稿来的,需要初始化数据
this.getProcessData('draft', { draftId: this.$route.query.draftId, projectId: this.$route.query.projectId })
}
if (this.$route.query.taskName) {
// 说明是已发起流程
this.currentNodeName = this.$route.query.taskName
} else {
this.currentNodeName = '标准化工程师发起'
}
// 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) {
@@ -216,6 +238,7 @@ export default {
},
data () {
return {
ProcessKey,
loading: false,
switchValue: 'base',
processInfoForm: this.$form.createForm(this),
@@ -270,15 +293,26 @@ export default {
}
},
methods: {
getProcessData (taskId) {
standardizationInitGetDataById(taskId).then(res => {
getProcessData (type, param) {
let func
let params = {}
if (type === 'todo') {
func = standardizationInitGetDataById
params = param.taskId
} else {
func = standardizationInitGetDataDraft
params = param
}
func(params).then(res => {
if (res.success) {
this.model = res.result
this.$nextTick(() => {
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model.common, 'prcName', 'dueTime', 'prcMes'))
// 初始化流程审批信息,todo:需要判断是不是草稿进来的,草稿进来的才回显审批信息
// this.approvalInfoForm.setFieldsValue(pick(this.model[0], 'commitText', 'commitFile'))
// 初始化流程审批信息,草稿进来的才回显审批信息
if (type === 'draft') {
this.approvalInfoForm.setFieldsValue(pick(this.model.common, 'commitText', 'commitFile'))
}
})
this.$refs.baseInfoRef.initData(this.model.dataList)
} else {