import {getBasicThirdSys} from "@/api/basic/basicThirdSys";
import {getLoading} from "@/utils";
import {deviceRepairInfo} from "@/api/dev/deviceRepairApi";


export default {
  name: "deviceRepairDialog",
  props: {repairId: {require: true}},
  data() {
    return {
      info: null
    }
  },
  watch: {
    val(newVal) {
      this.$emit('update:value', newVal);
    },
    value(newVal) {
      this.val = newVal
    },
  },
  created() {
    this.val = this.value
    this.getInfo()
  },
  methods: {
    getInfo() {
      let load = getLoading(this)
      deviceRepairInfo(this.repairId).then(res => {
        load.close()
        if (res.code != 20000) {
          this.$message.error(res.message)
          return
        }
        this.info = res.data
      }).catch(() => {
        load.close()
      })
    }
  }
}
