<template>
	<request-form
		title="报销申请"
		subtitle="填写报销信息，支持手机端快速提交"
		biz-type="reimburse"
		:request-api="submitReimburse"
		:initial-form="initialForm"
		:sections="sections"
		:flow-fields="flowFields"
	/>
</template>

<script>
import RequestForm from '@/components/hrm/RequestForm.vue'
import { addReimburseReq } from '@/api/hrm/reimburse'

export default {
	components: { RequestForm },
	data() {
		return {
			initialForm: { reimburseType: '', totalAmount: '', applyFileIds: '', reason: '', remark: '' },
			sections: [
				{ key: 'basic', title: '基础信息', fields: [
					{ key: 'reimburseType', label: '报销类型', type: 'select', required: true, placeholder: '请选择报销类型', options: ['差旅报销', '招待报销', '采购报销', '办公报销', '其他'] },
					{ key: 'totalAmount', label: '报销金额', type: 'input', inputType: 'digit', required: true, placeholder: '请输入金额' },
					{ key: 'applyFileIds', label: '附件', type: 'file', required: false, placeholder: '上传附件文件' }
				]},
				{ key: 'desc', title: '说明', fields: [
					{ key: 'reason', label: '事由', type: 'textarea', required: true, placeholder: '请说明报销用途' },
					{ key: 'remark', label: '备注', type: 'textarea', required: false, placeholder: '可选' }
				]}
			],
			flowFields: [
				{ key: 'reimburseType', label: '报销类型', required: true },
				{ key: 'totalAmount', label: '报销金额', required: true },
				{ key: 'reason', label: '事由', required: true }
			]
		}
	},
	methods: { submitReimburse(payload) { return addReimburseReq(payload) } }
}
</script>

<style scoped></style>