<template>
  <div>
    <el-form :model="infoForm" label-width="120px">
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="申请人姓名">
            <el-input :value="infoForm.applicantName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="所在部门">
            <el-input :value="infoForm.departName"></el-input>
            <!--            <el-select v-model="infoForm.departName" style="width: 100%" placeholder="请选择学历">-->
            <!--              <el-option-->
            <!--                v-for="dict in dict.type.department_type"-->
            <!--                :key="dict.value"-->
            <!--                :label="dict.label"-->
            <!--                :value="Number(dict.value)">-->
            <!--              </el-option>-->
            <!--            </el-select>-->
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="司机">
            <el-input :value="infoForm.driver"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="人数">
            <el-input :value="infoForm.peopleNumber"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="车牌号">
            <el-input :value="infoForm.licensePlate"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <!--          <el-form-item label="用车类型">-->
          <!--            <el-input :value="resolveVehicle(infoForm.vehicleType)"></el-input>-->
          <!--          </el-form-item>-->
          <el-form-item label="用车类型">
            <!--            <el-input :value="resolveVehicle(infoForm.vehicleType)"></el-input>-->

            <el-select v-model="infoForm.vehicleType" style="width: 100%" placeholder="请选择用车类型">
              <el-option
                v-for="dict in dict.type.vehicle_types"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="用车开始时间">
            <el-input :value="infoForm.startTime"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="用车结束时间">
            <el-input :value="infoForm.endTime"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="出发地">
            <el-input :value="infoForm.departurePlace"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="目的地">
            <el-input :value="infoForm.destination"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="公里数">
            <el-input :value="infoForm.kilometers"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="类型">
            <el-select :value="infoForm.type" style="width: 100%;">
              <el-option
                v-for="dict in dict.type.vehicle_use_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              ></el-option>
            </el-select>

          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <el-form-item label="用车原因">
            <el-input
              type="textarea"
              :rows="5"
              :value="infoForm.reason"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col>
          <el-form-item label="备注">
            <el-input type="textarea" :value="infoForm.remarks"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>


  </div>
</template>

<script>
import {getInfo} from "@/api/smartSchool/vehicleManage/application";
// import {UseType} from "@/enums/vehicle/application"

export default {
  name: "VehicleInfo",
  dicts: ['vehicle_types', 'department_type', 'vehicle_use_type', 'UseType'],

  props: {
    id: {
      type: [String, Number],
      default: ''
    }
  },
  data() {
    return {
      // UseType,
      infoForm: {}
    }
  },
  created() {
    this.getDetailInfo();
  },
  methods: {
    /** 获取详情 */
    getDetailInfo() {
      getInfo(this.id).then(response => {
        this.infoForm = response.data;
      })
    }
  }
}
</script>

<style scoped>

</style>
