<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
    <!-- <bus-market-member-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-market-member-form> -->
    <bus-market-coupons-event-detail-list :eventId="eventId" ref="modalCouponsEventDetailList"></bus-market-coupons-event-detail-list>
  </j-modal>
</template>

<script>


  import BusMarketCouponsEventDetailList from "./BusMarketCouponsEventDetailList";
  export default {
    name: 'BusMarketCouponsEventDetailListModal',
    components: {
      BusMarketCouponsEventDetailList
    },
    props: {
      eventId: {
        type: String,
        default: ''
      }
    },
    data () {
      return {
        title:'',
        width:800,
        visible: false,
        disableSubmit: false,
        // eventId:'',
      }
    },
    methods: {
      add (eventId) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.modalCouponsEventDetailList.add(this.eventId);
        })
      },
      edit (record) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.modalCouponsEventDetailList.edit(record);
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        this.$refs.modalCouponsEventDetailList.submitForm();
      },
      submitCallback(){
        this.$emit('ok');
        this.visible = false;
      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>