<template>
  <div class="app-container" style="min-height: 100%;">
    <el-form :model="day" :rules="rules" ref="day" label-width="130px">
      <div class="form-item">
        <el-row>
          <el-col :xs="24" :sm="12" :md="8" :lg="4">
            <div class="item-title">
              每日履职
            </div>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8" :lg="5">
            <el-form-item label="营业前提醒：" prop="workType">
              
                <el-input-number size="mini" style="width: 70%;" v-model="day.font" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
              分钟
            
            
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8" :lg="5">
            <el-form-item label="营业中提醒：" prop="educationType">
              <el-input-number size="mini" style="width: 70%;" v-model="day.z" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
              分钟
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="8" :lg="5">
            <el-form-item label="营业后提醒：" prop="professionalQualifications">
              <el-input-number size="mini" style="width: 70%;" v-model="day.h" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
              分钟
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8" :lg="5">
            <el-form-item label="全天提醒：" prop="professionalQualifications">
              <el-input-number size="mini" style="width: 70%;" v-model="day.all" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
              分钟
            </el-form-item>
          </el-col>
        </el-row>
      </div>
    </el-form> 
    <el-form :model="week" :rules="rules" ref="week" label-width="130px">
      <div class="form-item">
        <el-row>
          <el-col :xs="24" :sm="12" :md="8" :lg="4">
            <div class="item-title">
              每周履职
            </div>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8" :lg="5">
            <el-form-item label="提前提醒：" prop="educationType">
              <el-input-number size="mini" style="width: 70%" v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
              天
            </el-form-item>
          </el-col>
        </el-row>
      </div>
    </el-form> 
    <el-form :model="month" :rules="rules" ref="month" label-width="130px">
      <div class="form-item">
        <el-row>
          <el-col :xs="24" :sm="12" :md="8" :lg="4">
            <div class="item-title">
              每月履职
            </div>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8" :lg="5">
            <el-form-item label="提前提醒：" prop="educationType">
              <el-input-number  size="mini" v-model="num" style="width: 70%" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
              天
            </el-form-item>
          </el-col>
        </el-row>
      </div>
    </el-form> 
    <el-form :model="season" :rules="rules" ref="season" label-width="130px">
      <div class="form-item">
        <el-row>
          <el-col :xs="24" :sm="12" :md="8" :lg="4">
            <div class="item-title">
              每季履职
            </div>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8" :lg="5">
            <el-form-item label="提前提醒：" prop="educationType">
              <el-input-number  size="mini" v-model="num" style="width: 70%" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
    </el-form> 
    <el-form :model="holfYear" :rules="rules" ref="holfYear" label-width="130px">
      <div class="form-item">
        <el-row>
          <el-col :xs="24" :sm="12" :md="8" :lg="4">
            <div class="item-title">
              半年履职
            </div>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8" :lg="5">
            <el-form-item label="提前提醒：" prop="educationType">
              <el-input-number  size="mini" v-model="num" style="width: 70%" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
    </el-form> 
    <el-form :model="year" :rules="rules" ref="year" label-width="130px">
      <div class="form-item">
        <el-row>
          <el-col :xs="24" :sm="12" :md="8" :lg="4">
            <div class="item-title">
              每年履职
            </div>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8" :lg="5">
            <el-form-item label="提前提醒：" prop="educationType">
              <el-input-number size="mini" v-model="num" style="width: 70%" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
    </el-form>
    <div style="margin-top: 50px; margin-left: 42%">
      <el-button type="primary" @click="saveExtend" size="small">提交</el-button>
      <el-button type="primary" @click="nosaveExtend" size="small">取消</el-button>
    </div>
  </div>
  
</template>

<script>
export default {
  props: [],
  components: {},
  data() {
    return {
      num: 1,
      day:{},
      week:{},
      month:{},
      season:{},
      holfYear:{},
      year:{},
      formData:{
        deptId: null,
        duties: null,
        workType: null,
        isFullTime: "1",
        highestEducation: null,
        educationType: null,
        certificateWork: "1",
        professionalQualifications: null,
        certificateFailReason: null,
        workTime: null,
        entryTime: null,
        bornTime: null,
        responsibilitiesLeaderName: null,
        responsibilitiesLeaderDuties: null,
        qualificationCertificateUrl: null,
        userId: null,
      },
      rules: {
        name: [
          {
            required: true,
            message: "请输入活动名称",
            trigger: "blur",
          },
          {
            min: 3,
            max: 5,
            message: "长度在 3 到 5 个字符",
            trigger: "blur",
          },
        ],
        region: [
          {
            required: true,
            message: "请选择活动区域",
            trigger: "change",
          },
        ],
        date1: [
          {
            type: "date",
            required: true,
            message: "请选择日期",
            trigger: "change",
          },
        ],
        date2: [
          {
            type: "date",
            required: true,
            message: "请选择时间",
            trigger: "change",
          },
        ],
        type: [
          {
            type: "array",
            required: true,
            message: "请至少选择一个活动性质",
            trigger: "change",
          },
        ],
        resource: [
          {
            required: true,
            message: "请选择活动资源",
            trigger: "change",
          },
        ],
        desc: [
          {
            required: true,
            message: "请填写活动形式",
            trigger: "blur",
          },
        ],
      },
    }
  },
  watch: {},
  computed: {},
  beforeCreate() { },
  created() { },
  beforeMount() { },
  mounted() { },
  beforeUpdate() { },
  updated() { },
  destroyed() { },
  methods: {
    request() { },
    handleChange(value) { },
    hello() {
      alert("来自预设逻辑代码的问候")
    },
    saveExtend(){
     // this.formData.userId = this.$route.params.userId;
     
      this.$refs['form'].validate((valid) => {
          if (valid) {
            extendUserInformation(this.formData).then(res=>{
                this.$message.success('保存成功！')
                this.$router.go(-1)
            })
          }
        });

    },


  },
  fillter: {},
}
</script>

<style lang="scss" scoped>
.form-item{
  border: 1px solid #f1f1f1;
  margin-bottom: 2px;
  min-height: 100px;
  display: flex;
  align-items: center;
}
.item-title{
  width: 100px;
  color: #fff;
  background-color: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}
</style>
