feat:多项功能优化

This commit is contained in:
zhoujianjin
2026-09-18 18:54:54 +08:00
parent 672cd23329
commit 543655d441
48 changed files with 1289 additions and 447 deletions
+13 -4
View File
@@ -1,6 +1,6 @@
<script setup>
defineOptions({ name: 'Inventory' })
import { onMounted, reactive, ref } from 'vue'
import { computed, onMounted, reactive, ref } from 'vue'
import request from '../utils/request'
import { fmtTime } from '../utils/format'
import { exportXlsxFetch } from '../utils/export'
@@ -42,13 +42,22 @@ const total = ref(0)
const page = reactive({ current: 1, size: 20 })
// 区域下拉数据源
const zoneOptions = ref([])
const zonesRaw = ref([])
// 区域下拉选项:picker 每行是一个货位,同一区域会重复出现,按区域编码去重后只展示一条
const zoneOptions = computed(() => {
const map = new Map()
zonesRaw.value.forEach(z => {
if (!z.zoneCode) return
if (!map.has(z.zoneCode)) map.set(z.zoneCode, { zoneCode: z.zoneCode, zoneName: z.zoneName || '' })
})
return [...map.values()]
})
async function loadZones() {
try {
const data = await request.get('/zone/picker')
zoneOptions.value = data || []
zonesRaw.value = data || []
} catch (e) {
zoneOptions.value = []
zonesRaw.value = []
}
}