This commit is contained in:
2026-08-17 17:49:10 +08:00
parent 911a3620e1
commit c7334b2cf8
30 changed files with 1043 additions and 249 deletions
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, onActivated, onBeforeUnmount, onMounted, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import { ClipboardCheck, Eye, Ruler, SearchCheck } from '@lucide/vue'
import { Eye, Ruler, SearchCheck } from '@lucide/vue'
import { useAccessPreviewStore } from '@/core/access/accessPreview'
import { listPlatformTenants, type PlatformTenantResource } from '@/modules/iam'
import { listPlatformWarehouses } from '@/modules/warehouses'
@@ -14,11 +14,10 @@ import LoadErrorState from '@/shared/components/LoadErrorState.vue'
import QueryToolbar, { type QueryField, type QueryModel } from '@/shared/components/QueryToolbar.vue'
import { listPlatformInbounds } from '../core/api'
import type { InboundOrderSummary } from '../core/types'
import InboundMeasurementPanel from '../measurement/InboundMeasurementPanel.vue'
import InboundMeasurementDialog from '../measurement/InboundMeasurementDialog.vue'
import MeasurementReviewPanel from '../review/MeasurementReviewPanel.vue'
import { inboundProcessStatusLabels, inboundReviewStatusLabels, inboundStatusLabel } from '../status'
import { buildInboundTaskQuery, loadAllActiveCustomers, type InboundTaskMode } from '../task-list'
import WeightOcrPanel from '../weight/components/WeightOcrPanel.vue'
type FilterModel = QueryModel & {
customerId: string
@@ -41,8 +40,8 @@ const customers = ref<PlatformTenantResource[]>([])
const customerLoadError = ref<ApiErrorDetails | null>(null)
const warehouseOptions = ref<Array<{ label: string; value: string }>>([])
const selectedInbound = ref<InboundOrderSummary | null>(null)
const taskDialogOpen = ref(false)
const measurementPanelRef = ref<InstanceType<typeof InboundMeasurementPanel> | null>(null)
const measurementDialogOpen = ref(false)
const reviewDialogOpen = ref(false)
let requestSerial = 0
let optionsRequestSerial = 0
let disposed = false
@@ -168,7 +167,8 @@ function resetFilters() {
function openTask(row: InboundOrderSummary) {
selectedInbound.value = row
taskDialogOpen.value = true
if (isReview.value) reviewDialogOpen.value = true
else measurementDialogOpen.value = true
}
function openDetail(row: InboundOrderSummary) {
@@ -177,21 +177,21 @@ function openDetail(row: InboundOrderSummary) {
}
function handleTaskChanged() {
taskDialogOpen.value = false
reviewDialogOpen.value = false
selectedInbound.value = null
void loadTasks()
}
function handleWeightChanged() {
void loadTasks()
}
function handleMeasurementUpdated() {
void loadTasks()
}
function handleWeightSummaryChanged(actualGrossWeightKg: number | null) {
measurementPanelRef.value?.updateActualGrossWeight(actualGrossWeightKg)
function handleMeasurementSubmitted() {
void loadTasks()
}
function clearSelectedInbound() {
selectedInbound.value = null
}
watch([page, pageSize], () => { void loadTasks() })
@@ -280,38 +280,34 @@ onBeforeUnmount(() => { disposed = true; requestSerial += 1; optionsRequestSeria
</ListPageLayout>
<el-dialog
v-model="taskDialogOpen"
v-if="isReview"
v-model="reviewDialogOpen"
:title="selectedInbound ? `${taskLabel} · ${selectedInbound.inboundCode || selectedInbound.id}` : taskLabel"
width="min(1180px, calc(100vw - 32px))"
top="4vh"
destroy-on-close
append-to-body
class="inbound-task-dialog"
@closed="clearSelectedInbound"
>
<MeasurementReviewPanel
v-if="isReview && selectedInbound"
v-if="selectedInbound"
:tenant-id="selectedInbound.tenantId"
:inbound-id="selectedInbound.id"
@changed="handleTaskChanged"
/>
<div v-else-if="selectedInbound" class="measurement-task-workspace">
<section class="surface-panel inbound-task-weight" aria-label="称重图片与 OCR 核对">
<WeightOcrPanel
:customer-id="selectedInbound.tenantId"
:inbound-id="selectedInbound.id"
@changed="handleWeightChanged"
@summary-changed="handleWeightSummaryChanged"
/>
</section>
<InboundMeasurementPanel
ref="measurementPanelRef"
:tenant-id="selectedInbound.tenantId"
:inbound-id="selectedInbound.id"
@changed="handleTaskChanged"
@updated="handleMeasurementUpdated"
/>
</div>
</el-dialog>
<InboundMeasurementDialog
v-if="!isReview && selectedInbound"
v-model="measurementDialogOpen"
:customer-id="selectedInbound.tenantId"
:inbound-id="selectedInbound.id"
:inbound-code="selectedInbound.inboundCode"
@updated="handleMeasurementUpdated"
@submitted="handleMeasurementSubmitted"
@closed="clearSelectedInbound"
/>
</AdminPage>
</template>
@@ -323,12 +319,9 @@ onBeforeUnmount(() => { disposed = true; requestSerial += 1; optionsRequestSeria
.primary-cell { display: grid; gap: 3px; min-width: 0; }
.primary-cell strong, .primary-cell span { overflow-wrap: anywhere; }
.primary-cell span, .muted-action { color: var(--cc-muted); font-size: 12px; }
.measurement-task-workspace { display: grid; min-width: 0; gap: 20px; }
.inbound-task-weight { min-width: 0; padding: 20px; }
@media (max-width: 520px) {
.row-actions { align-items: stretch; flex-direction: column; }
.row-actions :deep(.el-button) { width: 100%; }
.inbound-task-weight { padding: 14px; }
}
</style>