[update] 处理流程中人员信息

This commit is contained in:
lideqin
2023-11-08 15:37:19 +08:00
parent ea6aac0329
commit 7cee81d2b5
17 changed files with 385 additions and 255 deletions
+5
View File
@@ -1,5 +1,8 @@
import { getAction, postAction } from './manage.js' import { getAction, postAction } from './manage.js'
// 查询定义流程列表
const getProcessNodeList = (params) => getAction('/process/fb/processFbInfo/getNodeList', params)
// 流程配置-部署 // 流程配置-部署
const deployWorkFlow = (params) => getAction('/activitiModel/deploy', params) const deployWorkFlow = (params) => getAction('/activitiModel/deploy', params)
// 流程配置-获取节点列表 // 流程配置-获取节点列表
@@ -131,6 +134,8 @@ const toDoTurnTo = (params) => postAction('', params)
// 已发-强制撤回 // 已发-强制撤回
const compulsoryWithdrawal = (params) => postAction('', params) const compulsoryWithdrawal = (params) => postAction('', params)
export { export {
getProcessNodeList,
deployWorkFlow, deployWorkFlow,
getFlowNodeList, getFlowNodeList,
addFlowNode, addFlowNode,
+41 -12
View File
@@ -10,28 +10,28 @@
</div> </div>
</template> </template>
<!-- 流程节点标题--> <!-- 流程节点标题-->
<template #title> <!--<template #title>-->
<a-tooltip> <!-- <a-tooltip>-->
<template #title>{{ step.nodeName }}</template> <!-- <template #title>{{ step.nodeName }}</template>-->
<div class="step-title">{{ step.nodeName }}</div> <!-- <div class="step-title">{{ step.nodeName }}</div>-->
</a-tooltip> <!-- </a-tooltip>-->
</template> <!--</template>-->
<!-- 流程节点选人内容--> <!-- 流程节点选人内容-->
<template #description> <template #description>
<div class="personnel-container"> <div class="personnel-container">
<div class="personnel-container-title" :class="{'personnel-container-select-title': index === 0}"> <div class="personnel-container-title" :class="{'personnel-container-select-title': index === 0}">
<a-tooltip> <a-tooltip>
<template #title>{{ step.nodeRoleName }}</template> <template #title>{{ step.nodeName }}</template>
<div class="personnel-container-title-text">{{ step.nodeRoleName }}</div> <div class="personnel-container-title-text">{{ step.nodeName }}</div>
</a-tooltip> </a-tooltip>
</div> </div>
<div class="personnel-container-content"> <div class="personnel-container-content">
<div class="personnel-container-content-text"> <div class="personnel-container-content-text">
<template v-if="step.canChoose && index >= currentNodeIndex"> <template v-if="step.canChoose && index >= currentNodeIndex">
<!-- TODO 数据库设计确定后处理数据抛出格式--> <!-- TODO 数据库设计确定后处理数据抛出格式-->
<user-select-by-work-group v-if="step.chooseSource === 'workGroup'" v-model="step.user" :type="step.chooseType" :name-str="step.user_dictText" input-type="textarea"/> <user-select-by-work-group v-if="step.chooseSource === 'workGroup'" v-model="step.linkUserIds" :type="step.chooseType" :name-str="step.linkUserIds_dictText" input-type="textarea"/>
<user-select-by-contact v-else-if="step.chooseSource === 'contactManage'" v-model="step.user" :type="step.chooseType" :name-str="step.user_dictText" input-type="textarea"/> <user-select-by-contact v-else-if="step.chooseSource === 'contactManage'" v-model="step.linkUserIds" :type="step.chooseType" :name-str="step.linkUserIds_dictText" input-type="textarea"/>
<user-selection v-else-if="!['contactManage', 'workGroup'].includes(step.chooseSource)" :type="step.chooseType" v-model="step.user" :name-str="step.user_dictText" input-type="textarea" /> <user-selection v-else-if="step.chooseSource === 'user'" :type="step.chooseType" v-model="step.linkUserIds" :name-str="step.linkUserIds_dictText" input-type="textarea" />
</template> </template>
<div class="personnel-container-content-echo-text" v-else>{{ step.userList }}</div> <div class="personnel-container-content-echo-text" v-else>{{ step.userList }}</div>
</div> </div>
@@ -88,6 +88,34 @@ export default {
deep: true, deep: true,
immediate: true immediate: true
} }
},
methods: {
// 获取人员对象,无校验
getDataObj () {
const personnelObj = {}
for (const item of this.stepsData) {
// 该属性还没有人就给他赋值
if ((item.canChoose || item.sort === 1) && !personnelObj[item.variableName]) {
personnelObj[item.variableName] = item.linkUserIds
}
}
return personnelObj
},
// 有校验的获取人员对象
getDataObjVerify () {
let personnelObj = {}
for (const item of this.stepsData) {
// 该属性还没有人就给他赋值
if ((item.canChoose || item.sort === 1) && !personnelObj[item.variableName]) {
personnelObj[item.variableName] = item.linkUserIds
}
}
if (!Object.values(personnelObj).every(v => !!v)) {
this.$message.warning(this.$t('pleaseEnterPersonnelInfo'))
personnelObj = false
}
return personnelObj
}
} }
} }
</script> </script>
@@ -106,7 +134,8 @@ export default {
} }
/deep/ .ant-steps-item-content { /deep/ .ant-steps-item-content {
padding: 0 12px; padding: 0 12px 30px 12px;
} }
.step-title { .step-title {
+59
View File
@@ -0,0 +1,59 @@
import { getProcessNodeList } from '../api/workCenter'
import Vue from 'vue'
import { USER_INFO } from '../store/mutation-types'
export const WorkCenterMixin = {
data () {
return {
personnelInfoData: [] // 需要传给PersonnelInfo的数据
}
},
methods: {
// 查询人员信息结构数据
getPersonInfoStructure (key) {
const param = {}
param.processDefinitionKey = key
if (this.$route.query.processInstanceId) {
param.processInstanceId = this.$route.query.processInstanceId
}
getProcessNodeList(param).then(res => {
if (res.success) {
console.log(res.result)
// 处理人员信息数据,判断每个节点是否能选人
this.personnelInfoData = res.result.map(item => {
return {
...item,
chooseType: item.variableType === 'string' ? 'radio' : 'checkbox'
}
})
if (!this.$route.query.processInstanceId) {
// 说明是在新发起一个节点,初始化发起人员信息
this.personnelInfoData[0].linkUserIds = Vue.ls.get(USER_INFO).id
this.personnelInfoData[0].userList = Vue.ls.get(USER_INFO).realname + '(' + Vue.ls.get(USER_INFO).username + ')'
}
}
})
},
/**
* 待办中进入需要初始化人员信息数据
* @param isFirstNode 是否是第一个节点,第一个节点需要能编辑的可以编辑并且回显数据
*/
initPersonInfoData (isFirstNode) {
if (!isFirstNode) {
this.personnelInfoData = this.personnelInfoData.map(item => {
return {
...item,
userList: item.linkUserIds_dictText,
canChoose: 0
}
})
}
},
// 操作完成返回
goBack () {
setTimeout(() => {
this.$router.go(-1)
}, 700)
}
}
}
@@ -99,7 +99,7 @@
<!-- 人员信息 --> <!-- 人员信息 -->
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0"> <div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list> <process-detail-list>
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNode + ''"></personnel-info> <personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNodeName"></personnel-info>
</process-detail-list> </process-detail-list>
</div> </div>
@@ -162,64 +162,19 @@ import {
import Vue from 'vue' import Vue from 'vue'
import { USER_INFO } from '@/store/mutation-types' import { USER_INFO } from '@/store/mutation-types'
import pick from 'lodash.pick' import pick from 'lodash.pick'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { ProcessKey } from '@/enums/commonEnums'
const personData = [ const taskNameConstant = {
{ STANDARD_ENGINEER_INIT: '标准化工程师发起',
id: 1, CONTACT_USER_DISTRIBUTE: '各部所联络人 填写/下发任务',
nodeName: '标准化工程师发起', WORK_GROUP_COLLECT: '工作组联络人 线下收集,填写计划内容(可跳过)',
nodeRoleName: '发起人', COLLECT_LEADER_APPROVAL: '收集联络人主管级领导审批',
canChoose: false, CONTACT_USER_COLLECT: '各部所联络人汇总',
userList: Vue.ls.get(USER_INFO).realname + '(' + Vue.ls.get(USER_INFO).username + ')', CONTACT_USER_LEADER_APPROVAL: '联络人主管级上级领导审批',
fieldName: 'standardEngineer' CONTACT_USER_EDIT: '各部所联络人修改调整',
}, STANDARD_ENGINEER_COLLECT: '标准化工程师归档'
{ }
id: 2,
nodeName: '各部门联络人填写/下发任务',
nodeRoleName: '各部门联络人',
canChoose: true,
chooseType: 'checkbox',
fieldName: 'contactUserList'
},
{
id: 3,
nodeName: '工作组/所联络人填写企标',
nodeRoleName: '工作组/所联络人',
canChoose: false,
fieldName: 'workGroupUserList'
},
{
id: 4,
nodeName: '收集联络人主管级领导审批',
nodeRoleName: '联络人主管级领导',
canChoose: false,
chooseType: 'checkbox',
fieldName: 'collectUserLeader'
},
{
id: 5,
nodeName: '各部门联络人汇总',
nodeRoleName: '各部门联络人',
canChoose: false,
chooseType: 'checkbox',
fieldName: 'contactUserList'
},
{
id: 6,
nodeName: '联络人主管级上一级领导审批',
nodeRoleName: '联络人主管级上一级领导',
canChoose: false,
chooseType: 'checkbox',
fieldName: 'contactUserLeaderLeader'
},
{
id: 7,
nodeName: '标准化工程师归档',
nodeRoleName: '标准化工程师',
canChoose: false,
chooseType: 'radio',
fieldName: 'standardEngineer'
}
]
export default { export default {
name: 'RevisionPlanActivelyReportFlow', name: 'RevisionPlanActivelyReportFlow',
@@ -233,6 +188,7 @@ export default {
PersonnelInfo, PersonnelInfo,
UserSelectModal UserSelectModal
}, },
mixins: [WorkCenterMixin],
computed: { computed: {
pageTitle () { pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title return this.$t('flowCenter') + this.$route.meta.title
@@ -243,30 +199,42 @@ export default {
} }
}, },
mounted () { mounted () {
// 获取人员信息结构
this.getPersonInfoStructure(ProcessKey.ES_ANNUAL_REPORT.value)
if (this.$route.query.taskId) { if (this.$route.query.taskId) {
this.currentNodeName = this.$route.query.taskName
// 有流程id说明是从流程中心来的,需要初始化数据 // 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData(this.$route.query.taskId) this.getProcessData(this.$route.query.taskId)
} else { } else {
// 没有taskId说明是新建进来的,初始化人员信息 this.currentNodeName = '标准化工程师发起'
this.personnelInfoData = personData
} }
// 初始化节点 // 初始化节点
const taskName = this.$route.query.taskName const taskName = this.$route.query.taskName
if (taskName) { if (taskName) {
if (taskName === '标准化工程师发起') { if (taskName === taskNameConstant.STANDARD_ENGINEER_INIT) {
// 标准化工程师发起
this.currentNode = 1 this.currentNode = 1
} else if (taskName === '各部所联络人 填写/下发任务') { } else if (taskName === taskNameConstant.CONTACT_USER_DISTRIBUTE) {
// 各部所联络人 填写/下发任务
this.currentNode = 2 this.currentNode = 2
} else if (taskName === '工作组/所联络人填写企标') { } else if (taskName === taskNameConstant.WORK_GROUP_COLLECT) {
// 工作组联络人 线下收集,填写计划内容(可跳过)
this.currentNode = 3 this.currentNode = 3
} else if (taskName === '收集联络人主管级领导审批') { } else if (taskName === taskNameConstant.COLLECT_LEADER_APPROVAL) {
// 收集联络人主管级领导审批
this.currentNode = 4 this.currentNode = 4
} else if (taskName === '各部所联络人汇总') { } else if (taskName === taskNameConstant.CONTACT_USER_COLLECT) {
// 各部所联络人汇总
this.currentNode = 5 this.currentNode = 5
} else if (taskName === '联络人主管级上一级领导审批') { } else if (taskName === taskNameConstant.CONTACT_USER_LEADER_APPROVAL) {
// 联络人主管级上级领导审批
this.currentNode = 6 this.currentNode = 6
} else { } else if (taskName === taskNameConstant.STANDARD_ENGINEER_COLLECT) {
// 标准化工程师归档
this.currentNode = 7 this.currentNode = 7
} else {
// 预留加签节点
this.currentNode = 999
} }
} }
// 如果是查看进入的,不可编辑,不可操作 // 如果是查看进入的,不可编辑,不可操作
@@ -342,25 +310,11 @@ export default {
}) })
// 初始化人员信息 // 初始化人员信息
if (this.currentNode === 1) { if (this.currentNode === 1) {
this.personnelInfoData = personData.map(item => { // 初始化人员信息数据
if (item.fieldName) { this.initPersonInfoData(true)
return {
...item,
user: this.model.flowUser[item.fieldName],
user_dictText: this.model.flowUser[item.fieldName + '_dictText']
}
} else {
return item
}
})
} else { } else {
this.personnelInfoData = personData.map(item => { // 初始化人员信息数据
if (item.fieldName) { this.initPersonInfoData(false)
return { ...item, user: this.model.flowUser[item.fieldName], userList: this.model.flowUser[item.fieldName + '_dictText'], canChoose: false }
} else {
return item
}
})
} }
// 初始化业务基本信息 // 初始化业务基本信息
if (this.currentNode === 1) { if (this.currentNode === 1) {
@@ -391,44 +345,54 @@ export default {
// 流程审批信息 // 流程审批信息
const approvalInfoForm = this.approvalInfoForm.getFieldsValue() const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
// 人员信息的数据, 处理成对象 // 人员信息的数据, 处理成对象
const personnelInfo = this.$refs.personnelInfo.stepsData const personnelObj = this.$refs.personnelInfo.getDataObj()
const personnelObj = {}
for (const item of personnelInfo) {
if (item.fieldName) {
personnelObj[item.fieldName] = item.user
}
}
// 需要传给后端的 // 需要传给后端的
let param = {} const paramObj = {}
param.common = { ...processInfoForm, ...approvalInfoForm } paramObj.common = { ...processInfoForm, ...approvalInfoForm }
param.flowUser = personnelObj paramObj.flowUser = personnelObj
// 业务基本信息 // 业务基本信息
if (this.$refs.baseInfoFormRef) { if (this.$refs.baseInfoFormRef) {
const ruleForm = this.$refs.baseInfoFormRef.getData() const ruleForm = this.$refs.baseInfoFormRef.getData()
if (this.currentNode === 1) { if (this.currentNode === 1) {
// 只有表单 // 只有表单
param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...ruleForm.formInline } const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...ruleForm.formInline }
const flag = Object.values(param).some(v => !!v || v === 0) const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag) { if (!flag) {
// 提示至少填写一项 // 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem')) this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return return
} }
param.dataList = [ruleForm.formInline] paramObj.dataList = [ruleForm.formInline]
} else if ([2, 3].includes(this.currentNode)) { } else if (this.currentNode === 2) {
// 业务基本信息有表单,可能有表格也可能没有
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...ruleForm.formInline }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag || (ruleForm.dataSource && ruleForm.dataSource.length <= 0)) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
if (ruleForm.dataSource) {
paramObj.dataList = ruleForm.dataSource.map(item => {
return { ...item, ...ruleForm.formInline }
})
} else {
paramObj.dataList = [ruleForm.formInline]
}
} else if (this.currentNode === 3) {
// 业务基本信息有表单也有表格 // 业务基本信息有表单也有表格
param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...ruleForm.formInline } const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...ruleForm.formInline }
const flag = Object.values(param).some(v => !!v || v === 0) const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag || ruleForm.dataSource.length <= 0) { if (!flag || ruleForm.dataSource.length <= 0) {
// 提示至少填写一项 // 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem')) this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return return
} }
param.dataList = ruleForm.dataSource.map(item => { paramObj.dataList = ruleForm.dataSource.map(item => {
return { ...item, ...ruleForm.formInline } return { ...item, ...ruleForm.formInline }
}) })
} else if (this.currentNode === 5) { } else if (this.currentNode === 5) {
param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj } const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj }
const flag = Object.values(param).some(v => !!v || v === 0) const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag || ruleForm.dataSource.length <= 0) { if (!flag || ruleForm.dataSource.length <= 0) {
// 提示至少填写一项 // 提示至少填写一项
@@ -436,11 +400,11 @@ export default {
return return
} }
// 业务基础信息中只有表格 // 业务基础信息中只有表格
param.dataList = ruleForm.dataSource paramObj.dataList = ruleForm.dataSource
} }
} else { } else {
// 需要外层信息至少填了一项 // 需要外层信息至少填了一项
param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj } const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj }
const flag = Object.values(param).some(v => !!v || v === 0) const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag) { if (!flag) {
// 提示至少填写一项 // 提示至少填写一项
@@ -450,7 +414,7 @@ export default {
} }
this.loading = true this.loading = true
// 保存到草稿 // 保存到草稿
activelyReportSave(param).then(res => { activelyReportSave(paramObj).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
this.goBack() this.goBack()
@@ -465,18 +429,8 @@ export default {
handleStart () { handleStart () {
if (this.loading) return if (this.loading) return
// 人员信息的数据, 处理成对象 // 人员信息的数据, 处理成对象
const personnelInfo = this.$refs.personnelInfo.stepsData const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
const personnelObj = {} if (!personnelObj) {
for (const item of personnelInfo) {
if (item.fieldName && item.canChoose) {
personnelObj[item.fieldName] = item.user
}
}
// 发起人,标准化工程师设置为当前登录人
personnelObj.standardEngineer = Vue.ls.get(USER_INFO).id
// 校验是否填了所有能填的人员信息
if (!Object.values(personnelObj).every(v => !!v)) {
this.$message.warning(this.$t('pleaseEnterPersonnelInfo'))
return return
} }
// 流程信息校验 // 流程信息校验
@@ -574,8 +528,9 @@ export default {
this.approvalInfoForm.validateFields((err, values) => { this.approvalInfoForm.validateFields((err, values) => {
if (!err) { if (!err) {
this.loading = true this.loading = true
const param = Object.assign({}, values) const param = {}
param.taskId = this.$route.query.taskId param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
activelyReportAgree(param).then(res => { activelyReportAgree(param).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
@@ -595,8 +550,9 @@ export default {
this.approvalInfoForm.validateFields((err, values) => { this.approvalInfoForm.validateFields((err, values) => {
if (!err) { if (!err) {
this.loading = true this.loading = true
const param = Object.assign({}, values) const param = {}
param.taskId = this.$route.query.taskId param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
activelyReportReject(param).then(res => { activelyReportReject(param).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
@@ -609,9 +565,6 @@ export default {
}) })
} }
}) })
},
goBack () {
this.$router.go(-1)
} }
} }
} }
@@ -120,8 +120,7 @@ export default {
} }
] ]
}, },
modalType: '', // 是在新增还是在编辑,编辑的时候放正在编辑的下标 modalType: '' // 是在新增还是在编辑,编辑的时候放正在编辑的下标
data: undefined
} }
}, },
methods: { methods: {
@@ -131,7 +130,6 @@ export default {
}, },
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
this.data = data
// 给表单赋值 // 给表单赋值
if (data.dataList[0].distributeFlag + '' === '0') { if (data.dataList[0].distributeFlag + '' === '0') {
// 不下发联络人 // 不下发联络人
@@ -166,11 +164,11 @@ export default {
if (result) { if (result) {
if (this.$refs.tableRef) { if (this.$refs.tableRef) {
// 存在表格说明是否下发联络人选择了否 // 存在表格说明是否下发联络人选择了否
if (this.$refs.tableRef.dataSource && this.$refs.tableRef.dataSource.length > 0) { const tableData = this.$refs.tableRef.getDataValidate()
if (tableData) {
data.formInline = this.formInline data.formInline = this.formInline
data.dataSource = this.$refs.tableRef.dataSource data.dataSource = tableData.dataSource
} else { } else {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
data = false data = false
} }
} else { } else {
@@ -63,8 +63,7 @@ export default {
} }
] ]
}, },
modalType: '', // 是在新增还是在编辑,编辑的时候放正在编辑的下标 modalType: '' // 是在新增还是在编辑,编辑的时候放正在编辑的下标
data: undefined
} }
}, },
methods: { methods: {
@@ -74,7 +73,6 @@ export default {
}, },
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
this.data = data
// 给表单赋值 // 给表单赋值
this.formInline = { collectUserLeader: data.flowUser.collectUserLeader } this.formInline = { collectUserLeader: data.flowUser.collectUserLeader }
// 给表格赋值 // 给表格赋值
@@ -96,25 +94,23 @@ export default {
return data return data
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) { async getDataValidate () {
// 可能是表单,也可能是表格,表单校验一定要填,有是否下发联络人 // 可能是表单,也可能是表格,表单校验一定要填,有是否下发联络人
this.$refs.ruleForm.validate(result => { let data = {}
await this.$refs.ruleForm.validate(result => {
if (result) { if (result) {
if (this.$refs.tableRef.dataSource && this.$refs.tableRef.dataSource.length > 0) { const tableData = this.$refs.tableRef.getDataValidate()
const data = {} if (tableData) {
data.formInline = this.formInline data.formInline = this.formInline
data.dataSource = this.$refs.tableRef.dataSource data.dataSource = tableData.dataSource
callback(data)
} else { } else {
this.$message.warning(this.$t('addAtLeastOneRowOfData')) data = false
const data = false
callback(data)
} }
} else { } else {
const data = false data = false
callback(data)
} }
}) })
return data
} }
} }
} }
@@ -44,14 +44,12 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
] ]
}, }
data: undefined
} }
}, },
methods: { methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
this.data = data
// 给表单赋值 // 给表单赋值
this.formInline = { this.formInline = {
processDescription: data.common.processDescription processDescription: data.common.processDescription
@@ -65,17 +63,16 @@ export default {
return data return data
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) { async getDataValidate () {
this.$refs.ruleForm.validate(valid => { let data = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
const data = {}
data.formInline = this.formInline data.formInline = this.formInline
callback(data)
} else { } else {
const data = false data = false
callback(data)
} }
}) })
return data
} }
} }
} }
@@ -278,12 +278,27 @@ export default {
}, },
methods: { methods: {
initData (data) { initData (data) {
this.data = data
// 给表格赋值 // 给表格赋值
this.$nextTick(() => { this.$nextTick(() => {
this.dataSource = data.dataList this.dataSource = data.dataList
}) })
}, },
// 外层要获取数据
getData () {
return { dataSource: this.dataSource }
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
// 可能是表单,也可能是表格,表单校验一定要填,有是否下发联络人
let data = {}
if (this.dataSource && this.dataSource.length > 0) {
data.dataSource = this.dataSource
} else {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
data = false
}
return data
},
// 企标编号,企标名称跳转详情,原企标 // 企标编号,企标名称跳转详情,原企标
handleGoDetailOld (record) { handleGoDetailOld (record) {
this.$openPageNewSheet({ this.$openPageNewSheet({
@@ -330,6 +345,12 @@ export default {
}, },
// 导入 // 导入
handleImportExcel (info) { handleImportExcel (info) {
// 限制导入大于500MB
if (info.file.size > 1024 * 1024 * 500) {
this.$message.error('导入文件最大500MB')
info.fileList.pop()
return
}
// 加一个大的提示 // 加一个大的提示
if (!this.loading) { if (!this.loading) {
importModalLoading = this.$info({ importModalLoading = this.$info({
@@ -247,8 +247,11 @@ export default {
this.currentNode = 5 this.currentNode = 5
} else if (taskName === '主起草单位主管级领导批准') { } else if (taskName === '主起草单位主管级领导批准') {
this.currentNode = 6 this.currentNode = 6
} else { } else if (taskName === '标准化归档') {
this.currentNode = 7 this.currentNode = 7
} else {
// 预留加签节点
this.currentNode = 999
} }
} }
// 如果是查看进入的,不可编辑,不可操作 // 如果是查看进入的,不可编辑,不可操作
@@ -425,24 +428,23 @@ export default {
} }
this.processInfoForm.validateFields((err, values) => { this.processInfoForm.validateFields((err, values) => {
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => { this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
this.$refs.baseInfoRef.getDataValidate((data) => { const data = this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) { if (!err && !approvalErr && data) {
const param = {} // 传给后端的数据 const param = {} // 传给后端的数据
param.common = { ...values, ...approvalValues } param.common = { ...values, ...approvalValues }
param.dataList = data.dataSource param.dataList = data.dataSource
param.flowUser = personnelObj param.flowUser = personnelObj
standardizationInitApproval(param).then(res => { standardizationInitApproval(param).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
this.goBack() this.goBack()
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
} }
})
}) })
}) })
}, },
@@ -478,35 +480,37 @@ export default {
if (this.loading) return if (this.loading) return
// 流程审批信息校验 // 流程审批信息校验
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => { this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
this.$refs.baseInfoFormRef.getDataValidate(data => { const data = this.$refs.baseInfoFormRef.getDataValidate()
if (approvalErr && data) { if (!approvalErr && data) {
// 只有表格 // 只有表格
const param = {} const param = {}
param.common = approvalValues param.common = approvalValues
param.dataList = data.dataSource param.common.taskId = this.$route.query.taskId
standardizationInitAgree(param).then(res => { param.dataList = data.dataSource
if (res.success) { standardizationInitAgree(param).then(res => {
this.$message.success(res.message) if (res.success) {
this.goBack() this.$message.success(res.message)
} else { this.goBack()
this.$message.warning(res.message) } else {
} this.$message.warning(res.message)
}).finally(() => { }
this.loading = false }).finally(() => {
}) this.loading = false
} })
}) }
}) })
}, },
// 同意(节点236有同意) // 同意(节点236有同意)
handleAgree () { handleAgree () {
if (this.loading) return if (this.loading) return
this.approvalInfoForm.validateFields((err, values) => { this.approvalInfoForm.validateFields((err, values) => {
if (!err) { const data = this.$refs.baseInfoFormRef.getDataValidate()
this.loading = true if (!err && data) {
// 只有表格
const param = {} const param = {}
param.common = Object.assign({}, values) param.common = values
param.taskId = this.$route.query.taskId param.common.taskId = this.$route.query.taskId
param.dataList = data.dataSource
standardizationInitAgree(param).then(res => { standardizationInitAgree(param).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
@@ -215,9 +215,8 @@ export default {
methods: { methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
this.data = data
// 给表格赋值 // 给表格赋值
// this.dataSource = this.dataSource = data.dataList
}, },
// 外层要获取数据 // 外层要获取数据
getData () { getData () {
@@ -227,8 +226,9 @@ export default {
return data return data
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) { getDataValidate () {
// 每行的审批人是否都有 // 每行的审批人是否都有
let data = {}
let hasErr = false let hasErr = false
for (const item of this.dataSource) { for (const item of this.dataSource) {
if (!item.approvalUser) { if (!item.approvalUser) {
@@ -237,15 +237,13 @@ export default {
break break
} }
} }
let data
if (hasErr) { if (hasErr) {
this.$message.warning(this.$t('workCenter.revisionPlanActivelyReport.pleaseSelectApprover')) this.$message.warning(this.$t('workCenter.revisionPlanActivelyReport.pleaseSelectApprover'))
data = false data = false
callback(data)
} else { } else {
data = { dataSource: this.dataSource } data.dataSource = this.dataSource
callback(data)
} }
return data
}, },
// 企标编号,企标名称跳转详情,原企标 // 企标编号,企标名称跳转详情,原企标
handleGoDetailOld (record) { handleGoDetailOld (record) {
@@ -287,9 +287,8 @@ export default {
methods: { methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
this.data = data
// 给表格赋值 // 给表格赋值
// this.dataSource = this.dataSource = data.dataList
}, },
// 外层要获取数据 // 外层要获取数据
getData () { getData () {
@@ -301,10 +300,10 @@ export default {
return data return data
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) { getDataValidate () {
// 校验表格是否每行都有数据,每行的联络人是否都有 // 校验表格是否每行都有数据,每行的联络人是否都有
let data = {}
if (this.dataSource && this.dataSource.length > 0) { if (this.dataSource && this.dataSource.length > 0) {
const data = {}
data.dataSource = this.dataSource.map(item => { data.dataSource = this.dataSource.map(item => {
return { ...item, enStandardSystem: item.enStandardSystem ? item.enStandardSystem.join(',') : ''} return { ...item, enStandardSystem: item.enStandardSystem ? item.enStandardSystem.join(',') : ''}
}) })
@@ -318,16 +317,13 @@ export default {
} }
if (hasErr) { if (hasErr) {
this.$message.warning(this.$t('workCenter.revisionPlanActivelyReport.pleaseSelectContact')) this.$message.warning(this.$t('workCenter.revisionPlanActivelyReport.pleaseSelectContact'))
const data = false data = false
callback(data)
} else {
callback(data)
} }
} else { } else {
this.$message.warning(this.$t('addAtLeastOneRowOfData')) this.$message.warning(this.$t('addAtLeastOneRowOfData'))
const data = false data = false
callback(data)
} }
return data
}, },
// 企标编号,企标名称跳转详情,原企标 // 企标编号,企标名称跳转详情,原企标
handleGoDetailOld (record) { handleGoDetailOld (record) {
@@ -375,6 +371,12 @@ export default {
}, },
// 导入 // 导入
handleImportExcel (info) { handleImportExcel (info) {
// 限制导入大于500MB
if (info.file.size > 1024 * 1024 * 500) {
this.$message.error('导入文件最大500MB')
info.fileList.pop()
return
}
// 加一个大的提示 // 加一个大的提示
if (!this.loading) { if (!this.loading) {
importModalLoading = this.$info({ importModalLoading = this.$info({
@@ -211,9 +211,8 @@ export default {
methods: { methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
this.data = data
// 给表格赋值 // 给表格赋值
// this.dataSource = this.dataSource = data.dataList
}, },
// 外层要获取数据 // 外层要获取数据
getData () { getData () {
@@ -223,8 +222,9 @@ export default {
return data return data
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) { getDataValidate () {
// 每行的主起草人是否都有 // 每行的主起草人是否都有
let data = {}
let hasErr = false let hasErr = false
for (const item of this.dataSource) { for (const item of this.dataSource) {
if (!item.drafter) { if (!item.drafter) {
@@ -233,15 +233,13 @@ export default {
break break
} }
} }
let data
if (hasErr) { if (hasErr) {
this.$message.warning(this.$t('workCenter.revisionPlanActivelyReport.pleaseSelectDrafter')) this.$message.warning(this.$t('workCenter.revisionPlanActivelyReport.pleaseSelectDrafter'))
data = false data = false
callback(data)
} else { } else {
data = { dataSource: this.dataSource } data.dataSource = this.dataSource
callback(data)
} }
return data
}, },
// 企标编号,企标名称跳转详情,原企标 // 企标编号,企标名称跳转详情,原企标
handleGoDetailOld (record) { handleGoDetailOld (record) {
@@ -230,9 +230,8 @@ export default {
methods: { methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
this.data = data
// 给表格赋值 // 给表格赋值
// this.dataSource = this.dataSource = data.dataList
}, },
// 外层要获取数据 // 外层要获取数据
getData () { getData () {
@@ -242,17 +241,16 @@ export default {
return data return data
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) { getDataValidate () {
// 校验表格是否每行都有数据,每行的联络人是否都有 // 校验表格是否每行都有数据,每行的联络人是否都有
let data = {}
if (this.dataSource && this.dataSource.length > 0) { if (this.dataSource && this.dataSource.length > 0) {
const data = {}
data.dataSource = this.dataSource data.dataSource = this.dataSource
callback(data)
} else { } else {
this.$message.warning(this.$t('addAtLeastOneRowOfData')) this.$message.warning(this.$t('addAtLeastOneRowOfData'))
const data = false data = false
callback(data)
} }
return data
}, },
// 企标编号,企标名称跳转详情,原企标 // 企标编号,企标名称跳转详情,原企标
handleGoDetailOld (record) { handleGoDetailOld (record) {
@@ -187,18 +187,34 @@ export default {
} }
}, },
mounted () { mounted () {
if (this.$route.query.processId) { if (this.$route.query.taskId) {
this.currentNode = 2 // todo: 先设置一个假数据,后端还不能返回当前节点
// 有流程id说明是从流程中心来的,需要初始化数据 // 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData(this.$route.query.processId) this.getProcessData(this.$route.query.taskId)
} else {
// 没有taskId说明是新建进来的,初始化人员信息
this.personnelInfoData = personalInfo
}
// 初始化节点
const taskName = this.$route.query.taskName
if (taskName) {
if (taskName === '主起草人发起') {
this.currentNode = 1
} else if (taskName === '相关人员校对') {
this.currentNode = 2
} else if (taskName === '起草人主管级领导审批') {
this.currentNode = 3
} else if (taskName === '标准化审批') {
this.currentNode = 4
} else if (taskName === '起草人主管级上一级领导审批') {
this.currentNode = 5
} else {
// 预留加签节点
this.currentNode = 999
}
} }
if (this.currentNode === 1) { if (this.currentNode === 1) {
this.personnelInfoData = personalInfo
this.disabled = false this.disabled = false
} else { } else {
this.personnelInfoData = personalInfo.map(item => {
return { ...item, canChoose: false, fieldName: undefined }
})
this.disabled = true this.disabled = true
} }
// 如果是查看进入的,不可编辑,不可操作 // 如果是查看进入的,不可编辑,不可操作
@@ -24,8 +24,8 @@
<div class="box-title-text form-flex-item"> <div class="box-title-text form-flex-item">
<div class="title-text"> <div class="title-text">
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.standardText')"> <span class="title-text-text" :title="$t('workCenter.enStandardRevision.standardText')">
{{ $t('workCenter.enStandardRevision.standardText') }} {{ $t('workCenter.enStandardRevision.standardText') }}
</span> </span>
</div> </div>
<a-form-model-item class="item-model"> <a-form-model-item class="item-model">
<div class="online-edit-wrapper"> <div class="online-edit-wrapper">
@@ -137,9 +137,8 @@ export default {
methods: { methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
this.data = data
// 给表格赋值,在线编辑不知道要怎么赋值? // 给表格赋值,在线编辑不知道要怎么赋值?
// this.dataSource = this.dataSource = data.dataSource
// 给表单赋值 // 给表单赋值
// this.$nextTick(() => { // this.$nextTick(() => {
// this.$refs.baseInfoForm.formInline = // this.$refs.baseInfoForm.formInline =
@@ -205,7 +205,7 @@
<!-- 人员信息 --> <!-- 人员信息 -->
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0"> <div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list> <process-detail-list>
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNode + ''"></personnel-info> <personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNodeName"></personnel-info>
</process-detail-list> </process-detail-list>
</div> </div>
<!-- 操作按钮 --> <!-- 操作按钮 -->
@@ -258,7 +258,9 @@ import {
enterprisePlanApprovalReject, enterprisePlanApprovalReject,
enterprisePlanApprovalSave, enterprisePlanApprovalSave,
enterprisePlanApproval, enterprisePlanApproval,
getProcessDataById getProcessDataById,
getNodeList,
getProcessNodeList
} from '@/api/workCenter' } from '@/api/workCenter'
import ApprovalBaseInfo from './modules/ApprovalBaseInfo' import ApprovalBaseInfo from './modules/ApprovalBaseInfo'
import FinishTimeChangeBaseInfo from './modules/FinishTimeChangeBaseInfo' import FinishTimeChangeBaseInfo from './modules/FinishTimeChangeBaseInfo'
@@ -266,10 +268,11 @@ import ProcessDetailList from '@/components/ProcessDetailList'
import JobEndBaseInfo from './modules/JobEndBaseInfo' import JobEndBaseInfo from './modules/JobEndBaseInfo'
import DutyDepartChangeBaseInfo from './modules/DutyDepartChangeBaseInfo' import DutyDepartChangeBaseInfo from './modules/DutyDepartChangeBaseInfo'
import MergeBaseInfo from './modules/MergeBaseInfo' import MergeBaseInfo from './modules/MergeBaseInfo'
import { ProjectType, ApplicationCategory } from '@/enums/commonEnums' import { ProjectType, ApplicationCategory, ProcessKey } from '@/enums/commonEnums'
import Vue from 'vue' import Vue from 'vue'
import { USER_INFO } from '@/store/mutation-types' import { USER_INFO } from '@/store/mutation-types'
import pick from 'lodash.pick' import pick from 'lodash.pick'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
// 标准立项的人员信息 // 标准立项的人员信息
const approvalPersonalInfo = [ // 人员信息的数据 const approvalPersonalInfo = [ // 人员信息的数据
@@ -416,9 +419,10 @@ export default {
InternalDetailPage, InternalDetailPage,
UserSelection UserSelection
}, },
mixins: [WorkCenterMixin],
computed: { computed: {
pageTitle () { pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title return this.$t('flowCenter') + this.$route.meta.title + '' + this.currentNodeName + ''
}, },
// 流程名称是否不可填写 // 流程名称是否不可填写
processNameDisabled () { processNameDisabled () {
@@ -452,12 +456,14 @@ export default {
}, },
mounted () { mounted () {
console.log(this.$route.query.taskId) console.log(this.$route.query.taskId)
// 查询流程定义列表,通过查出的数据获取到流程定义id,如果已经发起过流程,用这个id和流程实例id去查人员信息数据
this.getPersonInfoStructure(ProcessKey.ES_INIT_CHANGE.value)
if (this.$route.query.taskId) { if (this.$route.query.taskId) {
this.currentNodeName = this.$route.query.taskName
// 有流程id说明是从流程中心来的,需要初始化数据 // 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData(this.$route.query.taskId) this.getProcessData(this.$route.query.taskId)
} else { } else {
// 没有taskId说明是新建进来的,初始化人员信息 this.currentNodeName = '主起草人发起'
this.personnelInfoData = approvalPersonalInfo
} }
// 如果是查看进入的,不可编辑,不可操作 // 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) { if (this.$route.query.onlyLook) {
@@ -474,6 +480,7 @@ export default {
disabled: false, disabled: false,
onlyLook: false, // 是否仅查看 onlyLook: false, // 是否仅查看
currentNode: 1, // 当前节点 currentNode: 1, // 当前节点
currentNodeName: '', // 当前节点名称
model: [], model: [],
processInfoForm: this.$form.createForm(this), processInfoForm: this.$form.createForm(this),
labelCol: { labelCol: {
@@ -556,6 +563,25 @@ export default {
} }
}, },
methods: { methods: {
// 查询人员信息结构数据
getPersonInfoStructure (key) {
console.log('-----------getPersonInfoStructure-------', key)
const param = {}
param.processDefinitionKey = key
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.personnelInfoData = res.result
}
})
},
// 根据流程id获取数据并回显 // 根据流程id获取数据并回显
getProcessData (taskId) { getProcessData (taskId) {
getProcessDataById(taskId).then(res => { getProcessDataById(taskId).then(res => {
@@ -592,8 +618,11 @@ export default {
this.currentNode = 7 this.currentNode = 7
} else if (taskName === '相关人员会签') { } else if (taskName === '相关人员会签') {
this.currentNode = 8 this.currentNode = 8
} else { } else if (taskName === '抄送主起草人确认') {
this.currentNode = 9 this.currentNode = 9
} else {
// 预留加签节点
this.currentNode = 999
} }
} }
console.log(this.currentNode) console.log(this.currentNode)
@@ -690,6 +719,34 @@ export default {
} }
}) })
}, },
// 获取人员信息数据
getPersonInfoData () {
const param = {}
param.processDefinitionId = this.processDefinitionId
// 有流程实例id就需要传流程实例id
if (this.$route.query.processInstanceId) {
param.processInstanceId = this.$route.query.processInstanceId
}
getNodeList(param).then(res => {
if (res.success) {
console.log(res.result)
// 处理人员信息数据
if (this.formInline.applicationCategory) {
// 有申请类型,根据申请类型返回不同的人员信息,区分【立项、普通变更、责任部门变更(责任部门变更时某些节点不可跳过)】
if (this.formInline.applicationCategory === ApplicationCategory.INITIATION.value) {
// 是立项,从result中拿出立项有的人员信息
} else if (this.formInline.applicationCategory === ApplicationCategory.CHANGE.value) {
// 是变更
if (this.formInline.projectType === ProjectType.RESPONSIBLE_DEPT_CHANGE.value) {
// 是责任部门变更,从result中拿出责任部门变更有的人员信息
} else {
// 是别的变更,从result中拿出需要的人员信息
}
}
}
}
})
},
// 头部tab改变 // 头部tab改变
switchChange (value) { switchChange (value) {
this.switchValue = value this.switchValue = value