<template>
  <div>
    <el-dialog title="质保说明" :visible.sync="dialogVisible" width="40%" v-dialogDrag append-to-body>
      <el-descriptions class="margin-top" :column="1" :size="'medium'" border style="margin-bottom: 1rem">
        <el-descriptions-item>
          <template slot="label">
            质量保证期为车辆行驶多少公里
          </template>
          <el-input v-model="data.qualityMileage"/>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            或者多少天
          </template>
          <el-input v-model="data.qualityDay"/>
        </el-descriptions-item>
      </el-descriptions>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="handleOK">确 定</el-button>
        <el-button @click="dialogVisible = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import UserChoose from "@/views/repair/Components/UserChoose.vue";

export default {
  name: "QualityExplain",
  components: {UserChoose},
  props: {
    value: {
      type: Object,
      default: null
    }
  },
  watch: {
    value(val) {
      this.data = val
    }
  },
  data() {
    return {
      dialogVisible: false,
      data: {
        qualityMileage: 3000,
        qualityDay: 30
      }
    }
  },
  methods: {
    open() {
      this.dialogVisible = true
    },
    handleOK() {
      this.$emit("input", this.data)
      this.dialogVisible = false
    }
  }
}
</script>

<style scoped lang="scss">

</style>
