528 lines
19 KiB
Vue
528 lines
19 KiB
Vue
<template>
|
|
<div>
|
|
<a-spin :spinning="loading">
|
|
<div class="process-part-title">{{ $t('dispatchInformation') }}</div>
|
|
<div v-if="!disabled" class="table-operator">
|
|
<!-- 批量编辑(解读人填写信息节点) -->
|
|
<a-button type="primary" ghost @click="handleBatchEdit" v-if="isInterpreterFillInfo">
|
|
{{$t('workCenter.standardInterpretationProcess.batchEdit')}}
|
|
</a-button>
|
|
<!-- 导出(标准主解读人汇总节点) -->
|
|
<a-button type="primary" ghost @click="handleExport" v-if="isStandardInterpreterSummary">
|
|
{{$t('export')}}
|
|
</a-button>
|
|
</div>
|
|
<div class="table-container mb-20">
|
|
<j-table
|
|
:can-drag="true"
|
|
:scroll="{x: '100%'}"
|
|
ref="table"
|
|
rowKey="id"
|
|
:columns="showColumns"
|
|
:dataSource="dataSource"
|
|
:pagination="ipagination"
|
|
:row-selection="isCheckNode ? null : { selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
@change="handleTableChange">
|
|
<!--条文内容-->
|
|
<template slot="item_content" slot-scope="{text, record}">
|
|
<div class="table-text" style="cursor: pointer" v-if="text || text === 0" @click="showContent('item_content', text,record)">
|
|
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
|
|
</div>
|
|
<div class="table-text" v-else>{{ global.emptyLine }}</div>
|
|
</template>
|
|
<template v-slot:action="{text, record}">
|
|
<a @click="handleEdit(record)" class="table-ope-btn">{{ $t('edit') }}</a>
|
|
</template>
|
|
</j-table>
|
|
</div>
|
|
<a-form :form="form" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="isStandardInterpreterSummary">
|
|
<a-row>
|
|
<a-col :span="8">
|
|
<a-form-item :label="$t('workCenter.standardInterpretationProcess.mainInterpreter')" :colon="false">
|
|
<!--会签人员-->
|
|
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.standardInterpretationProcess.countersigningPerson')"
|
|
v-decorator="['countersignPersonIds', validatorRules.countersignPersonIds]"
|
|
:disabled="disabled"
|
|
filedName="countersignPersonIds"
|
|
@nameChange="userSelectNameChange"
|
|
:nameStr="formInline.countersignPersonIds_dictText" />
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-form-item :label="$t('workCenter.standardInterpretationProcess.mainInterpreter')" :colon="false">
|
|
<!--审核人员-->
|
|
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.standardInterpretationProcess.reviewersPerson')"
|
|
v-decorator="['uploader', validatorRules.uploader]"
|
|
:disabled="disabled"
|
|
filedName="uploader"
|
|
@nameChange="userSelectNameChange"
|
|
:nameStr="formInline.uploader_dictText" />
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-form-item :label="$t('workCenter.standardInterpretationProcess.mainInterpreter')" :colon="false">
|
|
<!--批准人员-->
|
|
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.standardInterpretationProcess.approvedPerson')"
|
|
v-decorator="['approvePersonId', validatorRules.approvePersonId]"
|
|
:disabled="disabled"
|
|
filedName="approvePersonId"
|
|
@nameChange="userSelectNameChange"
|
|
:nameStr="formInline.approvePersonId_dictText" />
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-row>
|
|
</a-form>
|
|
</a-spin>
|
|
<!-- 条款解读表单 -->
|
|
<terms-interpret-modal ref="termsInterpretModal" @ok="handleEditCallback"/>
|
|
<!--条文内容-->
|
|
<split-clause-detail ref="splitClauseDetail" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import TermsInterpretModal from '@views/workCenter/standardInterpretationProcess/modules/TermsInterpretModal'
|
|
import UserSelection from '@comp/selection/UserSelection'
|
|
import SplitClauseDetail from '@views/documentTool/documentSplit/modules/SplitClauseDetail'
|
|
import { filterObj } from '@/utils/util'
|
|
import { StandardInterpretationNodes } from '@/enums/commonEnums'
|
|
export default {
|
|
name: 'InterpretationInterpreterFillInfo',
|
|
components: { SplitClauseDetail, UserSelection, TermsInterpretModal },
|
|
props: {
|
|
disabled: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false
|
|
},
|
|
// 当前节点id
|
|
currentNodeId: {
|
|
type: String,
|
|
required: true
|
|
}
|
|
},
|
|
computed: {
|
|
// 解读人填写信息节点
|
|
isInterpreterFillInfo () {
|
|
return this.currentNodeId === StandardInterpretationNodes.interpreterFillInfo.value
|
|
},
|
|
// 是否解读人汇总
|
|
isStandardInterpreterSummary () {
|
|
return this.currentNodeId === StandardInterpretationNodes.standardInterpreterSummary.value
|
|
},
|
|
// 是否审核节点
|
|
isCheckNode () {
|
|
const checkNodeArr = [
|
|
StandardInterpretationNodes.mainInterpreterSingleLineReview.value, // 标准主解读人单线审核
|
|
StandardInterpretationNodes.countersignOne.value, // 会签
|
|
StandardInterpretationNodes.countersignTwo.value, // 会签
|
|
StandardInterpretationNodes.departManagerReviewOne.value, // 各涉及部门科室经理审核
|
|
StandardInterpretationNodes.departManagerReviewTwo.value, // 各涉及部门科室经理审核
|
|
StandardInterpretationNodes.manageOrTechnicalOfficerApprovalOne.value, // 主控部门高级经理/法规认证技术官批准
|
|
StandardInterpretationNodes.manageOrTechnicalOfficerApprovalTwo.value // 主控部门高级经理/法规认证技术官批准
|
|
]
|
|
return checkNodeArr.includes(this.currentNodeId)
|
|
},
|
|
// 最终显示的表头
|
|
showColumns () {
|
|
// 审批节点不显示操作列
|
|
if (this.isCheckNode) {
|
|
return this.columns.slice(0, this.columns.length - 1)
|
|
}
|
|
return this.columns
|
|
},
|
|
},
|
|
data () {
|
|
return {
|
|
StandardInterpretationNodes,
|
|
form: this.$form.createForm(this),
|
|
labelCol: {
|
|
xs: { span: 24 },
|
|
sm: { span: 6 }
|
|
},
|
|
wrapperCol: {
|
|
xs: { span: 24 },
|
|
sm: { span: 16 }
|
|
},
|
|
loading: false,
|
|
// 条款解读表格
|
|
columns: [
|
|
{ // 标准编号/条款号
|
|
title: this.$t('standardNumber') + '/' + this.$t('clauseNo'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'itemNum',
|
|
fixed: 'left',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 标准名称/条款标题
|
|
title: this.$t('standardName') + '/' + this.$t('clauseTitle'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'itemTitle',
|
|
fixed: 'left',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 条款内容
|
|
title: this.$t('clauseContent'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'itemContent',
|
|
scopedSlots: { customRender: 'item_content' }
|
|
},
|
|
{ // 译文
|
|
title: this.$t('workCenter.standardInterpretationProcess.translation'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'translation',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 是否与上一版相同
|
|
title: this.$t('workCenter.standardInterpretationProcess.sameAsPreviousVersion'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'isSameAsPrevVersion_dictText',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 相对上一版变化点说明
|
|
title: this.$t('workCenter.standardInterpretationProcess.explanationOfChangePoints'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'changeDescription',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 法规注解
|
|
title: this.$t('workCenter.standardInterpretationProcess.regulatoryAnnotations'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'regulatoryNotes',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 涉及系统/部件
|
|
title: this.$t('workCenter.standardInterpretationProcess.involvingSystemsComponents'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'keywords',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 关键控制器
|
|
title: this.$t('workCenter.standardInterpretationProcess.keyController'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'keyController',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 责任部门
|
|
title: this.$t('workCenter.standardInterpretationProcess.responsibleDepartment'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'responsibleDepartment',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 责任部门专业模块
|
|
title: this.$t('workCenter.standardInterpretationProcess.responsibleDepartmentModule'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'responsibleModule',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 关联部门
|
|
title: this.$t('workCenter.standardInterpretationProcess.relatedDepartments'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'relatedDepartment',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 关联部门专业模块
|
|
title: this.$t('workCenter.standardInterpretationProcess.relatedDepartmentsModule'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'relatedModule',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 适用车型
|
|
title: this.$t('workCenter.standardInterpretationProcess.applications'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'applications',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 动力类型
|
|
title: this.$t('workCenter.standardInterpretationProcess.powerType'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'powerType',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 专业领域
|
|
title: this.$t('workCenter.standardInterpretationProcess.professionalField'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'domainArea',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 配置需求
|
|
title: this.$t('workCenter.standardInterpretationProcess.configurationRequirements'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'configurationRequirements',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 新认证车实施日期
|
|
title: this.$t('workCenter.standardInterpretationProcess.newCertificationImplementationDate'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'newCerImplementDate',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 新生产车实施日期
|
|
title: this.$t('workCenter.standardInterpretationProcess.newProduceImplementationDate'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'newProductionImplementation',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 注册日期
|
|
title: this.$t('workCenter.standardInterpretationProcess.registrationDate'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'registrationDate',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 企业标准
|
|
title: this.$t('workCenter.standardInterpretationProcess.enterpriseStandards'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'enterpriseStandard',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 技术规范/设计指南
|
|
title: this.$t('workCenter.standardInterpretationProcess.technicalSpecificationsDesignGuidelines'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'technicalSpecificationDesignGuide',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 图纸模板
|
|
title: this.$t('workCenter.standardInterpretationProcess.drawingTemplate'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'drawingTemplate',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 技术协议模板
|
|
title: this.$t('workCenter.standardInterpretationProcess.technicalAgreementTemplate'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'technicalAgreementTemplate',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 校核报告模板/checklist
|
|
title: this.$t('workCenter.standardInterpretationProcess.verificationReportTemplate'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'verificationReportTemplateChecklist',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // DVP模板
|
|
title: this.$t('workCenter.standardInterpretationProcess.dvpTemplate'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'dvpTemplate',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // DFEMA
|
|
title: this.$t('workCenter.standardInterpretationProcess.dfema'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'dfema',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 特殊性清单模板 = 关键技术分解表
|
|
title: this.$t('workCenter.standardInterpretationProcess.specialListTemplate'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'keyTechnologyDecompositionTable',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 其他文件或模板
|
|
title: this.$t('workCenter.standardInterpretationProcess.otherFilesOrTemplates'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'otherDocumentsTemplates',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 排查阶段
|
|
title: this.$t('workCenter.standardInterpretationProcess.investigationStage'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'investigationStage',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // P3证明符合性的交付物名称
|
|
title: this.$t('workCenter.standardInterpretationProcess.pThree'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'p3',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // P5证明符合性的交付物名称
|
|
title: this.$t('workCenter.standardInterpretationProcess.pFive'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'p5',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 备注
|
|
title: this.$t('workCenter.standardInterpretationProcess.notes'),
|
|
align: 'center',
|
|
width: 180,
|
|
dataIndex: 'remarks',
|
|
scopedSlots: { customRender: 'text' }
|
|
},
|
|
{ // 操作
|
|
title: this.$t('operation'),
|
|
fixed: 'right',
|
|
width: 150,
|
|
scopedSlots: { customRender: 'action' }
|
|
}
|
|
],
|
|
dataSource: [],
|
|
/* 分页参数 */
|
|
ipagination: {
|
|
current: 1,
|
|
pageSize: 50,
|
|
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
|
|
showTotal: (total, range) => {
|
|
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
|
|
},
|
|
showQuickJumper: true,
|
|
showSizeChanger: true,
|
|
total: 0
|
|
},
|
|
selectedRowKeys: [],
|
|
selectedRows: [],
|
|
formInline: {},
|
|
validatorRules: {
|
|
// 会签人员
|
|
countersignPersonIds: {
|
|
rules: [
|
|
{ required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.standardInterpretationProcess.countersigningPerson') }
|
|
],
|
|
validateTrigger: 'change'
|
|
},
|
|
// 审核人员
|
|
uploader: {
|
|
rules: [
|
|
{ required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.standardInterpretationProcess.reviewersPerson') }
|
|
],
|
|
validateTrigger: 'change'
|
|
},
|
|
// 批准人员
|
|
approvePersonId: {
|
|
rules: [
|
|
{ required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.standardInterpretationProcess.approvedPerson') }
|
|
],
|
|
validateTrigger: 'change'
|
|
}
|
|
},
|
|
}
|
|
},
|
|
methods: {
|
|
/**
|
|
* 获取组件内的数据
|
|
* @param isValidate - 是否需要校验
|
|
*/
|
|
async getData (isValidate) {
|
|
const obj = {}
|
|
if (isValidate) {
|
|
// 汇总节点,处理表单
|
|
if (this.isStandardInterpreterSummary) {
|
|
obj.formData = await new Promise((resolve) => {
|
|
this.form.validateFields((err, values) => {
|
|
if (err) { obj._flag = true }
|
|
// 校验成功失败都返回表单数据
|
|
resolve(values)
|
|
})
|
|
})
|
|
}
|
|
} else {
|
|
obj.formData = this.form.getFieldsValue()
|
|
}
|
|
obj.clauseInterpretData = this.dataSource
|
|
return obj
|
|
},
|
|
// 更新组件内的数据
|
|
setData (data) {
|
|
console.log(data)
|
|
// 汇总节点,回显表单
|
|
if (this.isStandardInterpreterSummary) {
|
|
this.formInline = data.data.processStandardInterpret
|
|
this.form.setFieldsValue(this.formInline)
|
|
}
|
|
this.dataSource = data.data.processStandardInterpretClauseSublistList || []
|
|
},
|
|
handleEdit (record) {
|
|
this.$refs.termsInterpretModal.title = this.$t('workCenter.standardInterpretationProcess.batchEdit')
|
|
this.$refs.termsInterpretModal.edit(record)
|
|
},
|
|
// 批量编辑
|
|
handleBatchEdit () {
|
|
// 至少勾选一条数据
|
|
if (!this.selectedRowKeys.length) {
|
|
this.$message.warning(this.$t('selectARecord'))
|
|
return
|
|
}
|
|
this.$refs.termsInterpretModal.add()
|
|
},
|
|
// 表格编辑的回调函数
|
|
handleEditCallback (formData) {
|
|
console.log('编辑', formData)
|
|
// 如果有id就是编辑,否则是批量编辑
|
|
if (formData.id) {
|
|
const row = this.dataSource.find(item => item.id === formData.id)
|
|
Object.assign(row, filterObj(formData))
|
|
} else {
|
|
this.selectedRows.forEach(item => {
|
|
Object.assign(item, filterObj(formData))
|
|
})
|
|
}
|
|
},
|
|
handleTableChange (pagination) {
|
|
this.ipagination = pagination
|
|
},
|
|
/**
|
|
* 显示条款内容、条文解读弹框
|
|
* @param fieldName
|
|
* @param val
|
|
*/
|
|
showContent (fieldName, val) {
|
|
const title = (this.columns.find(tt => tt.dbFieldName === fieldName) || {}).dbFieldTxt
|
|
if (title) {
|
|
this.$refs.splitClauseDetail.title = title
|
|
}
|
|
this.$refs.splitClauseDetail.open(val)
|
|
},
|
|
// 表格选择改变
|
|
onSelectChange (value, row) {
|
|
this.selectedRowKeys = value
|
|
this.selectedRows = row
|
|
},
|
|
// 导出
|
|
handleExport () {
|
|
|
|
},
|
|
// 选择用户回显用户名
|
|
userSelectNameChange (value, fieldName) {
|
|
this.formInline[fieldName + '_dictText'] = value
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.mb-20 {
|
|
margin-bottom: 20px;
|
|
}
|
|
</style>
|