<template>
|
<j-modal
|
:title="title"
|
:width="1200"
|
:visible="visible"
|
:confirmLoading="confirmLoading"
|
:okButtonProps="{ class:{'jee-hidden': !isDisplaySubmitButton} }"
|
switchFullscreen
|
@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 :gutter="24">
|
<a-tabs>
|
<a-tab-pane key='1' tab='流程图'>
|
<img :src="imageSrc" alt="流程图获取中..."/>
|
</a-tab-pane>
|
</a-tabs>
|
</a-row>
|
|
<div v-if="model.maintenanceStatus==='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='model.confirmDealType' dictCode='approved_rejected'
|
placeholder="请选择处理类型"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item prop="confirmComment" label="确认意见">
|
<a-textarea placeholder="请输入意见" v-model="model.confirmComment"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</div>
|
|
<div v-if="model.maintenanceStatus==='WAIT_INITIAL_ACCEPTANCE'">
|
<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="initialAcceptanceComment"
|
label="初验收意见">
|
<a-textarea placeholder="请输入意见" v-model="model.initialAcceptanceComment"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item prop="initialAcceptanceFilesResult"
|
label="初验收附件">
|
<lx-upload :returnUrl="false" :isMultiple="true" v-model="model.initialAcceptanceFilesResult"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</div>
|
|
<div v-if="model.maintenanceStatus==='WAIT_FINAL_ACCEPTANCE'">
|
<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="finalAcceptanceComment"
|
label="终验收意见">
|
<a-textarea placeholder="请输入意见" v-model="model.finalAcceptanceComment"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item prop="finalAcceptanceFilesResult"
|
label="终验收附件">
|
<lx-upload :returnUrl="false" :isMultiple="true" v-model="model.finalAcceptanceFilesResult"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</div>
|
</a-form-model>
|
</a-spin>
|
</j-modal>
|
</template>
|
|
<script>
|
import { downFile, getAction, httpAction } from '@/api/manage'
|
|
export default {
|
name: 'WeekMaintenanceBatchApprovalModal',
|
props: {
|
taskList: {
|
type: Array
|
}
|
},
|
data() {
|
return {
|
title: '',
|
visible: false,
|
model: {},
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 6 }
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 16 }
|
},
|
confirmLoading: false,
|
spinning: false,
|
imageSrc: null,
|
validatorRules: {
|
confirmDealType: [
|
{ required: true, message: '请选择通过或驳回!' }
|
],
|
confirmComment: [
|
{ required: true, message: '请输入确认意见!' }
|
],
|
initialAcceptanceComment: [
|
{ required: true, message: '请输入初验收意见!' }
|
],
|
finalAcceptanceComment: [
|
{ required: true, message: '请输入终验收意见!' }
|
]
|
},
|
url: {
|
queryById: '/eam/weekMaintenanceOrder/queryById',
|
batchApprove: '/eam/weekMaintenanceOrder/batchApproval',
|
diagramView: '/assign/flow/diagramView'
|
}
|
}
|
},
|
computed: {
|
isDisplaySubmitButton: function() {
|
return ['WAIT_CONFIRM', 'WAIT_INITIAL_ACCEPTANCE', 'WAIT_FINAL_ACCEPTANCE'].includes(this.model.maintenanceStatus)
|
}
|
},
|
methods: {
|
async handleDetail(item) {
|
this.visible = true
|
this.spinning = true
|
this.imageSrc = null
|
if (item.procInstId) {
|
const { processDefinitionId, processInstanceId, processDefinitionKey } = item
|
|
downFile(this.url.diagramView, {
|
processDefinitionId,
|
processInstanceId,
|
TaskDefinitionKey: processDefinitionKey
|
}, 'get')
|
.then((res => {
|
const urlObject = window.URL.createObjectURL(new Blob([res]))
|
this.imageSrc = urlObject
|
}))
|
.catch(err => {
|
this.$notification.error({
|
message: '消息',
|
description: res.message
|
})
|
})
|
}
|
let res = await getAction(this.url.queryById, { id: item.dataId })
|
this.model = Object.assign({}, res.result)
|
this.spinning = false
|
},
|
|
async handleOk() {
|
const that = this
|
// 触发表单验证
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
that.confirmLoading = that.spinning = true
|
const { confirmComment, confirmDealType, initialAcceptanceComment, initialAcceptanceFilesResult, finalAcceptanceComment, finalAcceptanceFilesResult } = that.model
|
const params = {}
|
params.taskList = that.taskList
|
params.confirmComment = confirmComment
|
params.confirmDealType = confirmDealType
|
params.initialAcceptanceComment = initialAcceptanceComment
|
params.initialAcceptanceFilesResult = initialAcceptanceFilesResult
|
params.finalAcceptanceComment = finalAcceptanceComment
|
params.finalAcceptanceFilesResult = finalAcceptanceFilesResult
|
console.log('params', params)
|
httpAction(this.url.batchApprove, params, 'post').then((res) => {
|
if (res.success) {
|
that.$message.success(res.message)
|
that.$emit('searchReset')
|
that.close()
|
} else {
|
that.$message.warning(res.message)
|
}
|
}).finally(() => {
|
that.confirmLoading = that.spinning = false
|
})
|
} else {
|
return false
|
}
|
})
|
},
|
|
handleCancel() {
|
this.close()
|
},
|
|
close() {
|
this.$emit('close')
|
this.visible = false
|
if (this.$refs.form) this.$refs.form.clearValidate()
|
}
|
}
|
}
|
</script>
|