[update] 企标流程联调
This commit is contained in:
@@ -139,7 +139,8 @@ import StandardizationInitBaseInfo from './modules/StandardizationInitBaseInfo'
|
||||
import DrafterEnterOptionBaseInfo from './modules/DrafterEnterOptionBaseInfo'
|
||||
import RecheckApproveBaseInfo from './modules/RecheckApproveBaseInfo'
|
||||
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
|
||||
import { ProcessKey } from '../../../enums/commonEnums'
|
||||
import { ProcessKey, EsRecheckNodes } from '@/enums/commonEnums'
|
||||
import { enStandardRecheckGetDataDraft } from '../../../api/workCenter'
|
||||
|
||||
export default {
|
||||
name: 'EnterpriseStandardRecheckFlow',
|
||||
@@ -161,21 +162,21 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
// 初始化节点
|
||||
const taskName = this.$route.query.taskName
|
||||
if (taskName) {
|
||||
if (taskName === '标准化发起') {
|
||||
// 发起人发起
|
||||
const nodeId = this.$route.query.taskName
|
||||
if (nodeId) {
|
||||
if (nodeId === EsRecheckNodes.standardizationSelectContact.value) {
|
||||
// 标准化工程师选择联络人
|
||||
this.currentNode = 1
|
||||
} else if (taskName === '联络人发起') {
|
||||
// 联络人发起
|
||||
} else if (nodeId === EsRecheckNodes.initiatorStart.value) {
|
||||
// 发起人发起
|
||||
this.currentNode = 2
|
||||
} else if (taskName === '起草人填写意见') {
|
||||
} else if (nodeId === EsRecheckNodes.drafterEnterOption.value) {
|
||||
// 起草人填写意见
|
||||
this.currentNode = 3
|
||||
} else if (taskName === '起草人部长审批') {
|
||||
} else if (nodeId === EsRecheckNodes.drafterMinisterApproval.value) {
|
||||
// 起草人部长审批
|
||||
this.currentNode = 4
|
||||
} else if (taskName === '标准化审批') {
|
||||
} else if (nodeId === EsRecheckNodes.standardizationApproval.value) {
|
||||
// 标准化审批
|
||||
this.currentNode = 5
|
||||
} else {
|
||||
@@ -197,13 +198,21 @@ 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)
|
||||
} else {
|
||||
this.currentNodeName = '联络人发起'
|
||||
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.recheckPlanId) {
|
||||
this.$nextTick(() => {
|
||||
// 说明是从企标复审计划页面发起跳转过来的
|
||||
@@ -267,16 +276,27 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
// 根据流程id获取数据并回显
|
||||
getProcessData (taskId) {
|
||||
getProcessData (type, param) {
|
||||
this.loading = true
|
||||
enStandardRecheckGetDataById(taskId).then(res => {
|
||||
let func
|
||||
let params = {}
|
||||
if (type === 'todo') {
|
||||
func = enStandardRecheckGetDataById
|
||||
params = param.taskId
|
||||
} else {
|
||||
func = enStandardRecheckGetDataDraft
|
||||
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)
|
||||
@@ -321,6 +341,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
|
||||
@@ -349,6 +371,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
|
||||
|
||||
Reference in New Issue
Block a user