<template>
    <j-modal
            :title="title"
            :width="width"
            :visible="visible"
            switchFullscreen
            :footer="null"
            :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
            @cancel="handleCancel"
            cancelText="关闭"
            >
        <house-price-scheme-detail-list ref="detailModal" :schemeId="schemeId"></house-price-scheme-detail-list>
    </j-modal>
</template>

<script>

    import HousePriceSchemeDetailList from "./housePriceSchemeDetailList";
    export default {
        name: 'housePriceSchemeDetailModal',
        components: {
            HousePriceSchemeDetailList,
        },
        data () {
            return {
                title:'',
                width:1350,
                visible: false,
                disableSubmit: false,
                schemeId:null,
            }
        },
        methods: {
            add () {
                this.visible=true
                this.$nextTick(()=>{
                    this.$refs.detailModal.add();
                })
            },
            edit (record) {
                this.visible=true
                this.$nextTick(()=>{
                    this.$refs.detailModal.edit(record);
                })
            },
            close () {
                this.$emit('close');
                this.visible = false;
            },
            handleOk () {
                this.$refs.detailModal.submitForm();
            },
            submitCallback(){
                this.$emit('ok');
                this.visible = false;
            },
            handleCancel () {
                this.close()
            }
        }
    }
</script>
