修复采购审核竞态并整理管理页面展示

This commit is contained in:
2026-10-30 15:42:37 +08:00
parent 8cc8b4fb94
commit 4abd6ffd5d
23 changed files with 791 additions and 75 deletions
@@ -1,23 +1,24 @@
<script setup lang="ts">
import '@/styles/adminDensity.css'
import '@/styles/adminWorkbench.css'
import { computed, onMounted, watch } from 'vue'
import { computed, nextTick, onMounted, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import AdminPage from '@/shared/components/AdminPage.vue'
import LoadingListDetailDrawer from '../components/LoadingListDetailDrawer.vue'
import { useLoadingListDetail } from '../useLoadingListDetail'
import { printLoadingList } from '../printLoadingList'
const route = useRoute()
const router = useRouter()
const { detail, loading, error, load } = useLoadingListDetail()
const detailView = ref<InstanceType<typeof LoadingListDetailDrawer>>()
const planId = computed(() => String(route.params.planId || ''))
const warehouseId = computed(() => typeof route.query.warehouseId === 'string' ? route.query.warehouseId : '')
async function loadDetail() {
const result = await load('confirmed', planId.value, warehouseId.value)
if (!result || detail.value !== result || route.query.print !== '1') return
await printLoadingList()
await nextTick()
if (!await detailView.value?.print() || detail.value !== result) return
const { print: _print, ...query } = route.query
await router.replace({ name: 'loading-list-detail', params: { planId: planId.value }, query })
}
@@ -34,7 +35,7 @@ watch([planId, warehouseId], () => void loadDetail())
<template>
<AdminPage class="admin-workbench admin-density">
<div class="confirmed-loading-detail-page">
<LoadingListDetailDrawer dense
<LoadingListDetailDrawer ref="detailView" dense
mode="confirmed"
:loading="loading"
:detail="detail"