[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, EsAnnulNodes } from '@/enums/commonEnums'
import { enStandardAnnulGetDataDraft } from '../../../api/workCenter'
export default {
name: 'EnterpriseStandardAnnulFlow',
@@ -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 === EsAnnulNodes.initiatorStart.value) {
// 发起人发起
this.currentNode = 1
} else if (taskName === '相关人员会签') {
} else if (nodeId === EsAnnulNodes.relevantPersonnelWillSign.value) {
// 起草人填写意见
this.currentNode = 2
} else if (taskName === '起草人和会签人主管级领导审批') {
} else if (nodeId === EsAnnulNodes.leaderApproval.value) {
// 起草人和会签人主管级领导审批
this.currentNode = 3
} else if (taskName === '标准化审批') {
} else if (nodeId === EsAnnulNodes.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
enStandardAnnulGetDataById(taskId).then(res => {
let func
let params = {}
if (type === 'todo') {
func = enStandardAnnulGetDataById
params = param.taskId
} else {
func = enStandardAnnulGetDataDraft
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
@@ -125,7 +125,8 @@ import {
import MainDrafterInitBaseInfo from './modules/MainDrafterInitBaseInfo'
import ApproveBaseInfo from './modules/ApproveBaseInfo'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { ProcessKey } from '../../../enums/commonEnums'
import { ProcessKey, EsChangeNodes } from '@/enums/commonEnums'
import { enStandardChangeGetDataDraft } from '../../../api/workCenter'
export default {
name: 'EnterpriseStandardChangeFlow',
@@ -144,39 +145,50 @@ export default {
}
},
mounted () {
// 获取人员信息结构
this.getPersonInfoStructure(ProcessKey.ES_CHANGE.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 === EsChangeNodes.mainDrafterStart.value) {
this.currentNode = 1
} else if (taskName === '相关人员校对') {
} else if (nodeId === EsChangeNodes.relevantPersonnelCheck.value) {
this.currentNode = 2
} else if (taskName === '起草人主管级领导审批') {
} else if (nodeId === EsChangeNodes.mainDrafterLeaderApproval.value) {
this.currentNode = 3
} else if (taskName === '标准化审批') {
} else if (nodeId === EsChangeNodes.standardizationApproval.value) {
this.currentNode = 4
} else if (taskName === '起草人主管级上一级领导审批') {
} else if (nodeId === EsChangeNodes.mainDrafterLeaderLeaderApproval.value) {
this.currentNode = 5
} else {
// 预留加签节点
this.currentNode = 999
}
}
if (this.currentNode === 1) {
this.disabled = false
this.initPersonInfoData(true)
// 获取人员信息结构
this.getPersonInfoStructure(ProcessKey.ES_CHANGE.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.disabled = true
this.initPersonInfoData(false)
this.currentNodeName = '发起人发起'
}
// 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) {
@@ -235,15 +247,26 @@ export default {
},
methods: {
// 根据流程id获取数据并回显
getProcessData (taskId) {
enStandardChangeGetDataById(taskId).then(res => {
getProcessData (type, param) {
let func
let params = {}
if (type === 'todo') {
func = enStandardChangeGetDataById
params = param.taskId
} else {
func = enStandardChangeGetDataDraft
params = param
}
func(params).then(res => {
if (res.success) {
this.model = res.result
this.$nextTick(() => {
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model[0], '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'))
}
})
// 初始化业务基本信息中组件内容
} else {
@@ -274,6 +297,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
if (this.$refs.baseInfoRef) {
// 业务基本信息
@@ -285,12 +310,9 @@ export default {
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
paramObj.data = Object.assign({}, baseInfo.formInline)
if (baseInfo.dataSource) {
paramObj.dataList = baseInfo.dataSource.map(item => {
return { ...item, ...baseInfo.formInline }
})
} else {
paramObj.dataList = [baseInfo.formInline]
paramObj.data.list = baseInfo.dataSource
}
} else {
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj }
@@ -328,12 +350,12 @@ export default {
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
this.loading = true
const param = {} // 需要传给后端的数据
param.common = { ...values, ...approvalValues }
param.flowUser = personnelObj
param.dataList = data.dataSource.map(item => {
return { ...item, ...data.formInline }
})
param.data = Object.assign({}, data.formInline)
param.data.list = data.dataSource
enStandardChangeApproval(param).then(res => {
if (res.success) {
this.$message.success(res.message)
@@ -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
@@ -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
@@ -175,7 +175,7 @@ export default {
}
}
})
if (this.$route.query.taskId) {
if (this.$route.query.taskId && !this.$route.query.draftId) {
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData('todo', { taskId: this.$route.query.taskId })
}
@@ -341,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