|
@@ -63,9 +63,10 @@
|
|
|
</template>
|
|
|
<template #footer>
|
|
|
<div class="table-footer">
|
|
|
- <span class="table-footer-count">航班总数:{{ tableDataCount.flightCount }}</span>
|
|
|
+ <!-- <span class="table-footer-count">航班总数:{{ tableDataCount.flightCount }}</span> -->
|
|
|
<span class="table-footer-count">货运航班总数:{{ tableDataCount.freightFlightCount }}</span>
|
|
|
- <span class="table-footer-count">已装机总数:{{ tableDataCount.loadCount }}</span>
|
|
|
+ <span v-if="isDeparture" class="table-footer-count">已装机总数:{{ tableDataCount.loadCount }}</span>
|
|
|
+ <span v-else class="table-footer-count">已卸机总数:{{ tableDataCount.unloadCount }}</span>
|
|
|
<span class="table-footer-count">已起飞总数:{{ tableDataCount.takeOffCount }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -117,28 +118,38 @@ const cellPropsGetter = params => ({
|
|
|
class: cellClassV2(params),
|
|
|
})
|
|
|
|
|
|
-const tableDataCount = computed(() => ({
|
|
|
- waybillCount: tableData.value.reduce((count, current) => {
|
|
|
- const countValue = current[isDeparture ? 'preLoad' : 'preUnload']
|
|
|
- if (countValue) {
|
|
|
- count += Number(String(countValue).split('/')[0])
|
|
|
+const tableDataCount = computed(() =>
|
|
|
+ tableData.value.reduce(
|
|
|
+ (counts: { [x: string]: number }, current) => {
|
|
|
+ const preCount = current[isDeparture ? 'preLoad' : 'preUnload']
|
|
|
+ if (preCount) {
|
|
|
+ counts.waybillCount += Number(String(preCount).split('/')[0])
|
|
|
+ counts.goodsCount += Number(String(preCount).split('/')[1])
|
|
|
+ }
|
|
|
+ counts.flightCount++
|
|
|
+ const isFreight = tableColumns.value.some(column => column.groupName === '地服相关' && current[column.columnName])
|
|
|
+ if (isFreight) {
|
|
|
+ counts.freightFlightCount++
|
|
|
+ }
|
|
|
+ if (current.loadPlaneSure) {
|
|
|
+ counts.loadCount++
|
|
|
+ }
|
|
|
+ if (current.unLoad) {
|
|
|
+ counts.unloadCount++
|
|
|
+ }
|
|
|
+ return counts
|
|
|
+ },
|
|
|
+ {
|
|
|
+ waybillCount: 0,
|
|
|
+ goodsCount: 0,
|
|
|
+ flightCount: 0,
|
|
|
+ freightFlightCount: 0,
|
|
|
+ loadCount: 0,
|
|
|
+ unloadCount: 0,
|
|
|
+ takeOffCount: 0,
|
|
|
}
|
|
|
- return count
|
|
|
- }, 0),
|
|
|
- goodsCount: tableData.value.reduce((count, current) => {
|
|
|
- const countValue = current[isDeparture ? 'preLoad' : 'preUnload']
|
|
|
- if (countValue) {
|
|
|
- count += Number(String(countValue).split('/')[1])
|
|
|
- }
|
|
|
- return count
|
|
|
- }, 0),
|
|
|
- flightCount: tableData.value.length,
|
|
|
- freightFlightCount: tableData.value.length,
|
|
|
- loadCount: tableData.value.reduce((sum, current) => {
|
|
|
- return current.loadPlaneSure ? sum + 1 : sum
|
|
|
- }, 0),
|
|
|
- takeOffCount: 0,
|
|
|
-}))
|
|
|
+ )
|
|
|
+)
|
|
|
|
|
|
const { cellClickHandlerV2 } = useTableCellClick(props.name)
|
|
|
|