<!-- 添加教育和培训经历 -->
<template>
	<view class="experience">
		<!-- 导航栏 -->
		<u-navbar class="experience-bar" back-text="" back-icon-color="#fff" title="添加培训与教育经历" title-color="#fff" :background="background">
			<view class="experience-bar-right" slot="right">保存</view>
		</u-navbar>
		
		<!-- 表单 -->
		<view class="experience-form">
			<u-form :model="form" label-position="top">
				<u-form-item label="学校名称">
					<u-input v-model="form.school" placeholder="请输入学校名称"/>
				</u-form-item>
				<u-form-item label="课程名称">
					<u-input v-model="form.classes" placeholder="请输入课程名称"/>
				</u-form-item>
				<u-form-item label="在校时间">
					<u-input v-model="form.startDate" placeholder="开始时间" disabled @click="startDateShow = true" inputAlign="center"/>
					<u-picker mode="time" v-model="startDateShow" :params="{ year: true,
	month: true}" :end-year="endYear" @confirm="startDateConfirm"/>
					<view class="divider"></view>
					<u-input v-model="form.endDate" placeholder="结束时间" @click="endDateShow = true" inputAlign="center"/>
					<u-picker mode="time" v-model="endDateShow" :params="{ year: true,
					month: true}" :end-year="endYear" @confirm="endDateConfirm"/>
				</u-form-item>
				<u-form-item label="学习内容">
					<u-input v-model="form.content" placeholder="请输入学习内容"/>
				</u-form-item>
				<u-form-item label="证书名称">
					<u-input v-model="form.certificate" placeholder="请输入证书名称"/>
				</u-form-item>
				<u-form-item label="老师评价">
					<u-input v-model="form.evaluation" placeholder="请输入老师评价"/>
				</u-form-item>
			</u-form>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'AddExperience',
		data() {
			return {
				background: {
					backgroundColor: '#3D5D4C'
				},
				form: {
					school: '',
					classes: '',
					startDate: '',
					endDate: '',
					content: '',
					
				},
				startDateShow: false,
				endDateShow: false,
				endYear: (new Date()).getFullYear()
			}
		},
		methods: {
			/**
			 * 入职时间弹框确认
			 * @param { Object } e 
			 */
			startDateConfirm(e) {
				this.form.startDate = e.year + '-' + e.month
			},
			/**
			 * 离职时间弹框确认
			 * @param { Object } e 
			 */
			endDateConfirm(e) {
				this.form.endDate = e.year + '-' + e.month
			}
		}
	}
</script>

<style lang="scss" scoped>
@import './myResume.scss';
</style>
