<template>
  <a-modal
    class="container"
    :visible="value"
    title="更新当前限购轮次"
    @ok="handleOk"
    @cancel="handleCancel"
  >
    <a-form
      :form="form"
    >
      <a-form-item
        label="限购轮次描述"
        v-bind="formItemLayout"
      >
        <a-input
          style="width:450px"
          v-decorator="[
            'description',
            {
              rules: [{ required: true, message: '请输入限购轮次描述' }]
            }
          ]"
        ></a-input>
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script>
import { updateLimitRound } from '@/api/systemSetting/limitGroup'
import limitGroupMixin from './limitGroupMixin.js'

export default {
  mixins: [limitGroupMixin],
  props: {
    formData: {
      type: Object,
      default: () => {}
    }
  },

  methods: {
    handleOk (e) {
      e.preventDefault()
      this.form.validateFields((err, values) => {
        if (!err) {
          updateLimitRound(this.formData.id, values).then(res => {
            this.$message.success('更新成功。')
            this.form.resetFields()
            this.$emit('input', false)
            this.$emit('update')
          })
        }
      })
    }
  }
}
</script>

<style scoped>
.container>>>.ant-modal-content{
  width: 680px;
}
.container>>>.ant-col-sm-4{
  width: auto
}
.container>>>.ant-col-sm-20{
  width: auto
}
.container>>>.ant-select-selection--single{
  width: 100px;
}
.tips{
  height: 45px;
  line-height: 40px;
  padding-left: 20px;
  color:rgb(255,132,8);
  font-size: 14px;
  margin-bottom: 20px;
  background: rgb(251,252,207);

}
</style>
