<template>
  <div>
    <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" :="true" label-width="135px" :inline="true" disabled>
      <el-form-item label="培训名称:">
        <el-input v-model="ruleForm.planName" style="width:337px;" clearable></el-input>
      </el-form-item>
      <el-form-item label="主办部门:">
        <el-input v-model="ruleForm.planHostsDeptName" style="width:337px;" clearable></el-input>
      </el-form-item>
      <el-form-item label="项目负责人:">
        <el-input v-model="ruleForm.planChargePersonName" style="width:337px;" clearable></el-input>
      </el-form-item>
      <el-form-item label="培训渠道:" v-if='ruleForm.planChannel'>
        <el-select v-model="ruleForm.planChannel" clearable style="width:337px;">
          <el-option v-for="item in D_TB_PXQD" :key="item" :label="item.label" :value="item.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="培训地点:">
        <el-input v-model="ruleForm.place" maxlength="100" autosize type="textarea" style="width:337px;" show-word-limit
          placeholder="不能超过100个字"></el-input>
      </el-form-item>
      <el-form-item label="业务类型:">
        <el-select v-model="ruleForm.specialityType" multiple clearable placeholder="请选择业务类型：" style="width:337px;">
          <el-option v-for="item in D_BZ_KTKYWLX" :key="item" :label="item.label" :value="item.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="培训类型:">
        <el-select v-model="ruleForm.otherType" clearable style="width:337px;">
          <el-option v-for="item in GZ_TRAINOT" :key="item" :label="item.label" :value="item.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="培训开始日期:">
        <el-date-picker v-model="ruleForm.startDate" style="width:337px;" type="date" placeholder="培训开始日期"
          format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
      </el-form-item>
      <el-form-item label="培训结束日期:">
        <el-date-picker v-model="ruleForm.finshDate" style="width:337px;" type="date" placeholder="培训结束日期"
          format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
      </el-form-item>
      <el-form-item label="报道截止时间:">
        <el-date-picker v-model="ruleForm.signFinshDate" style="width:337px;" type="date" format="YYYY-MM-DD"
          value-format="YYYY-MM-DD" />
      </el-form-item>
      <el-form-item label="联系人:">
        <el-input v-model="ruleForm.contactorName" clearable style="width:337px;"></el-input>
      </el-form-item>
      <el-form-item label="联系人电话:">
        <el-input v-model="ruleForm.contactorPhone" type="Number" maxlength="11" style="width:337px;"></el-input>
      </el-form-item>
      <el-form-item label="培训预算（元）:">
        <el-input v-model="ruleForm.realBudget" type="Number" maxlength="7" style="width:337px;"></el-input>
      </el-form-item>
      <el-form-item label="考核方式:">
        <el-select v-model="ruleForm.examinationType" clearable style="width:337px;">
          <el-option v-for="item in D_TB_PXKHFS" :key="item" :label="item.label" :value="item.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="培训课时:">
        <el-input v-model="ruleForm.realClassHour" type="Number" maxlength="3" @input="check1"
          style="width:337px;"></el-input>
      </el-form-item>
      <el-form-item label="培训教师:">
        <el-input v-model="ruleForm.teachers" maxlength="200" autosize type="textarea" style="width:337px;"
          show-word-limit></el-input>
      </el-form-item>
      <el-form-item label="是否取证:" v-if='ruleForm.examinationType != "1"'>
        <el-select v-model="ruleForm.sffz" clearable style="width:337px;">
          <el-option v-for="item in D_BZ_SF" :key="item" :label="item.label" :value="item.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="最早开考时间:" v-if='ruleForm.examinationType != "1"'>
        <el-date-picker v-model="ruleForm.examStartTime" style="width:337px;" type="datetime"
          format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
      </el-form-item>
      <el-form-item label="最晚开考时间:" v-if='ruleForm.examinationType != "1"'>
        <el-date-picker v-model="ruleForm.examEndTime" style="width:337px;" type="datetime" placeholder="不选择则不限制"
          format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
      </el-form-item>
      <el-form-item label="考试时长:" v-if='ruleForm.examinationType != "1"'>
        <el-input v-model="ruleForm.examTime" type="number" clearable style="width:337px;"> <template
            #append>分钟</template></el-input>
      </el-form-item>
      <el-form-item label="培训内容:" style='width:100%;'>
        <el-input v-model="ruleForm.realContent" maxlength="500" type="textarea" show-word-limit style='width:100%;' />
      </el-form-item>
      <el-form-item label="备注:" style='width:100%;'>
        <el-input v-model="ruleForm.bz" maxlength="500" type="textarea" show-word-limit style='width:100%;' />
      </el-form-item>
    </el-form>
  </div>
</template>
<script setup>
import { ref, onMounted, defineProps, defineEmits, getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance();
const { D_BZ_KTKYWLX, D_TB_PXKHFS, D_TB_PXQD, D_BZ_SF, D_BZ_PXSSCTFS, GZ_TRAINOT } = proxy.$dict("D_BZ_KTKYWLX", "D_TB_PXKHFS",
  "D_TB_PXQD", "D_BZ_SF", "D_BZ_PXSSCTFS", "GZ_TRAINOT");
const props = defineProps({
  ruleForm: Object,
  type: String
});
const ruleForm = ref({})
onMounted(() => {
  ruleForm.value = props.ruleForm
})
</script>
<style>
::v-deep .el-form-item__content {
  flex-wrap: nowrap !important;
}

.el-form {
  width: 100%;
  padding: 0 20px;
  margin: 10px auto;
  flex-wrap: wrap;
  justify-content: space-between;
}

.el-form-item {
  text-align: center;
}
</style>