<template>
|
<j-modal :title="title" fullscreen :visible="visible" :confirmLoading="confirmLoading"
|
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @ok="handleOk"
|
@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="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.changeOrderNum" readOnly/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item label="申请单位">
|
<a-input v-model="model.factoryOrgCode_dictText" 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.designer_dictText" readOnly/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item label="编制时间">
|
<a-input v-model="model.designerTime" 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="10" class="scroll-col">
|
<a-tabs>
|
<a-tab-pane key="1" tab="设备明细">
|
<j-vxe-table ref="editableDetailTable" rowNumber bordered keep-source :dataSource="detail.dataSource"
|
:columns="detail.columns"/>
|
</a-tab-pane>
|
<a-tab-pane key='2' tab='流程图' v-if="selectShenpiData.procInstId">
|
<img :src="imageSrc" alt="Fetched Image" style="width: 100%" v-if="imageSrc"/>
|
</a-tab-pane>
|
</a-tabs>
|
</a-col>
|
|
<!--右侧审批列-->
|
<a-col :span="6" class="scroll-col">
|
<a-tabs v-if="displayDepartHeaderFlag">
|
<a-tab-pane tab="使用单位室级领导确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="departHeaderSignatureResult" label="确认类型" :labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type='radio' v-model='model.departHeaderSignatureResult'
|
dictCode='approve_reject'
|
:disabled="disableSubmit||(model.changeStatus&&model.changeStatus!='DEPART_HEADER_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.departHeaderComment"
|
:disabled="disableSubmit||(model.changeStatus&&model.changeStatus!='DEPART_HEADER_SIGNING')"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-tab-pane>
|
</a-tabs>
|
|
<a-tabs v-if="displayDepartLeaderFlag">
|
<a-tab-pane tab="使用单位部级领导确认">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item prop="departLeaderSignatureResult" label="确认类型" :labelCol="rightColLabelCol"
|
:wrapperCol="rightColWrapperCol">
|
<j-dict-select-tag type='radio' v-model='model.departLeaderSignatureResult'
|
dictCode='approve_reject'
|
:disabled="disableSubmit||(model.changeStatus&&model.changeStatus!='DEPART_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.departLeaderComment"
|
:disabled="disableSubmit||(model.changeStatus&&model.changeStatus!='DEPART_LEADER_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, postAction } from '@/api/manage'
|
import TechnicalStatusEquipmentSelect from '../../../eam/equipment/modules/TechnicalStatusEquipmentSelect'
|
import { JVXETypes } from '@comp/jeecg/JVxeTable'
|
|
export default {
|
name: 'TechnicalStatusChangeApprovalModal',
|
components: {
|
TechnicalStatusEquipmentSelect
|
},
|
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: 6 }
|
},
|
rightColWrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 16 }
|
},
|
confirmLoading: false,
|
spinning: false,
|
imageSrc: null,
|
validatorRules: {
|
departHeaderSignatureResult: [{ required: true, message: '请选择确认类型' }],
|
departLeaderSignatureResult: [{ required: true, message: '请选择确认类型' }]
|
},
|
url: {
|
queryById: '/eam/eamTechnicalStatusChange/queryById',
|
approval: '/eam/eamTechnicalStatusChange/approval',
|
detail: '/eam/eamTechnicalStatusChangeDetail/queryList',
|
diagramView: '/assign/flow/diagramView'
|
},
|
disableSubmit: false,
|
selectedRowKeys: [],
|
detail: {
|
dataSource: [],
|
columns: [
|
{
|
title: 'ID',
|
key: 'id',
|
type: JVXETypes.hidden
|
},
|
{
|
title: '统一编码',
|
key: 'equipmentCode',
|
align: 'center',
|
type: JVXETypes.normal,
|
width: 200
|
},
|
{
|
title: '设备名称',
|
key: 'equipmentName',
|
align: 'center',
|
type: JVXETypes.normal,
|
width: 200
|
},
|
{
|
title: '设备型号',
|
key: 'equipmentModel',
|
align: 'center',
|
type: JVXETypes.normal,
|
width: 200
|
},
|
{
|
title: '使用单位',
|
key: 'factoryName',
|
align: 'center',
|
type: JVXETypes.normal,
|
width: 200
|
},
|
{
|
title: '变更原因',
|
key: 'changeCategory_dictText',
|
align: 'center',
|
type: JVXETypes.normal,
|
width: 200
|
},
|
{
|
title: '变更日期',
|
key: 'changeDate',
|
align: 'center',
|
type: JVXETypes.normal,
|
width: 200
|
},
|
{
|
title: '变更后技术状态',
|
key: 'changeTechnicalStatus_dictText',
|
align: 'center',
|
type: JVXETypes.normal,
|
width: 200
|
}
|
]
|
}
|
}
|
},
|
computed: {
|
displayDepartHeaderFlag() {
|
return this.model.changeStatus && ['DEPART_HEADER_SIGNING', 'DEPART_LEADER_SIGNING', 'COMPLETED'].includes(this.model.changeStatus)
|
},
|
displayDepartLeaderFlag() {
|
return this.model.changeStatus && ['DEPART_LEADER_SIGNING', 'COMPLETED'].includes(this.model.changeStatus)
|
}
|
},
|
methods: {
|
/**
|
* 主页面点击执行审批时触发
|
* @param record 主页面列表行记录
|
*/
|
handleApprove(record) {
|
this.model = {}
|
this.getBasicInformationByApi(record)
|
this.getFlowChartImageByApi(record)
|
},
|
|
/**
|
* 主页面点击详情时触发
|
* @param record 主页面列表行记录
|
*/
|
handleDetail(record) {
|
this.model = Object.assign({}, record)
|
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
|
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
|
})
|
})
|
},
|
|
/**
|
* 获取设备明细
|
* @param orderId
|
*/
|
loadDetail(orderId) {
|
this.detail.dataSource = []
|
getAction(this.url.detail, { orderId })
|
.then(res => {
|
console.log('res', res)
|
if (res.success) this.detail.dataSource = res.result
|
})
|
.finally(() => {
|
this.spinning = false
|
})
|
},
|
|
async handleOk() {
|
const that = this
|
|
// 触发表单验证
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
that.confirmLoading = that.spinning = true
|
|
postAction(that.url.approval, that.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>
|