|
|
@@ -14,7 +14,7 @@
|
|
|
<h1 class="title">
|
|
|
{{ systemTitle }}
|
|
|
<span class="title-meta">库位
|
|
|
- <span class="title-meta-value">{{ availableLocationsCount }}/{{ locations.length }}</span></span>
|
|
|
+ <span class="title-meta-value">{{ filteredOccupiedLocationsCount }}/{{ filteredLocationsCount }}</span></span>
|
|
|
<span class="title-fill-rate">
|
|
|
<span
|
|
|
class="title-meta title-fill-rate-item"
|
|
|
@@ -524,14 +524,53 @@ const formatFillRateDetail = (occupied: number, total: number) => {
|
|
|
return `${occupied}/${total}`
|
|
|
}
|
|
|
|
|
|
-const availableLocationsCount = computed(() => {
|
|
|
- return locations.value.filter((loc) => loc.locationAttribute === 'OK').length
|
|
|
-})
|
|
|
-
|
|
|
const normalLocations = computed(() =>
|
|
|
locations.value.filter((loc) => loc.locationAttribute === 'OK')
|
|
|
)
|
|
|
|
|
|
+const isLocationMatchedByFilters = (loc: LocationResourceDataVO) => {
|
|
|
+ const matchedCategory = !selectedCategory.value || loc.category === selectedCategory.value
|
|
|
+ const matchedLocationAttribute =
|
|
|
+ !selectedLocationAttribute.value || loc.locationAttribute === selectedLocationAttribute.value
|
|
|
+ const hasContainerFlag = hasContainer(loc.containerCode)
|
|
|
+ const matchedHasContainer =
|
|
|
+ !selectedHasContainer.value ||
|
|
|
+ (selectedHasContainer.value === 'Y' && hasContainerFlag) ||
|
|
|
+ (selectedHasContainer.value === 'N' && !hasContainerFlag)
|
|
|
+ const matchedZoneId = !selectedZoneId.value || String(loc.zoneId || '') === selectedZoneId.value
|
|
|
+ const normalizedLocGroupKeyword = appliedLocGroupKeyword.value.trim().toUpperCase()
|
|
|
+ const matchedLocGroup =
|
|
|
+ !normalizedLocGroupKeyword ||
|
|
|
+ String(loc.locGroup1 || '')
|
|
|
+ .toUpperCase()
|
|
|
+ .includes(normalizedLocGroupKeyword)
|
|
|
+ const normalizedLocationIdKeyword = appliedLocationIdKeyword.value.trim().toUpperCase()
|
|
|
+ const matchedLocationId =
|
|
|
+ !normalizedLocationIdKeyword ||
|
|
|
+ String(loc.locationId || '')
|
|
|
+ .toUpperCase()
|
|
|
+ .includes(normalizedLocationIdKeyword)
|
|
|
+
|
|
|
+ return (
|
|
|
+ matchedCategory &&
|
|
|
+ matchedLocationAttribute &&
|
|
|
+ matchedHasContainer &&
|
|
|
+ matchedZoneId &&
|
|
|
+ matchedLocGroup &&
|
|
|
+ matchedLocationId
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+const filteredLocationsCount = computed(() => {
|
|
|
+ return locations.value.filter((loc) => isLocationMatchedByFilters(loc)).length
|
|
|
+})
|
|
|
+
|
|
|
+const filteredOccupiedLocationsCount = computed(() => {
|
|
|
+ return locations.value.filter(
|
|
|
+ (loc) => isLocationMatchedByFilters(loc) && hasContainer(loc.containerCode)
|
|
|
+ ).length
|
|
|
+})
|
|
|
+
|
|
|
const overallFillRate = computed(() => {
|
|
|
const occupiedCount = normalLocations.value.filter((loc) =>
|
|
|
hasContainer(loc.containerCode)
|