2026-10-12 20:33:39 +08:00
< script setup lang = "ts" >
import { computed } from 'vue'
2026-10-13 20:44:31 +08:00
import ChartDetailsDialog from './ChartDetailsDialog.vue'
import AnalyticsChart from './AnalyticsChart.vue'
2026-10-12 20:33:39 +08:00
import type { DailyResponse } from '../types'
2026-10-13 20:44:31 +08:00
import { label , quantityText , shownQuantity , reasonsText } from '../state'
import { skuTrendOption } from '../skuTrendChart'
2026-10-12 20:33:39 +08:00
const props = defineProps < { data : DailyResponse } > ()
2026-10-13 20:44:31 +08:00
const option = computed (() => skuTrendOption ( props . data . points ))
const hasData = computed (() => props . data . points . some ( point => point . dataStatus !== 'UNKNOWN' && shownQuantity ( point ) != null ))
2026-10-12 20:33:39 +08:00
</ script >
< template >
< section aria -label =" SKU每日出库趋势 " >
2026-10-12 21:36:24 +08:00
< h3 >{{ data . summary . sku }} · 每日出库趋势 </ h3 >
< p > 所属货主 : {{ data . summary . customerCode || '—' }} · {{ data . summary . productName || '—' }}</ p >
< p >{{ data . summary . dataStatus === 'COMPLETE' ? '完整出库量' : '已采集出库量' }} : {{ quantityText ( shownQuantity ( data . summary )) }} {{ data . summary . quantityUnit === 'PCS' ? '件' : '单位未知' }} ; {{ label ( data . summary . dataStatus ) }} 。 今日为已采集累计 。 </ p >
2026-10-13 20:44:31 +08:00
< p v-if = "!hasData" > 所选范围尚无可靠数据 , 未知日期不作为零销量 。 </ p >
< p class = "trend-legend" > 实线 / 实心点 : 完整日 · 虚线 / 空心点 : 未完整日 · 空缺 : 未知 , 缺失日期断线 </ p >
< AnalyticsChart :option = "option" class = "sku-trend" aria -label =" SKU每日出库趋势 " />
< ChartDetailsDialog title = "每日数量、完整性及覆盖证据" :reset-on = "data" >
2026-10-12 20:33:39 +08:00
< table class = "density-table" >< thead >< tr >< th > 北京时间日期 </ th >< th > 完整出库量 </ th >< th > 已采集量 </ th >< th > 状态 </ th >< th > 覆盖截止 </ th >< th > 缺口原因 </ th ></ tr ></ thead >< tbody >
2026-10-12 21:36:24 +08:00
< tr v-for = "point in data.points" :key="point.businessDate" >< td >{{ point . businessDate }}</ td >< td >{{ quantityText ( point . outboundQuantity ) }}</ td >< td >{{ quantityText ( point . observedQuantity ) }}</ td >< td >{{ label ( point . dataStatus ) }}</ td >< td >{{ point . coveredUntil ?? '—' }}</ td >< td >{{ reasonsText ( point . reasonCodes ) }}</ td ></ tr >
2026-10-12 20:33:39 +08:00
</ tbody ></ table >
2026-10-13 20:44:31 +08:00
</ ChartDetailsDialog >
2026-10-12 20:33:39 +08:00
</ section >
</ template >
< style scoped >
2026-10-13 20:44:31 +08:00
. sku - trend { display : block ; width : 100 % ; height : 340 px ; }
. trend - legend { color : var ( -- el - text - color - secondary ); font - size : var ( -- admin - font - caption ); }
2026-10-12 20:33:39 +08:00
</ style >