<template>
  <div>
    <el-button size="mini" type="primary" @click="drawer=true">审 核</el-button>
    <el-dialog append-to-body :visible.sync="drawer" width="400px">
      <el-form :model="form" :rules="rules" ref="form" label-width="120px" label-position="right" size="mini">
        <el-form-item label="回款归属月份:" prop="period">
          <el-date-picker
            v-model="form.period"
            type="month"
            value-format="yyyy-MM"
            placeholder="选择月">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <div class="dialog-footer">
        <el-button size="small" @click="drawer=false" class="normal-btn-width">取 消</el-button>
        <el-button size="small" type="warning" @click="submit" class="normal-btn-width btn-warning">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: '',
  data() {
    return {
      drawer:false,
      form: {
        period:''
      },
      rules:{
        period:[
          { required: true, message: '请填写回款归属月份', trigger: 'blur'},
        ],
      }
    };
  },
  computed:{
  },
  watch:{
  },
  methods: {
    async submit () {
      let res = await this.$api.requested({
        "id": "20221226153304",
        "content": {
            "sa_paybillid":this.$route.query.id,
            "period":this.form.period
        }
      })
      this.tool.showMessage(res,() => {
        this.drawer = false
        this.$emit('onSuccess')
      })
    }
  },
};
</script>

<style scoped>

</style>
