机器人显示名与站点标题可配;多段联运列表投影;协同群监听对账;工单附件落存;模板与工单后台补强
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,97 +1 @@
|
||||
import { buildDemandFields, quantitySummary } from "/@/views/inquiry/workOrder/demandFields";
|
||||
|
||||
test("land FTL shows vehicle not pieces", () => {
|
||||
const rows = buildDemandFields({
|
||||
businessLine: "LAND",
|
||||
bizTypeLabel: "陆运",
|
||||
origin: "上海",
|
||||
destination: "春疆货场",
|
||||
goodsName: "茶叶",
|
||||
factsJson: JSON.stringify({
|
||||
运输类型: "国内运输整车",
|
||||
线路类别: "国内长途/零担",
|
||||
运输分类: "普件",
|
||||
"车型/数量": "53尺(16.5厢车)",
|
||||
起运港: "上海",
|
||||
目的港: "春疆货场",
|
||||
品名: "茶叶",
|
||||
报价日期: "2026-10-03",
|
||||
}),
|
||||
});
|
||||
const map = Object.fromEntries(rows.map((r) => [r.label, r.value]));
|
||||
expect(map["运输方式"]).toBe("陆运");
|
||||
expect(map["运输类型"]).toBe("国内运输整车");
|
||||
expect(map["车型/数量"]).toBe("53尺(16.5厢车)");
|
||||
expect(map["始发站"]).toBe("上海");
|
||||
expect(map["货物品名"]).toBe("茶叶");
|
||||
expect(map["件数"]).toBeUndefined();
|
||||
expect(map["增值服务"]).toBeUndefined();
|
||||
});
|
||||
|
||||
test("air shows added services only when filled", () => {
|
||||
const filled = buildDemandFields({
|
||||
businessLine: "AIR",
|
||||
bizTypeLabel: "空运",
|
||||
factsJson: JSON.stringify({
|
||||
起运港: "深圳",
|
||||
目的港: "吉隆坡",
|
||||
品名: "茶叶",
|
||||
件数: "10",
|
||||
毛重: "100",
|
||||
体积: "2",
|
||||
包装方式: "纸箱",
|
||||
报价日期: "2026-10-13",
|
||||
added_services: "托盘、前置仓、带电",
|
||||
}),
|
||||
});
|
||||
const map = Object.fromEntries(filled.map((r) => [r.label, r.value]));
|
||||
expect(map["增值服务"]).toBe("托盘、前置仓、带电");
|
||||
expect(map["包装类型"]).toBe("纸箱");
|
||||
|
||||
const empty = buildDemandFields({
|
||||
businessLine: "AIR",
|
||||
bizTypeLabel: "空运",
|
||||
factsJson: JSON.stringify({
|
||||
目的港: "吉隆坡",
|
||||
品名: "茶叶",
|
||||
包装方式: "纸箱",
|
||||
}),
|
||||
});
|
||||
const emptyMap = Object.fromEntries(empty.map((r) => [r.label, r.value]));
|
||||
expect(emptyMap["增值服务"]).toBeUndefined();
|
||||
});
|
||||
|
||||
test("sea shows container spec", () => {
|
||||
const rows = buildDemandFields({
|
||||
businessLine: "SEA",
|
||||
bizTypeLabel: "海运",
|
||||
factsJson: JSON.stringify({
|
||||
起运港: "上海",
|
||||
目的港: "汉堡",
|
||||
品名: "配件",
|
||||
货量: "1x40HQ",
|
||||
整柜或拼柜: "整柜",
|
||||
箱型箱量: "40HQ*1",
|
||||
贸易条款: "FOB",
|
||||
运输分类: "Port to Port",
|
||||
报价日期: "2026-10-03",
|
||||
}),
|
||||
});
|
||||
const map = Object.fromEntries(rows.map((r) => [r.label, r.value]));
|
||||
expect(map["箱型箱量"]).toBe("40HQ*1");
|
||||
expect(map["整柜或拼柜"]).toBe("整柜");
|
||||
expect(map["件数"]).toBeUndefined();
|
||||
});
|
||||
|
||||
test("land LTL quantity summary uses volume", () => {
|
||||
const qty = quantitySummary({
|
||||
businessLine: "LAND",
|
||||
factsJson: JSON.stringify({
|
||||
运输类型: "国内运输拼车",
|
||||
体积: "10CBM",
|
||||
毛重: "50kg",
|
||||
}),
|
||||
});
|
||||
expect(qty).toContain("体积(CBM) 10CBM");
|
||||
expect(qty).not.toContain("车型");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user