|
|
|
|
@ -218,6 +218,14 @@ const displayValue = (value: unknown) => {
|
|
|
|
|
|
|
|
|
|
const formatCardLine = (label: string, value: unknown) => `${label}: ${displayValue(value)}`
|
|
|
|
|
|
|
|
|
|
const formatUnitStocksDisplay = (card?: { unitStocks?: Array<{ stockDisplay?: string }> }, fallback?: string) => {
|
|
|
|
|
const display = card?.unitStocks
|
|
|
|
|
?.map((item) => item?.stockDisplay)
|
|
|
|
|
.filter((item): item is string => Boolean(item))
|
|
|
|
|
.join('/')
|
|
|
|
|
return display || fallback
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const summaryCards = computed(() => {
|
|
|
|
|
const data: StockStatisticsCardsRespVO = statisticsCards.value || {}
|
|
|
|
|
const productStock = data.productStock || {}
|
|
|
|
|
@ -265,9 +273,9 @@ const summaryCards = computed(() => {
|
|
|
|
|
lines: [
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.inboundOrders'), todayIn.orderCount),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.detailLines'), todayIn.itemCount),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.productIn'), todayIn.productDisplay),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.materialIn'), todayIn.materialDisplay),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.sparePartIn'), todayIn.sparePartDisplay)
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.productIn'), todayIn.productStock?.stockDisplay || todayIn.productDisplay),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.materialIn'), formatUnitStocksDisplay(todayIn.materialStock, todayIn.materialDisplay)),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.sparePartIn'), formatUnitStocksDisplay(todayIn.sparePartStock, todayIn.sparePartDisplay))
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
@ -277,9 +285,9 @@ const summaryCards = computed(() => {
|
|
|
|
|
lines: [
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.outboundOrders'), todayOut.orderCount),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.detailLines'), todayOut.itemCount),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.productOut'), todayOut.productDisplay),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.materialOut'), todayOut.materialDisplay),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.sparePartOut'), todayOut.sparePartDisplay)
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.productOut'), todayOut.productStock?.stockDisplay || todayOut.productDisplay),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.materialOut'), formatUnitStocksDisplay(todayOut.materialStock, todayOut.materialDisplay)),
|
|
|
|
|
formatCardLine(t('ErpStock.Overview.cardLabels.sparePartOut'), formatUnitStocksDisplay(todayOut.sparePartStock, todayOut.sparePartDisplay))
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|