<template>
  <div class="app-container">
    <el-form ref="form" label-width="80px">
      <el-form-item label="工器具名称" label-width="200px" prop="equipName">
        <el-input v-model="items.equipName" :style="{width:'30%'}" :disabled="isDisabled"/>
      </el-form-item>
      <el-form-item label="型号"   label-width="200px" prop="model">
        <el-input v-model="items.model" :style="{width:'30%'}" :disabled="isDisabled"/>
      </el-form-item>
      <el-form-item label="单位" label-width="200px" prop="unit">
        <el-input v-model="items.unit" :style="{width:'30%'}" :disabled="isDisabled"/>
      </el-form-item>
      <el-form-item label="数量" label-width="200px" prop="num">
        <el-input v-model="items.num" :style="{width:'30%'}" :disabled="isDisabled"/>
      </el-form-item>
      <el-form-item label="设备类型" label-width="200px" prop="equipType">
        <el-input v-model="items.equipType" :style="{width:'30%'}" :disabled="isDisabled"/>
      </el-form-item>
      <el-form-item label="检测时间" label-width="200px" prop="detectionTime">
        <el-date-picker
          v-model="items.detectionTime"
          type="date"
          :editable="false"
          :disabled="isDisabled"
          :style="{width:'30%'}"
          placeholder="选择日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="是否强制检测检验" label-width="200px" prop="isForceDetection">
        <el-select v-model="items.isForceDetection" :style="{width:'30%'}" :disabled="isDisabled">
          <el-option label="是" value="1"></el-option>
          <el-option label="否" value="0"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="下次检测时间" label-width="200px" prop="nextDetectionTime">
        <el-date-picker
          v-model="items.nextDetectionTime"
          type="date"
          :editable="false"
          :disabled="isDisabled"
          :style="{width:'30%'}"
          placeholder="选择日期">
        </el-date-picker>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  components: {},
  props: {
    isDisabled:true,
    items: {
      type: Object,
      default: () => {
        return {
          equipName: '',
          model: '',
          unit: '',
          num: '',
          equipType: '',
          detectionTime: '',
          isForceDetection: '',
          nextDetectionTime: '',
        }
      }
    },
  },
  data() {
    return{
      rules : {
        equipName: [
          { required: true, message: '请输入工器具单位名称', trigger: 'blur' },
        ],
        model: [
          { required: true, message: '请输入型号', trigger: 'blur' },
        ],
        unit: [
          { required: true, message: '请输入单位', trigger: 'blur' },
        ],
        num: [
          { required: true, message: '请输入数量', trigger: 'blur' },
        ],
        equipType: [
          { required: true, message: '请输入设备类型', trigger: 'blur' },
        ],
        detectionTime: [
          { required: true, message: '请输入检测时间', trigger: 'blur' },
        ],
        isForceDetection: [
          { required: true, message: '请输入是否强制检测检验', trigger: 'blur' },
        ],
        nextDetectionTime: [
          { required: true, message: '请输入下次检测时间', trigger: 'blur' },
        ]
      }
    }
  }
}
</script>
