<template>
|
<j-modal :title="title" :visible="visible" :confirmLoading="confirmLoading"
|
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" fullscreen @ok="handleOk" @cancel="handleCancel"
|
cancelText="关闭">
|
<a-spin :spinning="spinning">
|
<a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-row :gutter="24" id="outer-row">
|
<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="统一编码">
|
<maintenance-equipment-select v-model="model.equipmentId" maintenanceCategory="THIRD_MAINTENANCE"
|
@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.standardName" readOnly/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item label="保养日期">
|
<a-input v-model="model.maintenanceDate" readOnly/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
|
<a-row>
|
<a-col :span="12">
|
<a-form-model-item label="维修人">
|
<a-input v-model="model.repairman_dictText" readOnly/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item label="保养周期">
|
<a-input v-model="model.maintenancePeriod" readOnly/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" label="备注">
|
<a-textarea v-model="model.remark" readOnly/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
</a-col>
|
|
<a-col :span="model.maintenanceStatus&&model.maintenanceStatus!='WAIT_MAINTENANCE'?10:16" class="scroll-col">
|
<a-tabs v-model="activeTabKey" @change="$refs.editableDetailTable.clearValidate()">
|
<a-tab-pane key="1" tab="保养项明细">
|
<j-vxe-table ref="editableDetailTable" rowSelection bordered alwaysEdit keep-source
|
:dataSource="detail.dataSource" :columns="detail.columns"
|
@selectRowChange="handleTableSelectRowChange">
|
<!--保养结果-->
|
<template v-slot:maintenanceResult="props">
|
<j-dict-select-tag v-model="props.row.maintenanceResult" dictCode="third_maintenance_result"
|
placeholder="请选择保养结果"
|
:disabled="disableSubmit || (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')"
|
@change="handleResultSelectChange($event,props.row,'exceptionDescription')"
|
style="width: 100%"/>
|
</template>
|
|
<!--保养异常描述-->
|
<template v-slot:exceptionDescription="props">
|
<a-textarea :rows="1" :autoSize="false" v-model="props.row.exceptionDescription"
|
:placeholder="props.row.maintenanceResult&&props.row.maintenanceResult!='NORMAL'?'请输入异常描述':''"
|
@blur="$refs.editableDetailTable.validateTable"
|
:disabled="disableSubmit ||
|
(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE') ||
|
!props.row.maintenanceResult ||
|
props.row.maintenanceResult === 'NORMAL'"/>
|
</template>
|
|
<!--第一次验收结果-->
|
<template v-slot:firstInspectResult="props">
|
<j-dict-select-tag v-model="props.row.firstInspectResult"
|
placeholder="请选择验收结果"
|
@change="handleResultSelectChange($event,props.row,'firstInspectException')"
|
:disabled="disableSubmit ||(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_FIRST_ACCEPTANCE')"
|
dictCode="check_status" style="width: 100%"/>
|
</template>
|
|
<!--第一次验收异常描述-->
|
<template v-slot:firstInspectException="props">
|
<a-textarea :rows="1" v-model="props.row.firstInspectException"
|
:placeholder="props.row.firstInspectResult&&props.row.firstInspectResult!='1'?'请输入异常描述':''"
|
@blur="$refs.editableDetailTable.validateTable"
|
:disabled="disableSubmit ||
|
(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_FIRST_ACCEPTANCE')||
|
!props.row.firstInspectResult ||
|
props.row.firstInspectResult === '1'"
|
dictCode="check_status" style="width: 100%;resize:none"/>
|
</template>
|
|
<!--第二次验收结果-->
|
<template v-slot:secondInspectResult="props">
|
<j-dict-select-tag v-model="props.row.secondInspectResult"
|
placeholder="请选择验收结果"
|
@change="handleResultSelectChange($event,props.row,'secondInspectException')"
|
disabled dictCode="check_status" style="width: 100%"/>
|
</template>
|
|
<!--第二次验收异常描述-->
|
<template v-slot:secondInspectException="props">
|
<a-textarea :rows="1" v-model="props.row.secondInspectException"
|
:placeholder="props.row.secondInspectResult&&props.row.secondInspectResult!='1'?'请输入异常描述':''"
|
@blur="$refs.editableDetailTable.validateTable"
|
:disabled="disableSubmit ||
|
(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_SECOND_ACCEPTANCE')||
|
!props.row.secondInspectResult ||
|
props.row.secondInspectResult === '1'"
|
dictCode="check_status" style="width: 100%;resize:none"/>
|
</template>
|
</j-vxe-table>
|
</a-tab-pane>
|
<template v-if="selectShenpiData.procInstId">
|
<a-tab-pane key='2' tab='流程图'>
|
<img :src="imageSrc" alt="Fetched Image"/>
|
</a-tab-pane>
|
</template>
|
|
<template slot="tabBarExtraContent">
|
<a-space>
|
<a-button
|
v-if="activeTabKey=='1'"
|
:disabled="disableSubmit || (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')||selectedRowKeys.length == 0"
|
type="primary" @click="handleSelectAllMaintenanceResult">批量保养正常
|
</a-button>
|
<a-button
|
v-if="activeTabKey=='1'"
|
:disabled="disableSubmit || (model.maintenanceStatus&&model.maintenanceStatus!='UNDER_FIRST_ACCEPTANCE')||selectedRowKeys.length == 0"
|
type="primary" @click="handleSelectAllFirstAcceptanceResult">批量验收通过
|
</a-button>
|
</a-space>
|
</template>
|
</a-tabs>
|
</a-col>
|
|
<a-col v-if="model.maintenanceStatus&&model.maintenanceStatus!='WAIT_MAINTENANCE'" :span="6"
|
class="scroll-col">
|
<a-tabs v-if="displayEvaluationFlag">
|
<a-tab-pane tab="保养前技术状态鉴定">
|
<a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol"
|
prop="fullyFunctional" label="设备功能是否齐全">
|
<j-dict-select-tag type='radio' v-model='model.fullyFunctional' dictCode='yn'
|
@change="handleCheckRadioChange"
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='WAIT_CHECK')"/>
|
</a-form-model-item>
|
<a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol"
|
prop="runningNormally" label="设备能否正常运转">
|
<j-dict-select-tag type='radio' v-model='model.runningNormally' dictCode='yn'
|
@change="handleCheckRadioChange"
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='WAIT_CHECK')"/>
|
</a-form-model-item>
|
<a-form-model-item v-if="model.fullyFunctional=='0'||model.runningNormally=='0'"
|
:labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="问题描述">
|
<a-textarea v-model='model.problemDescription' placeholder="请描述问题"
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='WAIT_CHECK')"/>
|
</a-form-model-item>
|
</a-tab-pane>
|
</a-tabs>
|
|
<a-tabs v-if="displayOperatorFlag">
|
<a-tab-pane tab="操作人确认">
|
<a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="确认类型">
|
<j-dict-select-tag v-model="model.operatorSignatureResult" type="radio" disabled dict-code="yn"/>
|
</a-form-model-item>
|
<a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="协助操作人">
|
<a-input v-model="model.assistantOperator"
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='OPERATOR_SIGNATURE')"
|
placeholder="请输入协助操作人"/>
|
</a-form-model-item>
|
</a-tab-pane>
|
</a-tabs>
|
|
<a-tabs v-if="displayRepairerFlag">
|
<a-tab-pane tab="维修人确认">
|
<a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="确认类型">
|
<j-dict-select-tag v-model="model.repairmanSignatureResult" type="radio" disabled dict-code="yn"/>
|
</a-form-model-item>
|
<a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="协助维修人">
|
<a-input v-model="model.assistantRepairman"
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='REPAIRMAN_SIGNATURE')"
|
placeholder="请输入协助维修人"/>
|
</a-form-model-item>
|
</a-tab-pane>
|
</a-tabs>
|
|
<a-tabs v-if="displayRepairLeaderFlag">
|
<a-tab-pane tab="维修室主任确认">
|
<a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="确认类型">
|
<j-dict-select-tag v-model="model.repairManagerSignatureResult" type="radio" disabled dict-code="yn"/>
|
</a-form-model-item>
|
</a-tab-pane>
|
</a-tabs>
|
|
<a-tabs v-if="displayInspectorFlag">
|
<a-tab-pane tab="检查人确认">
|
<a-form-model-item :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol" label="确认类型">
|
<j-dict-select-tag v-model="model.inspectorSignatureResult" type="radio" disabled dict-code="yn"/>
|
</a-form-model-item>
|
</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 ATextarea from 'ant-design-vue/es/input/TextArea'
|
|
export default {
|
name: 'ThirdMaintenanceApprovalModal',
|
mixins: [JVxeTableModelMixin],
|
components: {
|
ATextarea,
|
MaintenanceEquipmentSelect
|
},
|
props: {
|
selectShenpiData: {
|
type: Object
|
}
|
},
|
data() {
|
return {
|
title: '操作',
|
visible: false,
|
model: {},
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 6 }
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 16 }
|
},
|
labelColLong: {
|
xs: { span: 24 },
|
sm: { span: 3 }
|
},
|
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: {
|
fullyFunctional: [{ required: true, message: '请选择设备功能是否齐全' }],
|
runningNormally: [{ required: true, message: '请选择设备能否正常运转' }]
|
},
|
url: {
|
queryById: '/eam/thirdMaintenanceOrder/queryById',
|
detail: '/eam/thirdMaintenanceOrderDetail/queryList',
|
approval: '/eam/thirdMaintenanceOrder/approval',
|
diagramView: '/assign/flow/diagramView'
|
},
|
disableSubmit: false,
|
selectedRowKeys: [],
|
detail: {
|
dataSource: [],
|
columns: [],
|
defaultColumns: [
|
{
|
title: 'ID',
|
key: 'id',
|
type: JVXETypes.hidden
|
},
|
{
|
title: 'orderId',
|
key: 'orderId',
|
type: JVXETypes.hidden
|
},
|
{
|
title: '序号',
|
key: 'itemCode',
|
type: JVXETypes.normal,
|
width: 60,
|
align: 'center'
|
},
|
{
|
title: '保养部位',
|
key: 'itemPart',
|
type: JVXETypes.normal,
|
width: 120,
|
align: 'center'
|
},
|
{
|
title: '保养内容',
|
key: 'itemName',
|
type: JVXETypes.normal,
|
width: 120,
|
align: 'center'
|
},
|
{
|
title: '验收标准',
|
key: 'itemDemand',
|
type: JVXETypes.normal,
|
width: 120,
|
align: 'center'
|
},
|
{
|
title: '保养结果',
|
key: 'maintenanceResult',
|
type: JVXETypes.slot,
|
align: 'center',
|
width: 200,
|
slotName: 'maintenanceResult',
|
validateRules: [
|
{ required: true, message: '请选择${title}' }
|
]
|
},
|
{
|
title: '保养异常描述',
|
key: 'exceptionDescription',
|
type: JVXETypes.slot,
|
align: 'center',
|
width: 200,
|
slotName: 'exceptionDescription',
|
validateRules: [
|
{ handler: this.maintenanceExceptionDescriptionValidator }
|
]
|
}
|
]
|
}
|
}
|
},
|
computed: {
|
displayEvaluationFlag() {
|
return this.model.maintenanceStatus && ['WAIT_CHECK', 'UNDER_MAINTENANCE', 'UNDER_FIRST_ACCEPTANCE', 'UNDER_SECOND_ACCEPTANCE', 'OPERATOR_SIGNATURE', 'REPAIRMAN_SIGNATURE', 'REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE', 'CANCEL'].includes(this.model.maintenanceStatus)
|
},
|
displayFirstAcceptanceFlag() {
|
return this.model.maintenanceStatus && ['UNDER_FIRST_ACCEPTANCE', 'UNDER_SECOND_ACCEPTANCE', 'OPERATOR_SIGNATURE', 'REPAIRMAN_SIGNATURE', 'REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus)
|
},
|
displaySecondAcceptanceFlag() {
|
return this.model.maintenanceStatus && ['UNDER_SECOND_ACCEPTANCE', 'OPERATOR_SIGNATURE', 'REPAIRMAN_SIGNATURE', 'REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus)
|
},
|
displayOperatorFlag() {
|
return this.model.maintenanceStatus && ['OPERATOR_SIGNATURE', 'REPAIRMAN_SIGNATURE', 'REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus)
|
},
|
displayRepairerFlag() {
|
return this.model.maintenanceStatus && ['REPAIRMAN_SIGNATURE', 'REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus)
|
},
|
displayRepairLeaderFlag() {
|
return this.model.maintenanceStatus && ['REPAIR_MANAGER_SIGNATURE', 'INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus)
|
},
|
displayInspectorFlag() {
|
return this.model.maintenanceStatus && ['INSPECTOR_SIGNATURE', 'COMPLETE'].includes(this.model.maintenanceStatus)
|
}
|
},
|
methods: {
|
/**
|
* 主页面点击执行审批时触发
|
* @param record 主页面列表行记录
|
*/
|
async handleDetail(record) {
|
this.model = {}
|
this.detail.dataSource = []
|
this.getBasicInformationByApi(record)
|
this.getFlowChartImageByApi(record)
|
},
|
|
/**
|
* 主页面点击详情时触发
|
* @param record 主页面列表行记录
|
*/
|
recordDetail(record) {
|
this.spinning = true
|
this.detail.dataSource = []
|
this.model = Object.assign({
|
operatorSignatureResult: '1',
|
repairmanSignatureResult: '1',
|
repairManagerSignatureResult: '1',
|
inspectorSignatureResult: '1'
|
}, record)
|
this.handleDynamicColumns()
|
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({
|
operatorSignatureResult: '1',
|
repairmanSignatureResult: '1',
|
repairManagerSignatureResult: '1',
|
inspectorSignatureResult: '1'
|
}, res.result)
|
that.model.dataId = record.dataId
|
that.model.taskId = record.id
|
that.model.userId = record.assignee
|
that.model.instanceId = record.procInstId
|
that.handleDynamicColumns()
|
}
|
else {
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
})
|
}
|
})
|
.finally(() => {
|
this.loadDetail(record.dataId)
|
})
|
|
},
|
|
/**
|
* 获取保养明细
|
* @param orderId 工单号
|
*/
|
loadDetail(orderId) {
|
getAction(this.url.detail, { orderId })
|
.then(res => {
|
if (res.success) {
|
if (this.model.maintenanceStatus && this.model.maintenanceStatus == 'UNDER_SECOND_ACCEPTANCE') {
|
this.detail.dataSource = res.result.map(item => {
|
return {
|
...item,
|
secondInspectResult: '1'
|
}
|
})
|
return
|
}
|
this.detail.dataSource = res.result
|
}
|
})
|
.finally(() => {
|
this.spinning = false
|
})
|
},
|
|
/**
|
* 获取流程图
|
* @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
|
|
if (this.model.maintenanceStatus == 'UNDER_MAINTENANCE' || this.model.maintenanceStatus == 'UNDER_FIRST_ACCEPTANCE' || this.model.maintenanceStatus == 'UNDER_SECOND_ACCEPTANCE') {
|
let errMap = await that.$refs.editableDetailTable.validateTable()
|
if (this.activeTabKey != '1') {
|
this.activeTabKey = '1'
|
if (errMap) {
|
that.$refs.editableDetailTable.clearValidate()
|
that.$notification.warning({
|
message: '消息',
|
description: '保养或验收不能为空'
|
})
|
return
|
}
|
}
|
if (errMap) return
|
}
|
|
// 触发表单验证
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
that.confirmLoading = that.spinning = true
|
that.model.tableDetailList = that.$refs.editableDetailTable.getTableData()
|
|
httpAction(that.url.approval, that.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
|
}
|
})
|
},
|
|
handleDynamicColumns() {
|
let columns = []
|
if (this.displayFirstAcceptanceFlag) {
|
columns = [
|
{
|
title: '第一次验收结果',
|
key: 'firstInspectResult',
|
type: JVXETypes.slot,
|
align: 'center',
|
width: 200,
|
slotName: 'firstInspectResult',
|
validateRules: [{ required: true, message: '请选择${title}' }]
|
},
|
{
|
title: '第一次验收异常描述',
|
key: 'firstInspectException',
|
type: JVXETypes.slot,
|
align: 'center',
|
width: 200,
|
slotName: 'firstInspectException',
|
validateRules: [
|
{ handler: this.firstAcceptanceExceptionDescriptionValidator }
|
]
|
}
|
]
|
}
|
|
if (this.displaySecondAcceptanceFlag) {
|
columns = [
|
...columns,
|
{
|
title: '第二次验收结果',
|
key: 'secondInspectResult',
|
type: JVXETypes.slot,
|
align: 'center',
|
width: 200,
|
slotName: 'secondInspectResult',
|
validateRules: [{ required: true, message: '请选择${title}' }]
|
},
|
{
|
title: '第二次验收异常描述',
|
key: 'secondInspectException',
|
type: JVXETypes.slot,
|
align: 'center',
|
width: 200,
|
slotName: 'secondInspectException',
|
validateRules: [
|
{ handler: this.secondAcceptanceExceptionDescriptionValidator }
|
]
|
}
|
]
|
}
|
this.detail.columns = [...this.detail.defaultColumns, ...columns]
|
},
|
|
autocompleteForm(selectObj) {
|
this.$set(this.model, 'standardName', selectObj.standardName)
|
this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod)
|
this.$set(this.model, 'standardId', selectObj.id)
|
this.$set(this.model, 'equipmentId', selectObj.equipmentId)
|
},
|
|
/**
|
* 保养、验收结果发生改变时触发
|
* @param value 改变后的值
|
* @param record 表格行记录
|
* @param key 对象属性名称
|
*/
|
handleResultSelectChange(value, record, key) {
|
if (record[key]) delete record[key]
|
this.$refs.editableDetailTable.validateTable()
|
},
|
|
// 批量选择保养结果正常
|
handleSelectAllMaintenanceResult() {
|
this.selectedRowKeys.forEach(key => {
|
const dataItem = this.detail.dataSource.find(item => item.id === key)
|
if (dataItem && dataItem.maintenanceResult !== 'NORMAL') {
|
delete dataItem.exceptionDescription
|
dataItem.maintenanceResult = 'NORMAL'
|
}
|
})
|
this.$refs.editableDetailTable.clearCheckboxRow()
|
this.selectedRowKeys = []
|
},
|
|
// 批量选择第一次验收结果通过
|
handleSelectAllFirstAcceptanceResult() {
|
this.selectedRowKeys.forEach(key => {
|
const dataItem = this.detail.dataSource.find(item => item.id === key)
|
if (dataItem && dataItem.firstInspectResult !== '1') {
|
delete dataItem.firstInspectException
|
dataItem.firstInspectResult = '1'
|
}
|
})
|
this.$refs.editableDetailTable.clearCheckboxRow()
|
this.$refs.editableDetailTable.clearValidate()
|
this.selectedRowKeys = []
|
},
|
|
/**
|
* 表格多选框发生改变时触发
|
* @param {selectedRowIds} 表格中已选择的ID列表
|
*/
|
handleTableSelectRowChange({ selectedRowIds }) {
|
this.selectedRowKeys = selectedRowIds
|
},
|
|
// 保养前技术状态单选发生改变时触发
|
handleCheckRadioChange() {
|
if (this.model.fullyFunctional == '1' && this.model.runningNormally == '1') this.model.problemDescription = ''
|
},
|
|
/**
|
* 保养异常描述单元格校验
|
* @param cellValue 单元格值
|
* @param row 表格行记录
|
* @param callback 结果回调函数
|
*/
|
maintenanceExceptionDescriptionValidator({ cellValue, row }, callback) {
|
if (row.maintenanceResult === '2') {
|
if (!cellValue) {
|
callback(false, '请输入${title}') // false = 未通过,可以跟自定义提示
|
} else {
|
callback(true) // true = 通过验证
|
}
|
} else {
|
callback(true)
|
}
|
},
|
|
/**
|
* 第一次验收异常描述单元格校验
|
* @param cellValue 单元格值
|
* @param row 表格行记录
|
* @param callback 结果回调函数
|
*/
|
firstAcceptanceExceptionDescriptionValidator({ cellValue, row }, callback) {
|
if (row.firstInspectResult === '2') {
|
if (!cellValue) {
|
callback(false, '请输入${title}') // false = 未通过,可以跟自定义提示
|
} else {
|
callback(true) // true = 通过验证
|
}
|
} else {
|
callback(true)
|
}
|
},
|
|
/**
|
* 第二次验收异常描述单元格校验
|
* @param cellValue 单元格值
|
* @param row 表格行记录
|
* @param callback 结果回调函数
|
*/
|
secondAcceptanceExceptionDescriptionValidator({ cellValue, row }, callback) {
|
if (row.secondInspectResult === '2') {
|
if (!cellValue) {
|
callback(false, '请输入${title}') // false = 未通过,可以跟自定义提示
|
} else {
|
callback(true) // true = 通过验证
|
}
|
} else {
|
callback(true)
|
}
|
},
|
|
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>
|