Merge pull request 'feat: 经营地图放大下钻与中美口岸标注,并完善扫码/品牌/培训' (#29) from test into master
All checks were successful
Build and Deploy Front / deploy (push) Successful in 4m3s
All checks were successful
Build and Deploy Front / deploy (push) Successful in 4m3s
Reviewed-on: https://git.ideship.com/ideship/front/pulls/29
This commit is contained in:
commit
ce0d1f4695
13
index.html
13
index.html
@ -428,9 +428,18 @@
|
||||
if (sub) sub.textContent = copy.sub;
|
||||
if (retry) retry.textContent = copy.retry;
|
||||
|
||||
/* 冷启动优先用缓存吉祥物,避免等 Vue/API(与 brandLogo.ts MASCOT_CACHE_KEY 一致) */
|
||||
/* 冷启动只用本地 data URL,不请求接口(与 brandLogo.ts BRAND_IMAGE_CACHE_KEY 一致) */
|
||||
try {
|
||||
var cachedMascot = (localStorage.getItem('oms_brand_mascot_url') || '').trim();
|
||||
var cachedMascot = '';
|
||||
try {
|
||||
var brandPack = JSON.parse(localStorage.getItem('oms_brand_images') || '');
|
||||
if (brandPack && brandPack.images && typeof brandPack.images.mascot === 'string') {
|
||||
cachedMascot = brandPack.images.mascot;
|
||||
}
|
||||
} catch (ePack) {}
|
||||
if (cachedMascot.indexOf('data:') !== 0) {
|
||||
cachedMascot = (localStorage.getItem('oms_brand_mascot_url') || '').trim();
|
||||
}
|
||||
var logoImg = boot.querySelector('.boot-logo');
|
||||
var logoText = boot.querySelector('.boot-text-logo');
|
||||
var isLegacyDefault =
|
||||
|
||||
26
public/geo/cn-cities-mock.json
Normal file
26
public/geo/cn-cities-mock.json
Normal file
@ -0,0 +1,26 @@
|
||||
[
|
||||
{ "name": "深圳", "province": "广东", "coord": [114.06, 22.55], "orderCount": 5200 },
|
||||
{ "name": "广州", "province": "广东", "coord": [113.26, 23.13], "orderCount": 4100 },
|
||||
{ "name": "东莞", "province": "广东", "coord": [113.75, 23.05], "orderCount": 3800 },
|
||||
{ "name": "佛山", "province": "广东", "coord": [113.12, 23.02], "orderCount": 2100 },
|
||||
{ "name": "上海", "province": "上海", "coord": [121.47, 31.23], "orderCount": 4800 },
|
||||
{ "name": "苏州", "province": "江苏", "coord": [120.62, 31.3], "orderCount": 3200 },
|
||||
{ "name": "南京", "province": "江苏", "coord": [118.8, 32.06], "orderCount": 1800 },
|
||||
{ "name": "杭州", "province": "浙江", "coord": [120.15, 30.28], "orderCount": 2900 },
|
||||
{ "name": "宁波", "province": "浙江", "coord": [121.55, 29.87], "orderCount": 2400 },
|
||||
{ "name": "义乌", "province": "浙江", "coord": [120.07, 29.3], "orderCount": 3500 },
|
||||
{ "name": "厦门", "province": "福建", "coord": [118.09, 24.48], "orderCount": 1600 },
|
||||
{ "name": "福州", "province": "福建", "coord": [119.3, 26.08], "orderCount": 1100 },
|
||||
{ "name": "青岛", "province": "山东", "coord": [120.38, 36.07], "orderCount": 1900 },
|
||||
{ "name": "北京", "province": "北京", "coord": [116.41, 39.9], "orderCount": 2200 },
|
||||
{ "name": "天津", "province": "天津", "coord": [117.2, 39.13], "orderCount": 1400 },
|
||||
{ "name": "成都", "province": "四川", "coord": [104.07, 30.67], "orderCount": 1700 },
|
||||
{ "name": "重庆", "province": "重庆", "coord": [106.55, 29.56], "orderCount": 1500 },
|
||||
{ "name": "武汉", "province": "湖北", "coord": [114.31, 30.59], "orderCount": 1300 },
|
||||
{ "name": "长沙", "province": "湖南", "coord": [112.94, 28.23], "orderCount": 1000 },
|
||||
{ "name": "郑州", "province": "河南", "coord": [113.65, 34.76], "orderCount": 1200 },
|
||||
{ "name": "西安", "province": "陕西", "coord": [108.94, 34.34], "orderCount": 900 },
|
||||
{ "name": "大连", "province": "辽宁", "coord": [121.62, 38.91], "orderCount": 850 },
|
||||
{ "name": "昆明", "province": "云南", "coord": [102.71, 25.04], "orderCount": 700 },
|
||||
{ "name": "合肥", "province": "安徽", "coord": [117.28, 31.86], "orderCount": 950 }
|
||||
]
|
||||
20
public/geo/cn-ports.json
Normal file
20
public/geo/cn-ports.json
Normal file
@ -0,0 +1,20 @@
|
||||
[
|
||||
{ "name": "Shanghai Port", "nameZh": "上海港", "code": "SHA", "locode": "CNSHA", "type": "sea", "coord": [121.5, 31.35] },
|
||||
{ "name": "Ningbo-Zhoushan", "nameZh": "宁波舟山", "code": "NGB", "locode": "CNNGB", "type": "sea", "coord": [121.95, 29.93] },
|
||||
{ "name": "Yantian / Shenzhen", "nameZh": "深圳盐田", "code": "YTN", "locode": "CNYTN", "type": "sea", "coord": [114.28, 22.57] },
|
||||
{ "name": "Nansha / Guangzhou", "nameZh": "广州南沙", "code": "NSA", "locode": "CNNSA", "type": "sea", "coord": [113.58, 22.68] },
|
||||
{ "name": "Qingdao", "nameZh": "青岛港", "code": "TAO", "locode": "CNTAO", "type": "sea", "coord": [120.32, 36.05] },
|
||||
{ "name": "Xiamen", "nameZh": "厦门港", "code": "XMN", "locode": "CNXMN", "type": "sea", "coord": [118.08, 24.48] },
|
||||
{ "name": "Tianjin", "nameZh": "天津港", "code": "TSN", "locode": "CNTSN", "type": "sea", "coord": [117.75, 38.98] },
|
||||
{ "name": "Dalian", "nameZh": "大连港", "code": "DLC", "locode": "CNDLC", "type": "sea", "coord": [121.68, 38.95] },
|
||||
{ "name": "Lianyungang", "nameZh": "连云港", "code": "LYG", "locode": "CNLYG", "type": "sea", "coord": [119.45, 34.75] },
|
||||
{ "name": "Fuzhou", "nameZh": "福州港", "code": "FOC", "locode": "CNFOC", "type": "sea", "coord": [119.45, 25.98] },
|
||||
{ "name": "Shanghai Pudong", "nameZh": "上海浦东", "code": "PVG", "locode": "CNPVG", "type": "air", "coord": [121.81, 31.15] },
|
||||
{ "name": "Guangzhou Baiyun", "nameZh": "广州白云", "code": "CAN", "locode": "CNCAN", "type": "air", "coord": [113.3, 23.39] },
|
||||
{ "name": "Shenzhen Baoan", "nameZh": "深圳宝安", "code": "SZX", "locode": "CNSZX", "type": "air", "coord": [113.81, 22.64] },
|
||||
{ "name": "Beijing Capital", "nameZh": "北京首都", "code": "PEK", "locode": "CNPEK", "type": "air", "coord": [116.6, 40.08] },
|
||||
{ "name": "Beijing Daxing", "nameZh": "北京大兴", "code": "PKX", "locode": "CNPKX", "type": "air", "coord": [116.41, 39.51] },
|
||||
{ "name": "Chengdu Tianfu", "nameZh": "成都天府", "code": "TFU", "locode": "CNTFU", "type": "air", "coord": [104.44, 30.31] },
|
||||
{ "name": "Ezhou Huahu", "nameZh": "鄂州花湖", "code": "EHU", "locode": "CNEHU", "type": "air", "coord": [115.04, 30.34] },
|
||||
{ "name": "Hong Kong", "nameZh": "香港", "code": "HKG", "locode": "HKHKG", "type": "air", "coord": [113.91, 22.31] }
|
||||
]
|
||||
17
public/geo/us-ports.json
Normal file
17
public/geo/us-ports.json
Normal file
@ -0,0 +1,17 @@
|
||||
[
|
||||
{ "name": "Los Angeles / Long Beach", "nameZh": "洛杉矶 / 长滩", "code": "LAX", "locode": "USLAX", "type": "container", "coord": [-118.2642, 33.7361] },
|
||||
{ "name": "Oakland", "nameZh": "奥克兰", "code": "OAK", "locode": "USOAK", "type": "container", "coord": [-122.3186, 37.7955] },
|
||||
{ "name": "Seattle / Tacoma", "nameZh": "西雅图 / 塔科马", "code": "SEA", "locode": "USSEA", "type": "container", "coord": [-122.3381, 47.589] },
|
||||
{ "name": "Houston", "nameZh": "休斯敦", "code": "HOU", "locode": "USHOU", "type": "container", "coord": [-95.0204, 29.728] },
|
||||
{ "name": "New York / New Jersey", "nameZh": "纽约 / 新泽西", "code": "NYC", "locode": "USNYC", "type": "container", "coord": [-74.0721, 40.6681] },
|
||||
{ "name": "Savannah", "nameZh": "萨凡纳", "code": "SAV", "locode": "USSAV", "type": "container", "coord": [-81.0912, 32.0809] },
|
||||
{ "name": "Charleston", "nameZh": "查尔斯顿", "code": "CHS", "locode": "USCHS", "type": "container", "coord": [-79.9067, 32.826] },
|
||||
{ "name": "Miami", "nameZh": "迈阿密", "code": "MIA", "locode": "USMIA", "type": "container", "coord": [-80.1618, 25.7781] },
|
||||
{ "name": "Norfolk", "nameZh": "诺福克", "code": "ORF", "locode": "USORF", "type": "container", "coord": [-76.3285, 36.905] },
|
||||
{ "name": "Baltimore", "nameZh": "巴尔的摩", "code": "BAL", "locode": "USBAL", "type": "container", "coord": [-76.557, 39.262] },
|
||||
{ "name": "New Orleans", "nameZh": "新奥尔良", "code": "MSY", "locode": "USMSY", "type": "container", "coord": [-90.0634, 29.934] },
|
||||
{ "name": "Jacksonville", "nameZh": "杰克逊维尔", "code": "JAX", "locode": "USJAX", "type": "container", "coord": [-81.551, 30.385] },
|
||||
{ "name": "Philadelphia", "nameZh": "费城", "code": "PHL", "locode": "USPHL", "type": "container", "coord": [-75.141, 39.89] },
|
||||
{ "name": "Boston", "nameZh": "波士顿", "code": "BOS", "locode": "USBOS", "type": "container", "coord": [-71.035, 42.36] },
|
||||
{ "name": "Portland OR", "nameZh": "波特兰", "code": "PDX", "locode": "USPDX", "type": "container", "coord": [-122.72, 45.6] }
|
||||
]
|
||||
1217
public/geo/us-zip3-mock.json
Normal file
1217
public/geo/us-zip3-mock.json
Normal file
File diff suppressed because it is too large
Load Diff
54
public/geo/usa.json
Normal file
54
public/geo/usa.json
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,9 @@
|
||||
import { axiosInstance } from '@/api/rbac'
|
||||
import { assertBusinessOk, omsUrl, parseListPayload, unwrapData } from '@/api/oms/common'
|
||||
|
||||
/** 操作台自有反馈区+语音,关闭全局 Message toast */
|
||||
const opsSilent = { silentError: true as const }
|
||||
|
||||
export type InboundRecordResult = {
|
||||
id?: number
|
||||
waybillNo?: string
|
||||
@ -11,88 +14,104 @@ export type InboundRecordResult = {
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
export type OpsScanCandidate = {
|
||||
orderId: number
|
||||
serviceNo?: string
|
||||
clientNo?: string
|
||||
trackNo?: string
|
||||
orderStatusName?: string
|
||||
bindQtyTotal?: number
|
||||
matchedHint?: string
|
||||
}
|
||||
|
||||
export type OpsOrderLookupResult = {
|
||||
matched?: boolean
|
||||
matchedNumberType?: string
|
||||
candidates?: OpsScanCandidate[]
|
||||
orderId: number
|
||||
serviceNo: string
|
||||
clientNo?: string
|
||||
trackNo?: string
|
||||
productCode?: string
|
||||
salesProductId?: number
|
||||
salesProductName?: string
|
||||
destinationCountry?: string
|
||||
destinationCountryName?: string
|
||||
serviceChannelId?: number
|
||||
channelCode?: string
|
||||
serviceChannelName?: string
|
||||
orderStatus: string
|
||||
orderStatusName?: string
|
||||
allocationPendingReason?: string
|
||||
}
|
||||
|
||||
export async function inboundCreate(body: {
|
||||
waybillNo: string
|
||||
numberType?: string
|
||||
weight?: number
|
||||
length?: number
|
||||
width?: number
|
||||
height?: number
|
||||
warehouseId?: number
|
||||
}): Promise<InboundRecordResult> {
|
||||
const res = await axiosInstance.post(omsUrl('/operation/inbound/create'), body)
|
||||
const res = await axiosInstance.post(omsUrl('/operation/inbound/create'), body, opsSilent)
|
||||
assertBusinessOk(res.data)
|
||||
return unwrapData(res.data) as InboundRecordResult
|
||||
}
|
||||
|
||||
export async function inboundOrderLookup(waybillNo: string) {
|
||||
export async function inboundOrderLookup(waybillNo: string, numberType?: string) {
|
||||
const res = await axiosInstance.get(omsUrl('/operation/inbound/order-lookup'), {
|
||||
params: { waybillNo },
|
||||
params: { waybillNo, numberType: numberType || undefined },
|
||||
...opsSilent,
|
||||
})
|
||||
assertBusinessOk(res.data)
|
||||
return unwrapData(res.data) as {
|
||||
orderId: number
|
||||
serviceNo: string
|
||||
clientNo?: string
|
||||
trackNo?: string
|
||||
productCode?: string
|
||||
salesProductId?: number
|
||||
salesProductName?: string
|
||||
destinationCountry?: string
|
||||
destinationCountryName?: string
|
||||
orderStatus: string
|
||||
orderStatusName?: string
|
||||
allocationPendingReason?: string
|
||||
}
|
||||
return unwrapData(res.data) as OpsOrderLookupResult
|
||||
}
|
||||
|
||||
export async function inboundRecentList(params?: { limit?: number; warehouseId?: number }) {
|
||||
const res = await axiosInstance.get(omsUrl('/operation/inbound/recent-list'), { params })
|
||||
const res = await axiosInstance.get(omsUrl('/operation/inbound/recent-list'), {
|
||||
params,
|
||||
...opsSilent,
|
||||
})
|
||||
return parseListPayload(res.data)
|
||||
}
|
||||
|
||||
export async function outboundOrderLookup(waybillNo: string) {
|
||||
export async function outboundOrderLookup(waybillNo: string, numberType?: string) {
|
||||
const res = await axiosInstance.get(omsUrl('/operation/outbound/order-lookup'), {
|
||||
params: { waybillNo },
|
||||
params: { waybillNo, numberType: numberType || undefined },
|
||||
...opsSilent,
|
||||
})
|
||||
assertBusinessOk(res.data)
|
||||
return unwrapData(res.data) as {
|
||||
orderId: number
|
||||
serviceNo: string
|
||||
clientNo?: string
|
||||
trackNo?: string
|
||||
productCode?: string
|
||||
salesProductId?: number
|
||||
salesProductName?: string
|
||||
destinationCountry?: string
|
||||
destinationCountryName?: string
|
||||
serviceChannelId?: number
|
||||
channelCode?: string
|
||||
serviceChannelName?: string
|
||||
orderStatus: string
|
||||
orderStatusName?: string
|
||||
}
|
||||
return unwrapData(res.data) as OpsOrderLookupResult
|
||||
}
|
||||
|
||||
export async function outboundCreate(body: {
|
||||
waybillNo: string
|
||||
numberType?: string
|
||||
weight?: number
|
||||
length?: number
|
||||
width?: number
|
||||
height?: number
|
||||
warehouseId?: number
|
||||
}) {
|
||||
const res = await axiosInstance.post(omsUrl('/operation/outbound/create'), body)
|
||||
const res = await axiosInstance.post(omsUrl('/operation/outbound/create'), body, opsSilent)
|
||||
assertBusinessOk(res.data)
|
||||
return unwrapData(res.data)
|
||||
}
|
||||
|
||||
export async function outboundRecentList(params?: { limit?: number; warehouseId?: number }) {
|
||||
const res = await axiosInstance.get(omsUrl('/operation/outbound/recent-list'), { params })
|
||||
const res = await axiosInstance.get(omsUrl('/operation/outbound/recent-list'), {
|
||||
params,
|
||||
...opsSilent,
|
||||
})
|
||||
return parseListPayload(res.data)
|
||||
}
|
||||
|
||||
export async function printLabelLookup(params: { number: string; numberType?: string }) {
|
||||
const res = await axiosInstance.get(omsUrl('/operation/print-label/lookup'), { params })
|
||||
const res = await axiosInstance.get(omsUrl('/operation/print-label/lookup'), {
|
||||
params,
|
||||
...opsSilent,
|
||||
})
|
||||
assertBusinessOk(res.data)
|
||||
return unwrapData(res.data) as PrintLabelLookupResult
|
||||
}
|
||||
@ -149,18 +168,24 @@ export async function printLabelPrint(body: {
|
||||
labelTemplateId?: number
|
||||
templateType?: string
|
||||
}) {
|
||||
const res = await axiosInstance.post(omsUrl('/operation/print-label/print'), body)
|
||||
const res = await axiosInstance.post(omsUrl('/operation/print-label/print'), body, opsSilent)
|
||||
assertBusinessOk(res.data)
|
||||
return unwrapData(res.data)
|
||||
}
|
||||
|
||||
export async function printLabelRecentList(params?: { limit?: number; labelTemplateId?: number }) {
|
||||
const res = await axiosInstance.get(omsUrl('/operation/print-label/recent-list'), { params })
|
||||
const res = await axiosInstance.get(omsUrl('/operation/print-label/recent-list'), {
|
||||
params,
|
||||
...opsSilent,
|
||||
})
|
||||
return parseListPayload(res.data)
|
||||
}
|
||||
|
||||
export async function printLabelTemplateList(params?: { templateType?: string }) {
|
||||
const res = await axiosInstance.get(omsUrl('/operation/print-label/template-list'), { params })
|
||||
const res = await axiosInstance.get(omsUrl('/operation/print-label/template-list'), {
|
||||
params,
|
||||
...opsSilent,
|
||||
})
|
||||
const { items } = parseListPayload(res.data)
|
||||
return items
|
||||
}
|
||||
|
||||
@ -1,15 +1,18 @@
|
||||
import { axiosInstance } from '@/api/rbac'
|
||||
import { assertBusinessOk, omsUrl, unwrapData } from '@/api/oms/common'
|
||||
|
||||
/** 操作台自有反馈区+语音,关闭全局 Message toast */
|
||||
const opsSilent = { silentError: true as const }
|
||||
|
||||
function post<T>(path: string, body?: unknown): Promise<T> {
|
||||
return axiosInstance.post(omsUrl(path), body).then((res) => {
|
||||
return axiosInstance.post(omsUrl(path), body, opsSilent).then((res) => {
|
||||
assertBusinessOk(res.data)
|
||||
return unwrapData(res.data) as T
|
||||
})
|
||||
}
|
||||
|
||||
function get<T>(path: string, params?: Record<string, unknown>): Promise<T> {
|
||||
return axiosInstance.get(omsUrl(path), { params }).then((res) => {
|
||||
return axiosInstance.get(omsUrl(path), { params, ...opsSilent }).then((res) => {
|
||||
assertBusinessOk(res.data)
|
||||
return unwrapData(res.data) as T
|
||||
})
|
||||
|
||||
@ -4,6 +4,13 @@ import { OpenAPI } from './index'
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user'
|
||||
import { handleSessionExpired } from '@/utils/auth-session-expired'
|
||||
|
||||
declare module 'axios' {
|
||||
export interface AxiosRequestConfig {
|
||||
/** 为 true 时响应拦截器不弹全局 Message(由页面自有反馈区处理) */
|
||||
silentError?: boolean
|
||||
}
|
||||
}
|
||||
|
||||
// 创建自定义 axios 实例
|
||||
// baseURL 为空;远端由 OpenAPI.BASE / omsUrl 按 env 拼接(本地走 Vite 代理到测试环境)
|
||||
export const axiosInstance = axios.create({
|
||||
|
||||
@ -39,7 +39,6 @@ export async function fetchLoginGuard(
|
||||
): Promise<LoginGuardOutput> {
|
||||
const res = await axiosInstance.get(resolveAdminApiPath('/rbac/auth/login-guard'), {
|
||||
params: { account: account.trim(), type },
|
||||
// @ts-expect-error axios 自定义字段
|
||||
silentError: true,
|
||||
})
|
||||
const raw = unwrap<Record<string, any>>(res.data)
|
||||
@ -54,7 +53,6 @@ export async function fetchLoginGuard(
|
||||
/** 拉取图形验证码 */
|
||||
export async function fetchLoginCaptcha(): Promise<LoginCaptchaOutput> {
|
||||
const res = await axiosInstance.get(resolveAdminApiPath('/rbac/auth/login-captcha'), {
|
||||
// @ts-expect-error axios 自定义字段
|
||||
silentError: true,
|
||||
})
|
||||
const raw = unwrap<Record<string, any>>(res.data)
|
||||
|
||||
@ -117,7 +117,7 @@ import {
|
||||
CUSTOMER_SIDE_RAIL_COLLAPSED_WIDTH,
|
||||
CUSTOMER_SIDE_RAIL_EXPANDED_WIDTH,
|
||||
} from '@/utils/customer-portal-nav'
|
||||
import { BRAND_TEXT_LOGO, loadBrandLogoUrls } from '@/utils/brandLogo'
|
||||
import { BRAND_TEXT_LOGO, brandLogoImages } from '@/utils/brandLogo'
|
||||
|
||||
const AGENT_SIDE_RAIL_COLLAPSED_WIDTH = CUSTOMER_SIDE_RAIL_COLLAPSED_WIDTH
|
||||
const AGENT_SIDE_RAIL_EXPANDED_WIDTH = CUSTOMER_SIDE_RAIL_EXPANDED_WIDTH
|
||||
@ -133,10 +133,7 @@ type AgentNavItem = {
|
||||
const { t } = useI18n()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const navLogoSrc = ref('')
|
||||
void loadBrandLogoUrls().then((urls) => {
|
||||
navLogoSrc.value = urls.portal || ''
|
||||
})
|
||||
const navLogoSrc = computed(() => brandLogoImages.portal)
|
||||
|
||||
const collapsed = ref(readCollapsed())
|
||||
const compactLayout = ref(collapsed.value)
|
||||
|
||||
@ -206,7 +206,7 @@ import {
|
||||
useHiprintClientState,
|
||||
} from '@/utils/hiprint/hiprintClientState'
|
||||
import { PRINT_CONTROL_DOWNLOAD_URL } from '@/constants/printControl'
|
||||
import { BRAND_TEXT_LOGO, loadBrandLogoUrls } from '@/utils/brandLogo'
|
||||
import { BRAND_TEXT_LOGO, brandLogoImages } from '@/utils/brandLogo'
|
||||
import { resolveCurrentCustomer } from '@/api/customer/resolve'
|
||||
import { CUSTOMER_BALANCE_CHANGED_EVENT } from '@/api/customer/accountFlow'
|
||||
import { getMapIdFromAccessToken } from '@/utils/jwt'
|
||||
@ -242,10 +242,7 @@ const printConnectionState = useHiprintClientState()
|
||||
/** 与 CSS transition 时长一致(Linear 风格约 300ms) */
|
||||
const RAIL_ANIM_MS = 300
|
||||
|
||||
const navLogoSrc = ref('')
|
||||
void loadBrandLogoUrls().then((urls) => {
|
||||
navLogoSrc.value = urls.portal || ''
|
||||
})
|
||||
const navLogoSrc = computed(() => brandLogoImages.portal)
|
||||
|
||||
const collapsed = ref(readCustomerSideRailCollapsed(false))
|
||||
/** 布局紧凑态:动画结束后再切,避免收起中途图标跳动 */
|
||||
|
||||
@ -288,7 +288,7 @@ import { Message } from '@arco-design/web-vue';
|
||||
import { openWindow, regexUrl } from '@/utils';
|
||||
import { MenuService, AuthService } from '@/api/rbac';
|
||||
import type { MenuTreeDto } from '@/api/rbac';
|
||||
import { applyDocumentFavicon, loadBrandLogoUrls } from '@/utils/brandLogo';
|
||||
import { brandLogoImages } from '@/utils/brandLogo';
|
||||
import {
|
||||
initHiprintClientState,
|
||||
setHiprintClientEnabled,
|
||||
@ -319,11 +319,7 @@ const appStore = useAppStore();
|
||||
const tabBarStore = useTabBarStore();
|
||||
const rbacUserStore = useRbacUserStore();
|
||||
|
||||
const navLogoSrc = ref('');
|
||||
void loadBrandLogoUrls().then((urls) => {
|
||||
navLogoSrc.value = urls.portal || '';
|
||||
applyDocumentFavicon(urls.favicon);
|
||||
});
|
||||
const navLogoSrc = computed(() => brandLogoImages.portal);
|
||||
|
||||
const topMenuCon = ref<HTMLElement | null>(null);
|
||||
const topNavEnable = computed(() => true); // 启用顶部导航
|
||||
|
||||
125
src/composables/useCountryRegionSelects.ts
Normal file
125
src/composables/useCountryRegionSelects.ts
Normal file
@ -0,0 +1,125 @@
|
||||
import { ref } from 'vue';
|
||||
import {
|
||||
getCountryCityOptions,
|
||||
getCountryProvinceOptions,
|
||||
type CountryRegionOption,
|
||||
} from '@/api/system/country';
|
||||
|
||||
export type CountryRegionAddressFields = {
|
||||
countryCode: string;
|
||||
province: string;
|
||||
city: string;
|
||||
};
|
||||
|
||||
function toSelectOptions(list: CountryRegionOption[]) {
|
||||
return list.map((x) => ({ label: x.label || x.value, value: x.value }));
|
||||
}
|
||||
|
||||
/** 主数据缺失时保留已有/手填值,避免回显空白 */
|
||||
function ensureOption(
|
||||
options: Array<{ label: string; value: string }>,
|
||||
value?: string,
|
||||
) {
|
||||
const v = String(value || '').trim();
|
||||
if (!v || options.some((x) => x.value === v)) return options;
|
||||
return [...options, { label: v, value: v }];
|
||||
}
|
||||
|
||||
/**
|
||||
* 国家 → 省/州 → 城市联动(与发件地址簿弹窗同一套 options 接口)。
|
||||
*/
|
||||
export function useCountryRegionSelects(address: CountryRegionAddressFields) {
|
||||
const provinceLoading = ref(false);
|
||||
const cityLoading = ref(false);
|
||||
const provinceOptions = ref<Array<{ label: string; value: string }>>([]);
|
||||
const cityOptions = ref<Array<{ label: string; value: string }>>([]);
|
||||
const provinceRaw = ref<CountryRegionOption[]>([]);
|
||||
|
||||
async function loadProvinceOptions(countryCode: string, keepValue = false) {
|
||||
provinceLoading.value = true;
|
||||
try {
|
||||
provinceRaw.value = countryCode ? await getCountryProvinceOptions(countryCode) : [];
|
||||
provinceOptions.value = toSelectOptions(provinceRaw.value);
|
||||
if (!keepValue) {
|
||||
address.province = '';
|
||||
address.city = '';
|
||||
cityOptions.value = [];
|
||||
} else {
|
||||
provinceOptions.value = ensureOption(provinceOptions.value, address.province);
|
||||
}
|
||||
} catch {
|
||||
provinceRaw.value = [];
|
||||
provinceOptions.value = keepValue ? ensureOption([], address.province) : [];
|
||||
if (!keepValue) {
|
||||
address.province = '';
|
||||
address.city = '';
|
||||
cityOptions.value = [];
|
||||
}
|
||||
} finally {
|
||||
provinceLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function loadCityOptions(provinceName: string, keepValue = false) {
|
||||
cityLoading.value = true;
|
||||
try {
|
||||
const province = provinceRaw.value.find((x) => x.value === provinceName);
|
||||
cityOptions.value = province
|
||||
? toSelectOptions(await getCountryCityOptions(province.id))
|
||||
: [];
|
||||
if (!keepValue) {
|
||||
address.city = '';
|
||||
} else {
|
||||
cityOptions.value = ensureOption(cityOptions.value, address.city);
|
||||
}
|
||||
} catch {
|
||||
cityOptions.value = keepValue ? ensureOption([], address.city) : [];
|
||||
if (!keepValue) address.city = '';
|
||||
} finally {
|
||||
cityLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function onCountryChange() {
|
||||
address.province = '';
|
||||
address.city = '';
|
||||
cityOptions.value = [];
|
||||
await loadProvinceOptions(String(address.countryCode || '').trim(), false);
|
||||
}
|
||||
|
||||
async function onProvinceChange() {
|
||||
address.city = '';
|
||||
await loadCityOptions(String(address.province || '').trim(), false);
|
||||
}
|
||||
|
||||
/** 回填已有省/市(地址簿、AI 解析等) */
|
||||
async function hydrateRegionSelects() {
|
||||
const countryCode = String(address.countryCode || '').trim();
|
||||
await loadProvinceOptions(countryCode, true);
|
||||
const province = String(address.province || '').trim();
|
||||
if (province) {
|
||||
await loadCityOptions(province, true);
|
||||
} else {
|
||||
cityOptions.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
function resetRegionSelects() {
|
||||
provinceRaw.value = [];
|
||||
provinceOptions.value = [];
|
||||
cityOptions.value = [];
|
||||
}
|
||||
|
||||
return {
|
||||
provinceLoading,
|
||||
cityLoading,
|
||||
provinceOptions,
|
||||
cityOptions,
|
||||
loadProvinceOptions,
|
||||
loadCityOptions,
|
||||
onCountryChange,
|
||||
onProvinceChange,
|
||||
hydrateRegionSelects,
|
||||
resetRegionSelects,
|
||||
};
|
||||
}
|
||||
@ -1,8 +1,31 @@
|
||||
import { ref } from 'vue';
|
||||
import { extractOmsRequestError } from '@/api/oms/common';
|
||||
import { useOperationVoiceBroadcast } from './useOperationVoiceBroadcast';
|
||||
|
||||
export type ScanFeedbackType = 'idle' | 'success' | 'error' | 'warning';
|
||||
|
||||
/** 高频业务失败:界面仍显示完整句,语音播短词,便于连扫 */
|
||||
const SHORT_VOICE_RULES: Array<{ test: RegExp; voice: string }> = [
|
||||
{ test: /订单已出库/, voice: '已出库' },
|
||||
{ test: /未找到对应订单|未找到大包|未找到主单/, voice: '未找到' },
|
||||
{ test: /未付款/, voice: '未付款' },
|
||||
{ test: /入库处理中|请勿重复扫描/, voice: '处理中' },
|
||||
{ test: /不允许出库|不允许入库|仅待发货|状态为/, voice: '状态不符' },
|
||||
{ test: /实重与长宽高|件重尺|不能为空且须大于/, voice: '请补件重尺' },
|
||||
{ test: /请扫描或输入单号|运单号不能为空|请输入大包号|请输入主单号/, voice: '请扫单号' },
|
||||
{ test: /库存不足|SKU 库存/, voice: '库存不足' },
|
||||
{ test: /已在本袋中|已在其它大包|已在本主单|已归属其它/, voice: '重复扫描' },
|
||||
];
|
||||
|
||||
function resolveVoiceText(message: string): string {
|
||||
const text = message.trim();
|
||||
if (!text) return text;
|
||||
for (const rule of SHORT_VOICE_RULES) {
|
||||
if (rule.test.test(text)) return rule.voice;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫描页左侧反馈区 + 语音播报。
|
||||
*/
|
||||
@ -17,10 +40,11 @@ export function useOperationScanFeedback(pageKey: string) {
|
||||
}
|
||||
|
||||
function showFeedback(type: ScanFeedbackType, message: string, withVoice = true) {
|
||||
const text = String(message || '').trim();
|
||||
feedbackType.value = type;
|
||||
feedbackMessage.value = message;
|
||||
if (withVoice && (type === 'error' || type === 'success' || type === 'warning')) {
|
||||
speak(message);
|
||||
feedbackMessage.value = text;
|
||||
if (withVoice && text && (type === 'error' || type === 'success' || type === 'warning')) {
|
||||
speak(type === 'error' || type === 'warning' ? resolveVoiceText(text) : text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,6 +60,16 @@ export function useOperationScanFeedback(pageKey: string) {
|
||||
showFeedback('warning', message, withVoice);
|
||||
}
|
||||
|
||||
/** 从 axios / 业务响应提取可读错误,写入反馈区并短语音播报 */
|
||||
function showRequestError(err: unknown, fallback = '请求失败', withVoice = true) {
|
||||
const msg = extractOmsRequestError(err) || fallback;
|
||||
const text =
|
||||
/request failed with status code/i.test(msg) || /^Network Error$/i.test(msg)
|
||||
? fallback
|
||||
: msg;
|
||||
showError(text || fallback, withVoice);
|
||||
}
|
||||
|
||||
return {
|
||||
voiceEnabled,
|
||||
feedbackType,
|
||||
@ -47,5 +81,6 @@ export function useOperationScanFeedback(pageKey: string) {
|
||||
showError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
showRequestError,
|
||||
};
|
||||
}
|
||||
|
||||
41
src/composables/useOpsScanNumberType.ts
Normal file
41
src/composables/useOpsScanNumberType.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
function storageKey(pageKey: string) {
|
||||
return `oms.operation.numberType.${pageKey}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 入/出库扫码单号类型(与面单打印 / 履约打包选项对齐)。
|
||||
*/
|
||||
export function useOpsScanNumberType(pageKey: string, defaultType = 'auto') {
|
||||
const { t } = useI18n();
|
||||
const numberType = ref(defaultType);
|
||||
|
||||
try {
|
||||
const stored = localStorage.getItem(storageKey(pageKey));
|
||||
if (stored) numberType.value = stored;
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
|
||||
watch(numberType, (v) => {
|
||||
try {
|
||||
localStorage.setItem(storageKey(pageKey), v || defaultType);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
});
|
||||
|
||||
const numberTypeOptions = computed(() => [
|
||||
{ value: 'auto', label: t('operation.printLabel.numberType.auto') },
|
||||
{ value: 'waybill', label: t('operation.printLabel.numberType.waybill') },
|
||||
{ value: 'customerOrder', label: t('operation.printLabel.numberType.customerOrder') },
|
||||
{ value: 'tracking', label: t('operation.printLabel.numberType.tracking') },
|
||||
{ value: 'other', label: t('operation.printLabel.numberType.other') },
|
||||
{ value: 'parcel', label: t('operation.printLabel.numberType.parcel') },
|
||||
{ value: 'sku', label: t('operation.printLabel.numberType.sku') },
|
||||
]);
|
||||
|
||||
return { numberType, numberTypeOptions };
|
||||
}
|
||||
@ -121,6 +121,8 @@ async function bootstrap() {
|
||||
rbacUserStore.prefetchCurrentUser();
|
||||
}
|
||||
|
||||
const brandReady = bootstrapBrandAssets();
|
||||
|
||||
await initPreferredLocale();
|
||||
|
||||
// Business / home refresh: need full i18n before paint
|
||||
@ -132,14 +134,13 @@ async function bootstrap() {
|
||||
await ensureHeavyPlugins();
|
||||
}
|
||||
|
||||
await brandReady;
|
||||
app.mount('#app');
|
||||
;(window as any).__APP_MOUNTED__ = true;
|
||||
installWeChatH5HistoryGuard(router);
|
||||
initAuthKeepAlive();
|
||||
// GA4:有 VITE_GA_MEASUREMENT_ID 才加载;地域/设备等自动采集
|
||||
initGa();
|
||||
// 浏览器标签 favicon / 启动页吉祥物(匿名可读;未配置显示文字 LOGO)
|
||||
void bootstrapBrandAssets();
|
||||
|
||||
// 登录页勿预热 VXE/Element:体积大且会注入全局 CSS,和首屏抢带宽
|
||||
if (isHomePath(entryPath) && !isH5LikePath(entryPath) && !light) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ref } from 'vue'
|
||||
import { getBrandLogo, type BrandLogoDto } from '@/api/system/otherConfig'
|
||||
import { reactive, ref } from 'vue'
|
||||
import type { BrandLogoDto } from '@/api/system/otherConfig'
|
||||
import { resolveOmsAssetUrl, unwrapData } from '@/api/oms/common'
|
||||
import { resolveAdminApiPath } from '@/utils/adminApi'
|
||||
|
||||
@ -16,8 +16,18 @@ export const BRAND_TEXT_LOGO = 'LOGO'
|
||||
export const EMPTY_PLACEHOLDER = ''
|
||||
/** @deprecated 已改为文字 LOGO */
|
||||
export const MASCOT_FALLBACK = ''
|
||||
/** 启动页在 Vue 挂载前读取,须与 index.html 一致 */
|
||||
/** 启动页在 Vue 挂载前读取,须与 index.html 一致。只存 data URL,避免签名地址过期。 */
|
||||
export const MASCOT_CACHE_KEY = 'oms_brand_mascot_url'
|
||||
/** 四张品牌图的本地字节缓存(data URL),首屏直接用,不走接口 */
|
||||
export const BRAND_IMAGE_CACHE_KEY = 'oms_brand_images'
|
||||
|
||||
const BRAND_CHANNELS = ['portal', 'site', 'favicon', 'mascot'] as const
|
||||
type BrandChannel = (typeof BRAND_CHANNELS)[number]
|
||||
|
||||
type BrandImageStore = {
|
||||
images: Partial<BrandLogoUrls>
|
||||
stamps: Partial<Record<BrandChannel, string>>
|
||||
}
|
||||
|
||||
function isLegacyDefaultMascot(raw: string): boolean {
|
||||
return (
|
||||
@ -29,22 +39,46 @@ function isLegacyDefaultMascot(raw: string): boolean {
|
||||
)
|
||||
}
|
||||
|
||||
function emptyImageStore(): BrandImageStore {
|
||||
return { images: {}, stamps: {} }
|
||||
}
|
||||
|
||||
function readImageStore(): BrandImageStore {
|
||||
if (typeof localStorage === 'undefined') return emptyImageStore()
|
||||
try {
|
||||
const parsed = JSON.parse(localStorage.getItem(BRAND_IMAGE_CACHE_KEY) || '') as BrandImageStore
|
||||
return {
|
||||
images: parsed?.images && typeof parsed.images === 'object' ? parsed.images : {},
|
||||
stamps: parsed?.stamps && typeof parsed.stamps === 'object' ? parsed.stamps : {},
|
||||
}
|
||||
} catch {
|
||||
return emptyImageStore()
|
||||
}
|
||||
}
|
||||
|
||||
function writeImageStore(store: BrandImageStore) {
|
||||
try {
|
||||
localStorage.setItem(BRAND_IMAGE_CACHE_KEY, JSON.stringify(store))
|
||||
} catch {
|
||||
/* 配额不足时本次仍用内存里的 data URL */
|
||||
}
|
||||
}
|
||||
|
||||
function readCachedMascotUrl(): string {
|
||||
const stored = readImageStore().images.mascot || ''
|
||||
if (stored.startsWith('data:')) return stored
|
||||
if (typeof localStorage === 'undefined') return ''
|
||||
try {
|
||||
const raw = (localStorage.getItem(MASCOT_CACHE_KEY) || '').trim()
|
||||
if (!raw) return ''
|
||||
if (/^https?:\/\//i.test(raw) || raw.startsWith('/') || raw.startsWith('data:')) {
|
||||
if (isLegacyDefaultMascot(raw)) {
|
||||
localStorage.removeItem(MASCOT_CACHE_KEY)
|
||||
return ''
|
||||
}
|
||||
return raw
|
||||
if (!raw.startsWith('data:')) return ''
|
||||
if (isLegacyDefaultMascot(raw)) {
|
||||
localStorage.removeItem(MASCOT_CACHE_KEY)
|
||||
return ''
|
||||
}
|
||||
return raw
|
||||
} catch {
|
||||
/* ignore */
|
||||
return ''
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function mapBrandLogoDto(data?: BrandLogoDto | null): BrandLogoUrls {
|
||||
@ -56,9 +90,20 @@ function mapBrandLogoDto(data?: BrandLogoDto | null): BrandLogoUrls {
|
||||
}
|
||||
}
|
||||
|
||||
/** 空态 / 启动页吉祥物 URL;未配置为空串,UI 显示文字 LOGO */
|
||||
/** 空态 / 启动页吉祥物;有本地图时已是 data URL */
|
||||
export const appMascotUrl = ref(readCachedMascotUrl())
|
||||
|
||||
/** 顶栏 / 官网 / 标签 / 吉祥物。有缓存时首屏即可用,不请求接口 */
|
||||
export const brandLogoImages = reactive<BrandLogoUrls>({
|
||||
portal: '',
|
||||
site: '',
|
||||
favicon: '',
|
||||
mascot: '',
|
||||
})
|
||||
|
||||
/** 上传会递增,丢弃进行中的后台刷新,避免旧图盖住新图 */
|
||||
let brandImageGeneration = 0
|
||||
|
||||
function setMascotCssVar(resolved: string) {
|
||||
if (typeof document === 'undefined') return
|
||||
try {
|
||||
@ -94,14 +139,63 @@ function syncBootBrand(displayUrl: string) {
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
const initial = appMascotUrl.value
|
||||
if (initial) {
|
||||
setMascotCssVar(initial.split('?')[0] || initial)
|
||||
syncBootBrand(initial)
|
||||
} else {
|
||||
setMascotCssVar('')
|
||||
syncBootBrand('')
|
||||
function objectStamp(url: string): string {
|
||||
const value = url.trim()
|
||||
if (!value || value.startsWith('data:') || value.startsWith('blob:')) return ''
|
||||
const path = value.split('?')[0]
|
||||
try {
|
||||
if (/^https?:\/\//i.test(path)) return new URL(path).pathname
|
||||
} catch {
|
||||
/* 相对路径直接用 */
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
||||
function blobToDataUrl(blob: Blob): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader()
|
||||
reader.onload = () => resolve(String(reader.result || ''))
|
||||
reader.onerror = () => reject(reader.error)
|
||||
reader.readAsDataURL(blob)
|
||||
})
|
||||
}
|
||||
|
||||
/** 把已拿到的图片地址读成 data URL。跨域读不到字节时抛错,调用方再决定是否退回远程地址。 */
|
||||
async function embedImageUrl(url: string): Promise<string> {
|
||||
const res = await fetch(url, { credentials: 'omit', cache: 'force-cache' })
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
||||
const blob = await res.blob()
|
||||
if (blob.size <= 0 || blob.size > 1_500_000) throw new Error('image size')
|
||||
if (blob.type && !blob.type.startsWith('image/')) throw new Error('not image')
|
||||
const data = await blobToDataUrl(blob)
|
||||
if (!data.startsWith('data:image/')) throw new Error('data url')
|
||||
return data
|
||||
}
|
||||
|
||||
function publishBrandImage(channel: BrandChannel, value: string) {
|
||||
brandLogoImages[channel] = value
|
||||
if (channel === 'favicon') applyDocumentFavicon(value)
|
||||
if (channel !== 'mascot') return
|
||||
appMascotUrl.value = value
|
||||
setMascotCssVar(value)
|
||||
syncBootBrand(value)
|
||||
try {
|
||||
if (value.startsWith('data:')) localStorage.setItem(MASCOT_CACHE_KEY, value)
|
||||
else if (!value) localStorage.removeItem(MASCOT_CACHE_KEY)
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
function hydrateBrandImages() {
|
||||
const store = readImageStore()
|
||||
for (const channel of BRAND_CHANNELS) {
|
||||
const data = store.images[channel] || ''
|
||||
if (data.startsWith('data:')) publishBrandImage(channel, data)
|
||||
}
|
||||
if (!brandLogoImages.mascot) {
|
||||
const legacy = readCachedMascotUrl()
|
||||
if (legacy.startsWith('data:')) publishBrandImage('mascot', legacy)
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,87 +208,198 @@ export function applyDocumentFavicon(url?: string | null) {
|
||||
if (link) link.remove()
|
||||
return
|
||||
}
|
||||
const href = raw.includes('?') ? raw : `${raw}?_t=${Date.now()}`
|
||||
const href =
|
||||
raw.startsWith('data:') || raw.startsWith('blob:') || raw.includes('?')
|
||||
? raw
|
||||
: `${raw}?_t=${Date.now()}`
|
||||
if (!link) {
|
||||
link = document.createElement('link')
|
||||
link.rel = 'icon'
|
||||
document.head.appendChild(link)
|
||||
}
|
||||
link.type = raw.toLowerCase().endsWith('.svg') ? 'image/svg+xml' : 'image/png'
|
||||
link.type = raw.startsWith('data:image/svg') || raw.toLowerCase().endsWith('.svg')
|
||||
? 'image/svg+xml'
|
||||
: 'image/png'
|
||||
link.href = href
|
||||
}
|
||||
|
||||
/** 应用启动页 / 空态吉祥物;未配置则清缓存并用文字 LOGO */
|
||||
/** 应用启动页 / 空态吉祥物。data URL 直接显示;远程地址转成本地字节后再换,避免签名过期后空白。 */
|
||||
export function applyAppMascot(url?: string | null) {
|
||||
if (typeof document === 'undefined') return
|
||||
const configured = resolveOmsAssetUrl(url) || ''
|
||||
const display =
|
||||
!configured || configured.includes('?')
|
||||
? configured
|
||||
: `${configured}?_t=${Date.now()}`
|
||||
|
||||
appMascotUrl.value = display
|
||||
|
||||
try {
|
||||
if (!configured) {
|
||||
localStorage.removeItem(MASCOT_CACHE_KEY)
|
||||
} else {
|
||||
localStorage.setItem(MASCOT_CACHE_KEY, configured)
|
||||
}
|
||||
} catch {
|
||||
/* ignore */
|
||||
const raw = String(url || '').trim()
|
||||
if (!raw) {
|
||||
clearCachedBrandImage('mascot')
|
||||
return
|
||||
}
|
||||
|
||||
setMascotCssVar(configured)
|
||||
syncBootBrand(display)
|
||||
if (raw.startsWith('data:')) {
|
||||
void updateImageStore((store) => {
|
||||
store.images.mascot = raw
|
||||
})
|
||||
publishBrandImage('mascot', raw)
|
||||
return
|
||||
}
|
||||
const configured = resolveOmsAssetUrl(raw)
|
||||
if (!configured) {
|
||||
clearCachedBrandImage('mascot')
|
||||
return
|
||||
}
|
||||
void embedChannel('mascot', configured, brandImageGeneration)
|
||||
}
|
||||
|
||||
/** 拉取配置的品牌 Logo;未配置返回空串(需登录态) */
|
||||
export async function loadBrandLogoUrls(): Promise<BrandLogoUrls> {
|
||||
/** 上传成功后立刻把原文件写入本地缓存,页面其它位置不用再请求图片 */
|
||||
export async function rememberBrandImageFile(
|
||||
channel: BrandChannel,
|
||||
file: Blob,
|
||||
remoteUrl?: string | null,
|
||||
) {
|
||||
brandImageGeneration += 1
|
||||
const data = await blobToDataUrl(file)
|
||||
if (!data.startsWith('data:image/')) return
|
||||
const stamp = objectStamp(resolveOmsAssetUrl(remoteUrl) || String(remoteUrl || ''))
|
||||
await updateImageStore((store) => {
|
||||
store.images[channel] = data
|
||||
if (stamp) store.stamps[channel] = stamp
|
||||
})
|
||||
publishBrandImage(channel, data)
|
||||
}
|
||||
|
||||
let brandStoreWrite: Promise<void> = Promise.resolve()
|
||||
|
||||
function updateImageStore(mutate: (store: BrandImageStore) => void): Promise<void> {
|
||||
const run = brandStoreWrite.then(() => {
|
||||
const store = readImageStore()
|
||||
mutate(store)
|
||||
writeImageStore(store)
|
||||
})
|
||||
brandStoreWrite = run.catch(() => undefined)
|
||||
return run
|
||||
}
|
||||
|
||||
function wipeBrandImage(channel: BrandChannel) {
|
||||
void updateImageStore((store) => {
|
||||
delete store.images[channel]
|
||||
delete store.stamps[channel]
|
||||
})
|
||||
publishBrandImage(channel, '')
|
||||
}
|
||||
|
||||
/** 清除某一路本地图片,之后界面不占位 */
|
||||
export function clearCachedBrandImage(channel: BrandChannel) {
|
||||
brandImageGeneration += 1
|
||||
wipeBrandImage(channel)
|
||||
}
|
||||
|
||||
async function embedChannel(channel: BrandChannel, url: string, generation: number) {
|
||||
const stamp = objectStamp(url)
|
||||
const store = readImageStore()
|
||||
const cached = store.images[channel]
|
||||
if (stamp && store.stamps[channel] === stamp && cached?.startsWith('data:')) {
|
||||
if (brandLogoImages[channel] !== cached) publishBrandImage(channel, cached)
|
||||
return
|
||||
}
|
||||
try {
|
||||
const data = await getBrandLogo()
|
||||
return mapBrandLogoDto(data)
|
||||
const data = await embedImageUrl(url)
|
||||
if (generation !== brandImageGeneration) return
|
||||
await updateImageStore((latest) => {
|
||||
if (generation !== brandImageGeneration) return
|
||||
latest.images[channel] = data
|
||||
if (stamp) latest.stamps[channel] = stamp
|
||||
})
|
||||
if (generation !== brandImageGeneration) return
|
||||
publishBrandImage(channel, data)
|
||||
} catch {
|
||||
return {
|
||||
portal: '',
|
||||
site: '',
|
||||
favicon: '',
|
||||
mascot: readCachedMascotUrl(),
|
||||
if (generation !== brandImageGeneration) return
|
||||
if (!readImageStore().images[channel]?.startsWith('data:')) {
|
||||
publishBrandImage(channel, url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 官网匿名拉取品牌 Logo(不依赖登录态) */
|
||||
export async function fetchBrandLogoUrlsPublic(): Promise<BrandLogoUrls> {
|
||||
async function fetchRemoteBrandUrls(): Promise<BrandLogoUrls | null> {
|
||||
try {
|
||||
const res = await fetch(resolveAdminApiPath('/system/other-config/brand-logo'), {
|
||||
method: 'GET',
|
||||
headers: { Accept: 'application/json' },
|
||||
credentials: 'omit',
|
||||
})
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
||||
if (!res.ok) return null
|
||||
const body = await res.json()
|
||||
const data = unwrapData<BrandLogoDto>(body)
|
||||
return mapBrandLogoDto(data)
|
||||
return mapBrandLogoDto(unwrapData<BrandLogoDto>(body))
|
||||
} catch {
|
||||
return {
|
||||
portal: '',
|
||||
site: '',
|
||||
favicon: '',
|
||||
mascot: readCachedMascotUrl(),
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/** 启动时应用配置的 favicon + 吉祥物(匿名可读) */
|
||||
export async function bootstrapBrandAssets() {
|
||||
const cached = readCachedMascotUrl()
|
||||
applyAppMascot(cached || '')
|
||||
const urls = await fetchBrandLogoUrlsPublic()
|
||||
applyDocumentFavicon(urls.favicon)
|
||||
applyAppMascot(urls.mascot)
|
||||
let brandRefreshTask: Promise<void> | null = null
|
||||
|
||||
/** 后台核对对象路径;没变就不重新下载。失败不清本地图。 */
|
||||
export function refreshBrandImages(): Promise<void> {
|
||||
if (!brandRefreshTask) {
|
||||
const generation = brandImageGeneration
|
||||
brandRefreshTask = (async () => {
|
||||
const remote = await fetchRemoteBrandUrls()
|
||||
if (!remote || generation !== brandImageGeneration) return
|
||||
await Promise.all(
|
||||
BRAND_CHANNELS.map((channel) => {
|
||||
const url = remote[channel]
|
||||
if (!url) {
|
||||
if (brandLogoImages[channel]) wipeBrandImage(channel)
|
||||
return Promise.resolve()
|
||||
}
|
||||
return embedChannel(channel, url, generation)
|
||||
}),
|
||||
)
|
||||
})().finally(() => {
|
||||
brandRefreshTask = null
|
||||
})
|
||||
}
|
||||
return brandRefreshTask
|
||||
}
|
||||
|
||||
function snapshotBrandImages(): BrandLogoUrls {
|
||||
return {
|
||||
portal: brandLogoImages.portal,
|
||||
site: brandLogoImages.site,
|
||||
favicon: brandLogoImages.favicon,
|
||||
mascot: brandLogoImages.mascot,
|
||||
}
|
||||
}
|
||||
|
||||
/** 立即返回本地图,并在后台刷新。展示不依赖这次接口。 */
|
||||
export async function loadBrandLogoUrls(): Promise<BrandLogoUrls> {
|
||||
void refreshBrandImages()
|
||||
return snapshotBrandImages()
|
||||
}
|
||||
|
||||
/** 与 loadBrandLogoUrls 相同;登录页 / 官网在未登录时也可读本地缓存 */
|
||||
export async function fetchBrandLogoUrlsPublic(): Promise<BrandLogoUrls> {
|
||||
void refreshBrandImages()
|
||||
return snapshotBrandImages()
|
||||
}
|
||||
|
||||
function hasLocalBrandImage(): boolean {
|
||||
return BRAND_CHANNELS.some((channel) => brandLogoImages[channel].startsWith('data:'))
|
||||
}
|
||||
|
||||
/**
|
||||
* 已有本地图:立刻返回,刷新放后台。
|
||||
* 第一次没有缓存:在启动页盖住期间把图片收成 data URL,页面出来时已经在布局里。
|
||||
*/
|
||||
export async function bootstrapBrandAssets() {
|
||||
if (hasLocalBrandImage()) {
|
||||
void refreshBrandImages()
|
||||
return
|
||||
}
|
||||
await Promise.race([
|
||||
refreshBrandImages(),
|
||||
new Promise<void>((resolve) => {
|
||||
window.setTimeout(resolve, 8000)
|
||||
}),
|
||||
])
|
||||
}
|
||||
|
||||
hydrateBrandImages()
|
||||
|
||||
/** @deprecated 使用 bootstrapBrandAssets */
|
||||
export async function bootstrapBrandFavicon() {
|
||||
await bootstrapBrandAssets()
|
||||
|
||||
@ -13,10 +13,16 @@ export function isImeComposingEvent(e: unknown): boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
/** 包装无参回车处理:组字中直接忽略 */
|
||||
export function withImeEnterGuard(fn: () => void | Promise<void>) {
|
||||
return (e?: Event) => {
|
||||
if (isImeComposingEvent(e)) return
|
||||
void fn()
|
||||
}
|
||||
/**
|
||||
* 扫码回车:组字中忽略,否则执行 fn。
|
||||
*
|
||||
* 模板用法(全库现状,必须立即执行,不能返回 handler):
|
||||
* @press-enter="withImeEnterGuard(onScanEnter)"
|
||||
* @press-enter="withImeEnterGuard(onScanEnter, $event)" // 带事件可识别 IME
|
||||
*
|
||||
* 若写成返回函数再绑 `@press-enter="guarded"`,请自行 `const guarded = (e) => withImeEnterGuard(fn, e)`。
|
||||
*/
|
||||
export function withImeEnterGuard(fn: () => void | Promise<void>, e?: unknown) {
|
||||
if (isImeComposingEvent(e)) return
|
||||
void fn()
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { computed, nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
@ -117,7 +117,7 @@ import { loginErrorForUser, useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { useLoginCaptchaGate } from '@/composables/useLoginCaptchaGate';
|
||||
import LoginCaptchaField from '@/components/LoginCaptchaField/index.vue';
|
||||
import { ADMIN_H5_HOME_PATH, isAdminH5Path } from '@/utils/login-portal';
|
||||
import { BRAND_TEXT_LOGO, fetchBrandLogoUrlsPublic } from '@/utils/brandLogo';
|
||||
import { BRAND_TEXT_LOGO, brandLogoImages } from '@/utils/brandLogo';
|
||||
import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue';
|
||||
import H5LoginPortalSwitch from '@/views/h5/components/H5LoginPortalSwitch.vue';
|
||||
|
||||
@ -127,10 +127,7 @@ const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const rbacUserStore = useRbacUserStore();
|
||||
const logoSrc = ref('');
|
||||
void fetchBrandLogoUrlsPublic().then((urls) => {
|
||||
logoSrc.value = urls.site || '';
|
||||
});
|
||||
const logoSrc = computed(() => brandLogoImages.site);
|
||||
const {
|
||||
requireCaptcha,
|
||||
captchaId,
|
||||
|
||||
@ -255,7 +255,7 @@ const {
|
||||
feedbackType,
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('bagPack');
|
||||
@ -310,7 +310,7 @@ async function handleCreate(type: 'sack' | 'box') {
|
||||
);
|
||||
refocus();
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '开袋失败');
|
||||
showRequestError(e, '开袋失败');
|
||||
} finally {
|
||||
creating.value = false;
|
||||
}
|
||||
@ -323,7 +323,7 @@ async function refreshBag() {
|
||||
activeBag.value = await getShipBag(activeBag.value.bagNo);
|
||||
showSuccess('已刷新', false);
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '刷新失败');
|
||||
showRequestError(e, '刷新失败');
|
||||
} finally {
|
||||
loadingBag.value = false;
|
||||
}
|
||||
@ -356,7 +356,7 @@ async function handleScanEnter() {
|
||||
waybillNo.value = '';
|
||||
refocus();
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '入袋失败');
|
||||
showRequestError(e, '入袋失败');
|
||||
refocus();
|
||||
} finally {
|
||||
scanning.value = false;
|
||||
@ -403,7 +403,7 @@ function handleSeal() {
|
||||
activeBag.value = await sealShipBag(bagNo);
|
||||
showSuccess(`封袋成功 ${bagNo},共 ${count} 件`);
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '封袋失败');
|
||||
showRequestError(e, '封袋失败');
|
||||
throw e;
|
||||
} finally {
|
||||
sealing.value = false;
|
||||
@ -431,7 +431,7 @@ async function loadByNo(fromSession = false) {
|
||||
await nextTick();
|
||||
if (isOpen.value) refocus();
|
||||
} catch (e: any) {
|
||||
if (!fromSession) showError(e?.message || '加载失败');
|
||||
if (!fromSession) showRequestError(e, '加载失败');
|
||||
if (fromSession) persistSession();
|
||||
} finally {
|
||||
loadingBag.value = false;
|
||||
|
||||
@ -108,6 +108,7 @@ const {
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('h5FulfillPack');
|
||||
@ -200,7 +201,7 @@ async function loadQueue() {
|
||||
}));
|
||||
} catch (e: any) {
|
||||
queue.value = [];
|
||||
showError(e?.message || t('operation.fulfillPack.message.loadFailed'));
|
||||
showRequestError(e, t('operation.fulfillPack.message.loadFailed'));
|
||||
} finally {
|
||||
listLoading.value = false;
|
||||
}
|
||||
@ -235,7 +236,7 @@ async function runLookup(silent = false) {
|
||||
refocus();
|
||||
} catch (e: any) {
|
||||
lookup.value = null;
|
||||
showError(e?.message || t('operation.fulfillPack.message.lookupFailed'));
|
||||
showRequestError(e, t('operation.fulfillPack.message.lookupFailed'));
|
||||
refocus();
|
||||
} finally {
|
||||
lookingUp.value = false;
|
||||
@ -289,7 +290,7 @@ function confirmOutbound() {
|
||||
await loadQueue();
|
||||
refocus();
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('operation.fulfillPack.message.confirmFailed'));
|
||||
showRequestError(e, t('operation.fulfillPack.message.confirmFailed'));
|
||||
} finally {
|
||||
confirmLoading.value = false;
|
||||
}
|
||||
|
||||
@ -26,12 +26,38 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="h5-ops__type-row">
|
||||
<a-select
|
||||
v-model="numberType"
|
||||
class="h5-ops__type-select"
|
||||
:placeholder="t('operation.printLabel.form.placeholder.numberType')"
|
||||
>
|
||||
<a-option v-for="item in numberTypeOptions" :key="item.value" :value="item.value">
|
||||
{{ item.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</div>
|
||||
|
||||
<p v-if="feedbackMessage" class="h5-ops__feedback" :class="`is-${feedbackType}`">
|
||||
{{ feedbackMessage }}
|
||||
</p>
|
||||
|
||||
<section v-if="form.orderId" class="h5-ops__panel">
|
||||
<p class="h5-ops__waybill">{{ form.waybillNumber || '-' }}</p>
|
||||
<section v-if="candidates.length" class="h5-ops__panel">
|
||||
<p class="h5-ops__meta">{{ t('operation.printLabel.preview.multiMatch') }}</p>
|
||||
<button
|
||||
v-for="c in candidates"
|
||||
:key="c.orderId"
|
||||
type="button"
|
||||
class="h5-ops__candidate"
|
||||
@click="selectCandidate(c)"
|
||||
>
|
||||
<strong>{{ c.serviceNo || c.clientNo || `#${c.orderId}` }}</strong>
|
||||
<span>{{ c.clientNo || '-' }} · {{ c.trackNo || '-' }} · {{ c.orderStatusName || '-' }}</span>
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<section v-else-if="form.orderId" class="h5-ops__panel">
|
||||
<p class="h5-ops__waybill">{{ lookedUpServiceNo || form.waybillNumber || '-' }}</p>
|
||||
<p class="h5-ops__meta">
|
||||
{{ form.salesProductName || '-' }} · {{ form.destinationCountryName || '-' }}
|
||||
</p>
|
||||
@ -82,13 +108,19 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { nextTick, onMounted, reactive, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import H5ScanInput from '@/components/h5/H5ScanInput.vue';
|
||||
import H5OpsPageHeader from './H5OpsPageHeader.vue';
|
||||
import { inboundCreate, inboundOrderLookup, inboundRecentList } from '@/api/operation';
|
||||
import {
|
||||
inboundCreate,
|
||||
inboundOrderLookup,
|
||||
inboundRecentList,
|
||||
type OpsScanCandidate,
|
||||
} from '@/api/operation';
|
||||
import { useCurrentWarehouseStore } from '@/store';
|
||||
import { useOperationScanFeedback } from '@/composables/useOperationScanFeedback';
|
||||
import { useOpsScanNumberType } from '@/composables/useOpsScanNumberType';
|
||||
import { applyScanExtract, ensureScanExtractBundle } from '@/utils/scanExtract';
|
||||
|
||||
defineOptions({ name: 'H5AdminOpsInbound' });
|
||||
@ -101,9 +133,11 @@ const {
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('h5Inbound');
|
||||
const { numberType, numberTypeOptions } = useOpsScanNumberType('h5Inbound');
|
||||
|
||||
const form = reactive({
|
||||
waybillNumber: '',
|
||||
@ -117,6 +151,9 @@ const form = reactive({
|
||||
});
|
||||
|
||||
const lookedUpWaybillNo = ref('');
|
||||
const lookedUpServiceNo = ref('');
|
||||
const lookedUpNumberType = ref('auto');
|
||||
const candidates = ref<OpsScanCandidate[]>([]);
|
||||
const lookingUp = ref(false);
|
||||
const submitting = ref(false);
|
||||
const listLoading = ref(false);
|
||||
@ -156,6 +193,9 @@ function clearLookup() {
|
||||
form.width = '';
|
||||
form.height = '';
|
||||
lookedUpWaybillNo.value = '';
|
||||
lookedUpServiceNo.value = '';
|
||||
lookedUpNumberType.value = numberType.value;
|
||||
candidates.value = [];
|
||||
}
|
||||
|
||||
async function ensureLookup() {
|
||||
@ -164,20 +204,40 @@ async function ensureLookup() {
|
||||
clearLookup();
|
||||
return false;
|
||||
}
|
||||
if (form.orderId && lookedUpWaybillNo.value === no) return true;
|
||||
if (
|
||||
form.orderId &&
|
||||
lookedUpWaybillNo.value === no &&
|
||||
lookedUpNumberType.value === numberType.value
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
lookingUp.value = true;
|
||||
try {
|
||||
const info = await inboundOrderLookup(no);
|
||||
const info = await inboundOrderLookup(no, numberType.value);
|
||||
if (info?.candidates?.length && info.matched === false) {
|
||||
form.orderId = undefined;
|
||||
form.salesProductName = '';
|
||||
form.destinationCountryName = '';
|
||||
lookedUpWaybillNo.value = no;
|
||||
lookedUpServiceNo.value = '';
|
||||
lookedUpNumberType.value = numberType.value;
|
||||
candidates.value = info.candidates;
|
||||
showWarning(t('operation.printLabel.preview.multiMatch'));
|
||||
return false;
|
||||
}
|
||||
if (!info?.orderId) throw new Error(t('operation.common.message.orderNotFound'));
|
||||
form.orderId = info.orderId;
|
||||
form.salesProductName = info.salesProductName || info.productCode || '';
|
||||
form.destinationCountryName =
|
||||
info.destinationCountryName || info.destinationCountry || '';
|
||||
lookedUpWaybillNo.value = no;
|
||||
lookedUpServiceNo.value = info.serviceNo || no;
|
||||
lookedUpNumberType.value = numberType.value;
|
||||
candidates.value = [];
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
clearLookup();
|
||||
showError(e?.message || t('operation.common.message.orderNotFound'));
|
||||
showRequestError(e, t('operation.common.message.orderNotFound'));
|
||||
refocus();
|
||||
return false;
|
||||
} finally {
|
||||
@ -185,6 +245,18 @@ async function ensureLookup() {
|
||||
}
|
||||
}
|
||||
|
||||
async function selectCandidate(c: OpsScanCandidate) {
|
||||
const serviceNo = String(c.serviceNo || '').trim();
|
||||
if (!serviceNo) {
|
||||
showWarning(t('operation.common.message.orderNotFound'));
|
||||
return;
|
||||
}
|
||||
form.waybillNumber = serviceNo;
|
||||
numberType.value = 'waybill';
|
||||
candidates.value = [];
|
||||
await ensureLookup();
|
||||
}
|
||||
|
||||
async function onDetect(code: string) {
|
||||
form.waybillNumber = code;
|
||||
await onScanEnter();
|
||||
@ -229,7 +301,8 @@ async function submit() {
|
||||
submitting.value = true;
|
||||
try {
|
||||
const result = await inboundCreate({
|
||||
waybillNo: form.waybillNumber.trim(),
|
||||
waybillNo: lookedUpServiceNo.value || form.waybillNumber.trim(),
|
||||
numberType: lookedUpServiceNo.value ? 'waybill' : numberType.value,
|
||||
weight: Number(form.weight),
|
||||
length: Number(form.length),
|
||||
width: Number(form.width),
|
||||
@ -242,13 +315,20 @@ async function submit() {
|
||||
await loadRecent();
|
||||
refocus();
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('operation.inbound.message.inboundFailed'));
|
||||
showRequestError(e, t('operation.inbound.message.inboundFailed'));
|
||||
refocus();
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
watch(numberType, () => {
|
||||
form.orderId = undefined;
|
||||
lookedUpWaybillNo.value = '';
|
||||
lookedUpServiceNo.value = '';
|
||||
candidates.value = [];
|
||||
});
|
||||
|
||||
async function loadRecent() {
|
||||
listLoading.value = true;
|
||||
try {
|
||||
@ -268,7 +348,7 @@ async function loadRecent() {
|
||||
operateTime: row.operateTime ?? row.createTime ?? '',
|
||||
}));
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('operation.inbound.message.loadRecentFailed'));
|
||||
showRequestError(e, t('operation.inbound.message.loadRecentFailed'));
|
||||
rows.value = [];
|
||||
} finally {
|
||||
listLoading.value = false;
|
||||
|
||||
@ -242,7 +242,7 @@ const {
|
||||
feedbackType,
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('masterBoard');
|
||||
@ -306,7 +306,7 @@ async function handleCreate() {
|
||||
showSuccess(`已开主单 ${active.value.masterNo}`);
|
||||
refocus();
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '开主单失败');
|
||||
showRequestError(e, '开主单失败');
|
||||
throw e;
|
||||
} finally {
|
||||
creating.value = false;
|
||||
@ -332,7 +332,7 @@ async function loadMaster(fromSession = false) {
|
||||
await nextTick();
|
||||
if (isOpen.value) refocus();
|
||||
} catch (e: any) {
|
||||
if (!fromSession) showError(e?.message || '加载失败');
|
||||
if (!fromSession) showRequestError(e, '加载失败');
|
||||
if (fromSession) persistSession();
|
||||
} finally {
|
||||
loadingMaster.value = false;
|
||||
@ -378,7 +378,7 @@ async function handleScan() {
|
||||
scanNo.value = '';
|
||||
refocus();
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '上板失败');
|
||||
showRequestError(e, '上板失败');
|
||||
refocus();
|
||||
} finally {
|
||||
scanning.value = false;
|
||||
@ -428,7 +428,7 @@ function handleSeal() {
|
||||
active.value = await sealShipMaster(masterNo);
|
||||
showSuccess(`封板成功 ${masterNo}`);
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '封板失败');
|
||||
showRequestError(e, '封板失败');
|
||||
throw e;
|
||||
} finally {
|
||||
sealing.value = false;
|
||||
@ -464,7 +464,7 @@ async function refreshMaster() {
|
||||
active.value = await getShipMaster(active.value.masterNo);
|
||||
showSuccess('已刷新', false);
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '刷新失败');
|
||||
showRequestError(e, '刷新失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -15,6 +15,43 @@
|
||||
}
|
||||
}
|
||||
|
||||
.h5-ops__type-row {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
.h5-ops__type-select {
|
||||
width: 100%;
|
||||
|
||||
:deep(.arco-select-view-single) {
|
||||
min-height: 36px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.h5-ops__candidate {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
width: 100%;
|
||||
margin-top: 8px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid var(--color-border-2, #e5e6eb);
|
||||
border-radius: 10px;
|
||||
background: #f7f8fa;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
|
||||
strong {
|
||||
font-size: 14px;
|
||||
color: var(--h5-text, #1d2129);
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
color: var(--h5-text-3, #86909c);
|
||||
}
|
||||
}
|
||||
|
||||
.h5-ops__primary {
|
||||
flex: 0 0 auto;
|
||||
height: 44px;
|
||||
|
||||
@ -26,12 +26,38 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="h5-ops__type-row">
|
||||
<a-select
|
||||
v-model="numberType"
|
||||
class="h5-ops__type-select"
|
||||
:placeholder="t('operation.printLabel.form.placeholder.numberType')"
|
||||
>
|
||||
<a-option v-for="item in numberTypeOptions" :key="item.value" :value="item.value">
|
||||
{{ item.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</div>
|
||||
|
||||
<p v-if="feedbackMessage" class="h5-ops__feedback" :class="`is-${feedbackType}`">
|
||||
{{ feedbackMessage }}
|
||||
</p>
|
||||
|
||||
<section v-if="form.orderId" class="h5-ops__panel">
|
||||
<p class="h5-ops__waybill">{{ form.waybillNumber || '-' }}</p>
|
||||
<section v-if="candidates.length" class="h5-ops__panel">
|
||||
<p class="h5-ops__meta">{{ t('operation.printLabel.preview.multiMatch') }}</p>
|
||||
<button
|
||||
v-for="c in candidates"
|
||||
:key="c.orderId"
|
||||
type="button"
|
||||
class="h5-ops__candidate"
|
||||
@click="selectCandidate(c)"
|
||||
>
|
||||
<strong>{{ c.serviceNo || c.clientNo || `#${c.orderId}` }}</strong>
|
||||
<span>{{ c.clientNo || '-' }} · {{ c.trackNo || '-' }} · {{ c.orderStatusName || '-' }}</span>
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<section v-else-if="form.orderId" class="h5-ops__panel">
|
||||
<p class="h5-ops__waybill">{{ lookedUpServiceNo || form.waybillNumber || '-' }}</p>
|
||||
<p class="h5-ops__meta">
|
||||
{{ form.salesProductName || '-' }} · {{ form.destinationCountryName || '-' }}
|
||||
<template v-if="form.serviceChannelName"> · {{ form.serviceChannelName }}</template>
|
||||
@ -83,13 +109,19 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { nextTick, onMounted, reactive, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import H5ScanInput from '@/components/h5/H5ScanInput.vue';
|
||||
import H5OpsPageHeader from './H5OpsPageHeader.vue';
|
||||
import { outboundCreate, outboundOrderLookup, outboundRecentList } from '@/api/operation';
|
||||
import {
|
||||
outboundCreate,
|
||||
outboundOrderLookup,
|
||||
outboundRecentList,
|
||||
type OpsScanCandidate,
|
||||
} from '@/api/operation';
|
||||
import { useCurrentWarehouseStore } from '@/store';
|
||||
import { useOperationScanFeedback } from '@/composables/useOperationScanFeedback';
|
||||
import { useOpsScanNumberType } from '@/composables/useOpsScanNumberType';
|
||||
import { applyScanExtract, ensureScanExtractBundle } from '@/utils/scanExtract';
|
||||
|
||||
defineOptions({ name: 'H5AdminOpsOutbound' });
|
||||
@ -102,9 +134,11 @@ const {
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('h5Outbound');
|
||||
const { numberType, numberTypeOptions } = useOpsScanNumberType('h5Outbound');
|
||||
|
||||
const form = reactive({
|
||||
waybillNumber: '',
|
||||
@ -119,6 +153,9 @@ const form = reactive({
|
||||
});
|
||||
|
||||
const lookedUpWaybillNo = ref('');
|
||||
const lookedUpServiceNo = ref('');
|
||||
const lookedUpNumberType = ref('auto');
|
||||
const candidates = ref<OpsScanCandidate[]>([]);
|
||||
const lookingUp = ref(false);
|
||||
const submitting = ref(false);
|
||||
const listLoading = ref(false);
|
||||
@ -158,6 +195,9 @@ function clearLookup() {
|
||||
form.width = '';
|
||||
form.height = '';
|
||||
lookedUpWaybillNo.value = '';
|
||||
lookedUpServiceNo.value = '';
|
||||
lookedUpNumberType.value = numberType.value;
|
||||
candidates.value = [];
|
||||
}
|
||||
|
||||
async function ensureLookup() {
|
||||
@ -166,10 +206,28 @@ async function ensureLookup() {
|
||||
clearLookup();
|
||||
return false;
|
||||
}
|
||||
if (form.orderId && lookedUpWaybillNo.value === no) return true;
|
||||
if (
|
||||
form.orderId &&
|
||||
lookedUpWaybillNo.value === no &&
|
||||
lookedUpNumberType.value === numberType.value
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
lookingUp.value = true;
|
||||
try {
|
||||
const info = await outboundOrderLookup(no);
|
||||
const info = await outboundOrderLookup(no, numberType.value);
|
||||
if (info?.candidates?.length && info.matched === false) {
|
||||
form.orderId = undefined;
|
||||
form.salesProductName = '';
|
||||
form.destinationCountryName = '';
|
||||
form.serviceChannelName = '';
|
||||
lookedUpWaybillNo.value = no;
|
||||
lookedUpServiceNo.value = '';
|
||||
lookedUpNumberType.value = numberType.value;
|
||||
candidates.value = info.candidates;
|
||||
showWarning(t('operation.printLabel.preview.multiMatch'));
|
||||
return false;
|
||||
}
|
||||
if (!info?.orderId) throw new Error(t('operation.common.message.orderNotFound'));
|
||||
form.orderId = info.orderId;
|
||||
form.salesProductName = info.salesProductName || info.productCode || '';
|
||||
@ -177,10 +235,13 @@ async function ensureLookup() {
|
||||
info.destinationCountryName || info.destinationCountry || '';
|
||||
form.serviceChannelName = info.serviceChannelName || info.channelCode || '';
|
||||
lookedUpWaybillNo.value = no;
|
||||
lookedUpServiceNo.value = info.serviceNo || no;
|
||||
lookedUpNumberType.value = numberType.value;
|
||||
candidates.value = [];
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
clearLookup();
|
||||
showError(e?.message || t('operation.common.message.orderNotFound'));
|
||||
showRequestError(e, t('operation.common.message.orderNotFound'));
|
||||
refocus();
|
||||
return false;
|
||||
} finally {
|
||||
@ -188,6 +249,18 @@ async function ensureLookup() {
|
||||
}
|
||||
}
|
||||
|
||||
async function selectCandidate(c: OpsScanCandidate) {
|
||||
const serviceNo = String(c.serviceNo || '').trim();
|
||||
if (!serviceNo) {
|
||||
showWarning(t('operation.common.message.orderNotFound'));
|
||||
return;
|
||||
}
|
||||
form.waybillNumber = serviceNo;
|
||||
numberType.value = 'waybill';
|
||||
candidates.value = [];
|
||||
await ensureLookup();
|
||||
}
|
||||
|
||||
async function onDetect(code: string) {
|
||||
form.waybillNumber = code;
|
||||
await onScanEnter();
|
||||
@ -220,7 +293,8 @@ async function submit() {
|
||||
submitting.value = true;
|
||||
try {
|
||||
await outboundCreate({
|
||||
waybillNo: form.waybillNumber.trim(),
|
||||
waybillNo: lookedUpServiceNo.value || form.waybillNumber.trim(),
|
||||
numberType: lookedUpServiceNo.value ? 'waybill' : numberType.value,
|
||||
weight: Number(form.weight),
|
||||
length: Number(form.length),
|
||||
width: Number(form.width),
|
||||
@ -233,13 +307,20 @@ async function submit() {
|
||||
await loadRecent();
|
||||
refocus();
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('operation.outbound.message.outboundFailed'));
|
||||
showRequestError(e, t('operation.outbound.message.outboundFailed'));
|
||||
refocus();
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
watch(numberType, () => {
|
||||
form.orderId = undefined;
|
||||
lookedUpWaybillNo.value = '';
|
||||
lookedUpServiceNo.value = '';
|
||||
candidates.value = [];
|
||||
});
|
||||
|
||||
async function loadRecent() {
|
||||
listLoading.value = true;
|
||||
try {
|
||||
@ -258,7 +339,7 @@ async function loadRecent() {
|
||||
operateTime: row.operateTime ?? row.createTime ?? '',
|
||||
}));
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('operation.outbound.message.loadRecentFailed'));
|
||||
showRequestError(e, t('operation.outbound.message.loadRecentFailed'));
|
||||
rows.value = [];
|
||||
} finally {
|
||||
listLoading.value = false;
|
||||
|
||||
@ -65,6 +65,7 @@ const {
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('h5ParcelArrival');
|
||||
@ -114,7 +115,7 @@ async function loadList() {
|
||||
};
|
||||
});
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('warehouse.parcelArrival.message.loadFailed'));
|
||||
showRequestError(e, t('warehouse.parcelArrival.message.loadFailed'));
|
||||
rows.value = [];
|
||||
} finally {
|
||||
listLoading.value = false;
|
||||
@ -156,7 +157,7 @@ async function submit() {
|
||||
await loadList();
|
||||
refocus();
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('warehouse.parcelArrival.message.arriveFailed'));
|
||||
showRequestError(e, t('warehouse.parcelArrival.message.arriveFailed'));
|
||||
refocus();
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
|
||||
@ -182,6 +182,7 @@ const {
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('h5Putaway');
|
||||
@ -344,7 +345,7 @@ async function lookup() {
|
||||
scanCode.value = '';
|
||||
} catch (e: any) {
|
||||
resetForm();
|
||||
showError(e?.message || t('h5Admin.ops.putaway.loadFailed'));
|
||||
showRequestError(e, t('h5Admin.ops.putaway.loadFailed'));
|
||||
refocus();
|
||||
} finally {
|
||||
lookingUp.value = false;
|
||||
@ -366,7 +367,7 @@ async function loadById(row: PendingRow) {
|
||||
applyDetail(detail || {});
|
||||
await loadBinOptions(currentWarehouseStore.warehouseId || notice.value?.warehouseId);
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('h5Admin.ops.putaway.loadFailed'));
|
||||
showRequestError(e, t('h5Admin.ops.putaway.loadFailed'));
|
||||
} finally {
|
||||
lookingUp.value = false;
|
||||
}
|
||||
@ -414,7 +415,7 @@ async function loadPending() {
|
||||
pendingRows.value = merged.slice(0, 30);
|
||||
} catch (e: any) {
|
||||
pendingRows.value = [];
|
||||
showError(e?.message || t('h5Admin.ops.putaway.loadFailed'));
|
||||
showRequestError(e, t('h5Admin.ops.putaway.loadFailed'));
|
||||
} finally {
|
||||
listLoading.value = false;
|
||||
}
|
||||
@ -461,7 +462,7 @@ async function submit() {
|
||||
await loadPending();
|
||||
refocus();
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('h5Admin.ops.putaway.failed'));
|
||||
showRequestError(e, t('h5Admin.ops.putaway.failed'));
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
|
||||
@ -166,6 +166,7 @@ const {
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('h5Relocate');
|
||||
@ -310,7 +311,7 @@ async function selectSku(row: StockRow) {
|
||||
form.qty = Math.min(1, sourceBinOptions.value[0].qty || 1) || 1;
|
||||
}
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('h5Admin.ops.relocate.loadFailed'));
|
||||
showRequestError(e, t('h5Admin.ops.relocate.loadFailed'));
|
||||
} finally {
|
||||
lookingUp.value = false;
|
||||
}
|
||||
@ -386,7 +387,7 @@ async function lookup() {
|
||||
scanCode.value = '';
|
||||
} catch (e: any) {
|
||||
resetForm();
|
||||
showError(e?.message || t('h5Admin.ops.relocate.loadFailed'));
|
||||
showRequestError(e, t('h5Admin.ops.relocate.loadFailed'));
|
||||
refocus();
|
||||
} finally {
|
||||
lookingUp.value = false;
|
||||
@ -411,7 +412,7 @@ async function loadStockList() {
|
||||
.filter((x) => x.skuId > 0);
|
||||
} catch (e: any) {
|
||||
stockRows.value = [];
|
||||
showError(e?.message || t('h5Admin.ops.relocate.loadFailed'));
|
||||
showRequestError(e, t('h5Admin.ops.relocate.loadFailed'));
|
||||
} finally {
|
||||
listLoading.value = false;
|
||||
}
|
||||
@ -457,7 +458,7 @@ async function submit() {
|
||||
await loadStockList();
|
||||
refocus();
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('warehouse.inventory.message.relocateFailed'));
|
||||
showRequestError(e, t('warehouse.inventory.message.relocateFailed'));
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
|
||||
@ -174,7 +174,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { computed, nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
@ -188,7 +188,7 @@ import { isWeChatBrowser } from '@/utils/device';
|
||||
import { loginErrorForUser, useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { useLoginCaptchaGate } from '@/composables/useLoginCaptchaGate';
|
||||
import LoginCaptchaField from '@/components/LoginCaptchaField/index.vue';
|
||||
import { BRAND_TEXT_LOGO, fetchBrandLogoUrlsPublic } from '@/utils/brandLogo';
|
||||
import { BRAND_TEXT_LOGO, brandLogoImages } from '@/utils/brandLogo';
|
||||
import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue';
|
||||
import H5LoginPortalSwitch from '@/views/h5/components/H5LoginPortalSwitch.vue';
|
||||
import WechatOAuthLoginButton from '../components/WechatOAuthLoginButton.vue';
|
||||
@ -205,10 +205,7 @@ const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const rbacUserStore = useRbacUserStore();
|
||||
const logoSrc = ref('');
|
||||
void fetchBrandLogoUrlsPublic().then((urls) => {
|
||||
logoSrc.value = urls.site || '';
|
||||
});
|
||||
const logoSrc = computed(() => brandLogoImages.site);
|
||||
const {
|
||||
requireCaptcha,
|
||||
captchaId,
|
||||
|
||||
@ -79,6 +79,8 @@
|
||||
@select-country="onSelectCountry"
|
||||
@select-lane="selectedLaneId = $event"
|
||||
@drill-status="onDrillStatus"
|
||||
@expand-world="openWorldFocus"
|
||||
@expand-china="openChinaFocus"
|
||||
/>
|
||||
<div v-if="railError" class="biz-ops__rail-error">线路面板异常:{{ railError }}</div>
|
||||
<LaneRankRail
|
||||
@ -100,16 +102,57 @@
|
||||
@drill-lane="onDrillLane"
|
||||
@pick-alert="pickLane"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="mapFocus !== 'none'"
|
||||
class="biz-ops__focus"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
:aria-label="focusAriaLabel"
|
||||
>
|
||||
<ChinaOriginMap
|
||||
v-if="mapFocus === 'china'"
|
||||
:slice="slice"
|
||||
:selected-province="selectedProvince"
|
||||
:active-lane-ids="activeLaneIds"
|
||||
:focused="true"
|
||||
:expandable="false"
|
||||
@select-province="onSelectProvince"
|
||||
@collapse="closeMapFocus"
|
||||
/>
|
||||
<WorldDestMap
|
||||
v-else-if="mapFocus === 'world'"
|
||||
:slice="slice"
|
||||
:selected-country="selectedCountry"
|
||||
:selected-lane-id="selectedLaneId"
|
||||
:latency-mode="latencyMode"
|
||||
:focused="true"
|
||||
:expandable="false"
|
||||
@select-country="onSelectCountry"
|
||||
@select-lane="selectedLaneId = $event"
|
||||
@drill-status="onDrillStatus"
|
||||
@collapse="closeMapFocus"
|
||||
@drill-us="mapFocus = 'us'"
|
||||
/>
|
||||
<UsDestDetailMap
|
||||
v-else
|
||||
@back-world="mapFocus = 'world'"
|
||||
@collapse="closeMapFocus"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onErrorCaptured, onMounted, ref, watch } from 'vue'
|
||||
import { computed, onErrorCaptured, onMounted, onUnmounted, ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import gsap from 'gsap'
|
||||
import WorkplaceSegmented from '../components/WorkplaceSegmented.vue'
|
||||
import OpsDualMapStage from './OpsDualMapStage.vue'
|
||||
import ChinaOriginMap from './ChinaOriginMap.vue'
|
||||
import WorldDestMap from './WorldDestMap.vue'
|
||||
import UsDestDetailMap from './UsDestDetailMap.vue'
|
||||
import LaneRankRail from './LaneRankRail.vue'
|
||||
import { useBizOpsData } from './useBizOpsData'
|
||||
import { formatGrowth } from './mock/bizOpsMock'
|
||||
@ -135,6 +178,8 @@ const latencyMode = ref<LatencyMode>('success')
|
||||
const selectedProvince = ref<string | null>(null)
|
||||
const selectedCountry = ref<string | null>(null)
|
||||
const selectedLaneId = ref<string | null>(null)
|
||||
/** none=双图总览;china=中国放大;world=全球放大;us=美国下钻 */
|
||||
const mapFocus = ref<'none' | 'china' | 'world' | 'us'>('none')
|
||||
|
||||
const {
|
||||
range,
|
||||
@ -149,6 +194,17 @@ const {
|
||||
saveThresholds,
|
||||
} = useBizOpsData()
|
||||
|
||||
const activeLaneIds = computed(() => {
|
||||
if (selectedLaneId.value) return [selectedLaneId.value]
|
||||
return slice.value.lanes.slice(0, 6).map((l) => l.id)
|
||||
})
|
||||
|
||||
const focusAriaLabel = computed(() => {
|
||||
if (mapFocus.value === 'china') return '中国城市与口岸放大'
|
||||
if (mapFocus.value === 'us') return '美国目的分布'
|
||||
return '全球目的国放大'
|
||||
})
|
||||
|
||||
const draftFailDays = ref(thresholds.value.failDaysThreshold)
|
||||
const draftMarginPct = ref(Math.round(thresholds.value.marginRateThreshold * 100))
|
||||
|
||||
@ -199,6 +255,25 @@ function onSelectCountry(name: string | null) {
|
||||
if (name) selectedProvince.value = null
|
||||
}
|
||||
|
||||
function openWorldFocus() {
|
||||
mapFocus.value = 'world'
|
||||
}
|
||||
|
||||
function openChinaFocus() {
|
||||
mapFocus.value = 'china'
|
||||
}
|
||||
|
||||
function closeMapFocus() {
|
||||
mapFocus.value = 'none'
|
||||
}
|
||||
|
||||
function onFocusKeydown(e: KeyboardEvent) {
|
||||
if (e.key === 'Escape' && mapFocus.value !== 'none') {
|
||||
e.preventDefault()
|
||||
closeMapFocus()
|
||||
}
|
||||
}
|
||||
|
||||
function clearMapFilter() {
|
||||
selectedProvince.value = null
|
||||
selectedCountry.value = null
|
||||
@ -249,6 +324,7 @@ function onDrillLane(lane: LaneStat) {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('keydown', onFocusKeydown)
|
||||
if (!rootRef.value) return
|
||||
gsap.from(rootRef.value.querySelectorAll('.biz-ops__bar, .biz-ops__body'), {
|
||||
opacity: 0,
|
||||
@ -259,6 +335,10 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('keydown', onFocusKeydown)
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@ -404,6 +484,7 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.biz-ops__body {
|
||||
position: relative;
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
display: grid;
|
||||
@ -411,6 +492,17 @@ onMounted(() => {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.biz-ops__focus {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 20;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
border: 1px solid var(--biz-line);
|
||||
box-shadow: 0 12px 40px rgba(26, 46, 56, 0.12);
|
||||
}
|
||||
|
||||
.biz-ops__stage,
|
||||
.biz-ops__rail,
|
||||
.biz-ops__rail-error {
|
||||
|
||||
@ -1,7 +1,48 @@
|
||||
<template>
|
||||
<div class="china-map" :class="{ 'is-dense': dense }">
|
||||
<div class="china-map__label">
|
||||
<strong>中国 · 省域客户与出货</strong>
|
||||
<div class="china-map" :class="{ 'is-dense': dense, 'is-focus': focused }">
|
||||
<div class="china-map__chrome">
|
||||
<div class="china-map__label">
|
||||
<strong>中国 · 省域客户与出货</strong>
|
||||
<span v-if="focused" class="china-map__hint">滚轮缩放 · 拖拽平移 · 城市 / 口岸图层</span>
|
||||
</div>
|
||||
<div class="china-map__actions">
|
||||
<div v-if="focused" class="china-map__layers" role="group" aria-label="图层">
|
||||
<button
|
||||
type="button"
|
||||
class="china-map__layer"
|
||||
:class="{ 'is-on': showCities }"
|
||||
@click="showCities = !showCities"
|
||||
>
|
||||
城市分布
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="china-map__layer"
|
||||
:class="{ 'is-on': showPorts }"
|
||||
@click="showPorts = !showPorts"
|
||||
>
|
||||
港口
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
v-if="expandable && !focused"
|
||||
type="button"
|
||||
class="china-map__btn china-map__btn--icon"
|
||||
title="放大查看"
|
||||
aria-label="放大查看"
|
||||
@click="$emit('expand')"
|
||||
>
|
||||
<IconEye :size="14" />
|
||||
</button>
|
||||
<button
|
||||
v-if="focused"
|
||||
type="button"
|
||||
class="china-map__btn"
|
||||
@click="$emit('collapse')"
|
||||
>
|
||||
收起
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<VCharts
|
||||
v-if="ready"
|
||||
@ -10,6 +51,7 @@
|
||||
autoresize
|
||||
@click="onClick"
|
||||
/>
|
||||
<div v-else-if="loadError" class="china-map__loading is-err">{{ loadError }}</div>
|
||||
<div v-else class="china-map__loading">地图加载中…</div>
|
||||
<div class="china-map__metrics" role="group" aria-label="客户概览">
|
||||
<button
|
||||
@ -37,11 +79,17 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { IconEye } from '@arco-design/web-vue/es/icon'
|
||||
import '@/utils/echarts'
|
||||
import VCharts from 'vue-echarts'
|
||||
import { formatCount } from './mock/bizOpsMock'
|
||||
import type { BizOpsSlice, ProvinceStat } from './types'
|
||||
import { ensureGeoMaps } from './useGeoMaps'
|
||||
import {
|
||||
ensureCnOverlays,
|
||||
ensureGeoMaps,
|
||||
type CnCityPoint,
|
||||
type CnPortPoint,
|
||||
} from './useGeoMaps'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@ -50,20 +98,44 @@ const props = withDefaults(
|
||||
activeLaneIds?: string[]
|
||||
/** 手机端紧凑:缩小图例与指标条 */
|
||||
dense?: boolean
|
||||
/** 全屏态:开启 roam + 城市/港口图层 */
|
||||
focused?: boolean
|
||||
/** 总览小窗显示「放大」 */
|
||||
expandable?: boolean
|
||||
}>(),
|
||||
{ dense: false },
|
||||
{ dense: false, focused: false, expandable: true },
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'select-province', name: string | null): void
|
||||
(e: 'expand'): void
|
||||
(e: 'collapse'): void
|
||||
}>()
|
||||
|
||||
const ready = ref(false)
|
||||
const loadError = ref('')
|
||||
const highlightKey = ref<'total' | 'neu' | 'online' | 'idle7' | null>(null)
|
||||
const showCities = ref(true)
|
||||
const showPorts = ref(true)
|
||||
const ports = ref<CnPortPoint[]>([])
|
||||
const mockCities = ref<CnCityPoint[]>([])
|
||||
|
||||
onMounted(async () => {
|
||||
await ensureGeoMaps()
|
||||
ready.value = true
|
||||
try {
|
||||
await ensureGeoMaps()
|
||||
if (props.focused) {
|
||||
try {
|
||||
const overlays = await ensureCnOverlays()
|
||||
ports.value = overlays.ports
|
||||
mockCities.value = overlays.cities
|
||||
} catch (overlayErr) {
|
||||
console.warn('[ChinaOriginMap] overlays', overlayErr)
|
||||
}
|
||||
}
|
||||
ready.value = true
|
||||
} catch (err) {
|
||||
loadError.value = err instanceof Error ? err.message : '中国地图加载失败'
|
||||
}
|
||||
})
|
||||
|
||||
type MetricTone = 'up' | 'warn'
|
||||
@ -99,6 +171,24 @@ function metricField(p: ProvinceStat, key: NonNullable<typeof highlightKey.value
|
||||
return p.customerIdle7
|
||||
}
|
||||
|
||||
const cityPoints = computed(() => {
|
||||
const fromSlice = props.slice.cities
|
||||
.filter((c) => Array.isArray(c.value) && c.value.length >= 3)
|
||||
.map((c) => ({
|
||||
name: c.name,
|
||||
province: c.province,
|
||||
orderCount: Number(c.value[2]) || 0,
|
||||
coord: [Number(c.value[0]), Number(c.value[1])] as [number, number],
|
||||
}))
|
||||
if (fromSlice.length) return fromSlice
|
||||
return mockCities.value.map((c) => ({
|
||||
name: c.name,
|
||||
province: c.province,
|
||||
orderCount: c.orderCount,
|
||||
coord: c.coord,
|
||||
}))
|
||||
})
|
||||
|
||||
const option = computed(() => {
|
||||
const heatKey = highlightKey.value
|
||||
const data = props.slice.provinces.map((p) => ({
|
||||
@ -112,15 +202,131 @@ const option = computed(() => {
|
||||
}))
|
||||
const max = Math.max(...data.map((d) => d.value), 1)
|
||||
|
||||
const laneHints = (props.activeLaneIds?.length
|
||||
? props.slice.lanes.filter((l) => props.activeLaneIds!.includes(l.id))
|
||||
: props.slice.lanes.slice(0, 8)
|
||||
const laneHints = (
|
||||
props.activeLaneIds?.length
|
||||
? props.slice.lanes.filter((l) => props.activeLaneIds!.includes(l.id))
|
||||
: props.slice.lanes.slice(0, 8)
|
||||
)
|
||||
.filter((l) => l.fromCenter && l.fromCenter.length >= 2)
|
||||
.map((l) => ({
|
||||
coords: [l.fromCenter!, [l.fromCenter![0] + 8, l.fromCenter![1] - 2]],
|
||||
}))
|
||||
|
||||
const cities = cityPoints.value
|
||||
const maxCity = Math.max(...cities.map((c) => c.orderCount), 1)
|
||||
const showCityLayer = !props.focused || showCities.value
|
||||
const showPortLayer = props.focused && showPorts.value
|
||||
|
||||
const series: Record<string, unknown>[] = [
|
||||
{
|
||||
type: 'map',
|
||||
map: 'china',
|
||||
geoIndex: 0,
|
||||
data,
|
||||
selectedMode: false,
|
||||
},
|
||||
]
|
||||
|
||||
if (showCityLayer) {
|
||||
series.push({
|
||||
name: '城市分布',
|
||||
type: 'effectScatter',
|
||||
coordinateSystem: 'geo',
|
||||
zlevel: 2,
|
||||
rippleEffect: { brushType: 'stroke', scale: 2.8, period: 4 },
|
||||
symbolSize(val: number[]) {
|
||||
const v = val?.[2] || 0
|
||||
if (props.focused) return 6 + (v / maxCity) * 18
|
||||
return Math.max(5, Math.min(14, v / 8))
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#e8590c',
|
||||
shadowBlur: 8,
|
||||
shadowColor: 'rgba(232, 89, 12, 0.35)',
|
||||
},
|
||||
label: props.focused
|
||||
? {
|
||||
show: true,
|
||||
formatter: '{b}',
|
||||
position: 'top',
|
||||
distance: 4,
|
||||
fontSize: 10,
|
||||
color: 'rgba(26, 46, 56, 0.7)',
|
||||
textBorderColor: 'rgba(255,255,255,0.9)',
|
||||
textBorderWidth: 2,
|
||||
}
|
||||
: { show: false },
|
||||
data: cities.map((c) => ({
|
||||
name: c.name,
|
||||
value: [...c.coord, c.orderCount],
|
||||
province: c.province,
|
||||
orderCount: c.orderCount,
|
||||
})),
|
||||
})
|
||||
}
|
||||
|
||||
if (showPortLayer) {
|
||||
series.push({
|
||||
name: '港口',
|
||||
type: 'effectScatter',
|
||||
coordinateSystem: 'geo',
|
||||
zlevel: 3,
|
||||
rippleEffect: { brushType: 'stroke', scale: 2.4, period: 3.2 },
|
||||
symbolSize: 8,
|
||||
itemStyle: {
|
||||
color: '#1d7281',
|
||||
shadowBlur: 8,
|
||||
shadowColor: 'rgba(29, 114, 129, 0.35)',
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
formatter(params: any) {
|
||||
const d = params.data
|
||||
const zh = d?.nameZh || d?.name || params.name
|
||||
const code = d?.code || ''
|
||||
return code ? `${zh} ${code}` : zh
|
||||
},
|
||||
position: 'right',
|
||||
distance: 6,
|
||||
fontSize: 11,
|
||||
fontWeight: 600,
|
||||
color: 'rgba(26, 46, 56, 0.78)',
|
||||
textBorderColor: 'rgba(255,255,255,0.92)',
|
||||
textBorderWidth: 2,
|
||||
},
|
||||
data: ports.value.map((p) => ({
|
||||
name: p.nameZh || p.name,
|
||||
nameZh: p.nameZh || p.name,
|
||||
nameEn: p.name,
|
||||
value: [...p.coord, 1],
|
||||
code: p.code,
|
||||
locode: p.locode,
|
||||
portType: p.type,
|
||||
})),
|
||||
})
|
||||
}
|
||||
|
||||
if (!props.focused) {
|
||||
series.push({
|
||||
type: 'lines',
|
||||
coordinateSystem: 'geo',
|
||||
zlevel: 1,
|
||||
effect: {
|
||||
show: true,
|
||||
period: 5,
|
||||
trailLength: 0.3,
|
||||
color: 'rgba(240, 101, 67, 0.75)',
|
||||
symbolSize: 2.5,
|
||||
},
|
||||
lineStyle: {
|
||||
color: 'rgba(240, 101, 67, 0.28)',
|
||||
width: 1,
|
||||
curveness: 0.15,
|
||||
},
|
||||
data: laneHints,
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
backgroundColor: 'transparent',
|
||||
tooltip: {
|
||||
@ -130,11 +336,30 @@ const option = computed(() => {
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#1a2e38', fontSize: 12 },
|
||||
formatter(params: any) {
|
||||
if (params.seriesName === '港口') {
|
||||
const d = params.data
|
||||
const kind = d?.portType === 'air' ? '空港' : '海港'
|
||||
return [
|
||||
`<div style="font-weight:600;margin-bottom:4px">${d?.nameZh || d?.name || params.name}</div>`,
|
||||
`${d?.nameEn || ''}`,
|
||||
`港码 ${d?.code || '—'} · ${kind}`,
|
||||
d?.locode ? `LOCODE ${d.locode}` : '',
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join('<br/>')
|
||||
}
|
||||
if (params.seriesName === '城市分布' || params.seriesType === 'effectScatter') {
|
||||
const d = params.data
|
||||
return [
|
||||
`<div style="font-weight:600;margin-bottom:4px">${d?.name || params.name}</div>`,
|
||||
d?.province ? `${d.province}` : '',
|
||||
`出货热点 ${formatCount(d?.orderCount ?? params.value?.[2] ?? 0)}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join('<br/>')
|
||||
}
|
||||
const d = params.data
|
||||
if (!d || d.value == null) return params.name
|
||||
if (params.seriesType === 'effectScatter') {
|
||||
return `${params.name}<br/>热点指数 ${params.value?.[2] ?? '-'}`
|
||||
}
|
||||
return [
|
||||
`<div style="font-weight:600;margin-bottom:6px">${params.name}</div>`,
|
||||
`出货 ${formatCount(d.orderCount)}`,
|
||||
@ -161,9 +386,10 @@ const option = computed(() => {
|
||||
},
|
||||
geo: {
|
||||
map: 'china',
|
||||
roam: false,
|
||||
zoom: props.dense ? 1.08 : 1.15,
|
||||
roam: props.focused,
|
||||
zoom: props.focused ? 1.25 : props.dense ? 1.08 : 1.15,
|
||||
center: [105, 36],
|
||||
scaleLimit: props.focused ? { min: 0.8, max: 10 } : undefined,
|
||||
itemStyle: {
|
||||
areaColor: '#faf7f4',
|
||||
borderColor: 'rgba(217, 119, 80, 0.28)',
|
||||
@ -189,51 +415,7 @@ const option = computed(() => {
|
||||
]
|
||||
: [],
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'map',
|
||||
map: 'china',
|
||||
geoIndex: 0,
|
||||
data,
|
||||
selectedMode: false,
|
||||
},
|
||||
{
|
||||
type: 'effectScatter',
|
||||
coordinateSystem: 'geo',
|
||||
zlevel: 2,
|
||||
rippleEffect: { brushType: 'stroke', scale: 2.8, period: 4 },
|
||||
symbolSize(val: number[]) {
|
||||
return Math.max(5, Math.min(14, (val[2] || 0) / 8))
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#e8590c',
|
||||
shadowBlur: 8,
|
||||
shadowColor: 'rgba(232, 89, 12, 0.35)',
|
||||
},
|
||||
data: props.slice.cities.map((c) => ({
|
||||
name: c.name,
|
||||
value: c.value,
|
||||
})),
|
||||
},
|
||||
{
|
||||
type: 'lines',
|
||||
coordinateSystem: 'geo',
|
||||
zlevel: 1,
|
||||
effect: {
|
||||
show: true,
|
||||
period: 5,
|
||||
trailLength: 0.3,
|
||||
color: 'rgba(240, 101, 67, 0.75)',
|
||||
symbolSize: 2.5,
|
||||
},
|
||||
lineStyle: {
|
||||
color: 'rgba(240, 101, 67, 0.28)',
|
||||
width: 1,
|
||||
curveness: 0.15,
|
||||
},
|
||||
data: laneHints,
|
||||
},
|
||||
],
|
||||
series,
|
||||
}
|
||||
})
|
||||
|
||||
@ -254,20 +436,94 @@ function onClick(params: any) {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.china-map__label {
|
||||
.china-map__chrome {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 12px;
|
||||
z-index: 3;
|
||||
right: 12px;
|
||||
z-index: 4;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.china-map__label {
|
||||
pointer-events: none;
|
||||
|
||||
strong {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
font-weight: 650;
|
||||
color: #1a2e38;
|
||||
}
|
||||
}
|
||||
|
||||
.china-map__hint {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
font-size: 11px;
|
||||
color: rgba(26, 46, 56, 0.45);
|
||||
}
|
||||
|
||||
.china-map__actions {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.china-map__layers {
|
||||
display: inline-flex;
|
||||
gap: 4px;
|
||||
padding: 3px;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
border: 1px solid rgba(26, 46, 56, 0.08);
|
||||
}
|
||||
|
||||
.china-map__layer {
|
||||
height: 28px;
|
||||
padding: 0 10px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid transparent;
|
||||
background: transparent;
|
||||
font-size: 12px;
|
||||
color: rgba(26, 46, 56, 0.55);
|
||||
cursor: pointer;
|
||||
|
||||
&.is-on {
|
||||
background: rgba(29, 114, 129, 0.1);
|
||||
color: var(--app-primary-color, #1d7281);
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.china-map__btn {
|
||||
height: 28px;
|
||||
padding: 0 12px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid rgba(26, 46, 56, 0.08);
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
color: #1a2e38;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
border-color: rgba(29, 114, 129, 0.35);
|
||||
color: var(--app-primary-color, #1d7281);
|
||||
}
|
||||
|
||||
&--icon {
|
||||
width: 28px;
|
||||
padding: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.china-map__chart {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
@ -280,6 +536,12 @@ function onClick(params: any) {
|
||||
place-items: center;
|
||||
color: rgba(26, 46, 56, 0.4);
|
||||
font-size: 13px;
|
||||
|
||||
&.is-err {
|
||||
color: #c45c4a;
|
||||
padding: 24px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.china-map__metrics {
|
||||
@ -350,16 +612,16 @@ function onClick(params: any) {
|
||||
}
|
||||
|
||||
.china-map.is-dense {
|
||||
.china-map__label {
|
||||
.china-map__chrome {
|
||||
top: 8px;
|
||||
left: 10px;
|
||||
|
||||
strong {
|
||||
font-size: 12px;
|
||||
}
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.china-map__label strong {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 指标条改文档流,避免盖住华南;四等分便于点按切换热力 */
|
||||
.china-map__metrics {
|
||||
position: static;
|
||||
left: auto;
|
||||
@ -414,4 +676,11 @@ function onClick(params: any) {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.china-map.is-focus {
|
||||
.china-map__metrics {
|
||||
left: 12px;
|
||||
bottom: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -5,7 +5,9 @@
|
||||
:slice="slice"
|
||||
:selected-province="selectedProvince"
|
||||
:active-lane-ids="activeLaneIds"
|
||||
:expandable="true"
|
||||
@select-province="$emit('select-province', $event)"
|
||||
@expand="$emit('expand-china')"
|
||||
/>
|
||||
</div>
|
||||
<div class="ops-stage__pane ops-stage__pane--world">
|
||||
@ -14,9 +16,11 @@
|
||||
:selected-country="selectedCountry"
|
||||
:selected-lane-id="selectedLaneId"
|
||||
:latency-mode="latencyMode"
|
||||
:expandable="true"
|
||||
@select-country="$emit('select-country', $event)"
|
||||
@select-lane="$emit('select-lane', $event)"
|
||||
@drill-status="$emit('drill-status', $event)"
|
||||
@expand="$emit('expand-world')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -41,6 +45,8 @@ defineEmits<{
|
||||
(e: 'select-country', name: string | null): void
|
||||
(e: 'select-lane', id: string): void
|
||||
(e: 'drill-status', status: 'all' | 'predeclared' | 'pendingPayment' | 'pendingShip'): void
|
||||
(e: 'expand-world'): void
|
||||
(e: 'expand-china'): void
|
||||
}>()
|
||||
|
||||
const activeLaneIds = computed(() => {
|
||||
|
||||
353
src/views/home/workplace/biz-ops/UsDestDetailMap.vue
Normal file
353
src/views/home/workplace/biz-ops/UsDestDetailMap.vue
Normal file
@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<div class="us-map">
|
||||
<div class="us-map__chrome">
|
||||
<nav class="us-map__crumb" aria-label="地图层级">
|
||||
<button type="button" class="us-map__crumb-link" @click="$emit('back-world')">全球</button>
|
||||
<span class="us-map__crumb-sep">›</span>
|
||||
<strong>美国</strong>
|
||||
</nav>
|
||||
<div class="us-map__actions">
|
||||
<div class="us-map__layers" role="group" aria-label="图层">
|
||||
<button
|
||||
type="button"
|
||||
class="us-map__layer"
|
||||
:class="{ 'is-on': showZip }"
|
||||
@click="showZip = !showZip"
|
||||
>
|
||||
邮编分布
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="us-map__layer"
|
||||
:class="{ 'is-on': showPorts }"
|
||||
@click="showPorts = !showPorts"
|
||||
>
|
||||
港口
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="us-map__collapse" @click="$emit('collapse')">收起</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<VCharts v-if="ready" class="us-map__chart" :option="option" autoresize />
|
||||
<div v-else-if="loadError" class="us-map__loading is-err">{{ loadError }}</div>
|
||||
<div v-else class="us-map__loading">美国地图加载中…</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import '@/utils/echarts'
|
||||
import VCharts from 'vue-echarts'
|
||||
import { formatCount } from './mock/bizOpsMock'
|
||||
import {
|
||||
ensureUsaGeoMap,
|
||||
ensureUsOverlays,
|
||||
type UsPortPoint,
|
||||
type UsZip3Point,
|
||||
} from './useGeoMaps'
|
||||
|
||||
defineEmits<{
|
||||
(e: 'back-world'): void
|
||||
(e: 'collapse'): void
|
||||
}>()
|
||||
|
||||
const ready = ref(false)
|
||||
const loadError = ref('')
|
||||
const showZip = ref(true)
|
||||
const showPorts = ref(true)
|
||||
const ports = ref<UsPortPoint[]>([])
|
||||
const zip3 = ref<UsZip3Point[]>([])
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await ensureUsaGeoMap()
|
||||
const overlays = await ensureUsOverlays()
|
||||
ports.value = overlays.ports
|
||||
zip3.value = overlays.zip3
|
||||
ready.value = true
|
||||
} catch (err) {
|
||||
loadError.value = err instanceof Error ? err.message : '美国地图加载失败'
|
||||
}
|
||||
})
|
||||
|
||||
const option = computed(() => {
|
||||
const maxZip = Math.max(...zip3.value.map((z) => z.orderCount), 1)
|
||||
const series: Record<string, unknown>[] = [
|
||||
{
|
||||
type: 'map',
|
||||
map: 'usa',
|
||||
geoIndex: 0,
|
||||
data: [],
|
||||
silent: true,
|
||||
},
|
||||
]
|
||||
|
||||
if (showZip.value) {
|
||||
series.push({
|
||||
name: '邮编分布',
|
||||
type: 'scatter',
|
||||
coordinateSystem: 'geo',
|
||||
zlevel: 2,
|
||||
symbolSize(val: number[]) {
|
||||
const v = val?.[2] ?? 0
|
||||
return 6 + (v / maxZip) * 22
|
||||
},
|
||||
itemStyle: {
|
||||
color: 'rgba(232, 89, 12, 0.55)',
|
||||
borderColor: 'rgba(196, 65, 12, 0.35)',
|
||||
borderWidth: 0.5,
|
||||
},
|
||||
data: zip3.value.map((z) => ({
|
||||
name: z.zip3,
|
||||
value: [...z.coord, z.orderCount],
|
||||
labelName: z.name,
|
||||
orderCount: z.orderCount,
|
||||
})),
|
||||
})
|
||||
}
|
||||
|
||||
if (showPorts.value) {
|
||||
series.push({
|
||||
name: '港口',
|
||||
type: 'effectScatter',
|
||||
coordinateSystem: 'geo',
|
||||
zlevel: 3,
|
||||
rippleEffect: { brushType: 'stroke', scale: 2.6, period: 3.2 },
|
||||
symbolSize: 9,
|
||||
itemStyle: {
|
||||
color: '#1d7281',
|
||||
shadowBlur: 8,
|
||||
shadowColor: 'rgba(29, 114, 129, 0.35)',
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
formatter(params: any) {
|
||||
const d = params.data
|
||||
const zh = d?.nameZh || d?.name || params.name
|
||||
const code = d?.code || ''
|
||||
return code ? `${zh} ${code}` : zh
|
||||
},
|
||||
position: 'right',
|
||||
distance: 6,
|
||||
fontSize: 11,
|
||||
fontWeight: 600,
|
||||
color: 'rgba(26, 46, 56, 0.78)',
|
||||
textBorderColor: 'rgba(255,255,255,0.92)',
|
||||
textBorderWidth: 2,
|
||||
},
|
||||
data: ports.value.map((p) => ({
|
||||
name: p.nameZh || p.name,
|
||||
nameZh: p.nameZh || p.name,
|
||||
nameEn: p.name,
|
||||
value: [...p.coord, 1],
|
||||
code: p.code,
|
||||
locode: p.locode,
|
||||
portType: p.type,
|
||||
})),
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
backgroundColor: 'transparent',
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
backgroundColor: 'rgba(255,255,255,0.96)',
|
||||
borderColor: 'rgba(29, 114, 129, 0.2)',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#1a2e38', fontSize: 12 },
|
||||
formatter(params: any) {
|
||||
if (params.seriesName === '港口') {
|
||||
const d = params.data
|
||||
return [
|
||||
`<div style="font-weight:600;margin-bottom:4px">${d?.nameZh || d?.name || params.name}</div>`,
|
||||
`${d?.nameEn || ''}`,
|
||||
`港码 ${d?.code || '—'} · LOCODE ${d?.locode || '—'}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join('<br/>')
|
||||
}
|
||||
if (params.seriesName === '邮编分布') {
|
||||
const d = params.data
|
||||
return [
|
||||
`<div style="font-weight:600;margin-bottom:4px">ZIP3 ${d?.name}</div>`,
|
||||
`${d?.labelName || ''}`,
|
||||
`单量 ${formatCount(d?.orderCount || 0)}(演示)`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join('<br/>')
|
||||
}
|
||||
return params.name
|
||||
},
|
||||
},
|
||||
visualMap: showZip.value
|
||||
? {
|
||||
show: true,
|
||||
min: 0,
|
||||
max: maxZip,
|
||||
seriesIndex: 1,
|
||||
orient: 'vertical',
|
||||
right: 12,
|
||||
bottom: 16,
|
||||
itemWidth: 8,
|
||||
itemHeight: 72,
|
||||
text: ['高', '低'],
|
||||
textStyle: { color: 'rgba(26,46,56,0.45)', fontSize: 10 },
|
||||
inRange: {
|
||||
color: ['#fff5eb', '#ffd8a8', '#ff922b', '#f76707', '#d9480f'],
|
||||
},
|
||||
}
|
||||
: { show: false },
|
||||
geo: {
|
||||
map: 'usa',
|
||||
roam: true,
|
||||
zoom: 1.15,
|
||||
center: [-98.5, 39.5],
|
||||
scaleLimit: { min: 0.8, max: 8 },
|
||||
itemStyle: {
|
||||
areaColor: '#faf7f4',
|
||||
borderColor: 'rgba(29, 114, 129, 0.22)',
|
||||
borderWidth: 0.7,
|
||||
},
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
areaColor: '#e6f4f6',
|
||||
borderColor: '#1d7281',
|
||||
},
|
||||
label: { show: false },
|
||||
},
|
||||
},
|
||||
series,
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.us-map {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.us-map__chrome {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 12px;
|
||||
right: 12px;
|
||||
z-index: 4;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.us-map__crumb,
|
||||
.us-map__actions,
|
||||
.us-map__layers,
|
||||
.us-map__layer,
|
||||
.us-map__collapse,
|
||||
.us-map__crumb-link {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.us-map__crumb {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 6px 10px;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
border: 1px solid rgba(26, 46, 56, 0.08);
|
||||
font-size: 12px;
|
||||
color: #1a2e38;
|
||||
|
||||
strong {
|
||||
font-weight: 650;
|
||||
}
|
||||
}
|
||||
|
||||
.us-map__crumb-link {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: var(--app-primary-color, #1d7281);
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.us-map__crumb-sep {
|
||||
color: rgba(26, 46, 56, 0.35);
|
||||
}
|
||||
|
||||
.us-map__actions {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.us-map__layers {
|
||||
display: inline-flex;
|
||||
gap: 4px;
|
||||
padding: 3px;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
border: 1px solid rgba(26, 46, 56, 0.08);
|
||||
}
|
||||
|
||||
.us-map__layer,
|
||||
.us-map__collapse {
|
||||
height: 28px;
|
||||
padding: 0 10px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid transparent;
|
||||
background: transparent;
|
||||
font-size: 12px;
|
||||
color: rgba(26, 46, 56, 0.55);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.us-map__layer.is-on {
|
||||
background: rgba(29, 114, 129, 0.1);
|
||||
color: var(--app-primary-color, #1d7281);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.us-map__collapse {
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
border-color: rgba(26, 46, 56, 0.08);
|
||||
color: #1a2e38;
|
||||
|
||||
&:hover {
|
||||
border-color: rgba(29, 114, 129, 0.35);
|
||||
color: var(--app-primary-color, #1d7281);
|
||||
}
|
||||
}
|
||||
|
||||
.us-map__chart {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.us-map__loading {
|
||||
flex: 1;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
color: rgba(26, 46, 56, 0.4);
|
||||
font-size: 13px;
|
||||
|
||||
&.is-err {
|
||||
color: #c45c4a;
|
||||
padding: 24px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,7 +1,30 @@
|
||||
<template>
|
||||
<div class="world-map" :class="{ 'is-dense': dense }">
|
||||
<div class="world-map__label">
|
||||
<strong>全球 · 目的国分布</strong>
|
||||
<div class="world-map" :class="{ 'is-dense': dense, 'is-focus': focused }">
|
||||
<div class="world-map__chrome">
|
||||
<div class="world-map__label">
|
||||
<strong>全球 · 目的国分布</strong>
|
||||
<span v-if="focused" class="world-map__hint">滚轮缩放 · 拖拽平移 · 点击美国下钻</span>
|
||||
</div>
|
||||
<div class="world-map__actions">
|
||||
<button
|
||||
v-if="expandable && !focused"
|
||||
type="button"
|
||||
class="world-map__btn world-map__btn--icon"
|
||||
title="放大查看"
|
||||
aria-label="放大查看"
|
||||
@click="$emit('expand')"
|
||||
>
|
||||
<IconEye :size="14" />
|
||||
</button>
|
||||
<button
|
||||
v-if="focused"
|
||||
type="button"
|
||||
class="world-map__btn"
|
||||
@click="$emit('collapse')"
|
||||
>
|
||||
收起
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<VCharts
|
||||
v-if="ready"
|
||||
@ -28,12 +51,15 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { IconEye } from '@arco-design/web-vue/es/icon'
|
||||
import '@/utils/echarts'
|
||||
import VCharts from 'vue-echarts'
|
||||
import { formatCount, formatDays, formatMoney, latencyColor } from './mock/bizOpsMock'
|
||||
import type { BizOpsSlice, LatencyMode } from './types'
|
||||
import { ensureGeoMaps } from './useGeoMaps'
|
||||
|
||||
const US_WORLD_NAMES = new Set(['United States', 'United States of America', 'USA'])
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
slice: BizOpsSlice
|
||||
@ -42,14 +68,21 @@ const props = withDefaults(
|
||||
latencyMode: LatencyMode
|
||||
/** 手机端紧凑:缩小图例与指标条 */
|
||||
dense?: boolean
|
||||
/** 全屏态:开启 roam,点击美国触发下钻 */
|
||||
focused?: boolean
|
||||
/** 总览小窗显示「放大」 */
|
||||
expandable?: boolean
|
||||
}>(),
|
||||
{ dense: false },
|
||||
{ dense: false, focused: false, expandable: true },
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'select-country', name: string | null): void
|
||||
(e: 'select-lane', id: string): void
|
||||
(e: 'drill-status', status: 'all' | 'predeclared' | 'pendingPayment' | 'pendingShip'): void
|
||||
(e: 'expand'): void
|
||||
(e: 'collapse'): void
|
||||
(e: 'drill-us'): void
|
||||
}>()
|
||||
|
||||
const statusItems = computed(() => {
|
||||
@ -126,11 +159,15 @@ const option = computed(() => {
|
||||
}
|
||||
const d = params.data
|
||||
if (!d || d.value == null) return params.name
|
||||
return [
|
||||
const tip = [
|
||||
`<div style="font-weight:600;margin-bottom:6px">${d.nameZh || params.name}</div>`,
|
||||
`收件 ${formatCount(d.value)}`,
|
||||
`均时 ${formatDays(d.avgDays)} · 成功率 ${(d.successRate * 100).toFixed(1)}%`,
|
||||
].join('<br/>')
|
||||
]
|
||||
if (props.focused && US_WORLD_NAMES.has(params.name)) {
|
||||
tip.push('<span style="color:#1d7281">点击进入美国邮编 / 港口</span>')
|
||||
}
|
||||
return tip.join('<br/>')
|
||||
},
|
||||
},
|
||||
visualMap: {
|
||||
@ -151,9 +188,10 @@ const option = computed(() => {
|
||||
},
|
||||
geo: {
|
||||
map: 'world',
|
||||
roam: false,
|
||||
zoom: props.dense ? 1.0 : 1.05,
|
||||
roam: props.focused,
|
||||
zoom: props.focused ? 1.2 : props.dense ? 1.0 : 1.05,
|
||||
center: [12, 16],
|
||||
scaleLimit: props.focused ? { min: 0.8, max: 12 } : undefined,
|
||||
itemStyle: {
|
||||
areaColor: '#faf7f4',
|
||||
borderColor: 'rgba(217, 119, 80, 0.22)',
|
||||
@ -228,6 +266,11 @@ function onClick(params: any) {
|
||||
return
|
||||
}
|
||||
if (params?.componentSubType === 'map' && params.name) {
|
||||
if (props.focused && US_WORLD_NAMES.has(params.name)) {
|
||||
emit('select-country', params.name)
|
||||
emit('drill-us')
|
||||
return
|
||||
}
|
||||
const next = props.selectedCountry === params.name ? null : params.name
|
||||
emit('select-country', next)
|
||||
}
|
||||
@ -243,20 +286,65 @@ function onClick(params: any) {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.world-map__label {
|
||||
.world-map__chrome {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 12px;
|
||||
z-index: 3;
|
||||
right: 12px;
|
||||
z-index: 4;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.world-map__label {
|
||||
pointer-events: none;
|
||||
|
||||
strong {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
font-weight: 650;
|
||||
color: #1a2e38;
|
||||
}
|
||||
}
|
||||
|
||||
.world-map__hint {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
font-size: 11px;
|
||||
color: rgba(26, 46, 56, 0.45);
|
||||
}
|
||||
|
||||
.world-map__actions {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.world-map__btn {
|
||||
height: 28px;
|
||||
padding: 0 12px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid rgba(26, 46, 56, 0.08);
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
color: #1a2e38;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
border-color: rgba(29, 114, 129, 0.35);
|
||||
color: var(--app-primary-color, #1d7281);
|
||||
}
|
||||
|
||||
&--icon {
|
||||
width: 28px;
|
||||
padding: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.world-map__chart {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
@ -325,13 +413,14 @@ function onClick(params: any) {
|
||||
}
|
||||
|
||||
.world-map.is-dense {
|
||||
.world-map__label {
|
||||
.world-map__chrome {
|
||||
top: 8px;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
strong {
|
||||
font-size: 12px;
|
||||
}
|
||||
.world-map__label strong {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.world-map__metrics {
|
||||
@ -357,4 +446,11 @@ function onClick(params: any) {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
.world-map.is-focus {
|
||||
.world-map__metrics {
|
||||
left: 12px;
|
||||
bottom: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -3,6 +3,58 @@ import { registerMap } from 'echarts/core'
|
||||
let loading: Promise<void> | null = null
|
||||
let ready = false
|
||||
|
||||
let usaLoading: Promise<void> | null = null
|
||||
let usaReady = false
|
||||
|
||||
let overlayLoading: Promise<{
|
||||
ports: UsPortPoint[]
|
||||
zip3: UsZip3Point[]
|
||||
}> | null = null
|
||||
let overlays: { ports: UsPortPoint[]; zip3: UsZip3Point[] } | null = null
|
||||
|
||||
let cnOverlayLoading: Promise<{
|
||||
ports: CnPortPoint[]
|
||||
cities: CnCityPoint[]
|
||||
}> | null = null
|
||||
let cnOverlays: { ports: CnPortPoint[]; cities: CnCityPoint[] } | null = null
|
||||
|
||||
export interface UsPortPoint {
|
||||
name: string
|
||||
/** 中文港名 */
|
||||
nameZh: string
|
||||
/** 三字母港码,如 LAX / NYC */
|
||||
code: string
|
||||
/** UN/LOCODE,如 USLAX */
|
||||
locode?: string
|
||||
type: string
|
||||
coord: [number, number]
|
||||
}
|
||||
|
||||
export interface UsZip3Point {
|
||||
zip3: string
|
||||
name: string
|
||||
coord: [number, number]
|
||||
orderCount: number
|
||||
}
|
||||
|
||||
export interface CnPortPoint {
|
||||
name: string
|
||||
nameZh: string
|
||||
/** 三字母港码,如 SHA / PVG / YTN */
|
||||
code: string
|
||||
locode?: string
|
||||
/** sea | air */
|
||||
type: string
|
||||
coord: [number, number]
|
||||
}
|
||||
|
||||
export interface CnCityPoint {
|
||||
name: string
|
||||
province: string
|
||||
coord: [number, number]
|
||||
orderCount: number
|
||||
}
|
||||
|
||||
async function fetchJson(url: string) {
|
||||
const res = await fetch(url)
|
||||
if (!res.ok) throw new Error(`Failed to load ${url}`)
|
||||
@ -13,10 +65,7 @@ async function fetchJson(url: string) {
|
||||
export function ensureGeoMaps(): Promise<void> {
|
||||
if (ready) return Promise.resolve()
|
||||
if (loading) return loading
|
||||
loading = Promise.all([
|
||||
fetchJson('/geo/china.json'),
|
||||
fetchJson('/geo/world.json'),
|
||||
])
|
||||
loading = Promise.all([fetchJson('/geo/china.json'), fetchJson('/geo/world.json')])
|
||||
.then(([china, world]) => {
|
||||
registerMap('china', china)
|
||||
registerMap('world', world)
|
||||
@ -29,6 +78,70 @@ export function ensureGeoMaps(): Promise<void> {
|
||||
return loading
|
||||
}
|
||||
|
||||
/** 懒加载美国州级底图(进入下钻时再拉) */
|
||||
export function ensureUsaGeoMap(): Promise<void> {
|
||||
if (usaReady) return Promise.resolve()
|
||||
if (usaLoading) return usaLoading
|
||||
usaLoading = fetchJson('/geo/usa.json')
|
||||
.then((usa) => {
|
||||
registerMap('usa', usa)
|
||||
usaReady = true
|
||||
})
|
||||
.catch((err) => {
|
||||
usaLoading = null
|
||||
throw err
|
||||
})
|
||||
return usaLoading
|
||||
}
|
||||
|
||||
/** 懒加载美国港口 + ZIP3 mock 叠加层 */
|
||||
export function ensureUsOverlays(): Promise<{ ports: UsPortPoint[]; zip3: UsZip3Point[] }> {
|
||||
if (overlays) return Promise.resolve(overlays)
|
||||
if (overlayLoading) return overlayLoading
|
||||
overlayLoading = Promise.all([
|
||||
fetchJson('/geo/us-ports.json'),
|
||||
fetchJson('/geo/us-zip3-mock.json'),
|
||||
])
|
||||
.then(([ports, zip3]) => {
|
||||
overlays = {
|
||||
ports: Array.isArray(ports) ? ports : [],
|
||||
zip3: Array.isArray(zip3) ? zip3 : [],
|
||||
}
|
||||
return overlays
|
||||
})
|
||||
.catch((err) => {
|
||||
overlayLoading = null
|
||||
throw err
|
||||
})
|
||||
return overlayLoading
|
||||
}
|
||||
|
||||
/** 懒加载中国港口 + 城市 mock(放大态叠加;城市优先用业务 slice) */
|
||||
export function ensureCnOverlays(): Promise<{ ports: CnPortPoint[]; cities: CnCityPoint[] }> {
|
||||
if (cnOverlays) return Promise.resolve(cnOverlays)
|
||||
if (cnOverlayLoading) return cnOverlayLoading
|
||||
cnOverlayLoading = Promise.all([
|
||||
fetchJson('/geo/cn-ports.json'),
|
||||
fetchJson('/geo/cn-cities-mock.json'),
|
||||
])
|
||||
.then(([ports, cities]) => {
|
||||
cnOverlays = {
|
||||
ports: Array.isArray(ports) ? ports : [],
|
||||
cities: Array.isArray(cities) ? cities : [],
|
||||
}
|
||||
return cnOverlays
|
||||
})
|
||||
.catch((err) => {
|
||||
cnOverlayLoading = null
|
||||
throw err
|
||||
})
|
||||
return cnOverlayLoading
|
||||
}
|
||||
|
||||
export function geoMapsReady() {
|
||||
return ready
|
||||
}
|
||||
|
||||
export function usaGeoMapReady() {
|
||||
return usaReady
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
const { role, roles, roleMeta, percent, doneCount, totalCount } = useTrainingProgress()
|
||||
|
||||
const weekLabel: Record<string, string> = {
|
||||
basics: '物流基础',
|
||||
week1: '第1周',
|
||||
week2: '第2周',
|
||||
week3: '第3周',
|
||||
|
||||
@ -1,4 +1,11 @@
|
||||
export type TrainingWeekKey = 'week1' | 'week2' | 'week3' | 'week4' | 'practice' | 'exam'
|
||||
export type TrainingWeekKey =
|
||||
| 'basics'
|
||||
| 'week1'
|
||||
| 'week2'
|
||||
| 'week3'
|
||||
| 'week4'
|
||||
| 'practice'
|
||||
| 'exam'
|
||||
export type TrainingRoleKey = 'all' | 'ops' | 'cs' | 'warehouse' | 'finance' | 'implement'
|
||||
|
||||
export interface TrainingChecklistItem {
|
||||
@ -44,15 +51,42 @@ export const TRAINING_ROLES: { key: TrainingRoleKey; label: string; summary: str
|
||||
|
||||
/** 岗位建议学习的周次(用于课表提示) */
|
||||
export const ROLE_WEEK_FOCUS: Record<TrainingRoleKey, TrainingWeekKey[]> = {
|
||||
all: ['week1', 'week2', 'week3', 'week4', 'practice', 'exam'],
|
||||
ops: ['week1', 'week2', 'week3', 'practice', 'exam'],
|
||||
cs: ['week1', 'week3', 'week4', 'practice', 'exam'],
|
||||
warehouse: ['week1', 'week3', 'practice', 'exam'],
|
||||
finance: ['week1', 'week3', 'practice', 'exam'],
|
||||
implement: ['week1', 'week4', 'practice', 'exam'],
|
||||
all: ['basics', 'week1', 'week2', 'week3', 'week4', 'practice', 'exam'],
|
||||
ops: ['basics', 'week1', 'week2', 'week3', 'practice', 'exam'],
|
||||
cs: ['basics', 'week1', 'week3', 'week4', 'practice', 'exam'],
|
||||
warehouse: ['basics', 'week1', 'week3', 'practice', 'exam'],
|
||||
finance: ['basics', 'week1', 'week3', 'practice', 'exam'],
|
||||
implement: ['basics', 'week1', 'week4', 'practice', 'exam'],
|
||||
}
|
||||
|
||||
export const CHECKLIST_ITEMS: TrainingChecklistItem[] = [
|
||||
// 物流基础(按手册 ①~⑤ 脉络勾;正文含完整细表)
|
||||
{
|
||||
id: 'basics.chargeable',
|
||||
week: 'basics',
|
||||
label: '① 会口述实重/体积重/计费重;能说明 1 立方≈167kg(6000)与 200kg(5000)',
|
||||
},
|
||||
{
|
||||
id: 'basics.air',
|
||||
week: 'basics',
|
||||
label: '② 能分清四种运力;认得低/中/高板与 H1、Q6、Q7 等简码,知约 1.6m 腹舱限高',
|
||||
},
|
||||
{
|
||||
id: 'basics.cargo-type',
|
||||
week: 'basics',
|
||||
label: '③ 询价 6 问会开口;能对照货型表说托盘/带电/液体注意点',
|
||||
},
|
||||
{
|
||||
id: 'basics.eu-us',
|
||||
week: 'basics',
|
||||
label: '④ 认得必认口岸;能翻完整航司表说出 CA/MU/CZ/CK/CX/QR/EK/FedEx 等',
|
||||
},
|
||||
{
|
||||
id: 'basics.choose',
|
||||
week: 'basics',
|
||||
label: '⑤ 能按场景选型,并口述四类运力优劣与周班量级(非承诺时效)',
|
||||
},
|
||||
|
||||
// 练习包
|
||||
{ id: 'practice.customer-register', week: 'practice', label: '测服自行注册客户账号(网页端 /login)' },
|
||||
{ id: 'practice.admin-access', week: 'practice', label: '拿到或申请运营端账号(/admin),权限含订单/渠道/轨迹' },
|
||||
|
||||
591
src/views/kb/training/handbook-basics.md
Normal file
591
src/views/kb/training/handbook-basics.md
Normal file
@ -0,0 +1,591 @@
|
||||
# 物流基础(入职必读)
|
||||
|
||||
你好。这页不教点哪个按钮,只帮你建立 **出门不怕听不懂** 的常识。
|
||||
|
||||
读完你应该能:
|
||||
|
||||
1. 跟客户说清:钱为什么按 **计费重**,不是只看秤
|
||||
2. 听懂同事说:货机 / 腹舱、直飞 / 中转、口岸与航司代码
|
||||
3. 心里有数:什么货更适合哪类运力,航司大致优劣与周班量级
|
||||
|
||||
细规则以销售产品、禁运表、航司当日班期为准;本页是行业白话,方便对客、对下游对齐口径。
|
||||
|
||||
---
|
||||
|
||||
## 怎么读(建议先扫地图,再按序往下)
|
||||
|
||||
| 顺序 | 章节 | 你先抓住什么 | 阅读提示 |
|
||||
|------|------|--------------|----------|
|
||||
| ① | 钱从哪来 | 三个重量 + **1 立方怎么折公斤** + 手算 | **必读** |
|
||||
| ② | 货怎么上天 | 四种运力 + **打板 / ULD** + 常用词 | **必读** |
|
||||
| ③ | 什么货能走 | 询价 6 问 + 货型表 | **必读** |
|
||||
| ④ | 飞欧美代码与航司 | 必认代码 → 完整航司表 | 先记必认,细表可翻阅 |
|
||||
| ⑤ | 优劣 / 选型 / 周班 | 怎么选 + 量级 | 与④一起读 |
|
||||
| ⑥ | 接到 OMS | 回哪学系统 | 1 分钟 |
|
||||
|
||||
带教周五口述:页末 **自测题** 即可。下面正文 **不删细节**,只是按这条线排好,方便从头读或按需检索。
|
||||
|
||||
---
|
||||
|
||||
## ① 钱从哪来:三个重量
|
||||
|
||||
客户常问:「箱子才 12 公斤,怎么按 20 公斤收?」——因为飞机既怕 **超重**,也怕 **轻泡货占满舱**。
|
||||
|
||||
| 名词 | 白话 | 怎么来 |
|
||||
|------|------|--------|
|
||||
| **实重(毛重)** | 秤上的重量 | 含包装,单位 kg |
|
||||
| **体积重(泡重)** | 占多少舱位「折算」成的重量 | 长×宽×高 ÷ **体积系数** |
|
||||
| **计费重** | 真正用来查价/开票的重量 | 一般取 **实重与体积重较大者**,再按进位规则处理 |
|
||||
|
||||
**为什么要有体积重?**
|
||||
轻但很大的箱子,按体积收费才公平。
|
||||
|
||||
**口诀:** 重货看秤,泡货看方;**谁大按谁收**。
|
||||
|
||||
### 体积重公式
|
||||
|
||||
```
|
||||
体积重(kg)= 长(cm)× 宽(cm)× 高(cm)÷ 体积系数
|
||||
计费重 = max(实重,体积重)→ 再按产品进位(常见 0.5kg / 1kg)
|
||||
```
|
||||
|
||||
量尺寸:量 **外箱最大外径**(含凸出、缠膜、托盘底座)。多件时要看线路是「**逐件取大再汇总**」还是「**整票总实重 vs 总体积重**」——两种结果可能差很多。
|
||||
|
||||
### 体积系数(泡比 / 除数)常见值
|
||||
|
||||
| 场景 | 常用系数 | 1 立方米大约折算 |
|
||||
|------|----------|------------------|
|
||||
| 国际航空货运(货代空运) | **6000** | ≈ **167 kg** |
|
||||
| 国际快递(DHL / FedEx / UPS 等) | **5000** | = **200 kg** |
|
||||
| 部分专线 / 自定规则 | 6000、7000… | 以产品配置为准 |
|
||||
|
||||
系数 **越小**,同样箱子算出的体积重 **越大**,越「贵」。
|
||||
OMS 里这条叫 **计重规则**,挂在销售产品上;第 2 周会练手算。
|
||||
|
||||
### 为什么说「1 立方 ≈ 167 kg」?(把系数讲透)
|
||||
|
||||
**1 立方米(1 CBM)** = 100 cm × 100 cm × 100 cm = **1,000,000 立方厘米**。
|
||||
|
||||
| 系数 | 怎么折 | 行业口语 |
|
||||
|------|--------|----------|
|
||||
| ÷ **6000** | 1,000,000 ÷ 6000 ≈ **166.67** → 常说 **167 kg** | 「空运按 1:167」或「1 方按 167 公斤」 |
|
||||
| ÷ **5000** | 1,000,000 ÷ 5000 = **200** | 「快递按 1:200」或「1 方按 200 公斤」 |
|
||||
|
||||
所以这两句话是 **同一件事** 的两种说法:
|
||||
|
||||
- 说「系数 6000」→ 用长宽高(cm)去除
|
||||
- 说「1 立方 = 167 kg」→ 先算立方米,再 ×167
|
||||
|
||||
```
|
||||
体积重 ≈ 体积(立方米)× 167 (空运 / 6000)
|
||||
体积重 ≈ 体积(立方米)× 200 (快递 / 5000)
|
||||
```
|
||||
|
||||
**密度直觉(对内很好用):**
|
||||
|
||||
| 货物实际密度大概 | 按 6000(167)怎么计费 |
|
||||
|------------------|------------------------|
|
||||
| 每立方 **重于** 约 167 kg(实心、五金等) | 多半 **按实重**(重货) |
|
||||
| 每立方 **轻于** 约 167 kg(泡沫、家具、灯具等) | 多半 **按体积重**(泡货) |
|
||||
|
||||
快递用 200:临界密度更高,同样泡货更容易「按方折成更重」。
|
||||
|
||||
和别的运输方式比一眼(只建立感觉):
|
||||
|
||||
| 方式 | 常见口语 | 含义粗解 |
|
||||
|------|----------|----------|
|
||||
| 空运货代 | 1 CBM ≈ 167 kg | 空间折算较「松」于快递 |
|
||||
| 国际快递 | 1 CBM = 200 kg | 同体积折算更重 |
|
||||
| 卡航 / 部分陆运 | 有时听 1 CBM ≈ 333 kg 等 | 规则完全不同,别和空运混用 |
|
||||
| 海运拼箱 | 常按 **W/M**(吨与立方取大,1 方≈1 吨量级) | 和空运计费逻辑不一样 |
|
||||
|
||||
**小例子:** 货 0.5 立方、实重 40 kg → 空运体积重约 0.5×167 ≈ **83.5 kg** → 计费重约 **84**(再进位);若实重 100 kg → 按 **100**(重货)。
|
||||
|
||||
### 课堂例(请自己算一遍)
|
||||
|
||||
箱子 **60×50×40 cm**,实重 **12 kg**:
|
||||
|
||||
| 系数 | 体积重 | 计费重 |
|
||||
|------|--------|--------|
|
||||
| 6000(空运常见) | 60×50×40÷6000 = **20** kg | **20** kg(泡货) |
|
||||
| 5000(快递常见) | 60×50×40÷5000 = **24** kg | **24** kg |
|
||||
|
||||
再换一票:同尺寸但实重 **25 kg** → 体积重仍是 20/24,计费重变成 **25 kg**(重货按实重)。
|
||||
|
||||
### 轻重货、进位、最低计费
|
||||
|
||||
| 概念 | 要记住什么 |
|
||||
|------|------------|
|
||||
| **重货** | 实重 ≥ 体积重 → 按实重 |
|
||||
| **泡货 / 轻货** | 体积重 > 实重 → 按体积重 |
|
||||
| **进位** | 如 1.21 → 1.5(0.5kg 进位)或 2(1kg 进位),以产品规则为准 |
|
||||
| **最低计费重** | 空运常见有起步重量(如按票最低若干 kg),小件可能不够一票门槛 |
|
||||
| **预报 vs 入库** | 预报用客户填的件重尺;入库用仓库实测 → 费用可能变(正常) |
|
||||
|
||||
**对客一句:**
|
||||
「运费按计费重,不是只看秤重;体积大的货按体积重计,入库以仓库实测为准。」
|
||||
|
||||
和 OMS 的关系:查价/预报估一笔;入库重算后才是催付依据。详见「算账」Tab。
|
||||
|
||||
---
|
||||
|
||||
## ② 货怎么上天:四种运力
|
||||
|
||||
别一上来背几十个航司。先认清 **路怎么走**:
|
||||
|
||||
```
|
||||
客户货 ──┬─ 国际快递(门到门,品牌网络)
|
||||
├─ 全货机干线(机场到机场,载量大)
|
||||
├─ 客机腹舱(客机肚子带货,班次密但舱小)
|
||||
└─ 经枢纽中转(多飞一段,换舱位 / 价格)
|
||||
```
|
||||
|
||||
### 先分清两种「空运」说法
|
||||
|
||||
| | **航空货运(货代 / 空运专线)** | **国际快递** |
|
||||
|--|--------------------------------|--------------|
|
||||
| 典型 | 机场到机场 + 清关派送 | 门到门(DHL/FedEx/UPS 等) |
|
||||
| 单据 | 空运提单 **AWB** | 快递运单 |
|
||||
| 体积系数 | 多按 **6000** | 多按 **5000** |
|
||||
| 舱位 | 订舱、打板、跟航班 | 走快递自有网络/合作航司 |
|
||||
| 适合 | 较大货量、可议价 | 小件、时效稳、操作简单 |
|
||||
|
||||
### 客机腹舱 vs 全货机
|
||||
|
||||
| | **客机腹舱** | **全货机** |
|
||||
|--|--------------|------------|
|
||||
| 是什么 | 客机肚子里带货 | 专门运货的飞机(如 777F、747F) |
|
||||
| 优点 | 班次多、部分航线密 | 载量大、超大件/部分特货更友好 |
|
||||
| 注意 | 单件尺寸/重量限制更严;客运旺季舱紧 | 班期相对固定,订舱要盯板位 |
|
||||
|
||||
### 四种运力对照(一张表记住)
|
||||
|
||||
| | **国际快递** | **全货机** | **客机腹舱** | **中转** |
|
||||
|--|--------------|------------|--------------|----------|
|
||||
| 像什么 | 上门收派的国际件 | 专门运货的飞机 | 顺路塞进客机肚子 | 换飞机再飞 |
|
||||
| 计费直觉 | 常 **5000** | 常 **6000** | 随方案 | 随方案 |
|
||||
| 适合 | 小件、要好查 | 大货、重货、托盘 | 急、小、尺寸合规 | 直飞舱紧时的备选 |
|
||||
| 代价 | 常更贵、附加费多 | 要订舱;末端常另配 | 舱小、限尺寸 | 多 1~3 天风险 |
|
||||
|
||||
**直飞 vs 中转:** 中转常多 **1~3 天**,但能绕开「有价无舱」。
|
||||
|
||||
### 新人常听的词
|
||||
|
||||
| 词 | 白话 |
|
||||
|----|------|
|
||||
| **口岸 / 始发港** | 国内哪个机场出港(PVG 上海浦东、CAN 广州、SZX 深圳等) |
|
||||
| **目的港** | 到哪落地再清关分拨(LAX、JFK、FRA、AMS…) |
|
||||
| **直飞** | 国内口岸 → 目的港,少中转 |
|
||||
| **中转** | 经 HKG / ICN / DOH / DXB 等枢纽再飞,时效多 1~3 天不等 |
|
||||
| **打板 / ULD** | 把货装到航空集装板或集装箱上再上机(详见下一小节) |
|
||||
| **舱位 / BSA** | 向航司锁定的运力;旺季「有舱」比「有价」更关键 |
|
||||
| **燃油附加费** | 随油价浮动,常与基础运费分开列 |
|
||||
| **散货 / 交散** | 未打成整板,按件交货站再拼板 |
|
||||
| **包板 / 板位** | 货代向航司按「板」买舱,再分销给客户 |
|
||||
|
||||
### 打板是什么?(空运必懂)
|
||||
|
||||
快递小件多半 **不用你关心打板**;走 **航空货运 / 专线货机** 时,同事常说「进仓打板」「有没有板位」——指的是把货装进飞机用的标准载具。
|
||||
|
||||
**ULD(Unit Load Device)** = 航空集装器,两大类:
|
||||
|
||||
| 类型 | 长什么样 | 适合什么 |
|
||||
|------|----------|----------|
|
||||
| **集装板(Pallet)** | 铝合金平板 + **网套(Net)** 罩住绑牢 | 托盘货、大件、重货、异形(高度按舱位限) |
|
||||
| **集装箱(Container)** | 封闭/半封闭箱子(有的带斜角贴合腹舱) | 高价值、怕湿怕盗、散乱小纸箱 |
|
||||
|
||||
#### 业务里怎么说板型?(先认简码:高板 / 低板 / H1 / Q6…)
|
||||
|
||||
日常订舱、对内沟通,**很少只说 PMC**,更常说:
|
||||
|
||||
> 「这票打 **低板**」「要一张 **H1**」「主舱 **Q6 / Q7 高板**」
|
||||
|
||||
先分清两层(新人最容易混):
|
||||
|
||||
| 层级 | 说的是什么 | 例子 |
|
||||
|------|------------|------|
|
||||
| **底板 / 载具** | 铝板或箱子「长什么样」 | PMC、PAG、AKE(LD3) |
|
||||
| **轮廓 / 板型简码** | 这板 **允许打多高、什么舱** | 低板、中板、高板;**LD / H1 / H2 / A2 / Q6 / Q7** |
|
||||
|
||||
**同一块 PMC 底板,可以打成低板,也可以打成高板**——限高看的是 **轮廓简码**,不是底板三个字母本身。
|
||||
|
||||
##### 1)口语:低板 · 中板 · 高板
|
||||
|
||||
| 口语 | 大概限高 | 常见轮廓简码 | 多在哪 | 新人怎么记 |
|
||||
|------|----------|--------------|--------|------------|
|
||||
| **低板** | 约 **1.60~1.63 m**(常说 160/163) | **LD**;货代口语还有 **H1 / H2 / A2** 等 | 客机 **下舱 / 腹舱** 为主 | 「过不了约 1.6 m 就上不了低板」 |
|
||||
| **中板** | 约 **2.44 m**(常说 244) | **Q6** | 货机 **主舱** 常见 | 「标准主舱平高」 |
|
||||
| **高板** | 约 **2.9~3.0 m**(常说 290/300) | **Q7**(有的还说 Q7D、超高) | 货机主舱全高位 | 「再高要确认机型能不能收」 |
|
||||
|
||||
体积直觉(PMC 底板、培训用,实际看货形与收口):
|
||||
|
||||
| 口语 / 简码 | 底板约(长×宽) | 高约 | 大约能装 |
|
||||
|-------------|-----------------|------|----------|
|
||||
| 低板 LD / H1·H2·A2 一类 | 约 318×244 cm | ≈1.60 m | 约 **8~12 方** |
|
||||
| 中板 Q6 | 约 318×244 cm | ≈2.44 m | 约 **15~19 方** |
|
||||
| 高板 Q7 | 约 318×244 cm | ≈2.99~3.00 m | 约 **20~23 方** |
|
||||
|
||||
> **H1 / H2 / A2**:国内货代报价、订舱里很常见的 **低板轮廓简码**,高度多在 **≈1.6 m** 这一档;具体容积、是否收口,**各航司/庄家表可能略有差别**,以订舱确认的轮廓为准。
|
||||
> 国际材料里低板也常直接写 **LD**;主舱写 **Q6 / Q7**——和「中板 / 高板」是同一套高度逻辑。
|
||||
|
||||
##### 2)轮廓简码速查(听得懂就行)
|
||||
|
||||
| 简码 | 大约高度 | 常对应口语 | 备注 |
|
||||
|------|----------|------------|------|
|
||||
| **LD** | ≈1.63 m | 低板 | 下舱标准轮廓 |
|
||||
| **H1 / H2 / A2** 等 | ≈1.60 m | 低板 | 货代侧常用代号,对表时问清是哪家的 |
|
||||
| **Q6** | ≈2.44 m | 中板 | 主舱「箱子形」平高 |
|
||||
| **Q7 / Q7D** | ≈2.87~3.00 m | 高板 / 超高 | 顶部常有斜切/收口,**中间高、靠边矮** |
|
||||
| 其他(视航司) | — | — | 如鼻舱位、特殊机位另有高度码,听到再问 |
|
||||
|
||||
**重要:** 轮廓是 **剖面**,不是完美长方体——边上会收窄。所以会出现「底板放得下,轮廓过不了」。
|
||||
|
||||
##### 3)底板型号还是要认(PMC / PAG / 箱子)
|
||||
|
||||
轮廓说「打多高」;下面说「用哪块板 / 哪个箱」:
|
||||
|
||||
**集装板**
|
||||
|
||||
| 代码 | 底板约 | 新人怎么记 |
|
||||
|------|--------|------------|
|
||||
| **PMC(P6P)** | 约 244×318 cm(96×125″) | 最常见大板;可打低/中/高板 |
|
||||
| **PAG(P1P)** | 约 224×318 cm(88×125″) | 比 PMC 窄;下舱也常见 |
|
||||
| **PLA / PLB** | 约 153×318 cm | 半板,多下舱 |
|
||||
| **PRA(约 16′)** | 约 244×498 cm | 货机主舱加长板 |
|
||||
| **PGA(约 20′)** | 约 244×606 cm | 货机主舱更长板 |
|
||||
|
||||
**集装箱(封闭)**
|
||||
|
||||
| 代码 | 俗称 | 高约 | 新人怎么记 |
|
||||
|------|------|------|------------|
|
||||
| **AKE** | **LD3** | ≈1.6 m | 下舱小罐,最常见 |
|
||||
| **AKH** | LD3-45 一类 | 更矮 | 窄体下舱 |
|
||||
| **ALF** | LD6 | ≈1.6 m | 下舱更宽的箱 |
|
||||
| **AAP** | LD9 | ≈1.6 m | 更大封闭箱 |
|
||||
| **AMA** | M1 | ≈2.4 m | 货机主舱大箱 |
|
||||
| **RKN / RAP** | 冷藏箱 | 视型号 | 温控货 |
|
||||
|
||||
限重量级(约):PMC 主舱毛重可达约 6800 kg,下舱常更低;AKE 约 1588 kg——**以航司手册为准**。
|
||||
|
||||
##### 4)怎么选(口述版)
|
||||
|
||||
| 场景 | 更常说 |
|
||||
|------|--------|
|
||||
| 客机腹舱、货高 ≤ 约 1.6 m | **低板**(LD / H1·H2 等)或 **LD3 箱** |
|
||||
| 货高 1.6~2.4 m | 必须盯 **主舱中板 Q6**,别当腹舱低板报 |
|
||||
| 货高接近 3 m | **高板 Q7** + 确认机型/舱位 |
|
||||
| 超长件 | **16′/20′ 板(PRA/PGA)** + 主舱 |
|
||||
| 怕湿怕盗小件 | **AKE / AAP** 等集装箱 |
|
||||
| 温控 | **RKN / RAP**,早订 |
|
||||
|
||||
**口诀:**
|
||||
先问 **低板还是高板(限高)**,再问 **PMC 还是箱子(载具)**;日常简码先认 **低板 / H1·H2、Q6 中板、Q7 高板**;超 1.6 m 默认别按腹舱承诺。
|
||||
|
||||
**主舱 vs 下舱(和高低板绑在一起记):**
|
||||
|
||||
| | **下舱 / 腹舱** | **主舱(多在全货机)** |
|
||||
|--|-----------------|------------------------|
|
||||
| 板型口语 | **低板** 为主 | **中板 / 高板** |
|
||||
| 高度天花板 | 约 **1.63 m** | Q6≈2.44 m;Q7≈3.0 m |
|
||||
| 常见载具 | PMC/PAG 打低板、PLA、AKE、AAP… | PMC 打 Q6/Q7、PRA/PGA、AMA… |
|
||||
|
||||
#### 打板大致流程(听懂就行)
|
||||
|
||||
```
|
||||
订舱要板位 → 货到货站/指定仓 → 检查 ULD 能否用
|
||||
→ 堆码打板(重下轻上、重心居中)→ 网套/绑带固定
|
||||
→ 过安检、整板称重贴标 → 报关交接 → 机坪装机卡死
|
||||
→ 目的港拆板分拣 → 空板回流
|
||||
```
|
||||
|
||||
#### 打板要守的几条(对内沟通)
|
||||
|
||||
| 要点 | 白话 |
|
||||
|------|------|
|
||||
| **轮廓不超线** | 货不能超出板边/舱型弧线,否则舱门卡死上不了机 |
|
||||
| **重心** | 重货在下、轻货在上,左右前后尽量均匀,避免偏载 |
|
||||
| **限重** | 整板毛重、底板承压都有上限;重货可能要垫木分散压力 |
|
||||
| **固定** | 网套罩全;异形/重件加绑带扣在板扣上 |
|
||||
| **标签** | 航班、目的港、重量要和单证一致,防错运 |
|
||||
| **特货隔离** | 带电、危险品、生鲜按规则摆放,不能随便混装 |
|
||||
|
||||
#### 和「计费 / 对客」的关系
|
||||
|
||||
- 客户交来的可能是 **纸箱或木托**;货站再 **打成航空板**——这是操作环节,不等于客户托盘尺寸可以随便超高。
|
||||
- 货代常说 **包板**:按板向航司买运力,再按计费重卖给客户;板没装满时,泡货/拼货会影响板的盈亏。
|
||||
- **散货交运**:量小不一定整板独享,货站会和其他票拼板——时效仍取决于航班与是否及时组板。
|
||||
- 对客别说「已经打板就一定明天起飞」——还要看 **舱位、安检、报关、机型轮廓** 是否都过。
|
||||
|
||||
**口诀:** 大货走货机多半要打板;先问 **低板还是高板**,再问 PMC/箱子;重下轻上、网套绑牢、轮廓别超。
|
||||
|
||||
### 航线怎么听懂(举例)
|
||||
|
||||
口头「PVG–LAX 直飞」「CAN–FRA 货机」「经 ICN 中转美东」:
|
||||
|
||||
1. 先听 **始发–目的**(口岸对)
|
||||
2. 再听 **直飞还是中转**
|
||||
3. 最后听 **航司二字码 + 客机/货机**
|
||||
4. 若提到班期码,会换算成「一周几班」(见⑤)
|
||||
|
||||
时效直觉(仅作认知,非承诺):
|
||||
|
||||
- 直飞货机到美西/西欧主要港:空中段往往 **1~3 天级**,门到门还要加提货、报关、清关、派送
|
||||
- 中转航线:整体常再多 **1~3 天**,旺季看舱位与枢纽拥堵
|
||||
- 「已起飞 / 已到达目的港 / 清关中 / 派送中」是客服查轨迹时的关键节点语言
|
||||
|
||||
---
|
||||
|
||||
## ③ 什么货能走
|
||||
|
||||
**永远不要凭感觉答应「都能走」。**
|
||||
最终以:品名申报、航司/快递禁运表、销售产品规则、目的国法规为准。有疑问先对内问运营,再对客。
|
||||
|
||||
### 新人收货 / 询价先问清的 6 件事
|
||||
|
||||
1. **品名是什么**(中英文,能否报关)
|
||||
2. **有没有电、液体、粉末、带磁、带气**
|
||||
3. **单件长宽高 + 实重**(判断泡货、超长、能否上腹舱)
|
||||
4. **是否打托 / 几件几托**
|
||||
5. **要不要门到门、是否偏远**
|
||||
6. **目的国有无特殊限运**(品牌仿牌、食品、医疗等)
|
||||
|
||||
**口诀:**
|
||||
普货看尺寸重量;带电液体先过审;大托盘优先货机;小件急件才优先快递。
|
||||
|
||||
### 按运力类型看货型
|
||||
|
||||
图例:✓ 常见可走 △ 有条件(要鉴定/配额/特货申报) ✕ 通常不走或极难
|
||||
|
||||
| 货型 | 举例 | 全货机干线 | 客机腹舱 | 中转货机网 | 国际快递 |
|
||||
|------|------|------------|----------|------------|----------|
|
||||
| **普货(一般贸易)** | 服装、日用、小家电、配件 | ✓ | ✓(尺寸内) | ✓ | ✓ |
|
||||
| **电商小包 / 一件代发** | 服装鞋包、小百货 | ✓ | △ 量小可 | ✓ | ✓ 很合适 |
|
||||
| **重货** | 五金、零件、瓷砖密度高 | ✓ 很合适 | △ 限重 | ✓ | △ 贵+附加费 |
|
||||
| **泡货** | 家具、灯具、收纳、泡沫件 | ✓(按体积重) | △ 占舱难批 | ✓ | ✓ 但 5000 更贵 |
|
||||
| **托盘货 / 打板货** | 整托出口 | ✓ 很合适 | ✕ 多数装不下 | ✓ | △ 有托盘产品才行 |
|
||||
| **超长 / 超大 / 异形** | 长管、设备、展架 | ✓(确认舱门与板型) | ✕ | △ 看机型 | ✕ 或加高额附加/拒收 |
|
||||
| **带电(锂电等)** | 充电宝、蓝牙耳机、电动工具 | △ 要 UN 鉴定/包装 | △ 更严,很多客机拒 | △ 看航司政策 | △ 有「带电」产品线 |
|
||||
| **液体 / 粉末 / 膏体** | 化妆品、化工粉、胶水 | △ 看危险品属性 | △/✕ | △ | △ 品名与成分要过审 |
|
||||
| **危险品(DG)** | 油漆、电池、气雾剂等 | △ 有资质+舱位 | ✕ 多数禁 | △ 少数航司可 | △ 仅限接受的 UN 号 |
|
||||
| **生鲜 / 温控** | 海鲜、药品冷链 | △ 需冷链舱/箱 | △ 极少 | △ 枢纽冷链好的更合适 | △ 专用产品 |
|
||||
| **高价值** | 芯片、样品、奢侈品 | ✓ | ✓ | ✓ | ✓(安检/保价要讲清) |
|
||||
| **粉末状金属 / 磁铁等** | 特殊申报货 | △ | ✕/△ | △ | △ 常需额外文件 |
|
||||
|
||||
### 按航司/品牌记「更擅长什么」
|
||||
|
||||
| 对象 | 更常接的货型 | 不太适合 / 要特别确认 |
|
||||
|------|--------------|------------------------|
|
||||
| **CK / CZ / MU 物流货机** | 普货、重货、托盘、大货、电商大货 | 未申报的危险品;超规格未订舱的异形件 |
|
||||
| **CA / MU / CZ 等腹舱** | 急件小货、文件样品、尺寸合规普货 | 大托盘、超长超重、多数危险品 |
|
||||
| **LH / KL / AF 等** | 欧线普货、高附加值、需欧洲枢纽分拨的货 | 未确认冷链/特货前别承诺 |
|
||||
| **CX / KE / QR / EK / TK** | 普货、部分特货(看航司);舱紧时的绕道方案 | 强时效生鲜(总航程可能偏长) |
|
||||
| **O3 顺丰等** | 电商件、国内集货后出口的标件 | 超大工业件、复杂 DG |
|
||||
| **DHL / FedEx / UPS** | 文件、样品、电商小件、带电合规件(指定产品) | 超大托盘、未过审液体粉末、超出网络尺寸限的货 |
|
||||
|
||||
**和 OMS 的关系:** 销售产品常会写「可接货型 / 禁运」;下单踩黑名单或品名不合规会直接拒单——客服对客不要凭感觉答应「都能走」。
|
||||
|
||||
---
|
||||
|
||||
## ④ 飞欧美:口岸、目的港、常见航司
|
||||
|
||||
> 班期、机型会随 **夏秋/冬春航季、旺季加开、运力调整** 变化。
|
||||
> 入职先认 **二字码 + 枢纽**;「周班」只记 **量级**,订舱以航司/货代当日班期为准。
|
||||
|
||||
### 先记:必认口岸(出港 + 目的)
|
||||
|
||||
| 你要认得 | 代码 |
|
||||
|----------|------|
|
||||
| 国内出港 | **PVG** 上海 · **CAN** 广州 · **SZX** 深圳 · **PEK** 北京 · **HKG** 香港 |
|
||||
| 美国 | **LAX** 洛杉矶 · **ORD** 芝加哥 · **JFK** 纽约 |
|
||||
| 欧洲 | **FRA** 法兰克福 · **AMS** 阿姆斯特丹 · **CDG** 巴黎 · **LHR** 伦敦 |
|
||||
| 常见中转 | **ICN** 仁川 · **DOH** 多哈 · **DXB** 迪拜 · **IST** 伊斯坦布尔 · **TPE** 台北 |
|
||||
|
||||
### 国内常见出港口岸(完整)
|
||||
|
||||
| 代码 | 机场 | 常见角色 |
|
||||
|------|------|----------|
|
||||
| **PVG** | 上海浦东 | 欧美货量最大口岸之一(中美货运航班可到百班量级/周) |
|
||||
| **CAN** | 广州白云 | 华南主力,南航、FedEx 亚太转运等 |
|
||||
| **SZX** | 深圳宝安 | 电商/电子件密集 |
|
||||
| **PEK / PKX** | 北京 | 国航等枢纽 |
|
||||
| **CTU / TFU** | 成都 | 西部出港、部分欧美货机/腹舱 |
|
||||
| **EHU** | 鄂州花湖 | 顺丰等货机枢纽,近年欧美包机/定期增多 |
|
||||
| **HKG** | 香港 | 重要中转与集货口岸 |
|
||||
| **TPE / ICN** | 台北 / 仁川 | 常作美线中转跳板(华航、长荣、大韩、韩亚) |
|
||||
|
||||
### 欧美常见目的港(完整)
|
||||
|
||||
| 方向 | 代码 | 城市 |
|
||||
|------|------|------|
|
||||
| 美西 | **LAX** / SFO / SEA / ANC | 洛杉矶 / 旧金山 / 西雅图 / 安克雷奇(货机常见技术经停) |
|
||||
| 美中 | **ORD** / DFW / MEM / SDF / IND | 芝加哥 / 达拉斯 / 孟菲斯 / 路易斯维尔 / 印第安纳(快递枢纽多) |
|
||||
| 美东 | **JFK** / EWR | 纽约 / 纽瓦克 |
|
||||
| 加拿大 | **YYZ** / YVR | 多伦多 / 温哥华 |
|
||||
| 欧洲 | **FRA** / **AMS** / **CDG** / LHR·STN / BRU / LGG / BUD / MXP | 法兰克福 / 阿姆斯特丹 / 巴黎 / 伦敦 / 布鲁塞尔 / 列日 / 布达佩斯 / 米兰 等 |
|
||||
|
||||
### 常见航司二字码(欧美向,完整版)
|
||||
|
||||
#### A. 国内客运/货运主力
|
||||
|
||||
| 代码 | 航司 | 新人怎么记 |
|
||||
|------|------|------------|
|
||||
| **CA** | 国航 | 北京、成都枢纽;客运腹舱 + 货运协同 |
|
||||
| **CK** | 国货航 / 中货航系 | 全货机为主;中美、中欧干线常见 |
|
||||
| **MU** | 东航 | 上海枢纽;欧美客运密,物流侧有全货机 |
|
||||
| **CZ** | 南航 | 广州/深圳/浦东货机强;欧美货机班期公开 |
|
||||
| **HU** | 海航 | 部分北美、欧洲客运腹舱 |
|
||||
| **O3** | 顺丰航空 | 货机 + 鄂州等口岸;电商件常见 |
|
||||
|
||||
#### B. 欧美本土与联盟航司
|
||||
|
||||
| 代码 | 航司 | 新人怎么记 |
|
||||
|------|------|------------|
|
||||
| **LH** | 汉莎 | 欧洲 **FRA** 超级枢纽 |
|
||||
| **KL** / **AF** | 荷航 / 法航 | **AMS** / **CDG**;常客货联动 |
|
||||
| **BA** | 英航 | 英国方向 |
|
||||
| **AA** / **UA** / **DL** | 美航 / 联航 / 达美 | 美线客机腹舱补充运力 |
|
||||
|
||||
#### C. 中转枢纽型(经第三地再到欧美)
|
||||
|
||||
| 代码 | 航司 | 枢纽 | 新人怎么记 |
|
||||
|------|------|------|------------|
|
||||
| **CX** | 国泰 | **HKG** | 香港进出欧美 |
|
||||
| **CI** / **BR** | 华航 / 长荣 | **TPE** | 美西常见中转 |
|
||||
| **KE** / **OZ** | 大韩 / 韩亚 | **ICN** | 仁川跳美线/欧线 |
|
||||
| **QR** | 卡航 | **DOH** | 多哈中转全球 |
|
||||
| **EK** | 阿联酋航 | **DXB** | 迪拜中转;货机网络大 |
|
||||
| **EY** | 阿提哈德 | **AUH** | 阿布扎比;包机/定期货机可见 |
|
||||
| **TK** | 土航 | **IST** | 伊斯坦布尔;欧非衔接强 |
|
||||
| **SQ** | 新航 | **SIN** | 部分经新加坡再到欧美 |
|
||||
|
||||
#### D. 国际快递自有网络(对客说品牌名)
|
||||
|
||||
| 常见说法 | 关联 | 新人怎么记 |
|
||||
|----------|------|------------|
|
||||
| **DHL** | 欧线强、LGG/CGN 等 | 门到门快递;自有 + 合作运力 |
|
||||
| **FedEx(FX 等)** | MEM / CDG / CAN 等 | 亚太↔欧美货机密 |
|
||||
| **UPS(5X 等)** | SDF / 欧美口岸 | 同上,对客报 UPS 即可 |
|
||||
|
||||
---
|
||||
|
||||
## ⑤ 航司优劣、怎么选、周班量级
|
||||
|
||||
> 不是贬谁捧谁,而是帮新人建立「什么货、什么时效、选哪类运力」的直觉。
|
||||
> 实际以公司签约渠道、当季舱位和报价为准。
|
||||
|
||||
### 按类型先记四句
|
||||
|
||||
| 类型 | 优势 | 劣势 |
|
||||
|------|------|------|
|
||||
| **国内货机干线(CK/CZ/MU 物流等)** | 直飞多、载量大、大件友好;班期相对透明 | 要订舱/打板;末端派送常另配;旺季一样抢舱 |
|
||||
| **客运腹舱(CA/MU/CZ/LH/AF 等)** | 班次密、部分线路每日有;适合急小件 | 单班舱位少、尺寸重量限严;客运旺季优先旅客 |
|
||||
| **中转枢纽航司(CX/KE/QR/EK/TK…)** | 网络广、可绕开直飞舱紧;部分价更灵活 | 多一段中转风险;时效波动;要盯衔接与枢纽拥堵 |
|
||||
| **国际快递(DHL/FedEx/UPS)** | 门到门、轨迹清、操作省心;欧美末端强 | 单价常更高;泡货按 5000 更严;超大件/特货限制多 |
|
||||
|
||||
### 国内主力(逐家)
|
||||
|
||||
| 航司 | 优势 | 劣势 / 注意 |
|
||||
|------|------|-------------|
|
||||
| **CA 国航** | 北京/成都出港资源;客运欧美网络补腹舱 | 纯货机运力相对不如专业货航密;大货要确认货机还是腹舱 |
|
||||
| **CK 国货航/中货航系** | 全货机为主;中美、中欧干线载量大;适合重货/大货 | 偏「机场到机场」思维;末端、清关、卡班要另看服务范围 |
|
||||
| **MU 东航** | 上海枢纽强;欧美客运密 + 物流货机点位在扩(欧线多点) | 单点货机不一定每日;腹舱与货机产品要分清 |
|
||||
| **CZ 南航** | 华南 + 浦东货机都强;美欧干线班期清晰;适合华南集货 | 部分欧线一周数班不是天天;旺季华南舱同样紧 |
|
||||
| **HU 海航** | 部分北美/欧洲客运可补舱 | 货运不是主业;运力与稳定性波动相对更大 |
|
||||
| **O3 顺丰航空** | 电商件、国内集货到口岸顺;货机+鄂州等枢纽 | 欧美远程仍依赖自身货机/合作;对客常是「专线/快递产品」而非盯航班号 |
|
||||
|
||||
### 欧美本土(逐家)
|
||||
|
||||
| 航司 | 优势 | 劣势 / 注意 |
|
||||
|------|------|-------------|
|
||||
| **LH 汉莎** | **FRA** 分拨强;欧洲境内卡车/衔接成熟 | 直飞中国舱位紧时价高;大货要早锁板 |
|
||||
| **KL / AF 荷航法航** | **AMS / CDG** 枢纽好;客货联动、欧洲覆盖面广 | 同左:热门季舱紧;腹舱装不下超大件 |
|
||||
| **BA 英航** | 英国方向腹舱/衔接 | 点对点选择相对少;英国清关/派送另计 |
|
||||
| **AA / UA / DL** | 美线腹舱补充;部分美国内分拨衔接 | 载货能力有限;不是大货主通道 |
|
||||
|
||||
### 中转枢纽型(逐家)
|
||||
|
||||
| 航司 | 优势 | 劣势 / 注意 |
|
||||
|------|------|-------------|
|
||||
| **CX 国泰** | **HKG** 进出便捷;欧美网络成熟;操作规范口碑好 | 香港集货成本/时效;旺季 HKG 同样拥堵 |
|
||||
| **CI / BR 华航长荣** | **TPE** 跳美西常见;班期相对稳 | 多一段海运/陆运或空运进港;整体时效看衔接 |
|
||||
| **KE / OZ 大韩韩亚** | **ICN** 中转效率口碑好;美线常用备选 | 非直飞;爆舱时枢纽积压 |
|
||||
| **QR 卡航** | **DOH** 全球网;舱位灵活、可绕开直飞紧张 | 绕飞里程长;生鲜/时效敏感货要算总时长 |
|
||||
| **EK 阿联酋** | **DXB** 货机网络大;中东↔欧美衔接强 | 同上,中转总时效;旺季 DXB 也忙 |
|
||||
| **EY 阿提哈德** | **AUH**;包机/货机可补运力 | 网络密度通常不及 EK/QR;要确认定期还是包机 |
|
||||
| **TK 土航** | **IST** 连欧非强;欧洲多点可达 | 中转流程与直飞体验不同;部分货要接受更长路径 |
|
||||
| **SQ 新航** | **SIN** 操作稳、服务口碑好 | 经新再去欧美绕;更适合已在南向链路的货 |
|
||||
|
||||
### 国际快递(逐家)
|
||||
|
||||
| 品牌 | 优势 | 劣势 / 注意 |
|
||||
|------|------|-------------|
|
||||
| **DHL** | 欧洲末端强;清关/派送一体化体验好 | 价格敏感客户觉得贵;超重超长附加费多 |
|
||||
| **FedEx** | 中美、亚太↔欧美货机密;轨迹与时效产品线清晰 | 泡货、住宅派、偏远等附加费要讲清 |
|
||||
| **UPS** | 北美末端强;企业件稳定 | 同左;大件/异形限制;对客别承诺「一定某天航班」 |
|
||||
|
||||
### 怎么选(新人口述版)
|
||||
|
||||
| 场景 | 更常优先想 | 少优先 |
|
||||
|------|------------|--------|
|
||||
| 急小件、要门到门、要好查 | 国际快递 | 纯机场货机再自拼末端 |
|
||||
| 大货、重货、要控成本 | 国内/海外货机干线 + 清关派送方案 | 只靠客机腹舱 |
|
||||
| 直飞舱没有了、还能接受多 1~2 天 | 中转(ICN / HKG / DOH / DXB / IST) | 硬等直飞却不告知客户 |
|
||||
| 华南出货去欧美 | 南航货机、华南口岸快递转运等 | 强行全部拉去北方口岸(除非价/舱更好) |
|
||||
| 上海出货、欧线多点 | 东航物流/中货航系 + 腹舱补 | 只认一个目的港名字 |
|
||||
| 尺寸很小的急件 | 腹舱或快递 | 大货机方案(可能不划算) |
|
||||
|
||||
**对客别踩的坑:** 不要把「某航司优势」说成「你们这票一定走这家、一定某天到」——OMS 里客户选的是 **销售产品**,实际承运看 **排货 / 服务渠道**。
|
||||
|
||||
### 周班次数大概多少?(完整量级表)
|
||||
|
||||
**怎么读班期码:** 货代/航司常写 `1234567` = 周一到周日都飞(约 **7 班/周**);`246` = 二、四、六(约 **3 班/周**)。下面数字是 **单条干线、单方向量级**,不是「该航司全球总航班」。
|
||||
|
||||
| 类型 | 典型例子 | 大约周班(量级) | 怎么记 |
|
||||
|------|----------|------------------|--------|
|
||||
| **主干全货机 · 天天有** | 如 CK/CZ 类 **PVG–LAX**、部分 **PVG–FRA** | **约 6~7 班/周**(近每日) | 「这条几乎天天有货机」 |
|
||||
| **主干全货机 · 一周几班** | 如 **PVG–AMS**、**CAN–FRA / CAN–AMS**、**PVG–CDG / BUD** 等 | **约 3~4 班/周** 常见;有的口岸 **5~6** | 「隔天级,不是天天」 |
|
||||
| **南航货机网络(公开班期直觉)** | PVG–LAX 近每日;PVG–FRA 约 **6**;CAN–LAX 约 **6**;CAN–FRA / AMS 约 **3**;另有经 ANC 美线、经 CKG 欧线 | 单航司欧美货机 **多条线累加可达十余~二十班/周量级** | 华南 + 浦东都有板 |
|
||||
| **东航物流 / 中货航欧洲** | 伦敦、AMS、FRA、BUD、CDG 等点位组合 | 公开信息曾提欧洲区域 **往返约数十班/周**;单点如巴黎/布达佩斯常见 **约 3 班/周** | 「多点织网,单点不一定每日」 |
|
||||
| **国货航中美** | 如 PVG–LAX 全货机 | 公开计划可见 **约 7 班/周** | 美西干线高频 |
|
||||
| **客运腹舱 · 热门洲际** | MU/CA/CZ/LH/AF 等 PVG/PEK/CAN ↔ FRA/CDG/LAX/JFK | 热门对常 **每日 1 班腹舱**(≈7/周),热门城市甚至 **更高**;冷门对 **2~4/周** | 腹舱班次多,但 **单班载货少、尺寸限严** |
|
||||
| **中转枢纽航司** | CX(HKG)、KE/OZ(ICN)、QR(DOH)、EK(DXB)、TK(IST)、CI/BR(TPE) | 枢纽本身到欧美往往 **高频(近每日)**;你这票是「大陆→枢纽→欧美」,要看 **两段是否衔接** | 别把枢纽密度当成门到门时效 |
|
||||
| **FedEx / UPS / DHL** | 如 FedEx 亚太→欧洲货机网络 | 公开口径可见亚太→欧洲 **二十余班/周量级**;中美更高、近「每日多班」体感 | 快递网络按 **服务日** 取件,不按「订某一个航班号」跟客户讲 |
|
||||
|
||||
**口岸整体体感(培训用):**
|
||||
|
||||
- **PVG → 美国**:全口岸货运相关航班可到 **近百班/周量级**(含多家航司货机 + 腹舱),不是某一家的数字。
|
||||
- **PVG / CAN → 欧洲主要港**:主干货机多为 **每周数班到近每日**;再叠加腹舱,舱位选择多,但旺季仍会「有价无舱」。
|
||||
|
||||
**对内一句话:**
|
||||
「主干美西/西欧货机:要么近每日,要么一周三五班;腹舱更密但装不下大件;中转看两段衔接;快递看服务日不是盯某一个航班号。」
|
||||
|
||||
### 旺季心态
|
||||
|
||||
「双十一、圣诞、春节前后」欧美舱紧:
|
||||
**有舱位 > 便宜几毛钱。** 对客沟通要留缓冲,别只报最优理论时效;也别把培训表里的周班数当成承诺时效。
|
||||
|
||||
---
|
||||
|
||||
## ⑥ 和 OMS 培训怎么串起来
|
||||
|
||||
| 本页概念 | 系统里对应 |
|
||||
|----------|------------|
|
||||
| 体积系数 / 1 立方折公斤 | 渠道 → 计重规则(挂销售产品) |
|
||||
| 计费重 | 查价、预报应收、入库重算 |
|
||||
| 打板 / 板位 | 空运操作侧概念;对客讲清「进仓组板≠已起飞」 |
|
||||
| 预报 vs 入库件重尺 | 订单费用明细;客服解释差价 |
|
||||
| 货型 / 禁运 | 销售产品规则;下单黑名单 |
|
||||
| 走哪家下游 | 入库 **排货** 选服务渠道(不一定是某航司直客) |
|
||||
| 轨迹节点 | 出库后等服务商上网;见第 4 周 |
|
||||
|
||||
**建议顺序:** 本页打底 → 第 1 周跑通一票 → 第 2 周手算计费重 → 「算账」Tab 练对客话术。
|
||||
|
||||
---
|
||||
|
||||
## 自测题(带教口述)
|
||||
|
||||
1. 60×50×40、实重 12kg,系数 6000 时计费重是多少?对客怎么说?
|
||||
2. 为什么说「1 立方 ≈ 167 kg」?和系数 6000、快递 200 kg 是什么关系?
|
||||
3. 低板 / 中板 / 高板、H1、Q6、Q7 各大概多高?和 PMC 底板是什么关系?
|
||||
4. 托盘大货、带电小件、急小件门到门,分别更常优先想哪类运力?为什么?
|
||||
5. PVG、LAX、FRA、经 DOH 中转各代表什么?客户选的是销售产品还是航司?
|
||||
@ -1,7 +1,7 @@
|
||||
# 算账课(财务 / 客服 / 运营)
|
||||
|
||||
> 不背公式,只练「打开费用明细时怎么跟客户讲」。
|
||||
> 细规则见 [营销指引](/marketing/guide)、[订单指引](/order/guide)。
|
||||
> 体积重 / 计费重 / 系数先看「物流基础」Tab;细规则见 [营销指引](/marketing/guide)、[订单指引](/order/guide)。
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
|
||||
- [ ] 测服可注册客户;运营账号能开
|
||||
- [ ] 新人已选对岗位轨(总览页)
|
||||
- [ ] 「物流基础」按 ①~⑤ 勾完;能口述计费重 + 四种运力选型
|
||||
- [ ] 每周五 30 分钟对照进度;周末不排
|
||||
- [ ] 收「一票货四端对照」笔记 + 过验收勾选
|
||||
|
||||
@ -24,6 +25,7 @@
|
||||
| 仓储 | [/warehouse/guide](/warehouse/guide) |
|
||||
| 轨迹 | [/track/guide](/track/guide) |
|
||||
| 营销 | [/marketing/guide](/marketing/guide) |
|
||||
| 物流基础 | 本页「物流基础」Tab |
|
||||
| 算账课 | 本页「算账」Tab |
|
||||
|
||||
---
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
|
||||
细配与排障:打开文末「配套指引」。本页只帮你建立地图、敢上手。
|
||||
|
||||
**入职先读「物流基础」Tab:** 按 ①计费 → ②运力 → ③货型 → ④口岸航司 → ⑤优劣与周班 的脉络读(细表都在,方便检索);各岗都要有这份常识。
|
||||
|
||||
---
|
||||
|
||||
## 开场故事:一票货怎么赚钱?
|
||||
@ -88,6 +90,7 @@ OMS 就是把上面这条链 **配清楚、算清楚、查得着**。
|
||||
|
||||
| 周 | 主题 | 培训师目标 |
|
||||
|----|------|------------|
|
||||
| 物流基础 | 计重 + 航空常识 | 能手算计费重;认得欧美口岸/航司 |
|
||||
| 第1周 | 当客户跑通 | 能讲「一票货从问价到上网」 |
|
||||
| 第2周 | 渠道为什么有价 | 懂「不发布=没改」 |
|
||||
| 第3周 | 订单排障 + 钱 | 待排货、费用争议、付款 |
|
||||
@ -109,6 +112,7 @@ OMS 就是把上面这条链 **配清楚、算清楚、查得着**。
|
||||
|
||||
| 主题 | 去哪 |
|
||||
|------|------|
|
||||
| 物流基础(体积重 / 航司) | 「物流基础」Tab |
|
||||
| 练习包(可点跳转) / 话术(可搜) / 算账 | 本页对应 Tab |
|
||||
| 进度 · 带教口述题 | 「进度」Tab 置顶 |
|
||||
| 渠道 / 订单 / 操作 / 仓储 / 轨迹 / 营销 | 见上表指引列 |
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
| 工作日 | 重点 | 例子 |
|
||||
|--------|------|------|
|
||||
| 周一 | 分区 / 黑名单 / 偏远 | 邮编 55000 落「西马 A」;黑名单直接拒单,偏远只打标 |
|
||||
| 周二 | 计重 | 30×20×10、实重 0.8,泡比 6000 → 体积重 1.0 → 计费重 1.0kg |
|
||||
| 周二 | 计重 | 30×20×10、实重 0.8,泡比 6000 → 体积重 1.0 → 计费重 1.0kg(公式见「物流基础」) |
|
||||
| 周三 | 卖价矩阵 | 故意弄错重量段 → 下单报「卖价未匹配」 |
|
||||
| 周四 | 买价 + 排货 | 排货列表空或买价未发布 → 入库后容易 **待排货** |
|
||||
| 周五 | 发布对照 | 改价不发布 → 客户仍旧价;本周验收 |
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
import TrainingScriptsPanel from './TrainingScriptsPanel.vue';
|
||||
import TrainingExamPanel from './TrainingExamPanel.vue';
|
||||
import overviewContent from './handbook-overview.md?raw';
|
||||
import basicsContent from './handbook-basics.md?raw';
|
||||
import week1Content from './handbook-week1.md?raw';
|
||||
import week2Content from './handbook-week2.md?raw';
|
||||
import week3Content from './handbook-week3.md?raw';
|
||||
@ -40,6 +41,7 @@
|
||||
|
||||
const tabs: TabDef[] = [
|
||||
{ key: 'overview', title: '总览', content: overviewContent },
|
||||
{ key: 'basics', title: '物流基础', content: basicsContent, checklistWeek: 'basics' },
|
||||
{ key: 'week1', title: '第1周', content: week1Content, checklistWeek: 'week1' },
|
||||
{ key: 'week2', title: '第2周', content: week2Content, checklistWeek: 'week2' },
|
||||
{ key: 'week3', title: '第3周', content: week3Content, checklistWeek: 'week3' },
|
||||
@ -172,7 +174,7 @@
|
||||
/* 选读 Tab 标题略淡 */
|
||||
:deep(.arco-tabs-tab) {
|
||||
.arco-tabs-tab-title {
|
||||
max-width: 110px;
|
||||
max-width: 120px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
@ -4,6 +4,7 @@ import { ROLE_WEEK_FOCUS } from './checklist-items'
|
||||
/** 培训页 Tab(与 index 对齐) */
|
||||
export type TrainingTabKey =
|
||||
| 'overview'
|
||||
| 'basics'
|
||||
| 'week1'
|
||||
| 'week2'
|
||||
| 'week3'
|
||||
@ -14,6 +15,7 @@ export type TrainingTabKey =
|
||||
| 'progress'
|
||||
|
||||
const WEEK_TO_TAB: Partial<Record<TrainingWeekKey, TrainingTabKey>> = {
|
||||
basics: 'basics',
|
||||
week1: 'week1',
|
||||
week2: 'week2',
|
||||
week3: 'week3',
|
||||
@ -22,9 +24,9 @@ const WEEK_TO_TAB: Partial<Record<TrainingWeekKey, TrainingTabKey>> = {
|
||||
exam: 'progress',
|
||||
}
|
||||
|
||||
/** 各岗建议打开的 Tab(总览/进度始终建议) */
|
||||
/** 各岗建议打开的 Tab(总览/物流基础/进度始终建议) */
|
||||
export function recommendedTabsForRole(role: TrainingRoleKey): Set<TrainingTabKey> {
|
||||
const set = new Set<TrainingTabKey>(['overview', 'progress'])
|
||||
const set = new Set<TrainingTabKey>(['overview', 'basics', 'progress'])
|
||||
for (const w of ROLE_WEEK_FOCUS[role] || []) {
|
||||
const tab = WEEK_TO_TAB[w]
|
||||
if (tab) set.add(tab)
|
||||
@ -262,6 +264,10 @@ export interface OralQuestion {
|
||||
export const ORAL_EXAMS: Record<TrainingRoleKey, OralQuestion[]> = {
|
||||
all: [
|
||||
{ q: '用一分钟讲清:一票货从查价到上网。', expect: '查价→下单预报→入库改价排货→付款→出库→轨迹' },
|
||||
{
|
||||
q: '实重、体积重、计费重?急小件和托盘大货各优先想什么运力?',
|
||||
expect: '计费重取大;急小件偏快递;托盘大货偏货机;客户选产品不选航司',
|
||||
},
|
||||
{ q: '待排货是什么?怎么处理?', expect: '货已收但未选到下游;修买价/排货后重算应付' },
|
||||
{ q: '改价客户仍旧价,先查什么?', expect: '规则/价格是否发布' },
|
||||
],
|
||||
|
||||
@ -6,18 +6,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { fetchBrandLogoUrlsPublic } from '@/utils/brandLogo';
|
||||
import { brandLogoImages } from '@/utils/brandLogo';
|
||||
|
||||
defineOptions({ name: 'LoginLockLogo' });
|
||||
|
||||
const { t } = useI18n();
|
||||
const logoSrc = ref('');
|
||||
|
||||
void fetchBrandLogoUrlsPublic().then((urls) => {
|
||||
logoSrc.value = urls.site || '';
|
||||
});
|
||||
const logoSrc = computed(() => brandLogoImages.site);
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, defineAsyncComponent, onMounted, reactive, ref } from 'vue'
|
||||
import { Message, Modal } from '@arco-design/web-vue'
|
||||
import { extractOmsRequestError } from '@/api/oms/common'
|
||||
import HandsontablePro from '@/components/HandsontablePro/index.vue'
|
||||
import PaginationPro from '@/components/PaginationPro/index.vue'
|
||||
import SlidingTabs from '@/components/SlidingTabs/index.vue'
|
||||
@ -164,7 +165,7 @@
|
||||
}
|
||||
} catch (e: any) {
|
||||
templateOptions.value = []
|
||||
Message.error(e?.message || '加载标签模板失败')
|
||||
Message.error(extractOmsRequestError(e) || '加载标签模板失败')
|
||||
} finally {
|
||||
templateLoading.value = false
|
||||
}
|
||||
@ -226,7 +227,7 @@
|
||||
printVisible.value = true
|
||||
return true
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '批量打印失败')
|
||||
Message.error(extractOmsRequestError(e) || '批量打印失败')
|
||||
return false
|
||||
} finally {
|
||||
batchPrintLoading.value = false
|
||||
@ -245,7 +246,7 @@
|
||||
tableRows.value = res.items || []
|
||||
totalCount.value = Number(res.total || 0)
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '加载失败')
|
||||
Message.error(extractOmsRequestError(e) || '加载失败')
|
||||
} finally {
|
||||
listLoading.value = false
|
||||
}
|
||||
@ -281,7 +282,7 @@
|
||||
detail.value = await getShipBag(no)
|
||||
syncMetaForm(detail.value)
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '加载详情失败')
|
||||
Message.error(extractOmsRequestError(e) || '加载详情失败')
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
@ -312,7 +313,7 @@
|
||||
Message.success('属性已保存')
|
||||
await loadList()
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '保存失败')
|
||||
Message.error(extractOmsRequestError(e) || '保存失败')
|
||||
} finally {
|
||||
savingMeta.value = false
|
||||
}
|
||||
@ -332,7 +333,7 @@
|
||||
Message.success(`已入袋 ${no}`)
|
||||
await loadList()
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '入袋失败')
|
||||
Message.error(extractOmsRequestError(e) || '入袋失败')
|
||||
} finally {
|
||||
adding.value = false
|
||||
}
|
||||
@ -359,7 +360,7 @@
|
||||
await loadList()
|
||||
if (detail.value?.bagNo === row.bagNo) await refreshDetail(row.bagNo)
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '封袋失败')
|
||||
Message.error(extractOmsRequestError(e) || '封袋失败')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
feedbackType,
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('bagPack')
|
||||
@ -140,7 +140,7 @@
|
||||
showSuccess(`已开${type === 'box' ? '箱子' : '麻袋'} ${activeBag.value.bagNo}`)
|
||||
selectScanInput()
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '开袋失败')
|
||||
showRequestError(e, '开袋失败')
|
||||
} finally {
|
||||
creating.value = false
|
||||
}
|
||||
@ -152,7 +152,7 @@
|
||||
activeBag.value = await getShipBag(activeBag.value.bagNo)
|
||||
if (!silent) showSuccess('已刷新', false)
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '刷新失败')
|
||||
showRequestError(e, '刷新失败')
|
||||
}
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@
|
||||
waybillNo.value = ''
|
||||
selectScanInput()
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '入袋失败')
|
||||
showRequestError(e, '入袋失败')
|
||||
selectScanInput()
|
||||
} finally {
|
||||
scanning.value = false
|
||||
@ -226,7 +226,7 @@
|
||||
activeBag.value = await sealShipBag(bagNo)
|
||||
showSuccess(`封袋成功 ${bagNo},共 ${count} 件`)
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '封袋失败')
|
||||
showRequestError(e, '封袋失败')
|
||||
throw e
|
||||
} finally {
|
||||
sealing.value = false
|
||||
@ -254,7 +254,7 @@
|
||||
await nextTick()
|
||||
if (isOpen.value) selectScanInput()
|
||||
} catch (e: any) {
|
||||
if (!fromSession) showError(e?.message || '加载失败')
|
||||
if (!fromSession) showRequestError(e, '加载失败')
|
||||
if (fromSession) persistSession()
|
||||
} finally {
|
||||
loadingBag.value = false
|
||||
@ -331,7 +331,7 @@
|
||||
class="ops-scan-input"
|
||||
placeholder="扫描或输入大包号并回车"
|
||||
allow-clear
|
||||
@press-enter="withImeEnterGuard(() => loadByNo(false))"
|
||||
@press-enter="withImeEnterGuard(() => loadByNo(false), $event)"
|
||||
/>
|
||||
<a-input
|
||||
v-else
|
||||
@ -341,7 +341,7 @@
|
||||
:placeholder="isOpen ? '扫描运单号入袋(回车)' : '已封袋,不可再扫入'"
|
||||
allow-clear
|
||||
:disabled="!isOpen"
|
||||
@press-enter="withImeEnterGuard(handleScanEnter)"
|
||||
@press-enter="withImeEnterGuard(handleScanEnter, $event)"
|
||||
@focus="selectScanInput"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@ -109,7 +109,7 @@ defineExpose({
|
||||
class="fbl-scan-input"
|
||||
allow-clear
|
||||
:disabled="lookingUp"
|
||||
@press-enter="withImeEnterGuard(onLookupClick)"
|
||||
@press-enter="withImeEnterGuard(onLookupClick, $event)"
|
||||
/>
|
||||
<a-button
|
||||
type="primary"
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
import { ref, computed, onMounted, nextTick } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { Message, Modal } from '@arco-design/web-vue'
|
||||
import { extractOmsRequestError } from '@/api/oms/common'
|
||||
import { IconQuestionCircleFill } from '@arco-design/web-vue/es/icon'
|
||||
import PaginationPro from '@/components/PaginationPro/index.vue'
|
||||
import HandsontablePro from '@/components/HandsontablePro/index.vue'
|
||||
@ -229,7 +230,7 @@ async function loadQueue() {
|
||||
} catch (e: any) {
|
||||
queueList.value = []
|
||||
totalCount.value = 0
|
||||
Message.error(e?.message || t('operation.fulfillPack.message.loadFailed'))
|
||||
Message.error(extractOmsRequestError(e) || t('operation.fulfillPack.message.loadFailed'))
|
||||
} finally {
|
||||
listLoading.value = false
|
||||
}
|
||||
@ -373,7 +374,7 @@ async function handleConfirmOutbound() {
|
||||
clearQueueFilters()
|
||||
await loadQueue()
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || t('operation.fulfillPack.message.confirmFailed'))
|
||||
Message.error(extractOmsRequestError(e) || t('operation.fulfillPack.message.confirmFailed'))
|
||||
} finally {
|
||||
confirmLoading.value = false
|
||||
}
|
||||
|
||||
@ -10,12 +10,21 @@
|
||||
:placeholder="$t('operation.inbound.form.placeholder.scanOrInput')"
|
||||
class="ops-scan-input"
|
||||
allow-clear
|
||||
@press-enter="withImeEnterGuard(onScanEnter)"
|
||||
@press-enter="withImeEnterGuard(onScanEnter, $event)"
|
||||
@clear="clearLookup"
|
||||
/>
|
||||
</div>
|
||||
<div class="ops-scan__row ops-scan__row--tools">
|
||||
<div class="ops-scan__opts">
|
||||
<a-select
|
||||
v-model="numberType"
|
||||
class="ops-type-select"
|
||||
:placeholder="$t('operation.printLabel.form.placeholder.numberType')"
|
||||
>
|
||||
<a-option v-for="item in numberTypeOptions" :key="item.value" :value="item.value">
|
||||
{{ item.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
<a-checkbox v-model="keepScanFocus" class="ops-opt">
|
||||
{{ $t('operation.common.keepScanFocus') }}
|
||||
</a-checkbox>
|
||||
@ -51,10 +60,27 @@
|
||||
{{ feedbackMessage }}
|
||||
</p>
|
||||
<a-spin :loading="lookingUp" class="ops-verify-spin">
|
||||
<div v-if="formData.orderId" class="ops-panel">
|
||||
<div v-if="candidates.length" class="ops-candidates">
|
||||
<a-alert type="warning" show-icon>
|
||||
{{ $t('operation.printLabel.preview.multiMatch') }}
|
||||
</a-alert>
|
||||
<button
|
||||
v-for="c in candidates"
|
||||
:key="c.orderId"
|
||||
type="button"
|
||||
class="ops-candidate"
|
||||
@click="selectCandidate(c)"
|
||||
>
|
||||
<div>
|
||||
<strong>{{ c.serviceNo || c.clientNo || `#${c.orderId}` }}</strong>
|
||||
<p>{{ c.clientNo || '-' }} · {{ c.trackNo || '-' }} · {{ c.orderStatusName || '-' }}</p>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<div v-else-if="formData.orderId" class="ops-panel">
|
||||
<div class="ops-hero">
|
||||
<div class="ops-hero__nos">
|
||||
<div class="ops-hero__waybill">{{ formData.waybillNumber || '-' }}</div>
|
||||
<div class="ops-hero__waybill">{{ lookedUpServiceNo || formData.waybillNumber || '-' }}</div>
|
||||
<div class="ops-hero__meta">
|
||||
<span>{{ $t('operation.inbound.form.salesProduct') }} {{ formData.salesProductName || '-' }}</span>
|
||||
<span>{{ $t('operation.inbound.form.destinationCountry') }} {{ formData.destinationCountryName || '-' }}</span>
|
||||
@ -151,8 +177,14 @@ import PaginationPro from '@/components/PaginationPro/index.vue'
|
||||
import { useTableContainerHeight } from '@/composables/useTableContainerHeight'
|
||||
import { useOperationScanFocus } from '@/composables/useOperationScanFocus'
|
||||
import { useOperationScanFeedback } from '@/composables/useOperationScanFeedback'
|
||||
import { useOpsScanNumberType } from '@/composables/useOpsScanNumberType'
|
||||
import { withImeEnterGuard } from '@/utils/keyboard'
|
||||
import { inboundCreate, inboundRecentList, inboundOrderLookup } from '@/api/operation'
|
||||
import {
|
||||
inboundCreate,
|
||||
inboundRecentList,
|
||||
inboundOrderLookup,
|
||||
type OpsScanCandidate,
|
||||
} from '@/api/operation'
|
||||
import { buildStatusTagHtml } from '@/utils/statusTag'
|
||||
import { withServerFilterColumns } from '@/utils/headerFilterAdapter'
|
||||
import { applyScanExtract, ensureScanExtractBundle } from '@/utils/scanExtract'
|
||||
@ -166,10 +198,11 @@ const {
|
||||
feedbackType,
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('inboundScan')
|
||||
const { numberType, numberTypeOptions } = useOpsScanNumberType('inboundScan')
|
||||
|
||||
defineOptions({ name: 'InboundScan' })
|
||||
|
||||
@ -318,7 +351,7 @@ async function loadRecent(showLoadError = true) {
|
||||
if (currentPage.value > maxPage) currentPage.value = maxPage
|
||||
} catch (e: any) {
|
||||
if (showLoadError) {
|
||||
showError(e?.message || t('operation.inbound.message.loadRecentFailed'))
|
||||
showRequestError(e, t('operation.inbound.message.loadRecentFailed'))
|
||||
recentOrders.value = []
|
||||
}
|
||||
} finally {
|
||||
@ -340,6 +373,9 @@ function handlePageSizeChange(size: number) {
|
||||
}
|
||||
|
||||
const lookedUpWaybillNo = ref('')
|
||||
const lookedUpServiceNo = ref('')
|
||||
const lookedUpNumberType = ref('auto')
|
||||
const candidates = ref<OpsScanCandidate[]>([])
|
||||
|
||||
function clearLookupFields() {
|
||||
formData.salesProductName = ''
|
||||
@ -350,6 +386,9 @@ function clearLookupFields() {
|
||||
formData.width = ''
|
||||
formData.height = ''
|
||||
lookedUpWaybillNo.value = ''
|
||||
lookedUpServiceNo.value = ''
|
||||
lookedUpNumberType.value = numberType.value
|
||||
candidates.value = []
|
||||
}
|
||||
|
||||
function clearLookup() {
|
||||
@ -361,6 +400,17 @@ function hasMetrics() {
|
||||
return !!(formData.weight && formData.length && formData.width && formData.height)
|
||||
}
|
||||
|
||||
function applyLookupHit(info: Awaited<ReturnType<typeof inboundOrderLookup>>, scanNo: string) {
|
||||
formData.orderId = info.orderId
|
||||
formData.salesProductName = info.salesProductName || info.productCode || ''
|
||||
formData.destinationCountryName =
|
||||
info.destinationCountryName || info.destinationCountry || ''
|
||||
lookedUpWaybillNo.value = scanNo
|
||||
lookedUpServiceNo.value = info.serviceNo || scanNo
|
||||
lookedUpNumberType.value = numberType.value
|
||||
candidates.value = []
|
||||
}
|
||||
|
||||
/** 扫码后静默查单;不弹「匹配成功」,失败才提示 */
|
||||
async function ensureOrderLookup(): Promise<boolean> {
|
||||
const no = formData.waybillNumber?.trim()
|
||||
@ -368,27 +418,40 @@ async function ensureOrderLookup(): Promise<boolean> {
|
||||
clearLookup()
|
||||
return false
|
||||
}
|
||||
if (formData.orderId && lookedUpWaybillNo.value === no) {
|
||||
if (
|
||||
formData.orderId &&
|
||||
lookedUpWaybillNo.value === no &&
|
||||
lookedUpNumberType.value === numberType.value
|
||||
) {
|
||||
return true
|
||||
}
|
||||
lookingUp.value = true
|
||||
try {
|
||||
const info = await inboundOrderLookup(no)
|
||||
const info = await inboundOrderLookup(no, numberType.value)
|
||||
if (info?.candidates?.length && info.matched === false) {
|
||||
formData.orderId = undefined
|
||||
formData.salesProductName = ''
|
||||
formData.destinationCountryName = ''
|
||||
lookedUpWaybillNo.value = no
|
||||
lookedUpServiceNo.value = ''
|
||||
lookedUpNumberType.value = numberType.value
|
||||
candidates.value = info.candidates
|
||||
showWarning(t('operation.printLabel.preview.multiMatch'))
|
||||
return false
|
||||
}
|
||||
if (!info?.orderId) {
|
||||
throw new Error(t('operation.common.message.orderNotFound'))
|
||||
}
|
||||
formData.orderId = info.orderId
|
||||
formData.salesProductName = info.salesProductName || info.productCode || ''
|
||||
formData.destinationCountryName =
|
||||
info.destinationCountryName || info.destinationCountry || ''
|
||||
lookedUpWaybillNo.value = no
|
||||
applyLookupHit(info, no)
|
||||
return true
|
||||
} catch (e: any) {
|
||||
formData.salesProductName = ''
|
||||
formData.destinationCountryName = ''
|
||||
formData.orderId = undefined
|
||||
lookedUpWaybillNo.value = ''
|
||||
showError(e?.message || t('operation.common.message.orderNotFound'))
|
||||
lookedUpServiceNo.value = ''
|
||||
candidates.value = []
|
||||
showRequestError(e, t('operation.common.message.orderNotFound'))
|
||||
maybeRefocusScan()
|
||||
return false
|
||||
} finally {
|
||||
@ -396,6 +459,18 @@ async function ensureOrderLookup(): Promise<boolean> {
|
||||
}
|
||||
}
|
||||
|
||||
async function selectCandidate(c: OpsScanCandidate) {
|
||||
const serviceNo = String(c.serviceNo || '').trim()
|
||||
if (!serviceNo) {
|
||||
showWarning(t('operation.common.message.orderNotFound'))
|
||||
return
|
||||
}
|
||||
formData.waybillNumber = serviceNo
|
||||
numberType.value = 'waybill'
|
||||
candidates.value = []
|
||||
await ensureOrderLookup()
|
||||
}
|
||||
|
||||
async function onScanEnter() {
|
||||
formData.waybillNumber = applyScanExtract(formData.waybillNumber)
|
||||
const ok = await ensureOrderLookup()
|
||||
@ -434,7 +509,8 @@ async function handleSubmit() {
|
||||
submitting.value = true
|
||||
try {
|
||||
const result = await inboundCreate({
|
||||
waybillNo: formData.waybillNumber.trim(),
|
||||
waybillNo: lookedUpServiceNo.value || formData.waybillNumber.trim(),
|
||||
numberType: lookedUpServiceNo.value ? 'waybill' : numberType.value,
|
||||
weight: Number(formData.weight),
|
||||
length: Number(formData.length),
|
||||
width: Number(formData.width),
|
||||
@ -449,7 +525,7 @@ async function handleSubmit() {
|
||||
}
|
||||
maybeRefocusScan()
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('operation.inbound.message.inboundFailed'))
|
||||
showRequestError(e, t('operation.inbound.message.inboundFailed'))
|
||||
maybeRefocusScan()
|
||||
} finally {
|
||||
submitting.value = false
|
||||
@ -465,10 +541,19 @@ watch(
|
||||
formData.salesProductName = ''
|
||||
formData.destinationCountryName = ''
|
||||
lookedUpWaybillNo.value = ''
|
||||
lookedUpServiceNo.value = ''
|
||||
candidates.value = []
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
watch(numberType, () => {
|
||||
formData.orderId = undefined
|
||||
lookedUpWaybillNo.value = ''
|
||||
lookedUpServiceNo.value = ''
|
||||
candidates.value = []
|
||||
})
|
||||
|
||||
function handleReset(clearStatus = true) {
|
||||
formData.waybillNumber = ''
|
||||
clearLookupFields()
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, defineAsyncComponent, onMounted, reactive, ref } from 'vue'
|
||||
import { Message, Modal } from '@arco-design/web-vue'
|
||||
import { extractOmsRequestError } from '@/api/oms/common'
|
||||
import HandsontablePro from '@/components/HandsontablePro/index.vue'
|
||||
import PaginationPro from '@/components/PaginationPro/index.vue'
|
||||
import SlidingTabs from '@/components/SlidingTabs/index.vue'
|
||||
@ -173,7 +174,7 @@
|
||||
}
|
||||
} catch (e: any) {
|
||||
templateOptions.value = []
|
||||
Message.error(e?.message || '加载标签模板失败')
|
||||
Message.error(extractOmsRequestError(e) || '加载标签模板失败')
|
||||
} finally {
|
||||
templateLoading.value = false
|
||||
}
|
||||
@ -235,7 +236,7 @@
|
||||
printVisible.value = true
|
||||
return true
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '批量打印失败')
|
||||
Message.error(extractOmsRequestError(e) || '批量打印失败')
|
||||
return false
|
||||
} finally {
|
||||
batchPrintLoading.value = false
|
||||
@ -254,7 +255,7 @@
|
||||
tableRows.value = res.items || []
|
||||
totalCount.value = Number(res.total || 0)
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '加载失败')
|
||||
Message.error(extractOmsRequestError(e) || '加载失败')
|
||||
} finally {
|
||||
listLoading.value = false
|
||||
}
|
||||
@ -290,7 +291,7 @@
|
||||
detail.value = await getShipMaster(no)
|
||||
syncMetaForm(detail.value)
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '加载详情失败')
|
||||
Message.error(extractOmsRequestError(e) || '加载详情失败')
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
@ -322,7 +323,7 @@
|
||||
Message.success('属性已保存')
|
||||
await loadList()
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '保存失败')
|
||||
Message.error(extractOmsRequestError(e) || '保存失败')
|
||||
} finally {
|
||||
savingMeta.value = false
|
||||
}
|
||||
@ -345,7 +346,7 @@
|
||||
Message.success(addMode.value === 'bag' ? `大包 ${no} 已上板` : `小包 ${no} 已上板`)
|
||||
await loadList()
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '上板失败')
|
||||
Message.error(extractOmsRequestError(e) || '上板失败')
|
||||
} finally {
|
||||
adding.value = false
|
||||
}
|
||||
@ -380,7 +381,7 @@
|
||||
await loadList()
|
||||
if (detail.value?.masterNo === mawbForm.masterNo) await refreshDetail(mawbForm.masterNo)
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '绑定失败')
|
||||
Message.error(extractOmsRequestError(e) || '绑定失败')
|
||||
}
|
||||
}
|
||||
|
||||
@ -391,7 +392,7 @@
|
||||
await loadList()
|
||||
if (detail.value?.masterNo === row.masterNo) await refreshDetail(row.masterNo)
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || '封板失败')
|
||||
Message.error(extractOmsRequestError(e) || '封板失败')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
feedbackType,
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('masterBoard')
|
||||
@ -161,7 +161,7 @@
|
||||
showSuccess(`已开主单 ${active.value.masterNo}`)
|
||||
selectScanInput()
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '开主单失败')
|
||||
showRequestError(e, '开主单失败')
|
||||
throw e
|
||||
} finally {
|
||||
creating.value = false
|
||||
@ -187,7 +187,7 @@
|
||||
await nextTick()
|
||||
if (isOpen.value) selectScanInput()
|
||||
} catch (e: any) {
|
||||
if (!fromSession) showError(e?.message || '加载失败')
|
||||
if (!fromSession) showRequestError(e, '加载失败')
|
||||
if (fromSession) persistSession()
|
||||
} finally {
|
||||
loadingMaster.value = false
|
||||
@ -234,7 +234,7 @@
|
||||
scanNo.value = ''
|
||||
selectScanInput()
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '上板失败')
|
||||
showRequestError(e, '上板失败')
|
||||
selectScanInput()
|
||||
} finally {
|
||||
scanning.value = false
|
||||
@ -278,7 +278,7 @@
|
||||
active.value = await sealShipMaster(masterNo)
|
||||
showSuccess(`封板成功 ${masterNo}`)
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '封板失败')
|
||||
showRequestError(e, '封板失败')
|
||||
throw e
|
||||
} finally {
|
||||
sealing.value = false
|
||||
@ -314,7 +314,7 @@
|
||||
active.value = await getShipMaster(active.value.masterNo)
|
||||
showSuccess('已刷新', false)
|
||||
} catch (e: any) {
|
||||
showError(e?.message || '刷新失败')
|
||||
showRequestError(e, '刷新失败')
|
||||
}
|
||||
}
|
||||
|
||||
@ -370,7 +370,7 @@
|
||||
class="ops-scan-input"
|
||||
placeholder="扫描或输入内部主单号并回车"
|
||||
allow-clear
|
||||
@press-enter="withImeEnterGuard(() => loadMaster(false))"
|
||||
@press-enter="withImeEnterGuard(() => loadMaster(false), $event)"
|
||||
/>
|
||||
<a-input
|
||||
v-else
|
||||
@ -380,7 +380,7 @@
|
||||
:placeholder="scanPlaceholder"
|
||||
allow-clear
|
||||
:disabled="!isOpen"
|
||||
@press-enter="withImeEnterGuard(handleScan)"
|
||||
@press-enter="withImeEnterGuard(handleScan, $event)"
|
||||
@focus="selectScanInput"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@ -18,12 +18,22 @@
|
||||
"
|
||||
class="ops-scan-input"
|
||||
allow-clear
|
||||
@press-enter="withImeEnterGuard(onScanEnter)"
|
||||
@press-enter="withImeEnterGuard(onScanEnter, $event)"
|
||||
@clear="clearLookup"
|
||||
/>
|
||||
</div>
|
||||
<div class="ops-scan__row ops-scan__row--tools">
|
||||
<div class="ops-scan__opts">
|
||||
<a-select
|
||||
v-if="scanMode === 'parcel'"
|
||||
v-model="numberType"
|
||||
class="ops-type-select"
|
||||
:placeholder="$t('operation.printLabel.form.placeholder.numberType')"
|
||||
>
|
||||
<a-option v-for="item in numberTypeOptions" :key="item.value" :value="item.value">
|
||||
{{ item.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
<a-checkbox v-model="keepScanFocus" class="ops-opt">
|
||||
{{ $t('operation.common.keepScanFocus') }}
|
||||
</a-checkbox>
|
||||
@ -75,10 +85,27 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="candidates.length" class="ops-candidates">
|
||||
<a-alert type="warning" show-icon>
|
||||
{{ $t('operation.printLabel.preview.multiMatch') }}
|
||||
</a-alert>
|
||||
<button
|
||||
v-for="c in candidates"
|
||||
:key="c.orderId"
|
||||
type="button"
|
||||
class="ops-candidate"
|
||||
@click="selectCandidate(c)"
|
||||
>
|
||||
<div>
|
||||
<strong>{{ c.serviceNo || c.clientNo || `#${c.orderId}` }}</strong>
|
||||
<p>{{ c.clientNo || '-' }} · {{ c.trackNo || '-' }} · {{ c.orderStatusName || '-' }}</p>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<div v-else-if="formData.orderId" class="ops-panel">
|
||||
<div class="ops-hero">
|
||||
<div class="ops-hero__nos">
|
||||
<div class="ops-hero__waybill">{{ formData.waybillNumber || '-' }}</div>
|
||||
<div class="ops-hero__waybill">{{ lookedUpServiceNo || formData.waybillNumber || '-' }}</div>
|
||||
<div class="ops-hero__meta">
|
||||
<span>{{ $t('operation.outbound.form.salesProduct') }} {{ formData.salesProductName || '-' }}</span>
|
||||
<span>{{ $t('operation.outbound.form.destinationCountry') }} {{ formData.destinationCountryName || '-' }}</span>
|
||||
@ -177,7 +204,13 @@ import { useTableContainerHeight } from '@/composables/useTableContainerHeight'
|
||||
import { useOperationScanFocus } from '@/composables/useOperationScanFocus'
|
||||
import { withImeEnterGuard } from '@/utils/keyboard'
|
||||
import { useOperationScanFeedback } from '@/composables/useOperationScanFeedback'
|
||||
import { outboundCreate, outboundRecentList, outboundOrderLookup } from '@/api/operation'
|
||||
import { useOpsScanNumberType } from '@/composables/useOpsScanNumberType'
|
||||
import {
|
||||
outboundCreate,
|
||||
outboundRecentList,
|
||||
outboundOrderLookup,
|
||||
type OpsScanCandidate,
|
||||
} from '@/api/operation'
|
||||
import { outboundByBag } from '@/api/operation/shipContainer'
|
||||
import { withServerFilterColumns } from '@/utils/headerFilterAdapter'
|
||||
import { applyScanExtract, ensureScanExtractBundle } from '@/utils/scanExtract'
|
||||
@ -191,10 +224,11 @@ const {
|
||||
feedbackType,
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('outboundScan')
|
||||
const { numberType, numberTypeOptions } = useOpsScanNumberType('outboundScan')
|
||||
|
||||
defineOptions({ name: 'OutboundScan' })
|
||||
|
||||
@ -276,7 +310,7 @@ async function loadRecent() {
|
||||
const maxPage = Math.max(1, Math.ceil(filteredOrders.value.length / pageSize.value) || 1)
|
||||
if (currentPage.value > maxPage) currentPage.value = maxPage
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('operation.outbound.message.loadRecentFailed'))
|
||||
showRequestError(e, t('operation.outbound.message.loadRecentFailed'))
|
||||
recentOrders.value = []
|
||||
} finally {
|
||||
listLoading.value = false
|
||||
@ -297,6 +331,9 @@ function handlePageSizeChange(size: number) {
|
||||
}
|
||||
|
||||
const lookedUpWaybillNo = ref('')
|
||||
const lookedUpServiceNo = ref('')
|
||||
const lookedUpNumberType = ref('auto')
|
||||
const candidates = ref<OpsScanCandidate[]>([])
|
||||
|
||||
function clearLookupFields() {
|
||||
formData.salesProductName = ''
|
||||
@ -308,6 +345,9 @@ function clearLookupFields() {
|
||||
formData.width = ''
|
||||
formData.height = ''
|
||||
lookedUpWaybillNo.value = ''
|
||||
lookedUpServiceNo.value = ''
|
||||
lookedUpNumberType.value = numberType.value
|
||||
candidates.value = []
|
||||
}
|
||||
|
||||
function clearLookup() {
|
||||
@ -319,6 +359,18 @@ function hasMetrics() {
|
||||
return !!(formData.weight && formData.length && formData.width && formData.height)
|
||||
}
|
||||
|
||||
function applyLookupHit(info: Awaited<ReturnType<typeof outboundOrderLookup>>, scanNo: string) {
|
||||
formData.orderId = info.orderId
|
||||
formData.salesProductName = info.salesProductName || info.productCode || ''
|
||||
formData.destinationCountryName =
|
||||
info.destinationCountryName || info.destinationCountry || ''
|
||||
formData.serviceChannelName = info.serviceChannelName || info.channelCode || ''
|
||||
lookedUpWaybillNo.value = scanNo
|
||||
lookedUpServiceNo.value = info.serviceNo || scanNo
|
||||
lookedUpNumberType.value = numberType.value
|
||||
candidates.value = []
|
||||
}
|
||||
|
||||
/** 扫码后静默查单;不弹「匹配成功」,失败才提示 */
|
||||
async function ensureOrderLookup(): Promise<boolean> {
|
||||
const no = formData.waybillNumber?.trim()
|
||||
@ -326,21 +378,32 @@ async function ensureOrderLookup(): Promise<boolean> {
|
||||
clearLookup()
|
||||
return false
|
||||
}
|
||||
if (formData.orderId && lookedUpWaybillNo.value === no) {
|
||||
if (
|
||||
formData.orderId &&
|
||||
lookedUpWaybillNo.value === no &&
|
||||
lookedUpNumberType.value === numberType.value
|
||||
) {
|
||||
return true
|
||||
}
|
||||
lookingUp.value = true
|
||||
try {
|
||||
const info = await outboundOrderLookup(no)
|
||||
const info = await outboundOrderLookup(no, numberType.value)
|
||||
if (info?.candidates?.length && info.matched === false) {
|
||||
formData.orderId = undefined
|
||||
formData.salesProductName = ''
|
||||
formData.destinationCountryName = ''
|
||||
formData.serviceChannelName = ''
|
||||
lookedUpWaybillNo.value = no
|
||||
lookedUpServiceNo.value = ''
|
||||
lookedUpNumberType.value = numberType.value
|
||||
candidates.value = info.candidates
|
||||
showWarning(t('operation.printLabel.preview.multiMatch'))
|
||||
return false
|
||||
}
|
||||
if (!info?.orderId) {
|
||||
throw new Error(t('operation.common.message.orderNotFound'))
|
||||
}
|
||||
formData.orderId = info.orderId
|
||||
formData.salesProductName = info.salesProductName || info.productCode || ''
|
||||
formData.destinationCountryName =
|
||||
info.destinationCountryName || info.destinationCountry || ''
|
||||
formData.serviceChannelName = info.serviceChannelName || info.channelCode || ''
|
||||
lookedUpWaybillNo.value = no
|
||||
applyLookupHit(info, no)
|
||||
return true
|
||||
} catch (e: any) {
|
||||
formData.salesProductName = ''
|
||||
@ -348,7 +411,9 @@ async function ensureOrderLookup(): Promise<boolean> {
|
||||
formData.serviceChannelName = ''
|
||||
formData.orderId = undefined
|
||||
lookedUpWaybillNo.value = ''
|
||||
showError(e?.message || t('operation.common.message.orderNotFound'))
|
||||
lookedUpServiceNo.value = ''
|
||||
candidates.value = []
|
||||
showRequestError(e, t('operation.common.message.orderNotFound'))
|
||||
maybeRefocusScan()
|
||||
return false
|
||||
} finally {
|
||||
@ -356,6 +421,18 @@ async function ensureOrderLookup(): Promise<boolean> {
|
||||
}
|
||||
}
|
||||
|
||||
async function selectCandidate(c: OpsScanCandidate) {
|
||||
const serviceNo = String(c.serviceNo || '').trim()
|
||||
if (!serviceNo) {
|
||||
showWarning(t('operation.common.message.orderNotFound'))
|
||||
return
|
||||
}
|
||||
formData.waybillNumber = serviceNo
|
||||
numberType.value = 'waybill'
|
||||
candidates.value = []
|
||||
await ensureOrderLookup()
|
||||
}
|
||||
|
||||
async function onScanEnter() {
|
||||
if (scanMode.value === 'bag') {
|
||||
await handleSubmit()
|
||||
@ -388,7 +465,7 @@ async function handleSubmit() {
|
||||
await loadRecent()
|
||||
maybeRefocusScan()
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('operation.outbound.message.outboundFailed'))
|
||||
showRequestError(e, t('operation.outbound.message.outboundFailed'))
|
||||
maybeRefocusScan()
|
||||
} finally {
|
||||
submitting.value = false
|
||||
@ -404,7 +481,8 @@ async function handleSubmit() {
|
||||
submitting.value = true
|
||||
try {
|
||||
await outboundCreate({
|
||||
waybillNo: formData.waybillNumber.trim(),
|
||||
waybillNo: lookedUpServiceNo.value || formData.waybillNumber.trim(),
|
||||
numberType: lookedUpServiceNo.value ? 'waybill' : numberType.value,
|
||||
weight: formData.weight ? Number(formData.weight) : undefined,
|
||||
length: formData.length ? Number(formData.length) : undefined,
|
||||
width: formData.width ? Number(formData.width) : undefined,
|
||||
@ -415,7 +493,7 @@ async function handleSubmit() {
|
||||
await loadRecent()
|
||||
maybeRefocusScan()
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('operation.outbound.message.outboundFailed'))
|
||||
showRequestError(e, t('operation.outbound.message.outboundFailed'))
|
||||
maybeRefocusScan()
|
||||
} finally {
|
||||
submitting.value = false
|
||||
@ -432,10 +510,19 @@ watch(
|
||||
formData.destinationCountryName = ''
|
||||
formData.serviceChannelName = ''
|
||||
lookedUpWaybillNo.value = ''
|
||||
lookedUpServiceNo.value = ''
|
||||
candidates.value = []
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
watch(numberType, () => {
|
||||
formData.orderId = undefined
|
||||
lookedUpWaybillNo.value = ''
|
||||
lookedUpServiceNo.value = ''
|
||||
candidates.value = []
|
||||
})
|
||||
|
||||
function handleReset(clearStatus = true) {
|
||||
formData.waybillNumber = ''
|
||||
clearLookupFields()
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
class="pl-scan-input"
|
||||
allow-clear
|
||||
:disabled="busy"
|
||||
@press-enter="withImeEnterGuard(onScanEnter)"
|
||||
@press-enter="withImeEnterGuard(onScanEnter, $event)"
|
||||
/>
|
||||
<div class="pl-scan-bar__actions">
|
||||
<a-button
|
||||
|
||||
@ -245,6 +245,54 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.ops-type-select {
|
||||
flex: 0 0 auto;
|
||||
width: 124px;
|
||||
|
||||
:deep(.arco-select-view-single) {
|
||||
width: 100%;
|
||||
min-height: 32px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.ops-candidates {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
.ops-candidate {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid var(--color-border-2);
|
||||
border-radius: 6px;
|
||||
background: var(--color-fill-1);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--app-primary-color);
|
||||
}
|
||||
|
||||
strong {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
color: var(--color-text-1);
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 4px 0 0;
|
||||
font-size: 12px;
|
||||
color: var(--color-text-3);
|
||||
}
|
||||
}
|
||||
|
||||
.ops-opt {
|
||||
white-space: nowrap;
|
||||
color: var(--color-text-2);
|
||||
|
||||
@ -62,6 +62,7 @@
|
||||
import { getMapIdFromAccessToken } from '@/utils/jwt';
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { useWarehouseAdminCustomer } from '@/composables/useWarehouseAdminCustomer';
|
||||
import { useCountryRegionSelects } from '@/composables/useCountryRegionSelects';
|
||||
import { useEdiBatchPanel } from '@/composables/useEdiBatchPanel';
|
||||
import {
|
||||
checkCustomerContactRequired,
|
||||
@ -1327,6 +1328,7 @@
|
||||
if (needOptional) {
|
||||
showRecipientOptional.value = true;
|
||||
}
|
||||
void hydrateReceiverRegionSelects();
|
||||
}
|
||||
|
||||
function buildReceiverParseTip(result: {
|
||||
@ -2067,6 +2069,7 @@
|
||||
if (id == null) {
|
||||
if (!silentEmpty) {
|
||||
Object.assign(singleForm.receiver, emptyReceiverForm());
|
||||
resetReceiverRegionSelects();
|
||||
}
|
||||
selectedReceiverAddressId.value = undefined;
|
||||
return;
|
||||
@ -2078,6 +2081,7 @@
|
||||
...hit.data,
|
||||
});
|
||||
selectedReceiverAddressId.value = id;
|
||||
void hydrateReceiverRegionSelects();
|
||||
}
|
||||
|
||||
async function loadReceiverAddressOptions({ applyDefault = false } = {}) {
|
||||
@ -2306,6 +2310,17 @@
|
||||
],
|
||||
});
|
||||
|
||||
const {
|
||||
provinceLoading: receiverProvinceLoading,
|
||||
cityLoading: receiverCityLoading,
|
||||
provinceOptions: receiverProvinceOptions,
|
||||
cityOptions: receiverCityOptions,
|
||||
onCountryChange: onReceiverCountryChange,
|
||||
onProvinceChange: onReceiverProvinceChange,
|
||||
hydrateRegionSelects: hydrateReceiverRegionSelects,
|
||||
resetRegionSelects: resetReceiverRegionSelects,
|
||||
} = useCountryRegionSelects(singleForm.receiver);
|
||||
|
||||
const needExportQualification = computed(() =>
|
||||
isExportCustomsMode9610Summary(singleForm.exportCustomsMode),
|
||||
);
|
||||
@ -2910,6 +2925,7 @@
|
||||
if (countryCode) {
|
||||
singleForm.receiver.countryCode = countryCode;
|
||||
filled.push(t('order.placeOrder.fromPriceCheck.item.destCountry'));
|
||||
void hydrateReceiverRegionSelects();
|
||||
}
|
||||
if (zipCode) {
|
||||
singleForm.receiver.zipCode = zipCode;
|
||||
@ -3501,6 +3517,7 @@
|
||||
singleForm.receiver.certificateNo = '';
|
||||
singleForm.receiver.eori = '';
|
||||
singleForm.receiver.vat = '';
|
||||
void hydrateReceiverRegionSelects();
|
||||
|
||||
singleForm.items = [
|
||||
{
|
||||
@ -3668,6 +3685,7 @@
|
||||
singleForm.items = [emptyDeclarationItem()];
|
||||
selectedSenderAddressId.value = undefined;
|
||||
selectedReceiverAddressId.value = undefined;
|
||||
resetReceiverRegionSelects();
|
||||
singleShowFieldErrors.value = false;
|
||||
singleAgreementChecked.value = false;
|
||||
priceCheckHandoff.value = null;
|
||||
@ -4524,6 +4542,7 @@
|
||||
allow-search
|
||||
placeholder="请选择"
|
||||
:loading="singleReferenceLoading"
|
||||
@change="onReceiverCountryChange"
|
||||
>
|
||||
<a-option
|
||||
v-for="opt in singleCountryOptions"
|
||||
@ -4552,10 +4571,29 @@
|
||||
<a-input v-model="singleForm.receiver.streetAddress1" />
|
||||
</a-form-item>
|
||||
<a-form-item label="省/州">
|
||||
<a-input v-model="singleForm.receiver.province" />
|
||||
<a-select
|
||||
v-model="singleForm.receiver.province"
|
||||
:options="receiverProvinceOptions"
|
||||
:loading="receiverProvinceLoading"
|
||||
allow-search
|
||||
allow-create
|
||||
allow-clear
|
||||
:placeholder="t('user.senderAddress.placeholder.province')"
|
||||
:disabled="!singleForm.receiver.countryCode"
|
||||
@change="onReceiverProvinceChange"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="城市">
|
||||
<a-input v-model="singleForm.receiver.city" />
|
||||
<a-select
|
||||
v-model="singleForm.receiver.city"
|
||||
:options="receiverCityOptions"
|
||||
:loading="receiverCityLoading"
|
||||
allow-search
|
||||
allow-create
|
||||
allow-clear
|
||||
:placeholder="t('user.senderAddress.placeholder.city')"
|
||||
:disabled="!singleForm.receiver.countryCode"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="门牌号">
|
||||
<a-input v-model="singleForm.receiver.streetNumber" />
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { applyDocumentFavicon, fetchBrandLogoUrlsPublic } from '@/utils/brandLogo';
|
||||
import { brandLogoImages } from '@/utils/brandLogo';
|
||||
import { useUserStore } from '@/store';
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { applyRbacUserToUserStore } from '@/utils/enter-system';
|
||||
@ -156,11 +156,7 @@
|
||||
const rbacUserStore = useRbacUserStore();
|
||||
const signedIn = computed(() => rbacUserStore.isLoggedIn);
|
||||
const homeUrl = officialAppHomeUrl();
|
||||
const siteLogoSrc = ref('');
|
||||
void fetchBrandLogoUrlsPublic().then((urls) => {
|
||||
siteLogoSrc.value = urls.site || '';
|
||||
applyDocumentFavicon(urls.favicon);
|
||||
});
|
||||
const siteLogoSrc = computed(() => brandLogoImages.site);
|
||||
|
||||
function onLoginClick(e: MouseEvent) {
|
||||
goOfficialLogin(router, undefined, e);
|
||||
|
||||
@ -660,7 +660,11 @@ import {
|
||||
type PaymentReceiveQrChannel,
|
||||
type SystemOtherConfigDto,
|
||||
} from '@/api/system/otherConfig'
|
||||
import { applyAppMascot, applyDocumentFavicon } from '@/utils/brandLogo'
|
||||
import {
|
||||
brandLogoImages,
|
||||
clearCachedBrandImage,
|
||||
rememberBrandImageFile,
|
||||
} from '@/utils/brandLogo'
|
||||
import {
|
||||
getWechatOrderNotifyTemplates,
|
||||
saveWechatOrderNotifyTemplate,
|
||||
@ -1512,17 +1516,14 @@ async function uploadBrandLogoFile(channel: BrandLogoChannel, file: File) {
|
||||
brandLogoUploading[channel] = true
|
||||
try {
|
||||
const data = await uploadBrandLogo(channel, file)
|
||||
await rememberBrandImageFile(
|
||||
channel,
|
||||
file,
|
||||
pickBrandLogoUrl(data as any, `${channel}Url`, `${channel[0].toUpperCase()}${channel.slice(1)}Url`),
|
||||
)
|
||||
applyBrandLogoDto(data)
|
||||
brandLogoUrls[channel] = brandLogoImages[channel] || brandLogoUrls[channel]
|
||||
revokeBrandLogoLocalPreview(channel)
|
||||
if (channel === 'favicon') {
|
||||
applyDocumentFavicon(brandLogoUrls.favicon || pickBrandLogoUrl(data as any, 'faviconUrl', 'FaviconUrl'))
|
||||
}
|
||||
if (channel === 'mascot') {
|
||||
applyAppMascot(
|
||||
resolveOmsAssetUrl(pickBrandLogoUrl(data as any, 'mascotUrl', 'MascotUrl')) ||
|
||||
brandLogoUrls.mascot,
|
||||
)
|
||||
}
|
||||
Message.success(t('system.otherConfig.brandLogo.uploadSuccess'))
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || t('system.otherConfig.brandLogo.uploadFailed'))
|
||||
@ -1535,14 +1536,9 @@ async function handleBrandLogoClear(channel: BrandLogoChannel) {
|
||||
brandLogoUploading[channel] = true
|
||||
try {
|
||||
const data = await clearBrandLogo(channel)
|
||||
clearCachedBrandImage(channel)
|
||||
revokeBrandLogoLocalPreview(channel)
|
||||
applyBrandLogoDto(data)
|
||||
if (channel === 'favicon') {
|
||||
applyDocumentFavicon('')
|
||||
}
|
||||
if (channel === 'mascot') {
|
||||
applyAppMascot('')
|
||||
}
|
||||
Message.success(t('system.otherConfig.brandLogo.clearSuccess'))
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || t('system.otherConfig.brandLogo.clearFailed'))
|
||||
|
||||
@ -137,7 +137,7 @@ const {
|
||||
feedbackType,
|
||||
feedbackMessage,
|
||||
clearFeedback,
|
||||
showError,
|
||||
showRequestError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} = useOperationScanFeedback('parcelArrival')
|
||||
@ -199,7 +199,7 @@ async function loadList() {
|
||||
tableRows.value = (items || []).map((item: Record<string, unknown>) => mapRow(item))
|
||||
totalCount.value = Number(total || 0)
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('warehouse.parcelArrival.message.loadFailed'))
|
||||
showRequestError(e, t('warehouse.parcelArrival.message.loadFailed'))
|
||||
tableRows.value = []
|
||||
totalCount.value = 0
|
||||
} finally {
|
||||
@ -275,7 +275,7 @@ async function handleSubmit() {
|
||||
await loadList()
|
||||
maybeRefocusScan()
|
||||
} catch (e: any) {
|
||||
showError(e?.message || t('warehouse.parcelArrival.message.arriveFailed'))
|
||||
showRequestError(e, t('warehouse.parcelArrival.message.arriveFailed'))
|
||||
maybeRefocusScan()
|
||||
} finally {
|
||||
submitting.value = false
|
||||
|
||||
Loading…
Reference in New Issue
Block a user