<template>
	<a-form :model="createForm" :label-col="{span: 4}" labelAlign="left">
		<a-row gutter="20">
			<a-col span="24">
				<a-form-item required label="是否至今" name="是否至今">
					<a-radio-group v-model:value="createForm.end_today" button-style="solid">
						<a-radio-button value="1">非至今</a-radio-button>
						<a-radio-button value="2">至今</a-radio-button>
					</a-radio-group>
				</a-form-item>
			</a-col>
			<a-col span="8">
				<a-form-item label="公司名称" name="company_name">
					<a-input v-model:value="createForm.company_name" placeholder="请输入公司名称" />
				</a-form-item>
			</a-col>
			<a-col span="8">
				<a-form-item required label="职位" name="position">
					<a-input v-model:value="createForm.position" placeholder="请输入职位" />
				</a-form-item>
			</a-col>
			<a-col span="8">
				<a-form-item label="离职原因" name="reason_for_leaving">
					<a-input v-model:value="createForm.reason_for_leaving" placeholder="请输入离职原因" />
				</a-form-item>
			</a-col>
		</a-row>
		<a-row gutter="20">
			<a-col>
				<a-button type="primary" @click="onSubmit">保存</a-button>
			</a-col>
			<a-col>
				<a-button style="margin-left: 10px">重置</a-button>
			</a-col>
		</a-row>
	
	</a-form>
	
</template>

<script lang="ts" setup>
	import { ref, onMounted, computed, defineProps, watch, defineEmits } from 'vue';
	import { message } from 'ant-design-vue';
	import { PostJobapplicantAdd, PostJobapplicantUpdate } from '@/apis/models';
	const emit = defineEmits();
	const onSubmit = () => {
		// PostJobapplicantAdd(createForm.value).then(res => {
		// 	message.success('基本资料保存成功')
		// 	emit('toNext', {activeKey: "2"})
		// })
		emit('toNext', { activeKey: "8" })
	}
	let createForm = ref({
		  start_year: 0,
		      start_month: 0,
		      end_year: 0,
		      end_month: 0,
		      end_today: 0,
		      company_name: '',
		      position: '',
		      reason_for_leaving: ''
	})
	
	const resetForm = () => {
		createForm.value = {
			  start_year: 0,
			      start_month: 0,
			      end_year: 0,
			      end_month: 0,
			      end_today: 0,
			      company_name: '',
			      position: '',
			      reason_for_leaving: ''
		}
	}
</script>

<style>
</style>