2026-08-26 16:50:25 +08:00
< template >
< view class = "receiving-summary" >
< view class = "receiving-summary-head" >
2026-08-26 16:58:41 +08:00
< view >< text class = "receiving-summary-label" > 当前柜号 </ text >< text class = "receiving-summary-container" >{{ session ? . containerNo || '—' }}</ text ></ view >
2026-08-26 16:50:25 +08:00
< text class = "receiving-summary-status" >{{ statusLabel }}</ text >
</ view >
< view class = "receiving-summary-context" >
2026-08-26 17:09:07 +08:00
< view class = "receiving-summary-destinations" >< text class = "destination-label" > 目的仓 : </ text >< view class = "destination-tags" >< text v-for = "value in destinationValues" :key="value" >{{ value }}</ text ></ view ></ view >
2026-08-26 16:50:25 +08:00
</ view >
< view class = "receiving-summary-metrics" >
2026-08-26 16:58:41 +08:00
< view >< text class = "metric-value" >{{ inboundCodeCount }}</ text >< text class = "metric-label" > 入仓码 </ text ></ view >
< view >< text class = "metric-value" >{{ plannedPalletCount }}</ text >< text class = "metric-label" > 计划托数 </ text ></ view >
< view >< text class = "metric-value" >{{ totalPackages }}</ text >< text class = "metric-label" > 计划箱数 </ text ></ view >
< view >< text class = "metric-value metric-pending" >{{ pendingPackages }}</ text >< text class = "metric-label" > 待收箱数 </ text ></ view >
2026-08-26 16:50:25 +08:00
</ view >
2026-09-09 10:18:10 +08:00
< view v-if = "planFlags.length" class="receiving-plan-flags" >
< view v-for = "item in planFlags" :key="item.inboundCode" class="receiving-plan-row" >
< text class = "receiving-plan-code" >{{ item . inboundCode || '—' }}</ text >
< view class = "receiving-plan-tags" >
< text : class = "item.assigned ? 'flag-positive' : 'flag-muted'" >{{ item . assigned ? '已分配' : '未分配' }}</ text >
< text : class = "item.mergeAllowed ? 'flag-option' : 'flag-muted'" >{{ item . mergeAllowed ? '可合托·非强制' : '不合托' }}</ text >
< text : class = "item.urgent ? 'flag-urgent' : 'flag-muted'" >{{ item . urgent ? '加急' : '普通' }}</ text >
</ view >
</ view >
</ view >
2026-08-26 16:58:41 +08:00
< view class = "receiving-summary-progress" >< view >< text > 收货进度 </ text >< text >{{ receivedPackages }} / {{ totalPackages }} 箱 </ text ></ view >< view class = "progress-track" >< view class = "progress-fill" : style = "{ width: percent + '%' }" ></ view ></ view ></ view >
2026-08-26 16:50:25 +08:00
</ view >
</ template >
< script >
export default {
props : { session : { type : Object , default : null } },
computed : {
2026-09-09 10:18:10 +08:00
planFlags () { return Array . isArray ( this . session ? . inbounds ) ? this . session . inbounds : [] },
2026-08-26 16:50:25 +08:00
inboundCodeCount () { return Array . isArray ( this . session ? . inbounds ) ? this . session . inbounds . length : 0 },
plannedPalletCount () { return ( this . session ? . inbounds || []). reduce (( sum , item ) => sum + Math . max ( 0 , Number ( item ? . plannedPalletCount || 0 )), 0 ) },
2026-08-26 17:09:07 +08:00
destinationValues () { const values = ( this . session ? . inbounds || []). map (( item ) => item ? . fbaWarehouseCode || item ? . destinationWarehouseName || item ? . destinationWarehouseCode ). filter ( Boolean ); const unique = [... new Set ( values )]; return unique . length ? unique : [ '—' ] },
2026-08-26 16:50:25 +08:00
totalPackages () { return Math . max ( 0 , Number ( this . session ? . totalPackages || 0 )) },
receivedPackages () { return Math . max ( 0 , Number ( this . session ? . receivedPackages || 0 )) },
pendingPackages () { return Math . max ( 0 , Number ( this . session ? . pendingPackages ?? this . totalPackages - this . receivedPackages )) },
percent () { return this . totalPackages ? Math . min ( 100 , Math . round ( this . receivedPackages / this . totalPackages * 100 )) : 0 },
2026-08-26 16:58:41 +08:00
statusLabel () { return ({ WAIT_SIGN : '待签收' , SIGNED : '已签收' , RECEIVING : '收货中' , COMPLETED : '已完成' })[ this . session ? . status ] || '待签收' }
2026-08-26 16:50:25 +08:00
}
}
</ script >
< style scoped >
. receiving - summary { box - sizing : border - box ; margin - bottom : 10 px ; padding : 10 px 12 px ; border : 1 px solid # b8d2f3 ; border - radius : 13 px ; background : linear - gradient ( 145 deg , # fff , # f2f7ff ); box - shadow : 0 3 px 12 px rgba ( 31 , 74 , 125 , .08 )}
. receiving - summary - head ,. receiving - summary - progress > view : first - child { display : flex ; align - items : center ; justify - content : space - between ; gap : 10 px }
. receiving - summary - label ,. receiving - summary - container ,. metric - value ,. metric - label { display : block }. receiving - summary - label { color : # 718095 ; font - size : 9 px ; line - height : 13 px }. receiving - summary - container { margin - top : 1 px ; color : # 17324 d ; font - size : 17 px ; font - weight : 850 ; line - height : 22 px }
. receiving - summary - status { flex - shrink : 0 ; padding : 4 px 8 px ; border - radius : 99 px ; color : # 1668 dc ; font - size : 9 px ; font - weight : 700 ; background : # e3efff }
2026-10-22 14:38:15 +08:00
. receiving - summary - context { display : flex ; flex - direction : column ; gap : 4 px ; margin - top : 7 px ; color : # 617389 ; font - size : 9 px ; line - height : 14 px }. receiving - summary - destinations { display : flex ; min - width : 0 ; align - items : flex - start }. destination - label { flex - shrink : 0 }. destination - tags { display : flex ; min - width : 0 ; flex - wrap : wrap ; gap : 3 px 4 px }. destination - tags text { padding : 0 5 px ; border - radius : 99 px ; color : # 42617 f ; line - height : 14 px ; background : # e8f0fa ; white - space : nowrap }
2026-08-26 16:50:25 +08:00
. receiving - summary - metrics { display : grid ; grid - template - columns : repeat ( 4 , minmax ( 0 , 1 fr )); margin - top : 7 px ; padding : 7 px 2 px ; border - radius : 9 px ; background : rgba ( 255 , 255 , 255 , .8 )}. receiving - summary - metrics > view { display : flex ; align - items : center ; flex - direction : column ; border - right : 1 px solid # e3eaf2 }. receiving - summary - metrics > view : last - child { border - right : 0 }
2026-09-09 10:18:10 +08:00
. receiving - plan - flags { margin - top : 7 px ; padding : 3 px 8 px ; border - radius : 9 px ; background : rgba ( 255 , 255 , 255 , .82 )}. receiving - plan - row { display : flex ; align - items : center ; justify - content : space - between ; gap : 8 px ; padding : 5 px 0 ; border - bottom : 1 px solid # e9eef5 }. receiving - plan - row : last - child { border - bottom : 0 }. receiving - plan - code { min - width : 0 ; color : # 17324 d ; font - size : 10 px ; font - weight : 750 ; overflow - wrap : anywhere }. receiving - plan - tags { display : flex ; flex - shrink : 0 ; gap : 3 px }. receiving - plan - tags text { padding : 2 px 5 px ; border - radius : 99 px ; font - size : 8 px ; line - height : 12 px }. flag - positive { color : # 08705 f ; background : # e2f6f0 }. flag - option { color : # 1668 dc ; background : # e7f0ff }. flag - urgent { color : # b54708 ; background : # fff0dc }. flag - muted { color : # 718095 ; background : # edf1f5 }
2026-08-26 16:50:25 +08:00
. metric - value { color : # 17324 d ; font - size : 17 px ; font - weight : 850 ; line - height : 21 px }. metric - pending { color : # b66a08 }. metric - label { margin - top : 1 px ; color : # 718095 ; font - size : 8 px ; line - height : 12 px ; text - align : center }
. receiving - summary - progress { margin - top : 7 px ; color : # 607287 ; font - size : 9 px }. progress - track { height : 5 px ; margin - top : 5 px ; overflow : hidden ; border - radius : 99 px ; background : # dfe8f2 }. progress - fill { height : 100 % ; border - radius : inherit ; background : # 1677 e8 }
</ style >