handy пре 1 месец
родитељ
комит
f94a8204bc
2 измењених фајлова са 31 додато и 2 уклоњено
  1. 11 1
      src/App.vue
  2. 20 1
      src/components/WarehouseMap.vue

+ 11 - 1
src/App.vue

@@ -40,6 +40,14 @@
             </option>
           </select>
         </label>
+        <label class="filter-item">
+          <span class="selector-label">是否有容器</span>
+          <select v-model="selectedHasContainer" class="level-select">
+            <option value="">全部</option>
+            <option value="Y">有容器</option>
+            <option value="N">无容器</option>
+          </select>
+        </label>
         <label class="filter-item filter-input-item">
           <span class="selector-label">库位组</span>
           <span class="filter-input-wrap">
@@ -93,6 +101,7 @@
           :current-level="currentLevel"
           :selected-category="selectedCategory"
           :selected-location-attribute="selectedLocationAttribute"
+          :selected-has-container="selectedHasContainer"
           :loc-group-keyword="appliedLocGroupKeyword"
           :show-group-border="showGroupBorder"
           @select-loc-group="handleSelectLocGroup"
@@ -128,9 +137,10 @@ const error = ref('')
 const showLoginModal = ref(false)
 const selectedCategory = ref('')
 const selectedLocationAttribute = ref<LocationAttributeCode | ''>('')
+const selectedHasContainer = ref<'Y' | 'N' | ''>('')
 const locGroupKeywordInput = ref('')
 const appliedLocGroupKeyword = ref('')
-const showGroupBorder = ref(true)
+const showGroupBorder = ref(false)
 const now = ref(Date.now())
 const nextRefreshAt = ref(Date.now() + config.refreshInterval)
 let refreshTimer: number | null = null

+ 20 - 1
src/components/WarehouseMap.vue

@@ -19,6 +19,9 @@
             <div :class="['location-id', { 'location-id-mismatch': cell.categoryMismatch }]">
               {{ cell.locationId }}
             </div>
+            <div v-if="cell.containerCode" class="container-code">
+              {{ cell.containerCode }}
+            </div>
           </div>
         </div>
       </div>
@@ -35,6 +38,7 @@ interface Props {
   currentLevel: number
   selectedCategory: string
   selectedLocationAttribute: string
+  selectedHasContainer: string
   locGroupKeyword: string
   showGroupBorder: boolean
 }
@@ -233,11 +237,15 @@ const isCellMatched = (cell: GridCell) => {
   const matchedCategory = !props.selectedCategory || cell.category === props.selectedCategory
   const matchedLocationAttribute = !props.selectedLocationAttribute
     || cell.locationAttribute === props.selectedLocationAttribute
+  const hasContainer = Boolean(cell.containerCode && cell.containerCode.trim())
+  const matchedHasContainer = !props.selectedHasContainer
+    || (props.selectedHasContainer === 'Y' && hasContainer)
+    || (props.selectedHasContainer === 'N' && !hasContainer)
   const normalizedKeyword = props.locGroupKeyword.trim().toUpperCase()
   const matchedLocGroup = !normalizedKeyword
     || cell.locGroup1.toUpperCase().includes(normalizedKeyword)
 
-  return matchedCategory && matchedLocationAttribute && matchedLocGroup
+  return matchedCategory && matchedLocationAttribute && matchedHasContainer && matchedLocGroup
 }
 
 const getCellClass = (cell: GridCell | null) => {
@@ -481,4 +489,15 @@ onBeforeUnmount(() => {
   color: #ff4d4f;
 }
 
+.container-code {
+  max-width: 100%;
+  font-size: calc(var(--cell-id-font-size, 11px) - 2px);
+  color: #b9c7d4;
+  text-align: center;
+  line-height: 1.1;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
 </style>