<template>
  <div>
    <xy-dialog ref="dialog" :width="30" :is-show.sync="isShow" :type="'form'" title="预约次数调整"
      :form="form" :rules='rules' @submit="submit">
      <template v-slot:appointment_total>
        <div class="xy-table-item">
          <div class="xy-table-item-label" style="font-weight: bold">
            <span style="color: red;font-weight: bold;padding-right: 4px;">*</span>可预约总数：
          </div>
          <div class="xy-table-item-content">
            <el-input type="number" v-model="form.appointment_total"></el-input>
          </div>
        </div>
      </template>

    </xy-dialog>

  </div>
</template>

<script>

  import {save} from "@/api/student/index.js"
  export default {
    components: {

    },
    data() {
      return {
        isShow: false,
        form: {
          appointment_total: '',
        },

        rules: {
          appointment_total: [{
            required: true,
            message: '请填写总次数'
          }]
        }
      }
    },
    created() {
    },
    methods: {
      submit() {
        save({
          ...this.form
        }).then(res => {
          this.$message({
            type: 'success',
            message: '调整成功'
          })
          this.isShow = false
          this.$emit('refresh')
        })
      },

      setRow(row) {
        this.form = this.base.requestToForm(row,this.form)
      },
    },
    watch: {
      isShow(newVal) {
        if (newVal) {

        } else {
          this.$refs['dialog'].reset()
        }
      },
    }

  }
</script>

<style scoped lang="scss">
  ::v-deep .teacher_id{
    flex-basis: 100%;
  }
</style>
