优化
This commit is contained in:
@@ -177,11 +177,14 @@ onBeforeUnmount(() => {
|
|||||||
<el-tab-pane label="其他记录" name="records" lazy>
|
<el-tab-pane label="其他记录" name="records" lazy>
|
||||||
<InboundHistoryPanel
|
<InboundHistoryPanel
|
||||||
:pallet-locations="detail.palletLocations"
|
:pallet-locations="detail.palletLocations"
|
||||||
|
:dropship-pallets="detail.dropshipPallets"
|
||||||
|
:customer-id="customerId"
|
||||||
|
:inbound-id="inboundId"
|
||||||
:files="detail.files"
|
:files="detail.files"
|
||||||
:internal-notes="detail.internalNotes"
|
:internal-notes="detail.internalNotes"
|
||||||
:status-history="[]"
|
:status-history="[]"
|
||||||
:public-remark="detail.publicRemark"
|
:public-remark="detail.publicRemark"
|
||||||
:sections="['allocations', 'files', 'notes', 'remark']"
|
:sections="['dropship', 'allocations', 'files', 'notes', 'remark']"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|||||||
@@ -1,19 +1,25 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { InboundFileSummary, InboundInternalNote, InboundPalletLocation, InboundStatusHistory } from './types'
|
import type { InboundDropshipPallet, InboundFileSummary, InboundInternalNote, InboundPalletLocation, InboundStatusHistory } from './types'
|
||||||
import { inboundHistoryActionLabel, inboundProcessStatusLabels, inboundStatusLabel } from '../status'
|
import { inboundHistoryActionLabel, inboundProcessStatusLabels, inboundStatusLabel } from '../status'
|
||||||
|
import { downloadDropshipPalletLabel } from './api'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
palletLocations: InboundPalletLocation[]
|
palletLocations: InboundPalletLocation[]
|
||||||
|
dropshipPallets?: InboundDropshipPallet[]
|
||||||
|
customerId?: string
|
||||||
|
inboundId?: string
|
||||||
files: InboundFileSummary[]
|
files: InboundFileSummary[]
|
||||||
internalNotes: InboundInternalNote[]
|
internalNotes: InboundInternalNote[]
|
||||||
statusHistory: InboundStatusHistory[]
|
statusHistory: InboundStatusHistory[]
|
||||||
publicRemark: string | null
|
publicRemark: string | null
|
||||||
sections?: Array<'allocations' | 'files' | 'notes' | 'history' | 'remark'>
|
sections?: Array<'dropship' | 'allocations' | 'files' | 'notes' | 'history' | 'remark'>
|
||||||
}>(), {
|
}>(), {
|
||||||
sections: () => ['allocations', 'files', 'notes', 'history', 'remark'],
|
dropshipPallets: () => [],
|
||||||
|
sections: () => ['dropship', 'allocations', 'files', 'notes', 'history', 'remark'],
|
||||||
})
|
})
|
||||||
|
|
||||||
function shows(section: 'allocations' | 'files' | 'notes' | 'history' | 'remark') {
|
function shows(section: 'dropship' | 'allocations' | 'files' | 'notes' | 'history' | 'remark') {
|
||||||
return props.sections.includes(section)
|
return props.sections.includes(section)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,10 +30,24 @@ function date(value: string | null) {
|
|||||||
const parsed = new Date(value)
|
const parsed = new Date(value)
|
||||||
return Number.isNaN(parsed.getTime()) ? value : parsed.toLocaleString('zh-CN', { hour12: false })
|
return Number.isNaN(parsed.getTime()) ? value : parsed.toLocaleString('zh-CN', { hour12: false })
|
||||||
}
|
}
|
||||||
|
async function printPallet(pallet: InboundDropshipPallet) {
|
||||||
|
if (!props.customerId || !props.inboundId || !pallet.palletNo) return
|
||||||
|
try {
|
||||||
|
const blob = await downloadDropshipPalletLabel(props.customerId, props.inboundId, pallet.palletId)
|
||||||
|
const url = URL.createObjectURL(blob)
|
||||||
|
const link = document.createElement('a'); link.href = url; link.download = `${pallet.palletNo}-托盘唛.pdf`; link.click()
|
||||||
|
URL.revokeObjectURL(url)
|
||||||
|
} catch { ElMessage.error('托盘唛下载失败,请稍后重试') }
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="history-panel">
|
<div class="history-panel">
|
||||||
|
<section v-if="shows('dropship')" class="history-section">
|
||||||
|
<div class="section-heading"><h3>一件代发绑定托盘</h3><span>{{ dropshipPallets.length }} 个托盘</span></div>
|
||||||
|
<div v-if="dropshipPallets.length" class="simple-list"><div v-for="pallet in dropshipPallets" :key="pallet.palletId"><strong>{{ value(pallet.palletNo) }} · {{ pallet.cartonCount }} 箱 <el-button v-if="pallet.palletNo" link type="primary" @click="printPallet(pallet)">打印托盘唛</el-button></strong><span v-for="item in pallet.items" :key="`${pallet.palletId}-${item.inboundDetailId}`">{{ item.inboundCode }} · SKU {{ item.skuCode }} · {{ item.cartonCount }} 箱</span></div></div>
|
||||||
|
<p v-else class="muted-empty">暂无一件代发托盘绑定</p>
|
||||||
|
</section>
|
||||||
<section v-if="shows('allocations')" class="history-section">
|
<section v-if="shows('allocations')" class="history-section">
|
||||||
<div class="section-heading"><h3>托盘与库位</h3><span>{{ palletLocations.length }} 条分配</span></div>
|
<div class="section-heading"><h3>托盘与库位</h3><span>{{ palletLocations.length }} 条分配</span></div>
|
||||||
<div v-if="palletLocations.length" class="allocation-list">
|
<div v-if="palletLocations.length" class="allocation-list">
|
||||||
|
|||||||
@@ -99,6 +99,11 @@ function normalizeDetail(raw: InboundOrderDetail): InboundOrderDetail {
|
|||||||
return {
|
return {
|
||||||
...raw,
|
...raw,
|
||||||
summary: normalizeInboundSummary(raw.summary),
|
summary: normalizeInboundSummary(raw.summary),
|
||||||
|
dropshipPallets: (raw.dropshipPallets || []).map((pallet) => ({
|
||||||
|
...pallet,
|
||||||
|
palletId: id(pallet.palletId) || '',
|
||||||
|
items: (pallet.items || []).map((item) => ({ ...item, inboundId: id(item.inboundId) || '', inboundDetailId: id(item.inboundDetailId) || '' })),
|
||||||
|
})),
|
||||||
palletLocations: (raw.palletLocations || []).map(normalizePallet),
|
palletLocations: (raw.palletLocations || []).map(normalizePallet),
|
||||||
files: (raw.files || []).map(normalizeFile),
|
files: (raw.files || []).map(normalizeFile),
|
||||||
internalNotes: (raw.internalNotes || []).map(normalizeNote),
|
internalNotes: (raw.internalNotes || []).map(normalizeNote),
|
||||||
@@ -147,3 +152,10 @@ export async function downloadInboundCartonLabels(tenantId: string, inboundId: s
|
|||||||
}
|
}
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function downloadDropshipPalletLabel(tenantId: string, inboundId: string, palletId: string) {
|
||||||
|
return http.get<Blob, Blob>(
|
||||||
|
`/platform/v1/first-leg/pda-dropship/inbound-orders/${encodeURIComponent(inboundId)}/pallets/${encodeURIComponent(palletId)}/print`,
|
||||||
|
{ params: { accountId: tenantId }, responseType: 'blob', timeout: 60_000 },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
@@ -117,12 +117,24 @@ export interface InboundStatusHistory {
|
|||||||
export interface InboundOrderDetail {
|
export interface InboundOrderDetail {
|
||||||
summary: InboundOrderSummary
|
summary: InboundOrderSummary
|
||||||
publicRemark: string | null
|
publicRemark: string | null
|
||||||
|
dropshipPallets: InboundDropshipPallet[]
|
||||||
palletLocations: InboundPalletLocation[]
|
palletLocations: InboundPalletLocation[]
|
||||||
files: InboundFileSummary[]
|
files: InboundFileSummary[]
|
||||||
internalNotes: InboundInternalNote[]
|
internalNotes: InboundInternalNote[]
|
||||||
statusHistory: InboundStatusHistory[]
|
statusHistory: InboundStatusHistory[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface InboundDropshipPallet {
|
||||||
|
palletId: string
|
||||||
|
palletNo: string | null
|
||||||
|
palletStatus: string
|
||||||
|
cartonCount: number
|
||||||
|
skuCount: number
|
||||||
|
version: number
|
||||||
|
items: Array<{ inboundId: string; inboundCode: string; inboundDetailId: string; skuCode: string; cargoName: string | null; cartonCount: number; cartonMarks: string[] }>
|
||||||
|
completedAt: string | null
|
||||||
|
}
|
||||||
|
|
||||||
export interface InboundPageResult {
|
export interface InboundPageResult {
|
||||||
records: InboundOrderSummary[]
|
records: InboundOrderSummary[]
|
||||||
page: number
|
page: number
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
export const inboundProcessStatusLabels: Record<string, string> = {
|
export const inboundProcessStatusLabels: Record<string, string> = {
|
||||||
WAIT_MEASURE: '待测量', MEASURING: '测量中', MEASURE_PENDING: '待测量审核', MEASURE_REJECTED: '测量已驳回',
|
WAIT_MEASURE: '待测量', MEASURING: '测量中', MEASURE_PENDING: '待测量审核', MEASURE_REJECTED: '测量已驳回',
|
||||||
WAIT_PRICING: '待计费', FEE_CONFIRMING: '费用处理中', INBOUNDING: '入库处理中', WAIT_SPLIT: '待分柜', VOIDED: '已作废',
|
WAIT_PRICING: '待计费', FEE_CONFIRMING: '费用处理中', INBOUNDING: '入库处理中', WAIT_PALLETIZE: '待一件代发合托', WAIT_SPLIT: '待分柜', VOIDED: '已作废',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const inboundOrderStatusLabels: Record<string, string> = {
|
export const inboundOrderStatusLabels: Record<string, string> = {
|
||||||
DRAFT: '草稿', SUBMITTED: '待审核', APPROVED: '已审核', ACCEPTED: '已受理', REJECTED: '已驳回',
|
DRAFT: '草稿', SUBMITTED: '待审核', APPROVED: '已审核', ACCEPTED: '已受理', REJECTED: '已驳回',
|
||||||
PROCESSING: '处理中', COMPLETED: '已完成', CANCELLED: '已取消', PENDING_REVIEW: '待审核',
|
PROCESSING: '处理中', COMPLETED: '已完成', CANCELLED: '已取消', PENDING_REVIEW: '待审核',
|
||||||
WAIT_MEASURE: '待测量', WAIT_SPLIT: '待分柜', LOADING: '装柜中',
|
WAIT_MEASURE: '待测量', WAIT_PALLETIZE: '待一件代发合托', WAIT_SPLIT: '待分柜', LOADING: '装柜中',
|
||||||
LOADED: '装柜完成', DELIVERED: '派送完成',
|
LOADED: '装柜完成', DELIVERED: '派送完成',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user