<template>
|
<j-modal :title="title" :width="1300" :fullscreen="fullScreen" :visible="visible" :confirmLoading="confirmLoading"
|
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @ok="handleOk" centered
|
@cancel="handleCancel" 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="selectShenpiData.procInstId?8:14" 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="统一编码">
|
<lx-search-equipment-select v-model="model.equipmentId" 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.maintenanceDate" readOnly/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item label="保养人">
|
<a-input v-model="model.operator_dictText" 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 v-if="selectShenpiData.procInstId" :span="10" class="scroll-col">
|
<a-tabs>
|
<a-tab-pane key='1' tab='流程图'>
|
<img :src="imageSrc" alt="Fetched Image" style="width: 100%" v-if="imageSrc"/>
|
</a-tab-pane>
|
</a-tabs>
|
</a-col>
|
|
<!--右侧审批列-->
|
<a-col :span="selectShenpiData.procInstId?6:10" class="scroll-col">
|
<a-tabs v-if="displayRepairConfirmFlag">
|
<a-tab-pane tab="维修工确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="compressedAirPressureValue" label="压缩空气压力(MPa)"
|
:labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<a-input v-model='model.compressedAirPressureValue' placeholder="请输入压缩空气压力(MPa)"
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item prop="ultimateVacuumValue" label="极限真空(Pa)"
|
:labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<a-input v-model='model.ultimateVacuumValue' placeholder="请输入极限真空(Pa)"
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item prop="leakRate" label="泄漏率(Pa/h)"
|
:labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<a-input v-model='model.leakRate' placeholder="请输入泄漏率(Pa/h)"
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item prop="purificationTreatment" label="净化处理"
|
:labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<a-input v-model='model.purificationTreatment' placeholder="请输入净化处理"
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item prop="furnaceTemperatureUniformityTesting" label="炉温均匀性检测"
|
:labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<a-input v-model='model.furnaceTemperatureUniformityTesting' placeholder="请输入炉温均匀性检测"
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item prop="heatingPowerTest" label="加热功率测试"
|
:labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<a-input v-model='model.heatingPowerTest' placeholder="请输入加热功率测试"
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item prop="processingRequirementsFlag" label="能否满足加工需求"
|
:labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type="radio" dict-code="yn" v-model='model.processingRequirementsFlag'
|
:disabled="disableSubmit||(model.maintenanceStatus&&model.maintenanceStatus!='UNDER_MAINTENANCE')"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
|
<a-tabs v-if="displayRepairLeaderConfirmFlag">
|
<a-tab-pane tab="维修室主任确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="confirmDealType" label="确认类型" :labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type='radio' v-model='model.confirmDealType' dictCode='approved_rejected'
|
disabled/>
|
</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, putAction } from '@/api/manage'
|
import LxSearchEquipmentSelect from '../../../eam/equipment/modules/LxSearchEquipmentSelect'
|
|
export default {
|
name: 'ThirdMaintenanceFurnaceApprovalModal',
|
components: {
|
LxSearchEquipmentSelect
|
},
|
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: 10 }
|
},
|
rightColWrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 12 }
|
},
|
confirmLoading: false,
|
spinning: false,
|
imageSrc: null,
|
fullScreen: true,
|
validatorRules: {
|
compressedAirPressureValue: [{ required: true, message: '请输入压缩空气压力(MPa)', trigger: 'change' }],
|
ultimateVacuumValue: [{ required: true, message: '请输入极限真空(Pa)', trigger: 'change' }],
|
leakRate: [{ required: true, message: '请输入泄漏率(Pa/h)', trigger: 'change' }],
|
purificationTreatment: [{ required: true, message: '请输入净化处理', trigger: 'change' }],
|
furnaceTemperatureUniformityTesting: [{ required: true, message: '请输入炉温均匀性检测', trigger: 'change' }],
|
heatingPowerTest: [{ required: true, message: '请输入加热功率测试', trigger: 'change' }],
|
processingRequirementsFlag: [{ required: true, message: '请选择能否满足加工需求' }],
|
confirmDealType: [{ required: true, message: '请选择确认类型' }]
|
},
|
url: {
|
queryById: '/eam/eamThirdMaintenanceFurnace/queryById',
|
approval: '/eam/eamThirdMaintenanceFurnace/approval',
|
diagramView: '/assign/flow/diagramView'
|
},
|
disableSubmit: false,
|
selectedRowKeys: []
|
}
|
},
|
computed: {
|
displayRepairConfirmFlag() {
|
return this.model.maintenanceStatus && ['UNDER_MAINTENANCE', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.model.maintenanceStatus)
|
},
|
displayRepairLeaderConfirmFlag() {
|
return this.model.maintenanceStatus && ['WAIT_CONFIRM', 'COMPLETE'].includes(this.model.maintenanceStatus)
|
}
|
},
|
methods: {
|
/**
|
* 主页面点击执行审批时触发
|
* @param record 主页面列表行记录
|
*/
|
handleApprove(record) {
|
this.fullScreen = true
|
this.model = {}
|
this.getBasicInformationByApi(record)
|
this.getFlowChartImageByApi(record)
|
},
|
|
/**
|
* 主页面点击详情时触发
|
* @param record 主页面列表行记录
|
*/
|
handleDetail(record) {
|
this.fullScreen = false
|
this.model = Object.assign({}, record)
|
},
|
|
/**
|
* 获取基础信息
|
* @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({ confirmDealType: '1' }, 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(() => {
|
that.spinning = false
|
})
|
},
|
|
/**
|
* 获取流程图
|
* @param record 主页面列表行记录
|
*/
|
getFlowChartImageByApi(record) {
|
const { processDefinitionId, processInstanceId, processDefinitionKey } = record
|
this.imageSrc = null
|
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
|
|
// 触发表单验证
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
that.confirmLoading = that.spinning = true
|
|
putAction(this.url.approval, this.model)
|
.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
|
}
|
})
|
},
|
|
handleCancel() {
|
this.close()
|
},
|
|
close() {
|
this.$emit('close')
|
this.visible = false
|
this.$refs.form.clearValidate()
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="less">
|
/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>
|