<template>
	<a-drawer
		:title="'补单详情'"
		:width="800"
		: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.depotGrainName }}</a-descriptions-item>
				<a-descriptions-item label="审批状态">{{ formData.bankOpApprovalState }}</a-descriptions-item>
				<a-descriptions-item label="审批时间">{{ formData.bankOpApprovalTime }}</a-descriptions-item>
				<a-descriptions-item label="出入库">{{ formData.depotBizType }}</a-descriptions-item>
				<a-descriptions-item label="粮食种类">{{ formData.grainGroup }}</a-descriptions-item>
				<a-descriptions-item label="粮食类型">{{ formData.grainType }}</a-descriptions-item>
				<a-descriptions-item label="库位">{{ formData.shedName }}</a-descriptions-item>
				<a-descriptions-item label="车牌颜色">{{ formData.plateColor }}</a-descriptions-item>
				<a-descriptions-item label="车牌号码(前)">{{ formData.licensePlate }}</a-descriptions-item>
				<a-descriptions-item label="车牌号码(后)">{{ formData.licensePlateBack }}</a-descriptions-item>
				<a-descriptions-item label="司机姓名">{{ formData.driverName }}</a-descriptions-item>
				<a-descriptions-item label="司机电话">{{ formData.driverMobile }}</a-descriptions-item>
				<a-descriptions-item label="过毛时间">{{ formData.grossTime }}</a-descriptions-item>
				<a-descriptions-item label="过皮时间">{{ formData.tareTime }}</a-descriptions-item>
				<a-descriptions-item label="毛重(公斤)">{{ formData.grossWeight }}</a-descriptions-item>
				<a-descriptions-item label="皮重(公斤)">{{ formData.tareWeight }}</a-descriptions-item>
				<a-descriptions-item label="净重(公斤)">{{ formData.netWeight }}</a-descriptions-item>
				<a-descriptions-item label="单价(元/吨)">{{ formData.unitPrice }}</a-descriptions-item>
				<a-descriptions-item label="总价(元)">{{ formData.totalPrice }}</a-descriptions-item>
				<a-descriptions-item label="水份(%)">{{ formData.samplingShuiFen }}</a-descriptions-item>
				<a-descriptions-item label="容重">{{ formData.samplingRongZhong }}</a-descriptions-item>
				<a-descriptions-item label="不完善率">{{ formData.samplingQueShao }}</a-descriptions-item>
				<a-descriptions-item label="霉变">{{ formData.samplingMeiBian }}</a-descriptions-item>
				<a-descriptions-item label="杂质">{{ formData.samplingZaZhi }}</a-descriptions-item>
				<a-descriptions-item label="补单时间">{{ formData.createTime }}</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="depotTruckWeighDoubleForm">
import tool from '@/utils/tool'
import {cloneDeep} from 'lodash-es'
import {required} from '@/utils/formRules'
import depotTruckWeighDoubleApi from '@/api/biz/depotTruckWeighDoubleApi'
// 抽屉状态
const visible = ref(false)
const emit = defineEmits({successful: null})
const formRef = ref()
// 表单数据
const formData = ref({})
const submitLoading = ref(false)

// 打开抽屉
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>
