<template>
    <j-modal
            :title="title"
            :width="width"
            :visible="visible"
            switchFullscreen
            @ok="handleOk"
            @cancel="handleCancel">
        <commodity-return ref="realForm" @ok="submitCallback" :disabled="disableSubmit" :agreementOrderFeeId="agreementOrderFeeId"></commodity-return>
    </j-modal>
</template>

<script>
    import CommodityReturn from './commodityReturn'
    export default {
        name: 'commodityReturnModal',
        components: {
            CommodityReturn
        },
        props: {
        },
        data () {
            return {
                title:'',
                agreementOrderFeeId:'',
                width:800,
                visible: false,
                disableSubmit: false,
            }
        },
        methods: {
            show () {
                this.visible=true
                this.$nextTick(()=>{
                    this.$refs.realForm.show();
                })
            },
            close () {
                this.$emit('close');
                this.visible = false;
            },
            handleOk () {
                this.$refs.realForm.submitForm();
            },
            submitCallback(){
                this.$emit('ok');
                this.visible = false;
            },
            handleCancel () {
                this.close()
            }
        }
    }
</script>

