[update] 年度制修订标准化发起流程查看详情

This commit is contained in:
lideqin
2024-07-23 18:23:30 +08:00
parent ccbf6254ea
commit 9189a60c36
5 changed files with 103 additions and 33 deletions
@@ -1,7 +1,7 @@
<template> <template>
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading"> <internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
<!-- 标题右侧tab --> <!-- 标题右侧tab -->
<template v-slot:titleRightCustom> <template v-slot:titleRightCustom v-if="!isLook">
<div class="table-operator-tab"> <div class="table-operator-tab">
<!-- 基础信息 --> <!-- 基础信息 -->
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''" <a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
@@ -23,7 +23,7 @@
<!-- 流程名称 --> <!-- 流程名称 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('processName')" :colon="formItemColon"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('processName')" :colon="formItemColon">
<a-input :placeholder="$t('pleaseEnter') + $t('processName')" <a-input :placeholder="$t('pleaseEnter') + $t('processName')"
:disabled="disabled || processInfoDisabled" :disabled="disabled || processInfoDisabled || isLook"
:maxLength="50" :maxLength="50"
v-decorator="['prcName', validatorRules.prcName]" /> v-decorator="['prcName', validatorRules.prcName]" />
</a-form-item> </a-form-item>
@@ -33,7 +33,7 @@
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')" :colon="formItemColon"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')" :colon="formItemColon">
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')" <a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%" style="width: 100%"
:disabled="disabled || processInfoDisabled" :disabled="disabled || processInfoDisabled || isLook"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
v-decorator="['dueTime']" /> v-decorator="['dueTime']" />
</a-form-item> </a-form-item>
@@ -44,7 +44,7 @@
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')" <a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500" :maxLength="500"
:rows="4" :rows="4"
:disabled="disabled || processInfoDisabled" :disabled="disabled || processInfoDisabled || isLook"
v-decorator="['prcMes']" /> v-decorator="['prcMes']" />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -54,16 +54,16 @@
<!-- 业务基本信息 --> <!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div> <div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 节点1、标准工程师发起的基本信息表单 --> <!-- 节点1、标准工程师发起的基本信息表单 -->
<engineer-init-base-info v-if="[1, 3, 10].includes(currentNode)" ref="baseInfoRef" :currentNode="currentNode"></engineer-init-base-info> <engineer-init-base-info v-if="[1, 3, 10].includes(currentNode)" ref="baseInfoRef" :disabled="isLook" :currentNode="currentNode"></engineer-init-base-info>
<!-- 节点2、部所联络人选取审批人 --> <!-- 节点2、部所联络人选取审批人 -->
<contact-select-approver-base-info v-else-if="[2, 5].includes(currentNode)" ref="baseInfoRef" :currentNode="currentNode" @batchReject="handleBatchReject"></contact-select-approver-base-info> <contact-select-approver-base-info v-else-if="[2, 5].includes(currentNode)" ref="baseInfoRef" :disabled="isLook" :currentNode="currentNode" @batchReject="handleBatchReject"></contact-select-approver-base-info>
<!-- 节点3、主起草单位主管级领导审批下发 --> <!-- 节点3、主起草单位主管级领导审批下发 -->
<leader-approve-sent-base-info v-else-if="currentNode === 4" ref="baseInfoRef"></leader-approve-sent-base-info> <leader-approve-sent-base-info v-else-if="currentNode === 4" ref="baseInfoRef" :disabled="isLook"></leader-approve-sent-base-info>
<!-- 节点4、主起草人填写信息 --> <!-- 节点4、主起草人填写信息 -->
<!-- 节点5、部所联络人汇总 --> <!-- 节点5、部所联络人汇总 -->
<!-- 节点6、主起草单位主管级领导批准 --> <!-- 节点6、主起草单位主管级领导批准 -->
<!-- 节点7、标准化归档 --> <!-- 节点7、标准化归档 -->
<table-base-info v-else ref="baseInfoRef" :current-node="currentNode"></table-base-info> <table-base-info v-else ref="baseInfoRef" :disabled="isLook" :current-node="currentNode"></table-base-info>
<!-- 流程审批信息 --> <!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div> <div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
@@ -73,11 +73,12 @@
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')" <a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500" :maxLength="500"
:rows="4" :rows="4"
:disabled="isLook"
v-decorator="['commitText', validatorRules.commitText]" /> v-decorator="['commitText', validatorRules.commitText]" />
</a-form-item> </a-form-item>
<!--附件--> <!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('attach')" :colon="formItemColon"> <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-item>
</a-form> </a-form>
</div> </div>
@@ -90,7 +91,7 @@
</div> </div>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<div class="detail-page-bottom-operate-box"> <div v-if="!isLook" class="detail-page-bottom-operate-box">
<!-- 发起节点 --> <!-- 发起节点 -->
<template v-if="[1, 3, 10].includes(currentNode)"> <template v-if="[1, 3, 10].includes(currentNode)">
<!-- 保存 --> <!-- 保存 -->
@@ -145,11 +146,13 @@ import {
standardizationInitReject, standardizationInitReject,
standardizationInitGetDataById, standardizationInitGetDataById,
standardizationInitGetDataDraft, standardizationInitGetDataDraft,
standardizationInitBatchReject standardizationInitBatchReject,
saveSnapShot,
getLookData
} from '@/api/workCenter' } from '@/api/workCenter'
import pick from 'lodash.pick' import pick from 'lodash.pick'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin' import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { ProcessKey, EsRevisionPlanStandardizationInitNodes } from '@/enums/commonEnums' import { ProcessKey, EsRevisionPlanStandardizationInitNodes, ProcessType } from '@/enums/commonEnums'
export default { export default {
name: 'RevisionPlanStandardizationInitFlow', name: 'RevisionPlanStandardizationInitFlow',
@@ -227,13 +230,22 @@ export default {
} }
} }
}) })
if (this.$route.query.taskId && !this.$route.query.draftId) { if (this.$route.query.isLook + '' === '1') {
// 有流程id说明是从流程中心来的,需要初始化数据 // 是查看
this.getProcessData('todo', { taskId: this.$route.query.taskId }) this.isLook = true
} // 人员信息全部不可选
if (this.$route.query.draftId) { this.initPersonInfoData(false)
// 有草稿id,说明是从流程中心-草稿来的,需要初始化数据 // 查询数据
this.getProcessData('draft', { draftId: this.$route.query.draftId, projectId: this.$route.query.projectId }) 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 })
}
if (this.$route.query.draftId) {
// 有草稿id,说明是从流程中心-草稿来的,需要初始化数据
this.getProcessData('draft', { draftId: this.$route.query.draftId, projectId: this.$route.query.projectId })
}
} }
if (this.$route.query.taskName) { if (this.$route.query.taskName) {
// 说明是已发起流程 // 说明是已发起流程
@@ -295,7 +307,8 @@ export default {
url: { url: {
list: '' // 人员信息右侧表的分页查询接口 list: '' // 人员信息右侧表的分页查询接口
}, },
model: {} model: {},
isLook: false
} }
}, },
methods: { methods: {
@@ -305,6 +318,9 @@ export default {
if (type === 'todo') { if (type === 'todo') {
func = standardizationInitGetDataById func = standardizationInitGetDataById
params = param.taskId params = param.taskId
} else if (type === 'look') {
func = getLookData
params = param
} else { } else {
func = standardizationInitGetDataDraft func = standardizationInitGetDataDraft
params = param params = param
@@ -407,6 +423,49 @@ export default {
} }
}) })
}, },
// 获取快照json
getParamJsonStr () {
// 流程信息表单
const processInfoForm = this.processInfoForm.getFieldsValue()
// 流程审批信息
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObj()
// 业务基本信息
const ruleForm = this.$refs.baseInfoRef.getData()
const infoJsonStr = JSON.stringify({
basicProcessInfoDTO: processInfoForm,
basicTaskInfoDTO: approvalInfoForm,
dataList: ruleForm.dataSource,
personnelObj: personnelObj
})
return infoJsonStr
},
// 保存快照
saveParamJsonStr () {
// 流程信息表单
const processInfoForm = this.processInfoForm.getFieldsValue()
// 流程审批信息
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObj()
// 业务基本信息
const ruleForm = this.$refs.baseInfoRef.getData()
const params = { ...processInfoForm, ...approvalInfoForm }
params.infoJsonStr = JSON.stringify({
basicProcessInfoDTO: processInfoForm,
basicTaskInfoDTO: approvalInfoForm,
dataList: ruleForm.dataSource,
personnelObj: personnelObj
})
params.taskId = this.$route.query.taskId
params.prcType = ProcessType.ES_ANNUAL_INIT.value
saveSnapShot(params).then(res => {
if (!res.success) {
console.log(res.message)
}
})
},
// 节点一时候的提交,发起变更 // 节点一时候的提交,发起变更
handleStart () { handleStart () {
if (this.loading) return if (this.loading) return
@@ -435,10 +494,15 @@ export default {
param.common.taskId = this.$route.query.taskId || '' param.common.taskId = this.$route.query.taskId || ''
} else { } else {
func = standardizationInitApproval func = standardizationInitApproval
// 快照JSON
param.common.infoJsonStr = this.getParamJsonStr()
} }
func(param).then(res => { func(param).then(async res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
if (this.$route.query.taskId) {
await this.saveParamJsonStr()
}
this.goBack() this.goBack()
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
@@ -491,9 +555,11 @@ export default {
param.common.taskId = this.$route.query.taskId param.common.taskId = this.$route.query.taskId
param.dataList = data.dataSource param.dataList = data.dataSource
this.loading = true this.loading = true
standardizationInitAgree(param).then(res => { standardizationInitAgree(param).then(async res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
// 保存快照
await this.saveParamJsonStr()
this.goBack() this.goBack()
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
@@ -521,9 +587,11 @@ export default {
param.common.taskId = this.$route.query.taskId param.common.taskId = this.$route.query.taskId
param.dataList = data.dataSource param.dataList = data.dataSource
this.loading = true this.loading = true
standardizationInitAgree(param).then(res => { standardizationInitAgree(param).then(async res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
// 保存快照
await this.saveParamJsonStr()
this.goBack() this.goBack()
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
@@ -549,9 +617,11 @@ export default {
param.common = Object.assign({}, values) param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId param.common.taskId = this.$route.query.taskId
console.log(param, this.$route.query.taskId) console.log(param, this.$route.query.taskId)
standardizationInitReject(param).then(res => { standardizationInitReject(param).then(async res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
// 保存快照
await this.saveParamJsonStr()
this.goBack() this.goBack()
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<!-- 操作区域 --> <!-- 操作区域 -->
<div class="table-operator"> <div v-if="!disabled" class="table-operator">
<!-- 批量驳回 --> <!-- 批量驳回 -->
<!--<a-button icon="close" type="primary" ghost @click="batchReject">--> <!--<a-button icon="close" type="primary" ghost @click="batchReject">-->
<!-- {{ $t('batchReject') }}--> <!-- {{ $t('batchReject') }}-->
@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<!-- 操作区域 --> <!-- 操作区域 -->
<div class="table-operator"> <div v-if="!disabled" class="table-operator">
<!-- 新增 --> <!-- 新增 -->
<a-button icon="plus" type="primary" @click="handleAdd"> <a-button icon="plus" type="primary" @click="handleAdd">
{{ $t('newlyAdded') }} {{ $t('newlyAdded') }}
@@ -53,9 +53,9 @@
<!-- 操作栏 --> <!-- 操作栏 -->
<div slot="action" slot-scope="{record}" class="action-span-cell"> <div slot="action" slot-scope="{record}" class="action-span-cell">
<a @click="handleEdit(record)" class="table-ope-btn">{{ $t('edit') }}</a> <a v-if="!disabled" @click="handleEdit(record)" class="table-ope-btn">{{ $t('edit') }}</a>
<a-divider type="vertical" /> <a-divider v-if="!disabled" type="vertical" />
<a @click="handleDelete(record.uid)" class="table-ope-btn">{{ $t('delete') }}</a> <a v-if="!disabled" @click="handleDelete(record.uid)" class="table-ope-btn">{{ $t('delete') }}</a>
</div> </div>
</j-table> </j-table>
@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<!-- 操作区域 --> <!-- 操作区域 -->
<div class="table-operator"> <div v-if="!disabled" class="table-operator">
<!-- 批量设置主起草人 --> <!-- 批量设置主起草人 -->
<a-button icon="setting" type="primary" ghost @click="batchSetDrafter"> <a-button icon="setting" type="primary" ghost @click="batchSetDrafter">
{{ $t('workCenter.revisionPlanActivelyReport.batchSetDrafter') }} {{ $t('workCenter.revisionPlanActivelyReport.batchSetDrafter') }}
@@ -23,9 +23,9 @@
<!-- 操作栏 --> <!-- 操作栏 -->
<div slot="action" slot-scope="{record, index}" class="action-span-cell"> <div slot="action" slot-scope="{record, index}" class="action-span-cell">
<a @click="handleEdit(record, index)" class="table-ope-btn">{{ $t('edit') }}</a> <a v-if="!disabled" @click="handleEdit(record, index)" class="table-ope-btn">{{ $t('edit') }}</a>
<a-divider v-if="currentNode === 9" type="vertical" /> <a-divider v-if="currentNode === 9 ? !disabled : false" type="vertical" />
<a v-if="currentNode === 9" @click="handleDelete(record.id, index)" class="table-ope-btn">{{ $t('delete') }}</a> <a v-if="currentNode === 9 ? !disabled : false" @click="handleDelete(record.id, index)" class="table-ope-btn">{{ $t('delete') }}</a>
</div> </div>
</j-table> </j-table>