优化
This commit is contained in:
@@ -103,10 +103,10 @@ const canManualEntry = computed(() => access.can('platform:firstleg:inbound:meas
|
|||||||
const canSubmit = computed(() => access.can('platform:firstleg:inbound:measure:submit'))
|
const canSubmit = computed(() => access.can('platform:firstleg:inbound:measure:submit'))
|
||||||
const customerId = computed(() => props.customerId || props.tenantId || '')
|
const customerId = computed(() => props.customerId || props.tenantId || '')
|
||||||
const hasContext = computed(() => Boolean(customerId.value && props.inboundId))
|
const hasContext = computed(() => Boolean(customerId.value && props.inboundId))
|
||||||
const countEditableProcess = computed(() => ['WAIT_MEASURE', 'MEASURING', 'MEASURE_PENDING', 'MEASURE_REJECTED'].includes(detail.value?.processStatus || ''))
|
const countEditableProcess = computed(() => ['PREPARING', 'WAIT_MEASURE', 'MEASURING', 'MEASURE_PENDING', 'MEASURE_REJECTED'].includes(detail.value?.processStatus || ''))
|
||||||
const submitEditableProcess = computed(() => ['WAIT_MEASURE', 'MEASURING', 'MEASURE_REJECTED'].includes(detail.value?.processStatus || ''))
|
const submitEditableProcess = computed(() => ['PREPARING', 'WAIT_MEASURE', 'MEASURING', 'MEASURE_REJECTED'].includes(detail.value?.processStatus || ''))
|
||||||
const mayMaintain = computed(() => canEdit.value && countEditableProcess.value && !loading.value && !submitting.value)
|
const mayMaintain = computed(() => canEdit.value && countEditableProcess.value && !loading.value && !submitting.value)
|
||||||
const manualEntryEditableProcess = computed(() => ['WAIT_MEASURE', 'MEASURING', 'MEASURE_REJECTED'].includes(detail.value?.processStatus || ''))
|
const manualEntryEditableProcess = computed(() => ['PREPARING', 'WAIT_MEASURE', 'MEASURING', 'MEASURE_REJECTED'].includes(detail.value?.processStatus || ''))
|
||||||
const mayCreateManualEntry = computed(() => canManualEntry.value && manualEntryEditableProcess.value && !loading.value && !saving.value && !submitting.value && !isDirty.value)
|
const mayCreateManualEntry = computed(() => canManualEntry.value && manualEntryEditableProcess.value && !loading.value && !saving.value && !submitting.value && !isDirty.value)
|
||||||
const confirmedPackageCount = computed(() => form.items.reduce((sum, item) => sum + (Number.isFinite(item.packageCount) ? item.packageCount : 0), 0))
|
const confirmedPackageCount = computed(() => form.items.reduce((sum, item) => sum + (Number.isFinite(item.packageCount) ? item.packageCount : 0), 0))
|
||||||
const expectedPackageCount = computed(() => detail.value?.originalPackageCount ?? null)
|
const expectedPackageCount = computed(() => detail.value?.originalPackageCount ?? null)
|
||||||
@@ -609,6 +609,16 @@ defineExpose({ saveDraft, submitForReview, updateActualWeights, mayMaintain, may
|
|||||||
</LoadErrorState>
|
</LoadErrorState>
|
||||||
|
|
||||||
<template v-else-if="detail">
|
<template v-else-if="detail">
|
||||||
|
<el-alert
|
||||||
|
v-if="detail.processStatus === 'PREPARING'"
|
||||||
|
type="warning"
|
||||||
|
:closable="false"
|
||||||
|
show-icon
|
||||||
|
class="measurement-alert"
|
||||||
|
title="订单尚待客服审核,可先完成到仓称重和测量"
|
||||||
|
>
|
||||||
|
已采集数据会保留并在订单审核通过后继续使用;订单审核前不能审核测量、计费或进入分柜。
|
||||||
|
</el-alert>
|
||||||
<el-alert v-if="!countEditableProcess" type="info" :closable="false" show-icon>
|
<el-alert v-if="!countEditableProcess" type="info" :closable="false" show-icon>
|
||||||
<template #title>当前状态为“{{ processStatusLabel(detail.processStatus) }}”,测量数据仅可查看</template>
|
<template #title>当前状态为“{{ processStatusLabel(detail.processStatus) }}”,测量数据仅可查看</template>
|
||||||
确认箱数只允许在待测量、测量中、待审核或审核驳回状态维护。
|
确认箱数只允许在待测量、测量中、待审核或审核驳回状态维护。
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
export type MeasurementIdentifier = string
|
export type MeasurementIdentifier = string
|
||||||
|
|
||||||
export type InboundMeasurementProcessStatus =
|
export type InboundMeasurementProcessStatus =
|
||||||
|
| 'PREPARING'
|
||||||
| 'WAIT_MEASURE'
|
| 'WAIT_MEASURE'
|
||||||
| 'MEASURING'
|
| 'MEASURING'
|
||||||
| 'MEASURE_PENDING'
|
| 'MEASURE_PENDING'
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { inboundHistoryActionLabel, inboundOrderStatusLabels, inboundProcessStat
|
|||||||
|
|
||||||
describe('inbound status presentation', () => {
|
describe('inbound status presentation', () => {
|
||||||
it('translates process and order statuses', () => {
|
it('translates process and order statuses', () => {
|
||||||
|
expect(inboundStatusLabel('PREPARING', inboundProcessStatusLabels)).toBe('订单待审核(可先测量)')
|
||||||
expect(inboundStatusLabel('MEASURE_PENDING', inboundProcessStatusLabels)).toBe('待测量审核')
|
expect(inboundStatusLabel('MEASURE_PENDING', inboundProcessStatusLabels)).toBe('待测量审核')
|
||||||
expect(inboundStatusLabel('WAIT_SPLIT', inboundOrderStatusLabels)).toBe('待分柜')
|
expect(inboundStatusLabel('WAIT_SPLIT', inboundOrderStatusLabels)).toBe('待分柜')
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export const inboundProcessStatusLabels: Record<string, string> = {
|
export const inboundProcessStatusLabels: Record<string, string> = {
|
||||||
WAIT_MEASURE: '待测量', MEASURING: '测量中', MEASURE_PENDING: '待测量审核', MEASURE_REJECTED: '测量已驳回',
|
PREPARING: '订单待审核(可先测量)', WAIT_MEASURE: '待测量', MEASURING: '测量中', MEASURE_PENDING: '待测量审核', MEASURE_REJECTED: '测量已驳回',
|
||||||
WAIT_PRICING: '待计费', FEE_CONFIRMING: '费用处理中', INBOUNDING: '入库处理中', WAIT_PALLETIZE: '待一件代发合托', WAIT_SPLIT: '待分柜', VOIDED: '已作废',
|
WAIT_PRICING: '待计费', FEE_CONFIRMING: '费用处理中', INBOUNDING: '入库处理中', WAIT_PALLETIZE: '待一件代发合托', WAIT_SPLIT: '待分柜', VOIDED: '已作废',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ describe('WeightOcrPanel contract', () => {
|
|||||||
expect(source).toContain("platform:firstleg:inbound:measure:view")
|
expect(source).toContain("platform:firstleg:inbound:measure:view")
|
||||||
expect(source).toContain("platform:firstleg:inbound:weight:edit")
|
expect(source).toContain("platform:firstleg:inbound:weight:edit")
|
||||||
expect(source).toContain("platform:firstleg:inbound:weight:confirm")
|
expect(source).toContain("platform:firstleg:inbound:weight:confirm")
|
||||||
expect(source).toContain("new Set(['WAIT_MEASURE', 'MEASURING', 'MEASURE_REJECTED'])")
|
expect(source).toContain("new Set(['PREPARING', 'WAIT_MEASURE', 'MEASURING', 'MEASURE_REJECTED'])")
|
||||||
expect(source).toContain('&& canEdit.value')
|
expect(source).toContain('&& canEdit.value')
|
||||||
expect(source).toContain('&& editable.value')
|
expect(source).toContain('&& editable.value')
|
||||||
expect(source).toContain('cancelPalletOptionsLoad()')
|
expect(source).toContain('cancelPalletOptionsLoad()')
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ let palletLoadSequence = 0
|
|||||||
let palletAbortController: AbortController | null = null
|
let palletAbortController: AbortController | null = null
|
||||||
const PALLET_OPTION_PAGE_SIZE = 50
|
const PALLET_OPTION_PAGE_SIZE = 50
|
||||||
|
|
||||||
const editableStatuses = new Set(['WAIT_MEASURE', 'MEASURING', 'MEASURE_REJECTED'])
|
const editableStatuses = new Set(['PREPARING', 'WAIT_MEASURE', 'MEASURING', 'MEASURE_REJECTED'])
|
||||||
const minimumWeight = { KG: 0.001, LB: 0.002 } as const
|
const minimumWeight = { KG: 0.001, LB: 0.002 } as const
|
||||||
const maximumSafeWeight = 9_000_000_000_000
|
const maximumSafeWeight = 9_000_000_000_000
|
||||||
const customerId = computed(() => props.customerId || props.tenantId || '')
|
const customerId = computed(() => props.customerId || props.tenantId || '')
|
||||||
|
|||||||
@@ -2006,9 +2006,9 @@ const unifiedOrderRowActionIcons: Record<UnifiedOrderRowAction, Component> = {
|
|||||||
}
|
}
|
||||||
function unifiedOrderSecondaryActions(row: UnifiedOrderResource): UnifiedOrderRowAction[] {
|
function unifiedOrderSecondaryActions(row: UnifiedOrderResource): UnifiedOrderRowAction[] {
|
||||||
return [
|
return [
|
||||||
...(can('platform:order:note') ? ['note' as const] : []),
|
|
||||||
...(canApprove(row) ? ['approve' as const] : []),
|
...(canApprove(row) ? ['approve' as const] : []),
|
||||||
...(row.mainStatus === 'WAIT_MEASURE' && row.inboundId && can('platform:firstleg:inbound:measure:view') ? ['measurement' as const] : []),
|
...(['PENDING_REVIEW', 'WAIT_MEASURE'].includes(row.mainStatus) && row.inboundId && can('platform:firstleg:inbound:measure:view') ? ['measurement' as const] : []),
|
||||||
|
...(can('platform:order:note') ? ['note' as const] : []),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
function directUnifiedOrderActions(row: UnifiedOrderResource) {
|
function directUnifiedOrderActions(row: UnifiedOrderResource) {
|
||||||
|
|||||||
Reference in New Issue
Block a user