<template>
|
<j-modal
|
:title="title"
|
:width="1400"
|
:visible="visible"
|
:maskClosable="false"
|
switchFullscreen
|
@ok="handleOk"
|
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
|
@cancel="handleCancel">
|
<operation-certificate-apply-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" :achievement="isAchievement"/>
|
|
<template slot="footer">
|
<a-button
|
:style="{marginRight: '8px'}"
|
@click="handleCancel()"
|
>
|
关闭
|
</a-button>
|
|
<!-- <a-button
|
@click="handleOk()"
|
type="primary"
|
:loading="confirmLoading"
|
:disabled="disableSubmit || confirmLoading"
|
>确定</a-button> -->
|
<a-popconfirm
|
@confirm="() => handleReject()"
|
title="确认将当前操作证申请驳回?"
|
>
|
<a-button
|
:loading='confirmLoading'
|
:style="{marginRight: '8px'}"
|
:disabled="this.auditStatus == 'created' || this.auditStatus == 'audited'"
|
>
|
驳回
|
</a-button>
|
</a-popconfirm>
|
<a-popconfirm
|
@confirm="() => handlePass()"
|
title="确认将当前操作证申请审核通过?"
|
>
|
<a-button
|
type='primary'
|
:loading='confirmLoading'
|
:style="{marginRight: '8px'}"
|
:disabled="this.auditStatus == 'created' || this.auditStatus == 'audited'"
|
>
|
通过
|
</a-button>
|
</a-popconfirm>
|
</template>
|
</j-modal>
|
</template>
|
|
<script>
|
|
import OperationCertificateApplyForm from './OperationCertificateApplyForm'
|
|
export default {
|
name: 'OperationCertificateApplyModal',
|
components: {
|
OperationCertificateApplyForm
|
},
|
data() {
|
return {
|
title:'',
|
width:800,
|
visible: false,
|
disableSubmit: false,
|
isAchievement: false,
|
record:{},
|
model:{},
|
url: {
|
edit: '/eam/operationCertificateApply/edit',
|
}
|
}
|
},
|
methods:{
|
add () {
|
this.visible=true
|
this.$nextTick(()=>{
|
this.$refs.realForm.add();
|
})
|
},
|
edit (record) {
|
this.record = record
|
this.visible=true
|
this.$nextTick(()=>{
|
this.$refs.realForm.edit(record);
|
})
|
},
|
close () {
|
this.$emit('close');
|
this.visible = false;
|
},
|
handlePass() {
|
if (this.record.auditStatus == 'submitted') {
|
this.record.auditStatus = 'approved'
|
} else if (this.record.auditStatus == 'approved') {
|
this.record.auditStatus = 'audited'
|
}
|
this.$nextTick(()=>{
|
this.$refs.realForm.edit(this.record);
|
})
|
this.handleOk();
|
},
|
|
handleReject() {
|
if (this.record.auditStatus == 'submitted') {
|
this.record.auditStatus = 'created'
|
} else if (this.record.auditStatus == 'approved') {
|
this.record.auditStatus = 'submitted'
|
}
|
this.$nextTick(()=>{
|
this.$refs.realForm.edit(this.record);
|
})
|
this.handleOk();
|
},
|
|
handleOk () {
|
this.$refs.realForm.handleOk();
|
},
|
|
submitCallback(){
|
this.$emit('ok');
|
this.visible = false;
|
},
|
handleCancel () {
|
this.close()
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
</style>
|