946 lines
35 KiB
Vue
946 lines
35 KiB
Vue
<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'">
|
||
|
||
<!--步骤条-->
|
||
<a-steps :current="currentStep" v-if="showStep">
|
||
<a-step v-for="item in steps" :key="item.title" :title="item.title" />
|
||
</a-steps>
|
||
|
||
<!--流程信息-->
|
||
<div class="process-part-title" v-show="processInfoShowField && processInfoShowField.length > 0">{{ $t('processInformation') }}</div>
|
||
<a-form :form="processInfoForm">
|
||
<a-row>
|
||
<a-col :span="12" v-show="processInfoShowField.includes('processName')">
|
||
<!--流程名称-->
|
||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('processName')">
|
||
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
|
||
@change="event => event.target.value = event.target.value.trim()"
|
||
:maxLength="50"
|
||
:disabled="processInfoDisabled"
|
||
v-decorator="['processName', validatorRules.processName]" />
|
||
</a-form-item>
|
||
</a-col>
|
||
<a-col :span="12" v-show="processInfoShowField.includes('processDueDate')">
|
||
<!--截止日期-->
|
||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :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-row>
|
||
<a-col :span="12" v-show="processInfoShowField.includes('projectName')">
|
||
<!--车型项目信息-->
|
||
<a-form-item :labelCol="labelCol"
|
||
:wrapperCol="wrapperCol"
|
||
:label="$t('workCenter.projectComplianceEvaluationProcess.vehicleItemInfo')">
|
||
<div class="can-click-table-text" v-if="projectDataSource && projectDataSource.length > 0">
|
||
<div v-for="(project, index) in projectDataSource" :key="index + 'project'" @click="toProjectDetail(project)">
|
||
{{ projectDataSource[0].projectName }}
|
||
</div>
|
||
</div>
|
||
</a-form-item>
|
||
</a-col>
|
||
<a-col :span="12" v-show="processInfoShowField.includes('standardNumber')">
|
||
<!--属性及文本附件-->
|
||
<a-form-item :labelCol="labelCol"
|
||
:wrapperCol="wrapperCol"
|
||
:label="$t('workCenter.projectComplianceEvaluationProcess.propertiesAndTextAttachments')">
|
||
<div class="can-click-table-text" v-if="standardDataSource && standardDataSource.length > 0">
|
||
<div v-for="(standard, index) in standardDataSource" :key="index + 'standard'" @click="toStandardDetail(standard)">
|
||
{{ standard.standardNumber }} {{ standard.standardName }}
|
||
</div>
|
||
</div>
|
||
</a-form-item>
|
||
</a-col>
|
||
</a-row>
|
||
<!--流程说明-->
|
||
<a-form-item v-show="processInfoShowField.includes('processDescription')"
|
||
: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>
|
||
|
||
<!--发起第二步选择项目、第三步添加标准,采用引入组件的方式-->
|
||
<keep-alive>
|
||
<component :is="comp" v-if="comp" ref="projectStandardTable" />
|
||
</keep-alive>
|
||
|
||
<!--业务分派信息-->
|
||
<template v-if="showDispatchAndApprovalInfo">
|
||
<div class="process-part-title">{{ $t('workCenter.dispatchInformation') }}</div>
|
||
<div class="table-operator">
|
||
<!--批量选择人员-->
|
||
<a-button type="primary" ghost @click="batchSelector" v-if="!showExpandTable">
|
||
{{ $t('workCenter.projectComplianceEvaluationProcess.batchSelector') }}
|
||
</a-button>
|
||
</div>
|
||
<div v-if="!showExpandTable">
|
||
<j-table
|
||
:can-drag="true"
|
||
:scroll="{x: '100%'}"
|
||
ref="table"
|
||
rowKey="id"
|
||
:columns="columns"
|
||
:dataSource="dataSource"
|
||
:pagination="false"
|
||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||
v-bind="$attrs">
|
||
|
||
<!--责任单位-->
|
||
<template v-slot:depart="{text, record, index}">
|
||
<j-select-depart multi
|
||
:back-depart="true"
|
||
:value="record.depart"
|
||
@change="value => handleDepartChange(value, record, index)" />
|
||
</template>
|
||
|
||
<!--责任单位负责人-->
|
||
<template v-slot:user="{text, record, index}">
|
||
<user-selection :name-str="record.user_dictText"
|
||
:show-btn="false"
|
||
:value="record.user"
|
||
:placeholder="$t('pleaseSelect') + $t('workCenter.projectComplianceEvaluationProcess.responsibleUnitHead')"
|
||
type="checkbox"
|
||
@listChange="value => handleUserChange(value, record, index, 'user')" />
|
||
</template>
|
||
|
||
<!--模块负责人-->
|
||
<template v-slot:moduleOwner="{text, record, index}">
|
||
<!--不涉及不需要选模块负责人,需要填写不涉及理由-->
|
||
<user-selection :name-str="record.moduleOwner_dictText"
|
||
:show-btn="false"
|
||
:value="record.moduleOwner"
|
||
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.moduleOwner')"
|
||
type="checkbox"
|
||
v-if="!record.uninvolved"
|
||
@listChange="value => handleUserChange(value, record, index, 'moduleOwner')" />
|
||
<div v-else>{{ global.emptyLine }}</div>
|
||
</template>
|
||
|
||
<!--设计工程师-->
|
||
<template v-slot:designEngineer="{text, record, index}">
|
||
<!--不涉及不需要选模块负责人,需要填写不涉及理由-->
|
||
<user-selection :name-str="record.designEngineer_dictText"
|
||
:show-btn="false"
|
||
:value="record.designEngineer"
|
||
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.designEngineer')"
|
||
type="checkbox"
|
||
v-if="!record.uninvolved"
|
||
@listChange="value => handleUserChange(value, record, index, 'designEngineer')" />
|
||
<div v-else>{{ global.emptyLine }}</div>
|
||
</template>
|
||
|
||
<!--操作(删除)-->
|
||
<template v-slot:action="{text, record}">
|
||
<a @click="handleDelete(record.id)">{{ $t('delete') }}</a>
|
||
</template>
|
||
|
||
<!--操作(不涉及/不涉及原因)-->
|
||
<template v-slot:uninvolved="{text, record, index}">
|
||
<a @click="handleUninvolved(record, index)">
|
||
{{
|
||
!record.uninvolved ? $t('projectLibrary.vehicleItemLibrary.uninvolved') : $t('workCenter.projectComplianceEvaluationProcess.noCauseInvolved')
|
||
}}
|
||
</a>
|
||
</template>
|
||
</j-table>
|
||
</div>
|
||
<div v-if="showExpandTable">
|
||
<j-expand-table :columns="columns"
|
||
:data-source="dataSource"
|
||
:pagination="false"
|
||
:all-disabled="expandTableDisabled"
|
||
form-is-depend="evaluationFeedback"
|
||
:extra-form="extraForm"
|
||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
|
||
|
||
<template v-slot:evaluationFeedback="{text, record, index}">
|
||
|
||
<j-dict-select-tag
|
||
v-if="!expandTableDisabled"
|
||
style="width: 100%"
|
||
:placeholde="$t('pleaseSelect') + $t('workCenter.projectComplianceEvaluationProcess.evaluationFeedback')"
|
||
:value="record.evaluationFeedback"
|
||
:options="[
|
||
{value:'1', text: '符合'},
|
||
{value:'2', text: '不符合'},
|
||
{value:'3', text: '待验证'},
|
||
{value:'4', text: '不涉及'},
|
||
]"
|
||
@change="value => handleEvaluationFeedBackChange(value, record, index)" />
|
||
|
||
<template v-else>
|
||
<a-tooltip overlay-class-name="tooltip-style">
|
||
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
||
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
|
||
</a-tooltip>
|
||
</template>
|
||
</template>
|
||
|
||
</j-expand-table>
|
||
</div>
|
||
|
||
<a-form :form="dispatchInfoForm" class="dispatch-form" v-if="showCcPerson">
|
||
<a-row>
|
||
<a-col :span="12">
|
||
<!--抄送人员-->
|
||
<a-form-item :labelCol="labelCol"
|
||
:wrapperCol="wrapperCol"
|
||
:label="$t('workCenter.projectComplianceEvaluationProcess.ccPerson')">
|
||
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.projectComplianceEvaluationProcess.ccPerson')"
|
||
type="checkbox"
|
||
v-decorator="['ccPerson', validatorRules.ccPerson]" />
|
||
</a-form-item>
|
||
</a-col>
|
||
</a-row>
|
||
</a-form>
|
||
</template>
|
||
|
||
<!--流程审批信息-->
|
||
<template v-if="showDispatchAndApprovalInfo">
|
||
<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>
|
||
</template>
|
||
</div>
|
||
|
||
<!--人员信息-->
|
||
<div class="detail-page-scroll-content p-0" v-show="switchValue === 'user'">
|
||
<process-detail-list>
|
||
<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" ghost icon="arrow-up" v-if="btnList.includes('pre')" @click="handleLastStep">
|
||
{{ $t('workCenter.projectComplianceEvaluationProcess.lastStep') }}
|
||
</a-button>
|
||
<!--下一步-->
|
||
<a-button type="primary" :loading="loading" icon="arrow-down" v-if="btnList.includes('next')" @click="handleNextStep">
|
||
{{ $t('workCenter.projectComplianceEvaluationProcess.nextStep') }}
|
||
</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>
|
||
|
||
<!--选人-->
|
||
<user-select-modal type="checkbox" ref="userSelectModal" @listChange="handleBatchSelectorOk" />
|
||
<!--不涉及-->
|
||
<uninvolved-modal ref="uninvolvedModal" @ok="handleUninvolvedOk" />
|
||
</internal-detail-page>
|
||
</template>
|
||
|
||
<script>
|
||
import PersonnelInfo from '../../../components/PersonnelInfo'
|
||
import InternalDetailPage from '../../../components/InternalDetailPage'
|
||
import ProcessDetailList from '../../../components/ProcessDetailList'
|
||
import { WorkCenterMixin } from '../../../mixins/WorkCenterMixin'
|
||
import { ProcessKey, ProjectComplianceEvaluationProcessNode } from '../../../enums/commonEnums'
|
||
import JTable from '../../../components/jero/JTable'
|
||
import ProjectTable from './components/ProjectTable'
|
||
import UserSelection from '../../../components/selection/UserSelection'
|
||
import UserSelectModal from '../../../components/selection/UserSelectModal'
|
||
import UninvolvedModal from './modules/UninvolvedModal'
|
||
import JExpandTable from '../../../components/JExpandTable'
|
||
|
||
export default {
|
||
name: 'ProjectComplianceEvaluationProcess',
|
||
components: {
|
||
JExpandTable,
|
||
JTable,
|
||
ProcessDetailList,
|
||
InternalDetailPage,
|
||
PersonnelInfo,
|
||
ProjectTable,
|
||
UserSelection,
|
||
UserSelectModal,
|
||
UninvolvedModal
|
||
},
|
||
mixins: [WorkCenterMixin],
|
||
data () {
|
||
return {
|
||
loading: false,
|
||
// 流程信息表单
|
||
processInfoForm: this.$form.createForm(this),
|
||
processInfo: {},
|
||
// 业务分派信息的表单
|
||
dispatchInfoForm: this.$form.createForm(this),
|
||
dispatchInfo: {},
|
||
// 审批信息的表单
|
||
approvalInfoForm: this.$form.createForm(this),
|
||
approvalInfo: {},
|
||
currentNode: null,
|
||
labelCol: {
|
||
xs: { span: 24 },
|
||
sm: { span: 6 }
|
||
},
|
||
wrapperCol: {
|
||
xs: { span: 24 },
|
||
sm: { span: 18 }
|
||
},
|
||
longLabelCol: {
|
||
xs: { span: 24 },
|
||
sm: { span: 3 }
|
||
},
|
||
longWrapperCol: {
|
||
xs: { span: 24 },
|
||
sm: { span: 21 }
|
||
},
|
||
validatorRules: {
|
||
// 流程名称
|
||
processName: {
|
||
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('processName') }],
|
||
validateTrigger: 'blur'
|
||
},
|
||
// 备注
|
||
handleText: {
|
||
rules: [{ required: false, message: this.$t('pleaseEnter') + this.$t('remarks') }],
|
||
validateTrigger: 'blur'
|
||
},
|
||
// 抄送人员
|
||
ccPerson: {
|
||
rules: [{ required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.projectComplianceEvaluationProcess.ccPerson') }],
|
||
validateTrigger: 'change'
|
||
}
|
||
},
|
||
currentStep: 0,
|
||
steps: [
|
||
// 基本信息
|
||
{
|
||
title: this.$t('essentialInformation')
|
||
},
|
||
// 选择项目
|
||
{
|
||
title: this.$t('projectLibrary.selectProject')
|
||
},
|
||
// 选择标准
|
||
{
|
||
title: this.$t('workCenter.projectComplianceEvaluationProcess.selectStandard')
|
||
},
|
||
// 任务分发
|
||
{
|
||
title: this.$t('workCenter.projectComplianceEvaluationProcess.taskDistributing')
|
||
}
|
||
],
|
||
projectDataSource: [], // 选中的项目
|
||
standardDataSource: [], // 选中的标准
|
||
basicColumns: [
|
||
// 序号
|
||
{
|
||
title: this.$t('serialNumber'),
|
||
key: 'rowIndex',
|
||
width: 80,
|
||
align: 'center',
|
||
customRender: function (t, r, index) {
|
||
return parseInt(index) + 1
|
||
}
|
||
},
|
||
// 标准编号/条款号
|
||
{
|
||
dataIndex: 'workNumber',
|
||
title: this.$t('projectLibrary.vehicleItemLibrary.standardNumberClauseNumber'),
|
||
width: 150,
|
||
align: 'center',
|
||
scopedSlots: { customRender: 'text' }
|
||
},
|
||
// 标准名称/条款名称
|
||
{
|
||
dataIndex: 'projectName',
|
||
title: this.$t('workCenter.projectComplianceEvaluationProcess.standardNameClauseName'),
|
||
width: 160,
|
||
align: 'center',
|
||
scopedSlots: { customRender: 'text' }
|
||
},
|
||
// 条款内容
|
||
{
|
||
dataIndex: 'projectSource_dictText',
|
||
title: this.$t('workCenter.projectComplianceEvaluationProcess.terms'),
|
||
width: 150,
|
||
align: 'center',
|
||
scopedSlots: { customRender: 'text' }
|
||
}
|
||
],
|
||
dataSource: [],
|
||
selectedRowKeys: [],
|
||
// 展开表格的配置项
|
||
extraForm: {
|
||
// 符合
|
||
'1': {
|
||
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'
|
||
}
|
||
]
|
||
},
|
||
// 不符合
|
||
'2': {
|
||
rules: {
|
||
// 依据描述
|
||
basisDescription: {
|
||
required: true,
|
||
message: this.$t('pleaseEnter') + this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
|
||
trigger: 'blur'
|
||
},
|
||
// 预计整改完成日期
|
||
basisFile: {
|
||
required: true,
|
||
message: this.$t('pleaseSelect') + this.$t('projectLibrary.vehicleItemLibrary.estimatedDateOfCompletionOfRectification'),
|
||
trigger: 'change'
|
||
}
|
||
},
|
||
formArr: [
|
||
{
|
||
fieldShowType: 1,
|
||
dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
|
||
dbFieldName: 'basisDescription'
|
||
},
|
||
{
|
||
fieldShowType: 3,
|
||
dbFieldTxt: this.$t('projectLibrary.vehicleItemLibrary.estimatedDateOfCompletionOfRectification'),
|
||
dbFieldName: 'basisFile'
|
||
}
|
||
]
|
||
},
|
||
// 待验证
|
||
'3': {
|
||
rules: {
|
||
// 依据描述
|
||
basisDescription: {
|
||
required: true,
|
||
message: this.$t('pleaseEnter') + this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
|
||
trigger: 'blur'
|
||
},
|
||
// 预计整改完成日期
|
||
basisFile: {
|
||
required: true,
|
||
message: this.$t('pleaseSelect') + this.$t('projectLibrary.vehicleItemLibrary.estimatedDateOfCompletionOfRectification'),
|
||
trigger: 'change'
|
||
}
|
||
},
|
||
formArr: [
|
||
{
|
||
fieldShowType: 1,
|
||
dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
|
||
dbFieldName: 'basisDescription'
|
||
},
|
||
{
|
||
fieldShowType: 3,
|
||
dbFieldTxt: this.$t('projectLibrary.vehicleItemLibrary.estimatedDateOfCompletionOfRectification'),
|
||
dbFieldName: 'basisFile'
|
||
}
|
||
]
|
||
},
|
||
// 不涉及
|
||
'4': {
|
||
rules: {
|
||
// 依据描述
|
||
basisDescription: {
|
||
required: true,
|
||
message: this.$t('pleaseEnter') + this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
|
||
trigger: 'blur'
|
||
}
|
||
},
|
||
formArr: [
|
||
{
|
||
fieldShowType: 1,
|
||
dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
|
||
dbFieldName: 'basisDescription'
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
computed: {
|
||
pageTitle () {
|
||
return `${this.$t('flowCenter')}${this.$route.meta.title}`
|
||
},
|
||
// 流程信息禁用
|
||
processInfoDisabled () {
|
||
return !(this.currentNode === ProjectComplianceEvaluationProcessNode.initiate.value && !this.$route.query.processInstanceId && this.currentStep !== 3)
|
||
},
|
||
// 节点显示的按钮
|
||
btnList () {
|
||
let btnList = ProjectComplianceEvaluationProcessNode.propertyOfValue('btn', this.currentNode) || ProjectComplianceEvaluationProcessNode.moduleOwnerApproval.btn
|
||
if (this.currentNode === ProjectComplianceEvaluationProcessNode.initiate.value) {
|
||
switch (this.currentStep) {
|
||
case 0:
|
||
btnList = ['save', 'next']
|
||
break
|
||
case 1:
|
||
case 2:
|
||
btnList = ['save', 'pre', 'next']
|
||
break
|
||
case 3:
|
||
btnList = ['save', 'pre', 'submit']
|
||
break
|
||
default:
|
||
break
|
||
}
|
||
}
|
||
return btnList
|
||
},
|
||
// 流程信息展示的字段
|
||
processInfoShowField () {
|
||
if (this.currentNode === ProjectComplianceEvaluationProcessNode.initiate.value) {
|
||
let fieldList = []
|
||
switch (this.currentStep) {
|
||
case 0:
|
||
fieldList = ['processName', 'processDueDate', 'processDescription']
|
||
break
|
||
case 1:
|
||
case 2:
|
||
fieldList = []
|
||
break
|
||
case 3:
|
||
fieldList = ['processName', 'processDueDate', 'processDescription', 'projectName', 'standardNumber']
|
||
break
|
||
default:
|
||
fieldList = []
|
||
break
|
||
}
|
||
return fieldList
|
||
}
|
||
return ['processName', 'processDueDate', 'processDescription', 'projectName', 'standardNumber']
|
||
},
|
||
comp () {
|
||
// 发起节点的第二步
|
||
if (this.currentNode === ProjectComplianceEvaluationProcessNode.initiate.value && this.currentStep === 1) {
|
||
return resolve => require(['./components/ProjectTable.vue'], resolve)
|
||
}
|
||
// 发起节点第三步
|
||
if (this.currentNode === ProjectComplianceEvaluationProcessNode.initiate.value && this.currentStep === 2) {
|
||
return resolve => require(['./components/StandardList.vue'], resolve)
|
||
}
|
||
return null
|
||
},
|
||
// 展示业务分派信息和流程审批信息的判断
|
||
showDispatchAndApprovalInfo () {
|
||
return !(this.currentNode === ProjectComplianceEvaluationProcessNode.initiate.value && this.currentStep !== 3)
|
||
},
|
||
// 业务分派信息部分表头
|
||
columns () {
|
||
console.log(this.currentNode)
|
||
// 法规工程师发起
|
||
if (this.currentNode === ProjectComplianceEvaluationProcessNode.initiate.value) {
|
||
return this.basicColumns.concat([
|
||
// 责任单位
|
||
{
|
||
title: this.$t('workCenter.projectComplianceEvaluationProcess.accountabilityUnit'),
|
||
dataIndex: 'depart',
|
||
width: 150,
|
||
scopedSlots: { customRender: 'depart' }
|
||
},
|
||
// 责任单位负责人
|
||
{
|
||
title: this.$t('workCenter.projectComplianceEvaluationProcess.responsibleUnitHead'),
|
||
dataIndex: 'user',
|
||
width: 150,
|
||
scopedSlots: { customRender: 'user' }
|
||
},
|
||
// 操作
|
||
{
|
||
title: this.$t('operation'),
|
||
fixed: 'right',
|
||
width: 100,
|
||
scopedSlots: { customRender: 'action' }
|
||
}
|
||
])
|
||
}
|
||
// 各部门主管级领导下发
|
||
if (this.currentNode === ProjectComplianceEvaluationProcessNode.departLeaderIssued.value) {
|
||
return this.basicColumns.concat([
|
||
// 发起人
|
||
{
|
||
title: this.$t('workCenter.processCenter.initiator'),
|
||
dataIndex: 'depart',
|
||
width: 150
|
||
},
|
||
// 模块负责人
|
||
{
|
||
title: this.$t('workCenter.standardConsultationProcess.moduleOwner'),
|
||
dataIndex: 'moduleOwner',
|
||
width: 150,
|
||
scopedSlots: { customRender: 'moduleOwner' }
|
||
},
|
||
// 操作
|
||
{
|
||
title: this.$t('operation'),
|
||
fixed: 'right',
|
||
width: 120,
|
||
scopedSlots: { customRender: 'uninvolved' }
|
||
}
|
||
])
|
||
}
|
||
// 模块负责人分发
|
||
if (this.currentNode === ProjectComplianceEvaluationProcessNode.moduleOwnerIssued.value) {
|
||
return this.basicColumns.concat([
|
||
// 设计工程师
|
||
{
|
||
title: this.$t('workCenter.standardConsultationProcess.designEngineer'),
|
||
dataIndex: 'designEngineer',
|
||
width: 150,
|
||
scopedSlots: { customRender: 'designEngineer' }
|
||
},
|
||
// 操作
|
||
{
|
||
title: this.$t('operation'),
|
||
fixed: 'right',
|
||
width: 120,
|
||
scopedSlots: { customRender: 'uninvolved' }
|
||
}
|
||
])
|
||
}
|
||
// 设计工程师评估、模块负责人审批、各部门主管级领导审批、法规工程师归档,及用户新增的审批节点都显示审批节点的表头
|
||
const showNode = [ProjectComplianceEvaluationProcessNode.designEngineerEvaluation.value, ProjectComplianceEvaluationProcessNode.moduleOwnerApproval.value, ProjectComplianceEvaluationProcessNode.departLeaderApproval.value, ProjectComplianceEvaluationProcessNode.regulatoryEngineerFiling.value]
|
||
if (showNode.includes(this.currentNode) || !ProjectComplianceEvaluationProcessNode.keyOfValue(this.currentNode)) {
|
||
return this.basicColumns.concat([
|
||
// 上一节点处理人
|
||
{
|
||
title: this.$t('workCenter.projectComplianceEvaluationProcess.preNodePeople'),
|
||
dataIndex: 'preNodePeople',
|
||
width: 150,
|
||
align: 'center',
|
||
scopedSlots: { customRender: 'text' }
|
||
},
|
||
// 评估反馈
|
||
{
|
||
title: this.$t('workCenter.projectComplianceEvaluationProcess.evaluationFeedback'),
|
||
dataIndex: 'evaluationFeedback',
|
||
width: 150,
|
||
align: 'center',
|
||
scopedSlots: { customRender: 'evaluationFeedback' }
|
||
}
|
||
])
|
||
}
|
||
return []
|
||
},
|
||
// 是否展示步骤条
|
||
showStep () {
|
||
return this.currentNode === ProjectComplianceEvaluationProcessNode.initiate.value
|
||
},
|
||
// 是否展示可展开表格
|
||
showExpandTable () {
|
||
// 设计工程师评估及之后节点都是
|
||
const showNode = [ProjectComplianceEvaluationProcessNode.designEngineerEvaluation.value, ProjectComplianceEvaluationProcessNode.moduleOwnerApproval.value, ProjectComplianceEvaluationProcessNode.departLeaderApproval.value, ProjectComplianceEvaluationProcessNode.regulatoryEngineerFiling.value]
|
||
return showNode.includes(this.currentNode) || !ProjectComplianceEvaluationProcessNode.keyOfValue(this.currentNode)
|
||
},
|
||
// 展开表格的禁用
|
||
expandTableDisabled () {
|
||
return this.showExpandTable && this.currentNode !== ProjectComplianceEvaluationProcessNode.designEngineerEvaluation.value
|
||
},
|
||
// 是否展示抄送人员
|
||
showCcPerson () {
|
||
return this.currentNode === ProjectComplianceEvaluationProcessNode.regulatoryEngineerFiling.value
|
||
}
|
||
},
|
||
created () {
|
||
if (this.$route.query.processInstanceId || this.$route.query.draftId) {
|
||
this.currentNode = this.$route.query.nodeId
|
||
this.initProcessInfo()
|
||
} else {
|
||
this.currentNode = ProjectComplianceEvaluationProcessNode.initiate.value
|
||
}
|
||
this.getPersonInfoStructure(ProcessKey.PROJECT_COMPLIANCE_EVALUATION.value, () => {
|
||
this.initPersonInfoData()
|
||
})
|
||
},
|
||
methods: {
|
||
/**
|
||
* 上一步
|
||
*/
|
||
handleLastStep () {
|
||
this.currentStep--
|
||
},
|
||
/**
|
||
* 下一步
|
||
*/
|
||
handleNextStep () {
|
||
let flag = true
|
||
// 第一步,填写流程信息
|
||
if (this.currentStep === 0) {
|
||
this.processInfoForm.validateFields(this.processInfoShowField, (errors, values) => {
|
||
if (errors) {
|
||
flag = false
|
||
}
|
||
})
|
||
}
|
||
// 第二步选择项目
|
||
if (this.currentStep === 1) {
|
||
this.projectDataSource = this.$refs.projectStandardTable.getData()
|
||
if (!this.projectDataSource || this.projectDataSource.length === 0) {
|
||
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
|
||
flag = false
|
||
}
|
||
}
|
||
// 第三步选择标准
|
||
if (this.currentStep === 2) {
|
||
this.standardDataSource = this.$refs.projectStandardTable.getData()
|
||
if (!this.standardDataSource || this.standardDataSource.length === 0) {
|
||
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
|
||
flag = false
|
||
} else {
|
||
// TODO 这块应该需要调接口把标准转成第四步要的条款
|
||
}
|
||
}
|
||
if (!flag) {
|
||
return
|
||
}
|
||
this.currentStep++
|
||
},
|
||
/**
|
||
* 跳转项目详情
|
||
*/
|
||
toProjectDetail (project) {
|
||
this.$router.push({
|
||
path: '/projectLibrary/VehicleItemLibraryDetail',
|
||
query: {
|
||
id: project.id,
|
||
projectName: project.projectName
|
||
}
|
||
})
|
||
},
|
||
/**
|
||
* 跳转标准详情
|
||
*/
|
||
toStandardDetail (standard) {
|
||
// todo 需要标准类别
|
||
console.log(standard)
|
||
},
|
||
/**
|
||
* 批量选择人员
|
||
*/
|
||
batchSelector () {
|
||
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
|
||
this.$message.warning(this.$t('selectOne'))
|
||
return
|
||
}
|
||
this.$refs.userSelectModal.open()
|
||
},
|
||
handleBatchSelectorOk (list) {
|
||
let fieldName
|
||
switch (this.currentNode) {
|
||
// 发起节点,批量选择的是责任单位负责人
|
||
case ProjectComplianceEvaluationProcessNode.initiate.value:
|
||
fieldName = 'user'
|
||
break
|
||
// 各部门主管级领导下发,批量选择的是模块负责人
|
||
case ProjectComplianceEvaluationProcessNode.departLeaderIssued.value:
|
||
fieldName = 'moduleOwner'
|
||
break
|
||
// 模块负责人分发,批量选择的是设计工程师
|
||
case ProjectComplianceEvaluationProcessNode.moduleOwnerIssued.value:
|
||
fieldName = 'designEngineer'
|
||
break
|
||
default:
|
||
break
|
||
}
|
||
if (!fieldName) {
|
||
return
|
||
}
|
||
this.dataSource.forEach((item, index) => {
|
||
if (this.selectedRowKeys.includes(item.id)) {
|
||
item[fieldName] = list.map(tt => tt.id).join(',')
|
||
item[fieldName + '_dictText'] = list.map(tt => tt.realname + '(' + tt.username + ')').join(',')
|
||
this.$set(this.dataSource, index, item)
|
||
}
|
||
})
|
||
this.selectedRowKeys = []
|
||
},
|
||
onSelectChange (selectedRowKeys) {
|
||
this.selectedRowKeys = selectedRowKeys
|
||
},
|
||
/**
|
||
* 选择部门
|
||
* @param value
|
||
* @param record
|
||
* @param index
|
||
*/
|
||
handleDepartChange (value, record, index) {
|
||
record.depart = value
|
||
this.$set(this.dataSource, index, record)
|
||
},
|
||
/**
|
||
* 选择用户
|
||
* @param list
|
||
* @param record
|
||
* @param index
|
||
* @param fieldName
|
||
*/
|
||
handleUserChange (list, record, index, fieldName) {
|
||
record[fieldName] = list.map(tt => tt.id).join(',')
|
||
record[fieldName + '_dictText'] = list.map(tt => tt.realname + '(' + tt.username + ')').join(',')
|
||
this.$set(this.dataSource, index, record)
|
||
},
|
||
handleDelete (id) {
|
||
const index = this.dataSource.findIndex(tt => tt.id === id)
|
||
if (index !== -1) {
|
||
this.$confirm({
|
||
title: this.$t('confirmDeletion'),
|
||
content: this.$t('areYouSure'),
|
||
onOk: () => {
|
||
this.dataSource.splice(index, 1)
|
||
}
|
||
})
|
||
}
|
||
},
|
||
/**
|
||
* 不涉及
|
||
* @param record
|
||
* @param index
|
||
*/
|
||
handleUninvolved (record, index) {
|
||
this.$refs.uninvolvedModal.open(record, index)
|
||
},
|
||
handleUninvolvedOk (record, index) {
|
||
this.$set(this.dataSource, index, record)
|
||
},
|
||
/**
|
||
* 评估反馈修改
|
||
* @param value
|
||
* @param record
|
||
* @param index
|
||
*/
|
||
handleEvaluationFeedBackChange (value, record, index) {
|
||
record.evaluationFeedback = value
|
||
this.$set(this.dataSource, index, record)
|
||
},
|
||
handleSave () {
|
||
},
|
||
handleSubmit () {
|
||
},
|
||
handleTurnTo () {
|
||
|
||
},
|
||
handleAgree () {
|
||
|
||
},
|
||
handleReject () {
|
||
|
||
}
|
||
},
|
||
beforeRouteLeave (to, form, next) {
|
||
// 跳转项目详情就不销毁
|
||
if (to.path !== '/projectLibrary/VehicleItemLibraryDetail') {
|
||
this.$destroy()
|
||
}
|
||
next()
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="less">
|
||
@import '~@assets/less/common.less';
|
||
|
||
/deep/ .ant-steps-item-process > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title {
|
||
color: @primary-color;
|
||
}
|
||
|
||
/deep/ .ant-steps-item-wait > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title {
|
||
color: #4E5969;
|
||
}
|
||
|
||
/deep/ .ant-steps-item-wait .ant-steps-item-icon {
|
||
background: #F2F3F5;
|
||
border-color: transparent;
|
||
}
|
||
|
||
/deep/ .ant-steps-item-wait .ant-steps-item-icon > .ant-steps-icon {
|
||
font-weight: 600;
|
||
color: #4E5969;
|
||
}
|
||
|
||
/deep/ .user-input {
|
||
width: 100% !important;
|
||
}
|
||
|
||
.dispatch-form {
|
||
margin-top: 20px;
|
||
}
|
||
</style> |