1Merge branch 'release/test' of http://8.163.30.128:10082/html/client-web into release/test
# Conflicts: # src/modules/overseas-warehouse/views/WarehouseServiceView.vue
This commit is contained in:
@@ -5,6 +5,12 @@ import test from 'node:test'
|
||||
const view = readFileSync(new URL('./WarehouseServiceView.vue', import.meta.url), 'utf8')
|
||||
const api = readFileSync(new URL('../api/warehouseServices.ts', import.meta.url), 'utf8')
|
||||
|
||||
test('贴标总文件与关联模板保持左右分组,退货来源使用专用明细', () => {
|
||||
assert.match(view, /class="warehouse-file-groups" :class="\{ 'warehouse-file-groups--single': isReturnRelabelSource \}"/)
|
||||
assert.match(view, /warehouse-service-page--return-relabel/)
|
||||
assert.match(view, /const sourceValue = `RETURN_ORDER:\$\{requestedReturnNo\}`/)
|
||||
})
|
||||
|
||||
test('仓储转运先选择入仓方式并按方式切换地址信息', () => {
|
||||
assert.match(view, /value="WAREHOUSE_PICKUP">仓库上门提货/)
|
||||
assert.match(view, /value="CUSTOMER_DELIVERY">客户送货到仓/)
|
||||
@@ -14,14 +20,14 @@ test('仓储转运先选择入仓方式并按方式切换地址信息', () => {
|
||||
})
|
||||
|
||||
test('仓储转运支持无目的地、FBA 仓和私人仓并显式选择是否换标', () => {
|
||||
assert.match(view, /是否有目的去向/)
|
||||
assert.match(view, />目的去向</)
|
||||
assert.match(view, /value="NONE">暂未确定/)
|
||||
assert.match(view, /value="FBA">FBA 仓/)
|
||||
assert.match(view, /value="PRIVATE">私人仓/)
|
||||
assert.match(view, /transferDestinationType === 'PRIVATE'.*私人仓地址.*邮编.*私人仓联系人.*联系电话/s)
|
||||
assert.match(view, /是否需要换标/)
|
||||
assert.match(view, /:value="false">不需要换标/)
|
||||
assert.match(view, /:value="true">需要换标/)
|
||||
assert.match(view, />换标服务</)
|
||||
assert.match(view, /:value="false">不需要/)
|
||||
assert.match(view, /:value="true">需要/)
|
||||
assert.match(api, /fbaWarehouseCode\?: string/)
|
||||
assert.match(api, /privateDestinationAddress\?: string; privateDestinationPostalCode\?: string/)
|
||||
assert.match(api, /fbaShipmentNo\?: string/)
|
||||
@@ -30,13 +36,11 @@ test('仓储转运支持无目的地、FBA 仓和私人仓并显式选择是否
|
||||
})
|
||||
|
||||
test('仓储转运换标整票只允许一个目的仓', () => {
|
||||
assert.match(view, /props\.service === 'transfer' && transferDestinationType === 'FBA'[^\n]+未换标货物目的 FBA 仓/)
|
||||
assert.match(view, /此处只表示不换标箱子的去向/)
|
||||
assert.match(view, /props\.service === 'transfer' && transferDestinationType === 'FBA'[^\n]+FBA 目的仓/)
|
||||
assert.match(view, /FBA 货件编号<\/span><el-input v-model="form\.fbaShipmentNo" placeholder="选填,可后续补充"/)
|
||||
assert.match(view, /transferDestinationType\.value === 'FBA' && !form\.destination/)
|
||||
assert.match(view, /transferDestinationType\.value === 'PRIVATE'.*!form\.privateDestinationPostalCode/)
|
||||
assert.match(view, /整票换标货物目的 FBA 仓/)
|
||||
assert.match(view, /暂不支持一票多个目的仓/)
|
||||
assert.match(view, /if \(!transferRelabelDefaultDestination\.value\) \{ ElMessage\.warning\('请选择整票换标货物的 FBA 目的仓'\)/)
|
||||
assert.match(view, /destinationWarehouseCode: transferRelabelDefaultDestination\.value \|\| undefined/)
|
||||
const transferRelabelSection = view.split('warehouse-transfer-relabel">')[1]?.split('warehouse-transfer-submit-bar')[0] || ''
|
||||
@@ -56,15 +60,14 @@ test('仓储转运不要求客户填写内部入仓号和我方箱唛,但换
|
||||
assert.doesNotMatch(transferConfig, /进仓编号/)
|
||||
assert.doesNotMatch(transferSubmit, /inboundCode|sourceLastlegOrderIds/)
|
||||
assert.match(view, /货物明细/)
|
||||
assert.match(view, /客户只填写自己的箱唛,我方箱唛由系统生成/)
|
||||
assert.match(view, /客户箱唛号 \*/)
|
||||
assert.match(view, /downloadTransferCartonMarkTemplate/)
|
||||
assert.match(view, /importTransferCartonMarks/)
|
||||
assert.match(view, /下载 SKU 关联模板/)
|
||||
assert.match(view, /上传 SKU 关联/)
|
||||
assert.match(view, /下载箱号关联模板/)
|
||||
assert.match(view, /上传箱号关联/)
|
||||
assert.match(view, /下载 SKU 混箱模板/)
|
||||
assert.match(view, /上传 SKU 混箱/)
|
||||
assert.match(view, /<strong>SKU 关联<\/strong>/)
|
||||
assert.match(view, /<strong>箱号关联<\/strong>/)
|
||||
assert.match(view, /<strong>SKU 混箱<\/strong>/)
|
||||
assert.match(view, />下载模板<\/el-button>/)
|
||||
assert.match(view, />上传文件<\/el-button>/)
|
||||
assert.match(view, /换标类型/)
|
||||
assert.match(view, /v-if="labelingMode === 'carton'"/)
|
||||
assert.match(view, /v-else-if="labelingMode === 'sku'"/)
|
||||
@@ -80,9 +83,50 @@ test('仓储转运不要求客户填写内部入仓号和我方箱唛,但换
|
||||
assert.doesNotMatch(view, /<th v-if="props\.service === 'transfer'">FNSKU \/ 箱唛<\/th>/)
|
||||
})
|
||||
|
||||
test('仓储转运货物明细可按 SKU 和箱数打印客户预贴箱唛', () => {
|
||||
assert.match(view, /printTransferDraftCartonMarks/)
|
||||
assert.match(view, /请先填写商品 SKU 和对应的整数箱数/)
|
||||
assert.match(view, /Array\.from\(\{ length: Number\(row\.quantity\) \}/)
|
||||
assert.match(view, /row\.customerCartonMarks = marks\.join\('\\n'\)/)
|
||||
assert.match(view, /仓储转运客户箱唛/)
|
||||
assert.match(view, /@click="printTransferDraftCartonMarks"/)
|
||||
assert.match(view, /打印唛头/)
|
||||
assert.match(view, /单次最多打印 500 张箱唛/)
|
||||
})
|
||||
|
||||
test('仓储转运换标资料按步骤分组展示', () => {
|
||||
assert.match(view, /<span v-if="props\.service === 'transfer'" class="warehouse-step-number">1<\/span>货物明细/)
|
||||
assert.match(view, /<span class="warehouse-step-number">2<\/span>换标申请/)
|
||||
assert.match(view, /<strong><span>3<\/span>明细关联模板<\/strong>/)
|
||||
assert.match(view, /<span class="warehouse-step-number">4<\/span>绑定明细/)
|
||||
assert.match(view, /warehouse-transfer-template-group/)
|
||||
assert.match(view, /warehouse-transfer-relabel/)
|
||||
})
|
||||
|
||||
test('仓储转运需要换标时上传总文件并挂到关联换标单', () => {
|
||||
const transferRelabelSection = view.split('warehouse-transfer-relabel">')[1]?.split('warehouse-transfer-submit-bar')[0] || ''
|
||||
assert.match(transferRelabelSection, /warehouse-transfer-total-files/)
|
||||
assert.match(transferRelabelSection, />贴标总文件</)
|
||||
assert.match(transferRelabelSection, />箱唛总文件</)
|
||||
assert.match(transferRelabelSection, />SKU 总文件</)
|
||||
assert.match(view, /action === 'submit' && requiresBothTotalFiles\.value/)
|
||||
assert.match(view, /const submitted = await submitTransfer\(transferNo\)/)
|
||||
assert.match(view, /submitted\.relabelNo \|\| created\.relabelNo/)
|
||||
assert.match(view, /uploadRelabelFile\(relabelNo, 'CARTON_TOTAL', cartonTotalFile\.value\)/)
|
||||
assert.match(view, /uploadRelabelFile\(relabelNo, 'SKU_TOTAL', skuTotalFile\.value\)/)
|
||||
assert.match(view, /转运单已提交,附件待补传/)
|
||||
})
|
||||
|
||||
test('仓储转运换标总文件与明细模板在桌面端左右排列', () => {
|
||||
assert.match(view, /class="warehouse-transfer-file-groups"/)
|
||||
assert.match(view, /\.warehouse-transfer-file-groups\{display:grid;grid-template-columns:minmax\(0,1\.15fr\) minmax\(360px,\.85fr\)/)
|
||||
assert.match(view, /\.warehouse-transfer-total-files,\.warehouse-transfer-template-group\{height:100%;margin:0\}/)
|
||||
assert.match(view, /@media\(max-width:1180px\)\{\.warehouse-transfer-file-groups\{grid-template-columns:minmax\(0,1fr\)\}\}/)
|
||||
})
|
||||
|
||||
test('上门提货不提交物流号,需要换标时随转运单登记申请', () => {
|
||||
assert.match(view, /trackingNo:\s*form\.deliveryMethod === 'CUSTOMER_DELIVERY'\s*\?[^:]+:\s*undefined/)
|
||||
assert.match(view, /本次提交将同时登记换标申请/)
|
||||
assert.match(view, /relabelItems: form\.relabel/)
|
||||
assert.match(view, /form\.deliveryMethod === 'CUSTOMER_DELIVERY'.*物流跟踪号/s)
|
||||
assert.match(view, /提货联系人/)
|
||||
assert.match(view, /联系人电话/)
|
||||
@@ -102,14 +146,14 @@ test('仓储转运列表操作仓使用海外仓接口数据', () => {
|
||||
assert.match(view, /loadAllWarehouseRecords\('OVERSEAS', getMerchantWarehouses\)/)
|
||||
assert.match(view, /warehouseDisplay\(item\.operatingWarehouseId\)/)
|
||||
assert.match(view, /\['OVERSEAS', 'OVERSEAS_PARTNER'\]/)
|
||||
assert.match(view, /v-for="warehouse in \(props\.service === 'relabel' \? fbaWarehouses : operationWarehouses\)"/)
|
||||
assert.match(view, /props\.service === 'relabel' \? fbaWarehouses\.value : operationWarehouses\.value/)
|
||||
assert.doesNotMatch(view, /美西洛杉矶仓/)
|
||||
})
|
||||
|
||||
test('仓储转运预计发货时间可选并只读展示实际发货时间', () => {
|
||||
assert.match(view, /预计发货时间/)
|
||||
assert.match(view, /v-model="form\.estimatedShipAt"/)
|
||||
assert.match(view, /选填,可线下确认后补充/)
|
||||
assert.match(view, /v-model="form\.estimatedShipAt"[^>]+placeholder="选填"/)
|
||||
assert.doesNotMatch(view, /!form\.estimatedShipAt && '预计发货时间'/)
|
||||
assert.match(view, /estimatedShipAt: form\.estimatedShipAt/)
|
||||
assert.match(view, /实际发货时间由仓库出库或 PDA 完成后回填/)
|
||||
@@ -140,8 +184,8 @@ test('仓储转运详情按接口具名字段展示订单概览', () => {
|
||||
})
|
||||
|
||||
test('PDA 打托完成后客户可从列表或详情确认并查看实测数据', () => {
|
||||
assert.match(view, /row\.__status === 'WAIT_CUSTOMER_CONFIRMATION'/)
|
||||
assert.match(view, /confirmTransferFromList\(row\['0'\]\)/)
|
||||
assert.match(view, /item\.__status === 'WAIT_CUSTOMER_CONFIRMATION'/)
|
||||
assert.match(view, /confirmTransferFromList\(item\['0'\]\)/)
|
||||
assert.match(view, /selectedDetail\?\.status === 'WAIT_CUSTOMER_CONFIRMATION'/)
|
||||
assert.match(view, /PDA 打托实测数据/)
|
||||
for (const label of ['托盘号', '库位', '箱数', '长 × 宽 × 高(cm)', '毛重(kg)', '体积(m³)', '完成时间']) assert.equal(view.includes(label), true)
|
||||
@@ -167,7 +211,7 @@ test('仓储转运详情自动加载 PDA 测量照片并释放 Blob URL', () =>
|
||||
})
|
||||
|
||||
test('PDA 完成后主单显示入库完成并保留客户确认测量入口', () => {
|
||||
assert.match(view, /row\.__status === 'WAIT_CUSTOMER_CONFIRMATION'.*确认测量数据/s)
|
||||
assert.match(view, /item\.__status === 'WAIT_CUSTOMER_CONFIRMATION'.*确认测量/s)
|
||||
assert.match(view, /selectedDetail\?\.status === 'WAIT_CUSTOMER_CONFIRMATION'.*确认测量数据/s)
|
||||
assert.doesNotMatch(view, /确认实测并入库/)
|
||||
})
|
||||
@@ -179,7 +223,7 @@ test('仓储转运可在新建页直接提交,也可保存草稿后编辑提
|
||||
assert.match(api, /warehouse-transfers\/\$\{encodeURIComponent\(transferNo\)\}\/submit/)
|
||||
assert.match(view, /submit\('draft'\).*保存草稿/s)
|
||||
assert.match(view, /async function openEdit\(transferNo: string\)/)
|
||||
assert.match(view, /row\.__status === 'DRAFT'[^>]*[\s\S]*?@click="openEdit\(row\['0'\]\)"[^>]*>编辑/)
|
||||
assert.match(view, /item\.__status === 'DRAFT'.*openEdit\(item\['0'\]\)/s)
|
||||
assert.match(view, /v-if="props\.service === 'transfer'"[^>]*type="primary"[^>]*native-type="submit"[^>]*>提交订单/)
|
||||
assert.match(view, /await updateTransfer\(editingTransferNo\.value, payload\)/)
|
||||
assert.match(view, /await submitTransfer\(transferNo\)/)
|
||||
|
||||
Reference in New Issue
Block a user