<template>
	<a-drawer
		:title="'门锁预约详情'"
		:width="600"
		:visible="visible"
		:destroy-on-close="true"
		:footer-style="{ textAlign: 'right' }"
		@close="onClose"
	>
		<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
			<a-descriptions :column="1" size="middle" bordered class="mb-2">
				<a-descriptions-item label="库位">{{ formData.shedName }}</a-descriptions-item>
				<a-descriptions-item label="锁名称">{{ formData.lockName }}</a-descriptions-item>
				<a-descriptions-item label="描述">{{ formData.remark }}</a-descriptions-item>
				<a-descriptions-item label="审批状态">{{ formData.bankOpApprovalState }}</a-descriptions-item>
				<a-descriptions-item label="审批信息">{{ formData.bankOpApprovalRemark }}</a-descriptions-item>
				<a-descriptions-item label="审批时间">{{ formData.bankOpApprovalTime }}</a-descriptions-item>
			</a-descriptions>
		</a-form>
		<template #footer>
			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
		</template>
	</a-drawer>
</template>

<script setup name="depotRepayOrderForm">
import {message} from 'ant-design-vue'
import tool from '@/utils/tool'
import {cloneDeep} from 'lodash-es'

// 抽屉状态
const visible = ref(false)
const emit = defineEmits({successful: null})
const formRef = ref()
// 表单数据
const formData = ref({})
const submitLoading = ref(false)
const depotShedOptions = ref([])
const depotOptions = ref([])

// 打开抽屉
const onOpen = (record) => {
	visible.value = true
	if (record) {
		let recordData = cloneDeep(record)
		formData.value = Object.assign({}, recordData)
	}
}
// 关闭抽屉
const onClose = () => {
	formRef.value.resetFields()
	formData.value = {}
	visible.value = false
}
// 默认要校验的
const formRules = {}
// 抛出函数
defineExpose({
	onOpen
})
</script>
