<template>
  <div id="app" class= "from_box">
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="设备编号">
        <el-input v-model="form.deviceId"></el-input>
      </el-form-item>
      <el-form-item label="设备名称">
        <el-input v-model="form.deviceName"></el-input>
      </el-form-item>
      <el-form-item label="设备启用日期">
        <el-col :span="11">
          <el-input v-model="form.deviceStartDate"  placeholder="YYYY-MM-DD"></el-input>
<!--          <el-date-picker type="date" placeholder="选择日期" v-model="form.deviceStartDate" style="width: 100%;"></el-date-picker>-->
        </el-col>
      </el-form-item>
      <el-form-item label="设备数据单位">
        <el-input v-model="form.deviceUnit"></el-input>
      </el-form-item>
      <el-form-item label="所属企业id">
        <el-input v-model="form.companyId"></el-input>
      </el-form-item>
      <el-form-item label="所属企业名称">
        <el-input v-model="form.companyName"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">立即创建</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  data() {
    return {
      form: {}
    }
  },
  methods: {
    onSubmit() {
      this.$post('/demp/info/deviceInfo', this.form).then(() => {
        this.$message({
          message: this.$t('tips.createSuccess'),
          type: 'success'
        })
        this.$emit('success')
      }).catch(r => {
      })
    }
  }
}
</script>
<style>
h1{
  text-align: center;
}
</style>
