From 543433f64d491fe133b7a23363ff0ccacc3da07e Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 24 七月 2026 14:33:42 +0800
Subject: [PATCH] fix(upload): 修复文件上传时的请求头配置问题

---
 src/views/wls/warehouse/components/area-select.vue |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/views/wls/warehouse/components/area-select.vue b/src/views/wls/warehouse/components/area-select.vue
index b423ae7..b2b2aff 100644
--- a/src/views/wls/warehouse/components/area-select.vue
+++ b/src/views/wls/warehouse/components/area-select.vue
@@ -3,7 +3,7 @@
 
 import { computed, ref, useAttrs, watch, watchEffect } from 'vue';
 
-import { Select, SelectOption, Tag, Tooltip } from 'ant-design-vue';
+import { Select, SelectOption, Tooltip } from 'ant-design-vue';
 
 import { getWarehouseAreaSimpleList } from '#/api/mes/wm/warehouse/area';
 
@@ -73,11 +73,21 @@
   },
 );
 
-/** 搴撳尯鍙樻洿鎴栧垵濮嬪寲鏃堕噸鏂板姞杞藉簱浣嶅垪琛� */
+/** 搴撳尯鍙樻洿鏃舵竻绌哄凡閫夊簱浣嶅苟閲嶆柊鍔犺浇鍒楄〃 */
 watchEffect(async () => {
+  if (!props.locationId) {
+    allList.value = [];
+    return;
+  }
   allList.value = await getWarehouseAreaSimpleList(props.locationId);
-  if (props.modelValue !== null) {
-    selectedItem.value = allList.value.find((o) => o.id === props.modelValue);
+  // 搴撳尯鍙樻洿鏃舵竻绌哄凡閫夌殑搴撲綅
+  if (props.modelValue !== null && props.modelValue !== undefined) {
+    const stillExists = allList.value.find((o) => o.id === props.modelValue);
+    if (!stillExists) {
+      selectedItem.value = undefined;
+      emit('update:modelValue', undefined);
+      emit('change', undefined);
+    }
   }
 });
 </script>
@@ -100,14 +110,12 @@
       :disabled="disabled"
       :filter-option="filterOption"
       :placeholder="placeholder"
+      :popup-match-select-width="false"
       show-search
       @change="handleChange"
     >
       <SelectOption v-for="item in allList" :key="item.id" :value="item.id">
-        <div class="flex items-center gap-2">
-          <span>{{ item.name }}</span>
-          <Tag v-if="item.code" color="blue">缂栧彿: {{ item.code }}</Tag>
-        </div>
+        {{ item.name }}
       </SelectOption>
     </Select>
   </Tooltip>

--
Gitblit v1.9.3