[update] 企标计划立项、变更流程流程查看

This commit is contained in:
lideqin
2024-07-23 16:39:22 +08:00
parent 33cb5b5ece
commit ccbf6254ea
2 changed files with 181 additions and 33 deletions
@@ -1,7 +1,7 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<template v-slot:titleRightCustom v-if="!isLook">
<div class="table-operator-tab">
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
@click="switchChange('base')">{{ $t('basicInformation') }}
@@ -21,7 +21,7 @@
<!-- 流程名称 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('processName')" :colon="formItemColon">
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
:disabled="disabled || processNameDisabled"
:disabled="disabled || processNameDisabled || isLook"
:maxLength="50"
v-decorator="['prcName', validatorRules.prcName]" />
</a-form-item>
@@ -31,7 +31,7 @@
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')" :colon="formItemColon">
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled"
:disabled="disabled || isLook"
value-format="YYYY-MM-DD"
v-decorator="['dueTime']" />
</a-form-item>
@@ -42,7 +42,7 @@
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500"
:rows="4"
:disabled="disabled"
:disabled="disabled || isLook"
v-decorator="['prcMes']" />
</a-form-item>
</a-col>
@@ -70,7 +70,7 @@
<!-- :triggerChange="false"-->
<!-- dictCode="esp_application_category" />-->
<a-select v-model="formInline.applicationCategory"
:disabled="disabled || categoryTypeDisabled"
:disabled="disabled || categoryTypeDisabled || isLook"
@change="applicationCategoryChange"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.applicationType')">
<a-select-option :value="ApplicationCategory.INITIATION.value">{{ $t('workCenter.enterpriseInitChangePlan.standardProjectEstablishment') }}</a-select-option>
@@ -89,7 +89,7 @@
<a-form-model-item class="item-model" prop="projectType">
<a-select v-if="formInline.applicationCategory === ApplicationCategory.INITIATION.value"
v-model="formInline.projectType"
:disabled="disabled || categoryTypeDisabled"
:disabled="disabled || categoryTypeDisabled || isLook"
@change="projectTypeChange"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.itemCategory')">
<a-select-option :value="ProjectType.ENACT.value">{{ $t('workCenter.enterpriseInitChangePlan.formulate') }}</a-select-option>
@@ -97,7 +97,7 @@
</a-select>
<a-select v-else-if="formInline.applicationCategory === ApplicationCategory.CHANGE.value"
v-model="formInline.projectType"
:disabled="disabled || categoryTypeDisabled"
:disabled="disabled || categoryTypeDisabled || isLook"
@change="projectTypeChange"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.itemCategory')">
<a-select-option :value="ProjectType.COMPLETE_TIME_CHANGE.value">{{ $t('workCenter.enterpriseInitChangePlan.completionTimeChange') }}</a-select-option>
@@ -118,7 +118,7 @@
<approval-base-info
v-if="formInline.applicationCategory === ApplicationCategory.INITIATION.value"
ref="approvalBaseInfo"
:disabled="disabled"
:disabled="disabled || isLook"
:currentNode="currentNode"
:isInitData="isInitData"
@processNameChange="processNameChange"
@@ -128,7 +128,7 @@
<finish-time-change-base-info
v-else-if="formInline.applicationCategory === ApplicationCategory.CHANGE.value && formInline.projectType === ProjectType.COMPLETE_TIME_CHANGE.value"
ref="changeBaseInfo"
:disabled="disabled"
:disabled="disabled || isLook"
:currentNode="currentNode"
:projectType="formInline.projectType"
>
@@ -137,7 +137,7 @@
<job-end-base-info
v-else-if="formInline.applicationCategory === ApplicationCategory.CHANGE.value && formInline.projectType === ProjectType.WORK_TERMINATE.value"
ref="changeBaseInfo"
:disabled="disabled"
:disabled="disabled || isLook"
:currentNode="currentNode"
:projectType="formInline.projectType"
>
@@ -146,7 +146,8 @@
<duty-depart-change-base-info
v-else-if="formInline.applicationCategory === ApplicationCategory.CHANGE.value && formInline.projectType === ProjectType.RESPONSIBLE_DEPT_CHANGE.value"
ref="changeBaseInfo"
:disabled="disabled"
:disabled="disabled || isLook"
:isLook="isLook"
@processNameChange="processNameChange"
:currentNode="currentNode"
:projectType="formInline.projectType"
@@ -156,7 +157,7 @@
<merge-base-info
v-else-if="formInline.applicationCategory === ApplicationCategory.CHANGE.value && formInline.projectType === ProjectType.MERGE.value"
ref="changeBaseInfo"
:disabled="disabled"
:disabled="disabled || isLook"
:isInitData="isInitData"
@processNameChange="processNameChange"
:projectType="formInline.projectType"
@@ -175,6 +176,7 @@
@nameChange="userSelectNameChange"
filedName="newMainDraftUserLeader"
:nameStr="userFormModel.newMainDraftUserLeader_dictText"
:disabled="isLook"
input-type="textarea" />
</a-form-item>
</a-col>
@@ -187,6 +189,7 @@
@nameChange="userSelectNameChange"
filedName="relatedUserList"
:nameStr="userFormModel.relatedUserList_dictText"
:disabled="isLook"
input-type="textarea" />
</a-form-item>
</a-col>
@@ -201,11 +204,12 @@
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
:disabled="isLook"
v-decorator="['commitText', validatorRules.commitText]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('attach')" :colon="formItemColon">
<j-upload v-decorator="['commitFile']" return-id multiple />
<j-upload v-decorator="['commitFile']" return-id multiple :disabled="isLook" />
</a-form-item>
</a-form>
</div>
@@ -216,7 +220,7 @@
</process-detail-list>
</div>
<!-- 操作按钮 -->
<div class="detail-page-bottom-operate-box">
<div v-if="!isLook" class="detail-page-bottom-operate-box">
<!-- 发起节点 -->
<template v-if="currentNode === 1">
<!-- 保存 -->
@@ -267,7 +271,9 @@ import {
enterprisePlanApproval,
getProcessDataById,
getProcessNodeList,
getProcessDataDraft
getProcessDataDraft,
saveSnapShot,
getLookData
} from '@/api/workCenter'
import ApprovalBaseInfo from './modules/ApprovalBaseInfo'
import FinishTimeChangeBaseInfo from './modules/FinishTimeChangeBaseInfo'
@@ -275,7 +281,7 @@ import ProcessDetailList from '@/components/ProcessDetailList'
import JobEndBaseInfo from './modules/JobEndBaseInfo'
import DutyDepartChangeBaseInfo from './modules/DutyDepartChangeBaseInfo'
import MergeBaseInfo from './modules/MergeBaseInfo'
import { ProjectType, ApplicationCategory, ProcessKey, EsInitChangeNodes } from '@/enums/commonEnums'
import { ProjectType, ApplicationCategory, ProcessKey, EsInitChangeNodes, ProcessType } from '@/enums/commonEnums'
import Vue from 'vue'
import { USER_INFO } from '@/store/mutation-types'
import pick from 'lodash.pick'
@@ -379,15 +385,24 @@ export default {
this.disabled = true
}
}
if (this.$route.query.taskId && !this.$route.query.draftId) {
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData('todo', { taskId: this.$route.query.taskId })
// 待办进来的节点1说明是被驳回的,不可修改申请类型和项目类别
this.categoryTypeDisabled = true
}
if (this.$route.query.draftId) {
// 有草稿id,说明是从流程中心-草稿来的,需要初始化数据
this.getProcessData('draft', { draftId: this.$route.query.draftId, projectId: this.$route.query.projectId })
if (this.$route.query.isLook + '' === '1') {
// 是查看
this.isLook = true
// 人员信息全部不可选
this.initPersonInfoData(false)
// 查询数据
this.getProcessData('look', { snapshotId: this.$route.query.snapshotId })
} else {
if (this.$route.query.taskId && !this.$route.query.draftId) {
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData('todo', { taskId: this.$route.query.taskId })
// 待办进来的节点1说明是被驳回的,不可修改申请类型和项目类别
this.categoryTypeDisabled = true
}
if (this.$route.query.draftId) {
// 有草稿id,说明是从流程中心-草稿来的,需要初始化数据
this.getProcessData('draft', { draftId: this.$route.query.draftId, projectId: this.$route.query.projectId })
}
}
},
data () {
@@ -483,7 +498,8 @@ export default {
list: '' // 人员信息的右侧表格获取接口
},
isInitData: false, // 是否正在初始化数据,正在初始化数据的时候不获取企标编号
onlySelectFromFlowStation: [EsInitChangeNodes.standardizationApproval.value] // 只能在标准与流程所里选人的节点
onlySelectFromFlowStation: [EsInitChangeNodes.standardizationApproval.value], // 只能在标准与流程所里选人的节点
isLook: false
}
},
methods: {
@@ -566,6 +582,9 @@ export default {
if (type === 'todo') {
func = getProcessDataById
params = param.taskId
} else if (type === 'look') {
func = getLookData
params = param
} else {
func = getProcessDataDraft
params = param
@@ -872,6 +891,117 @@ export default {
}
})
},
// 需要传给后端的快照用的json
getParamJsonStr () {
// 流程信息表单
const processInfoForm = this.processInfoForm.getFieldsValue()
// 业务基本信息-申请类型和项目类别
const ruleForm = this.formInline
// 流程审批信息
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
// 部分节点的选人表单
const userInfoForm = this.userForm.getFieldsValue()
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObj()
// 业务基础信息组件中的数据
let arr = []
// 业务基本信息-立项表单
if (this.$refs.approvalBaseInfo) {
const approvalBaseInfo = Object.assign({}, this.$refs.approvalBaseInfo.formInline)
// 企标体系处理成逗号分隔
if (approvalBaseInfo.enStandardSystem && approvalBaseInfo.enStandardSystem.length > 0) {
approvalBaseInfo.enStandardSystem = approvalBaseInfo.enStandardSystem.map(item => item.value).join(',')
}
// 处理隶属工作组
if (approvalBaseInfo.workGroup) {
approvalBaseInfo.workGroup_dictText = approvalBaseInfo.workGroup.label
approvalBaseInfo.workGroup = approvalBaseInfo.workGroup.value
}
arr.push({ ...ruleForm, ...approvalBaseInfo })
} else if (this.formInline.projectType === ProjectType.COMPLETE_TIME_CHANGE.value) {
// 业务基本信息-变更-完成时间变更
arr = this.$refs.changeBaseInfo.dataSource.map(item => { return { ...item, ...ruleForm } })
} else if (this.formInline.projectType === ProjectType.WORK_TERMINATE.value) {
// 业务基本信息-变更-工作终止
arr = this.$refs.changeBaseInfo.dataSource.map(item => { return { ...item, ...ruleForm } })
} else if (this.formInline.projectType === ProjectType.RESPONSIBLE_DEPT_CHANGE.value) {
// 业务基本信息-变更-责任部门变更
const dutyDepartChangeForm = this.$refs.changeBaseInfo.formInline
arr.push({ ...ruleForm, ...dutyDepartChangeForm, ...userInfoForm })
} else if (this.formInline.projectType === ProjectType.MERGE.value) {
// 业务基本信息-变更-合并
const mergeForm = this.$refs.changeBaseInfo.formInline
arr.push({ ...ruleForm, ...mergeForm })
}
const infoJsonStr = JSON.stringify({
basicProcessInfoDTO: processInfoForm,
basicTaskInfoDTO: approvalInfoForm,
dataList: arr.map(item => {
return { ...item, ...this.userFormModel }
}),
personnelObj: personnelObj
})
return infoJsonStr
},
// 保存快照
saveParamJsonStr () {
// 流程信息表单
const processInfoForm = this.processInfoForm.getFieldsValue()
// 业务基本信息-申请类型和项目类别
const ruleForm = this.formInline
// 流程审批信息
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
// 部分节点的选人表单
const userInfoForm = this.userForm.getFieldsValue()
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObj()
// 业务基础信息组件中的数据
let arr = []
// 业务基本信息-立项表单
if (this.$refs.approvalBaseInfo) {
const approvalBaseInfo = Object.assign({}, this.$refs.approvalBaseInfo.formInline)
// 企标体系处理成逗号分隔
if (approvalBaseInfo.enStandardSystem && approvalBaseInfo.enStandardSystem.length > 0) {
approvalBaseInfo.enStandardSystem = approvalBaseInfo.enStandardSystem.map(item => item.value).join(',')
}
// 处理隶属工作组
if (approvalBaseInfo.workGroup) {
approvalBaseInfo.workGroup_dictText = approvalBaseInfo.workGroup.label
approvalBaseInfo.workGroup = approvalBaseInfo.workGroup.value
}
arr.push({ ...ruleForm, ...approvalBaseInfo })
} else if (this.formInline.projectType === ProjectType.COMPLETE_TIME_CHANGE.value) {
// 业务基本信息-变更-完成时间变更
arr = this.$refs.changeBaseInfo.dataSource.map(item => { return { ...item, ...ruleForm } })
} else if (this.formInline.projectType === ProjectType.WORK_TERMINATE.value) {
// 业务基本信息-变更-工作终止
arr = this.$refs.changeBaseInfo.dataSource.map(item => { return { ...item, ...ruleForm } })
} else if (this.formInline.projectType === ProjectType.RESPONSIBLE_DEPT_CHANGE.value) {
// 业务基本信息-变更-责任部门变更
const dutyDepartChangeForm = this.$refs.changeBaseInfo.formInline
arr.push({ ...ruleForm, ...dutyDepartChangeForm, ...userInfoForm })
} else if (this.formInline.projectType === ProjectType.MERGE.value) {
// 业务基本信息-变更-合并
const mergeForm = this.$refs.changeBaseInfo.formInline
arr.push({ ...ruleForm, ...mergeForm })
}
const params = { ...processInfoForm, ...approvalInfoForm }
params.infoJsonStr = JSON.stringify({
basicProcessInfoDTO: processInfoForm,
basicTaskInfoDTO: approvalInfoForm,
dataList: arr.map(item => {
return { ...item, ...this.userFormModel }
}),
personnelObj: personnelObj
})
params.taskId = this.$route.query.taskId
params.prcType = ProcessType.ES_INIT_CHANGE.value
saveSnapShot(params).then(res => {
if (!res.success) {
console.log(res.message)
}
})
},
// 节点一时候的提交,发起立项变更申请,有taskId就是驳回后的提交
handleStart () {
if (this.loading) return
@@ -972,10 +1102,15 @@ export default {
param.common.taskId = this.$route.query.taskId
} else {
func = enterprisePlanApproval
// 快照JSON
param.common.infoJsonStr = this.getParamJsonStr()
}
func(param).then(async res => {
if (res.success) {
this.$message.success(res.message)
if (this.$route.query.taskId) {
await this.saveParamJsonStr()
}
this.goBack()
} else {
this.$message.warning(res.message)
@@ -1014,9 +1149,11 @@ export default {
param.common = Object.assign({}, approvalValues)
param.common.taskId = this.$route.query.taskId
param.flowUser = Object.assign({}, values)
enterprisePlanApprovalAgree(param).then(res => {
enterprisePlanApprovalAgree(param).then(async res => {
if (res.success) {
this.$message.success(res.message)
// 保存快照
await this.saveParamJsonStr()
this.goBack()
} else {
this.$message.warning(res.message)
@@ -1109,9 +1246,11 @@ export default {
return
}
this.loading = true
enterprisePlanApprovalAgree(param).then(res => {
enterprisePlanApprovalAgree(param).then(async res => {
if (res.success) {
this.$message.success(res.message)
// 保存快照
await this.saveParamJsonStr()
this.goBack()
} else {
this.$message.warning(res.message)
@@ -1135,9 +1274,11 @@ export default {
const param = {}
param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
enterprisePlanApprovalReject(param).then(res => {
enterprisePlanApprovalReject(param).then(async res => {
if (res.success) {
this.$message.success(res.message)
// 保存快照
await this.saveParamJsonStr()
this.goBack()
} else {
this.$message.warning(res.message)
@@ -1159,9 +1300,11 @@ export default {
const param = {}
param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
enterprisePlanApprovalAgree(param).then(res => {
enterprisePlanApprovalAgree(param).then(async res => {
if (res.success) {
this.$message.success(res.message)
// 保存快照
await this.saveParamJsonStr()
this.goBack()
} else {
this.$message.warning(res.message)
@@ -94,7 +94,7 @@
<a-form-model-item class="item-model" prop="newMainDraftingUser">
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.newPrincipalDrafter')"
v-model="formInline.newMainDraftingUser"
:disabled="disabled && !newMainDrafterCanUpdate && !onlyNewMainDrafterCanUpdate"
:disabled="(disabled && !newMainDrafterCanUpdate && !onlyNewMainDrafterCanUpdate) || isLook"
filedName="newMainDraftingUser"
@nameChange="userSelectNameChange"
:nameStr="formInline.newMainDraftingUser_dictText"
@@ -111,7 +111,7 @@
</div>
<a-form-model-item class="item-model" prop="newMainDraftingUnit">
<j-select-depart v-model="formInline.newMainDraftingUnit"
:disabled="disabled && !newMainDrafterCanUpdate"
:disabled="(disabled && !newMainDrafterCanUpdate) || isLook"
:isSomeDisabled="true"
:backDepart="true" />
</a-form-model-item>
@@ -127,7 +127,7 @@
<a-form-model-item class="item-model" prop="newMainDraftingUnitResponsiblePerson">
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.newHeadOfMainDraftingUnit')"
v-model="formInline.newMainDraftingUnitResponsiblePerson"
:disabled="disabled && !newMainDrafterCanUpdate"
:disabled="(disabled && !newMainDrafterCanUpdate) || isLook"
filedName="newMainDraftingUnitResponsiblePerson"
@nameChange="userSelectNameChange"
:nameStr="formInline.newMainDraftingUnitResponsiblePerson_dictText"
@@ -175,6 +175,11 @@ export default {
type: Number,
required: false,
default: 1
},
isLook: { // 是否是查看
type: Boolean,
required: false,
default: false
}
},
mounted () {