[update] 企标流程联调

This commit is contained in:
lideqin
2023-11-23 15:48:59 +08:00
parent 33977f873c
commit edb1a3404e
6 changed files with 190 additions and 82 deletions
@@ -123,7 +123,8 @@ import {
} from '@/api/workCenter'
import BaseInfoForm from './modules/BaseInfoForm'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { ProcessKey } from '@/enums/commonEnums'
import { ProcessKey, EsSealSaveNodes } from '@/enums/commonEnums'
import { enStandardSealSaveGetDataDraft } from '../../../api/workCenter'
export default {
name: 'EnterpriseStandardSealSaveFlow',
@@ -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 === EsSealSaveNodes.initiatorStart.value) {
// 发起人发起
this.currentNode = 1
} else if (taskName === '相关人员会签') {
} else if (nodeId === EsSealSaveNodes.relevantPersonnelWillSign.value) {
// 起草人填写意见
this.currentNode = 2
} else if (taskName === '起草人和会签人主管级领导审批') {
} else if (nodeId === EsSealSaveNodes.leaderApproval.value) {
// 起草人和会签人主管级领导审批
this.currentNode = 3
} else if (taskName === '标准化审批') {
} else if (nodeId === EsSealSaveNodes.standardizationApproval.value) {
// 标准化审批
this.currentNode = 4
} else {
@@ -174,10 +175,17 @@ export default {
}
}
})
if (this.$route.query.taskId) {
this.currentNodeName = this.$route.query.taskName
if (this.$route.query.taskId && !this.$route.query.draftId) {
// 有流程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
enStandardSealSaveGetDataById(taskId).then(res => {
let func
let params = {}
if (type === 'todo') {
func = enStandardSealSaveGetDataById
params = param.taskId
} else {
func = enStandardSealSaveGetDataDraft
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
@@ -320,6 +341,7 @@ export default {
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
this.loading = true
const paramObj = {} // 需要传给后端的数据
paramObj.common = { ...values, ...approvalValues }
paramObj.flowUser = personnelObj