<template>
  <div>
    <j-modal
        :title="title"
        :width="width"
        :visible="visible"
        switchFullscreen
        @ok="handleOk"
        :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
        @cancel="handleCancel"
        cancelText="关闭">
      <continued-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></continued-form>
    </j-modal>
    <batchCardModalCopy ref="batchCardModalCopy" />
  </div>
</template>

<script>

  import batchCardModalCopy from './../../../modules/checkIn/batchCardModalCopy'
  import ContinuedForm from '@views/room/modules/fangtaiModal/continuedModal/continuedForm'
  export default {
    name: 'PosTableModal',
    components: {
      ContinuedForm,
      batchCardModalCopy
    },
    data () {
      return {
        title:'',
        width:1200,
        visible: false,
        disableSubmit: false,
        makeCardInfo: {}
      }
    },
    methods: {
      add () {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.add();
        })
      },
      edit (record) {
        this.visible=true,
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        this.$refs.realForm.submitForm();
      },
      submitCallback(e) {
        this.$emit('ok', e);
        this.$refs.batchCardModalCopy.edit([this.makeCardInfo])
        this.visible = false;

      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>
