[update] 修改企标制修订流程

This commit is contained in:
lideqin
2023-11-15 11:54:14 +08:00
parent 549a2335f5
commit 5b4c806a40
23 changed files with 637 additions and 486 deletions
@@ -57,36 +57,36 @@
<!-- 节点1、主起草人起草分发 -->
<main-drafter-sent-base-info v-if="currentNode === 1" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></main-drafter-sent-base-info>
<!-- 节点2、其他起草人上传企标 -->
<other-drafter-upload-standard-base-info v-if="currentNode === 2" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></other-drafter-upload-standard-base-info>
<other-drafter-upload-standard-base-info v-if="currentNode === 2" :disabled="disabled" ref="baseInfoRef"></other-drafter-upload-standard-base-info>
<!-- 节点3、主起草人汇总上传会议纪要 -->
<main-drafter-collect-upload-minute-base-info v-if="currentNode === 3" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></main-drafter-collect-upload-minute-base-info>
<main-drafter-collect-upload-minute-base-info v-if="currentNode === 3" :disabled="disabled" ref="baseInfoRef"></main-drafter-collect-upload-minute-base-info>
<!-- 节点4、标准化审核 -->
<standardization-audit-base-info v-if="currentNode === 4" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef" @standardizationAuditIsMeeting="standardizationAuditIsMeeting"></standardization-audit-base-info>
<standardization-audit-base-info v-if="currentNode === 4" :disabled="disabled" ref="baseInfoRef" @standardizationAuditIsMeeting="standardizationAuditIsMeeting"></standardization-audit-base-info>
<!-- 节点5、评分人打分 -->
<scorer-mark-base-info v-if="currentNode === 5" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></scorer-mark-base-info>
<scorer-mark-base-info v-if="currentNode === 5" :disabled="disabled" ref="baseInfoRef"></scorer-mark-base-info>
<!-- 节点6、标准化确认是否开启征求意见 -->
<confirm-whether-comment-base-info v-if="currentNode === 6" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></confirm-whether-comment-base-info>
<confirm-whether-comment-base-info v-if="currentNode === 6" :disabled="disabled" ref="baseInfoRef"></confirm-whether-comment-base-info>
<!-- 节点7、部所联络人下发 -->
<depart-liaison-issue-base-info v-if="currentNode === 7" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></depart-liaison-issue-base-info>
<depart-liaison-issue-base-info v-if="currentNode === 7" :disabled="disabled" ref="baseInfoRef"></depart-liaison-issue-base-info>
<!-- 节点8、征求意见对象填写意见 -->
<comment-object-enter-base-info v-if="currentNode === 8" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></comment-object-enter-base-info>
<comment-object-enter-base-info v-if="currentNode === 8" :disabled="disabled" ref="baseInfoRef"></comment-object-enter-base-info>
<!-- 节点9、部所联络人汇总数据 -->
<depart-liaison-collect-base-info v-if="currentNode === 9" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></depart-liaison-collect-base-info>
<depart-liaison-collect-base-info v-if="currentNode === 9" :disabled="disabled" ref="baseInfoRef"></depart-liaison-collect-base-info>
<!-- 节点10、部所联络人主管级领导审批 -->
<depart-liaison-leader-approve-base-info v-if="currentNode === 10" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></depart-liaison-leader-approve-base-info>
<depart-liaison-leader-approve-base-info v-if="currentNode === 10" :disabled="disabled" ref="baseInfoRef"></depart-liaison-leader-approve-base-info>
<!-- 节点11、主起草人汇总 -->
<main-drafter-collect-base-info v-if="currentNode === 11" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></main-drafter-collect-base-info>
<main-drafter-collect-base-info v-if="currentNode === 11" :disabled="disabled" ref="baseInfoRef"></main-drafter-collect-base-info>
<!-- 节点12、主起草人上传会议纪要 -->
<main-drafter-upload-minute-base-info v-if="currentNode === 12" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></main-drafter-upload-minute-base-info>
<main-drafter-upload-minute-base-info v-if="currentNode === 12" :disabled="disabled" ref="baseInfoRef"></main-drafter-upload-minute-base-info>
<!-- 节点13、其他起草人校对 -->
<!-- 节点14、主管级领导审批 -->
<!-- 节点15、标准化审批 -->
<!-- 节点16、相关部门领导会签 -->
<!-- 节点17、总工程师审批 -->
<!-- 只有标准文本 -->
<other-drafter-proofread-base-info v-if="[13, 14, 15, 16, 17].includes(currentNode)" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></other-drafter-proofread-base-info>
<other-drafter-proofread-base-info v-if="[13, 14, 15, 16, 17].includes(currentNode)" :disabled="disabled" ref="baseInfoRef"></other-drafter-proofread-base-info>
<!-- 节点18、主起草人发布 -->
<main-drafter-publish-base-info v-if="currentNode === 18" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></main-drafter-publish-base-info>
<main-drafter-publish-base-info v-if="currentNode === 18" :disabled="disabled" ref="baseInfoRef"></main-drafter-publish-base-info>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
@@ -171,121 +171,15 @@ import MainDrafterCollectUploadMinuteBaseInfo from './modules/MainDrafterCollect
import MainDrafterUploadMinuteBaseInfo from './modules/MainDrafterUploadMinuteBaseInfo'
import OtherDrafterProofreadBaseInfo from './modules/OtherDrafterProofreadBaseInfo'
import MainDrafterPublishBaseInfo from './modules/MainDrafterPublishBaseInfo'
const personData = [
{
id: 1,
nodeName: '主起草人起草分发',
nodeRoleName: '主起草人',
canChoose: false
},
{
id: 2,
nodeName: '其他起草人上传企标',
nodeRoleName: '其他起草人',
canChoose: false
},
{
id: 3,
nodeName: '主起草人汇总上传会议纪要',
nodeRoleName: '主起草人',
canChoose: false
},
{
id: 4,
nodeName: '标准化审批',
nodeRoleName: '标准化',
canChoose: true,
chooseType: 'radio',
fieldName: ''
},
{
id: 5,
nodeName: '评分人打分',
nodeRoleName: '评分人',
canChoose: false
},
{
id: 6,
nodeName: '标准化确认是否开启征求意见',
nodeRoleName: '标准化',
canChoose: false
},
{
id: 7,
nodeName: '部所联络人下发',
nodeRoleName: '部所联络人',
canChoose: false
},
{
id: 8,
nodeName: '征求意见对象填写意见',
nodeRoleName: '征求意见对象',
canChoose: true,
chooseType: 'checkbox',
fieldName: ''
},
{
id: 9,
nodeName: '部所联络人汇总数据',
nodeRoleName: '部所联络人',
canChoose: false
},
{
id: 10,
nodeName: '部所联络人主管级领导审批',
nodeRoleName: '部所联络人主管级领导',
canChoose: false
},
{
id: 11,
nodeName: '主起草人汇总',
nodeRoleName: '主起草人',
canChoose: false
},
{
id: 12,
nodeName: '主起草人上传会议纪要',
nodeRoleName: '主起草人',
canChoose: false
},
{
id: 13,
nodeName: '其他起草人校对',
nodeRoleName: '其他起草人',
canChoose: false
},
{
id: 14,
nodeName: '主管级领导审批',
nodeRoleName: '主管级领导',
canChoose: false
},
{
id: 15,
nodeName: '标准化审批',
nodeRoleName: '标准化审批人',
canChoose: false
},
{
id: 16,
nodeName: '相关部门领导会签',
nodeRoleName: '相关部门领导',
canChoose: false
},
{
id: 17,
nodeName: '总工程师审批',
nodeRoleName: '总工程师',
canChoose: false
},
{
id: 18,
nodeName: '主起草人发布',
nodeRoleName: '主起草人',
canChoose: false
}
]
import { ProcessKey } from '../../../enums/commonEnums'
import {
enStandardEditAgree,
enStandardEditApproval,
enStandardEditGetDataById,
enStandardEditReject,
enStandardEditSave,
enStandardEditTurnTo
} from '@/api/workCenter'
export default {
name: 'EnterpriseStandardRevisionFlow',
@@ -311,16 +205,70 @@ export default {
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
return this.$t('flowCenter') + this.$route.meta.title + '(' + this.currentNodeName + ')'
}
},
mounted () {
if (this.currentNode === 1) {
this.personnelInfoData = personData
// 初始化节点
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 if (taskName === '标准化确认是否开启征求意见') {
this.currentNode = 6
} else if (taskName === '部所联络人下发') {
this.currentNode = 7
} else if (taskName === '征求意见对象填写意见') {
this.currentNode = 8
} else if (taskName === '部所联络人汇总数据') {
this.currentNode = 9
} else if (taskName === '部门联络人主管级领导审批') {
this.currentNode = 10
} else if (taskName === '主起草人汇总') {
this.currentNode = 11
} else if (taskName === '主起草人上传会议纪要') {
this.currentNode = 12
} else if (taskName === '其他起草人校对') {
this.currentNode = 13
} else if (taskName === '主管级领导审批') {
this.currentNode = 14
} else if (taskName === '标准化审批') {
this.currentNode = 15
} else if (taskName === '相关部门领导会签') {
this.currentNode = 16
} else if (taskName === '总工程师审批') {
this.currentNode = 17
} else if (taskName === '主起草人发布') {
this.currentNode = 18
} else {
// 预留加签节点
this.currentNode = 999
}
}
// 获取人员信息结构
this.getPersonInfoStructure(ProcessKey.ES_EDIT.value, () => {
if (this.$route.query.processInstanceId) {
if (this.currentNode === 1) {
this.initPersonInfoData(true)
} else {
this.initPersonInfoData(false)
}
}
})
if (this.$route.query.taskId) {
this.currentNodeName = this.$route.query.taskName
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData(this.$route.query.taskId)
} else {
this.personnelInfoData = personData.map(item => {
return { ...item, canChoose: false, fieldName: undefined }
})
this.currentNodeName = '主起草人起草分发'
}
// 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) {
@@ -373,7 +321,9 @@ export default {
validateTrigger: 'blur'
}
},
currentNode: 18,
model: {},
currentNode: 1,
currentNodeName: '', // 当前节点名称
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: [], // 人员信息数据
url: {
@@ -385,10 +335,27 @@ export default {
}
},
methods: {
// 根据流程id获取数据并回显
getProcessData (taskId) {
enStandardEditGetDataById(taskId).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'))
})
// 初始化业务基本信息中组件内容
} else {
this.$message.warning(res.message)
}
})
},
switchChange (value) {
this.switchValue = value
},
// 标准化审核节点是否可进行评审会修改
// 标准化审核节点是否可进行评审会修改,需要修改备注的是否必填和同意、驳回按钮是否可用
standardizationAuditIsMeeting (value) {
// 选是的话,驳回按钮置灰,不可点击;选否,备注变成必填,内容自动带入“驳回”,下方同意按钮置灰,不可点击
if (value === 1) {
@@ -416,17 +383,29 @@ export default {
// 流程审批信息
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
// 人员信息的数据, 处理成对象
const personnelInfo = this.$refs.personnelInfo.stepsData
const personnelObj = {}
for (const item of personnelInfo) {
if (item.fieldName) {
personnelObj[item.fieldName] = item.user
}
}
const personnelObj = this.$refs.personnelInfo.getDataObj()
// 需要传给后端的
const paramObj = {}
paramObj.common = { ...processInfoForm, ...approvalInfoForm }
paramObj.flowUser = personnelObj
// 业务基本信息
if (this.$refs.basicInfoFormRef) {
if (this.$refs.baseInfoRef) {
// 业务基本信息
const baseInfo = this.$refs.baseInfoRef.getData()
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...baseInfo.formInline }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag || (baseInfo.dataSource && baseInfo.dataSource.length <= 0)) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
if (baseInfo.dataSource) {
paramObj.dataList = baseInfo.dataSource.map(item => {
return { ...item, ...baseInfo.formInline }
})
} else {
paramObj.dataList = [baseInfo.formInline]
}
} else {
// 需要外层信息至少填了一项
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj }
@@ -437,34 +416,52 @@ export default {
return
}
}
this.loading = true
// 保存到草稿
// enterprisePlanApprovalSave(arr).then(res => {
// if (res.success) {
// this.$message.success(res.message)
// } else {
// this.$message.warning(res.message)
// }
// })
enStandardEditSave(paramObj).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 节点一时候的提交,发起变更
handleStart () {
if (this.loading) return
// 人员信息的数据, 处理成对象
const personnelInfo = this.$refs.personnelInfo.stepsData
const personnelObj = {}
for (const item of personnelInfo) {
if (item.fieldName) {
personnelObj[item.fieldName] = item.user
}
}
// 校验是否填了所有能填的人员信息
if (!Object.values(personnelObj).every(v => !!v)) {
this.$message.warning(this.$t('pleaseEnterPersonnelInfo'))
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
return
}
this.processInfoForm.validateFields((err, values) => {
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
const param = {} // 需要传给后端的数据
param.common = { ...values, ...approvalValues }
param.flowUser = personnelObj
if (data.dataSource && data.dataSource.length > 0) {
param.dataList = data.dataSource.map(item => {
return { ...item, ...data.formInline }
})
} else {
param.dataList = [data.formInline]
}
enStandardEditApproval(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
})
},
@@ -482,29 +479,97 @@ export default {
const param = Object.assign({}, values)
param.userId = userIds
param.taskId = this.$route.query.taskId
// enterprisePlanApprovalTurnTo(param).then(res => {
// if (res.success) {
// this.$message.success(res.message)
// } else {
// this.$message.warning(res.message)
// }
// }).finally(() => {
// this.loading = false
// })
enStandardEditTurnTo(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
},
// 提交
handleSubmit () {
if (this.loading) return
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!approvalErr && data) {
const param = {} // 需要传给后端的数据
param.common = approvalValues
if (data.dataSource && data.dataSource.length > 0) {
param.dataList = data.dataSource.map(item => {
return { ...item, ...data.formInline }
})
} else {
param.dataList = [data.formInline]
}
enStandardEditAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
},
// 同意
handleAgree () {
if (this.loading) return
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = {}
param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
enStandardEditAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
},
// 驳回
handleReject () {
if (this.loading) return
this.validatorRules.commitText.rules[0].required = true
if (!this.approvalInfoForm.getFieldValue('commitText')) {
this.$message.warning(this.$t('pleaseEnterRemarks'))
}
this.$nextTick(() => {
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = {}
param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
enStandardEditReject(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
this.validatorRules.commitText.rules[0].required = false
})
}
})
})
}
}
}