Files
laws-sinotruk-client/src/views/workCenter/standardConsultationProcess/StandardConsultationProcess.vue
T
2023-11-28 18:49:46 +08:00

1200 lines
45 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<internal-detail-page :content-padding="0" :title="pageTitle" :loading="loading">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<div class="table-operator-tab">
<!--基础信息-->
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
@click="switchChange('base')">{{ $t('workCenter.basicInformation') }}
</a>
<!--人员信息-->
<a class="switch-item" :class="switchValue === 'user' ? 'table-operator-tab-active' : ''"
@click="switchChange('user')">{{ $t('workCenter.personalInformation') }}
</a>
</div>
</template>
<!--基本信息-->
<div class="detail-page-scroll-content" v-show="switchValue === 'base'">
<!--流程信息-->
<div class="process-part-title">{{ $t('processInformation') }}</div>
<a-form :form="processInfoForm">
<a-row>
<a-col :span="12">
<!--流程名称-->
<a-form-item :labelCol="twoLabelCol" :wrapperCol="twoWrapperCol" :label="$t('processName')">
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
@change="event => event.target.value = event.target.value.trim()"
:maxLength="50"
disabled
v-decorator="['processName']" />
</a-form-item>
</a-col>
<a-col :span="12">
<!--截止日期-->
<a-form-item :labelCol="twoLabelCol" :wrapperCol="twoWrapperCol" :label="$t('expirationDate')">
<a-date-picker class="box-input"
:placeholder="$t('pleaseSelect') + $t('expirationDate')"
:getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
v-decorator="['processDueDate']"
:disabled="processInfoDisabled"
style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
<!--流程说明-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('processExplain')">
<a-input :placeholder="$t('pleaseEnter') + $t('processExplain')"
@change="event => event.target.value = event.target.value.trim()"
:maxLength="500"
type="textarea"
:disabled="processInfoDisabled"
v-decorator="['processDescription']" />
</a-form-item>
</a-form>
<!--业务基本信息-->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<a-form :form="basicServiceInfoForm">
<div class="form-flex-box">
<div class="form-flex-item custom-flex-form-item">
<!--标准编号-->
<a-form-item :label="$t('standardNumber')">
<standard-selection v-decorator="['standardNumber', validatorRules.standardNumber]"
:disabled="basicServiceInfoDisabled"
:placeholder="$t('pleaseSelect') + $t('standardNumber')"
:filters="{releaseSplitFlag: '1'}"
:can-selected-source="[StandardSource.DOMESTIC.value]"
type="radio"
@nameChange="handleStandardChange" />
</a-form-item>
</div>
<div class="form-flex-item custom-flex-form-item">
<!--标准名称-->
<a-form-item :label="$t('standardName')">
<a-input :placeholder="$t('pleaseEnter') + $t('standardName')"
@change="event => event.target.value = event.target.value.trim()"
:maxLength="50"
disabled
v-decorator="['standardName', validatorRules.standardName]" />
</a-form-item>
</div>
<div class="form-flex-item custom-flex-form-item">
<!--标准文本-->
<a-form-item :label="$t('workCenter.standardConsultationProcess.standardText')"
:class="{'add-required': basicServiceInfoDisabled}">
<div class="box-title-text" v-if="!basicServiceInfoDisabled">
<a-input class="box-input disabled-white-input"
v-decorator="['standardTextFileName', validatorRules.standardText]"
readonly
disabled
:title="basicServiceInfo.standardTextFileName"
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.standardText')" />
<a-button type="primary" class="button-box" @click="chooseStandardText">
{{ this.$t('workCenter.standardConsultationProcess.selectText') }}
</a-button>
</div>
<file-echo :file-ids="basicServiceInfo.standardTextFileId" v-else />
</a-form-item>
</div>
<div class="form-flex-item custom-flex-form-item">
<!--相关文件-->
<a-form-item :label="$t('workCenter.standardConsultationProcess.relevantDocument')">
<j-upload return-id v-decorator="['relatedFile', validatorRules.relatedFile]" :disabled="basicServiceInfoDisabled" />
</a-form-item>
</div>
<div class="form-flex-item custom-flex-form-item">
<!--征求意见结束日期-->
<a-form-item :label="$t('workCenter.standardConsultationProcess.endDate')">
<j-date show-type="day"
v-decorator="['consultationDueDate', validatorRules.consultationDueDate]"
:disabled="basicServiceInfoDisabled" />
</a-form-item>
</div>
</div>
</a-form>
<!--业务分派信息-->
<template v-if="showDispatchInformation">
<div class="process-part-title">{{ $t('workCenter.dispatchInformation') }}</div>
<a-form :form="dispatchInfoForm">
<div class="form-flex-box">
<div class="form-flex-item custom-flex-form-item" v-if="currentNode.indexOf(ConsultationProcess.distribute.value) === 0">
<!--下发人员类型-->
<a-form-item :label="$t('workCenter.standardConsultationProcess.senderType')">
<j-dict-select-tag v-decorator="['userType', validatorRules.userType]"
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.senderType')"
type="select"
dict-code="sender_type"
:triggerChange="false"
@change="handleSenderTypeChange" />
</a-form-item>
</div>
<div class="form-flex-item custom-flex-form-item" v-if="senderType === SenderType.moduleOwner.value">
<!--模块负责人-->
<a-form-item :label="$t('workCenter.standardConsultationProcess.moduleOwner')">
<user-selection v-decorator="['moduleOwnerId', validatorRules.moduleOwnerId]"
:name-str="dispatchInfo.moduleOwnerId_dictText"
type="checkbox"
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.moduleOwner')" />
</a-form-item>
</div>
<!--下发人员类型选了模块负责人或者模块负责人分发节点都显示这个选项-->
<div class="form-flex-item custom-flex-form-item"
v-if="senderType === SenderType.designEngineer.value || currentNode.indexOf(ConsultationProcess.moduleOwnerDistribution.value)===0">
<!--设计工程师-->
<a-form-item :label="$t('workCenter.standardConsultationProcess.designEngineer')">
<user-selection v-decorator="['designEngineerId', validatorRules.designEngineerId]"
:name-str="dispatchInfo.designEngineerId_dictText"
type="checkbox"
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.designEngineer')" />
</a-form-item>
</div>
</div>
</a-form>
</template>
<!--征求意见列表-->
<template v-if="showConsultationList">
<div class="process-part-title">{{ $t('workCenter.standardConsultationProcess.solicitationList') }}</div>
<!--设计工程师填写征求意见表格-->
<template v-if="currentNode.indexOf(ConsultationProcess.designEngineerFillIn.value) === 0">
<div class="table-operator">
<!-- 新增-->
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
<!-- 批量删除-->
<a-button type="primary" icon="delete" ghost @click="batchDel">{{ $t('delete') }}</a-button>
</div>
<div>
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
:rowKey="(record, index) => {return index}"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:loading="loading">
<!-- 操作栏 -->
<div slot="action" slot-scope="{record, index}" class="action-span-cell">
<a @click="handleEdit(record, index)" class="table-ope-btn">{{ $t('edit') }}</a>
</div>
</j-table>
</div>
</template>
<!--模块负责人汇总填写意见-->
<template v-if="showAuditTable">
<div class="table-operator">
<!--批量操作汇总节点才有的按钮-->
<a-button type="primary" icon="delete" ghost @click="batchOperate" v-if="isSummaryNode">
{{ $t('batchOperation') }}
</a-button>
</div>
<j-expand-table ref="expandTable"
:columns="columns"
:data-source="dataSource"
bordered
form-is-depend="isAdopt"
:pagination="false"
:extra-form="collectExtraForm"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
<!--意见汇总节点才用插槽用表头控制了-->
<template v-slot:opinion="{text, record, index}">
<j-dict-select-tag :value="record.isAdopt"
:triggerChange="false"
class="opinion-select"
dict-code="consultation_opinion"
:placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.opinion')"
@change="value => {handleOpinionChange(value, index)}" />
</template>
</j-expand-table>
</template>
</template>
<!--流程审批信息-->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
<a-form :form="approvalInfoForm">
<!--备注-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')">
<a-input :placeholder="$t('pleaseEnter') + $t('remarks')"
@change="event => event.target.value = event.target.value.trim()"
:maxLength="500"
type="textarea"
v-decorator="['handleText', validatorRules.handleText]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
<j-upload v-decorator="['handleFile']" return-id />
</a-form-item>
</a-form>
</div>
<!--人员信息-->
<div class="detail-page-scroll-content p-0" v-show="switchValue === 'user'">
<process-detail-list :process-key="processKey">
<template #personnelInfo>
<personnel-info ref="personnelInfo" :data="personnelInfoData" />
</template>
</process-detail-list>
</div>
<div class="detail-page-bottom-operate-box">
<!--转办 审批节点存在-->
<a-button type="primary" :loading="loading" ghost icon="arrow-up" v-if="btnList.includes('return')" @click="handleTurnTo">
{{ $t('turnTo') }}
</a-button>
<!--保存 发起节点审批节点都存在-->
<a-button type="primary" :loading="loading" ghost v-if="btnList.includes('save')" @click="handleSave">
<i class="iconfont icon-save" />{{ $t('preservation') }}
</a-button>
<!--提交 发起节点存在-->
<a-button type="primary" :loading="loading" @click="handleSubmit" v-if="btnList.includes('submit')" icon="upload">
{{ $t('submit') }}
</a-button>
<!--同意 审批节点存在-->
<a-button type="primary" :loading="loading" icon="check-circle" v-if="btnList.includes('agree')" @click="handleAgree">
{{ $t('agree') }}
</a-button>
<!--驳回 审批节点存在-->
<a-button type="primary" :loading="loading" icon="close-circle" v-if="btnList.includes('reject')" @click="handleReject">
{{ $t('reject') }}
</a-button>
</div>
<!--新增编辑征求意见列表弹框-->
<consultation-modal ref="consultationModal" @ok="handleAddData" />
<!--选择标准文本-->
<select-standard-file-modal ref="selectStandardFileModal" @okItem="handleSelectedFile" />
<!--批量填写意见-->
<batch-write-opinion-modal ref="opinionModal" @ok="handleWriteOpinion" />
<!--转办选人-->
<user-select-modal ref="userSelectModal" check-required @change="continueTurnTo" />
</internal-detail-page>
</template>
<script>
import InternalDetailPage from '../../../components/InternalDetailPage.vue'
import StandardSelection from '../../../components/selection/StandardSelection.vue'
import { ConsultationProcess, SenderType, ProcessKey, StandardSource } from '../../../enums/commonEnums'
import UserSelection from '../../../components/selection/UserSelection'
import JTable from '../../../components/jero/JTable'
import ConsultationModal from './modules/ConsultationModal'
import ProcessDetailList from '../../../components/ProcessDetailList'
import PersonnelInfo from '../../../components/PersonnelInfo'
import { WorkCenterMixin } from '../../../mixins/WorkCenterMixin'
import JExpandTable from '../../../components/JExpandTable'
import SelectStandardFileModal from './modules/SelectStandardFileModal'
import FileEcho from '../../../components/FileEcho'
import BatchWriteOpinionModal from './modules/BatchWriteOpinionModal'
import {
saveConsultationProcess,
queryConsultationProcessDetail,
initiateConsultationProcess,
submitConsultationProcess,
transferConsultationProcess,
agreeConsultationProcess,
rejectConsultationProcess
} from '../../../api/workCenter'
import UserSelectModal from '../../../components/selection/UserSelectModal'
import { getFileInfo } from '../../../api/api'
export default {
name: 'StandardConsultationProcess',
components: {
UserSelectModal,
FileEcho,
PersonnelInfo,
ProcessDetailList,
JTable,
UserSelection,
InternalDetailPage,
StandardSelection,
ConsultationModal,
JExpandTable,
SelectStandardFileModal,
BatchWriteOpinionModal
},
mixins: [WorkCenterMixin],
data () {
return {
SenderType,
ConsultationProcess,
StandardSource,
switchValue: 'base',
twoLabelCol: {
xs: { span: 24 },
sm: { span: 4 }
},
twoWrapperCol: {
xs: { span: 24 },
sm: { span: 20 }
},
longLabelCol: {
xs: { span: 24 },
sm: { span: 2 }
},
longWrapperCol: {
xs: { span: 24 },
sm: { span: 22 }
},
// 流程信息
processInfo: {},
processInfoForm: this.$form.createForm(this),
// 业务基本信息
basicServiceInfo: {},
basicServiceInfoForm: this.$form.createForm(this),
// 流程审批信息
approvalInfo: {},
approvalInfoForm: this.$form.createForm(this),
// 业务分派信息
dispatchInfo: {},
dispatchInfoDisabled: false,
dispatchInfoForm: this.$form.createForm(this),
validatorRules: {
// 标准编号
standardNumber: {
rules: [{ required: true, message: this.$t('pleaseSelect') + this.$t('standardSelect.standardNumber') }],
validateTrigger: 'change'
},
// 标准名称
standardName: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardName') }],
validateTrigger: 'blur'
},
// 标准文本
standardText: {
rules: [{
required: true,
message: this.$t('pleaseSelect') + this.$t('workCenter.standardConsultationProcess.standardText')
}],
validateTrigger: 'change'
},
// 相关文件
relatedFile: {
rules: [{
required: false,
message: this.$t('uploadFile.pleaseUpload') + this.$t('workCenter.standardConsultationProcess.relevantDocument')
}],
validateTrigger: 'change'
},
// 征求意见结束日期
consultationDueDate: {
rules: [{
required: true,
message: this.$t('pleaseSelect') + this.$t('workCenter.standardConsultationProcess.endDate')
}],
validateTrigger: 'change'
},
// 下发人员类型
userType: {
rules: [{
required: true,
message: this.$t('pleaseSelect') + this.$t('workCenter.standardConsultationProcess.senderType')
}],
validateTrigger: 'change'
},
// 模块负责人
moduleOwnerId: {
rules: [{
required: true,
message: this.$t('pleaseSelect') + this.$t('workCenter.standardConsultationProcess.senderType')
}],
validateTrigger: 'change'
},
// 设计工程师
designEngineerId: {
rules: [{
required: true,
message: this.$t('pleaseSelect') + this.$t('workCenter.standardConsultationProcess.designEngineer')
}],
validateTrigger: 'change'
},
// 备注
handleText: {
rules: [{ required: false, message: this.$t('pleaseEnter') + this.$t('remarks') }],
validateTrigger: 'blur'
}
},
btnList: [], // 显示的按钮
loading: false,
currentNode: '', // 当前节点
nodeEnumsKey: null, // 当前节点对应枚举的key
senderType: null,
// 设计工程师填写表头
designEngineerFillInColumns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 80,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 章节编号
title: this.$t('workCenter.esInspectionProcess.sectionNumber'),
width: 180,
align: 'center',
dataIndex: 'chapterNumber',
scopedSlots: { customRender: 'text' }
},
{ // 章节名称
title: this.$t('workCenter.standardConsultationProcess.chapterName'),
width: 180,
align: 'center',
dataIndex: 'chapterName',
scopedSlots: { customRender: 'text' }
},
{ // 修改意见内容
title: this.$t('workCenter.enStandardChange.revisedOpinionContent'),
children: [
{ // 修改前
title: this.$t('workCenter.enStandardChange.beforeUpdate'),
align: 'center',
width: 180,
dataIndex: 'modificationBefore',
scopedSlots: { customRender: 'text' }
},
{ // 修改后
title: this.$t('workCenter.enStandardChange.afterUpdate'),
align: 'center',
width: 180,
dataIndex: 'modificationAfter',
scopedSlots: { customRender: 'text' }
},
{ // 修改理由
title: this.$t('workCenter.enStandardChange.updateReason'),
align: 'center',
width: 180,
dataIndex: 'modificationReason',
scopedSlots: { customRender: 'text' }
}
]
},
{
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
align: 'center',
width: 200
}
],
// 汇总表头
collectColumns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 80,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 章节编号
title: this.$t('workCenter.esInspectionProcess.sectionNumber'),
width: 180,
align: 'center',
dataIndex: 'chapterNumber',
scopedSlots: { customRender: 'text' }
},
{ // 章节名称
title: this.$t('workCenter.standardConsultationProcess.chapterName'),
width: 180,
align: 'center',
dataIndex: 'chapterName',
scopedSlots: { customRender: 'text' }
},
{ // 修改意见内容
title: this.$t('workCenter.enStandardChange.revisedOpinionContent'),
children: [
{ // 修改前
title: this.$t('workCenter.enStandardChange.beforeUpdate'),
align: 'center',
width: 180,
dataIndex: 'modificationBefore',
scopedSlots: { customRender: 'text' }
},
{ // 修改后
title: this.$t('workCenter.enStandardChange.afterUpdate'),
align: 'center',
width: 180,
dataIndex: 'modificationAfter',
scopedSlots: { customRender: 'text' }
},
{ // 修改理由
title: this.$t('workCenter.enStandardChange.updateReason'),
align: 'center',
width: 180,
dataIndex: 'modificationReason',
scopedSlots: { customRender: 'text' }
}
]
},
{ // 设计工程师
title: this.$t('workCenter.standardConsultationProcess.designEngineer'),
width: 180,
align: 'center',
dataIndex: 'designEngineerName',
scopedSlots: { customRender: 'text' }
},
{ // 意见
title: this.$t('workCenter.esInspectionPlan.opinion'),
width: 180,
align: 'center',
dataIndex: 'isAdopt_dictText',
scopedSlots: { customRender: 'opinion' }
}
],
dataSource: [],
selectedRowKeys: [],
// 汇总表格的表单校验
collectExtraForm: {
// 采纳
'1': {
rules: {
// 依据描述
basisDescription: {
required: false,
message: this.$t('pleaseEnter') + this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
trigger: 'blur'
},
// 佐证材料
basisFile: {
required: false,
message: this.$t('pleaseUpload') + this.$t('projectLibrary.specialProjectLibrary.supportingMaterial'),
trigger: 'change'
}
},
formArr: [
{
fieldShowType: 1,
dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
dbFieldName: 'basisDescription'
},
{
fieldShowType: 2,
dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.supportingMaterial'),
dbFieldName: 'basisFile',
fileType: 'pdf,doc,docx,pptx,ppt,jpg,jpeg,png,xls,xlsx,bmp'
}
]
},
// 部分采纳
'2': {
rules: {
// 依据描述
basisDescription: {
required: false,
message: this.$t('pleaseEnter') + this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
trigger: 'blur'
},
// 佐证材料
basisFile: {
required: false,
message: this.$t('pleaseUpload') + this.$t('projectLibrary.specialProjectLibrary.supportingMaterial'),
trigger: 'change'
}
},
formArr: [
{
fieldShowType: 1,
dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
dbFieldName: 'basisDescription'
},
{
fieldShowType: 2,
dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.supportingMaterial'),
dbFieldName: 'basisFile',
fileType: 'pdf,doc,docx,pptx,ppt,jpg,jpeg,png,xls,xlsx,bmp'
}
]
},
// 不采纳
'3': {
rules: {
// 依据描述
basisDescription: {
required: true,
message: this.$t('pleaseEnter') + this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
trigger: 'blur'
},
// 佐证材料
basisFile: {
required: false,
message: this.$t('pleaseUpload') + this.$t('projectLibrary.specialProjectLibrary.supportingMaterial'),
trigger: 'change'
}
},
formArr: [
{
fieldShowType: 1,
dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
dbFieldName: 'basisDescription'
},
{
fieldShowType: 2,
dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.supportingMaterial'),
dbFieldName: 'basisFile',
fileType: 'pdf,doc,docx,pptx,ppt,jpg,jpeg,png,xls,xlsx,bmp'
}
]
}
},
// 审批表头
approvalColumns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 80,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 章节编号
title: this.$t('workCenter.esInspectionProcess.sectionNumber'),
width: 180,
align: 'center',
dataIndex: 'chapterNumber',
scopedSlots: { customRender: 'text' }
},
{ // 章节名称
title: this.$t('workCenter.standardConsultationProcess.chapterName'),
width: 180,
align: 'center',
dataIndex: 'chapterName',
scopedSlots: { customRender: 'text' }
},
{ // 修改意见内容
title: this.$t('workCenter.enStandardChange.revisedOpinionContent'),
children: [
{ // 修改前
title: this.$t('workCenter.enStandardChange.beforeUpdate'),
align: 'center',
width: 180,
dataIndex: 'modificationBefore',
scopedSlots: { customRender: 'text' }
},
{ // 修改后
title: this.$t('workCenter.enStandardChange.afterUpdate'),
align: 'center',
width: 180,
dataIndex: 'modificationAfter',
scopedSlots: { customRender: 'text' }
},
{ // 修改理由
title: this.$t('workCenter.enStandardChange.updateReason'),
align: 'center',
width: 180,
dataIndex: 'modificationReason',
scopedSlots: { customRender: 'text' }
}
]
},
{ // 设计工程师
title: this.$t('workCenter.standardConsultationProcess.designEngineer'),
width: 180,
align: 'center',
dataIndex: 'designEngineerName',
scopedSlots: { customRender: 'text' }
},
{ // 意见
title: this.$t('workCenter.standardConsultationProcess.moduleOwner') + this.$t('workCenter.esInspectionPlan.opinion'),
width: 180,
align: 'center',
dataIndex: 'isAdopt_dictText',
scopedSlots: { customRender: 'text' }
}
],
businessId: null
}
},
computed: {
// 流程的key
processKey () {
return ProcessKey.CONSULTATION.value
},
pageTitle () {
const subTitle = this.$route.query.taskName || ConsultationProcess.initiate.text
return `${this.$t('flowCenter')}${this.$route.meta.title}${subTitle}`
},
// 是否展示业务分派信息,各部所主管级领导分发、模块负责人分发显示
showDispatchInformation () {
const nodes = [ConsultationProcess.distribute.value, ConsultationProcess.moduleOwnerDistribution.value]
return nodes.some(tt => this.currentNode.indexOf(tt) === 0)
},
// 流程信息禁用,非发起节点都禁用
processInfoDisabled () {
return this.currentNode.indexOf(ConsultationProcess.initiate.value) === -1
},
// 业务基本信息禁用,非发起节点都禁用
basicServiceInfoDisabled () {
return !!this.currentNode && this.currentNode.indexOf(ConsultationProcess.initiate.value) === -1
},
// 展示征求意见列表(设计工程师填写征求意见、模块负责人/各部所主管级领导汇总、各部所主管级领导/法规工程师审批)
showConsultationList () {
const nodes = [ConsultationProcess.designEngineerFillIn.value, ConsultationProcess.moduleOwnerSummary.value, ConsultationProcess.leaderApproval.value, ConsultationProcess.leaderSummary.value, ConsultationProcess.regulatoryEngineerApproval.value]
return nodes.some(tt => this.currentNode.indexOf(tt) === 0)
},
// 展示审批的表格
showAuditTable () {
const nodes = [ConsultationProcess.moduleOwnerSummary.value, ConsultationProcess.leaderSummary.value, ConsultationProcess.leaderApproval.value, ConsultationProcess.regulatoryEngineerApproval.value]
return nodes.some(tt => this.currentNode.indexOf(tt) === 0) || this.nodeEnumsKey === 'regulatoryEngineerApproval'
},
// 是否汇总节点
isSummaryNode () {
const nodes = [ConsultationProcess.moduleOwnerSummary.value, ConsultationProcess.leaderSummary.value]
return nodes.some(tt => this.currentNode.indexOf(tt) === 0)
},
columns () {
// 设计工程师填写征求意见表头
if (this.currentNode.indexOf(ConsultationProcess.designEngineerFillIn.value) === 0) {
return this.designEngineerFillInColumns
}
// 模块负责人汇总填写意见表头
const summaryNodes = [ConsultationProcess.moduleOwnerSummary.value, ConsultationProcess.leaderSummary.value]
if (summaryNodes.some(tt => this.currentNode.indexOf(tt) === 0)) {
return this.collectColumns
}
// 审批节点表头
const auditNodes = [ConsultationProcess.leaderApproval.value, ConsultationProcess.regulatoryEngineerApproval.value]
if (auditNodes.some(tt => this.currentNode.indexOf(tt) === 0) || this.nodeEnumsKey === 'regulatoryEngineerApproval') {
return this.approvalColumns
}
return []
}
},
created () {
// 有流程id或者草稿id点进来的
if (this.$route.query.processInstanceId || this.$route.query.draftId) {
this.currentNode = this.$route.query.nodeId || ConsultationProcess.initiate.value
this.initProcessDetailData()
} else {
this.currentNode = ConsultationProcess.initiate.value
}
// 获取人员信息数据
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.currentNode.indexOf(ConsultationProcess.initiate.value) === 0)
})
// 找不到这个节点默认使用审批节点页面及按钮,发起除外
this.nodeEnumsKey = this.currentNode ? ConsultationProcess.keyOfValueByLike(this.currentNode) || 'regulatoryEngineerApproval' : 'initiate'
this.btnList = ConsultationProcess[this.nodeEnumsKey].btn
},
methods: {
initProcessDetailData () {
this.loading = true
const params = {
taskId: this.$route.query.taskId
}
if (this.$route.query.draftId) {
params.draftId = this.$route.query.draftId
} else {
params.processInstanceId = this.$route.query.processInstanceId
}
queryConsultationProcessDetail(params).then(async res => {
if (res.success) {
const { result } = res
this.businessId = result.businessId
// 处理流程信息
this.processInfo = Object.assign({}, result.basicProcessInfoDTO || {})
// 流程审批信息
this.approvalInfo = Object.assign({}, result.basicTaskInfoDTO || {})
this.approvalInfo.taskId = this.approvalInfo.taskId || this.$route.query.taskId
// 业务基本信息
this.basicServiceInfo = Object.assign({}, result.businessInfoDTO.processFbStandardConsultation || {})
if (this.currentNode.indexOf(ConsultationProcess.initiate.value) !== -1 && this.basicServiceInfo.standardTextFileId) {
await this.queryFileName()
}
// 业务分派信息
this.dispatchInfo = Object.assign({}, result.businessInfoDTO.processFbConsultationUserLink || {})
if (this.dispatchInfo.userType) {
this.handleSenderTypeChange(this.dispatchInfo.userType)
}
// 征求意见列表
this.dataSource = result.businessInfoDTO.processFbConsultationLists || []
// 统一处理表单回显
this.$nextTick(() => {
this.processInfoForm.setFieldsValue(this.processInfo)
this.approvalInfoForm.setFieldsValue(this.approvalInfo)
this.basicServiceInfoForm.setFieldsValue(this.basicServiceInfo)
this.dispatchInfoForm.setFieldsValue(this.dispatchInfo)
})
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
queryFileName () {
return new Promise(resolve => {
getFileInfo({ id: this.basicServiceInfo.standardTextFileId }).then(res => {
if (res.success) {
this.basicServiceInfo.standardTextFileName = res.result.fileName
}
}).finally(() => {
resolve()
})
})
},
switchChange (value) {
this.switchValue = value
},
/**
* 选择标准带出标准名称
* @param name
*/
handleStandardChange (name) {
this.basicServiceInfoForm.setFieldsValue({ standardName: name, standardTextFileName: null })
delete this.basicServiceInfo.standardTextFileName
delete this.basicServiceInfo.standardText
delete this.basicServiceInfo.standardTextFileId
},
/**
* 选择标准文本
*/
chooseStandardText () {
const selectedStandard = this.basicServiceInfoForm.getFieldValue('standardNumber')
if (!selectedStandard) {
this.$message.warning(this.$t('workCenter.standardConsultationProcess.pleaseSelectCriteriaFirst'))
return
}
this.$refs.selectStandardFileModal.open(selectedStandard, this.basicServiceInfo.standardText)
},
/**
* 下发人员类型修改
* @param value
*/
handleSenderTypeChange (value) {
this.senderType = value
},
/**
* 征求意见列表-新增
*/
handleAdd () {
const pdfId = this.basicServiceInfo.standardTextFileId
this.$refs.consultationModal.add(pdfId, this.basicServiceInfo.standardText)
},
/**
* 表单填写完成,新增数据
*/
handleAddData (lineData) {
if (lineData.index || lineData.index === 0) {
this.dataSource.splice(lineData.index, 1, lineData)
} else {
this.dataSource.push(lineData)
}
},
/**
* 征求意见列表-删除
*/
batchDel () {
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('selectLeastOne'))
return
}
const tableData = JSON.parse(JSON.stringify(this.dataSource))
this.selectedRowKeys.forEach(index => {
tableData[index] = null
})
this.dataSource = tableData.filter(tt => !!tt)
this.selectedRowKeys = []
},
onSelectChange (selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys
},
handleEdit (record, index) {
record.index = index
const pdfId = this.basicServiceInfo.standardTextFileId
this.$refs.consultationModal.edit(pdfId, record)
},
/**
* 处理页面数据
*/
dealFormData (isSave) {
// 提交的表单数据,流程信息,流程审批信息,征求意见列表,业务分派信息,业务基本信息
let formData = {}, processInfo = {}, approvalInfo = {}, consultationListData = [], dispatchInfo = {}, basicServiceInfo = {},
userInfoMap = {}, flag = true
// 保存,只需要有填写内容即可
if (isSave) {
// 流程信息
processInfo = Object.assign(this.processInfo, this.processInfoForm.getFieldsValue())
// 业务基本信息
basicServiceInfo = Object.assign(this.basicServiceInfo, this.basicServiceInfoForm.getFieldsValue())
// 流程审批信息
approvalInfo = Object.assign(this.approvalInfo, this.approvalInfoForm.getFieldsValue())
// 业务分派信息
if (this.showDispatchInformation) {
dispatchInfo = Object.assign(this.dispatchInfo, this.dispatchInfoForm.getFieldsValue())
}
// 用户信息
userInfoMap = this.$refs.personnelInfo.getDataObj()
const saveCheckObj = { ...processInfo, ...basicServiceInfo, ...approvalInfo, ...dispatchInfo, ...userInfoMap }
// 征求意见列表
consultationListData = this.dataSource || []
if (!(Object.values(saveCheckObj).some(tt => !!tt || tt === 0) || consultationListData.length > 0)) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
flag = false
}
} else {
// 流程信息
this.processInfoForm.validateFields((errors, values) => {
if (!errors) {
processInfo = Object.assign(this.processInfo, values)
} else {
flag = false
}
})
// 业务基本信息
this.basicServiceInfoForm.validateFields((errors, values) => {
if (!errors) {
basicServiceInfo = Object.assign(this.basicServiceInfo, values)
} else {
flag = false
}
})
// 流程审批信息
this.approvalInfoForm.validateFields((errors, values) => {
if (!errors) {
approvalInfo = Object.assign(this.approvalInfo, values)
} else {
flag = false
}
})
// 业务分派信息
if (this.showDispatchInformation) {
this.dispatchInfoForm.validateFields((errors, values) => {
if (!errors) {
dispatchInfo = Object.assign(this.dispatchInfo, values)
} else {
flag = false
}
})
} else {
dispatchInfo = Object.assign({}, this.dispatchInfo)
}
// 征求意见列表
if (this.showConsultationList && (this.currentNode.indexOf(ConsultationProcess.moduleOwnerSummary.value) !== -1 || this.currentNode.indexOf(ConsultationProcess.leaderSummary.value) !== -1) && !this.$refs.expandTable.submit()) {
flag = false
}
// 用户信息
const userInfo = this.$refs.personnelInfo.getDataObjVerify()
if (!userInfo) {
flag = false
} else {
userInfoMap = userInfo
}
consultationListData = this.dataSource || []
}
if (!flag) {
return false
}
formData = {
businessId: this.businessId,
basicProcessInfoDTO: processInfo,
basicTaskInfoDTO: approvalInfo,
businessInfoDTO: {
processFbStandardConsultation: basicServiceInfo,
processFbConsultationUserLink: dispatchInfo,
processFbConsultationLists: this.dataSource
},
userInfoMap
}
return formData
},
/**
* 转办
*/
handleTurnTo () {
this.$refs.userSelectModal.open()
},
continueTurnTo (userId) {
const params = {
taskId: this.$route.query.taskId,
userId
}
this.loading = true
transferConsultationProcess(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 保存
*/
handleSave () {
const formData = this.dealFormData(true)
if (!formData) {
return
}
this.loading = true
saveConsultationProcess(formData).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 提交
*/
handleSubmit () {
const formData = this.dealFormData()
if (!formData) {
return
}
this.loading = true
let func
if (!this.currentNode || (this.currentNode.indexOf(ConsultationProcess.initiate.value) === 0 && !this.$route.query.processInstanceId)) {
func = initiateConsultationProcess
} else {
func = submitConsultationProcess
}
func(formData).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 同意
*/
handleAgree () {
this.validatorRules.handleText.rules[0].required = false
this.approvalInfoForm.setFieldsValue({ handleText: '同意' })
const formData = this.dealFormData()
if (!formData) {
return
}
this.loading = true
agreeConsultationProcess(formData).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 驳回
*/
handleReject () {
this.validatorRules.handleText.rules[0].required = true
const formData = this.dealFormData()
if (!formData) {
return
}
this.loading = true
rejectConsultationProcess(formData).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 批量操作
*/
batchOperate () {
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('selectLeastOne'))
return
}
this.$refs.opinionModal.open()
},
handleWriteOpinion ({ isAdopt }) {
this.selectedRowKeys.forEach(index => {
this.$set(this.dataSource[index], 'isAdopt', isAdopt)
})
},
/**
* 选中标准文本
* @param item
*/
handleSelectedFile (item) {
this.basicServiceInfoForm.setFieldsValue({ standardTextFileName: item.fileName })
this.basicServiceInfo.standardTextFileName = item.fileName
this.basicServiceInfo.standardText = item.publishBeforeId
this.basicServiceInfo.standardTextFileId = item.fileId
},
/**
* 修改意见
* @param value
* @param index
*/
handleOpinionChange (value, index) {
this.$set(this.dataSource[index], 'isAdopt', value)
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.box-title-text {
height: 40px;
line-height: 40px;
display: flex;
align-items: center;
.box-input {
width: 100%;
}
.button-box {
margin-left: 10px;
}
}
.disabled-white-input[disabled] {
background-color: white;
color: rgba(0, 0, 0, 0.65);
}
.opinion-select {
width: 100%;
}
.add-required > ::v-deep.ant-form-item-label > label::before {
display: inline-block;
margin-right: 4px;
color: #f5222d;
font-size: 14px;
font-family: SimSun, sans-serif;
line-height: 1;
content: '*';
}
</style>