@@ -7,7 +7,8 @@ import {
createDiscard , createRelabel , createTransfer , getDiscard , getRelabel , getTransfer ,
getTransferCartonLabel ,
confirmRelabelCompletion , confirmTransferMeasurement , downloadRelabelCompletionPhoto , uploadRelabelShippingLabel ,
listDiscardCandidates , listDiscards , listRelabelInventoryCandidates , listRelabels , listTransfers ,
uploadRelabelFile ,
listDiscardCandidates , listDiscards , listRelabelInventoryCandidates , listRelabels , listTransfers , cancelDiscard ,
type RelabelInventoryCandidate ,
type RelabelCreate ,
type RelabelDetail ,
@@ -33,7 +34,7 @@ interface TransferCarton { cartonMark: string; customerCartonMark?: string; cart
const props = defineProps < { service : ServiceType } > ( )
const configs : Record < ServiceType , ServiceConfig > = {
labeling : { title : '贴标申请' , createTitle : '新增贴标申请' , numberLabel : '贴标申请单号' , emptyText : '暂无贴标申请' , columns : [ '操作' , '贴标申请单号' , '客户单号' , '海外操作仓' , '贴标要求' , 'SKU 数' , '总箱数' , '状态' , '创建时间' ] } ,
transfer : { title : '仓储转运单' , createTitle : '新增仓储转运单' , numberLabel : '转运单号' , emptyText : '暂无仓储转运订单' , columns : [ '操作' , '转运单号' , '入库箱数' , '中转 仓' , 'FBA 目的仓' , '入仓方式' , '是否换标' , '状态' , '创建时间' ] } ,
transfer : { title : '仓储转运单' , createTitle : '新增仓储转运单' , numberLabel : '转运单号' , emptyText : '暂无仓储转运订单' , columns : [ '操作' , '转运单号' , '入库箱数' , '海外 仓' , 'FBA 目的仓' , '入仓方式' , '是否换标' , '状态' , '创建时间' ] } ,
disposal : { title : '货物废弃' , createTitle : '新增货物废弃申请' , numberLabel : '废弃申请单号' , emptyText : '暂无货物废弃申请' , columns : [ '操作' , '废弃申请单号' , '进仓编号' , '操作仓' , 'SKU 汇总' , '废弃数量' , '预估费用' , '状态' , '创建时间' ] } ,
relabel : { title : '退货换标' , createTitle : '新建退货换标单' , numberLabel : '退货换标单号' , emptyText : '暂无退货换标订单' , columns : [ '操作' , '退货换标单号' , '来源 FBA 仓' , '目的 FBA 仓' , 'SKU 汇总' , '退件总数' , '是否换标' , '换标状态' , '尾程状态' , '创建时间' ] } ,
}
@@ -41,11 +42,11 @@ const config = computed(() => configs[props.service])
const statusOptions = computed ( ( ) => props . service === 'labeling'
? [ { label : '待处理' , value : 'PENDING_PROCESSING' } , { label : '处理中' , value : 'PROCESSING' } , { label : '待客户确认' , value : 'CUSTOMER_CONFIRM_PENDING' } , { label : '待出库' , value : 'READY_FOR_OUTBOUND' } , { label : '已完成' , value : 'COMPLETED' } , { label : '已拒绝' , value : 'REJECTED' } , { label : '已取消' , value : 'CANCELLED' } ]
: props . service === 'disposal'
? [ { label : '待审核' , value : 'PENDING_REVIEW' } , { label : '已通过 ' , value : 'APPROVED' } , { label : '已拒绝' , value : 'REJECT ED' } ]
? [ { label : '待审核' , value : 'PENDING_REVIEW' } , { label : '待 PDA 废弃 ' , value : 'APPROVED' } , { label : '待仓库确认完成' , value : 'PDA_COMPLETED' } , { label : '已完成' , value : 'COMPLETED' } , { label : '已拒绝' , value : 'REJECTED' } , { label : '已取消' , value : 'CANCELL ED' } ]
: [ { label : '待审核' , value : 'PENDING_REVIEW' } , { label : '已通过' , value : 'APPROVED' } , { label : '待分配' , value : 'PENDING_ASSIGNMENT' } , { label : '已分配' , value : 'ALLOCATED' } , { label : '已出库' , value : 'OUTBOUNDED' } , { label : '部分收货' , value : 'PARTIALLY_RECEIVED' } , { label : '已收货' , value : 'RECEIVED' } , { label : '已拒绝' , value : 'REJECTED' } ] )
const mode = ref < PageMode > ( 'list' )
const filters = reactive ( { number : '' , inboundNo : '' , warehouse : '' , destination : '' , status : '' , start : '' , end : '' } )
const form = reactive ( { customerNo : '' , inboundNo : '' , sourceWarehouse : '' , warehouse : '' , destination : '' , address : '' , contact : '' , phone : '' , deliveryMethod : '' , relabelDeliveryMethod : '' , trackingNo : '' , reason : '' , requirement : '' , relabel : false , remark : '' , labelDeadline : '' , estimatedArrivalAt : '' , estimatedShipAt : '' , fbaShipmentNo : '' , volumeCbm : 0.01 , chargeAmount : 0 } )
const form = reactive ( { customerNo : '' , inboundNo : '' , sourceWarehouse : '' , warehouse : '' , destination : '' , address : '' , contact : '' , phone : '' , deliveryMethod : '' , relabelDeliveryMethod : '' , trackingNo : '' , reason : '' , requirement : '' , relabel : false , remark : '' , labelDeadline : '' , estimatedArrivalAt : '' , estimatedShipAt : '' , fbaShipmentNo : '' , volumeCbm : 0.01 } )
const transferHasFbaDestination = ref ( false )
const selectedOperationWarehouse = ref < MerchantWarehouseDetail | null > ( null )
const operationWarehouseDetailLoading = ref ( false )
@@ -103,10 +104,17 @@ const cartonTemplateInput = ref<HTMLInputElement | null>(null)
const skuTemplateInput = ref < HTMLInputElement | null > ( null )
const mixedTemplateInput = ref < HTMLInputElement | null > ( null )
const transferCartonMarkInput = ref < HTMLInputElement | null > ( null )
const relabelFileInput = ref < HTMLInputElement | null > ( null )
const relabelFileScope = ref < 'CARTON_TOTAL' | 'SKU_TOTAL' | 'ITEM' > ( 'CARTON_TOTAL' )
const relabelFileItemId = ref < string > ( )
const cartonTotalFile = ref < File | null > ( null )
const skuTotalFile = ref < File | null > ( null )
const cartonTotalCreateInput = ref < HTMLInputElement | null > ( null )
const skuTotalCreateInput = ref < HTMLInputElement | null > ( null )
let cargoSequence = 0
let skuRelabelSequence = 0
watch ( ( ) => props . service , ( ) => { mode . value = 'list' ; resetFilters ( ) ; resetForm ( ) ; void load ( ) } )
watch ( ( ) => props . service , ( ) => { mode . value = 'list' ; resetFilters ( ) ; resetForm ( ) ; void loadPage ( ) } )
watch ( ( ) => form . relabel , ( value ) => {
if ( props . service === 'transfer' && value ) {
labelingMode . value = 'carton_and_sku'
@@ -124,10 +132,14 @@ function refreshWarehouseMarkLabels() {
while ( ( node = walker . nextNode ( ) ) ) nodes . push ( node as Text )
for ( const text of nodes ) text . nodeValue = text . nodeValue ? . replaceAll ( '旧箱唛' , '仓库唛头' ) . replaceAll ( '旧唛头' , '仓库唛头' ) || text . nodeValue
}
onMounted ( ( ) => { void load ( ) ; if ( props . service === 'labeling' || props . service === 'relabel' || props . service === 'transfer' || props . service === 'disposal' ) void loadWarehouses ( ) ; void nextTick ( refreshWarehouseMarkLabels ) } )
async function loadPage ( ) {
if ( props . service === 'labeling' || props . service === 'relabel' || props . service === 'transfer' || props . service === 'disposal' ) await loadWarehouses ( )
await load ( )
}
onMounted ( ( ) => { void loadPage ( ) ; void nextTick ( refreshWarehouseMarkLabels ) } )
function resetFilters ( ) { Object . assign ( filters , { number : '' , inboundNo : '' , warehouse : '' , destination : '' , status : '' , start : '' , end : '' } ) }
function resetForm ( ) {
Object . assign ( form , { customerNo : '' , inboundNo : '' , sourceWarehouse : '' , warehouse : '' , destination : '' , address : '' , contact : '' , phone : '' , deliveryMethod : '' , relabelDeliveryMethod : '' , trackingNo : '' , reason : '' , requirement : '' , relabel : false , remark : '' , labelDeadline : '' , estimatedArrivalAt : '' , estimatedShipAt : '' , fbaShipmentNo : '' , volumeCbm : 0.01 , chargeAmount : 0 } )
Object . assign ( form , { customerNo : '' , inboundNo : '' , sourceWarehouse : '' , warehouse : '' , destination : '' , address : '' , contact : '' , phone : '' , deliveryMethod : '' , relabelDeliveryMethod : '' , trackingNo : '' , reason : '' , requirement : '' , relabel : false , remark : '' , labelDeadline : '' , estimatedArrivalAt : '' , estimatedShipAt : '' , fbaShipmentNo : '' , volumeCbm : 0.01 } )
cargoRows . value = [ ]
labelingMode . value = 'carton'
skuRelabelRows . value = [ ]
@@ -144,9 +156,18 @@ async function openCreate() {
if ( props . service === 'labeling' || props . service === 'relabel' || props . service === 'transfer' ) void loadWarehouses ( )
if ( props . service === 'labeling' ) return
if ( props . service !== 'disposal' ) { addCargoRow ( ) ; return }
}
async function selectDiscardWarehouse ( ) {
selectedDiscardOrderId . value = ''
form . inboundNo = ''
discardCandidates . value = [ ]
cargoRows . value = [ ]
if ( ! form . warehouse ) return
discardCandidatesLoading . value = true
try { discardCandidates . value = await listDiscardCandidates ( ) }
catch ( error ) { ElMessage . error ( error instanceof Error ? error . message : '可废弃入库单加载失败' ) }
try {
const candidates = await listDiscardCandidates ( )
discardCandidates . value = candidates . filter ( ( candidate ) => String ( candidate . overseasWarehouseId ) === form . warehouse )
} catch ( error ) { ElMessage . error ( error instanceof Error ? error . message : '可废弃入库单加载失败' ) }
finally { discardCandidatesLoading . value = false }
}
function createCargoRow ( ) : CargoRow { return { id : ++ cargoSequence , sku : '' , name : '' , quantity : 1 , fnsku : '' , shipmentNo : '' , newSkuCode : '' , shippingMark : '' , customerCartonMarks : '' , cartonMark : '' , fbaCartonMark : '' , destinationWarehouseId : '' , remark : '' } }
@@ -179,6 +200,11 @@ function applyExistingCartonBinding(row: SkuRelabelRow) {
if ( ! row . destinationWarehouseId ) row . destinationWarehouseId = mapping . destinationWarehouseId
}
function selectShippingLabel ( event : Event ) { shippingLabelFile . value = ( event . target as HTMLInputElement ) . files ? . [ 0 ] || null }
function selectCartonTotalFile ( event : Event ) { cartonTotalFile . value = ( event . target as HTMLInputElement ) . files ? . [ 0 ] || null }
function selectSkuTotalFile ( event : Event ) { skuTotalFile . value = ( event . target as HTMLInputElement ) . files ? . [ 0 ] || null }
function chooseCreateTotalFile ( scope : 'CARTON_TOTAL' | 'SKU_TOTAL' ) {
; ( scope === 'CARTON_TOTAL' ? cartonTotalCreateInput : skuTotalCreateInput ) . value ? . click ( )
}
function buildSkuRelabelItems ( ) : RelabelCreate [ 'items' ] {
const groups = new Map < string , SkuRelabelRow [ ] > ( )
for ( const row of skuRelabelRows . value ) {
@@ -443,7 +469,7 @@ function statusLabel(value: string) {
PENDING _PROCESSING : '待处理' , PROCESSING : '处理中' , CUSTOMER _CONFIRM _PENDING : '待客户确认' ,
READY _FOR _OUTBOUND : '待出库' , COMPLETED : '已完成' , CANCELLED : '已取消' ,
PENDING _REVIEW : '待审核' , APPROVED : '已通过 ' , REJECTED : '已拒绝' , PENDING _ASSIGNMENT : '待分配' ,
PENDING _REVIEW : '待审核' , APPROVED : '待 PDA 废弃' , PDA _COMPLETED : '待仓库确认完成 ', REJECTED : '已拒绝' , PENDING _ASSIGNMENT : '待分配' ,
ALLOCATED : '已分配' , OUTBOUNDED : '已出库' , PARTIALLY _RECEIVED : '部分收货' , RECEIVED : '已收货' ,
}
@@ -476,7 +502,7 @@ async function load() {
} else {
const result = await listTransfers ( { page : 1 , size : 20 , transferNo : filters . number || undefined , inboundCode : filters . inboundNo || undefined , operatingWarehouseId : filters . warehouse || undefined , fbaWarehouseCode : filters . destination || undefined , status : filters . status || undefined , ... ( props . service === 'relabel' ? { needRelabel : true } : { } ) , createdFrom : dateTime ( filters . start ) , createdTo : dateTime ( filters . end , true ) } )
submittedRows . value = result . records . map ( ( item ) => props . service === 'transfer'
? row ( [ item . transferNo , item . packageCount , '—' , item . fbaWarehouseCode , deliveryMethodLabel ( item . deliveryMethod ) , item . needRelabel ? '是 · 待绑定换标单' : '否' , statusLabel ( item . status ) , formatDateTime ( item . createdAt ) ] )
? row ( [ item . transferNo , item . packageCount , warehouseDisplay ( item . operatingWarehouseId ) , item . fbaWarehouseCode , deliveryMethodLabel ( item . deliveryMethod ) , item . needRelabel ? '是 · 待绑定换标单' : '否' , statusLabel ( item . status ) , formatDateTime ( item . createdAt ) ] )
: row ( [ item . transferNo , '—' , item . fbaWarehouseCode , '—' , item . packageCount , '是' , item . relabelNo ? '已生成' : '待生成' , statusLabel ( item . status ) , formatDateTime ( item . createdAt ) ] ) )
}
} catch ( error ) { ElMessage . error ( error instanceof Error ? error . message : '列表加载失败' ) }
@@ -494,11 +520,11 @@ async function submit() {
|| ( labelingMode . value === 'carton_and_sku' && ( ! item . fbaCartonMark || ! item . destinationWarehouseId ) ) )
: cargoRows . value . some ( ( item ) => ( props . service !== 'labeling' && ! item . sku ) || ! item . name
|| ( props . service !== 'labeling' && item . quantity < 1 ) ) ) )
if ( ( props . service === 'relabel' && ! form . inboundNo ) || ( props . service !== 'disposal' && ! primaryWarehouse ) || invalidCargo ) {
if ( ( props . service === 'relabel' && ! form . inboundNo ) || ! primaryWarehouse || invalidCargo ) {
ElMessage . warning ( '请填写必填信息和完整的货物明细' ) ; return
}
if ( props . service === 'labeling' && ( ! form . labelDeadline || ! form . contact || ! form . phone || form . chargeAmount <= 0 ) ) {
ElMessage . warning ( '请填写贴标截止时间、联系人和贴标费用 ' ) ; return
if ( props . service === 'labeling' && ( ! form . labelDeadline || ! form . contact || ! form . phone ) ) {
ElMessage . warning ( '请填写贴标截止时间和海外仓联系人信息 ' ) ; return
}
if ( props . service === 'labeling' && labelingMode . value !== 'sku' && ! form . deliveryMethod ) {
ElMessage . warning ( '请选择换标完成后的派送方式' ) ; return
@@ -520,14 +546,14 @@ async function submit() {
ElMessage . warning ( '请填写完整的派送信息、体积、预计到达时间和 FBA 货件号' ) ; return
}
if ( props . service === 'transfer' && ( ! form . warehouse || ! form . deliveryMethod || ! form . address || ! form . estimatedArrivalAt || ! form . estimatedShipAt || form . volumeCbm < 0 || ( form . deliveryMethod === 'WAREHOUSE_PICKUP' && ( ! form . contact || ! form . phone ) ) ) ) {
const missing = [ ! form . warehouse && '中转 仓' , ! form . deliveryMethod && '送货方式' , ! form . address && '地址' , form . deliveryMethod === 'WAREHOUSE_PICKUP' && ! form . contact && '提货联系人' , form . deliveryMethod === 'WAREHOUSE_PICKUP' && ! form . phone && '联系人电话' , ! form . estimatedArrivalAt && '预计入仓时间' , ! form . estimatedShipAt && '预计发货时间' , form . volumeCbm < 0 && '预估总体积' ] . filter ( Boolean ) . join ( '、' )
const missing = [ ! form . warehouse && '海外 仓' , ! form . deliveryMethod && '送货方式' , ! form . address && '地址' , form . deliveryMethod === 'WAREHOUSE_PICKUP' && ! form . contact && '提货联系人' , form . deliveryMethod === 'WAREHOUSE_PICKUP' && ! form . phone && '联系人电话' , ! form . estimatedArrivalAt && '预计入仓时间' , ! form . estimatedShipAt && '预计发货时间' , form . volumeCbm < 0 && '预估总体积' ] . filter ( Boolean ) . join ( '、' )
ElMessage . warning ( ` 请填写: ${ missing || '必填信息' } ` ) ; return
}
if ( props . service === 'transfer' && transferHasFbaDestination . value && ( ! form . destination || ! form . fbaShipmentNo ) ) {
ElMessage . warning ( '已选择有 FBA 去向,请填写 FBA 目的仓和货件编号' ) ; return
}
if ( props . service === 'transfer' && form . relabel ) {
if ( ! form . labelDeadline || ! form . contact || ! form . phone || form . chargeAmount < 0.01 || ( labelingMode . value !== 'sku' && ! form . relabelDeliveryMethod ) ) { ElMessage . warning ( '请填写换标截止时间、联系人、费用 和换标后派送方式' ) ; return }
if ( ! form . labelDeadline || ! form . contact || ! form . phone || ( labelingMode . value !== 'sku' && ! form . relabelDeliveryMethod ) ) { ElMessage . warning ( '请填写换标截止时间、联系人和换标后派送方式' ) ; return }
const relabelRows = transferRelabelRows . value
const allMarks = relabelRows . flatMap ( transferCustomerMarks )
if ( ! relabelRows . length || relabelRows . some ( ( row ) => transferCustomerMarks ( row ) . length !== row . quantity ) ) { ElMessage . warning ( '每个换标明细的客户箱唛数量必须与换标数量一致' ) ; return }
@@ -544,9 +570,11 @@ async function submit() {
const items = labelingMode . value === 'carton'
? cartonDetailRows . value . map ( ( item ) => ( { sourceInventoryBalanceId : item . sourceInventoryBalanceId ! , sourceInventoryPositionId : item . sourceInventoryPositionId ! , sourceInboundOrderId : item . sourceInboundOrderId ! , skuCode : item . sku , productNameZh : item . name , totalPackageCount : 1 , notifiedPackageCount : 1 , shipmentNo : item . shipmentNo , trackingCode : form . trackingNo || undefined , newSkuCode : undefined , labelRequirement : form . requirement || undefined , cartonMark : item . cartonMark , fbaCartonMark : item . fbaCartonMark , destinationFbaWarehouseCode : item . destinationWarehouseId , operationType : 'CARTON_LABEL' as const , skuItems : [ ] , remark : item . remark || undefined } ) )
: buildSkuRelabelItems ( )
const created = await createRelabel ( { customerOrderNo : sourceInboundOrders || '贴标申请' , operationWarehouseId : form . warehouse , labelDeadline : form . labelDeadline , contactName : form . contact , contactPhone : form . phone , chargeAmount : form . chargeAmount , remark : form . remark || undefined , idempotencyKey , items ,
const created = await createRelabel ( { customerOrderNo : sourceInboundOrders || '贴标申请' , operationWarehouseId : form . warehouse , labelDeadline : form . labelDeadline , contactName : form . contact , contactPhone : form . phone , remark : form . remark || undefined , idempotencyKey , items ,
deliveryMethod : labelingMode . value === 'sku' ? undefined : form . deliveryMethod as 'TRUCK' | 'EXPRESS' | 'TRUCK_PICKUP' | 'EXPRESS_PICKUP' ,
printShippingLabel : labelingMode . value !== 'sku' && ( form . deliveryMethod === 'EXPRESS' || form . deliveryMethod === 'EXPRESS_PICKUP' ) && form . relabel } )
if ( cartonTotalFile . value ) await uploadRelabelFile ( created . application . relabelNo , 'CARTON_TOTAL' , cartonTotalFile . value )
if ( skuTotalFile . value ) await uploadRelabelFile ( created . application . relabelNo , 'SKU_TOTAL' , skuTotalFile . value )
if ( shippingLabelFile . value ) await uploadRelabelShippingLabel ( created . application . relabelNo , shippingLabelFile . value )
} else if ( props . service === 'disposal' ) {
const items = cargoRows . value . filter ( ( item ) => item . quantity > 0 ) . map ( ( item ) => {
@@ -561,7 +589,7 @@ async function submit() {
const customerCartonMarks = ( form . relabel ? transferRelabelRows . value : cargoRows . value ) . flatMap ( transferCustomerMarks )
const transferRemark = [ form . remark , form . relabel && form . requirement ? ` 换标要求: ${ form . requirement } ` : '' ] . filter ( Boolean ) . join ( '; ' )
const operationType = labelingMode . value === 'carton' ? 'CARTON_LABEL' : labelingMode . value === 'sku' ? 'SKU_LABEL' : 'CARTON_AND_SKU'
await createTransfer ( { operatingWarehouseId : primaryWarehouse , fbaWarehouseCode : form . destination || undefined , deliveryAddress : form . address , packageCount , volumeCbm : form . volumeCbm , deliveryMethod : form . deliveryMethod , estimatedArrivalAt : form . estimatedArrivalAt , estimatedShipAt : form . estimatedShipAt || undefined , fbaShipmentNo : form . fbaShipmentNo || undefined , trackingNo : form . deliveryMethod === 'CUSTOMER_DELIVERY' ? form . trackingNo || undefined : undefined , fbaBoxNos : customerCartonMarks . length ? customerCartonMarks . join ( ',' ) : undefined , remark : transferRemark || undefined , needRelabel : props . service === 'relabel' || form . relabel , labelDeadline : form . relabel ? form . labelDeadline : undefined , relabelContactName : ( form . relabel || form . deliveryMethod === 'WAREHOUSE_PICKUP' ) ? form . contact : undefined , relabelContactPhone : ( form . relabel || form . deliveryMethod === 'WAREHOUSE_PICKUP' ) ? form . phone : undefined , relabelChargeAmount : form . relabel ? form . chargeAmount : undefined , relabelDeliveryMethod : form . relabel && labelingMode . value !== 'sku' ? form . relabelDeliveryMethod as 'TRUCK' | 'EXPRESS' | 'TRUCK_PICKUP' | 'EXPRESS_PICKUP' : undefined , idempotencyKey , items : cargoRows . value . map ( ( item ) => ( { skuCode : item . sku , productNameZh : item . name , packageCount : item . quantity , shippingMark : transferCustomerMarks ( item ) . join ( ',' ) || undefined } ) ) , relabelItems : form . relabel ? transferRelabelRows . value . map ( ( item ) => ( { operationType , customerCartonMarks : transferCustomerMarks ( item ) , originalSku : item . sku , newSku : item . newSkuCode || undefined , quantity : item . quantity , fbaCartonMark : item . fbaCartonMark || undefined , destinationWarehouseCode : item . destinationWarehouseId || undefined , remark : item . remark || undefined } ) ) : undefined } )
await createTransfer ( { operatingWarehouseId : primaryWarehouse , fbaWarehouseCode : form . destination || undefined , deliveryAddress : form . address , packageCount , volumeCbm : form . volumeCbm , deliveryMethod : form . deliveryMethod , estimatedArrivalAt : form . estimatedArrivalAt , estimatedShipAt : form . estimatedShipAt || undefined , fbaShipmentNo : form . fbaShipmentNo || undefined , trackingNo : form . deliveryMethod === 'CUSTOMER_DELIVERY' ? form . trackingNo || undefined : undefined , fbaBoxNos : customerCartonMarks . length ? customerCartonMarks . join ( ',' ) : undefined , remark : transferRemark || undefined , needRelabel : props . service === 'relabel' || form . relabel , labelDeadline : form . relabel ? form . labelDeadline : undefined , relabelContactName : ( form . relabel || form . deliveryMethod === 'WAREHOUSE_PICKUP' ) ? form . contact : undefined , relabelContactPhone : ( form . relabel || form . deliveryMethod === 'WAREHOUSE_PICKUP' ) ? form . phone : undefined , relabelDeliveryMethod : form . relabel && labelingMode . value !== 'sku' ? form . relabelDeliveryMethod as 'TRUCK' | 'EXPRESS' | 'TRUCK_PICKUP' | 'EXPRESS_PICKUP' : undefined , idempotencyKey , items : cargoRows . value . map ( ( item ) => ( { skuCode : item . sku , productNameZh : item . name , packageCount : item . quantity , shippingMark : transferCustomerMarks ( item ) . join ( ',' ) || undefined } ) ) , relabelItems : form . relabel ? transferRelabelRows . value . map ( ( item ) => ( { operationType , customerCartonMarks : transferCustomerMarks ( item ) , originalSku : item . sku , newSku : item . newSkuCode || undefined , quantity : item . quantity , fbaCartonMark : item . fbaCartonMark || undefined , destinationWarehouseCode : item . destinationWarehouseId || undefined , remark : item . remark || undefined } ) ) : undefined } )
}
ElMessage . success ( ` ${ config . value . title } 提交成功 ` ) ; mode . value = 'list' ; await load ( )
} catch ( error ) { ElMessage . error ( error instanceof Error ? error . message : '提交失败' ) }
@@ -570,7 +598,8 @@ async function submit() {
async function openDetail ( value : Record < string , string > ) {
try {
const detail = props . service === 'labeling' ? await getRelabel ( value [ '0' ] ) : props . service === 'disposal' ? await getDiscard ( value [ '0' ] ) : await getTransfer ( value [ '0' ] )
selectedDetail . value = { ... value , ... ( detail as ServiceDetail ) }
const discardSummary = props . service === 'disposal' ? ( detail as { summary ? : ServiceDetail } ) . summary : undefined
selectedDetail . value = { ... value , ... ( detail as ServiceDetail ) , ... ( discardSummary || { } ) }
selectedRelabelDetail . value = props . service === 'labeling' ? detail as RelabelDetail : null
mode . value = 'detail'
} catch ( error ) { ElMessage . error ( error instanceof Error ? error . message : '详情加载失败' ) }
@@ -613,6 +642,24 @@ async function previewCompletionPhoto(fileId: string) {
window . setTimeout ( ( ) => URL . revokeObjectURL ( url ) , 60 _000 )
} catch ( error ) { ElMessage . error ( error instanceof Error ? error . message : '完工照片加载失败' ) }
}
async function cancelSelectedDiscard ( ) {
const no = String ( selectedDetail . value ? . discardNo || selectedDetail . value ? . [ '0' ] || '' )
if ( ! no ) return
try { await ElMessageBox . confirm ( '确认取消该废弃申请吗?' , '取消确认' , { confirmButtonText : '取消申请' , cancelButtonText : '返回' } ) ; await cancelDiscard ( no ) ; ElMessage . success ( '废弃申请已取消' ) ; mode . value = 'list' ; await load ( ) }
catch ( error ) { if ( error !== 'cancel' ) ElMessage . error ( error instanceof Error ? error . message : '取消失败' ) }
}
function chooseRelabelFile ( scope : 'CARTON_TOTAL' | 'SKU_TOTAL' | 'ITEM' , itemId ? : string ) {
relabelFileScope . value = scope ; relabelFileItemId . value = itemId ; relabelFileInput . value ? . click ( )
}
async function uploadSelectedRelabelFile ( event : Event ) {
const input = event . target as HTMLInputElement ; const file = input . files ? . [ 0 ] ; input . value = ''
const relabelNo = selectedRelabelDetail . value ? . application . relabelNo
if ( ! file || ! relabelNo ) return
try {
selectedRelabelDetail . value = await uploadRelabelFile ( relabelNo , relabelFileScope . value , file , relabelFileItemId . value )
ElMessage . success ( '文件上传成功' )
} catch ( error ) { ElMessage . error ( error instanceof Error ? error . message : '文件上传失败' ) }
}
async function loadWarehouses ( ) {
fbaWarehousesLoading . value = true
fbaWarehousesError . value = ''
@@ -620,10 +667,7 @@ async function loadWarehouses() {
try {
const [ fbaResult , operationResult ] = await Promise . allSettled ( [
loadAllWarehouseRecords ( 'FBA' , getMerchantWarehouses ) ,
// The warehouse master uses OVERSEAS_PARTNER for managed overseas transit warehouses
// (including Los Angeles and New York). Query the active catalogue without a type
// restriction, then accept both supported overseas warehouse types.
loadAllWarehouseRecords ( 'OVERSEAS' , ( query ) => getMerchantWarehouses ( { page : query . page , size : query . size } ) ) ,
loadAllWarehouseRecords ( 'OVERSEAS' , getMerchantWarehouses ) ,
] )
fbaWarehouses . value = fbaResult . status === 'fulfilled' ? fbaResult . value . filter ( ( item ) => item . status === 'ACTIVE' && item . warehouseType === 'FBA' ) : [ ]
operationWarehouses . value = operationResult . status === 'fulfilled'
@@ -696,6 +740,8 @@ function selectRelabelInventory(inboundOrderId: string) {
skuRelabelRows . value = [ ]
importedRelabelBindings . value = [ ]
shippingLabelFile . value = null
cartonTotalFile . value = null
skuTotalFile . value = null
if ( labelingMode . value !== 'carton' ) addSkuRelabelRow ( )
}
< / script >
@@ -729,19 +775,19 @@ function selectRelabelInventory(inboundOrderId: string) {
< form : class = "{ 'warehouse-transfer-form': props.service === 'transfer', 'warehouse-transfer-form--relabel': props.service === 'transfer' && form.relabel }" @submit.prevent ="submit" >
< div class = "warehouse-card warehouse-form-section warehouse-transfer-main-card" > < h3 > { { props . service === 'transfer' ? '入库与转运信息' : props . service === 'relabel' ? '退货信息' : props . service === 'labeling' ? '订单信息' : '基础信息' } } < / h3 >
< div class = "warehouse-form-grid" >
< label v-if = "props.service === 'disposal'" class="warehouse-span-2"><span><i>*</i>选择入库单 </span><el-select v-model="selectedDiscardOrderId" filterable :loading="discardCandidatesLoading " placeholder="请选择有可用库存的入库单 " @change="selectDiscardInbound "><el-option v-for="candidate in discardCandidates" :key="candidate.orderId" :label="`${candidate.inboundOrderNo || candidate.inboundCode || '—'}| ${candidate.inboundCode || '—'}| ${candidate.overseasWarehouseName || '—'}|可用 ${candidate.availablePackages} 箱`" :value="candidate.orderId" /></el-select><small class="warehouse-hint" > 仅显示一件代发中仍有可用箱数的入库单 。 < / small > < / label >
< label v-if = "props.service === 'disposal'" class="warehouse-span-2"><span><i>*</i>操作仓 </span><el-select v-model="form.warehouse" filterable clearable :loading="fbaWarehousesLoading" :disabled="Boolean(operationWarehousesError) " placeholder="请选择海外仓 " @change="selectDiscardWarehouse "><el-option v-for="warehouse in operationWarehouses" :key="warehouse.id" :label="warehouseLabel(warehouse)" :value="String(warehouse.id)" /></el-select><small v-if="operationWarehousesError" class="warehouse-hint">{{ operationWarehousesError }}</small><small v-else class="warehouse-hint" > 请先选择本次废弃货物所在的海外仓 。 < / small > < / label >
< label v-if = "props.service === 'disposal'" class="warehouse-span-2"><span><i>*</i>选择入库单</span><el-select v-model="selectedDiscardOrderId" filterable clearable :loading="discardCandidatesLoading" :disabled="!form.warehouse" no-data-text="当前海外仓暂无可废弃库存" placeholder="请先选择操作仓,再选择有可用库存的入库单" @change="selectDiscardInbound"><el-option v-for="candidate in discardCandidates" :key="candidate.orderId" :label="`${candidate.inboundOrderNo || candidate.inboundCode || '—'}| ${candidate.inboundCode || '—'}|可用 ${candidate.availablePackages} 箱`" :value="candidate.orderId" /></el-select><small class="warehouse-hint" > 仅显示当前操作仓下一件代发中仍有可用箱数的入库单 。 < / small > < / label >
< label v-if = "props.service === 'relabel'"><span><i>*</i>进仓编号</span><el-input v-model="form.inboundNo" placeholder="请输入已有入仓编号" / > < / label >
< label v-if = "props.service === 'relabel'"><span><i>*</i>来源 FBA 仓库</span><el-select v-model="form.sourceWarehouse" :loading="fbaWarehousesLoading" :disabled="Boolean(fbaWarehousesError)" placeholder="请选择平台维护的 FBA 仓"><el-option v-for="warehouse in fbaWarehouses" :key="warehouse.id" :label="warehouseLabel(warehouse)" :value="warehouse.warehouseCode" / > < / el-select > < / label >
< label v-else-if = "props.service === 'disposal'"><span>进仓编号</span><el-input v-model="form.inboundNo" readonly / > < / label >
< label v-else > < span > < i > * < / i > { { props . service === 'labeling' ? '海外操作仓(中转仓)' : props . service === 'transfer' ? '入库中转 仓' : '操作仓' } } < / span > < el-select v-model = "form.warehouse" :loading="fbaWarehousesLoading || operationWarehouseDetailLoading" :disabled="Boolean(operationWarehousesError)" clearable placeholder="请选择国外中转仓" @change="props.service === 'labeling' ? selectOperationWarehouse() : props.service === 'transfer' && selectTransferWarehouse()"><el-option v-for="warehouse in operationWarehouses" :key="warehouse.id" :label="warehouseLabel(warehouse)" :value="String(warehouse.id)" /></el-select><small v-if="operationWarehousesError" class="warehouse-hint">{{ operationWarehousesError }}</small><small v-else-if="props.service === 'labeling'" class="warehouse-hint">选择后仅查询当前客户在该中转仓的可用库存。</small><small v-else-if="props.service === 'transfer'" class="warehouse-hint" > 本批货物将先进入该仓完成签收和入库 。 < / small > < / label >
< label v-else > < span > < i > * < / i > { { props . service === 'labeling' ? '海外操作仓(中转仓)' : props . service === 'transfer' ? '入库海外 仓' : '操作仓' } } < / span > < el-select v-model = "form.warehouse" :loading="fbaWarehousesLoading || operationWarehouseDetailLoading" :disabled="Boolean(operationWarehousesError)" clearable : placeholder="props.service === 'transfer' ? '请选择海外仓' : ' 请选择国外中转仓' " @change="props.service === 'labeling' ? selectOperationWarehouse() : props.service === 'transfer' && selectTransferWarehouse()"><el-option v-for="warehouse in operationWarehouses" :key="warehouse.id" :label="warehouseLabel(warehouse)" :value="String(warehouse.id)" /></el-select><small v-if="operationWarehousesError" class="warehouse-hint">{{ operationWarehousesError }}</small><small v-else-if="props.service === 'labeling'" class="warehouse-hint">选择后仅查询当前客户在该中转仓的可用库存。</small><small v-else-if="props.service === 'transfer'" class="warehouse-hint" > 本批货物将先进入该海外 仓完成签收和入库 。 < / small > < / label >
< label v-if = "props.service === 'labeling'" class="warehouse-span-2"><span><i>*</i>选择有库存的历史入仓单</span><el-select v-model="selectedRelabelInboundOrderId" filterable clearable :loading="relabelCandidatesLoading" :disabled="!form.warehouse" no-data-text="当前中转仓暂无已入库可用库存" placeholder="请选择曾经下单且当前仍有库存的入仓单" @change="selectRelabelInventory"><el-option v-for="option in relabelInboundOptions" :key="option.value" :label="`${option.inboundOrderNo}|入仓码 ${option.inboundCode}|可用 ${option.availablePackages} 箱`" :value="option.value" /></el-select><small class="warehouse-hint" > 仅显示当前客户在所选中转仓已经完成入库且仍有可用库存的历史入仓单 。 < / small > < / label >
< label v-if = "props.service === 'disposal'"><span>操作仓</span><el-input :model-value="discardCandidates.find((item) => item.orderId === selectedDiscardOrderId)?.overseasWarehouseName || form.warehouse" readonly / > < / label >
< div v-if = "props.service === 'transfer'" class="warehouse-choice-field warehouse-span-2"><span><i>*</i>货物如何送到中转仓</span><el-radio-group v-model="form.deliveryMethod" @change="selectTransferInboundMethod"><el-radio-button value="WAREHOUSE_PICKUP">仓库上门提货</el-radio-button><el-radio-button value="CUSTOMER_DELIVERY" > 客户送货到仓 < / el -radio -button > < / el-radio-group > < small > 仓库上门提货 : 填写货物当前地址 ; 客户送货到仓 : 下方自动展示中转仓收货信息 。 < / small > < / div >
< div v-if = "props.service === 'transfer'" class="warehouse-choice-field warehouse-span-2"><span><i>*</i>货物如何送到海外仓</span><el-radio-group v-model="form.deliveryMethod" @change="selectTransferInboundMethod"><el-radio-button value="WAREHOUSE_PICKUP">仓库上门提货</el-radio-button><el-radio-button value="CUSTOMER_DELIVERY" > 客户送货到仓 < / el -radio -button > < / el-radio-group > < small > 仓库上门提货 : 填写货物当前地址 ; 客户送货到仓 : 下方自动展示海外仓收货信息 。 < / small > < / div >
< label v-if = "props.service === 'transfer' && form.deliveryMethod === 'WAREHOUSE_PICKUP'" class="pickup-address-field"><span><i>*</i>提货地址</span><el-input v-model="form.address" placeholder="请输入仓库上门提货的详细地址" / > < / label >
< label v-if = "props.service === 'transfer' && form.deliveryMethod === 'WAREHOUSE_PICKUP'"><span><i>*</i>提货联系人</span><el-input v-model="form.contact" placeholder="请输入提货联系人" maxlength="128" / > < / label >
< label v-if = "props.service === 'transfer' && form.deliveryMethod === 'WAREHOUSE_PICKUP'"><span><i>*</i>联系人电话</span><el-input v-model="form.phone" placeholder="请输入联系人电话" maxlength="64" / > < / label >
< div v-if = "props.service === 'transfer' && form.deliveryMethod === 'CUSTOMER_DELIVERY'" v-loading="operationWarehouseDetailLoading" class="warehouse-receiving-card warehouse-span-2" >
< div > < span > 仓库 收货信息 < / span > < strong > { { operationWarehouseAddress || '该中转 仓暂未维护收货地址' } } < / strong > < / div >
< div > < span > 海外 仓收货信息< / span > < strong > { { operationWarehouseAddress || '该海外 仓暂未维护收货地址' } } < / strong > < / div >
< label class = "warehouse-span-2" > < span > < i > * < / i > 送货地址 < / span > < el-input v-model = "form.address" placeholder="请输入实际送货地址" / > < / label >
< div > < span > 收货联系人 < / span > < strong > { { form . contact || '未维护' } } < / strong > < / div >
< div > < span > 联系电话 < / span > < strong > { { form . phone || '未维护' } } < / strong > < / div >
@@ -752,7 +798,6 @@ function selectRelabelInventory(inboundOrderId: string) {
< label v-if = "props.service === 'labeling'"><span><i>*</i>海外仓签收联系人<em v-if="form.warehouse && !form.contact" class="warehouse-unmaintained">未维护</em></span><el-input v-model="form.contact" placeholder="选择海外操作仓后自动带出" / > < / label >
< label v-if = "props.service === 'labeling'"><span><i>*</i>海外仓联系电话<em v-if="form.warehouse && !form.phone" class="warehouse-unmaintained">未维护</em></span><el-input v-model="form.phone" placeholder="选择海外操作仓后自动带出" / > < / label >
< label v-if = "props.service === 'labeling'"><span><i>*</i>贴标截止时间</span><el-date-picker v-model="form.labelDeadline" type="datetime" value-format="YYYY-MM-DDTHH:mm:ss" placeholder="请选择截止时间" / > < / label >
< label v-if = "props.service === 'labeling'"><span><i>*</i>贴标费用(CNY) </span><el-input-number v-model="form.chargeAmount" :min="0" :precision="2" controls-position="right" placeholder="请输入贴标费用" / > < / label >
< label v-if = "props.service === 'labeling' && labelingMode !== 'sku'"><span><i>*</i>换标后派送方式</span><el-select v-model="form.deliveryMethod" placeholder="请选择派送方式"><el-option label="卡车派送" value="TRUCK" /><el-option label="快递派送" value="EXPRESS" /><el-option label="卡车自提" value="TRUCK_PICKUP" /><el-option label="快递自提" value="EXPRESS_PICKUP" /></el-select><small class="warehouse-hint" > 卡车派送进入预排车 ; 其余方式确认换标完成后进入换标出库 。 < / small > < / label >
< div v-if = "props.service === 'labeling' && labelingMode !== 'sku' && (form.deliveryMethod === 'EXPRESS' || form.deliveryMethod === 'EXPRESS_PICKUP')" class="warehouse-checkbox-field"><span>是否打印面单</span><el-checkbox v-model="form.relabel" > 需要仓库打印面单 < / el -checkbox > < / div >
< label v-if = "props.service === 'labeling' && labelingMode !== 'sku' && (form.deliveryMethod === 'EXPRESS' || form.deliveryMethod === 'EXPRESS_PICKUP') && form.relabel"><span><i>*</i>上传面单文件</span><input class="warehouse-native-file" type="file" accept="application/pdf,image/*,.pdf" @change="selectShippingLabel"><small class="warehouse-hint" > 支持 PDF 或图片 , 最大 20 MB 。 < / small > < / label >
@@ -760,7 +805,7 @@ function selectRelabelInventory(inboundOrderId: string) {
< label v-if = "props.service === 'transfer' || props.service === 'relabel'"><span><i>*</i>预估总体积(CBM) </span><el-input-number v-model="form.volumeCbm" :min="0" :precision="4" :step="0.0001" controls-position="right" placeholder="请输入预估总体积" / > < / label >
< label v-if = "props.service === 'transfer' || props.service === 'relabel'"><span><i>*</i>{{ props.service === 'transfer' ? '预计入仓时间' : '预计到达时间' }}</span><el-date-picker v-model="form.estimatedArrivalAt" type="datetime" value-format="YYYY-MM-DDTHH:mm:ss" :placeholder="props.service === 'transfer' ? '请选择预计入仓时间' : '请选择预计到达时间'" / > < / label >
< label v-if = "props.service === 'transfer'"><span><i>*</i>预计发货时间</span><el-date-picker v-model="form.estimatedShipAt" type="datetime" value-format="YYYY-MM-DDTHH:mm:ss" placeholder="请选择预计发货时间" / > < / label >
< div v-if = "props.service === 'transfer'" class="warehouse-choice-field warehouse-span-2"><span><i>*</i>是否已有 FBA 去向</span><el-radio-group v-model="transferHasFbaDestination" @change="selectTransferFbaAvailability"><el-radio-button :value="false">暂未确定</el-radio-button><el-radio-button :value="true" > 已有 FBA 去向 < / el -radio -button > < / el-radio-group > < small > 暂未确定也可以提交 , 货物先正常入中转 仓 , 后续再补充转运指令 。 < / small > < / div >
< div v-if = "props.service === 'transfer'" class="warehouse-choice-field warehouse-span-2"><span><i>*</i>是否已有 FBA 去向</span><el-radio-group v-model="transferHasFbaDestination" @change="selectTransferFbaAvailability"><el-radio-button :value="false">暂未确定</el-radio-button><el-radio-button :value="true" > 已有 FBA 去向 < / el -radio -button > < / el-radio-group > < small > 暂未确定也可以提交 , 货物先正常入海外 仓 , 后续再补充转运指令 。 < / small > < / div >
< label v-if = "props.service === 'transfer' && transferHasFbaDestination && !form.relabel"><span><i>*</i>目的 FBA 仓</span><el-select v-model="form.destination" :loading="fbaWarehousesLoading" :disabled="Boolean(fbaWarehousesError)" filterable placeholder="请选择平台维护的 FBA 仓"><el-option v-for="warehouse in fbaWarehouses" :key="warehouse.id" :label="warehouseLabel(warehouse)" :value="warehouse.warehouseCode" / > < / el-select > < / label >
< label v-if = "props.service === 'transfer' && transferHasFbaDestination && !form.relabel"><span><i>*</i>FBA 货件编号</span><el-input v-model="form.fbaShipmentNo" placeholder="请输入 FBA 货件编号" / > < / label >
< label v-if = "props.service === 'relabel'"><span><i>*</i>FBA 货件编号</span><el-input v-model="form.fbaShipmentNo" placeholder="请输入 FBA 货件编号" / > < / label >
@@ -775,6 +820,8 @@ function selectRelabelInventory(inboundOrderId: string) {
< div class = "warehouse-section-heading warehouse-labeling-heading" >
< h3 > 货物明细 < / h3 >
< div class = "warehouse-template-actions" >
< el-button size = "small" @click ="chooseCreateTotalFile('CARTON_TOTAL')" > < Upload :size = "15" / > 上传箱唛总文件 < / el-button >
< el-button size = "small" @click ="chooseCreateTotalFile('SKU_TOTAL')" > < Upload :size = "15" / > 上传 SKU 总文件 < / el-button >
< el-button size = "small" :disabled = "!cargoRows.length" @click ="downloadRelabelTemplate('sku')" > < Download :size = "15" / > 下载 SKU 关联模板 < / el-button >
< el-button size = "small" :disabled = "!cargoRows.length" @click ="skuTemplateInput?.click()" > < Upload :size = "15" / > 上传 SKU 关联 < / el-button >
< el-button size = "small" :disabled = "!cargoRows.length" @click ="downloadRelabelTemplate('carton')" > < Download :size = "15" / > 下载箱号关联模板 < / el-button >
@@ -784,8 +831,11 @@ function selectRelabelInventory(inboundOrderId: string) {
< input ref = "skuTemplateInput" class = "warehouse-hidden-input" type = "file" accept = ".csv,text/csv" @change ="importRelabelTemplate($event, 'sku')" >
< input ref = "cartonTemplateInput" class = "warehouse-hidden-input" type = "file" accept = ".csv,text/csv" @change ="importRelabelTemplate($event, 'carton')" >
< input ref = "mixedTemplateInput" class = "warehouse-hidden-input" type = "file" accept = ".csv,text/csv" @change ="importRelabelTemplate($event, 'mixed')" >
< input ref = "cartonTotalCreateInput" class = "warehouse-hidden-input" type = "file" accept = "application/pdf,.pdf" @change ="selectCartonTotalFile" >
< input ref = "skuTotalCreateInput" class = "warehouse-hidden-input" type = "file" accept = "application/pdf,.pdf" @change ="selectSkuTotalFile" >
< / div >
< / div >
< div class = "warehouse-upload-summary" > < span > 箱唛总文件 : { { cartonTotalFile ? . name || '未选择' } } < / span > < span > SKU 总文件 : { { skuTotalFile ? . name || '未选择' } } < / span > < / div >
< div class = "warehouse-labeling-mode" >
< span > 换标类型 < / span >
< el-radio-group v-model = "labelingMode" aria-label="换标类型" >
@@ -814,7 +864,7 @@ function selectRelabelInventory(inboundOrderId: string) {
</div>
<div v-if=" props . service === 'transfer' && form . relabel " class=" warehouse - card warehouse - form - section warehouse - transfer - relabel ">
<div class=" warehouse - section - heading warehouse - labeling - heading "><div><h3>货物明细</h3><p>换标明细与贴标申请保持一致;客户只填写自己的箱唛,我方箱唛由系统生成。</p></div><div class=" warehouse - template - actions "><el-button size=" small " :disabled=" ! cargoRows . length " @click=" downloadRelabelTemplate ( 'sku' ) "><Download :size=" 15 " />下载 SKU 关联模板</el-button><el-button size=" small " :disabled=" ! cargoRows . length " @click=" skuTemplateInput ? . click ( ) "><Upload :size=" 15 " />上传 SKU 关联</el-button><el-button size=" small " :disabled=" ! cargoRows . length " @click=" downloadRelabelTemplate ( 'carton' ) "><Download :size=" 15 " />下载箱号关联模板</el-button><el-button size=" small " :disabled=" ! cargoRows . length " @click=" cartonTemplateInput ? . click ( ) "><Upload :size=" 15 " />上传箱号关联</el-button><el-button size=" small " :disabled=" ! cargoRows . length " @click=" downloadRelabelTemplate ( 'mixed' ) "><Download :size=" 15 " />下载 SKU 混箱模板</el-button><el-button size=" small " :disabled=" ! cargoRows . length " @click=" mixedTemplateInput ? . click ( ) "><Upload :size=" 15 " />上传 SKU 混箱</el-button><input ref=" skuTemplateInput " class=" warehouse - hidden - input " type=" file " accept=" . csv , text / csv " @change=" importRelabelTemplate ( $event , 'sku' ) "><input ref=" cartonTemplateInput " class=" warehouse - hidden - input " type=" file " accept=" . csv , text / csv " @change=" importRelabelTemplate ( $event , 'carton' ) "><input ref=" mixedTemplateInput " class=" warehouse - hidden - input " type=" file " accept=" . csv , text / csv " @change=" importRelabelTemplate ( $event , 'mixed' ) "></div></div>
<div class=" warehouse - form - grid warehouse - transfer - relabel - fields "><label><span><i>*</i>换标截止时间</span><el-date-picker v-model=" form . labelDeadline " type=" datetime " value-format=" YYYY - MM - DDTHH : mm : ss " placeholder=" 请选择截止时间 " /></label><label><span><i>*</i>联系人</span><el-input v-model=" form . contact " placeholder=" 请输入联系人 " /></label><label><span><i>*</i>联系电话</span><el-input v-model=" form . phone " placeholder=" 请输入联系电话 " /></label><label><span><i>*</i>换标费用(CNY) </span><el-input-number v-model=" form . chargeAmount " :min=" 0.01 " :precision=" 2 " :step=" 0.01 " controls-position=" right " placeholder=" 请输入服务费用 " /></label><label v-if="labelingMode !== 'sku' "><span><i>*</i>换标后派送方式</span><el-select v-model=" form . relabelDeliveryMethod " placeholder=" 请选择派送方式 "><el-option label=" 卡车派送 " value=" TRUCK " /><el-option label=" 快递派送 " value=" EXPRESS " /><el-option label=" 卡车自提 " value=" TRUCK _PICKUP " /><el-option label=" 快递自提 " value=" EXPRESS _PICKUP " /></el-select></label><label><span>FBA 货件编号</span><el-input v-model=" form . fbaShipmentNo " placeholder=" 选填 , 未填则使用转运单号 " /></label><label class=" warehouse - span - 2 "><span>贴标要求</span><el-input v-model=" form . requirement " type=" textarea " :rows=" 2 " maxlength=" 1000 " show-word-limit placeholder=" 请输入贴标要求 ( 选填 ) " /></label></div>
<div class=" warehouse - form - grid warehouse - transfer - relabel - fields "><label><span><i>*</i>换标截止时间</span><el-date-picker v-model=" form . labelDeadline " type=" datetime " value-format=" YYYY - MM - DDTHH : mm : ss " placeholder=" 请选择截止时间 " /></label><label><span><i>*</i>联系人</span><el-input v-model=" form . contact " placeholder=" 请输入联系人 " /></label><label><span><i>*</i>联系电话</span><el-input v-model=" form . phone " placeholder=" 请输入联系电话 " /></label><label v-if=" labelingMode !== 'sku' "><span><i>*</i>换标后派送方式</span><el-select v-model=" form . relabelDeliveryMethod " placeholder=" 请选择派送方式 "><el-option label=" 卡车派送 " value=" TRUCK " /><el-option label=" 快递派送 " value=" EXPRESS " /><el-option label=" 卡车自提 " value=" TRUCK _PICKUP " /><el-option label=" 快递自提 " value=" EXPRESS _PICKUP " /></el-select></label><label><span>FBA 货件编号</span><el-input v-model=" form . fbaShipmentNo " placeholder=" 选填 , 未填则使用转运单号 " /></label><label class=" warehouse - span - 2 "><span>贴标要求</span><el-input v-model=" form . requirement " type=" textarea " :rows=" 2 " maxlength=" 1000 " show-word-limit placeholder=" 请输入贴标要求 ( 选填 ) " /></label></div>
<div class=" warehouse - labeling - mode "><span>换标类型</span><el-radio-group v-model=" labelingMode " aria-label=" 换标类型 "><el-radio-button value=" carton ">只换箱唛</el-radio-button><el-radio-button value=" sku ">只换 SKU 标签</el-radio-button><el-radio-button value=" carton _and _sku ">SKU 和箱唛都换</el-radio-button></el-radio-group><p>{{ labelingModeHint }}</p></div>
<div v-if=" importedRelabelBindings . length " class=" warehouse - import - preview "><div class=" warehouse - section - heading "><div><strong>待导入绑定关系</strong><p>可只勾选本次需要换标的部分,也可以全选后一次导入。</p></div><div><el-checkbox :model-value=" importedRelabelBindings . every ( ( item ) => item . selected ) " @change=" selectAllImportedBindings ( Boolean ( $event ) ) ">全选</el-checkbox><el-button type=" primary " size=" small " @click=" importSelectedBindingsToDetails ">导入到明细</el-button></div></div><div class=" warehouse - table - scroll "><table class=" warehouse - binding - preview - table "><thead><tr><th>选择</th><th>关系类型</th><th>仓库唛头</th><th>旧 SKU</th><th>新 SKU</th><th>数量</th><th>新 FBA 箱唛</th><th>FBA 目的仓</th></tr></thead><tbody><tr v-for=" item in importedRelabelBindings " :key=" item . id "><td><el-checkbox v-model=" item . selected " /></td><td>{{ item.templateType === 'mixed' ? 'SKU 混箱换标' : item.templateType === 'carton' ? '箱号关联' : 'SKU 关联' }}</td><td>{{ item.cartonMark }}</td><td>{{ item.originalSku || '—' }}</td><td>{{ item.newSku || '—' }}</td><td>{{ item.quantity }}</td><td>{{ item.fbaCartonMark || '—' }}</td><td>{{ warehouseDisplay(item.destinationWarehouseId) }}</td></tr></tbody></table></div></div>
<div class=" warehouse - section - heading warehouse - tab - actions "><div><strong>绑定明细</strong><p>上传后在下方回显,也可以手动添加;客户箱唛作为仓库唛头来源,系统我方箱唛不需要手填。</p></div><div><el-button type=" primary " size=" small " @click=" addTransferRelabelRow "><Plus :size=" 15 " />添加 SKU 明细</el-button><el-button size=" small " @click=" clearTransferRelabelRows ">清空</el-button></div></div>
@@ -828,7 +878,7 @@ function selectRelabelInventory(inboundOrderId: string) {
<template v-else>
<div class=" warehouse - breadcrumb "><button type=" button " @click=" mode = 'list' ">{{ config.title }}</button><b>/</b><strong>订单详情</strong></div>
<div class=" warehouse - page - heading "><h2>{{ config.title }}详情</h2><div><el-button v-if=" props . service === 'transfer' && selectedDetail ? . status === 'WAIT_CUSTOMER_CONFIRMATION' " type=" primary " @click=" confirmTransferMeasurements ">确认实测并入库</el-button><el-button @click=" mode = 'list' "><ArrowLeft :size=" 16 " />返回列表</el-button></div></div>
<div class=" warehouse - page - heading "><h2>{{ config.title }}详情</h2><div><el-button v-if=" props . service === 'disposal' && selectedDetail ? . status === 'PENDING_REVIEW' " type=" danger " @click=" cancelSelectedDiscard ">取消申请</el-button><el-button v-if=" props . service === 'transfer' && selectedDetail ? . status === 'WAIT_CUSTOMER_CONFIRMATION' " type=" primary " @click=" confirmTransferMeasurements ">确认实测并入库</el-button><el-button @click=" mode = 'list' "><ArrowLeft :size=" 16 " />返回列表</el-button></div></div>
<div class=" warehouse - card warehouse - form - section "><h3>订单概览</h3><div class=" warehouse - detail - grid "><div v-for=" ( column , index ) in config . columns . slice ( 1 ) " :key=" column "><span>{{ column }}</span><strong>{{ selectedDetail?.[String(index)] || '—' }}</strong></div></div></div>
<div v-if=" props . service === 'transfer' " class=" warehouse - card warehouse - form - section warehouse - transfer - times "><h3>发货时间</h3><div class=" warehouse - detail - grid "><div><span>预计发货时间</span><strong>{{ formatDateTime(selectedDetail?.estimatedShipAt) }}</strong></div><div><span>实际发货时间</span><strong>{{ formatDateTime(selectedDetail?.actualShipAt) }}</strong></div></div><p>实际发货时间由仓库出库或 PDA 完成后回填,客户不能手动修改。</p></div>
<div v-if=" props . service === 'transfer' " class=" warehouse - card warehouse - form - section ">
@@ -848,6 +898,14 @@ function selectRelabelInventory(inboundOrderId: string) {
<div class=" warehouse - evidence "><span>仓库完工照片</span><div v-if=" selectedRelabelDetail ? . completionEvidence ? . photoFileIds ? . length " class=" warehouse - photo - actions "><el-button v-for=" ( fileId , index ) in selectedRelabelDetail . completionEvidence . photoFileIds " :key=" fileId " size=" small " plain @click=" previewCompletionPhoto ( fileId ) "><Eye :size=" 14 " />照片 {{ index + 1 }}</el-button></div><strong v-else>仓库尚未上传完工照片</strong></div>
<p v-if=" selectedRelabelDetail ? . completionEvidence ? . completionRemark " class=" warehouse - completion - remark ">完工备注:{{ selectedRelabelDetail.completionEvidence.completionRemark }}</p>
</div>
<div v-if=" props . service === 'labeling' " class=" warehouse - card warehouse - form - section ">
<div class=" warehouse - section - heading "><h3>贴标明细资料</h3><input ref=" relabelFileInput " class=" warehouse - hidden - input " type=" file " accept=" application / pdf , . pdf " @change=" uploadSelectedRelabelFile "></div>
<div class=" warehouse - hint ">需要补充或替换资料时,可在对应明细行上传 SKU 或箱唛文件。</div>
<div class=" warehouse - table - scroll "><table class=" warehouse - relabel - detail - table "><thead><tr><th>换标模式</th><th>仓库唛头</th><th>SKU</th><th>明细文件</th><th>操作</th></tr></thead><tbody>
<tr v-for=" item in selectedRelabelDetail ? . items || [ ] " :key=" item . id "><td>{{ item.operationType === 'CARTON_AND_SKU' ? '箱唛 + SKU 换标' : item.operationType === 'SKU_LABEL' ? 'SKU 换标' : '箱唛换标' }}</td><td>{{ item.cartonMark || '—' }}</td><td>{{ item.skuCode || '—' }}</td><td>{{ item.relabelFileName || '未上传' }}</td><td><el-button size=" small " @click=" chooseRelabelFile ( 'ITEM' , String ( item . id ) ) "><Upload :size=" 14 " />上传明细文件</el-button></td></tr>
<tr v-if=" ! selectedRelabelDetail ? . items ? . length "><td colspan=" 5 "><div class=" warehouse - empty ">暂无贴标明细</div></td></tr>
</tbody></table></div>
</div>
<div v-if=" props . service === 'labeling' " class=" warehouse - card warehouse - form - section ">
<h3>换标任务明细</h3>
<div class=" warehouse - table - scroll "><table class=" warehouse - relabel - detail - table "><thead><tr><th>换标模式</th><th>我方箱唛</th><th>新 FBA 箱唛</th><th>FBA 目的仓</th><th>任务箱数</th><th>商品 SKU</th><th>SKU 换标明细</th><th>FBA 货件编号</th><th>贴标要求</th><th>备注</th></tr></thead><tbody>
@@ -864,6 +922,7 @@ function selectRelabelInventory(inboundOrderId: string) {
. warehouse - checkbox - field { display : flex ; min - height : 32 px ; align - items : center ; justify - content : flex - start ; gap : 16 px } . warehouse - checkbox - field > span { color : # 596579 ; font - size : 12 px } . warehouse - checkbox - field : deep ( . el - checkbox ) { margin - right : 0 }
. warehouse - choice - field { display : grid ; grid - template - columns : 150 px auto 1 fr ; align - items : center ; gap : 14 px ; min - height : 40 px ; padding : 12 px 14 px ; border : 1 px solid # e1e8f2 ; border - radius : 5 px ; background : # f8faff } . warehouse - choice - field > span { color : # 34445 c ; font - size : 13 px ; font - weight : 650 } . warehouse - choice - field > span i { margin - right : 3 px ; color : # e24b4b ; font - style : normal } . warehouse - choice - field > small { color : # 7 a879a ; font - size : 12 px } . warehouse - receiving - card { display : grid ; grid - template - columns : 2 fr 1 fr 1 fr ; gap : 22 px ; padding : 15 px 16 px ; border : 1 px solid # cfe0f5 ; border - radius : 5 px ; background : # f6faff } . warehouse - receiving - card div { display : flex ; min - width : 0 ; flex - direction : column ; gap : 6 px } . warehouse - receiving - card span { color : # 7 c899c ; font - size : 12 px } . warehouse - receiving - card strong { overflow - wrap : anywhere ; color : # 314561 ; font - size : 13 px ; font - weight : 600 }
. warehouse - hidden - input { display : none } . warehouse - label - table { min - width : 1120 px } . warehouse - attachment - tip { margin : 10 px 0 12 px ; color : # 7 d8797 ; font - size : 12 px } . warehouse - mark - mapping { display : flex ; flex - wrap : wrap ; gap : 8 px ; margin : 4 px 0 8 px ; padding : 12 px ; border : 1 px solid # dce7f5 ; border - radius : 5 px ; background : # f7faff } . warehouse - mark - mapping strong { width : 100 % ; color : # 34445 c } . warehouse - mark - mapping span { padding : 5 px 9 px ; border - radius : 3 px ; background : # eaf2fc ; color : # 3 e6593 ; font - size : 12 px }
. warehouse - upload - summary { display : flex ; flex - wrap : wrap ; gap : 8 px 24 px ; margin : - 4 px 0 14 px ; padding : 9 px 12 px ; border : 1 px solid # dce7f5 ; border - radius : 4 px ; background : # f8fbff ; color : # 596579 ; font - size : 12 px }
. warehouse - unmaintained { margin - left : 8 px ; color : # e6a23c ; font - size : 12 px ; font - style : normal }
. warehouse - labeling - tabs { margin - top : - 8 px } . warehouse - labeling - heading { align - items : flex - start } . warehouse - labeling - heading h3 { margin - bottom : 16 px } . warehouse - template - actions { display : flex ; gap : 8 px ; padding - bottom : 12 px } . warehouse - tab - actions { align - items : center ; margin : 2 px 0 14 px } . warehouse - tab - actions p { margin : 0 ; color : # 7 d8797 ; font - size : 12 px } . warehouse - tab - actions > div { display : flex ; gap : 8 px } . warehouse - sku - notice { margin : 0 0 14 px ; padding : 10 px 12 px ; border : 1 px solid # f2d39b ; border - radius : 4 px ; background : # fff8e8 ; color : # 8 a6116 ; font - size : 12 px } . warehouse - sku - label - table { min - width : 980 px } . warehouse - sku - label - table : deep ( . el - input - number ) { width : 160 px } : deep ( . warehouse - labeling - tabs > . el - tabs _ _header ) { margin - bottom : 18 px } : deep ( . warehouse - labeling - tabs . el - tabs _ _item ) { height : 42 px ; padding : 0 26 px ; font - weight : 600 } . warehouse - labeling - mode { display : flex ; align - items : center ; gap : 14 px ; margin : 0 0 16 px ; padding : 14 px 16 px ; border : 1 px solid # dce5f5 ; border - radius : 5 px ; background : # f7f9ff } . warehouse - labeling - mode > span { color : # 34445 c ; font - size : 13 px ; font - weight : 650 ; white - space : nowrap } . warehouse - labeling - mode p { margin : 0 ; color : # 71809 a ; font - size : 12 px } . warehouse - labeling - mode : deep ( . el - radio - group ) { display : flex ; flex - shrink : 0 } . warehouse - labeling - mode : deep ( . el - radio - button _ _inner ) { padding : 8 px 14 px }
. warehouse - relabel - detail - table { min - width : 1420 px } . warehouse - relabel - detail - table td strong { color : # 253 f67 }