<script lang="ts" setup>
|
import type { MdmItemApi } from '#/api/mdm/item';
|
|
import { computed } from 'vue';
|
|
import { Divider, Tag } from 'ant-design-vue';
|
|
const props = defineProps<{
|
item?: MdmItemApi.Item | null;
|
}>();
|
|
// 是否显示(启用批次管理时显示)
|
const visible = computed(() => props.item?.isBatchManaged === true);
|
|
// 已启用的批次属性列表
|
const enabledProps = computed(() => {
|
if (!props.item) return [];
|
const list: string[] = [];
|
if (props.item.produceDateFlag) list.push('生产日期');
|
if (props.item.expireDateFlag) list.push('有效期');
|
if (props.item.receiptDateFlag) list.push('入库日期');
|
if (props.item.vendorFlag) list.push('供应商');
|
if (props.item.purchaseOrderCodeFlag) list.push('采购订单号');
|
if (props.item.lotNumberFlag) list.push('生产批号');
|
if (props.item.qualityStatusFlag) list.push('质量状态');
|
return list;
|
});
|
</script>
|
|
<template>
|
<div v-if="visible" class="mx-4 mt-4 rounded border border-gray-200 bg-gray-50 p-4">
|
<Divider orientation="left">批次属性</Divider>
|
<div v-if="enabledProps.length === 0" class="text-center text-gray-500">
|
该物料未配置批次属性
|
</div>
|
<div v-else class="flex flex-wrap gap-2">
|
<Tag v-for="prop in enabledProps" :key="prop" color="blue">
|
{{ prop }}
|
</Tag>
|
</div>
|
<p class="mt-2 text-xs text-gray-500">
|
以上字段创建批次时必填
|
</p>
|
</div>
|
</template>
|