<template>
|
<j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading"
|
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" fullscreen @ok="handleOk"
|
@cancel="handleCancel" centered cancelText="关闭">
|
<a-spin :spinning="spinning">
|
<a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-row id="outer-row" :gutter="24">
|
|
<!--左侧基础信息列-->
|
<a-col :span="8" class="scroll-col">
|
<a-tabs>
|
<a-tab-pane tab="基础信息">
|
<a-row>
|
<a-col :span="12">
|
<a-form-model-item label="工单号">
|
<a-input v-model="model.orderNum" readOnly/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item label="统一编码">
|
<technical-status-equipment-select v-model="model.equipmentId"
|
@autocompleteForm="autocompleteForm" disabled/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
|
<a-row>
|
<a-col :span="12">
|
<a-form-model-item label="计划鉴定日期">
|
<a-input v-model="model.evaluationDate" readOnly/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item label="领取人">
|
<a-input v-model="model.evaluator_dictText" readOnly/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
|
<a-row>
|
<a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" label="备注">
|
<a-textarea v-model="model.remark" readOnly/>
|
</a-form-model-item>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
</a-col>
|
|
<!-- 中间明细项列-->
|
<a-col
|
:span="model.evaluationStatus&&model.evaluationStatus!='UNDER_EVALUATION'&&model.evaluationStatus!='WAIT_EVALUATION'?10:16"
|
class="scroll-col">
|
|
<a-tabs :active-key="activeTabKey" @change="handleTabChange">
|
<a-tab-pane :key="1" tab="安全装置检查" forceRender
|
v-if="disableSubmit||
|
selectShenpiData.taskDefKey&&(selectShenpiData.taskDefKey=='safety_equipment_check'||selectShenpiData.taskDefKey=='safety_equipment_check_confirm')||
|
model.evaluationStatus&&model.evaluationStatus!='UNDER_EVALUATION'&&detail.safetyEquipmentCheckList.length>0">
|
<j-vxe-table ref="editableDetailTable1" rowNumber bordered alwaysEdit keep-source :height="300"
|
:dataSource="detail.safetyEquipmentCheckList"
|
:columns="detail.safetyEquipmentCheckColumns">
|
<template v-slot:safetyEquipmentCheckResult="props">
|
<j-dict-select-tag v-model="props.row.safetyEquipmentCheckResult"
|
placeholder="请选择检查结果"
|
:disabled="disableSubmit||
|
model.evaluationStatus!='UNDER_EVALUATION'||
|
selectShenpiData.taskDefKey=='safety_equipment_check_confirm'"
|
@change="$refs['editableDetailTable'+activeTabKey].validateTable()"
|
dictCode="yes_no_none" style="width: 100%"/>
|
</template>
|
</j-vxe-table>
|
|
<a-tabs v-if="model.safetyCheckCompleted">
|
<a-tab-pane tab="维修室主任确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="safetyCheckConfirmResult" :labelCol="labelColLong"
|
:wrapperCol="wrapperColLong" label="确认类型">
|
<j-dict-select-tag type='radio' v-model='model.safetyCheckConfirmResult'
|
:disabled="disableSubmit||selectShenpiData.taskDefKey!='safety_equipment_check_confirm'"
|
dictCode='approved_rejected'/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" label="确认意见">
|
<a-textarea placeholder="请输入意见" v-model="model.safetyCheckConfirmComment"
|
:disabled="disableSubmit||selectShenpiData.taskDefKey!='safety_equipment_check_confirm'"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
</a-tab-pane>
|
|
<a-tab-pane :key="2" tab="设备精度检查" forceRender
|
v-if="disableSubmit||
|
selectShenpiData.taskDefKey&&(selectShenpiData.taskDefKey=='equipment_precision_check'||selectShenpiData.taskDefKey=='equipment_precision_check_confirm')||
|
model.evaluationStatus&&model.evaluationStatus!='UNDER_EVALUATION'&&detail.precisionCheckList.length>0">
|
<j-vxe-table ref="editableDetailTable2" rowNumber bordered
|
alwaysEdit keep-source :height="300"
|
:dataSource="detail.precisionCheckList" :columns="detail.precisionCheckColumns">
|
<template v-slot:precisionCheckResult="props">
|
<a-input-number v-model="props.row.precisionCheckResult"
|
:disabled="disableSubmit||
|
model.evaluationStatus!='UNDER_EVALUATION'||
|
selectShenpiData.taskDefKey=='equipment_precision_check_confirm'"
|
@blur="$refs['editableDetailTable'+activeTabKey].validateTable()"
|
placeholder="请输入检查结果" style="width: 100%"/>
|
</template>
|
</j-vxe-table>
|
|
<a-tabs v-if="model.precisionCheckCompleted">
|
<a-tab-pane tab="维修室主任确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="precisionCheckConfirmResult" :labelCol="labelColLong"
|
:wrapperCol="wrapperColLong" label="确认类型">
|
<j-dict-select-tag type='radio' v-model='model.precisionCheckConfirmResult'
|
:disabled="disableSubmit||selectShenpiData.taskDefKey!='equipment_precision_check_confirm'"
|
dictCode='approved_rejected'/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" label="确认意见">
|
<a-textarea placeholder="请输入意见" v-model="model.precisionCheckConfirmComment"
|
:disabled="disableSubmit||selectShenpiData.taskDefKey!='equipment_precision_check_confirm'"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
</a-tab-pane>
|
|
<a-tab-pane :key="3" tab="其他检查" forceRender
|
v-if="disableSubmit||
|
selectShenpiData.taskDefKey&&(selectShenpiData.taskDefKey=='other_check'||selectShenpiData.taskDefKey=='other_check_confirm')||
|
model.evaluationStatus&&model.evaluationStatus!='UNDER_EVALUATION'&&detail.otherCheckList.length>0">
|
<j-vxe-table ref="editableDetailTable3" rowNumber bordered
|
alwaysEdit keep-source :height="300"
|
:dataSource="detail.otherCheckList" :columns="detail.otherCheckColumns">
|
<template v-slot:otherCheckResult="props">
|
<a-textarea v-model="props.row.otherCheckResult" :rows="1"
|
:disabled="disableSubmit||model.evaluationStatus!='UNDER_EVALUATION'||selectShenpiData.taskDefKey=='other_check_confirm'"
|
@blur="$refs['editableDetailTable'+activeTabKey].validateTable()"
|
placeholder="请输入检查结果"
|
:autoSize="false"/>
|
</template>
|
</j-vxe-table>
|
|
<a-tabs v-if="model.otherCheckCompleted">
|
<a-tab-pane tab="维修室主任确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="otherCheckConfirmResult" :labelCol="labelColLong"
|
:wrapperCol="wrapperColLong" label="确认类型">
|
<j-dict-select-tag type='radio' v-model='model.otherCheckConfirmResult'
|
dictCode='approved_rejected'
|
:disabled="disableSubmit||selectShenpiData.taskDefKey!='other_check_confirm'"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" label="确认意见">
|
<a-textarea placeholder="请输入意见" v-model="model.otherCheckConfirmComment"
|
:disabled="disableSubmit||selectShenpiData.taskDefKey!='other_check_confirm'"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
</a-tab-pane>
|
|
<template v-if="selectShenpiData.procInstId">
|
<a-tab-pane key='4' tab='流程图'>
|
<img :src="imageSrc" alt="Fetched Image" style="width: 100%"/>
|
</a-tab-pane>
|
</template>
|
</a-tabs>
|
</a-col>
|
|
<!--右侧审批列-->
|
<a-col :span="6" class="scroll-col"
|
v-if="model.evaluationStatus&&model.evaluationStatus!='UNDER_EVALUATION'&&model.evaluationStatus!='WAIT_EVALUATION'">
|
<a-tabs v-if="displayRepairerFlag">
|
<a-tab-pane tab="维修工确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="safetyEquipmentCheckResult" label="安全装置是否齐全" :labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type='radio' v-model='model.safetyEquipmentCheckResult' dictCode='yn'
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='REPAIRER_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item prop="precisionCheckResult" label="设备功能是否齐全" :labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type='radio' v-model='model.precisionCheckResult' dictCode='yn'
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='REPAIRER_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item prop="functionalCheckResult" label="精度是否达到要求" :labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type='radio' v-model='model.functionalCheckResult' dictCode='yes_no_none'
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='REPAIRER_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item prop="otherCheckResult" label="其他检查是否合格" :labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type='radio' v-model='model.otherCheckResult' dictCode='yes_no_none'
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='REPAIRER_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
|
<a-tabs v-if="displayRepairLeaderFlag">
|
<a-tab-pane tab="维修室主任确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="repairManagerSignatureResult" label="确认类型" :labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type='radio' v-model='model.repairManagerSignatureResult'
|
dictCode='approved_rejected'
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='REPAIR_MANAGER_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="确认意见" :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol">
|
<a-textarea placeholder="请输入意见" v-model="model.repairManagerComment"
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='REPAIR_MANAGER_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
|
<a-tabs v-if="displayTechnicianFlag">
|
<a-tab-pane tab="工艺员确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="sampleCheckResult" label="试件检查结果" :labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type='radio' v-model='model.sampleCheckResult' dictCode='yn'
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='PROCESS_TECHNICIAN_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="确认意见" :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol">
|
<a-textarea placeholder="请输入意见" v-model="model.processTechnicianComment"
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='PROCESS_TECHNICIAN_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
|
<a-tabs v-if="displayTechnicalLeaderFlag">
|
<a-tab-pane tab="使用单位技术主管确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="departTechnicalLeaderSignatureResult" label="确认类型"
|
:labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type='radio' v-model='model.departTechnicalLeaderSignatureResult'
|
dictCode='approved_rejected'
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='DEPART_TECHNICAL_LEADER_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="确认意见" :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol">
|
<a-textarea placeholder="请输入意见" v-model="model.departTechnicalLeaderComment"
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='DEPART_TECHNICAL_LEADER_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
|
<a-tabs v-if="displayInspectorFlag">
|
<a-tab-pane tab="设备检验员确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="evaluationResult" label="鉴定结果" :labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type='radio' v-model='model.evaluationResult'
|
dictCode='equipment_technology_status' @change="handleEvaluationResultChange"
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='INSPECTOR_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item prop="evaluationReason"
|
v-if="model.evaluationResult&&model.evaluationResult!='QUALIFIED'" label="限/禁用原因"
|
:labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol">
|
<j-select-multiple v-model='model.evaluationReason'
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='INSPECTOR_SIGNING')"
|
dictCode='technical_status_evaluation_result_reason' placeholder="请选择限/禁用原因"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="确认意见" :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol">
|
<a-textarea placeholder="请输入意见" v-model="model.inspectorComment"
|
:disabled="disableSubmit||(model.evaluationStatus&&model.evaluationStatus!='INSPECTOR_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
</a-col>
|
</a-row>
|
</a-form-model>
|
</a-spin>
|
</j-modal>
|
</template>
|
|
<script>
|
import { downFile, getAction, httpAction } from '@/api/manage'
|
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
|
import { JVXETypes } from '@comp/jeecg/JVxeTable'
|
import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect'
|
import TechnicalStatusEquipmentSelect from '../../../eam/equipment/modules/TechnicalStatusEquipmentSelect'
|
|
export default {
|
name: 'TechnicalStatusEvaluationApprovalModal',
|
mixins: [JVxeTableModelMixin],
|
components: {
|
TechnicalStatusEquipmentSelect,
|
MaintenanceEquipmentSelect
|
},
|
props: {
|
selectShenpiData: {
|
type: Object
|
}
|
},
|
data() {
|
return {
|
title: '操作',
|
visible: false,
|
model: {},
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 8 }
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 16 }
|
},
|
labelColLong: {
|
xs: { span: 24 },
|
sm: { span: 4 }
|
},
|
wrapperColLong: {
|
xs: { span: 24 },
|
sm: { span: 20 }
|
},
|
rightColLabelCol: {
|
xs: { span: 24 },
|
sm: { span: 9 }
|
},
|
rightColWrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 15 }
|
},
|
confirmLoading: false,
|
spinning: false,
|
imageSrc: null,
|
activeTabKey: 1,
|
validatorRules: {
|
safetyCheckConfirmResult: [{ required: true, message: '请选择确认类型' }],
|
precisionCheckConfirmResult: [{ required: true, message: '请选择确认类型' }],
|
otherCheckConfirmResult: [{ required: true, message: '请选择确认类型' }],
|
safetyEquipmentCheckResult: [{ required: true, message: '请选择安全装置是否齐全' }],
|
precisionCheckResult: [{ required: true, message: '请选择设备功能是否齐全' }],
|
functionalCheckResult: [{ required: true, message: '请选择精度是否达到要求' }],
|
otherCheckResult: [{ required: true, message: '请选择其他检查是否合格' }],
|
repairManagerSignatureResult: [{ required: true, message: '请选择确认类型' }],
|
sampleCheckResult: [{ required: true, message: '请选择试件检查结果' }],
|
departTechnicalLeaderSignatureResult: [{ required: true, message: '请选择确认类型' }],
|
evaluationResult: [{ required: true, message: '请选择鉴定结果' }],
|
evaluationReason: [{ required: true, message: '请选择限/禁用原因' }]
|
},
|
url: {
|
queryById: '/eam/eamTechnicalStatusEvaluationOrder/queryById',
|
detail: '/eam/eamTechnicalStatusEvaluationOrderDetail/queryList',
|
approval: '/eam/eamTechnicalStatusEvaluationOrder/approval',
|
diagramView: '/assign/flow/diagramView'
|
},
|
disableSubmit: false,
|
selectedRowKeys: [],
|
detail: {
|
safetyEquipmentCheckList: [],
|
precisionCheckList: [],
|
otherCheckList: [],
|
safetyEquipmentCheckColumns: [
|
{
|
title: 'ID',
|
key: 'id',
|
type: JVXETypes.hidden
|
},
|
{
|
title: 'standardId',
|
key: 'standardId',
|
type: JVXETypes.hidden
|
},
|
{
|
title: '序号',
|
key: 'itemCode',
|
type: JVXETypes.normal,
|
align: 'center',
|
width: 60
|
},
|
{
|
title: '检查项目',
|
key: 'itemName',
|
type: JVXETypes.normal,
|
align: 'center'
|
},
|
{
|
title: '检查结果',
|
key: 'safetyEquipmentCheckResult',
|
type: JVXETypes.slot,
|
slotName: 'safetyEquipmentCheckResult',
|
validateRules: [{ handler: this.customValidate }],
|
align: 'center'
|
}
|
],
|
precisionCheckColumns: [
|
{
|
title: 'ID',
|
key: 'id',
|
type: JVXETypes.hidden
|
},
|
{
|
title: 'standardId',
|
key: 'standardId',
|
type: JVXETypes.hidden
|
},
|
{
|
title: '序号',
|
key: 'itemCode',
|
type: JVXETypes.normal,
|
align: 'center',
|
width: 60
|
},
|
{
|
title: '检查项目',
|
key: 'itemName',
|
type: JVXETypes.normal,
|
align: 'center'
|
},
|
{
|
title: '检查子项目',
|
key: 'subItemName',
|
type: JVXETypes.normal,
|
align: 'center'
|
},
|
{
|
title: '允差值',
|
key: 'toleranceValue',
|
type: JVXETypes.normal,
|
align: 'center'
|
},
|
{
|
title: '检查结果',
|
key: 'precisionCheckResult',
|
type: JVXETypes.slot,
|
slotName: 'precisionCheckResult',
|
align: 'center',
|
validateRules: [{ handler: this.customValidate }]
|
}
|
],
|
otherCheckColumns: [
|
{
|
title: 'ID',
|
key: 'id',
|
type: JVXETypes.hidden
|
},
|
{
|
title: 'standardId',
|
key: 'standardId',
|
type: JVXETypes.hidden
|
},
|
{
|
title: '序号',
|
key: 'itemCode',
|
type: JVXETypes.normal,
|
align: 'center',
|
width: 60
|
},
|
{
|
title: '检查项目',
|
key: 'itemName',
|
type: JVXETypes.normal,
|
align: 'center'
|
},
|
{
|
title: '检查结果',
|
key: 'otherCheckResult',
|
type: JVXETypes.slot,
|
slotName: 'otherCheckResult',
|
align: 'center',
|
validateRules: [{ handler: this.customValidate }]
|
}
|
]
|
}
|
}
|
},
|
computed: {
|
displayRepairerFlag() {
|
return this.model.evaluationStatus && ['REPAIRER_SIGNING', 'REPAIR_MANAGER_SIGNING', 'PROCESS_TECHNICIAN_SIGNING', 'DEPART_TECHNICAL_LEADER_SIGNING', 'INSPECTOR_SIGNING', 'COMPLETED'].includes(this.model.evaluationStatus)
|
},
|
displayRepairLeaderFlag() {
|
return this.model.evaluationStatus && ['REPAIR_MANAGER_SIGNING', 'PROCESS_TECHNICIAN_SIGNING', 'DEPART_TECHNICAL_LEADER_SIGNING', 'INSPECTOR_SIGNING', 'COMPLETED'].includes(this.model.evaluationStatus)
|
},
|
displayTechnicianFlag() {
|
return this.model.evaluationStatus && ['PROCESS_TECHNICIAN_SIGNING', 'DEPART_TECHNICAL_LEADER_SIGNING', 'INSPECTOR_SIGNING', 'COMPLETED'].includes(this.model.evaluationStatus)
|
},
|
displayTechnicalLeaderFlag() {
|
return this.model.evaluationStatus && ['DEPART_TECHNICAL_LEADER_SIGNING', 'INSPECTOR_SIGNING', 'COMPLETED'].includes(this.model.evaluationStatus)
|
},
|
displayInspectorFlag() {
|
return this.model.evaluationStatus && ['INSPECTOR_SIGNING', 'COMPLETED'].includes(this.model.evaluationStatus)
|
}
|
},
|
methods: {
|
/**
|
* 主页面点击执行审批时触发
|
* @param record 主页面列表行记录
|
*/
|
async handleDetail(record) {
|
this.model = {}
|
this.visible = true
|
this.detail.safetyEquipmentCheckList = this.detail.precisionCheckList = this.detail.otherCheckList = []
|
this.handleTabToFirstTable()
|
this.getBasicInformationByApi(record)
|
this.getFlowChartImageByApi(record)
|
},
|
|
/**
|
* 主页面点击详情时触发
|
* @param record 主页面列表行记录
|
*/
|
recordDetail(record) {
|
this.visible = true
|
this.detail.safetyEquipmentCheckList = this.detail.precisionCheckList = this.detail.otherCheckList = []
|
this.model = Object.assign({}, record)
|
this.handleTabToFirstTable()
|
this.loadDetail(record.id)
|
},
|
|
/**
|
* 获取基础信息
|
* @param record 主页面列表行记录
|
*/
|
getBasicInformationByApi(record) {
|
this.spinning = true
|
const that = this
|
getAction(this.url.queryById, { id: record.dataId })
|
.then(res => {
|
if (res.success) {
|
that.model = Object.assign({}, res.result)
|
that.model.dataId = record.dataId
|
that.model.taskId = record.id
|
that.model.userId = record.assignee
|
that.model.instanceId = record.procInstId
|
}
|
else {
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
})
|
}
|
})
|
.finally(() => {
|
this.loadDetail(record.dataId)
|
})
|
|
},
|
|
/**
|
* 获取流程图
|
* @param record 主页面列表行记录
|
*/
|
getFlowChartImageByApi(record) {
|
const { processDefinitionId, processInstanceId, processDefinitionKey } = record
|
|
downFile(this.url.diagramView, {
|
processDefinitionId,
|
processInstanceId,
|
TaskDefinitionKey: processDefinitionKey
|
}, 'get')
|
.then((res => {
|
this.imageSrc = window.URL.createObjectURL(new Blob([res]))
|
}))
|
.catch(err => {
|
this.$notification.error({
|
message: '消息',
|
description: err.message
|
})
|
})
|
},
|
|
async handleOk() {
|
const that = this
|
|
let errMap
|
if (that.$refs['editableDetailTable' + this.activeTabKey]) {
|
// 校验当前tab表格
|
errMap = await that.$refs['editableDetailTable' + this.activeTabKey].validateTable()
|
} else {
|
// 当前tab不是表格时则校验有表格的
|
for (let index = 1; index <= 3; index++) {
|
if (that.$refs['editableDetailTable' + index]) {
|
errMap = await that.$refs['editableDetailTable' + index].validateTable()
|
if (errMap) {
|
that.activeTabKey = index
|
that.$refs['editableDetailTable' + this.activeTabKey].clearValidate()
|
that.$notification.warning({
|
message: '消息',
|
description: '检查结果不能为空'
|
})
|
break
|
}
|
}
|
}
|
}
|
if (errMap) return
|
|
|
// 触发表单验证
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
that.confirmLoading = that.spinning = true
|
|
// 仅在鉴定中状态传递表格列表
|
if (this.model.evaluationStatus == 'UNDER_EVALUATION') {
|
for (let index = 1; index <= 3; index++) {
|
if (that.$refs['editableDetailTable' + index]) {
|
this.model.tableDetailList = that.$refs['editableDetailTable' + index].getTableData()
|
break
|
}
|
}
|
}
|
|
httpAction(this.url.approval, this.model, 'put')
|
.then((res) => {
|
if (res.success) {
|
that.$notification.success({
|
message: '消息',
|
description: res.message
|
})
|
that.$emit('modalFormOk')
|
that.close()
|
} else {
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
})
|
}
|
})
|
.finally(() => {
|
that.confirmLoading = that.spinning = false
|
})
|
} else {
|
return false
|
}
|
})
|
},
|
|
autocompleteForm(selectObj) {
|
this.$set(this.model, 'standardName', selectObj.standardName)
|
this.$set(this.model, 'standardId', selectObj.id)
|
this.$set(this.model, 'equipmentId', selectObj.equipmentId)
|
},
|
|
//规范选择变化
|
loadDetail(orderId) {
|
this.spinning = true
|
getAction(this.url.detail, { orderId })
|
.then(res => {
|
if (res.success) {
|
this.detail.safetyEquipmentCheckList = res.result.filter(item => item.checkCategory == 'SAFETY_EQUIPMENT_CHECK')
|
this.detail.precisionCheckList = res.result.filter(item => item.checkCategory == 'PRECISION_CHECK')
|
this.detail.otherCheckList = res.result.filter(item => item.checkCategory == 'OTHER_CHECK')
|
this.handleTabToFirstTable()
|
}
|
})
|
.finally(() => {
|
this.spinning = false
|
})
|
},
|
|
// 切换tab至第一个表格
|
handleTabToFirstTable() {
|
this.$nextTick(() => {
|
for (let index = 1; index <= 3; index++) {
|
if (this.$refs['editableDetailTable' + index]) {
|
console.log('index----------', index)
|
this.activeTabKey = index
|
break
|
}
|
}
|
})
|
},
|
|
/**
|
* 检查明细标签切换时触发
|
* @param tabKey 切换后的tabKey
|
*/
|
handleTabChange(tabKey) {
|
if (this.$refs['editableDetailTable' + this.activeTabKey]) this.$refs['editableDetailTable' + this.activeTabKey].clearValidate()
|
this.activeTabKey = tabKey
|
},
|
|
handleEvaluationResultChange(value) {
|
if (value == 'QUALIFIED') this.model.evaluationReason = ''
|
},
|
|
/**
|
* 自定义表格单元格校验
|
* @param cellValue 单元格值
|
* @param callback 结果回调函数
|
*/
|
customValidate({ cellValue }, callback) {
|
if (cellValue) {
|
callback(true)
|
} else {
|
callback(false, '${title}不能为空')
|
}
|
},
|
|
handleCancel() {
|
this.close()
|
},
|
|
close() {
|
this.$emit('close')
|
this.visible = false
|
this.$refs.form.clearValidate()
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="less">
|
/deep/ .ant-select-dropdown-menu {
|
text-align: left;
|
}
|
|
/deep/ .ant-spin-nested-loading {
|
height: 100%;
|
|
.ant-spin-container {
|
height: 100%;
|
|
.ant-form {
|
height: 100%;
|
|
#outer-row {
|
height: 100%;
|
|
.scroll-col {
|
height: 100%;
|
overflow: auto;
|
}
|
}
|
}
|
}
|
}
|
</style>
|