<template>
  <storeForm :showStatus="showStatus" :form="form" title="新增门店" @submit="submit" @close="close" />
</template>

<script>
import storeForm from './form'
import { createStore } from 'api/store'
export default {
  props: {
    showStatus: Boolean,
  },
  data () {
    return {
      form: {}
    }
  },
  components: {
    storeForm
  },
  methods: {
    submit () {
      createStore(this.form).then(res => {
        this.$emit('createStoreSuccess')
      })
    },
    close () {
      this.$emit('close')
    }
  }
}
</script>