<template>
    <el-dialog
        id="flowDialog"
        custom-class="flowDialog"
        append-to-body
        title="多轮采购立项"
        width="100%"
        fullscreen
        :visible="outerDialogVisible"
        :before-close="handleClose"
        :close-on-click-modal="false"
        v-if="outerDialogVisible"
    >
        <startFlow :defId="defId" @closeTaskFlow="handleClose" :relationData="relationData"></startFlow>
    </el-dialog>
</template>

<script>
import startFlow from '@/components/flow/taskFlowComponents/startFlow.vue'
import flow from '@/api/flow.js'
export default {
    name: 'myBalanceSignDialog',
    components: {
        startFlow,
    },
    data() {
        return {
            outerDialogVisible: false,
            disabledEdit: false,
            defId: '',
            relationData: {},
            currentUser:{},
            codeKey:''
        }
    },
    created() {
        this.currentUser = JSON.parse(sessionStorage.getItem('currentUserDetail'))
        this.codeKey = this.currentUser.org[0].orgCode
        
    },
    methods: {
        async loadDef() {
            let res = await flow.getMainByDefKey('CGLX'+this.codeKey+'002')
            this.defId = res.data.defId
            console.log(this.defId)
        },
        handleOpen(data) {
            this.loadDef()
            console.log(data,'data');
            this.relationData = data
            this.outerDialogVisible = true
        },
        handleClose() {
            this.outerDialogVisible = false
            this.$emit('reload')
        },
    },
}
</script>

<style lang="scss">
.flowDialog{
    margin-bottom: 0!important;
    height: calc(100% - 40px);
    /deep/ .el-dialog__body{
        padding: 0!important;
    }
}
</style>