[update] 修改企标流程各模块的数据格式

This commit is contained in:
lideqin
2023-11-09 15:28:36 +08:00
parent 3d90dde143
commit 370f59d7bd
11 changed files with 351 additions and 539 deletions
@@ -275,137 +275,6 @@ import { USER_INFO } from '@/store/mutation-types'
import pick from 'lodash.pick'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
// 标准立项的人员信息
const approvalPersonalInfo = [ // 人员信息的数据
{
id: 1,
nodeName: '主起草人发起',
nodeRoleName: '发起人',
canChoose: false,
userList: Vue.ls.get(USER_INFO).realname + '(' + Vue.ls.get(USER_INFO).username + ')',
fieldName: 'createUser'
},
{
id: 2,
nodeName: '部所联络人校对',
nodeRoleName: '部所联络人',
canChoose: true,
chooseType: 'radio',
chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 3,
nodeName: '专家审批',
nodeRoleName: '专家',
canChoose: true,
chooseType: 'checkbox',
chooseSource: 'workGroup',
fieldName: 'standardExpert',
minLength: 2
},
{
id: 4,
nodeName: '发起人主管级领导审批',
nodeRoleName: '发起人主管级领导',
canChoose: true,
chooseType: 'radio',
fieldName: 'mainDraftUserLeader'
},
{
id: 5,
nodeName: '发起人主管级上级领导审批',
nodeRoleName: '发起人主管级上级领导',
canChoose: true,
chooseType: 'radio',
fieldName: 'mainDraftUserLeaderLeader'
},
{
id: 6,
nodeName: '标准化审批',
nodeRoleName: '标准化',
canChoose: true,
chooseType: 'radio',
fieldName: 'standardizationApprovalUser'
}
]
// 变更的人员信息
const changePersonalInfo = [
{
id: 1,
nodeName: '主起草人发起',
nodeRoleName: '发起人',
userList: Vue.ls.get(USER_INFO).realname + '(' + Vue.ls.get(USER_INFO).username + ')',
fieldName: 'createUser',
canChoose: false
},
{
id: 2,
nodeName: '部所联络人校对',
nodeRoleName: '部所联络人',
canChoose: true,
chooseType: 'radio',
chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 3,
nodeName: '主起草人主管级领导审批',
nodeRoleName: '主起草人主管级领导',
canChoose: true,
chooseType: 'radio',
fieldName: 'mainDraftUserLeader'
},
{
id: 4,
nodeName: '主起草人主管级上一级领导审批',
nodeRoleName: '主起草人主管级上一级领导',
canChoose: true,
chooseType: 'radio',
fieldName: 'mainDraftUserLeaderLeader'
},
{
id: 5,
nodeName: '标准化审批',
nodeRoleName: '标准化',
canChoose: true,
chooseType: 'radio',
fieldName: 'standardizationApprovalUser'
},
{
id: 6,
nodeName: '新起草部门主管级上一级领导下发',
nodeRoleName: '新起草部门主管级上一级领导',
canChoose: false,
chooseType: 'radio',
fieldName: 'newMainDraftUserLeaderLeader'
},
{
id: 7,
nodeName: '新起草部门主管级领导确认',
nodeRoleName: '新起草部门主管级领导',
canChoose: false,
chooseType: 'radio',
fieldName: 'newMainDraftUserLeader'
},
{
id: 8,
nodeName: '相关人员会签',
nodeRoleName: '相关人员',
canChoose: false,
chooseType: 'checkbox',
fieldName: 'relatedUser'
},
{
id: 9,
nodeName: '抄送主起草人',
nodeRoleName: '主起草人',
canChoose: false,
chooseType: 'checkbox',
fieldName: 'createUser'
}
]
export default {
name: 'PlanApprovalFlow',
components: {
@@ -572,13 +441,9 @@ export default {
if (this.$route.query.processInstanceId) {
param.processInstanceId = this.$route.query.processInstanceId
}
console.log(param)
getProcessNodeList(param).then(res => {
if (res.success) {
console.log(res.result)
// 处理人员信息数据
// 筛选出是立项、责任部门变更,其他变更
// 每个节点是否能选人
this.personnelInfoDataAll = res.result.map(item => {
return {
...item,
@@ -602,7 +467,6 @@ export default {
resetPersonInfoStructure (type) {
// 筛选出人员信息
this.personnelInfoData = this.personnelInfoDataAll.filter(item => item.branchType.split(',').includes(type))
console.log(this.personnelInfoData)
},
// 根据流程id获取数据并回显
getProcessData (taskId) {
@@ -621,6 +485,19 @@ export default {
this.formInline = Object.assign({}, baseInfoForm)
baseInfoForm.projectType = this.model.dataList[0].projectType
this.formInline = Object.assign({}, baseInfoForm)
// 初始化人员信息
if (this.formInline.applicationCategory === ApplicationCategory.INITIATION.value) {
// 立项
this.resetPersonInfoStructure('1')
} else if (this.formInline.applicationCategory === ApplicationCategory.CHANGE.value &&
this.formInline.projectType !== ProjectType.RESPONSIBLE_DEPT_CHANGE.value) {
// 非责任部门变更
this.resetPersonInfoStructure('2')
} else if (this.formInline.applicationCategory === ApplicationCategory.CHANGE.value &&
this.formInline.projectType === ProjectType.RESPONSIBLE_DEPT_CHANGE.value) {
// 变更的责任部门变更
this.resetPersonInfoStructure('3')
}
// 初始化流程节点,此流程因为节点名称有重复,需要在此处根据applicationCatsegory做一些判断
const taskName = this.$route.query.taskName
if (taskName) {
@@ -647,6 +524,10 @@ export default {
this.currentNode = 999
}
}
if (this.currentNode !== 1) {
// 不是第一个节点需要处理人员信息都不可选
this.initPersonInfoData()
}
console.log(this.currentNode)
// 根据流程节点初始化是否可以编辑
if (this.currentNode === 1) {
@@ -654,57 +535,6 @@ export default {
} else {
this.disabled = true
}
// 初始化人员信息
if (this.formInline.applicationCategory === ApplicationCategory.INITIATION.value && this.currentNode === 1) {
// 立项的节点1
this.personnelInfoData = approvalPersonalInfo.map(item => {
if (item.fieldName) {
return {
...item,
user: this.model.flowUser[item.fieldName],
user_dictText: this.model.flowUser[item.fieldName + '_dictText']
}
} else {
return item
}
})
} else if (this.formInline.applicationCategory === ApplicationCategory.INITIATION.value) {
// 立项的其他节点
this.personnelInfoData = approvalPersonalInfo.map(item => {
if (item.fieldName) {
return {
...item,
user: this.model.flowUser[item.fieldName],
userList: this.model.flowUser[item.fieldName + '_dictText'],
canChoose: false
}
} else {
return item
}
})
} else if (this.formInline.applicationCategory === ApplicationCategory.CHANGE.value && this.currentNode === 1) {
// 变更的节点1
this.personnelInfoData = changePersonalInfo.map(item => {
if (item.fieldName) {
return {
...item,
user: this.model.flowUser[item.fieldName],
user_dictText: this.model.flowUser[item.fieldName + '_dictText']
}
} else {
return item
}
})
} else {
// 变更的其他节点
this.personnelInfoData = changePersonalInfo.map(item => {
if (item.fieldName) {
return { ...item, user: this.model.flowUser[item.fieldName], userList: this.model.flowUser[item.fieldName + '_dictText'], canChoose: false }
} else {
return item
}
})
}
// 初始化业务基本信息中组件内容
if (this.formInline.applicationCategory === ApplicationCategory.INITIATION.value) {
// 是立项
@@ -790,15 +620,7 @@ export default {
// 部分节点的选人表单
const userInfoForm = this.userForm.getFieldsValue()
// 人员信息的数据, 处理成对象
const personnelInfo = this.$refs.personnelInfo.stepsData
const personnelObj = {}
for (const item of personnelInfo) {
if (item.fieldName) {
personnelObj[item.fieldName] = item.user
}
}
// 发起人设置为当前登录人
personnelObj.createUser = Vue.ls.get(USER_INFO).id
const personnelObj = this.$refs.personnelInfo.getDataObj
// 业务基础信息组件中的数据
let arr = []
// 业务基本信息-立项表单
@@ -898,6 +720,7 @@ export default {
// 专家审批至少需要选两个专家 todo: 后端选多人流程进行不下去,暂时不限制传多人
// if (personnelObj.standardExpert.split(',').length < 2) {
// this.$message.warning(this.$t('workCenter.enterpriseInitChangePlan.pleaseSelectLeastTwoExpert'))
// return
// }
console.log(this.formInline)
this.processInfoForm.validateFields((err, values) => {