merge release test changes and preserve local frontend updates
This commit is contained in:
@@ -3,6 +3,8 @@ import { overseasRequest, overseasUpload, overseasDownload } from './overseas.js
|
||||
const BASE = '/pda/v1/last-leg/relabel-tasks'
|
||||
const encoded = (value) => encodeURIComponent(String(value || '').trim())
|
||||
export const scanRelabelSku = async (no, payload) => normalizeRelabel(await overseasRequest('POST', `${BASE}/${encoded(no)}/skus/scan`, payload))
|
||||
export const completeReturnRelabelSku = async (no, payload) => normalizeRelabel(await overseasRequest('POST', `${BASE}/${encoded(no)}/return-skus/complete`, payload))
|
||||
export const completeReturnRelabelSkuTotal = async (no, payload) => normalizeRelabel(await overseasRequest('POST', `${BASE}/${encoded(no)}/return-skus/complete-total`, payload))
|
||||
|
||||
function asList(value) { return Array.isArray(value) ? value : [] }
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { overseasRequest } from './overseas.js'
|
||||
import { overseasDownload, overseasRequest, overseasUpload } from './overseas.js'
|
||||
|
||||
const BASE = '/pda/v1/last-leg/return-receipts'
|
||||
|
||||
@@ -25,7 +25,9 @@ export function normalizeReturnReceiptStart(value = {}) {
|
||||
return {
|
||||
returnNo: String(value.returnNo || ''),
|
||||
status: String(value.status || ''),
|
||||
expectedItems: Array.isArray(value.expectedItems) ? value.expectedItems.map(normalizeItem) : []
|
||||
expectedItems: Array.isArray(value.expectedItems) ? value.expectedItems.map(normalizeItem) : [],
|
||||
completedPallets: Array.isArray(value.completedPallets) ? value.completedPallets.map((item) => ({ palletCode: String(item.palletCode || ''), skuCode: String(item.skuCode || ''), quantity: count(item.quantity), receiptBatchNo: String(item.receiptBatchNo || '') })) : []
|
||||
,photos: Array.isArray(value.photos) ? value.photos.map((item) => ({ fileId: String(item.fileId || ''), fileName: String(item.fileName || '退货打托照片'), contentType: String(item.contentType || 'image/jpeg'), sizeBytes: count(item.sizeBytes) })) : []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +51,7 @@ export function normalizeReturnReceiptResult(value = {}) {
|
||||
returnNo: String(value.returnNo || ''),
|
||||
receiptNo: String(value.receiptNo || ''),
|
||||
receiptBatchNo: String(value.receiptBatchNo || ''),
|
||||
cartonMark: String(value.cartonMark || ''),
|
||||
palletCode: String(value.palletCode || ''),
|
||||
orderStatus: String(value.orderStatus || ''),
|
||||
fullyMatched: Boolean(value.fullyMatched),
|
||||
expectedQuantity: count(value.expectedQuantity),
|
||||
@@ -80,3 +82,16 @@ export async function findReturnSkuCandidates(skuCode) {
|
||||
export async function confirmReturnReceipt(request) {
|
||||
return normalizeReturnReceiptResult(await overseasRequest('POST', `${BASE}/confirm`, request))
|
||||
}
|
||||
|
||||
export async function createReturnPallet(returnNo, skuCode) {
|
||||
const value = await overseasRequest('POST', `${BASE}/pallets`, { returnNo: String(returnNo || '').trim(), skuCode: String(skuCode || '').trim() })
|
||||
return { palletCode: String(value?.palletCode || value?.code || ''), printableHtml: String(value?.printableHtml || '') }
|
||||
}
|
||||
|
||||
export async function checkReturnPallet(returnNo, palletCode) {
|
||||
const value = await overseasRequest('POST', `${BASE}/pallets/check`, { returnNo: String(returnNo || '').trim(), palletCode: String(palletCode || '').trim() })
|
||||
return { palletCode: String(value?.palletCode || ''), empty: Boolean(value?.empty), skuCodes: Array.isArray(value?.skuCodes) ? value.skuCodes.map(String) : [], quantity: count(value?.quantity) }
|
||||
}
|
||||
export const manuallyCompleteReturnReceipt = (returnNo, discrepancyReason) => overseasRequest('POST', `${BASE}/${encodeURIComponent(String(returnNo || '').trim())}/manual-complete`, { discrepancyReason: String(discrepancyReason || '').trim() })
|
||||
export const uploadReturnPalletPhoto = (returnNo, filePath) => overseasUpload(`${BASE}/${encodeURIComponent(String(returnNo || '').trim())}/photos/files`, filePath)
|
||||
export const downloadReturnPalletPhoto = (returnNo, fileId) => overseasDownload(`${BASE}/${encodeURIComponent(String(returnNo || '').trim())}/photos/files/${encodeURIComponent(String(fileId || '').trim())}/download`, { expectedContentTypePrefix: 'image/' })
|
||||
|
||||
Reference in New Issue
Block a user