[update] 修改企标流程

This commit is contained in:
lideqin
2023-11-22 18:19:06 +08:00
parent 16678e037d
commit df07366bd1
5 changed files with 77 additions and 17 deletions
@@ -115,6 +115,7 @@ import UserSelectModal from '@/components/selection/UserSelectModal'
import pick from 'lodash.pick'
import {
enStandardStartUseGetDataById,
enStandardStartUseGetDataDraft,
enStandardStartUseSave,
enStandardStartUseApproval,
enStandardStartUseTurnTo,
@@ -123,7 +124,7 @@ import {
} from '@/api/workCenter'
import BaseInfoForm from './modules/BaseInfoForm'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { ProcessKey } from '../../../enums/commonEnums'
import { ProcessKey, EsStartUseNodes } from '@/enums/commonEnums'
export default {
name: 'EnterpriseStandardStartUseFlow',
@@ -142,18 +143,18 @@ export default {
},
mounted () {
// 初始化节点
const taskName = this.$route.query.taskName
if (taskName) {
if (taskName === '发起人发起') {
const nodeId = this.$route.query.nodeId
if (nodeId) {
if (nodeId === EsStartUseNodes.initiatorStart.value) {
// 发起人发起
this.currentNode = 1
} else if (taskName === '相关人员会签') {
} else if (nodeId === EsStartUseNodes.relevantPersonnelWillSign.value) {
// 相关人员会签
this.currentNode = 2
} else if (taskName === '起草人和会签人主管级领导审批') {
} else if (nodeId === EsStartUseNodes.leaderApproval.value) {
// 起草人部长审批
this.currentNode = 3
} else if (taskName === '标准化审批') {
} else if (nodeId === EsStartUseNodes.standardizationApproval.value) {
// 标准化审批
this.currentNode = 4
} else {
@@ -175,9 +176,16 @@ export default {
}
})
if (this.$route.query.taskId) {
this.currentNodeName = this.$route.query.taskName
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData(this.$route.query.taskId)
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 = '发起人发起'
}
@@ -238,16 +246,27 @@ export default {
},
methods: {
// 根据流程id获取数据并回显
getProcessData (taskId) {
getProcessData (type, param) {
this.loading = true
enStandardStartUseGetDataById(taskId).then(res => {
let func
let params = {}
if (type === 'todo') {
func = enStandardStartUseGetDataById
params = param.taskId
} else {
func = enStandardStartUseGetDataDraft
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'))
}
if (this.$refs.baseInfoRef) {
this.$refs.baseInfoRef.initData(this.model.data)
}
@@ -292,6 +311,8 @@ export default {
// 需要传给后端的数据
const paramObj = {}
paramObj.common = { ...processInfoForm, ...approvalInfoForm }
paramObj.common.taskId = this.$route.query.taskId || null
paramObj.common.processInstanceId = this.model.common ? this.model.common.processInstanceId : null
paramObj.flowUser = personnelObj
paramObj.data = baseInfo.formInline
this.loading = true