<template>
|
<j-modal
|
:title="title"
|
:width="1200"
|
:visible="visible"
|
:okButtonProps="{ class:{'jee-hidden': tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'} }"
|
@ok="submitForm"
|
@cancel="handleCancel"
|
:mask-closable="false"
|
:confirmLoading="confirmLoading"
|
switchFullscreen
|
centered
|
>
|
<a-spin :spinning="spinning">
|
<a-tabs>
|
<a-tab-pane key='1' tab='流程图'>
|
<img :src="imageSrc" alt="流程图获取中..."/>
|
</a-tab-pane>
|
</a-tabs>
|
|
|
<a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol" :wrapperCol="wrapperCol"
|
:rules="validatorRules" v-if="tableRowRecord.inspectionStatus==='WAIT_CONFIRM'">
|
<a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 班组长确认信息
|
</a-divider>
|
|
<a-row :gutter="24">
|
<a-col :span="12">
|
<a-form-model-item prop="confirmDealType" label="处理类型">
|
<j-dict-select-tag type='radio' v-model='tableRowRecord.confirmDealType' dictCode='approved_rejected'/>
|
</a-form-model-item>
|
</a-col>
|
|
<a-col :span="12">
|
<a-form-model-item prop="confirmComment" label="处理意见">
|
<a-textarea placeholder="请输入处理意见" v-model="tableRowRecord.confirmComment"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-form-model>
|
</a-spin>
|
</j-modal>
|
</template>
|
|
<script>
|
import { getAction, downFile, httpAction } from '@api/manage'
|
|
export default {
|
name: 'InspectionOrderBatchHandle',
|
props: {
|
taskList: {
|
type: Array
|
}
|
},
|
data() {
|
return {
|
confirmLoading: false,
|
spinning: false,
|
tableRowRecord: {},
|
hitaskDataSource: [],
|
validatorRules: {
|
confirmDealType: [
|
{ required: true, message: '请选择处理类型' }
|
],
|
confirmComment: [
|
{ required: true, message: '请输入处理意见' }
|
]
|
},
|
imageSrc: null,
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 6 }
|
},
|
wrapperCol: {
|
xs: { span: 30 },
|
sm: { span: 16 }
|
},
|
visible: false,
|
// 表头
|
url: {
|
diagramView: '/assign/flow/diagramView',
|
batchApprove: '/eam/eamInspectionOrder/batchApproval',
|
queryById: '/eam/eamInspectionOrder/queryById'
|
},
|
title: ''
|
}
|
},
|
methods: {
|
/**
|
* 获取流程图
|
* @param record 待办记录信息
|
*/
|
getAllApproveData(record) {
|
if (record.procInstId) {
|
const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = record
|
const param = { procInstId }
|
const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey }
|
const that = this
|
|
downFile(this.url.diagramView, imageParam, 'get')
|
.then((res => {
|
const urlObject = window.URL.createObjectURL(new Blob([res]))
|
that.imageSrc = urlObject
|
}))
|
.catch(err => {
|
that.$notification.error({
|
message: '消息',
|
description: res.message
|
})
|
})
|
}
|
},
|
|
/**
|
* 获取待办记录的基本信息
|
* @param record 待办记录信息
|
*/
|
async getBasicInformation(record) {
|
this.spinning = true
|
const param = { id: record.dataId }
|
let res = await getAction(this.url.queryById, param)
|
this.tableRowRecord = Object.assign({}, res.result)
|
this.spinning = false
|
},
|
|
async submitForm() {
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
this.confirmLoading = this.spinning = true
|
const flowTaskVo = {}
|
flowTaskVo.confirmDealType = this.tableRowRecord.confirmDealType
|
flowTaskVo.confirmComment = this.tableRowRecord.confirmComment
|
flowTaskVo.taskList = this.taskList
|
const that = this
|
console.log('表单提交数据', flowTaskVo)
|
httpAction(this.url.batchApprove, flowTaskVo, 'post')
|
.then((res) => {
|
if (res.success) {
|
that.$message.success(res.message)
|
//刷新表格
|
that.$emit('searchReset')
|
that.handleCancel()
|
} else {
|
that.$message.warning(res.message)
|
}
|
})
|
.finally(() => {
|
that.confirmLoading = that.spinning = false
|
})
|
} else {
|
return false
|
}
|
})
|
},
|
|
handleCancel() {
|
this.visible = false
|
}
|
}
|
}
|
</script>
|