Эх сурвалжийг харах

可以 wmsLocation 搜索

handy 2 өдөр өмнө
parent
commit
7da60262f4

+ 21 - 4
src/App.vue

@@ -354,6 +354,7 @@
             :selected-zone-id="selectedZoneId"
             :loc-group-keyword="appliedLocGroupKeyword"
             :location-id-keyword="appliedLocationIdKeyword"
+            :wcs-location-id-keyword="appliedWcsLocationIdKeyword"
             :show-group-border="showGroupBorder"
             :show-tooltip="showTooltip"
             :category-color-visibility="categoryColorVisibility"
@@ -456,6 +457,7 @@ const categoryColorVisibility = ref<Record<'A' | 'B' | 'C', boolean>>({
 const locationKeywordInput = ref('')
 const appliedLocGroupKeyword = ref('')
 const appliedLocationIdKeyword = ref('')
+const appliedWcsLocationIdKeyword = ref('')
 const showGroupBorder = ref(false)
 const showTooltip = ref(true)
 const selectionMode = ref(false)
@@ -550,6 +552,12 @@ const isLocationMatchedByFilters = (loc: LocationResourceDataVO) => {
     String(loc.locationId || '')
       .toUpperCase()
       .includes(normalizedLocationIdKeyword)
+  const normalizedWcsLocationIdKeyword = appliedWcsLocationIdKeyword.value.trim().toUpperCase()
+  const matchedWcsLocationId =
+    !normalizedWcsLocationIdKeyword ||
+    String(loc.wcsLocationId || '')
+      .toUpperCase()
+      .includes(normalizedWcsLocationIdKeyword)
 
   return (
     matchedCategory &&
@@ -557,7 +565,8 @@ const isLocationMatchedByFilters = (loc: LocationResourceDataVO) => {
     matchedHasContainer &&
     matchedZoneId &&
     matchedLocGroup &&
-    matchedLocationId
+    matchedLocationId &&
+    matchedWcsLocationId
   )
 }
 
@@ -762,21 +771,27 @@ const applyLocationKeywordFilter = () => {
   if (hyphenCount === 3) {
     appliedLocationIdKeyword.value = keyword
     appliedLocGroupKeyword.value = ''
+    appliedWcsLocationIdKeyword.value = ''
   } else if (hyphenCount === 2) {
     appliedLocGroupKeyword.value = keyword
     appliedLocationIdKeyword.value = ''
+    appliedWcsLocationIdKeyword.value = ''
+  } else if (keyword.length >= 13 && hyphenCount === 0) {
+    appliedWcsLocationIdKeyword.value = keyword
+    appliedLocationIdKeyword.value = ''
+    appliedLocGroupKeyword.value = ''
   } else {
     appliedLocGroupKeyword.value = ''
     appliedLocationIdKeyword.value = ''
+    appliedWcsLocationIdKeyword.value = ''
   }
-
-  triggerWorkingHighlightRefresh()
 }
 
 const clearLocationKeywordFilter = () => {
   locationKeywordInput.value = ''
   appliedLocGroupKeyword.value = ''
   appliedLocationIdKeyword.value = ''
+  appliedWcsLocationIdKeyword.value = ''
 }
 
 const handleGroupBorderToggle = (event: Event) => {
@@ -932,6 +947,7 @@ const handleSelectLocGroup = async (locGroup1: string) => {
   locationKeywordInput.value = locGroup1
   appliedLocGroupKeyword.value = locGroup1
   appliedLocationIdKeyword.value = ''
+  appliedWcsLocationIdKeyword.value = ''
 }
 
 const handleSelectLocationId = async (locationId: string) => {
@@ -945,6 +961,7 @@ const handleSelectLocationId = async (locationId: string) => {
   locationKeywordInput.value = locationId
   appliedLocationIdKeyword.value = locationId
   appliedLocGroupKeyword.value = ''
+  appliedWcsLocationIdKeyword.value = ''
 }
 
 const handleLoginCancel = () => {
@@ -1348,7 +1365,7 @@ onBeforeUnmount(() => {
 .filter-input-wrap {
   position: relative;
   display: inline-flex;
-  width: 115px;
+  width: 145px;
 }
 
 .filter-input {

+ 8 - 1
src/components/WarehouseMap.vue

@@ -143,6 +143,7 @@ interface Props {
   selectedZoneId: string
   locGroupKeyword: string
   locationIdKeyword: string
+  wcsLocationIdKeyword: string
   showGroupBorder: boolean
   showTooltip: boolean
   selectionMode?: boolean
@@ -414,6 +415,10 @@ const isCellMatched = (cell: GridCell) => {
   const matchedLocationId =
     !normalizedLocationIdKeyword ||
     cell.locationId.toUpperCase().includes(normalizedLocationIdKeyword)
+  const normalizedWcsLocationIdKeyword = props.wcsLocationIdKeyword.trim().toUpperCase()
+  const matchedWcsLocationId =
+    !normalizedWcsLocationIdKeyword ||
+    (cell.wcsLocationId || '').toUpperCase().includes(normalizedWcsLocationIdKeyword)
 
   return (
     matchedCategory &&
@@ -421,7 +426,8 @@ const isCellMatched = (cell: GridCell) => {
     matchedHasContainer &&
     matchedZoneId &&
     matchedLocGroup &&
-    matchedLocationId
+    matchedLocationId &&
+    matchedWcsLocationId
   )
 }
 
@@ -491,6 +497,7 @@ const shouldHideNonLocationCells = computed(() => {
     Boolean(props.selectedZoneId) ||
     Boolean(props.locGroupKeyword.trim()) ||
     Boolean(props.locationIdKeyword.trim()) ||
+    Boolean(props.wcsLocationIdKeyword.trim()) ||
     Boolean(selectedRange.value)
   )
 })