feat: 培训与各模块指引补强,指引菜单置末,客户侧栏仓切换改版
Some checks failed
Build and Deploy Front / deploy (push) Has been cancelled

补仓储/操作指引与报错排查表,统一指引命名与同步排序;培训手册分角色强化;客户底栏改为 Workspace Switcher 式换仓 Popover。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zzh 2026-11-15 21:55:08 +08:00
parent 2ac6ec85cd
commit 49ca5072c4
53 changed files with 3448 additions and 965 deletions

1
src/components.d.ts vendored
View File

@ -79,5 +79,6 @@ declare module 'vue' {
UserEditDrawer: typeof import('./components/UserEditDrawer/index.vue')['default']
UserProfileFields: typeof import('./components/UserProfileFields/index.vue')['default']
WarehouseAddressPeekModal: typeof import('./components/customer-side-rail/WarehouseAddressPeekModal.vue')['default']
WarehouseSwitcherPopover: typeof import('./components/customer-side-rail/WarehouseSwitcherPopover.vue')['default']
}
}

View File

@ -1,19 +1,9 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
import { watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { Message } from '@arco-design/web-vue'
import ModalPro from '@/components/ModalPro/index.vue'
import useModal from '@/components/ModalPro/useModal'
import { getWarehouseList, type WarehouseDto } from '@/api/system/warehouse'
import { resolveCurrentCustomer } from '@/api/customer/resolve'
import {
compareWarehouseSort,
formatWarehouseShipAddress,
formatWarehouseShipRecipient,
} from '@/utils/warehouseShipAddress'
import { getMapIdFromAccessToken } from '@/utils/jwt'
import { useRbacUserStore } from '@/store/modules/rbac-user'
import { useCurrentWarehouseStore } from '@/store'
import { useWarehousePeek } from './useWarehousePeek'
const props = defineProps<{
visible: boolean
@ -25,140 +15,18 @@ const emit = defineEmits<{
const { t } = useI18n()
const [registerModal] = useModal()
const rbacUserStore = useRbacUserStore()
const warehouseStore = useCurrentWarehouseStore()
const loading = ref(false)
const list = ref<WarehouseDto[]>([])
const customerCode = ref('')
const currentId = computed(() => warehouseStore.warehouseId)
const orderedList = computed(() => {
const rows = [...list.value]
const cur = currentId.value
if (!cur) return rows
return rows.sort((a, b) => {
const aCur = Number(a.id) === cur ? 0 : 1
const bCur = Number(b.id) === cur ? 0 : 1
if (aCur !== bCur) return aCur - bCur
return compareWarehouseSort(a, b)
})
})
function pick(raw: any, ...keys: string[]) {
for (const k of keys) {
const v = raw?.[k]
if (v !== undefined && v !== null && String(v).trim() !== '') return String(v)
}
return ''
}
function normalize(row: any): WarehouseDto {
const sortRaw = row?.sort ?? row?.Sort
const sortNum = sortRaw == null || sortRaw === '' ? null : Number(sortRaw)
return {
id: row?.id ?? row?.Id,
warehouseName: pick(row, 'warehouseName', 'WarehouseName'),
warehouseType: pick(row, 'warehouseType', 'WarehouseType') || undefined,
warehouseTypeName: pick(row, 'warehouseTypeName', 'WarehouseTypeName') || undefined,
recipient: pick(row, 'recipient', 'Recipient'),
contactPhone: pick(row, 'contactPhone', 'ContactPhone'),
shippingAddress: pick(row, 'shippingAddress', 'ShippingAddress'),
sort: sortNum != null && Number.isFinite(sortNum) ? sortNum : null,
remark: pick(row, 'remark', 'Remark') || undefined,
}
}
function displayRecipient(item: WarehouseDto) {
return formatWarehouseShipRecipient(item.recipient, customerCode.value)
}
function displayAddress(item: WarehouseDto) {
return formatWarehouseShipAddress(item.shippingAddress, customerCode.value)
}
function buildCopyText(item: WarehouseDto) {
return [
item.warehouseName || '-',
`${t('system.warehouseAddress.fields.recipient')}: ${displayRecipient(item)}`,
`${t('system.warehouseAddress.fields.contactPhone')}: ${item.contactPhone || '-'}`,
`${t('system.warehouseAddress.fields.shippingAddress')}: ${displayAddress(item)}`,
].join('\n')
}
async function copyText(text: string) {
try {
await navigator.clipboard.writeText(text)
Message.success(t('system.warehouseAddress.message.copySuccess'))
} catch {
Message.error(t('system.warehouseAddress.message.copyFailed'))
}
}
function copyItem(item: WarehouseDto) {
void copyText(buildCopyText(item))
}
function copyField(value: string) {
const text = String(value || '').trim()
if (!text || text === '-') {
Message.warning(t('nav.warehousePeek.emptyField'))
return
}
void copyText(text)
}
async function loadCustomerCode() {
try {
const mapId = getMapIdFromAccessToken(rbacUserStore.accessToken)
const account = rbacUserStore.userInfo?.account?.trim() || ''
const data = await resolveCurrentCustomer({ mapId, account })
customerCode.value = String(data?.customerCode ?? '').trim()
} catch {
customerCode.value = ''
}
}
function syncWarehouseOptions(rows: WarehouseDto[]) {
warehouseStore.setOptions(
rows
.filter((row) => row.id != null)
.map((row) => ({
label: row.warehouseName || String(row.id),
value: Number(row.id),
})),
)
}
function selectWarehouse(item: WarehouseDto) {
const id = Number(item.id)
if (!id) return
if (id === currentId.value) return
syncWarehouseOptions(list.value)
warehouseStore.setWarehouseId(id)
Message.success(
t('nav.warehousePeek.switched', {
name: item.warehouseName || String(id),
}),
)
}
async function loadList() {
loading.value = true
try {
const [res] = await Promise.all([
getWarehouseList({ page: 1, pageSize: 100 }),
loadCustomerCode(),
])
list.value = (res.items ?? []).map(normalize).sort(compareWarehouseSort)
syncWarehouseOptions(list.value)
} catch {
list.value = []
} finally {
loading.value = false
}
}
const {
loading,
customerCode,
currentId,
orderedList,
displayRecipient,
displayAddress,
copyItem,
copyField,
selectWarehouse,
loadList,
} = useWarehousePeek()
function onUpdateVisible(val: boolean) {
emit('update:visible', val)

View File

@ -0,0 +1,422 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { IconCheck, IconCopy, IconHome, IconSearch } from '@arco-design/web-vue/es/icon'
import type { WarehouseDto } from '@/api/system/warehouse'
import { useWarehousePeek } from './useWarehousePeek'
const props = defineProps<{
/** 与 trigger 的 popup-visible 同步;打开时拉列表 */
active: boolean
}>()
const emit = defineEmits<{
close: []
openFull: []
}>()
const { t } = useI18n()
const {
loading,
customerCode,
currentId,
currentItem,
orderedList,
displayRecipient,
displayAddress,
copyItem,
copyField,
selectWarehouse,
loadList,
} = useWarehousePeek()
const filterKeyword = ref('')
const SEARCH_THRESHOLD = 6
const showSearch = computed(() => orderedList.value.length >= SEARCH_THRESHOLD)
const filteredList = computed(() => {
const q = filterKeyword.value.trim().toLowerCase()
if (!q) return orderedList.value
return orderedList.value.filter((row) =>
String(row.warehouseName || '')
.toLowerCase()
.includes(q),
)
})
watch(
() => props.active,
(open) => {
if (open) {
filterKeyword.value = ''
void loadList()
}
},
)
function onSelect(item: WarehouseDto) {
const switched = selectWarehouse(item)
if (switched || Number(item.id) === currentId.value) {
emit('close')
}
}
function onOpenFull() {
emit('close')
emit('openFull')
}
function onListKeydown(e: KeyboardEvent, item: WarehouseDto, index: number) {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault()
onSelect(item)
return
}
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
e.preventDefault()
const delta = e.key === 'ArrowDown' ? 1 : -1
const next = index + delta
if (next < 0 || next >= filteredList.value.length) return
const el = document.getElementById(`csr-wh-opt-${filteredList.value[next]?.id}`)
el?.focus()
}
}
</script>
<template>
<div class="wh-switcher" role="dialog" :aria-label="t('nav.warehousePeek.switchTitle')">
<header class="wh-switcher__head">
<div class="wh-switcher__title">
<span>{{ t('nav.warehousePeek.switchTitle') }}</span>
<span v-if="customerCode" class="wh-switcher__code">{{ customerCode }}</span>
</div>
<p class="wh-switcher__tip">{{ t('nav.warehousePeek.tip') }}</p>
</header>
<div v-if="showSearch" class="wh-switcher__search">
<icon-search class="wh-switcher__search-icon" />
<input
v-model="filterKeyword"
type="search"
class="wh-switcher__search-input"
:placeholder="t('nav.warehousePeek.searchPlaceholder')"
autocomplete="off"
/>
</div>
<a-spin :loading="loading" class="wh-switcher__spin">
<div
v-if="!filteredList.length && !loading"
class="wh-switcher__empty"
>
{{ t('nav.warehousePeek.empty') }}
</div>
<ul class="wh-switcher__list" role="listbox" :aria-label="t('nav.warehousePeek.switchTitle')">
<li
v-for="(item, index) in filteredList"
:id="`csr-wh-opt-${item.id}`"
:key="String(item.id)"
role="option"
tabindex="0"
class="wh-switcher__option"
:class="{ 'is-current': Number(item.id) === currentId }"
:aria-selected="Number(item.id) === currentId"
@click="onSelect(item)"
@keydown="onListKeydown($event, item, index)"
>
<icon-home class="wh-switcher__option-icon" />
<span class="wh-switcher__option-name">{{ item.warehouseName || '-' }}</span>
<icon-check
v-if="Number(item.id) === currentId"
class="wh-switcher__option-check"
/>
</li>
</ul>
<section v-if="currentItem" class="wh-switcher__summary" @click.stop>
<div class="wh-switcher__summary-head">
<span>{{ t('nav.warehousePeek.addressSummary') }}</span>
<button
type="button"
class="wh-switcher__copy-all"
@click="copyItem(currentItem)"
>
<icon-copy />
{{ t('nav.warehousePeek.copyAll') }}
</button>
</div>
<div class="wh-switcher__row">
<span class="wh-switcher__label">{{ t('system.warehouseAddress.fields.recipient') }}</span>
<span class="wh-switcher__value" :title="displayRecipient(currentItem)">
{{ displayRecipient(currentItem) }}
</span>
<button type="button" class="wh-switcher__copy" @click="copyField(displayRecipient(currentItem))">
<icon-copy />
</button>
</div>
<div class="wh-switcher__row">
<span class="wh-switcher__label">{{ t('system.warehouseAddress.fields.contactPhone') }}</span>
<span class="wh-switcher__value" :title="currentItem.contactPhone || '-'">
{{ currentItem.contactPhone || '-' }}
</span>
<button type="button" class="wh-switcher__copy" @click="copyField(currentItem.contactPhone || '')">
<icon-copy />
</button>
</div>
<div class="wh-switcher__row">
<span class="wh-switcher__label">{{ t('system.warehouseAddress.fields.shippingAddress') }}</span>
<span class="wh-switcher__value" :title="displayAddress(currentItem)">
{{ displayAddress(currentItem) }}
</span>
<button type="button" class="wh-switcher__copy" @click="copyField(displayAddress(currentItem))">
<icon-copy />
</button>
</div>
</section>
</a-spin>
<footer class="wh-switcher__foot">
<button type="button" class="wh-switcher__full" @click="onOpenFull">
{{ t('nav.warehousePeek.viewFull') }}
</button>
</footer>
</div>
</template>
<style scoped lang="less">
.wh-switcher {
width: min(320px, 86vw);
max-height: min(70vh, 520px);
display: flex;
flex-direction: column;
padding: 10px 0 8px;
color: var(--color-text-1);
&__head {
padding: 0 12px 8px;
}
&__title {
display: flex;
align-items: center;
gap: 8px;
font-size: 13px;
font-weight: 650;
}
&__code {
padding: 1px 6px;
border-radius: 4px;
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 10%, #fff);
color: var(--app-primary-color, #1d7281);
font-size: 11px;
font-weight: 700;
font-variant-numeric: tabular-nums;
}
&__tip {
margin: 4px 0 0;
color: var(--color-text-3);
font-size: 11px;
line-height: 1.4;
}
&__search {
position: relative;
margin: 0 12px 8px;
}
&__search-icon {
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
color: var(--color-text-4);
font-size: 13px;
pointer-events: none;
}
&__search-input {
width: 100%;
height: 32px;
padding: 0 10px 0 30px;
border: 1px solid var(--color-border-2, #e5e6eb);
border-radius: 6px;
background: #fff;
color: var(--color-text-1);
font-size: 13px;
outline: none;
&:focus {
border-color: color-mix(in srgb, var(--app-primary-color, #1d7281) 45%, transparent);
}
}
&__spin {
display: block;
flex: 1;
min-height: 0;
overflow: auto;
padding: 0 6px;
}
&__empty {
padding: 24px 12px;
text-align: center;
color: var(--color-text-3);
font-size: 13px;
}
&__list {
margin: 0;
padding: 0;
list-style: none;
}
&__option {
display: flex;
align-items: center;
gap: 8px;
min-height: 36px;
padding: 6px 10px;
border-radius: 6px;
cursor: pointer;
outline: none;
transition: background-color 0.14s ease;
&:hover,
&:focus-visible {
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 8%, #fff);
}
&.is-current {
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 10%, #fff);
}
}
&__option-icon {
flex-shrink: 0;
color: var(--app-primary-color, #1d7281);
font-size: 14px;
}
&__option-name {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 13px;
font-weight: 550;
}
&__option-check {
flex-shrink: 0;
color: var(--app-primary-color, #1d7281);
font-size: 14px;
}
&__summary {
margin: 8px 6px 0;
padding: 8px 10px;
border-radius: 8px;
border: 1px solid var(--color-border-2, #e5e6eb);
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 4%, #fff);
}
&__summary-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 6px;
color: var(--color-text-2);
font-size: 12px;
font-weight: 600;
}
&__copy-all {
display: inline-flex;
align-items: center;
gap: 4px;
height: 24px;
padding: 0 8px;
border: none;
border-radius: 4px;
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 10%, #fff);
color: var(--app-primary-color, #1d7281);
font-size: 11px;
font-weight: 600;
cursor: pointer;
&:hover {
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 16%, #fff);
}
}
&__row {
display: grid;
grid-template-columns: 52px minmax(0, 1fr) 22px;
align-items: start;
gap: 4px;
padding: 4px 0;
}
&__label {
color: var(--color-text-3);
font-size: 11px;
line-height: 1.45;
}
&__value {
min-width: 0;
color: var(--color-text-1);
font-size: 12px;
line-height: 1.45;
word-break: break-word;
}
&__copy {
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
border: none;
border-radius: 4px;
background: transparent;
color: var(--color-text-4);
cursor: pointer;
font-size: 12px;
&:hover {
color: var(--app-primary-color, #1d7281);
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 8%, #fff);
}
}
&__foot {
padding: 8px 12px 0;
border-top: 1px solid var(--color-border-2, rgba(0, 0, 0, 0.06));
margin-top: 8px;
}
&__full {
width: 100%;
height: 32px;
border: none;
border-radius: 6px;
background: transparent;
color: var(--app-primary-color, #1d7281);
font-size: 12px;
font-weight: 600;
cursor: pointer;
&:hover {
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 8%, #fff);
}
}
}
</style>

View File

@ -83,8 +83,54 @@
</section>
</div>
<!-- 底栏:头像+消息+打印 → 仓库+收起(昵称/余额进头像菜单) -->
<!-- 底栏:当前仓(一级)→ 头像/消息/打印/收起(二级) -->
<div class="customer-side-rail__dock">
<a-trigger
v-model:popup-visible="warehouseSwitcherVisible"
trigger="click"
position="tr"
:popup-translate="[0, -8]"
unmount-on-close
content-class="csr-warehouse-switcher-popup"
>
<a-tooltip
:content="warehouseDockTitle"
position="right"
:disabled="!compactLayout || warehouseSwitcherVisible"
>
<button
type="button"
class="customer-side-rail__warehouse-chip"
:class="{
'is-compact': compactLayout,
'is-open': warehouseSwitcherVisible,
}"
:aria-label="warehouseDockTitle"
aria-haspopup="listbox"
:aria-expanded="warehouseSwitcherVisible"
>
<icon-home class="customer-side-rail__warehouse-chip-icon" />
<span v-if="!compactLayout" class="customer-side-rail__warehouse-chip-body">
<span class="customer-side-rail__warehouse-chip-label">
{{ t('nav.warehousePeek.shipLabel') }}
</span>
<span class="customer-side-rail__warehouse-chip-name">{{ warehouseDockName }}</span>
</span>
<icon-down
v-if="!compactLayout"
class="customer-side-rail__warehouse-chip-chevron"
/>
</button>
</a-tooltip>
<template #content>
<WarehouseSwitcherPopover
:active="warehouseSwitcherVisible"
@close="warehouseSwitcherVisible = false"
@open-full="openWarehouseAddressPeek"
/>
</template>
</a-trigger>
<div
class="customer-side-rail__toolbar"
:class="{ 'is-account-active': isAccountRouteActive || isBalanceRouteActive }"
@ -138,19 +184,6 @@
</a-doption>
</template>
</a-dropdown>
</div>
<div class="customer-side-rail__footer-row">
<button
type="button"
class="customer-side-rail__warehouse-btn"
:class="{ 'is-compact': compactLayout }"
:title="warehouseDockTitle"
:aria-label="warehouseDockTitle"
@click="openWarehouseAddressPeek"
>
<span class="customer-side-rail__warehouse-btn-text">{{ warehouseDockLabel }}</span>
</button>
<button
type="button"
class="customer-side-rail__toggle"
@ -177,6 +210,8 @@ import { Message } from '@arco-design/web-vue'
import {
IconDoubleLeft,
IconDoubleRight,
IconDown,
IconHome,
IconPrinter,
IconRefresh,
} from '@arco-design/web-vue/es/icon'
@ -218,6 +253,7 @@ import { openPortalSideDrawer } from '@/views/user/portal-drawer/usePortalSideDr
import RightTopMessage from '@/components/top-nav/RightTopMessage.vue'
import RightTopUser from '@/components/top-nav/RightTopUser.vue'
import WarehouseAddressPeekModal from '@/components/customer-side-rail/WarehouseAddressPeekModal.vue'
import WarehouseSwitcherPopover from '@/components/customer-side-rail/WarehouseSwitcherPopover.vue'
const { t, te, locale } = useI18n()
const route = useRoute()
@ -325,6 +361,7 @@ function handleCustomerBalanceChanged() {
}
const warehousePeekVisible = ref(false)
const warehouseSwitcherVisible = ref(false)
const warehouseDockName = computed(
() =>
@ -332,20 +369,19 @@ const warehouseDockName = computed(
t('nav.contactService.selectWarehouse'),
)
const warehouseDockLabel = computed(() => {
const name = warehouseDockName.value
if (compactLayout.value) return name.slice(0, 1) || '仓'
return name
})
const warehouseDockTitle = computed(
() => `${t('nav.warehousePeek.title')}: ${warehouseDockName.value}`,
const warehouseDockTitle = computed(() =>
t('nav.warehousePeek.currentPrefix', { name: warehouseDockName.value }),
)
function openWarehouseAddressPeek() {
warehouseSwitcherVisible.value = false
warehousePeekVisible.value = true
}
watch(compactLayout, () => {
warehouseSwitcherVisible.value = false
})
async function ensureWarehouseOptions() {
try {
const { items } = await getWarehouseList({ page: 1, pageSize: 100 })
@ -636,70 +672,21 @@ onUnmounted(() => {
border-bottom: 1px solid var(--color-border-2, rgba(0, 0, 0, 0.06));
}
&__footer-row {
display: flex;
align-items: center;
gap: 2px;
min-width: 0;
}
&__warehouse-btn {
flex: 1;
display: inline-flex;
align-items: center;
min-width: 0;
height: 30px;
padding: 0 8px;
border: none;
border-radius: 6px;
background: rgba(255, 255, 255, 0.55);
color: var(--color-text-2);
font-size: 12px;
font-weight: 500;
line-height: 1.2;
cursor: pointer;
text-align: left;
transition: color 0.14s ease, background-color 0.14s ease;
&:hover {
color: var(--app-primary-color, #1d7281);
background: rgba(255, 255, 255, 0.92);
}
&.is-compact {
flex: 0 0 auto;
width: 36px;
min-width: 36px;
height: 28px;
padding: 0;
justify-content: center;
text-align: center;
background: transparent;
}
}
&__warehouse-btn-text {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&__message-slot {
flex: 1;
flex: 0 0 auto;
min-width: 0;
display: flex;
justify-content: center;
:deep(.message-dropdown-trigger) {
width: 100%;
max-width: 56px;
height: 30px;
width: 32px;
max-width: none;
height: 32px;
justify-content: center;
padding: 0 4px;
padding: 0;
border-radius: 6px;
color: var(--color-text-2);
gap: 2px;
gap: 0;
}
:deep(.message-dropdown-trigger:hover) {
@ -914,20 +901,102 @@ onUnmounted(() => {
flex-shrink: 0;
display: flex;
flex-direction: column;
gap: 4px;
padding: 8px var(--csr-pad-x) 8px;
gap: 8px;
padding: 10px var(--csr-pad-x) 10px;
border-top: 1px solid var(--color-border-2, rgba(0, 0, 0, 0.06));
}
/* 工具条:头像 + 消息 + 打印 */
/* 一级:当前仓 Workspace Switcher */
&__warehouse-chip {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
min-width: 0;
height: 40px;
padding: 0 10px;
border: 1px solid color-mix(in srgb, var(--app-primary-color, #1d7281) 16%, transparent);
border-radius: 8px;
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 6%, #fff);
color: var(--color-text-1);
cursor: pointer;
text-align: left;
transition:
background-color 0.14s ease,
border-color 0.14s ease,
box-shadow 0.14s ease;
&:hover {
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 10%, #fff);
border-color: color-mix(in srgb, var(--app-primary-color, #1d7281) 28%, transparent);
}
&.is-open {
border-color: color-mix(in srgb, var(--app-primary-color, #1d7281) 40%, transparent);
box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-primary-color, #1d7281) 12%, transparent);
.customer-side-rail__warehouse-chip-chevron {
transform: rotate(180deg);
}
}
&.is-compact {
width: 40px;
height: 40px;
padding: 0;
justify-content: center;
gap: 0;
}
}
&__warehouse-chip-icon {
flex-shrink: 0;
font-size: 16px;
color: var(--app-primary-color, #1d7281);
}
&__warehouse-chip-body {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 1px;
}
&__warehouse-chip-label {
font-size: 11px;
line-height: 1.2;
color: var(--color-text-3);
font-weight: 500;
}
&__warehouse-chip-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 13px;
font-weight: 650;
line-height: 1.25;
color: var(--color-text-1);
}
&__warehouse-chip-chevron {
flex-shrink: 0;
font-size: 12px;
color: var(--color-text-3);
transition: transform 0.16s ease;
}
/* 二级:头像 + 消息 + 打印 + 收起 */
&__toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 2px;
min-width: 0;
padding: 2px;
border-radius: 8px;
background: rgba(255, 255, 255, 0.45);
background: transparent;
transition:
background-color 0.14s ease,
box-shadow 0.14s ease;
@ -945,8 +1014,8 @@ onUnmounted(() => {
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 30px;
height: 30px;
width: 32px;
height: 32px;
border: none;
border-radius: 6px;
background: transparent;
@ -996,8 +1065,8 @@ onUnmounted(() => {
:deep(.user-dropdown-trigger),
:deep(.user-dropdown-trigger.is-compact) {
width: 30px;
height: 30px;
width: 32px;
height: 32px;
padding: 0;
margin: 0;
justify-content: center;
@ -1014,8 +1083,8 @@ onUnmounted(() => {
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 28px;
height: 28px;
width: 32px;
height: 32px;
border: none;
border-radius: 6px;
background: transparent;
@ -1113,8 +1182,15 @@ onUnmounted(() => {
.customer-side-rail__dock {
align-items: center;
gap: 4px;
padding: 6px 0 8px;
gap: 6px;
padding: 8px 0 10px;
}
.customer-side-rail__warehouse-chip {
width: 40px;
height: 40px;
padding: 0;
justify-content: center;
}
.customer-side-rail__toolbar {
@ -1133,18 +1209,18 @@ onUnmounted(() => {
}
.customer-side-rail__user {
width: 30px;
width: 32px;
flex: 0 0 auto;
}
.customer-side-rail__message-slot {
width: 30px;
width: 32px;
flex: 0 0 auto;
:deep(.message-dropdown-trigger) {
width: 30px;
width: 32px;
max-width: none;
height: 28px;
height: 32px;
padding: 0;
background: transparent;
}
@ -1155,33 +1231,22 @@ onUnmounted(() => {
}
.customer-side-rail__tool {
width: 30px;
height: 28px;
}
.customer-side-rail__footer-row {
width: 40px;
flex-direction: column;
align-items: center;
gap: 2px;
}
.customer-side-rail__warehouse-btn {
width: 36px;
min-width: 36px;
height: 28px;
flex: 0 0 auto;
padding: 0;
justify-content: center;
text-align: center;
background: transparent;
width: 32px;
height: 32px;
}
.customer-side-rail__toggle {
width: 28px;
height: 28px;
width: 32px;
height: 32px;
padding: 0;
}
}
}
:global(.csr-warehouse-switcher-popup) {
padding: 0 !important;
border-radius: 10px !important;
overflow: hidden;
box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12) !important;
}
</style>

View File

@ -0,0 +1,173 @@
import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { Message } from '@arco-design/web-vue'
import { getWarehouseList, type WarehouseDto } from '@/api/system/warehouse'
import { resolveCurrentCustomer } from '@/api/customer/resolve'
import {
compareWarehouseSort,
formatWarehouseShipAddress,
formatWarehouseShipRecipient,
} from '@/utils/warehouseShipAddress'
import { getMapIdFromAccessToken } from '@/utils/jwt'
import { useRbacUserStore } from '@/store/modules/rbac-user'
import { useCurrentWarehouseStore } from '@/store'
function pick(raw: any, ...keys: string[]) {
for (const k of keys) {
const v = raw?.[k]
if (v !== undefined && v !== null && String(v).trim() !== '') return String(v)
}
return ''
}
function normalize(row: any): WarehouseDto {
const sortRaw = row?.sort ?? row?.Sort
const sortNum = sortRaw == null || sortRaw === '' ? null : Number(sortRaw)
return {
id: row?.id ?? row?.Id,
warehouseName: pick(row, 'warehouseName', 'WarehouseName'),
warehouseType: pick(row, 'warehouseType', 'WarehouseType') || undefined,
warehouseTypeName: pick(row, 'warehouseTypeName', 'WarehouseTypeName') || undefined,
recipient: pick(row, 'recipient', 'Recipient'),
contactPhone: pick(row, 'contactPhone', 'ContactPhone'),
shippingAddress: pick(row, 'shippingAddress', 'ShippingAddress'),
sort: sortNum != null && Number.isFinite(sortNum) ? sortNum : null,
remark: pick(row, 'remark', 'Remark') || undefined,
}
}
/** 仓库列表 / 切换 / 寄件信息复制,供侧栏 Popover 与完整 Modal 共用 */
export function useWarehousePeek() {
const { t } = useI18n()
const rbacUserStore = useRbacUserStore()
const warehouseStore = useCurrentWarehouseStore()
const loading = ref(false)
const list = ref<WarehouseDto[]>([])
const customerCode = ref('')
const currentId = computed(() => warehouseStore.warehouseId)
const orderedList = computed(() => {
const rows = [...list.value]
const cur = currentId.value
if (!cur) return rows
return rows.sort((a, b) => {
const aCur = Number(a.id) === cur ? 0 : 1
const bCur = Number(b.id) === cur ? 0 : 1
if (aCur !== bCur) return aCur - bCur
return compareWarehouseSort(a, b)
})
})
const currentItem = computed(
() => orderedList.value.find((row) => Number(row.id) === currentId.value) || null,
)
function displayRecipient(item: WarehouseDto) {
return formatWarehouseShipRecipient(item.recipient, customerCode.value)
}
function displayAddress(item: WarehouseDto) {
return formatWarehouseShipAddress(item.shippingAddress, customerCode.value)
}
function buildCopyText(item: WarehouseDto) {
return [
item.warehouseName || '-',
`${t('system.warehouseAddress.fields.recipient')}: ${displayRecipient(item)}`,
`${t('system.warehouseAddress.fields.contactPhone')}: ${item.contactPhone || '-'}`,
`${t('system.warehouseAddress.fields.shippingAddress')}: ${displayAddress(item)}`,
].join('\n')
}
async function copyText(text: string) {
try {
await navigator.clipboard.writeText(text)
Message.success(t('system.warehouseAddress.message.copySuccess'))
} catch {
Message.error(t('system.warehouseAddress.message.copyFailed'))
}
}
function copyItem(item: WarehouseDto) {
void copyText(buildCopyText(item))
}
function copyField(value: string) {
const text = String(value || '').trim()
if (!text || text === '-') {
Message.warning(t('nav.warehousePeek.emptyField'))
return
}
void copyText(text)
}
async function loadCustomerCode() {
try {
const mapId = getMapIdFromAccessToken(rbacUserStore.accessToken)
const account = rbacUserStore.userInfo?.account?.trim() || ''
const data = await resolveCurrentCustomer({ mapId, account })
customerCode.value = String(data?.customerCode ?? '').trim()
} catch {
customerCode.value = ''
}
}
function syncWarehouseOptions(rows: WarehouseDto[]) {
warehouseStore.setOptions(
rows
.filter((row) => row.id != null)
.map((row) => ({
label: row.warehouseName || String(row.id),
value: Number(row.id),
})),
)
}
/** @returns true 表示发生了切换 */
function selectWarehouse(item: WarehouseDto): boolean {
const id = Number(item.id)
if (!id) return false
if (id === currentId.value) return false
syncWarehouseOptions(list.value)
warehouseStore.setWarehouseId(id)
Message.success(
t('nav.warehousePeek.switched', {
name: item.warehouseName || String(id),
}),
)
return true
}
async function loadList() {
loading.value = true
try {
const [res] = await Promise.all([
getWarehouseList({ page: 1, pageSize: 100 }),
loadCustomerCode(),
])
list.value = (res.items ?? []).map(normalize).sort(compareWarehouseSort)
syncWarehouseOptions(list.value)
} catch {
list.value = []
} finally {
loading.value = false
}
}
return {
loading,
list,
customerCode,
currentId,
currentItem,
orderedList,
displayRecipient,
displayAddress,
copyItem,
copyField,
selectWarehouse,
loadList,
}
}

View File

@ -1027,6 +1027,8 @@ const pathToRouteNameMap: Record<string, string> = {
'/channel/guide': 'ChannelGuide',
'/marketing/guide': 'MarketingGuide',
'/order/guide': 'OrderGuide',
'/warehouse/guide': 'WarehouseGuide',
'/operation/guide': 'OperationGuide',
'/kb/training': 'KbTraining',
'/kb/category': 'KbCategory',
'/kb/article': 'KbArticle',

View File

@ -114,7 +114,7 @@ export default {
'agent.analysis.columns.conversionRate': 'Conversion',
'agent.analysis.columns.commissionPending': 'Pending',
'menu.marketing': 'Marketing',
'menu.marketing.marketingGuide': 'Getting Started',
'menu.marketing.marketingGuide': 'Marketing Guide',
'menu.marketing.analysis': 'Marketing Analysis',
'menu.marketing.memberLevel': 'Member Levels',
'marketing.memberLevel.pageTip':
@ -166,7 +166,7 @@ export default {
'navbar.messageNotice': 'Announcements',
'navbar.action.locale': 'Switch to English',
'menu.order': 'Order',
'menu.order.orderGuide': 'Getting Started',
'menu.order.orderGuide': 'Order Guide',
'menu.order.priceCheck': 'Price Check',
'menu.order.placeOrder': 'Place Order',
'menu.order.templateMapping': 'Template Mapping',
@ -179,6 +179,7 @@ export default {
'menu.order.platformStore': 'Platform Stores',
'menu.order.platformStoreOrder': 'Store Orders',
'menu.warehouse': 'Warehouse',
'menu.warehouse.warehouseGuide': 'Warehouse Guide',
'menu.warehouse.parcel': 'My Parcels',
'menu.warehouse.inventory': 'My Inventory',
'menu.warehouse.sku': 'My SKU',
@ -1312,7 +1313,7 @@ export default {
'order.platformStoreOrder.message.temuNoRts': 'Temu does not support RTS',
'order.platformStoreOrder.message.actionFailed': 'Action failed',
'menu.channel': 'Channel',
'menu.channel.channelGuide': 'Getting Started',
'menu.channel.channelGuide': 'Channel Guide',
'menu.channel.salesProducts': 'Sales Products',
'menu.channel.serviceChannels': 'Service Channels',
'menu.channel.pricingWorkbench': 'Pricing Workbench',
@ -1326,7 +1327,7 @@ export default {
'menu.channel.issueTemplate': 'Issue Template',
'menu.channel.labelDesign': 'Label Design',
'menu.track': 'Track',
'menu.track.trackGuide': 'Getting Started',
'menu.track.trackGuide': 'Track Guide',
'menu.track.trackOrder': 'Track Order',
'menu.track.warningOrder': 'Warning Order',
'menu.track.trackState': 'Track State',
@ -1336,6 +1337,7 @@ export default {
'menu.track.trackPush': 'Track Push',
'menu.track.kpiEarlyWarningConfig': 'KPI Early Warning Config',
'menu.operation': 'Operation',
'menu.operation.operationGuide': 'Operation Guide',
'menu.operation.inboundScan': 'Inbound Scan',
'menu.operation.outboundScan': 'Outbound Scan',
'menu.operation.bagPack': 'Bag Packing',
@ -2003,6 +2005,12 @@ export default {
'nav.warehousePeek.copyAll': 'Copy',
'nav.warehousePeek.empty': 'No warehouse address yet',
'nav.warehousePeek.emptyField': 'Nothing to copy',
'nav.warehousePeek.switchTitle': 'Switch warehouse',
'nav.warehousePeek.shipLabel': 'Ship from',
'nav.warehousePeek.searchPlaceholder': 'Search warehouses',
'nav.warehousePeek.addressSummary': 'Shipping details',
'nav.warehousePeek.viewFull': 'View full shipping details',
'nav.warehousePeek.currentPrefix': 'Current warehouse: {name}',
'nav.contactService.serviceWechat': 'Customer WeChat',
'nav.contactService.wechatQrcode': 'WeChat QR code',
'nav.contactService.phone': 'Contact phone',

View File

@ -114,7 +114,7 @@ export default {
'agent.analysis.columns.conversionRate': '转化率',
'agent.analysis.columns.commissionPending': '待结算',
'menu.marketing': '营销',
'menu.marketing.marketingGuide': '新手指引',
'menu.marketing.marketingGuide': '营销指引',
'menu.marketing.analysis': '营销分析',
'menu.marketing.memberLevel': '会员等级',
'marketing.memberLevel.pageTip':
@ -167,7 +167,7 @@ export default {
'navbar.messageNotice': '公告',
'navbar.action.locale': '切换为中文',
'menu.order': '订单',
'menu.order.orderGuide': '新手指引',
'menu.order.orderGuide': '订单指引',
'menu.order.priceCheck': '我要查价',
'menu.order.placeOrder': '我要下单',
'menu.order.templateMapping': '模板字段映射',
@ -180,6 +180,7 @@ export default {
'menu.order.platformStore': '店铺授权',
'menu.order.platformStoreOrder': '店铺订单',
'menu.warehouse': '仓储',
'menu.warehouse.warehouseGuide': '仓储指引',
'menu.warehouse.parcel': '我的包裹',
'menu.warehouse.inventory': '我的库存',
'menu.warehouse.sku': '我的 SKU',
@ -1302,7 +1303,7 @@ export default {
'order.platformStoreOrder.message.actionFailed': '操作失败',
'menu.channel': '渠道',
'menu.channel.channelGuide': '新手指引',
'menu.channel.channelGuide': '渠道指引',
'menu.channel.salesProducts': '销售产品',
'menu.channel.serviceChannels': '服务渠道',
'menu.channel.pricingWorkbench': '定价工作台',
@ -1316,7 +1317,7 @@ export default {
'menu.channel.issueTemplate': '问题模板',
'menu.channel.labelDesign': '标签设计',
'menu.track': '轨迹',
'menu.track.trackGuide': '新手指引',
'menu.track.trackGuide': '轨迹指引',
'menu.track.trackOrder': '轨迹订单',
'menu.track.warningOrder': '预警订单',
'menu.track.trackState': '轨迹状态',
@ -1326,6 +1327,7 @@ export default {
'menu.track.trackPush': '轨迹推送',
'menu.track.kpiEarlyWarningConfig': '预警配置',
'menu.operation': '操作',
'menu.operation.operationGuide': '操作指引',
'menu.operation.inboundScan': '入库扫描',
'menu.operation.outboundScan': '出库扫描',
'menu.operation.bagPack': '装袋作业',
@ -1700,6 +1702,12 @@ export default {
'nav.warehousePeek.copyAll': '复制',
'nav.warehousePeek.empty': '暂无仓库地址',
'nav.warehousePeek.emptyField': '无可复制内容',
'nav.warehousePeek.switchTitle': '切换仓库',
'nav.warehousePeek.shipLabel': '寄件仓',
'nav.warehousePeek.searchPlaceholder': '搜索仓库',
'nav.warehousePeek.addressSummary': '当前仓寄件信息',
'nav.warehousePeek.viewFull': '查看全部寄件信息',
'nav.warehousePeek.currentPrefix': '当前仓库:{name}',
'nav.contactService.serviceWechat': '客服微信',
'nav.contactService.wechatQrcode': '微信二维码',
'nav.contactService.phone': '联系电话',

View File

@ -19,7 +19,7 @@ const CHANNEL: AppRouteRecordRaw = {
meta: {
locale: 'menu.channel.channelGuide',
requiresAuth: true,
order: 0,
order: 99,
icon: 'icon-book',
},
},

View File

@ -21,7 +21,7 @@ const MARKETING: AppRouteRecordRaw = {
requiresAuth: true,
// 与渠道/订单/轨迹指引一致:独立 Guide 权限码,供「同步子菜单」写入 RBAC
menuPermission: 'Marketing.Guide',
order: 0,
order: 99,
icon: 'icon-book',
},
},

View File

@ -12,6 +12,18 @@ const OPERATION: AppRouteRecordRaw = {
order: 5,
},
children: [
{
path: 'guide',
name: 'OperationGuide',
component: () => import('@/views/operation/operationGuide/index.vue'),
meta: {
locale: 'menu.operation.operationGuide',
requiresAuth: true,
menuPermission: 'Operation.Guide',
order: 99,
icon: 'icon-book',
},
},
{
path: 'inboundScan',
name: 'InboundScan',

View File

@ -19,7 +19,7 @@ const ORDER: AppRouteRecordRaw = {
meta: {
locale: 'menu.order.orderGuide',
requiresAuth: true,
order: 0,
order: 99,
icon: 'icon-book',
},
},

View File

@ -19,7 +19,7 @@ const TRACK: AppRouteRecordRaw = {
meta: {
locale: 'menu.track.trackGuide',
requiresAuth: true,
order: 0,
order: 99,
icon: 'icon-book',
},
},

View File

@ -12,6 +12,18 @@ const WAREHOUSE: AppRouteRecordRaw = {
order: 4,
},
children: [
{
path: 'guide',
name: 'WarehouseGuide',
component: () => import('@/views/warehouse/warehouseGuide/index.vue'),
meta: {
locale: 'menu.warehouse.warehouseGuide',
requiresAuth: true,
menuPermission: 'Warehouse.Guide',
order: 99,
icon: 'icon-book',
},
},
{
path: 'parcel',
name: 'WarehouseParcel',

View File

@ -18,7 +18,10 @@ export const MENU_NAME_TO_LOCALE_KEY: Record<string, string> = {
充值记录: 'menu.finance.rechargeRecord',
资金流水: 'menu.finance.accountFlow',
应收应付: 'menu.finance.receivablePayable',
营销: 'menu.marketing',
营销指引: 'menu.marketing.marketingGuide',
订单: 'menu.order',
订单指引: 'menu.order.orderGuide',
新手指引: 'menu.order.orderGuide',
我要查价: 'menu.order.priceCheck',
我要下单: 'menu.order.placeOrder',
@ -31,12 +34,15 @@ export const MENU_NAME_TO_LOCALE_KEY: Record<string, string> = {
店铺授权: 'menu.order.platformStore',
店铺订单: 'menu.order.platformStoreOrder',
仓储: 'menu.warehouse',
仓储指引: 'menu.warehouse.warehouseGuide',
我的包裹: 'menu.warehouse.parcel',
我的库存: 'menu.warehouse.inventory',
'我的 SKU': 'menu.warehouse.sku',
入库预报: 'menu.warehouse.inboundNotice',
库位管理: 'menu.warehouse.binLocation',
仓租设置: 'menu.warehouse.storageRent',
渠道: 'menu.channel',
渠道指引: 'menu.channel.channelGuide',
销售产品: 'menu.channel.salesProducts',
服务渠道: 'menu.channel.serviceChannels',
价格分区: 'menu.channel.priceArea',
@ -48,6 +54,7 @@ export const MENU_NAME_TO_LOCALE_KEY: Record<string, string> = {
问题模板: 'menu.channel.issueTemplate',
标签设计: 'menu.channel.labelDesign',
轨迹: 'menu.track',
轨迹指引: 'menu.track.trackGuide',
轨迹订单: 'menu.track.trackOrder',
预警订单: 'menu.track.warningOrder',
轨迹状态: 'menu.track.trackState',
@ -57,6 +64,7 @@ export const MENU_NAME_TO_LOCALE_KEY: Record<string, string> = {
轨迹推送: 'menu.track.trackPush',
预警配置: 'menu.track.kpiEarlyWarningConfig',
操作: 'menu.operation',
操作指引: 'menu.operation.operationGuide',
入库扫描: 'menu.operation.inboundScan',
出库扫描: 'menu.operation.outboundScan',
装袋作业: 'menu.operation.bagPack',

View File

@ -61,10 +61,12 @@ export const SUB_MENU_DEFAULT_ICONS: Record<string, string> = {
'menu.track.trackPull': 'IconDownload',
'menu.track.trackPush': 'IconUpload',
'menu.track.kpiEarlyWarningConfig': 'IconSettings',
'menu.operation.operationGuide': 'IconBook',
'menu.operation.inboundScan': 'IconImport',
'menu.operation.outboundScan': 'IconExport',
'menu.operation.printLabel': 'IconPrinter',
'menu.operation.parcelArrival': 'IconImport',
'menu.warehouse.warehouseGuide': 'IconBook',
'menu.warehouse.parcel': 'IconGift',
'menu.warehouse.inventory': 'IconStorage',
'menu.warehouse.sku': 'IconTags',
@ -128,12 +130,14 @@ export function resolveArcoIcon(icon?: string | null): Component | null {
return (Icons as Record<string, Component>)[pascal] ?? null
}
/** 同名菜单(如「新手指引」)按 path 区分 locale */
/** 指引等菜单按 path 区分 locale(同步后名称已按模块区分) */
export const PATH_TO_LOCALE_KEY: Record<string, string> = {
'/track/guide': 'menu.track.trackGuide',
'/order/guide': 'menu.order.orderGuide',
'/channel/guide': 'menu.channel.channelGuide',
'/marketing/guide': 'menu.marketing.marketingGuide',
'/warehouse/guide': 'menu.warehouse.warehouseGuide',
'/operation/guide': 'menu.operation.operationGuide',
'/kb/training': 'menu.kb.training',
'/agentAdmin/list': 'menu.agentAdmin.list',
'/agentAdmin/commission': 'menu.agentAdmin.commission',

View File

@ -127,6 +127,10 @@ const routeNameMap: Record<string, string> = {
'/marketing': 'Marketing',
'marketing_guide': 'MarketingGuide',
'/marketing/guide': 'MarketingGuide',
'warehouse_guide': 'WarehouseGuide',
'/warehouse/guide': 'WarehouseGuide',
'operation_guide': 'OperationGuide',
'/operation/guide': 'OperationGuide',
'kb': 'Knowledge',
'/kb': 'Knowledge',
'kb_training': 'KbTraining',

View File

@ -22,6 +22,29 @@ function readSyncError(error: unknown): string {
return error instanceof Error ? error.message : String(error);
}
/** 限制并发,避免打爆接口 */
async function mapPool<T, R>(
items: T[],
concurrency: number,
fn: (item: T, index: number) => Promise<R>,
): Promise<R[]> {
if (!items.length) return [];
const results: R[] = new Array(items.length);
let cursor = 0;
const workers = Array.from(
{ length: Math.min(Math.max(1, concurrency), items.length) },
async () => {
while (true) {
const index = cursor++;
if (index >= items.length) return;
results[index] = await fn(items[index], index);
}
},
);
await Promise.all(workers);
return results;
}
export interface SyncLevel3ButtonsResult {
created: number;
updated: number;
@ -36,12 +59,14 @@ export interface SyncLevel3ButtonsResult {
export interface SyncLevel3Options {
/** 无三级按钮时不抛错,返回 created=0 */
allowEmpty?: boolean;
/** 复用已拉取的权限树,避免每个页面重复请求 */
permissionGroups?: PermissionGroupDto[] | null;
}
export interface SyncMenuTreeResult {
mode: 'module' | 'page';
level2Created: number;
/** 已有二级菜单补齐图标/权限码等字段 */
/** 已有二级菜单补齐图标/权限码/排序等字段 */
level2Updated: number;
level2Skipped: number;
level3Created: number;
@ -122,7 +147,6 @@ function resolveButtonsFromPermissionTree(
groups.forEach((group) => visitNodes(group.permissions));
// 兼容扁平结构:通过 parentCode 关联
const scanParentCode = (nodes: PermissionDefinitionDto[] | null | undefined) => {
(nodes || []).forEach((node) => {
const nodeCode = node.code?.trim() || '';
@ -132,9 +156,7 @@ function resolveButtonsFromPermissionTree(
(parent === resourceCode || parent === menuCode) &&
nodeCode !== menuCode
) {
pushButton(
permissionNodeToButton(node, buttons.length + 1),
);
pushButton(permissionNodeToButton(node, buttons.length + 1));
}
scanParentCode(node.children);
});
@ -186,14 +208,32 @@ async function reloadMenuNode(menuId: string): Promise<MenuTreeDto | null> {
return findMenuById(tree ?? [], menuId);
}
async function syncMenuOrder(menuId: string, nextOrder: number, currentOrder?: number | null) {
if ((currentOrder ?? 0) === nextOrder) return false;
await MenuService.putRbacMenuUpdateOrder(menuId, nextOrder);
return true;
}
function upsertLocalChild(parent: MenuTreeDto, child: MenuTreeDto): MenuTreeDto {
const children = [...(parent.children || [])];
const idx = children.findIndex((c) => c.id && c.id === child.id);
if (idx >= 0) {
children[idx] = { ...children[idx], ...child };
} else {
children.push(child);
}
children.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
return { ...parent, children };
}
async function ensurePageMenu(
parentMenu: MenuTreeDto,
pageDef: RoutePageMenuDef,
): Promise<{ menu: MenuTreeDto; created: boolean; updated: boolean }> {
const nextIcon = pageDef.icon?.trim() || undefined;
const nextOrder = pageDef.order ?? 0;
const existing = findPageChildMenu(parentMenu, pageDef.route, pageDef.permissionCode);
if (existing?.id) {
// 已有二级菜单:补齐或纠正 permissionCode(Xxx.Query → Xxx);图标仅补空,不覆盖人工更换
const existingCode = existing.permissionCode?.trim() || '';
const nextCode = pageDef.permissionCode?.trim() || '';
const shouldPatchCode =
@ -202,40 +242,60 @@ async function ensurePageMenu(
(!existingCode || normalizeResourcePermissionCode(existingCode) === nextCode);
const existingIcon = existing.icon?.trim() || '';
const shouldPatchIcon = !existingIcon && !!nextIcon;
const shouldPatchName =
!!pageDef.name?.trim() &&
(existing.name || '').trim() !== pageDef.name.trim();
const shouldPatchHidden = (existing.isHidden ?? false) !== pageDef.isHidden;
const shouldPatchOrder = (existing.order ?? 0) !== nextOrder;
if (shouldPatchCode || shouldPatchIcon) {
let updated = false;
let menu: MenuTreeDto = { ...existing };
if (shouldPatchCode || shouldPatchIcon || shouldPatchName || shouldPatchHidden) {
const permissionCode = shouldPatchCode ? nextCode : existing.permissionCode;
const icon = existingIcon || nextIcon;
try {
await MenuService.putRbacMenuUpdate(existing.id, {
name: existing.name || pageDef.name,
name: shouldPatchName ? pageDef.name : existing.name || pageDef.name,
permissionCode,
icon,
route: existing.route || pageDef.route,
component: existing.component || pageDef.component,
order: existing.order ?? pageDef.order,
isHidden: existing.isHidden ?? pageDef.isHidden,
isHidden: pageDef.isHidden,
isCached: existing.isCached ?? false,
description:
existing.description ||
(shouldPatchIcon
? `同步二级菜单图标: ${icon}`
: `同步二级菜单权限码: ${permissionCode}`),
: shouldPatchCode
? `同步二级菜单权限码: ${permissionCode}`
: `同步二级菜单: ${pageDef.route}`),
});
return {
menu: {
...existing,
permissionCode: permissionCode || existing.permissionCode,
icon: icon || existing.icon,
},
created: false,
updated: true,
menu = {
...menu,
name: shouldPatchName ? pageDef.name : menu.name,
permissionCode: permissionCode || menu.permissionCode,
icon: icon || menu.icon,
isHidden: pageDef.isHidden,
};
updated = true;
} catch {
// 更新失败时仍返回原节点,后续三级同步可能因无权限码跳过
// 更新失败时仍返回原节点
}
}
return { menu: existing, created: false, updated: false };
// 排序独立接口(UpdateDto 的 order 不可靠)
if (shouldPatchOrder) {
try {
await syncMenuOrder(existing.id, nextOrder, existing.order);
menu = { ...menu, order: nextOrder };
updated = true;
} catch {
// ignore order failure
}
}
return { menu, created: false, updated };
}
const createdMenu = await MenuService.postRbacMenuCreate({
@ -246,7 +306,7 @@ async function ensurePageMenu(
icon: nextIcon,
route: pageDef.route,
component: pageDef.component,
order: pageDef.order,
order: nextOrder,
isHidden: pageDef.isHidden,
isCached: false,
description: `同步二级菜单: ${pageDef.route}`,
@ -262,7 +322,7 @@ async function ensurePageMenu(
icon: nextIcon,
route: pageDef.route,
component: pageDef.component,
order: pageDef.order,
order: nextOrder,
isHidden: pageDef.isHidden,
children: [],
},
@ -289,7 +349,6 @@ export async function syncMenuLevel3Buttons(
throw new Error('仅支持对页面菜单同步三级按钮');
}
// 二级菜单若误存为 Xxx.Query,纠正为资源码,使「查询」可作为三级按钮同步
const resourceCode = normalizeResourcePermissionCode(parentPermissionCode);
if (resourceCode && resourceCode !== parentPermissionCode) {
try {
@ -299,7 +358,6 @@ export async function syncMenuLevel3Buttons(
icon: menu.icon,
route: menu.route,
component: menu.component,
order: menu.order ?? 0,
isHidden: menu.isHidden ?? false,
isCached: menu.isCached ?? false,
description: menu.description || `同步二级菜单权限码: ${resourceCode}`,
@ -307,24 +365,31 @@ export async function syncMenuLevel3Buttons(
parentPermissionCode = resourceCode;
menu = { ...menu, permissionCode: resourceCode };
} catch {
// 纠正失败时仍按原编码尝试同步(查询按钮可能被过滤)
// 纠正失败时仍按原编码尝试同步
}
}
const catalogButtons = getCatalogButtons(parentPermissionCode);
let permissionTreeButtons: PageButtonDef[] = [];
try {
const groups = await PermissionService.getRbacPermissionGetPermissionTree();
permissionTreeButtons = resolveButtonsFromPermissionTree(groups ?? [], parentPermissionCode);
} catch {
// 权限树不可用时仅使用前端目录
if (!catalogButtons.length) {
try {
const groups =
options?.permissionGroups !== undefined
? options.permissionGroups
: await PermissionService.getRbacPermissionGetPermissionTree();
if (groups?.length) {
permissionTreeButtons = resolveButtonsFromPermissionTree(
groups,
parentPermissionCode,
);
}
} catch {
// 权限树不可用时仅使用前端目录
}
}
// 前端目录非空时以目录为准(支持改名/删多余);否则回退权限树
const targetButtons = filterSyncTargets(
catalogButtons.length
? catalogButtons
: mergeButtonDefs(permissionTreeButtons),
catalogButtons.length ? catalogButtons : mergeButtonDefs(permissionTreeButtons),
parentPermissionCode,
);
@ -341,9 +406,9 @@ export async function syncMenuLevel3Buttons(
deletedNames: [],
};
}
const resourceCode = normalizeResourcePermissionCode(parentPermissionCode);
const normalized = normalizeResourcePermissionCode(parentPermissionCode);
throw new Error(
`未找到可同步的三级按钮(菜单编码: ${parentPermissionCode}${resourceCode !== parentPermissionCode ? `,资源编码: ${resourceCode}` : ''})。请确认菜单 permissionCode 与权限树/前端目录一致。`,
`未找到可同步的三级按钮(菜单编码: ${parentPermissionCode}${normalized !== parentPermissionCode ? `,资源编码: ${normalized}` : ''})。请确认菜单 permissionCode 与权限树/前端目录一致。`,
);
}
@ -363,58 +428,67 @@ export async function syncMenuLevel3Buttons(
let deleted = 0;
let skipped = 0;
for (const btn of targetButtons) {
const existing = existingByCode.get(btn.permissionCode);
if (!existing?.id) {
await MenuService.postRbacMenuCreate({
pId: menu.id,
name: btn.name,
type: 2,
permissionCode: btn.permissionCode,
order: btn.order ?? 0,
isHidden: false,
isCached: false,
description: `同步三级按钮: ${btn.permissionCode}`,
});
createdNames.push(btn.name);
created += 1;
continue;
}
const toCreate = targetButtons.filter((btn) => !existingByCode.get(btn.permissionCode)?.id);
const toMaybeUpdate = targetButtons.filter((btn) => existingByCode.get(btn.permissionCode)?.id);
await mapPool(toCreate, 4, async (btn) => {
await MenuService.postRbacMenuCreate({
pId: menu.id,
name: btn.name,
type: 2,
permissionCode: btn.permissionCode,
order: btn.order ?? 0,
isHidden: false,
isCached: false,
description: `同步三级按钮: ${btn.permissionCode}`,
});
createdNames.push(btn.name);
created += 1;
});
await mapPool(toMaybeUpdate, 4, async (btn) => {
const existing = existingByCode.get(btn.permissionCode)!;
const currentName = (existing.name || '').trim();
const nextName = (btn.name || '').trim();
const currentOrder = existing.order ?? 0;
const nextOrder = btn.order ?? 0;
const needUpdate = (nextName && currentName !== nextName) || currentOrder !== nextOrder;
if (!needUpdate) {
const needName = !!nextName && currentName !== nextName;
const needOrder = currentOrder !== nextOrder;
if (!needName && !needOrder) {
skipped += 1;
continue;
return;
}
await MenuService.putRbacMenuUpdate(existing.id, {
name: nextName || currentName,
permissionCode: btn.permissionCode,
icon: existing.icon,
route: existing.route,
component: existing.component,
order: nextOrder,
isHidden: existing.isHidden ?? false,
isCached: existing.isCached ?? false,
description: existing.description || `同步三级按钮: ${btn.permissionCode}`,
});
if (needName) {
await MenuService.putRbacMenuUpdate(existing.id!, {
name: nextName || currentName,
permissionCode: btn.permissionCode,
icon: existing.icon,
route: existing.route,
component: existing.component,
isHidden: existing.isHidden ?? false,
isCached: existing.isCached ?? false,
description: existing.description || `同步三级按钮: ${btn.permissionCode}`,
});
}
if (needOrder) {
await syncMenuOrder(existing.id!, nextOrder, currentOrder);
}
updatedNames.push(nextName || currentName);
updated += 1;
}
});
// 目录为源时,删除页面上已不存在的三级按钮
if (catalogButtons.length) {
for (const child of existingButtons) {
const toDelete = existingButtons.filter((child) => {
const code = child.permissionCode?.trim() || '';
if (!child.id || !code || targetCodes.has(code)) continue;
await MenuService.deleteRbacMenuDelete(child.id);
deletedNames.push(child.name || code);
return child.id && code && !targetCodes.has(code);
});
await mapPool(toDelete, 4, async (child) => {
await MenuService.deleteRbacMenuDelete(child.id!);
deletedNames.push(child.name || child.permissionCode || '');
deleted += 1;
}
});
}
return {
@ -474,55 +548,74 @@ export async function syncMenuTree(menu: MenuTreeDto): Promise<SyncMenuTreeResul
let level3Skipped = 0;
const level3FailedPages: string[] = [];
let currentParent = menu;
// 权限树只拉一次,供各页面三级同步复用
let permissionGroups: PermissionGroupDto[] | null = null;
try {
permissionGroups = await PermissionService.getRbacPermissionGetPermissionTree();
} catch {
permissionGroups = null;
}
let currentParent = menu;
const ensuredPages: { pageDef: RoutePageMenuDef; pageMenu: MenuTreeDto }[] = [];
// 二级:串行保证父子关系;本地维护 children,避免每页整树 reload
for (const pageDef of pageDefs) {
let pageMenu: MenuTreeDto;
let created = false;
let updated = false;
try {
const ensured = await ensurePageMenu(currentParent, pageDef);
pageMenu = ensured.menu;
created = ensured.created;
updated = ensured.updated;
ensuredPages.push({ pageDef, pageMenu: ensured.menu });
if (ensured.created) {
level2Created += 1;
currentParent = upsertLocalChild(currentParent, ensured.menu);
} else if (ensured.updated) {
level2Updated += 1;
currentParent = upsertLocalChild(currentParent, ensured.menu);
} else {
level2Skipped += 1;
}
} catch (error: unknown) {
level3FailedPages.push(`${pageDef.name}: ${readSyncError(error)}`);
continue;
}
if (created) {
level2Created += 1;
const refreshedParent = await reloadMenuNode(menu.id);
if (refreshedParent) {
currentParent = refreshedParent;
}
} else if (updated) {
level2Updated += 1;
const refreshedParent = await reloadMenuNode(menu.id);
if (refreshedParent) {
currentParent = refreshedParent;
}
} else {
level2Skipped += 1;
}
}
if (!pageMenu.permissionCode?.trim()) {
continue;
}
// 一次刷新拿齐各页已有三级按钮,再并发同步
const freshParent = await reloadMenuNode(menu.id);
if (freshParent) {
currentParent = freshParent;
}
const pageNode =
findPageChildMenu(currentParent, pageDef.route, pageDef.permissionCode) || pageMenu;
const freshPage = pageNode.id ? await reloadMenuNode(pageNode.id) : null;
const targetPage = freshPage || pageNode;
const pageTargets = ensuredPages
.map(({ pageDef, pageMenu }) => {
const fromTree =
findPageChildMenu(currentParent, pageDef.route, pageDef.permissionCode) || pageMenu;
return { pageDef, pageMenu: fromTree };
})
.filter((item) => item.pageMenu.permissionCode?.trim());
const level3Results = await mapPool(pageTargets, 3, async ({ pageDef, pageMenu }) => {
try {
const btnResult = await syncMenuLevel3Buttons(targetPage, { allowEmpty: true });
level3Created += btnResult.created;
level3Updated += btnResult.updated;
level3Deleted += btnResult.deleted;
level3Skipped += btnResult.skipped;
const btnResult = await syncMenuLevel3Buttons(pageMenu, {
allowEmpty: true,
permissionGroups,
});
return { ok: true as const, pageDef, btnResult };
} catch (error: unknown) {
const message = error instanceof Error ? error.message : String(error);
level3FailedPages.push(`${pageDef.name}: ${message}`);
return {
ok: false as const,
pageDef,
message: error instanceof Error ? error.message : String(error),
};
}
});
for (const item of level3Results) {
if (item.ok) {
level3Created += item.btnResult.created;
level3Updated += item.btnResult.updated;
level3Deleted += item.btnResult.deleted;
level3Skipped += item.btnResult.skipped;
} else {
level3FailedPages.push(`${item.pageDef.name}: ${item.message}`);
}
}

View File

@ -115,9 +115,10 @@ export function findModuleRouteByMenu(menu: MenuTreeDto): AppRouteRecordRaw | un
export function getPageRoutesFromModule(moduleRoute: AppRouteRecordRaw): RoutePageMenuDef[] {
const parentPath = normalizeRoutePath(moduleRoute.path);
const pages: RoutePageMenuDef[] = [];
type PageWithIndex = RoutePageMenuDef & { declareIndex: number };
const staged: PageWithIndex[] = [];
(moduleRoute.children || []).forEach((child) => {
(moduleRoute.children || []).forEach((child, index) => {
if (!child.meta) return;
if (child.meta.hideInMenu && !child.meta.syncInMenu) return;
@ -127,7 +128,9 @@ export function getPageRoutesFromModule(moduleRoute: AppRouteRecordRaw): RoutePa
(child.meta.menuPermission as string | undefined)?.trim() ||
(child.meta.permission as string | undefined)?.trim() ||
undefined;
pages.push({
// 显式 meta.order 优先;否则按路由文件声明顺序,避免大量 order=0 同步后乱序
const explicitOrder = child.meta.order as number | undefined;
staged.push({
name: resolveRouteMenuTitle(child),
route: routePath,
component: extractComponentPath(child.component),
@ -135,12 +138,15 @@ export function getPageRoutesFromModule(moduleRoute: AppRouteRecordRaw): RoutePa
? normalizeResourcePermissionCode(rawPermission) || rawPermission
: undefined,
icon: resolveRouteMenuIcon(child, routePath),
order: (child.meta.order as number | undefined) ?? 0,
order: typeof explicitOrder === 'number' ? explicitOrder : index,
isHidden: Boolean(child.meta.hideInMenu),
declareIndex: index,
});
});
return pages.sort((a, b) => a.order - b.order);
return staged
.sort((a, b) => a.order - b.order || a.declareIndex - b.declareIndex)
.map(({ declareIndex: _declareIndex, ...page }) => page);
}
export function isModuleMenu(menu: MenuTreeDto): boolean {

View File

@ -437,25 +437,19 @@ Query:`standardCode`、`supplierCode`。
---
## 11. 常见问题
## 11. 常见问题(开发向)
**下游保存提示 Body / Mapping Body 不能为空?**
核对 ContentType:Form 必须同时有 Body 表单与 Mapping Body 树;Json 必须 Body 树有节点。
运营可见对照表见同页「运营」Tab §9。补充实现侧:
**映射页右侧树是空的?**
下游接口未保存、未发布,或 ContentType 与打开的 Tab 不对应(Form 要看 Mapping Body 是否配置)。
**映射对了但服务商报文不对?**
用 **请求日志** 看最终 Query/Body;重点查 `$FromMappingBody` 是否替换、签名脚本是否写到正确字段名。
**Query 上有 DTO,Mapping Body 也有树,但 Body 表单多了 DTO 一行?**
POST 参数仅在 URL 时应只在 Query 配 `$FromMappingBody`,Body 表单可为空。
**Json 接口能否配 Mapping Body?**
界面隐藏;只配 Body 参数树即可。
**配置改了不生效?**
下游接口、映射、应用均需 **发布**。
| 现象 | 排查 |
|------|------|
| Body / Mapping Body 不能为空 | Form:传输 KV + Mapping 树;Json:Body 树节点 |
| 映射右侧树空 | 下游未发布 / Tab 与 ContentType 不符 |
| 报文不对 | 请求日志;`$FromMappingBody`;脚本写字段名 |
| Query/Body 双份 DTO | 只保留 cURL 所在位置一处占位符 |
| 改了不生效 | 下游 + 映射 + 应用都发布 |
| OMS OpenAPI 鉴权失败 | `CustomerOpenApiAuthHelper`(凭证/过期/签名) |
| 客户查单/轨迹 OpenAPI | `OpenApiService` / `OpenApiCustomerOrderResolver` |
---

View File

@ -1,6 +1,6 @@
# Like API 运营指引
> 本文面向要在系统里 **对接外部服务商接口** 的运营 / 实施同学。
> 本文面向要在系统里 **对接外部服务商接口** 的运营 / 实施同学,含 **配置/鉴权/联调常见报错怎么排查**。
> 传输层字段、映射树、占位符细节见同页 **「开发」** Tab。
> 下文里的单号、密钥均为示例,请换成你们环境的真实数据。
@ -504,7 +504,7 @@ POST /openapi/notify?_aop_signature=xxx&bizEventDto={...json...}
| Tab | 用途 |
|-----|------|
| **新手指引** | 本文 |
| **API 指引** | 本文 |
| **接口调试** | 自由填 URL / Header / Body,或导入 cURL 试连通 |
注意:
@ -528,15 +528,55 @@ POST /openapi/notify?_aop_signature=xxx&bizEventDto={...json...}
---
## 9. 常见问题
## 9. 常见报错 ↔ 解决思路
| 现象 | 处理 |
|------|------|
| 保存提示 Body / Mapping Body 不能为空 | Form 要同时有表单 KV 和 Mapping Body 树;Json 要有 Body 树节点 |
| 映射页右侧树是空的 | 下游没保存/没发布,或开错了 Tab |
| 映射看着对,服务商仍报错 | 打开请求日志看最终报文;查 `$FromMappingBody` 有没有替换、签名有没有写到对的字段 |
| 配置改了线上没变 | 下游、映射、应用是否都重新发布 |
| Query 上已有 DTO,Body 又多了一行 | 按 cURL 只保留一处 `$FromMappingBody` |
> Like API 配置校验 + OMS OpenAPI 鉴权常见文案(以界面/日志为准)。
> **排查口诀:** ContentType 对不对 → 有没有 **发布** → 请求日志里最终报文对不对 → App 鉴权通不通。
### 9.1 下游 / 映射配置
| 系统提示或现象 | 可能原因 | 解决思路 |
|----------------|----------|----------|
| Body / Mapping Body 不能为空 | Form 缺表单 KV 或 Mapping 树;Json 缺 Body 树 | Form:两处都配;Json:Body 树至少一个节点 |
| 映射页右侧树是空的 | 下游未保存/未发布,或开错 Tab | 先发布下游;Form 看 Mapping Body |
| Content-Type 与正文不一致 | 选了 Json 却发 form(或相反) | 与服务商 cURL 对齐后重配 |
| 映射看着对,服务商仍拒 | `$FromMappingBody` 未替换 / 签名字段名错 | **请求日志**对最终 Query/Body/签名字段 |
| Query 已有 DTO,Body 又多一行 | 重复塞同一段 JSON | 按 cURL 只留一处 `$FromMappingBody` |
| 配置改了线上没变 | 下游/映射/应用未重新发布 | 三处都点发布 |
| 签名验签失败 | 脚本未跑、字段名差字母、密钥错 | 签名列留空交给脚本;对字段名与账户密钥 |
| 智能填充后缺字段 | cURL 解析不完整 | 人工补树节点后再保存发布 |
### 9.2 应用鉴权 / 调用入口
| 系统提示或现象 | 可能原因 | 解决思路 |
|----------------|----------|----------|
| 鉴权失败 / App 无权限 | App 未授权该上游或未上线 | 应用里勾选上游接口并上线 |
| IP 不在白名单 | 调用方出口 IP 未登记 | 补白名单或临时放开(按规范) |
| standardCode / supplierCode 找不到 | 码错或未发布 | 对编码;确认发布态 |
| 本页调试通、业务不通 | 调试器不带正式映射/发布版本 | 用上游/下游内嵌调试 + 请求日志 |
### 9.3 OMS 客户 OpenAPI(对接客户系统时)
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 凭证无效 | AppKey/Secret 错或未生成 | 客户中心生成凭证;核对环境 |
| 签名无效 | 签名算法/串拼接错 | 对文档重算;校时区 |
| 请求已过期 | 时间戳超窗 | 校服务器时间;缩短重放窗口 |
| 尚未生成开放接口凭证 | 客户未点生成 | 主客户先生成 |
| 仅主客户可配置/管理开放接口凭证 | 子账号操作 | 换主客户 |
| 请求体不能为空 | Body 空 | 传业务 JSON |
| 请传入 clientNo、serviceNo 或 trackNo | 查单缺号 | 至少一个单号 |
| 订单不存在 / 订单无服务单号,无法查询轨迹 | 单号错或未出运单号 | 核对;等预报出号 |
| 不支持的附件类型 / 请传入 fileType | 附件类型非法 | 按约定 fileType 传 |
| 不支持的重量/长度单位 | 单位枚举错 | 换成系统支持单位 |
### 9.4 排错顺序(建议)
1. 请求日志:最终发出的 URL / Header / Body
2. 下游 ContentType + 映射树是否与文档一致
3. 前置脚本是否写入正确签名字段
4. 应用授权与发布状态
5. 仍失败:把日志里的请求包与服务商文档并排对比
---

View File

@ -152,3 +152,14 @@ Providers 来源:rules 快照 / LIVE 的 `t_sales_product_allocation_provider`
| 价格分区未匹配 | pack 明细 + 产品关联;邮编闭区间 |
| 黑名单 | 黑名单 pack + 产品绑定 |
| 待排货 / buyPrice skip | 排货列表、渠道启用、买价发布、公式条件、客户限制 |
运营可见报错表见同页「运营」Tab §7;文案多来自:
| 场景 | 后端入口(示意) |
|------|------------------|
| 分区 / 黑名单 / 偏远 | `KpiAreaService` / `KpiAreaPackService` |
| 计重 / 进位 | `WeightRuleService` / `WeightRoundingService` |
| 销售产品 / 试算 | `SalesProductService`(含 `BillingSimulate`) |
| 服务渠道 / 买价 | `ServiceChannelService` |
| 排货失败文案 | `AllocationResolver` → 订单 `ParcelBilling` |
| 标签 / 问题模板 / 自动触发 | `LabelTemplateService` / `IssueTemplateService` / `AutoTriggerService` |

View File

@ -1,6 +1,6 @@
# 渠道中心运营指引
> 本文面向 **运营** 同学,说明物流产品、卖价、买价、排货怎么配,以及改完为什么一定要 **发布**。
> 本文面向 **运营** 同学,说明物流产品、卖价、买价、排货怎么配,改完为什么一定要 **发布**,以及 **配置/试算常见报错怎么排查**。
> 快照表、排货代码见同页 **「开发」** Tab;订单用法见 [订单指引](/order/guide)。
---
@ -140,7 +140,7 @@
| 菜单 | 路径 | 做什么 |
|------|------|--------|
| 新手指引 | `/channel/guide` | 本文 |
| 渠道指引 | `/channel/guide` | 本文 |
| 销售产品 | `/channel/salesProducts` | 产品、卖价、排货、发布、对客说明 |
| 服务渠道 | `/channel/serviceChannels` | 下游渠道与买价 |
| 价格分区 | `/channel/priceArea` | 卖价用的地理分区 |
@ -163,16 +163,47 @@
---
## 7. 订单报错 ↔ 渠道侧排查
## 7. 常见报错 ↔ 解决思路
| 订单侧现象 | 先查哪里 |
|------------|----------|
| 产品未启用 | 销售产品状态 |
| 价格分区未匹配 | 价格分区明细是否覆盖该邮编;产品是否关联 |
| 黑名单命中 | 黑名单明细 + 产品是否绑了该黑名单 |
| 未命中价格/规则快照 | 是否点过发布 |
| 卖价未匹配 | 卖价重量段 / 货物属性 / 价区 |
| 待排货 / 无可用渠道 | 排货列表、渠道启用、买价是否可算、客户白名单 |
> 文案来自后端 `BusinessException`(以界面提示为准)。
> **排查口诀:** 先看有没有 **发布** → 再对分区/计重/卖价条件 → 再对排货与买价。
### 7.1 配置保存(渠道本模块)
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 分区名称已存在 / 分区明细已存在相同规则 | 重名或重复明细 | 换名;合并重复邮编/规则行 |
| 分区不存在 / 分区明细不存在 | 已删或脏数据 | 刷新列表重进 |
| 计重规则名称已存在 / 计重进位名称已存在 | 重名 | 换名 |
| 计重规则/进位(明细)不存在 | 已删 | 重建或换绑产品 |
| 当前分组下仍有关联渠道,无法删除 | 分组下还有服务渠道 | 先迁走或删渠道 |
| 价格项归属不匹配 / 买价项归属不匹配 | 编辑了别的产品/渠道的价格行 | 从正确产品/渠道页打开再改 |
| 标签模板名称已存在 / 不存在 / 模板 JSON 为空 | 模板未保存完整 | 设计器保存后再发布类型 |
| 请上传 Excel / Excel 中无有效数据行 | 分区或自动触发导入空 | 用模板重导 |
| 自动触发不存在 | 规则已删 | 从列表重开 |
| 问题模板相关(类型/标题/通知方式…) | 模板必填未齐或组织下重复 | 按提示补全;同组织同类型勿重复 |
### 7.2 试算 / 查价(渠道侧模拟)
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 长宽高与实重必须大于 0 | 尺寸没填 | 补全件重尺 |
| 目的国家不能为空 | 未选国家 | 选目的国 |
| 未配置计重规则 / 未配置计重进位 | 产品未绑或规则空 | 产品配置绑计重+进位,并 **发布规则** |
| 价格分区未匹配 | 邮编/国家不在分区明细 | 补分区明细;确认产品已关联该分区 |
| 计费重计算失败:… | 计重条件/公式异常 | 看后缀原因;对计重明细 |
### 7.3 订单侧现象 ↔ 渠道排查(高频)
| 订单/客户提示 | 渠道侧先查 | 解决思路 |
|---------------|------------|----------|
| 销售产品不存在或未启用 | 产品状态 | 启用产品 |
| 未命中价格/规则快照(或「未命中…快照版本」) | 是否发布 price/rules | 销售产品 → 发布规则 + 价格 |
| 收件地址命中黑名单区域 | 黑名单明细 + 产品绑定 | 改地址或调黑名单/解绑 |
| 价格分区未匹配(规则快照) | 分区 pack + 产品关联 | 补邮编;重新发布规则 |
| 产品卖价未匹配到有效价格 | 重量段/货物属性/价区/客户组 | 对卖价矩阵条件后发布价格 |
| 排货规则未匹配到可用服务渠道 / 待排货 | 排货列表、渠道启用、买价发布、客户白名单 | 补渠道与买价并发布;修白名单后订单侧重算应付 |
| 价格发布审批载荷为空/缺快照 | 审批流缺数据 | 从发布预览重提;找开发对审批载荷 |
---

View File

@ -135,7 +135,7 @@ export default {
'workplace.admin.ops.claimed': '理赔件',
'workplace.admin.ops.claimedHint': '待跟进理赔',
'workplace.admin.link.training': '培训手册',
'workplace.admin.link.trainingHint': '新人四周课表与话术',
'workplace.admin.link.trainingHint': '运营/客服/操作/财务分岗课表',
'workplace.admin.link.warning': '轨迹预警',
'workplace.admin.link.warningHint': '超时与轨迹异常',
'workplace.admin.link.waybill': '运单管理',

View File

@ -0,0 +1,115 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { useTrainingProgress } from './useTrainingProgress'
import { ORAL_EXAMS } from './training-meta'
defineOptions({ name: 'TrainingExamPanel' })
const { role, roleMeta } = useTrainingProgress()
const questions = computed(() => ORAL_EXAMS[role.value] || ORAL_EXAMS.all)
const noteTemplate = `运单号:
客户单号:
销售产品:
网页端 / H5 / 运营端状态:
预报费用 / 入库费用:
排货渠道(成本侧):
轨迹最新节点:
本次踩坑:
对应指引章节:`
</script>
<template>
<div class="exam-panel">
<div class="exam-panel__banner">
<div>
<div class="exam-panel__title">今天下午怎么考 · {{ roleMeta.label }}</div>
<div class="exam-panel__sub">带教抽问下面 3 题即可;笔记模板可复制给新人。</div>
</div>
</div>
<ol class="exam-panel__qs">
<li v-for="(item, idx) in questions" :key="idx" class="exam-panel__q">
<div class="exam-panel__q-text">{{ item.q }}</div>
<div class="exam-panel__expect">期望要点:{{ item.expect }}</div>
</li>
</ol>
<div class="exam-panel__note">
<div class="exam-panel__note-title">一票货四端对照 · 笔记模板</div>
<pre class="exam-panel__pre">{{ noteTemplate }}</pre>
</div>
</div>
</template>
<style lang="less" scoped>
.exam-panel {
margin: 0 0 20px;
padding: 14px 16px;
border: 1px solid var(--color-border-2);
border-radius: 8px;
background: color-mix(in srgb, var(--app-primary-color) 6%, #fff);
}
.exam-panel__title {
font-size: 14px;
font-weight: 600;
color: var(--color-text-1);
}
.exam-panel__sub {
margin-top: 4px;
font-size: 12px;
color: var(--color-text-3);
}
.exam-panel__qs {
margin: 12px 0 0;
padding-left: 20px;
}
.exam-panel__q {
margin-bottom: 10px;
}
.exam-panel__q-text {
font-size: 13px;
font-weight: 500;
color: var(--color-text-1);
line-height: 1.5;
}
.exam-panel__expect {
margin-top: 4px;
font-size: 12px;
color: var(--color-text-3);
line-height: 1.45;
}
.exam-panel__note {
margin-top: 12px;
padding-top: 12px;
border-top: 1px dashed var(--color-border-2);
}
.exam-panel__note-title {
font-size: 13px;
font-weight: 600;
color: var(--color-text-1);
margin-bottom: 8px;
}
.exam-panel__pre {
margin: 0;
padding: 10px 12px;
border-radius: 6px;
background: var(--color-fill-1);
border: 1px solid var(--color-border-2);
font-size: 12px;
line-height: 1.6;
color: var(--color-text-2);
white-space: pre-wrap;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
</style>

View File

@ -0,0 +1,108 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { useRouter } from 'vue-router'
import { useTrainingProgress } from './useTrainingProgress'
import { PRACTICE_CARDS } from './training-meta'
defineOptions({ name: 'TrainingPracticeCards' })
const router = useRouter()
const { role } = useTrainingProgress()
const cards = computed(() => {
const r = role.value
if (r === 'all') return PRACTICE_CARDS
return PRACTICE_CARDS.filter((c) => !c.roles || c.roles.includes(r))
})
function go(path: string) {
void router.push(path)
}
</script>
<template>
<div class="practice-cards">
<div class="practice-cards__head">
<div class="practice-cards__title">测服深链练习</div>
<div class="practice-cards__hint">点按钮直达页面;按当前岗位过滤场景</div>
</div>
<div class="practice-cards__grid">
<article v-for="card in cards" :key="card.id" class="practice-card">
<h4 class="practice-card__title">{{ card.title }}</h4>
<p class="practice-card__goal">{{ card.goal }}</p>
<div class="practice-card__links">
<a-button
v-for="link in card.links"
:key="link.path"
size="small"
class="app-btn-search"
@click="go(link.path)"
>
{{ link.label }}
</a-button>
</div>
</article>
</div>
</div>
</template>
<style lang="less" scoped>
.practice-cards {
margin: 0 0 20px;
}
.practice-cards__head {
margin-bottom: 10px;
}
.practice-cards__title {
font-size: 14px;
font-weight: 600;
color: var(--color-text-1);
}
.practice-cards__hint {
margin-top: 2px;
font-size: 12px;
color: var(--color-text-3);
}
.practice-cards__grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}
.practice-card {
padding: 12px 14px;
border: 1px solid var(--color-border-2);
border-radius: 8px;
background: var(--color-bg-2);
}
.practice-card__title {
margin: 0;
font-size: 14px;
font-weight: 600;
color: var(--color-text-1);
}
.practice-card__goal {
margin: 6px 0 10px;
font-size: 12px;
line-height: 1.5;
color: var(--color-text-3);
}
.practice-card__links {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
@media (max-width: 720px) {
.practice-cards__grid {
grid-template-columns: 1fr;
}
}
</style>

View File

@ -1,9 +1,18 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { useTrainingProgress } from './useTrainingProgress'
import { ROLE_WEEK_FOCUS } from './checklist-items'
defineOptions({ name: 'TrainingRolePicker' })
const props = withDefaults(
defineProps<{
/** 非总览页:只显示当前岗 + 进度 + 快捷切岗 */
compact?: boolean
}>(),
{ compact: false },
)
const { role, roles, roleMeta, percent, doneCount, totalCount } = useTrainingProgress()
const weekLabel: Record<string, string> = {
@ -15,89 +24,280 @@
exam: '验收',
}
const focusLabels = () =>
(ROLE_WEEK_FOCUS[role.value] || [])
.map((k) => weekLabel[k] || k)
.join(' · ')
const focusWeeks = computed(() =>
(ROLE_WEEK_FOCUS[role.value] || []).map((k) => weekLabel[k] || k),
)
function selectRole(key: typeof role.value) {
role.value = key
}
</script>
<template>
<div class="role-picker">
<div class="role-picker__head">
<div>
<div class="role-picker__title">我的岗位轨</div>
<div class="role-picker__desc">
{{ roleMeta.summary }} · 建议学习:{{ focusLabels() }}
<div class="role-picker" :class="{ 'is-compact': props.compact }">
<template v-if="props.compact">
<div class="role-picker__compact">
<div class="role-picker__compact-left">
<span class="role-picker__eyebrow">当前岗</span>
<span class="role-picker__compact-name">{{ roleMeta.label }}</span>
<span class="role-picker__compact-progress">{{ doneCount }}/{{ totalCount }} · {{ percent }}%</span>
</div>
<a-dropdown trigger="click" position="br">
<a-button size="small">切换岗位</a-button>
<template #content>
<a-doption
v-for="r in roles"
:key="r.key"
@click="selectRole(r.key)"
>
{{ r.label }}{{ role === r.key ? ' ✓' : '' }}
</a-doption>
</template>
</a-dropdown>
</div>
</template>
<template v-else>
<div class="role-picker__top">
<div class="role-picker__identity">
<span class="role-picker__eyebrow">岗位轨</span>
<h3 class="role-picker__title">{{ roleMeta.label }}</h3>
<p class="role-picker__summary">{{ roleMeta.summary }}</p>
</div>
<div class="role-picker__meter" :title="`已完成 ${doneCount} / ${totalCount}`">
<a-progress
type="circle"
:percent="percent"
:width="52"
:stroke-width="6"
:color="'var(--app-primary-color)'"
track-color="var(--color-fill-3)"
/>
<div class="role-picker__meter-text">
<span class="role-picker__meter-num">{{ doneCount }}/{{ totalCount }}</span>
<span class="role-picker__meter-hint">本岗进度</span>
</div>
</div>
</div>
<div class="role-picker__progress">
<a-progress
:percent="percent"
size="small"
:stroke-width="6"
style="width: 120px"
/>
<span class="role-picker__count">{{ doneCount }}/{{ totalCount }}</span>
<div class="role-picker__roles" role="radiogroup" aria-label="选择岗位">
<button
v-for="r in roles"
:key="r.key"
type="button"
class="role-picker__chip"
:class="{ 'is-active': role === r.key }"
:aria-checked="role === r.key"
role="radio"
@click="selectRole(r.key)"
>
{{ r.label }}
</button>
</div>
</div>
<a-radio-group v-model="role" type="button" size="small" class="role-picker__radios">
<a-radio v-for="r in roles" :key="r.key" :value="r.key">{{ r.label }}</a-radio>
</a-radio-group>
<div v-if="focusWeeks.length" class="role-picker__focus">
<span class="role-picker__focus-label">建议学习</span>
<div class="role-picker__focus-tags">
<span v-for="w in focusWeeks" :key="w" class="role-picker__tag">{{ w }}</span>
</div>
</div>
</template>
</div>
</template>
<style lang="less" scoped>
.role-picker {
margin: 0 0 16px;
padding: 14px 16px;
margin: 0 0 20px;
padding: 16px 18px;
background: var(--color-fill-1);
border: 1px solid var(--color-border-2);
border-radius: 8px;
&.is-compact {
margin-bottom: 12px;
padding: 10px 12px;
}
}
.role-picker__head {
.role-picker__compact {
display: flex;
align-items: flex-start;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 12px;
gap: 12px;
}
.role-picker__title {
.role-picker__compact-left {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 8px;
min-width: 0;
}
.role-picker__compact-name {
font-size: 14px;
font-weight: 600;
color: var(--color-text-1);
}
.role-picker__desc {
margin-top: 4px;
.role-picker__compact-progress {
font-size: 12px;
color: var(--color-text-3);
line-height: 1.5;
font-variant-numeric: tabular-nums;
}
.role-picker__progress {
.role-picker__top {
display: flex;
align-items: center;
gap: 8px;
justify-content: space-between;
gap: 16px;
}
.role-picker__identity {
min-width: 0;
flex: 1;
}
.role-picker__eyebrow {
display: inline-block;
font-size: 11px;
font-weight: 500;
letter-spacing: 0.04em;
color: var(--color-text-3);
line-height: 1.2;
}
.role-picker__title {
margin: 4px 0 0;
font-size: 16px;
font-weight: 600;
line-height: 1.35;
color: var(--color-text-1);
}
.role-picker__summary {
margin: 4px 0 0;
font-size: 12px;
line-height: 1.5;
color: var(--color-text-3);
}
.role-picker__meter {
display: flex;
align-items: center;
gap: 10px;
flex-shrink: 0;
}
.role-picker__count {
font-size: 12px;
.role-picker__meter-text {
display: flex;
flex-direction: column;
gap: 2px;
}
.role-picker__meter-num {
font-size: 13px;
font-weight: 600;
color: var(--color-text-1);
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
.role-picker__meter-hint {
font-size: 11px;
color: var(--color-text-3);
white-space: nowrap;
}
.role-picker__radios {
.role-picker__roles {
display: flex;
flex-wrap: wrap;
gap: 0;
gap: 8px;
margin-top: 14px;
}
@media (max-width: 768px) {
.role-picker__head {
.role-picker__chip {
height: 32px;
padding: 0 12px;
border-radius: 4px;
border: 1px solid var(--color-border-2);
background: var(--color-bg-2);
color: var(--color-text-2);
font-size: 13px;
line-height: 30px;
cursor: pointer;
transition:
border-color 0.15s ease,
background 0.15s ease,
color 0.15s ease;
&:hover {
border-color: color-mix(in srgb, var(--app-primary-color) 45%, var(--color-border-2));
color: var(--color-text-1);
}
&.is-active {
border-color: var(--app-primary-color);
background: color-mix(in srgb, var(--app-primary-color) 12%, #fff);
color: var(--app-primary-color);
font-weight: 600;
}
}
.role-picker__focus {
display: flex;
align-items: flex-start;
gap: 10px;
margin-top: 12px;
padding-top: 12px;
border-top: 1px dashed var(--color-border-2);
}
.role-picker__focus-label {
flex-shrink: 0;
margin-top: 2px;
font-size: 12px;
color: var(--color-text-3);
line-height: 22px;
}
.role-picker__focus-tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
min-width: 0;
}
.role-picker__tag {
display: inline-flex;
align-items: center;
height: 22px;
padding: 0 8px;
border-radius: 4px;
background: var(--color-fill-2);
color: var(--color-text-2);
font-size: 12px;
line-height: 22px;
}
@media (max-width: 640px) {
.role-picker__top {
align-items: flex-start;
}
.role-picker__meter {
flex-direction: column;
align-items: flex-end;
gap: 4px;
}
.role-picker__meter-text {
align-items: flex-end;
}
.role-picker__focus {
flex-direction: column;
gap: 6px;
}
}
</style>

View File

@ -0,0 +1,136 @@
<script lang="ts" setup>
import { computed, ref } from 'vue'
import {
SCRIPT_GROUP_LABEL,
SCRIPT_ROWS,
type ScriptGroupKey,
} from './training-meta'
defineOptions({ name: 'TrainingScriptsPanel' })
const keyword = ref('')
const group = ref<ScriptGroupKey | 'all'>('all')
const groups: { key: ScriptGroupKey | 'all'; label: string }[] = [
{ key: 'all', label: '全部' },
{ key: 'order', label: SCRIPT_GROUP_LABEL.order },
{ key: 'fee', label: SCRIPT_GROUP_LABEL.fee },
{ key: 'track', label: SCRIPT_GROUP_LABEL.track },
{ key: 'pay', label: SCRIPT_GROUP_LABEL.pay },
]
const filtered = computed(() => {
const q = keyword.value.trim().toLowerCase()
return SCRIPT_ROWS.filter((row) => {
if (group.value !== 'all' && row.group !== group.value) return false
if (!q) return true
const hay = `${row.trigger} ${row.say} ${row.check}`.toLowerCase()
return hay.includes(q)
})
})
</script>
<template>
<div class="scripts-panel">
<div class="scripts-panel__toolbar">
<a-input
v-model="keyword"
allow-clear
size="small"
class="scripts-panel__search"
placeholder="搜客户说法 / 话术关键词,如:待排货、旧价、轨迹"
/>
<a-radio-group v-model="group" type="button" size="small">
<a-radio v-for="g in groups" :key="g.key" :value="g.key">{{ g.label }}</a-radio>
</a-radio-group>
</div>
<div v-if="!filtered.length" class="scripts-panel__empty">没有匹配话术,换个词试试。</div>
<div v-else class="scripts-panel__list">
<article v-for="row in filtered" :key="row.id" class="script-row">
<div class="script-row__meta">
<span class="script-row__group">{{ SCRIPT_GROUP_LABEL[row.group] }}</span>
<span class="script-row__trigger">{{ row.trigger }}</span>
</div>
<p class="script-row__say">「{{ row.say }}」</p>
<p class="script-row__check">后台先看:{{ row.check }}</p>
</article>
</div>
</div>
</template>
<style lang="less" scoped>
.scripts-panel {
margin: 0 0 16px;
}
.scripts-panel__toolbar {
display: flex;
flex-direction: column;
gap: 10px;
margin-bottom: 12px;
}
.scripts-panel__search {
max-width: 420px;
}
.scripts-panel__empty {
padding: 24px;
text-align: center;
font-size: 13px;
color: var(--color-text-3);
border: 1px dashed var(--color-border-2);
border-radius: 8px;
}
.scripts-panel__list {
display: flex;
flex-direction: column;
gap: 8px;
}
.script-row {
padding: 12px 14px;
border: 1px solid var(--color-border-2);
border-radius: 8px;
background: var(--color-bg-2);
}
.script-row__meta {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
.script-row__group {
height: 20px;
padding: 0 6px;
border-radius: 4px;
background: var(--color-fill-2);
color: var(--color-text-3);
font-size: 11px;
line-height: 20px;
}
.script-row__trigger {
font-size: 13px;
font-weight: 600;
color: var(--color-text-1);
}
.script-row__say {
margin: 8px 0 4px;
font-size: 13px;
line-height: 1.55;
color: var(--color-text-1);
}
.script-row__check {
margin: 0;
font-size: 12px;
color: var(--color-text-3);
}
</style>

View File

@ -1,5 +1,5 @@
export type TrainingWeekKey = 'week1' | 'week2' | 'week3' | 'week4' | 'practice' | 'exam'
export type TrainingRoleKey = 'all' | 'cs' | 'channel' | 'warehouse' | 'implement'
export type TrainingRoleKey = 'all' | 'ops' | 'cs' | 'warehouse' | 'finance' | 'implement'
export interface TrainingChecklistItem {
id: string
@ -15,20 +15,25 @@ export const TRAINING_ROLES: { key: TrainingRoleKey; label: string; summary: str
label: '通才 / 未定岗',
summary: '四周全学,约 20 个工作日',
},
{
key: 'ops',
label: '运营',
summary: '第1周快过 + 第2周渠道深挖 + 第3周待排货;约 12 个工作日',
},
{
key: 'cs',
label: '客服',
summary: '第1+3周为主,第4周轨迹扫一眼;约 12 个工作日',
},
{
key: 'channel',
label: '渠道运营',
summary: '第2周深挖 + 第3周待排货;第1周快速过;约 12 个工作日',
key: 'warehouse',
label: '操作',
summary: '第1周状态 + 第3周入库出库;约 8~10 个工作日',
},
{
key: 'warehouse',
label: '仓管 / 操作',
summary: '第1周状态 + 第3周入库出库;约 8~10 个工作日',
key: 'finance',
label: '财务',
summary: '第1周主线 + 第3周费用/付款;营销折扣扫一眼;约 8~10 个工作日',
},
{
key: 'implement',
@ -40,9 +45,10 @@ 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'],
channel: ['week1', 'week2', 'week3', 'practice', 'exam'],
warehouse: ['week1', 'week3', 'practice', 'exam'],
finance: ['week1', 'week3', 'practice', 'exam'],
implement: ['week1', 'week4', 'practice', 'exam'],
}
@ -56,34 +62,70 @@ export const CHECKLIST_ITEMS: TrainingChecklistItem[] = [
{ id: 'practice.draft-fail', week: 'practice', label: '制造/找到一票预报失败草稿,能读失败原因' },
{ id: 'practice.price-vs-order', week: 'practice', label: '复现「查价有价、下单更严」(缺邮编/黑名单等)' },
{ id: 'practice.track-refresh', week: 'practice', label: '出库后在轨迹订单刷新,能读时间轴(有则看未映射)' },
{
id: 'practice.fee-compare',
week: 'practice',
label: '同一票对比预报应收 vs 入库应收,说出差额原因',
roles: ['finance', 'cs', 'ops'],
},
{
id: 'practice.floor',
week: 'practice',
label: '打开入库/出库扫描页各一次;知道仓租账单入口',
roles: ['warehouse', 'ops'],
},
{
id: 'practice.calc',
week: 'practice',
label: '算账课例 B:能口述券与会员折二选一、附加费不打折',
roles: ['finance', 'cs', 'ops'],
},
// 第1周
{ id: 'w1.map', week: 'week1', label: '画出销售产品 / 服务渠道 / 预报 vs 入库 / 待排货' },
{ id: 'w1.map', week: 'week1', label: '用自己的话讲清:销售产品 / 服务渠道 / 预报 vs 入库' },
{ id: 'w1.pc-order', week: 'week1', label: '网页端完成查价→下单→看到已预报' },
{ id: 'w1.h5', week: 'week1', label: 'H5 同账号对照查价与订单列表' },
{ id: 'w1.ops-find', week: 'week1', label: '运营端用运单号找到该单并说出状态含义' },
{ id: 'w1.explain', week: 'week1', label: '能解释:客户选销售产品,入库后系统选服务渠道' },
{
id: 'w1.money',
week: 'week1',
label: '能区分:客户应付的钱(应收)vs 公司付给下游的钱(成本)',
roles: ['finance', 'ops', 'cs'],
},
// 第2周
{ id: 'w2.zone', week: 'week2', label: '价格分区 / 黑名单 / 偏远各做一组正反例', roles: ['all', 'channel'] },
{ id: 'w2.weight', week: 'week2', label: '按计重规则手算一例计费重', roles: ['all', 'channel'] },
{ id: 'w2.price', week: 'week2', label: '卖价矩阵故意配错,看到「卖价未匹配」', roles: ['all', 'channel'] },
{ id: 'w2.alloc', week: 'week2', label: '理解排货与买价发布;能说明待排货成因', roles: ['all', 'channel', 'cs'] },
{ id: 'w2.publish', week: 'week2', label: '规则+价格都点过发布;故意不发布观察旧规则', roles: ['all', 'channel'] },
{ id: 'w2.zone', week: 'week2', label: '价格分区 / 黑名单 / 偏远各做一组正反例', roles: ['ops'] },
{ id: 'w2.weight', week: 'week2', label: '按计重规则手算一例计费重', roles: ['ops', 'finance'] },
{ id: 'w2.price', week: 'week2', label: '卖价矩阵故意配错,看到「卖价未匹配」', roles: ['ops'] },
{ id: 'w2.alloc', week: 'week2', label: '理解排货与买价发布;能说明待排货成因', roles: ['ops', 'cs'] },
{ id: 'w2.publish', week: 'week2', label: '规则+价格都点过发布;故意不发布观察旧规则', roles: ['ops'] },
// 第3周
{ id: 'w3.full', week: 'week3', label: '完整跑通:下单→入库→付款→出库' },
{ id: 'w3.pending', week: 'week3', label: '待排货→重算应付→待支付' },
{ id: 'w3.fee-talk', week: 'week3', label: '用预报/入库件重尺差演练费用解释', roles: ['all', 'cs', 'channel'] },
{ id: 'w3.fee-talk', week: 'week3', label: '用预报/入库件重尺差演练费用解释', roles: ['cs', 'ops', 'finance'] },
{ id: 'w3.cross-end', week: 'week3', label: '同一运单号网页端与运营端状态一致' },
{ id: 'w3.warehouse', week: 'week3', label: '跟一次入库/出库扫描(或录屏)', roles: ['all', 'warehouse'] },
{ id: 'w3.warehouse', week: 'week3', label: '跟一次入库/出库扫描(或录屏)', roles: ['warehouse'] },
{
id: 'w3.pay',
week: 'week3',
label: '看清一票:待支付→付款成功→待发货;能指出费用明细里基础运费与附加费',
roles: ['finance', 'cs'],
},
{
id: 'w3.marketing',
week: 'week3',
label: '知道会员折/券只打基础运费、二者取更优',
roles: ['finance', 'cs', 'ops'],
},
// 第4周
{ id: 'w4.track', week: 'week4', label: '轨迹订单刷新,能读时间轴', roles: ['all', 'cs', 'implement'] },
{ id: 'w4.unmap', week: 'week4', label: '理解未映射:有原文无标准节点先查内容映射', roles: ['all', 'cs', 'implement'] },
{ id: 'w4.push', week: 'week4', label: '看过一条推送记录(成功或失败原因)', roles: ['all', 'implement', 'cs'] },
{ id: 'w4.api', week: 'week4', label: '能口述上游/下游/映射/应用/发布', roles: ['all', 'implement'] },
{ id: 'w4.log', week: 'week4', label: '打开请求日志对照最终报文', roles: ['all', 'implement'] },
{ id: 'w4.track', week: 'week4', label: '轨迹订单刷新,能读时间轴', roles: ['cs', 'implement'] },
{ id: 'w4.unmap', week: 'week4', label: '理解未映射:有原文无标准节点先查内容映射', roles: ['cs', 'implement'] },
{ id: 'w4.push', week: 'week4', label: '看过一条推送记录(成功或失败原因)', roles: ['implement', 'cs'] },
{ id: 'w4.api', week: 'week4', label: '能口述上游/下游/映射/应用/发布', roles: ['implement'] },
{ id: 'w4.log', week: 'week4', label: '打开请求日志对照最终报文', roles: ['implement'] },
// 总验收
{ id: 'exam.flow', week: 'exam', label: '能画出查价→…→轨迹状态流转' },
@ -91,21 +133,29 @@ export const CHECKLIST_ITEMS: TrainingChecklistItem[] = [
{ id: 'exam.pending', week: 'exam', label: '能说明待排货是什么、怎么处理' },
{ id: 'exam.publish', week: 'exam', label: '改价客户仍旧价时,先查是否发布' },
{ id: 'exam.track', week: 'exam', label: '能处理「官网有轨迹你们没有」' },
{ id: 'exam.api', week: 'exam', label: '能说明上游下游映射发布;排错看请求日志' },
{ id: 'exam.api', week: 'exam', label: '能说明上游下游映射发布;排错看请求日志', roles: ['implement'] },
{ id: 'exam.ends', week: 'exam', label: '同一运单号:网页端/H5/运营端各在哪找' },
{ id: 'exam.notes', week: 'exam', label: '提交「一票货四端对照」个人笔记' },
{
id: 'exam.finance',
week: 'exam',
label: '能讲清:预报价≠最终价;应收 vs 成本;优惠只打基础运费',
roles: ['finance', 'cs', 'ops'],
},
]
export function itemsForWeek(week: TrainingWeekKey): TrainingChecklistItem[] {
return CHECKLIST_ITEMS.filter((i) => i.week === week)
}
export function itemsForRole(role: TrainingRoleKey): TrainingChecklistItem[] {
const weeks = new Set(ROLE_WEEK_FOCUS[role])
return CHECKLIST_ITEMS.filter((i) => {
if (!weeks.has(i.week)) return false
if (!i.roles || i.roles.length === 0) return true
if (role === 'all') return true
return i.roles.includes(role) || i.roles.includes('all')
})
export function itemsForRole(
role: TrainingRoleKey,
week?: TrainingWeekKey | 'all',
): TrainingChecklistItem[] {
const list =
!week || week === 'all'
? CHECKLIST_ITEMS
: CHECKLIST_ITEMS.filter((i) => i.week === week)
if (role === 'all') return list
return list.filter((i) => !i.roles || i.roles.includes(role))
}

View File

@ -0,0 +1,57 @@
# 算账课(财务 / 客服 / 运营)
> 不背公式,只练「打开费用明细时怎么跟客户讲」。
> 细规则见 [营销指引](/marketing/guide)、[订单指引](/order/guide)。
---
## 1. 先分清三笔钱
| 名字 | 白话 | 在哪看 |
|------|------|--------|
| **预报应收** | 客户填尺寸时估出来的 | 下单后、入库前 |
| **入库应收** | 仓库实测后的,催付以此为准 | 入库后费用明细 |
| **成本(买价)** | 公司付给下游的 | 排货成功后;运单/渠道侧 |
**毛利直觉:** 入库应收里的基础运费 − 下游成本 − 营销让利 ≈ 这票大概赚多少。
---
## 2. 课堂例 A:入库比预报贵
- 预报:计费重 1.0kg → 基础运费 **20 元**
- 入库:实重变大,计费重 1.5kg → 基础运费 **28 元**
- 另有燃油附加费 **3 元**(不变)
对客:差额来自 **实测计费重**,不是乱加价。
财务核对:打开同一票的预报件重尺 vs 入库件重尺。
---
## 3. 课堂例 B:会员折 vs 券(只打基础运费)
假设入库后:
- 基础运费 100 元
- 燃油 + 偏远附加费合计 15 元
- 铜卡会员折 99 折 → 基础运费少付 1 元 → 基础实付 99
- 手头有一张「满 80 减 10」券 → 若用券,基础实付 90
系统规则:**会员折和券二选一,取更省的** → 用券更省(少付 10 > 少付 1)→ 基础 90 + 附加费 15 = **应付 105**。
| 项目 | 金额 |
|------|------|
| 基础运费(用券后) | 90 |
| 附加费(不参与优惠) | 15 |
| 客户应付 | 105 |
| 积分 | 只按「实付基础运费」计(例:90 分),附加费不计 |
---
## 4. 财务日常三问
1. 这票卡在 **待支付** 还是已经付款?
2. 费用明细里,哪几行是基础运费,哪几行是附加费?
3. 有没有券/会员折?有的话是否只动了基础运费?
常用入口:[我的订单](/order/myOrders) · [运单管理](/order/waybillManage) · [账户流水](/finance/accountFlow) · [营销指引](/marketing/guide)

View File

@ -1,35 +1,16 @@
# 总验收说明
> 验收安排在 **工作日**(建议第 4 周周五或下一周周一)。
> **下方勾选清单** 即总验收题,勾选保存在本机;带教对照勾选提问即可。
> **上方「今天下午怎么考」** 已按岗位给出 3 道口述题 + 笔记模板。
> **下方勾选** 为总验收清单(按岗位过滤),保存在本机。
---
## 带教人 checklist
- [ ] 测服可自助注册客户;运营账号能开
- [ ] 练习用现有已启用销售产品即可
- [ ] **每周五** 30 分钟对照「进度」勾选;周六日不排
- [ ] 法定假日顺延,不压缩进周末
- [ ] 第 4 周周五:收「一票货四端对照」笔记 + 过验收勾选
---
## 个人笔记模板
```text
运单号:
客户单号:
销售产品:
网页端截图:
H5 截图:
运营端状态:
预报费用 / 入库费用:
排货渠道:
轨迹最新节点:
本次踩坑:
对应指引章节:
```
- [ ] 测服可注册客户;运营账号能开
- [ ] 新人已选对岗位轨(总览页)
- [ ] 每周五 30 分钟对照进度;周末不排
- [ ] 收「一票货四端对照」笔记 + 过验收勾选
---
@ -39,14 +20,14 @@ H5 截图:
|------|------|
| 渠道 | [/channel/guide](/channel/guide) |
| 订单 | [/order/guide](/order/guide) |
| 操作 | [/operation/guide](/operation/guide) |
| 仓储 | [/warehouse/guide](/warehouse/guide) |
| 轨迹 | [/track/guide](/track/guide) |
| API | [/api/apiDebugger](/api/apiDebugger) |
| 话术 | 本页「话术」Tab |
| 练习包 | 本页「练习包」Tab |
| 营销 | [/marketing/guide](/marketing/guide) |
| 算账课 | 本页「算账」Tab |
---
## 一句话
> 先当客户发一票,再当运营配通、查通;
> 钱看渠道发布,货看订单状态,进度看轨迹映射,外系统看 API 发布与日志。
> 运营盯发布,客服盯状态,操作盯扫描,财务盯费用明细。

View File

@ -1,111 +1,117 @@
# OMS 新人培训手册
# OMS 新人培训(培训师讲义)
> 面向 **运营、客服、实施、仓管** 等内部新人。
> 只讲业务:怎么理解系统、怎么按月学会、怎么验收。
> 渠道 / 订单 / 轨迹 / API 的细配与排障,请点开文末「配套指引」。
你好。下面这份材料按 **「先懂物流生意,再懂系统按钮」** 来写。
页面上方先选好 **岗位轨**(运营 / 客服 / 操作 / 财务 …),勾选进度会按岗位过滤,保存在本机。
页面上方可选 **岗位轨**(勾选进度按岗位过滤,保存在本机)。
细配与排障:打开文末「配套指引」。本页只帮你建立地图、敢上手。
---
## 计时规则(必读)
## 开场故事:一票货怎么赚钱?
- **只计工作日(周一~周五)**,周六、周日 **不排课、不计入进度**。
- 通才四周 ≈ **20 个工作日**;遇法定节假日顺延到下一个工作日。
- 课表里的「周一~周五」均指当周工作日,不是自然日连号。
想象客户小王要寄一箱货去马来西亚。
1. 他先问:「大概多少钱?」→ 这叫 **查价**
2. 觉得行,填地址、尺寸,点提交 → 这叫 **下单 / 预报**(系统先按他填的尺寸估一笔钱)
3. 箱子到了咱们仓库,称重、量尺寸 → 这叫 **入库**(钱可能变;系统还要选走哪家承运商)
4. 小王付钱 → **待发货**;仓库扫码发出 → **出库**
5. 承运商网站开始有物流节点 → **轨迹** 上网,客服才能回答「到哪了」
公司怎么赚钱?
**卖给客户的运费(应收)− 付给下游承运商的成本(买价)≈ 毛利。**
中间还有燃油、偏远等附加费,以及会员折、优惠券(只打在基础运费上)。
OMS 就是把上面这条链 **配清楚、算清楚、查得着**。
---
## 岗位速成(怎么选课)
## 系统积木(各管什么)
| 岗位 | 怎么学 | 大约工期 |
|------|--------|----------|
| **通才 / 未定岗** | 第1~4周全学 + 练习包 | 20 个工作日 |
| **客服** | 第1、3周为主;第4周只学轨迹(周一~周二);话术 Tab 常备 | ≈12 个工作日 |
| **渠道运营** | 第1周快速过;第2周深挖;第3周待排货与费用 | ≈12 个工作日 |
| **仓管 / 操作** | 第1周状态机;第3周入库出库与待排货协同 | ≈8~10 个工作日 |
| **实施 / 对接** | 第1周主线;第4周轨迹+API;练习包场景 1、5 | ≈10 个工作日 |
| 积木 | 一句话 | 谁天天碰 | 指引 |
|------|--------|----------|------|
| **渠道** | 卖什么线路、卖多少钱、货走哪家下游 | 运营 | [/channel/guide](/channel/guide) |
| **订单** | 查价→下单→入库→付款→出库 | 客服、操作、财务 | [/order/guide](/order/guide) |
| **操作** | 仓内扫枪:入库、出库、装袋、打单 | 操作 | [/operation/guide](/operation/guide) |
| **仓储** | SKU、库存、入库预报、仓租账本 | 仓管、财务 | [/warehouse/guide](/warehouse/guide) |
| **轨迹** | 把服务商话翻译成标准节点,再给客户看 | 客服 | [/track/guide](/track/guide) |
| **营销** | 会员折、券、拉新(只动基础运费) | 运营、财务 | [/marketing/guide](/marketing/guide) |
测服账号 **自己注册**;产品用环境里已有线路即可 → 见「练习包」Tab。
---
## 1. 这套系统在干什么?
| 模块 | 一句话 | 指引页 |
|------|--------|--------|
| **渠道** | 卖什么、卖多少、货走哪条下游 | [/channel/guide](/channel/guide) |
| **订单** | 查价 → 下单 → 入库 → 付款 → 出库 | [/order/guide](/order/guide) |
| **轨迹** | 服务商轨迹翻译成标准节点,再推给客户 | [/track/guide](/track/guide) |
| **API** | 公司标准接口 ↔ 服务商方言 | [/api/apiDebugger](/api/apiDebugger) |
**主线:**
主线记这一串:
```
渠道定规则并发布 → 客户下单预报计费 → 入库实测改价并排货
→ 付款出库 → 轨迹上网 →(可选)推客户系统 / 调外部接口
→ 付款出库 → 轨迹上网
```
订单状态:
订单状态(口语版):
```
草稿 → 已预报 →(入库)→ 待支付 或 待排货
↓(付款)
待发货 →(出库)→ 待上网 → …轨迹
草稿 → 已预报 → 入库后变成「待支付」或「待排货」
↓ 客户付钱
待发货 → 出库 → 待上网 → …轨迹
```
---
## 2. 四个端
## 四个角色分别学什么?(选岗)
| 端 | 登录入口 | 谁用 |
|----|----------|------|
| **网页端** | `/login` | 发货客户 PC |
| **H5** | `/h5` | 同一客户手机 |
| **运营端** | `/admin` | 内部员工 |
| **客户端** | 与网页端同一客户体系 | 「当客户」优先网页端,再用 H5 对照 |
| 岗位 | 你要能回答的问题 | 建议工期 | 怎么选课 |
|------|------------------|----------|----------|
| **运营** | 价从哪来?为什么忘了发布客户还是旧价?待排货怎么修? | ≈12 工作日 | 第1周快过 → **第2周深挖** → 第3周待排货 |
| **客服** | 客户卡在哪一步?费用为什么变了?轨迹为什么没有? | ≈12 工作日 | **第1、3周** + 第4周轨迹 + 话术 Tab |
| **操作** | 入库/出库扫什么?扫完状态变成啥?待排货要不要拦货? | ≈8~10 工作日 | 第1周状态机 + **第3周入库出库** |
| **财务** | 预报价≠最终价?应收和成本差在哪?券打在什么上? | ≈8~10 工作日 | 第1周主线 + **第3周费用/付款** |
| **通才** | 上面都会一点 | ≈20 工作日 | 四周全学 |
| **实施** | 外系统怎么连进来?(业务层) | ≈10 工作日 | 第1周 + 第4周 API |
**心态:** 先当客户发一票,再当运营配通、查通。
**培训师口诀:**
- 运营盯 **发布**
- 客服盯 **状态 + 话术**
- 操作盯 **扫描 + 件重尺**
- 财务盯 **费用明细 + 付款**
---
## 3. 四周主题
## 四个端(别登错门)
| 周次 | 主题 |
| 端 | 入口 | 谁用 |
|----|------|------|
| 客户网页 | `/login` | 发货客户 PC |
| 客户 H5 | `/h5` | 同一客户手机 |
| 运营端 | `/admin` | 内部员工(你们) |
心态:**先当客户发一票,再当内部人查这票。**
---
## 四周课表(只计工作日)
| 周 | 主题 | 培训师目标 |
|----|------|------------|
| 第1周 | 当客户跑通 | 能讲「一票货从问价到上网」 |
| 第2周 | 渠道为什么有价 | 懂「不发布=没改」 |
| 第3周 | 订单排障 + 钱 | 待排货、费用争议、付款 |
| 第4周 | 轨迹 + API | 查件不慌;知道外系统怎么接 |
周六日不排课。测服账号 **自己注册**;产品用环境里已有线路即可。
---
## 每天最小练习(5~15 分钟)
1. 客户侧下/查一票(或打开昨天那票)
2. 运营端用 **同一运单号** 对一下状态和费用
3. 问自己三句:发布了吗?预报还是入库?轨迹是映射还是还没上网?
---
## 配套入口
| 主题 | 去哪 |
|------|------|
| **第 1 周** | 当客户跑通;分清四端 |
| **第 2 周** | 渠道为什么有价;不发布=没改 |
| **第 3 周** | 订单运营排障;待排货与费用 |
| **第 4 周** | 轨迹 + API |
| 练习包(可点跳转) / 话术(可搜) / 算账 | 本页对应 Tab |
| 进度 · 带教口述题 | 「进度」Tab 置顶 |
| 渠道 / 订单 / 操作 / 仓储 / 轨迹 / 营销 | 见上表指引列 |
| 工作台快捷入口 | 运营端工作台「培训手册」 |
```mermaid
flowchart LR
A[第1周 当客户] --> B[第2周 渠道配置]
B --> C[第3周 订单排障]
C --> D[第4周 轨迹与API]
```
**刻意先不啃:** 开发 Tab、表结构、脚本细节。
---
## 4. 每日最小闭环(工作日)
1. 网页端或 H5 下/查一票
2. 运营端看同一运单状态与费用
3. 出库后看轨迹时间轴
4. 三问:发布了吗?预报还是入库?映射还是推送?
周末可自愿复习,**不计入是否完成**。
---
## 5. 配套入口
| 主题 | 路径 |
|------|------|
| 练习包 | 本页「练习包」Tab |
| 对客话术 | 本页「话术」Tab |
| 勾选进度 | 本页「进度」Tab |
| 渠道 / 订单 / 轨迹 / API 指引 | `/channel/guide` 等 |
| 工作台 | 运营端工作台「培训手册」快捷入口 |
选岗后,非本岗重点的周次 Tab 会标成 **选读**(仍可打开,但建议先学亮着的)。

View File

@ -1,54 +1,30 @@
# 测服练习包
> 账号请 **自己在测服注册**;销售产品用环境里 **已有已启用产品** 即可,不必新建专线。
> 勾选进度见本页下方或「进度」Tab(保存在本机浏览器)。
> 账号请 **自己在测服注册**;销售产品用环境里 **已有已启用产品** 即可。
> **上方卡片**可一键跳到查价 / 下单 / 扫描等页面;下方勾选进度。
---
## 1. 开练前准备
## 开练前准备
| 准备项 | 怎么做 |
|--------|--------|
| **客户账号** | 测服网页端 [`/login`](/login) 自行注册;手机可再用 H5 [`/h5`](/h5) 同账号登录 |
| **运营账号** | 向带教/管理员要内部账号,入口 [`/admin`](/admin);至少能看订单、渠道、轨迹 |
| **练习产品** | 在「我要查价 / 我要下单」里任选一条 **已启用** 销售产品;记下编码与目的国 |
| **权限** | 若侧栏没有「培训手册」,让管理员对知识库点一次「同步子菜单」,并勾选角色菜单 |
| 客户账号 | 测服网页 [`/login`](/login) 注册;手机可用 [`/h5`](/h5) |
| 运营账号 | 向带教要 [`/admin`](/admin) |
| 练习产品 | 查价/下单里任选一条已启用销售产品 |
| 菜单 | 若没有「培训手册」,让管理员同步知识库子菜单 |
制造待排货 / 草稿 **只用测服**,改完还原。
---
## 2. 必练场景(建议按序)
## 四端对照(同一运单号)
| # | 场景 | 你要看到什么 | 备注 |
|---|------|--------------|------|
| 1 | **幸福路径** | 已预报 → 入库后待支付 → 付款 → 出库 → 待上网 | 用任意现有产品;件重尺填完整 |
| 2 | **查价松 / 下单严** | 查价能出参考价;故意缺邮编或踩黑名单时下单失败 | 对客话术:查价仅供参考 |
| 3 | **待排货** | 入库后进待排货;修好配置/重算应付后变待支付 | 可让带教临时关掉某渠道买价或清空排货再恢复 |
| 4 | **预报失败草稿** | 订单停在草稿,有「预报失败原因」 | 常见:分区未匹配、卖价未匹配、未发布 |
| 5 | **轨迹刷新** | 出库后轨迹订单有时间轴;若有未映射会看到原文 | 服务商尚未上网时只有已预报也正常 |
制造待排货/草稿时 **只用测服**,改完记得还原,避免影响他人。
---
## 3. 四端对照(同一票)
对场景 1 的运单号,分别打开:
| 端 | 看哪里 |
|----|--------|
| 端 | 打开哪里 |
|----|----------|
| 网页端 | [`/order/myOrders`](/order/myOrders) |
| H5 | [`/h5/orders`](/h5/orders) |
| 运营端 | 运单管理 / 我的订单(按权限) |
| 运营端 | 运单管理 / 我的订单 |
| 轨迹 | [`/track/order`](/track/order)(出库后) |
截图或记到个人笔记(模板见「进度 / 验收」)。
---
## 4. 带教最小配合
- 测服可注册客户;运营账号能开
- 允许新人在测服改练习相关配置(或带教代改演示待排货)
- **每周五** 对照「进度」Tab 勾选情况聊 30 分钟;周六日不排
产品不必单独建:现网测服已有线路全部可用。
笔记模板在「进度」Tab 的带教验收区。

View File

@ -1,61 +1,21 @@
# 对客话术速查
# 对客话术
> 客服日常页。先安抚,再给原因与下一步;涉及改价/禁运时对齐渠道同事。
> 细配见 [订单指引](/order/guide)、[轨迹指引](/track/guide)、[渠道指引](/channel/guide)。
> 用 **上方搜索 / 分组** 找话:客户说了一句 → 复制说法 → 后台先看那一栏。
> 细配:[订单指引](/order/guide) · [轨迹指引](/track/guide) · [渠道指引](/channel/guide)
---
## 1. 开场与原则
## 开场四句(先背)
| 原则 | 说法示例 |
|------|----------|
| 查价≠最终价 | 「查价是参考,最终以仓库入库实测重量和尺寸计费为准。」 |
| 状态可查 | 「您报一下运单号或客户单号,我帮您看当前到哪一步。」 |
| 不瞎承诺时效 | 「轨迹以服务商上网为准;我们这边看到节点会同步给您。」 |
| 改配置要发布 | (对内)客户仍旧价 → 先问渠道是否点过发布,别只改草稿 |
1. 「您报一下 **运单号** 或客户单号,我帮您看当前到哪一步。」
2. 「查价是 **参考价**,最终以仓库 **入库实测** 为准。」
3. 「轨迹以服务商上网为准;映射好了会同步给您。」
4. (对内)客户说还是旧价 → 先问运营 **发布了没有**。
---
## 2. 下单 / 费用
## 对内三句
| 客户或系统说法 | 可对客户说 | 你后台先查 |
|----------------|------------|------------|
| 客户单号已存在 | 「这个客户单号已经用过了,请换一个再提交,或告诉我原单号我帮您查。」 | 同客户是否已有该单 |
| 产品不存在/未启用 | 「当前线路暂时不可用,我帮您看下可发的替代线路。」 | 销售产品是否启用 |
| 地址命中黑名单 | 「这个邮编/地区暂时无法收寄,请换地址或换线路;需要的话我帮您确认禁运范围。」 | 黑名单 + 产品关联 |
| 价格分区未匹配 | 「目的地分区还对不上报价,我请渠道同事核对邮编分区,好了马上回您。」 | 价格分区明细、是否发布 |
| 卖价未匹配 | 「这个重量/货物类型暂时报不出价,我们核对价卡后回您。」 | 卖价矩阵重量段/货物属性 |
| 未命中价格/规则快照 | 「线路规则刚在调整,请稍等我们发布后再下;或先换一条已上线线路。」 | 是否发布 rules/price |
| 查价有价、下单失败 | 「查价比较宽松,下单要完整邮编和地址。请按页面提示补全后再试。」 | 邮编、黑名单、尺寸 |
| 一直草稿 | 「系统还在算预报运费,请稍等刷新;若一直如此,我看失败原因帮您改。」 | 预报失败原因 |
| 入库后比预报贵 | 「入库按实测重和体积重重新计费,体积大或超重都会上调,这是正常规则。」 | 预报 vs 入库件重尺 |
| 一直待排货 | 「货已收到,系统还在匹配承运渠道。我们处理好运费渠道后会变成待支付,再通知您付款。」 | 待排货原因;找渠道补买价/排货 |
---
## 3. 轨迹
| 客户说法 | 可对客户说 | 你后台先查 |
|----------|------------|------------|
| 官网有轨迹,你们没有 | 「我马上按单号刷新;若服务商文案还没对上我们的标准节点,会先补映射再更新给您。」 | 刷新;未映射原文;单号类型 |
| 一直显示已预报 | 「仓库出库后,要等服务商上网才会有运输节点。我帮您确认是否已出库、拉取是否已开始。」 | 是否出库;拉取开始节点 |
| 节点乱跳 / 缺段 | 「我们核对一下节点映射,避免关键词过宽;好了会按正确顺序展示。」 | 映射关键词、反向词 |
| 我们系统没收到推送 | 「我查一下贵司推送开关和最近一次推送记录;必要时先手工补推一笔。」 | 自动推送、顺序、推送记录 |
---
## 4. 付款 / 出库
| 场景 | 可对客户说 |
|------|------------|
| 催付 | 「您的包裹已入库计费完成,请登录后完成支付,我们才能安排出库。」 |
| 已付未出库 | 「支付已收到,仓库正在排队出库;出库后轨迹会进入待上网。」 |
| 要拦截 | 「请提供运单号,我看当前状态能否拦截;已出库/已上网的需按服务商规则处理。」 |
---
## 5. 对内三句(自己先想清)
1. 规则/价格 **发布了吗**?
2. 卡在 **预报** 还是 **入库/排货**?
3. 轨迹是 **映射** 问题还是 **推送** 问题?
1. 规则 / 价格 **发布了吗**?
2. 卡在 **预报** 还是 **入库 / 排货**?
3. 轨迹是 **还没上网**,还是 **映射 / 推送**?

View File

@ -1,58 +1,72 @@
# 第 1 周:建立业务地图 + 当客户跑通一票
# 第 1 周:先当客户,把一票货跑通
**本周目标:** 能口述「一票货从问价到上网」;分清网页端 / H5 / 运营端角色。
**计时:** 仅周一~周五 5 个工作日;周六日不算。
**培训师本周目标:** 新人能用自己的话讲清「一票货从问价到上网」,并分清客户网页 / H5 / 运营端。
**计时:** 仅周一~周五;周六日不算。
---
## 学习安排(工作日)
## 本周故事(课堂用)
| 工作日 | 学什么 | 怎么练 |
小王要寄 **马来西亚**,选销售产品「MY 特惠线」,预报尺寸 30×20×10 cm、实重 0.8kg。
| 步骤 | 他做了什么 | 系统状态大概变成 |
|------|------------|------------------|
| 1 | 查价看了一眼参考运费 | 不落库,只是参考 |
| 2 | 填齐地址和件重尺,确认下单 | 很快变成 **已预报**,有一笔「预报应收」 |
| 3 | 箱子到仓,称重变成 0.95kg | **入库**后按实测重算;排货成功 → **待支付** |
| 4 | 付钱 | **待发货** |
| 5 | 仓库扫码出库 | **待上网**,之后看轨迹 |
**课堂上要强调的两句:**
1. 客户下单选的是 **销售产品**(卖什么);货真正走哪家,是入库时系统 **排货** 选的 **服务渠道**。
2. 查价可以松一点;真正下单更严(邮编、黑名单、尺寸都要齐)。
---
## 工作日安排
| 工作日 | 学什么 | 练什么 |
|--------|--------|--------|
| **周一** | 读 [渠道指引](/channel/guide)、[订单指引](/order/guide) 前半;画业务脑图 | 纸上画出:销售产品 / 服务渠道 / 预报 vs 入库 / 待排货 |
| **周二** | 继续补脑图;运营端只逛菜单,先别改配置 | 能讲清四个模块各管什么 |
| **周三** | **网页端当客户**:查价 → 下单 → 看状态 → 付款(测服) | 故意漏邮编、错尺寸,感受「查价松、下单严」 |
| **周四** | **H5 对照同一账号** | 同一目的国/重量查价与下单,记下 PC/H5 差异与话术 |
| **周五** | 运营端找到这票:订单/运单、轨迹订单;本周验收 | 对照状态机;能讲清草稿 / 已预报 / 待支付 / 待排货 |
| 周一 | 读 [订单指引](/order/guide) 前半;对照上面故事画一张纸质流程图 | 标出:销售产品、服务渠道、预报、入库 |
| 周二 | 运营端只逛菜单,先别改配置;打开 [渠道指引](/channel/guide) 扫一眼「销售产品 vs 服务渠道」 | 能口头讲清四块积木各管什么 |
| 周三 | **网页端当客户**:查价→下单→看到已预报 | 故意漏邮编试一次下单失败,体会「查价松、下单严」 |
| 周四 | 同一账号打开 **H5** | 对照 PC:查价结果、订单列表在哪 |
| 周五 | 运营端用运单号找到这票;本周验收 | 说出草稿 / 已预报 / 待支付 / 待排货 各是什么意思 |
---
## 必记概念
### 查价 vs 下单
## 必记:查价 vs 下单
| | 查价 | 下单 |
|--|------|------|
| 目的 | 心里有数 | 真正建单 |
| 尺寸 | 可不填(按实重大致估) | 长宽高实重都必须 > 0 |
| 邮编 | 可不填(不校验黑名单) | 必须有邮编;命中黑名单直接拒单 |
| 是否落库 | 否 | 是,有运单号 |
| 尺寸 | 可不填(按实重大致估) | 长宽高、实重都必须 > 0 |
| 邮编 | 可不填(不校验黑名单) | 必须有;踩黑名单直接拒单 |
| 落库 | 否 | 是,有运单号 |
**对客话术:** 查价仅供参考;最终以入库实测计费为准。
**对客一句:** 「查价仅供参考,最终以仓库入库实测计费为准。」
### 幸福路径(先走通)
---
假设发马来西亚,销售产品「MY 特惠线」,预报 30×20×10 cm、实重 0.8kg:
## 刚下完单还是「草稿」?
1. 查价 → 看到参考运费
2. 下单成功 → 很快变 **已预报**,有预报运费
3. 入库称重变了 → 重算应收 → 排货成功 → **待支付**
4. 客户付款 → **待发货**
5. 出库 → **待上网**,之后看轨迹
多半预报还在排队算钱。等几秒刷新;若一直草稿,打开订单看 **预报失败原因**(常见:分区没配到、卖价对不上、规则没发布)。
### 刚下完单还是「草稿」?
---
多半预报还在队列里。等几秒刷新;若一直草稿,打开订单看 **预报失败原因**。
## 各岗位本周重点
| 岗位 | 多花时间在 |
|------|------------|
| 客服 | 状态白话 + 对客那句「入库实测为准」 |
| 操作 | 记住:入库前是「已预报」;入库后才谈付款/出库 |
| 财务 | 分清:预报应收 ≈ 预估;入库应收才更接近最终;还有下游成本那一笔 |
| 运营 | 快过即可,下周进渠道深挖 |
---
## 本周练习
请在本页 **下方勾选清单** 完成练习(进度保存在本机)。
客服 / 仓管 / 实施:本周为必学;渠道运营可快速过状态机后进入第 2 周。
---
## 周五验收
能对客说清「查价仅供参考,最终以入库实测为准」;能画出状态流转;能指出同一票在网页端 / H5 / 运营端分别在哪看。
请在本页 **下方勾选**。
周五带教问三句:销售产品是谁选的?服务渠道谁选的?查价和下单差在哪?

View File

@ -1,94 +1,75 @@
# 第 2 周:渠道配置(为什么有价、为什么卡单)
# 第 2 周:渠道——钱和走货规则从哪来
**本周目标:** 理解钱与走货规则从哪来;会按推荐顺序在测服配一条测试线。
**计时:** 仅周一~周五 5 个工作日;周六日不算。
**培训师本周目标:** 新人明白「卖价 / 买价 / 排货」;改完不点发布 = 等于没改。
**计时:** 仅周一~周五。详配见 [渠道指引](/channel/guide)。
详配见 [渠道指引](/channel/guide)。
> **运营本周是主课;客服只吃「待排货 / 未发布」话术;操作 / 财务可略读。**
---
## 心智模型
> **销售产品**决定客户怎么买、卖多少钱;
> **服务渠道**决定货怎么走、成本多少;
> **排货**把两者在入库时接上。
> **改配置不发布 = 等于没改。**
订单计费读的是 **发布后的快照**,不是你刚改完还没点发布的草稿。
---
## 新开线路推荐顺序(照着做)
## 心智模型(课堂板书)
```
主数据
① 价格分区(国家/邮编落到哪一价区)
② 黑名单(禁运)
③ 偏远分区(可选)
④ 计重规则 + 计重进位
成本侧
⑤ 建服务渠道(下游通道)
⑥ 配渠道买价并发布
卖价侧
⑦ 建销售产品,绑上分区、计重、黑名单等
⑧ 配产品卖价
⑨ 配排货(挂上可用服务渠道)
⑩ 写对客说明(可选)
⑪ 发布「规则」+ 发布「价格」
销售产品 = 客户看到的「线路名 + 卖多少钱」
服务渠道 = 货实际走的下游 + 公司成本多少
排货 = 入库时,从产品挂着的渠道里自动挑一条
发布 = 让订单开始用你改过的版本(不发布仍用旧的)
```
| 发布类型 | 大概包含 | 忘了会怎样 |
|----------|----------|------------|
| **规则(rules)** | 计重、黑名单、偏远、排货等 | 计重/禁运/排货仍按旧版 |
| **价格(price)** | 卖价矩阵 + 价格分区明细 | 运费仍按旧卖价 |
**比喻:** 菜单上的「招牌套餐」是销售产品;后厨选哪家中央厨房供货是服务渠道;改菜单不印刷新版,客人手里还是旧菜单。
---
## 学习安排(工作日)
## 新开一条线怎么配?(照顺序念)
| 工作日 | 重点 |
|--------|------|
| **周一** | 价格分区 / 黑名单 / 偏远:各做一组正反例(邮编多为左开右闭) |
| **周二** | 计重规则 + 进位;用例子算出计费重 |
| **周三** | 卖价矩阵:价区 × 重量段 × 货物属性;故意配错看「卖价未匹配」 |
| **周四** | 服务渠道买价 + 排货;买价不发布 → 入库容易进 **待排货** |
| **周五** | 规则 + 价格发布;对照订单报错表自测;本周验收 |
```
① 价格分区(邮编落到哪一价区)
② 黑名单(禁运) / 偏远(可下单但加标记)
③ 计重规则 + 进位
④ 服务渠道 + 买价 → 发布买价
⑤ 销售产品:绑分区、计重、黑名单 → 配卖价 → 配排货
⑥ 发布「规则」+ 发布「价格」
```
| 发布类型 | 忘了会怎样 |
|----------|------------|
| 规则 | 禁运、计重、排货还是旧版 |
| 价格 | 客户运费还是旧卖价 |
---
## 必记例子
## 工作日安排
### 计费重
| 工作日 | 重点 | 例子 |
|--------|------|------|
| 周一 | 分区 / 黑名单 / 偏远 | 邮编 55000 落「西马 A」;黑名单直接拒单,偏远只打标 |
| 周二 | 计重 | 30×20×10、实重 0.8,泡比 6000 → 体积重 1.0 → 计费重 1.0kg |
| 周三 | 卖价矩阵 | 故意弄错重量段 → 下单报「卖价未匹配」 |
| 周四 | 买价 + 排货 | 排货列表空或买价未发布 → 入库后容易 **待排货** |
| 周五 | 发布对照 | 改价不发布 → 客户仍旧价;本周验收 |
产品:体积重 = 长×宽×高 ÷ 6000;实重与体积重取大。
---
- 件:30×20×10、实重 0.8 → 体积重 1.0 → 计费重 **1.0kg**
- 入库后实重变 1.2 → 计费重可能升到更高档 → 应收比预报高,属正常,要跟客户讲清
## 三个必记例子
### 黑名单 vs 偏远
### 1)计费重会变
预报按客户填的尺寸估;入库按仓库实测。体积大或超重 → 应收比预报高,**正常**,要跟客户讲清。
### 2)黑名单 ≠ 偏远
| | 黑名单 | 偏远 |
|--|--------|------|
| 命中 | **不能下单** | 可以下单,订单标偏远 |
| 运营 | 换地址或改黑名单区 | 留意偏远附加费 |
| 命中 | 不能下单 | 可以下单,订单打偏远标 |
### 只配卖价、排货为空 / 买价未发布
### 3)待排货从哪来?
→ 入库后容易进 **待排货**(货已收,但还没定走哪条下游)。
货已经收到了,但系统挑不出可用下游(没挂渠道、渠道关了、买价没发布、客户不在白名单…)。
**不是丢单**——修好配置后「重算应付」,应变 **待支付**。
---
## 本周练习
请在本页 **下方勾选清单** 完成练习。
**渠道运营** 本周为重头;客服至少要懂「待排货 / 未发布」话术;仓管/实施可略读。
产品:用测服 **已有销售产品** 练习发布与排障即可,不必新建专线。
---
## 周五验收
能默写新产品上线 checklist;改价忘发布能自己排查;能说清销售产品 vs 服务渠道。
下方勾选。产品用测服 **已有销售产品** 即可,不必新建专线。
周五验收:能说清销售产品 vs 服务渠道;改价忘发布能自己想到去查发布。

View File

@ -1,95 +1,130 @@
# 第 3 周:订单全链路运营 + 客服排障
# 第 3 周:订单全链路——跟仓、催付、说清费用
**本周目标:** 会跟仓、会催付、会看费用争议;网页端 / H5 / 运营端同一票能对上。
**计时:** 仅周一~周五 5 个工作日;周六日不算。
**培训师本周目标:** 会跟仓、会催付、会解释「为什么比预报贵」;同一运单号在客户侧和运营端对得上。
**计时:** 仅周一~周五。详表见 [订单指引](/order/guide)、[营销指引](/marketing/guide)。
详配与报错表见 [订单指引](/order/guide)。
> **客服 / 操作 / 财务 / 运营本周都是重点周。**
---
## 学习安排(工作日)
## 幸福路径(再走一遍,带钱)
| 工作日 | 重点 |
|--------|------|
| **周一** | 幸福路径上半:下单 → 已预报 → 入库 → 待支付 |
| **周二** | 幸福路径下半:付款 → 出库 → 待上网;四端对同一运单号 |
| **周三** | **待排货专项**:看原因、补买价/排货、重算应付 |
| **周四** | 预报 vs 入库费用;常见报错话术演练 |
| **周五** | 批量导入 / 模板映射(若常用);跟一次入库出库;本周验收 |
1. 下单成功 → **已预报**(预报应收)
2. 入库 → 实测重算应收 → 排货成功 → **待支付**
3. 客户付款 → **待发货**
4. 出库 → **待上网**
排货失败时:状态是 **待排货**(货在、钱也能算,但还没定下游)。
---
## 入库与待排货
## 工作日安排
入库时系统会:
1. 写入库实测件重尺
2. **重算客户应收**
3. **尝试自动排货**(从销售产品排货列表选服务渠道并算成本)
| 结果 | 订单状态 | 含义 |
|------|----------|------|
| 排货成功 | **待支付** | 可以催客户付款 |
| 排货失败 | **待排货** | 货已收、钱也能算给客户看,但还没定下游渠道 |
**待排货不是丢单。** 常见原因:排货列表空、渠道未启用、买价未发布、客户不在白名单、重量/分区匹配不到买价。
处理完后在订单侧做 **重算应付**(以现场按钮名为准),成功应变为 **待支付**。
| 工作日 | 重点 | 谁必须到场 |
|--------|------|------------|
| 周一 | 下单→已预报→入库→待支付 | 全员 |
| 周二 | 付款→出库;四端对同一运单号 | 全员 |
| 周三 | **待排货专项**:看原因 → 补配置 → 重算应付 | 运营、客服 |
| 周四 | 预报 vs 入库费用;基础运费 vs 附加费;会员折/券 | 财务、客服 |
| 周五 | 跟一次入库/出库扫描;本周验收 | 操作必跟,他人旁听 |
---
## 下单成功后系统在忙什么?(运营视角)
## 入库时系统在干什么?(给操作听)
| 阶段 | 你会看到 | 失败时 |
|------|----------|--------|
| 提交当时 | 有运单号,可能短暂「草稿/处理中」 | — |
| 预报计费 | 变成 **已预报**,有预报应收 | 停在草稿,看预报失败原因 |
| 面单 / 营销等 | 异步,一般不挡下单 | 可稍后重打面单 |
| 入库后 | 实测改价 + 排货 | 待排货或待支付 |
仓库扫入库后,系统大致做三件事:
拦截类自动触发发生在「点下单、还没建成单」之前:命中则直接报错,**不会留下订单**。
1. 写入库实测长宽高、实重
2. **重算客户应收**(可能比预报贵或便宜)
3. **自动排货**(选服务渠道、算公司成本)
| 结果 | 状态 | 操作要不要拦货? |
|------|------|------------------|
| 排货成功 | 待支付 | 不用拦,等客户付款后再出库 |
| 排货失败 | 待排货 | 货先收着;通知运营修配置,不要当「丢单」 |
---
## 常见报错 ↔ 怎么回
## 待排货(给运营 / 客服)
| 客户或系统提示 | 可能原因 | 运营动作 |
|----------------|----------|----------|
| 客户单号已存在 | 同客户重复客户单号 | 换单号,或查是否已下过 |
| 销售产品不存在或未启用 | 产品停用 / 编码错 | 查销售产品状态 |
| 未命中价格/规则快照 | 改过配置 **没发布** | 渠道 → 销售产品 → 发布 |
| 收件地址命中黑名单 | 地址在禁运区 | 换地址,或调整黑名单 |
| 价格分区未匹配 | 邮编/国家不在分区 | 补分区或核对地址 |
| 卖价未匹配 | 重量段/货物属性/价区对不上 | 查卖价矩阵 |
| 查价有价、下单失败 | 查价未校验邮编/黑名单 | 用完整地址再试下单 |
| 一直待排货 | 见上一节 | 先看订单上的待排货原因 |
常见原因:排货列表空、渠道未启用、**买价未发布**、客户不在白名单、重量/分区匹配不到买价。
处理:修好渠道侧 → 订单上 **重算应付**(以页面按钮名为准)→ 成功应变 **待支付**。
**对客:** 「货已收到,系统还在匹配承运渠道;处理好后会通知您付款。」
---
## 推荐日常工作流(运营)
## 钱怎么看?(给财务 / 客服)
```
① 新产品:先在渠道配齐并发布
② 「我要查价」自测几个国家+重量
③ 「我要下单」测单 → 确认已预报
④ 仓库入库 → 确认待支付(待排货则先排障)
⑤ 付款 → 出库 → 轨迹中心看是否上网
⑥ 客诉对照上表;费用争议核对预报 vs 入库实测
```
### 预报价 ≠ 最终价
常用菜单:查价 `/order/priceCheck`、下单 `/order/placeOrder`、我的订单 `/order/myOrders`;仓侧在 **操作** 菜单(入库/出库扫描)。
| 阶段 | 看什么 | 白话 |
|------|--------|------|
| 预报 | 预报应收 | 客户填的尺寸估出来的 |
| 入库后 | 入库应收 | 仓库实测后的,催付以此为准 |
| 付款后 | 已付金额、账户流水 | 余额扣款 / 充值付款 |
**课堂例:** 预报计费重 1.0kg → 预报运费 20 元;入库实重变大,计费重 1.5kg → 应收 28 元。差额来自实测,不是「系统乱加价」。
### 应收 vs 成本
| | 应收(卖) | 成本 / 应付(买) |
|--|-----------|------------------|
| 谁付 | 客户付给公司 | 公司付给下游 |
| 配置在哪 | 销售产品卖价(要发布) | 服务渠道买价(要发布) |
| 何时算稳 | 入库重算后 | 排货成功选中渠道后 |
毛利直觉:卖价 − 买价 −(营销让利)≈ 这票赚多少。
### 优惠只打「基础运费」
见营销指引五条总规则,课堂只记三条:
1. 燃油、偏远等 **附加费不打折、不用券**
2. 会员折和券 **二选一,取更省的**
3. 积分只定级,**不能抵运费**
---
## 本周练习
## 常见卡单 ↔ 怎么回(客服速查)
请在本页 **下方勾选清单** 完成练习。
客服 / 仓管 / 渠道运营均为重点周;实施可跟一票幸福路径即可。
| 现象 | 先查 | 对客方向 |
|------|------|----------|
| 客户单号已存在 | 是否重复提交 | 换单号或查原单 |
| 命中黑名单 | 邮编/地址 | 换地址或换线 |
| 价格分区 / 卖价未匹配 | 分区、价卡、是否发布 | 「我们核对报价后回您」 |
| 一直草稿 | 预报失败原因 | 等刷新或按原因改资料 |
| 入库比预报贵 | 预报 vs 入库件重尺 | 「按实测计费」 |
| 一直待排货 | 待排货原因 | 「渠道匹配中,好了催付」 |
话术见「话术」Tab;待排货场景见「练习包」。
完整话术见「话术」Tab。
---
## 周五验收
## 仓内现场(操作必读,客服扫一眼)
给一张异常单,能定位是渠道配置、地址问题,还是还在预报队列;能处理待排货到待支付。
| 动作 | 入口 | 扫完大概怎样 |
|------|------|----------------|
| **入库扫描** | [/operation/inboundScan](/operation/inboundScan) | 写入实测件重尺 → 重算应收 → 待支付或待排货 |
| **出库扫描** | [/operation/outboundScan](/operation/outboundScan) | 待发货 → 待上网 |
| **仓租** | [/warehouse/storageRent](/warehouse/storageRent) | 货在仓按天/体积计费的日账单(与运单运费是另一本账) |
| **操作指引** | [/operation/guide](/operation/guide) | 扫枪全流程白话 |
| **仓储指引** | [/warehouse/guide](/warehouse/guide) | SKU / 库存 / 预报 / 仓租 |
**微信订单通知(客服 / 运营):**
客户可在 H5「我的」里订阅待支付、出入库、派送等事件;后台有模板与发送日志。客户说「没收到微信提醒」时:先看是否已关注公众号、是否订阅该事件,再查发送日志(成功/跳过/失败原因)。
细配仍以现场菜单与产品说明为准;练手优先跑通入库出库扫描。
---
## 各岗位本周验收问法
| 岗位 | 带教问一句 |
|------|------------|
| 操作 | 入库成功后,订单常见变成哪两个状态? |
| 客服 | 客户说比预报贵,你打开订单看哪两块数字? |
| 财务 | 应收和成本分别代表谁付给谁?优惠打在什么上? |
| 运营 | 待排货修完后,你要点什么让它变待支付? |
下方勾选清单完成本周练习。算账例见「算账」Tab。

View File

@ -1,91 +1,74 @@
# 第 4 周:轨迹对客 + API 对接意识
# 第 4 周:轨迹对客 + 外系统怎么接(业务层)
**本周目标:** 客服查轨迹不慌;知道外部系统怎么连进来(业务层,不写代码)。
**计时:** 仅周一~周五 5 个工作日;周六日不算。
**培训师本周目标:** 客服查轨迹不慌;实施知道「上游 / 下游 / 映射 / 发布」四件事。
**计时:** 仅周一~周五。详见 [轨迹指引](/track/guide)、[API 指引](/api/apiDebugger)。
详见 [轨迹指引](/track/guide)、[API 指引](/api/apiDebugger)。
> **客服重点周一~周二;实施全周;运营 / 操作 / 财务可浏览串讲。**
---
## 学习安排(工作日)
## 轨迹故事(课堂)
客户问:「官网都有物流了,你们系统怎么还没有?」
背后通常是:
```
服务商原始轨迹(他们的话)
→ 轨迹中心翻译成「标准节点」(我们的话)
→ 写到轨迹订单时间轴
→(可选)推送给客户自己的系统
```
所以「没有标准节点」≠「一定没拉到」。
经常是:拉到了原文,但对不上映射 → 叫 **未映射**。补映射再刷新即可。
---
## 工作日安排
| 工作日 | 重点 |
|--------|------|
| **周一** | 轨迹:状态/内容主数据 → 拉取映射 → 单票刷新;「官网有、我们没有」优先查未映射 |
| **周二** | 推送:自动推送、顺序异常、手工救急;预警概念扫一眼 |
| **周三** | API:上游 / 下游 / 映射 / 应用 / 发布;跟一次调试;看请求日志 |
| **周四** | 串讲:渠道发布 → 客户下单 → 出库 → 轨迹拉取 →(可选)推客户 / 调外部 |
| **周五** | **综合演练**:一票货四端截图对照;整理 FAQ;准备总验收 |
| 周一 | 轨迹订单:刷新、读时间轴;找一条「未映射」原文(有则练) |
| 周二 | 推送记录:成功 / 失败原因;客服「没收到回调」怎么查 |
| 周三 | API:上游=公司普通话,下游=服务商方言;映射=翻译器;发布=上岗 |
| 周四 | 串讲整条链:渠道发布→下单→出库→轨迹→(可选)推客户 |
| 周五 | 综合演练:一票货四端对照笔记;总验收 |
---
## 轨迹心智模型
## 客服三句够用
> **拉取** = 把服务商的话翻译成公司标准节点;
> **推送** = 按约定顺序告诉客户。
> 看到原始轨迹却没有标准节点,优先查 **内容映射**,不是「系统没拉到」。
| 客户说法 | 你怎么想 | 怎么做 |
|----------|----------|--------|
| 官网有、你们没有 | 映射?间隔?单号类型? | 刷新;看未映射;找运营补映射 |
| 一直已预报 | 出库了吗?服务商上网了吗? | 先确认是否已出库 |
| 我们系统没收到推送 | 自动推送关了?顺序卡住? | 看推送记录;必要时手工补推 |
```
服务商原始轨迹
→ 轨迹中心按规则翻译成「标准节点」
→ 写到轨迹订单
→(可选)推送给客户系统 / OMS
```
### 新服务商接入顺序(运营向)
```
① 轨迹状态(已揽收 / 运输中 / 签收 …)
② 轨迹内容(标准话术关联状态)
③ 轨迹标记(可选)
④ 确认拉取接口已通
⑤ 轨迹拉取:主配置 → 内容映射 → 频率
⑥ 轨迹推送(若客户要回调)
⑦ 测试单「刷新轨迹」,看时间轴与推送记录
```
### 客服常见问答
| 客户说法 | 可能原因 | 怎么处理 |
|----------|----------|----------|
| 官网有轨迹,你们没有 | 未映射 / 间隔未到 / 单号类型不对 | 刷新;看未映射原文;补映射 |
| 一直显示已预报 | 未上网,或拉取未开始 | 看出库、拉取开始节点 |
| 我们系统没收回调 | 自动推送关了、顺序卡了、异常单 | 查推送记录;必要时手工推 |
**对客:** 「我按运单号刷新一下;节点以服务商上网为准,映射好了会同步给您。」
---
## API(Like API)心智模型
> **上游**是公司普通话,**下游**是服务商方言;**映射**是翻译器,**发布**才上岗。
> 排错先看 **请求日志里真正发出的那一包**。
## API(给实施,不写代码)
| 名词 | 白话 |
|------|------|
| 上游接口 | 给业务用的标准口(如 `TRACK_QUERY`) |
| 下游接口 | 服务商真实 HTTP |
| 映射 | 字段对照 + 签名脚本 |
| 应用 | 谁有权调用(AppKey) |
| 发布 | 配置生效开关 |
| 上游 | 给业务用的标准口 |
| 下游 | 服务商真实接口 |
| 映射 | 字段怎么对、怎么签名 |
| 应用 | 谁有权调(AppKey) |
| 发布 | 配置生效 |
推荐上手:下游(贴 cURL)→ 上游 → 映射 → 应用授权 → 调试 / 请求日志。
**注意:** `/api/apiDebugger` 自由调试 **不会** 自动写回下游配置;正式联调优先在已配置的上下游里调试。
排错顺序:先看 **请求日志里真正发出的那一包**,再怀疑映射或鉴权。
---
## 本周练习
## 本周练习与验收
请在本页 **下方勾选清单** 完成练习。
**实施** 全周必学;**客服** 重点周一~周二轨迹;渠道/仓管可浏览。
下方勾选。周五能讲清三件事:
---
1. 订单卡在预报 / 待排货 / 待支付 / 待上网哪一段
2. 轨迹卡在「没上网」还是「未映射 / 推送」
3.(实施)接口卡在未发布、鉴权,还是报文
## 周五验收
能讲清三件事:
1. 订单卡在哪一段(预报 / 待排货 / 待支付 / 待上网)
2. 轨迹卡在映射还是推送
3. 接口卡在未发布、鉴权,还是签名/报文字段
完成后到「进度」Tab 勾总验收项(安排在工作日)。
完成后到「进度」Tab 勾总验收。

View File

@ -1,30 +1,41 @@
<script lang="ts" setup>
import { ref } from 'vue';
import { computed, ref, watch } from 'vue';
import MarkdownViewer from '@/components/MarkdownViewer/index.vue';
import TrainingRolePicker from './TrainingRolePicker.vue';
import TrainingChecklist from './TrainingChecklist.vue';
import TrainingPracticeCards from './TrainingPracticeCards.vue';
import TrainingScriptsPanel from './TrainingScriptsPanel.vue';
import TrainingExamPanel from './TrainingExamPanel.vue';
import overviewContent from './handbook-overview.md?raw';
import week1Content from './handbook-week1.md?raw';
import week2Content from './handbook-week2.md?raw';
import week3Content from './handbook-week3.md?raw';
import week4Content from './handbook-week4.md?raw';
import practiceContent from './handbook-practice.md?raw';
import calcContent from './handbook-calc.md?raw';
import scriptsContent from './handbook-scripts.md?raw';
import checklistContent from './handbook-checklist.md?raw';
import type { TrainingWeekKey } from './checklist-items';
import { useTrainingProgress } from './useTrainingProgress';
import {
isTabRecommended,
type TrainingTabKey,
} from './training-meta';
defineOptions({
name: 'KbTraining',
});
const activeTab = ref('overview');
const activeTab = ref<TrainingTabKey>('overview');
const { role } = useTrainingProgress();
type TabDef = {
key: string;
key: TrainingTabKey;
title: string;
content: string;
checklistWeek?: TrainingWeekKey | 'all';
showReset?: boolean;
kind?: 'default' | 'practice' | 'scripts' | 'progress' | 'calc';
};
const tabs: TabDef[] = [
@ -33,26 +44,68 @@
{ key: 'week2', title: '第2周', content: week2Content, checklistWeek: 'week2' },
{ key: 'week3', title: '第3周', content: week3Content, checklistWeek: 'week3' },
{ key: 'week4', title: '第4周', content: week4Content, checklistWeek: 'week4' },
{ key: 'practice', title: '练习包', content: practiceContent, checklistWeek: 'practice' },
{ key: 'scripts', title: '话术', content: scriptsContent },
{
key: 'practice',
title: '练习包',
content: practiceContent,
checklistWeek: 'practice',
kind: 'practice',
},
{ key: 'calc', title: '算账', content: calcContent, kind: 'calc' },
{ key: 'scripts', title: '话术', content: scriptsContent, kind: 'scripts' },
{
key: 'progress',
title: '进度',
content: checklistContent,
checklistWeek: 'all',
showReset: true,
kind: 'progress',
},
];
const tabViews = computed(() =>
tabs.map((tab) => {
const recommended = isTabRecommended(role.value, tab.key);
return {
...tab,
recommended,
displayTitle: recommended ? tab.title : `${tab.title}·选读`,
};
}),
);
const activeMeta = computed(() => tabViews.value.find((t) => t.key === activeTab.value));
watch(role, () => {
const cur = activeMeta.value;
if (cur && !cur.recommended && activeTab.value !== 'overview') {
// 切岗后若停在选读页,不强行跳走,仅靠标题提示
}
});
</script>
<template>
<div class="kb-training-page">
<div class="kb-training-card">
<a-tabs v-model:active-key="activeTab" type="rounded" class="kb-training-tabs">
<a-tab-pane v-for="tab in tabs" :key="tab.key" :title="tab.title">
<a-tab-pane
v-for="tab in tabViews"
:key="tab.key"
:title="tab.displayTitle"
>
<div class="kb-training-pane">
<TrainingRolePicker />
<TrainingRolePicker :compact="tab.key !== 'overview'" />
<div v-if="!tab.recommended" class="kb-training-optional">
当前岗位未将本页标为必学,可作<strong>选读</strong>。建议先学岗位轨里亮着的周次。
</div>
<TrainingPracticeCards v-if="tab.kind === 'practice'" />
<TrainingScriptsPanel v-if="tab.kind === 'scripts'" />
<TrainingExamPanel v-if="tab.kind === 'progress'" />
<MarkdownViewer :content="tab.content" />
<TrainingChecklist
v-if="tab.checklistWeek"
:week="tab.checklistWeek"
@ -115,6 +168,16 @@
:deep(.arco-tabs-pane) {
overflow: hidden;
}
/* 选读 Tab 标题略淡 */
:deep(.arco-tabs-tab) {
.arco-tabs-tab-title {
max-width: 110px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.kb-training-pane {
@ -126,4 +189,20 @@
max-width: 960px;
margin: 0 auto;
}
.kb-training-optional {
margin: 0 0 12px;
padding: 8px 12px;
border-radius: 6px;
border: 1px dashed var(--color-border-2);
background: var(--color-fill-1);
font-size: 12px;
line-height: 1.5;
color: var(--color-text-3);
strong {
color: var(--color-text-2);
font-weight: 600;
}
}
</style>

View File

@ -0,0 +1,293 @@
import type { TrainingRoleKey, TrainingWeekKey } from './checklist-items'
import { ROLE_WEEK_FOCUS } from './checklist-items'
/** 培训页 Tab(与 index 对齐) */
export type TrainingTabKey =
| 'overview'
| 'week1'
| 'week2'
| 'week3'
| 'week4'
| 'practice'
| 'calc'
| 'scripts'
| 'progress'
const WEEK_TO_TAB: Partial<Record<TrainingWeekKey, TrainingTabKey>> = {
week1: 'week1',
week2: 'week2',
week3: 'week3',
week4: 'week4',
practice: 'practice',
exam: 'progress',
}
/** 各岗建议打开的 Tab(总览/进度始终建议) */
export function recommendedTabsForRole(role: TrainingRoleKey): Set<TrainingTabKey> {
const set = new Set<TrainingTabKey>(['overview', 'progress'])
for (const w of ROLE_WEEK_FOCUS[role] || []) {
const tab = WEEK_TO_TAB[w]
if (tab) set.add(tab)
}
// 话术:客服必学;运营/通才建议
if (role === 'all' || role === 'cs' || role === 'ops') {
set.add('scripts')
}
// 算账:财务必学;客服/运营/通才建议
if (role === 'all' || role === 'finance' || role === 'cs' || role === 'ops') {
set.add('calc')
}
return set
}
export function isTabRecommended(role: TrainingRoleKey, tab: TrainingTabKey): boolean {
if (role === 'all') return true
return recommendedTabsForRole(role).has(tab)
}
export interface PracticeCard {
id: string
title: string
goal: string
roles?: TrainingRoleKey[]
links: { label: string; path: string }[]
}
export const PRACTICE_CARDS: PracticeCard[] = [
{
id: 'happy',
title: '幸福路径',
goal: '查价→下单→入库→付款→出库,看到待上网',
links: [
{ label: '我要查价', path: '/order/priceCheck' },
{ label: '我要下单', path: '/order/placeOrder' },
{ label: '我的订单', path: '/order/myOrders' },
{ label: '入库扫描', path: '/operation/inboundScan' },
{ label: '出库扫描', path: '/operation/outboundScan' },
],
},
{
id: 'strict',
title: '查价松 / 下单严',
goal: '查价有参考价;故意缺邮编或踩黑名单时下单失败',
roles: ['cs', 'ops'],
links: [
{ label: '我要查价', path: '/order/priceCheck' },
{ label: '我要下单', path: '/order/placeOrder' },
],
},
{
id: 'pending',
title: '待排货',
goal: '入库后进待排货;修好配置后重算→待支付',
roles: ['ops', 'cs'],
links: [
{ label: '运单管理', path: '/order/waybillManage' },
{ label: '渠道指引', path: '/channel/guide' },
],
},
{
id: 'fee',
title: '预报 vs 入库费用',
goal: '同一票对比两套应收,说出差额来自件重尺',
roles: ['finance', 'cs', 'ops'],
links: [
{ label: '我的订单', path: '/order/myOrders' },
{ label: '运单管理', path: '/order/waybillManage' },
{ label: '账户流水', path: '/finance/accountFlow' },
],
},
{
id: 'track',
title: '轨迹刷新',
goal: '出库后刷新时间轴;有未映射能指原文',
roles: ['cs', 'implement'],
links: [
{ label: '轨迹订单', path: '/track/order' },
{ label: '轨迹指引', path: '/track/guide' },
],
},
{
id: 'floor',
title: '仓内操作',
goal: '跟一次入库/出库;知道仓租账单在哪看',
roles: ['warehouse', 'ops', 'cs'],
links: [
{ label: '操作指引', path: '/operation/guide' },
{ label: '仓储指引', path: '/warehouse/guide' },
{ label: '入库扫描', path: '/operation/inboundScan' },
{ label: '出库扫描', path: '/operation/outboundScan' },
{ label: '仓租账单', path: '/warehouse/storageRent' },
],
},
]
export type ScriptGroupKey = 'fee' | 'track' | 'pay' | 'order'
export interface ScriptRow {
id: string
group: ScriptGroupKey
trigger: string
say: string
check: string
}
export const SCRIPT_GROUP_LABEL: Record<ScriptGroupKey, string> = {
order: '下单 / 卡单',
fee: '费用 / 优惠',
track: '轨迹',
pay: '付款 / 出库',
}
export const SCRIPT_ROWS: ScriptRow[] = [
{
id: 's1',
group: 'order',
trigger: '客户单号已存在',
say: '这个客户单号用过了,请换一个,或告诉我原单号我帮查。',
check: '同客户是否已有该单',
},
{
id: 's2',
group: 'order',
trigger: '产品未启用 / 不存在',
say: '这条线路暂时不可用,我帮您看替代线路。',
check: '销售产品是否启用',
},
{
id: 's3',
group: 'order',
trigger: '地址命中黑名单',
say: '这个地区暂时无法收寄,请换地址或换线路。',
check: '黑名单 + 产品关联',
},
{
id: 's4',
group: 'order',
trigger: '价格分区 / 卖价未匹配',
say: '目的地或重量暂时对不上报价,我们核对后马上回您。',
check: '分区、价卡、是否发布',
},
{
id: 's5',
group: 'order',
trigger: '查价有价、下单失败',
say: '查价比较宽松,下单要完整邮编和地址,请按提示补全。',
check: '邮编、黑名单、尺寸',
},
{
id: 's6',
group: 'order',
trigger: '一直草稿',
say: '系统还在算预报运费,请稍等刷新;一直如此我看失败原因。',
check: '预报失败原因',
},
{
id: 's7',
group: 'order',
trigger: '一直待排货',
say: '货已收到,还在匹配承运渠道;处理好会变成待支付,再通知您付款。',
check: '待排货原因;找运营',
},
{
id: 's8',
group: 'fee',
trigger: '入库比预报贵',
say: '入库按实测重和体积重重新计费,体积大或超重会上涨,这是规则。',
check: '预报 vs 入库件重尺',
},
{
id: 's9',
group: 'fee',
trigger: '会员折 / 券怎么用',
say: '优惠只打在基础运费上,燃油偏远等附加费不参与;折和券取更省的那个。',
check: '费用明细;营销指引',
},
{
id: 's10',
group: 'fee',
trigger: '还是旧价',
say: '我请渠道同事确认线路规则和价格是否已发布,发布后新单会按新价。',
check: '规则/价格是否发布(对内)',
},
{
id: 's11',
group: 'track',
trigger: '官网有轨迹,你们没有',
say: '我马上按单号刷新;若文案还没对上标准节点,会先补映射再更新。',
check: '刷新;未映射;单号类型',
},
{
id: 's12',
group: 'track',
trigger: '一直已预报',
say: '出库后要等服务商上网才有运输节点。我帮您确认是否已出库。',
check: '是否出库;拉取是否开始',
},
{
id: 's13',
group: 'track',
trigger: '我们系统没收到推送',
say: '我查贵司推送开关和最近一次推送记录;必要时先手工补推。',
check: '自动推送、推送记录',
},
{
id: 's14',
group: 'pay',
trigger: '催付',
say: '包裹已入库计费完成,请登录完成支付,我们才能安排出库。',
check: '是否待支付;费用是否合理',
},
{
id: 's15',
group: 'pay',
trigger: '已付未出库',
say: '支付已收到,仓库排队出库中;出库后轨迹会进入待上网。',
check: '付款状态;出库队列',
},
{
id: 's16',
group: 'pay',
trigger: '要拦截',
say: '请提供运单号,我看当前状态能否拦截;已出库/已上网按服务商规则处理。',
check: '当前状态;服务商规则',
},
]
export interface OralQuestion {
q: string
expect: string
}
export const ORAL_EXAMS: Record<TrainingRoleKey, OralQuestion[]> = {
all: [
{ q: '用一分钟讲清:一票货从查价到上网。', expect: '查价→下单预报→入库改价排货→付款→出库→轨迹' },
{ q: '待排货是什么?怎么处理?', expect: '货已收但未选到下游;修买价/排货后重算应付' },
{ q: '改价客户仍旧价,先查什么?', expect: '规则/价格是否发布' },
],
ops: [
{ q: '销售产品和服务渠道分别是谁选的?', expect: '客户选产品;入库排货选渠道' },
{ q: '不点发布会怎样?', expect: '订单仍读旧快照,等于没改' },
{ q: '待排货修完要点什么?', expect: '重算应付,应变待支付' },
],
cs: [
{ q: '查价和下单差在哪?对客怎么说?', expect: '查价松;入库实测为准' },
{ q: '入库比预报贵怎么解释?', expect: '看预报/入库件重尺;实测计费' },
{ q: '官网有轨迹我们没有怎么查?', expect: '刷新→未映射→补映射' },
],
warehouse: [
{ q: '入库成功后订单常见变成哪两个状态?', expect: '待支付或待排货' },
{ q: '待排货要不要当丢件?', expect: '不要;货在仓,通知运营修配置' },
{ q: '出库后状态大概是什么?', expect: '待上网,等轨迹' },
],
finance: [
{ q: '预报应收和入库应收差在哪?', expect: '预报按客户填的;入库按实测' },
{ q: '应收和成本分别是谁付给谁?', expect: '客户→公司;公司→下游' },
{ q: '会员折/券打在什么上?附加费呢?', expect: '只打基础运费;附加费原价' },
],
implement: [
{ q: '轨迹拉取和推送各干什么?', expect: '拉取=翻译进来;推送=告诉客户系统' },
{ q: '上游/下游/映射/发布各是什么?', expect: '普通话/方言/翻译器/生效开关' },
{ q: '接口排错先看哪?', expect: '请求日志里真正发出的报文' },
],
}

View File

@ -22,8 +22,13 @@ function readChecked(): Record<string, boolean> {
function readRole(): TrainingRoleKey {
try {
const raw = localStorage.getItem(STORAGE_ROLE) as TrainingRoleKey | null
if (raw && TRAINING_ROLES.some((r) => r.key === raw)) return raw
const raw = localStorage.getItem(STORAGE_ROLE)
// 兼容旧岗位键:渠道运营→运营,仓管→操作
const mapped =
raw === 'channel' ? 'ops' : raw === 'warehouse' ? 'warehouse' : raw
if (mapped && TRAINING_ROLES.some((r) => r.key === mapped)) {
return mapped as TrainingRoleKey
}
} catch {
// ignore
}

View File

@ -124,3 +124,13 @@ Vite:`/marketing/guide` 等 SPA path 须 bypass,勿把页面打到 API。
| 子账号 | 券在主客户;部分门户接口拒子账号 |
| 重算应收 | 先用 `MarketingFeeHelper` 排除已有营销抵扣行 |
| 支付预览 | 券优惠 ≤ 会员折时标不可用 |
运营可见报错表见同页「运营」Tab §8;文案多来自:
| 场景 | 后端入口(示意) |
|------|------------------|
| 会员等级 / 积分 | `MarketingMemberLevelService` / `MarketingPointsManager` / `MarketingPointsRuleService` |
| 券模板 / 发放 / 锁券 | `MarketingCouponTemplateService` / `MarketingCouponGrantService` / `MarketingCouponManager` |
| 支付用券互斥 | `OrderService.PayCoupon` + `MarketingBillingCalculator` |
| 邀请绑定 / 分成 / 提现 | `MarketingReferralBinder` / `ReferralCommissionManager` / `MarketingCommissionAdminService` |
| 门户 | `MarketingPortal*Service`(子账号常拒) |

View File

@ -1,6 +1,6 @@
# 营销中心运营指引
> 本文面向 **运营同学**,说明 OMS「会员体系 / 优惠券 / 拉新」怎么配、怎么算、客户会看到什么。
> 本文面向 **运营同学**,说明 OMS「会员体系 / 优惠券 / 拉新」怎么配、怎么算、客户会看到什么,以及 **后端常见报错怎么排查**。
> API、计价互斥实现、Worker 见同页 **「开发」** Tab。
> 菜单入口:左侧 **营销**;客户侧在 **个人中心 → 营销中心**。
@ -298,7 +298,7 @@
| 菜单 | 路径 | 运营用途 |
|------|------|----------|
| 新手指引 | `/marketing/guide` | 本文档 |
| 营销指引 | `/marketing/guide` | 本文档 |
| 会员等级 | `/marketing/memberLevel` | 定级门槛与基础运费折扣 |
| 积分规则 | `/marketing/pointsRule` | 积分比例 |
| 积分流水 | `/marketing/pointsFlow` | 查账、人工调积分 |
@ -320,18 +320,78 @@
---
## 8. 常见客诉怎么回
## 8. 常见报错 ↔ 解决思路
> 文案来自后端 `BusinessException`(中英文提示都可能出现,以界面为准)。
> **排查口诀:** 先分清是配置保存、发券、支付用券,还是邀请/提现。
### 8.1 会员 / 积分配置
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 等级编码/名称不能为空 / 等级编码已存在 | 必填或重名 | 补全;换编码 |
| 基础运费折扣率须在 0~0.05… | 折扣填超 95 折封顶 | 改为 ≤0.05 |
| 该等级已被 N 个客户使用,无法删除… | 有人占用 | 改为禁用,勿删 |
| 会员等级不存在 / 等级 Id 无效 | 已删 | 刷新重选 |
| 调账原因至少 10 个字 | 积分调账备注太短 | 写清原因 |
| 可用积分不足 | 扣减超过余额 | 核对流水后再调 |
| Adjust main customer only / 仅调主客户 | 对子账号调积分 | 改对主客户操作 |
| Points per yuan cannot be negative 等 | 积分规则参数非法 | 按提示改正 |
### 8.2 券模板 / 批量发券
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| Template code/name/Coupon type is required | 模板必填空 | 补编码、名称、类型 |
| Template code already exists | 编码重复 | 换编码 |
| Face value must be positive / Discount rate must be between 0 and 1 | 面额/折扣非法 | 改正数值 |
| Only draft templates can be published | 非草稿点发布 | 仅草稿可发布 |
| Only active templates can be ended | 非发放中点停发 | 仅「发放中」可停发 |
| Ended template cannot be edited | 已结束仍改 | 新建模板 |
| Unlock validity days is required | 解锁后天数未填 | 补「解锁后 N 天」 |
| 券模板不存在 / 券模板未发布,无法发放 | 未发布或已删 | 先发布再发券 |
| 券模板库存不足 / 该客户已达领取上限 | 库存或限领 | 加库存或换客户 |
| 客户编号不能为空 / 客户编号 xxx 不存在 | 批量名单错 | 核对客户编号 |
### 8.3 支付 / 用券(订单侧也会抛)
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 优惠券未解锁,完成首单派送后可用 | 第二单券未解锁 | 等首单派送成功 |
| 优惠券已使用 / 已过期 / 尚未生效 | 状态不对 | 换可用券 |
| 优惠券已被其他订单占用 | 预占中 | 等锁释放或取消占单 |
| 该优惠券不适用于当前线路 | 线路定向国家不符 | 换券或改适用国家 |
| 优惠券不属于当前客户 | 串号 | 用本人主账号券包 |
| **所选优惠券未达使用门槛或优惠不高于会员折扣,请重新选择** | 门槛不够或会员折更划算 | 换券,或接受会员折 |
| 券活动未开放 / 该券不支持自助领取 | 模板渠道不对 | 改发放类型或运营代发 |
### 8.4 拉新 / 分成 / 提现
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 邀请码无效或已停用 / Invite code not found/disabled | 码错或停用 | 换有效码 |
| 不能使用自己的邀请码 / Self referral not allowed | 自邀 | 换邀请人 |
| 邀请人暂无邀请资格 | 邀请人未达等级门槛 | 升到 V1+ 或调分成规则门槛 |
| 订单未达到派送成功状态 | 手工补分成时机不对 | 等派送成功 |
| 佣金余额不足 / Insufficient available commission | 提现超额 | 对可用佣金 |
| Only pending requests can be approved/rejected | 非待审单 | 只处理 pending |
| Reject reason is required(驳回原因) | 驳回没写原因 | 写清原因(客户可见) |
| Reason must be at least 20 characters | 改绑原因太短 | ≥20 字 |
| Rebind main customer only / Referrer must be main customer | 绑到子账号 | 只绑主客户 |
| 子账号不可访问营销中心 | 子账号进门户营销 | 用主账号打开 |
### 8.5 客诉现象级(不一定有固定文案)
| 客户说法 | 常见原因 | 怎么处理 / 怎么解释 |
|----------|----------|---------------------|
| 「我有会员等级,为什么附加费没打折?」 | 折扣只打基础运费 | 说明燃油/偏远等始终原价 |
| 「会员折和券能不能一起用?」 | 系统设计互斥 | 说明每单取更省的那个;可帮客户对比两笔金额 |
| 「第二单券为什么是灰的?」 | 未解锁 | 等首单 **派送成功**;并用时基础运费满 150 |
| 「积分怎么变少了?」 | 滚动 12 个月 / 退款扣回 | 查积分流水;说明不是终身累计 |
| 「我邀请了人怎么没钱?」 | 未派送成功 / 未满门槛 / 超 6 单 / 超 90 天 / 自己是 V0 | 对分成明细看「第几单、实付基数、状态」 |
| 「奖励显示待结算很久」 | T+3 工作日 | 看明细「计划结算」日期;周末不计入工作日 |
| 「为什么改了分成比例,旧单没变?」 | 改规则不追溯 | 正常现象,只影响新产生的明细 |
| 「子账号看不到券」 | 券在主账号 | 用主账号登录查看;子账号下单时仍可用主账号券包 |
| 「附加费怎么没打折?」 | 折扣只打基础运费 | 燃油/偏远等始终原价 |
| 「会员折和券能不能一起用?」 | 互斥取更优 | 每单只取更省的那个 |
| 「第二单券为什么是灰的?」 | 未解锁 | 等首单派送成功;满 150 再用 |
| 「积分怎么变少了?」 | 滚动 12 个月 / 退款扣回 | 查积分流水 |
| 「邀请了人怎么没钱?」 | 未派送成功 / 门槛 / 超窗 / V0 | 对分成明细 |
| 「待结算很久」 | T+3 工作日 | 看计划结算日;周末不计 |
| 「改了比例旧单没变」 | 不追溯 | 只影响新明细 |
| 「子账号看不到券」 | 券在主账号 | 主账号查看;下单仍可用主账号券 |
---

View File

@ -0,0 +1,79 @@
# 操作中心开发指引
> 面向 **开发**。扫枪业务流程见同页「运营」Tab。
> 预报/入库计费、状态机细节以 [订单开发指引](/order/guide) 为准;库存/lot 以 [仓储开发指引](/warehouse/guide) 为准。
---
## 1. 模块职责
操作模块提供仓内作业入口:入库扫描、出库扫描、到货、装袋/大包、主单、打单、履约打包。
多数动作 **驱动订单状态**,并可能 **写入仓储库存 / 仓租 lot**。
API 多落在订单/仓储 Application 上,前端路由前缀 `/operation/*`。
---
## 2. 入库扫描 ↔ 订单
入库成功时(概念顺序):
1. 校验运单可入库(已预报等)
2. 写实测件重尺
3. 重算客户应收(入库阶段费用)
4. 尝试排货(选服务渠道、算成本)
5. 状态 → **待支付** 或 **待排货**
6. 若涉及备货/SKU:库存↑、仓租 lot↑(仓储)
排货失败 **不回滚收货**:货已收,单停在待排货;运营修好后「重算应付」。
---
## 3. 出库扫描 ↔ 订单 / 轨迹
- 前置:通常已付款(待发货)
- 成功:状态 → **待上网**(及后续轨迹相关)
- 可触发轨迹订单创建/刷新条件(见轨迹模块)
- 库存/lot 扣减在仓储侧完成
面单 PDF 异步生成失败一般 **不阻断** 出库状态;补打走打印标签页。
---
## 4. 与仓储的写入边界
| 操作动作 | 订单 | 仓储 |
|----------|------|------|
| 入库扫描 | 状态 + 费用 + 排货 | inventory / rent lot 增加 |
| 出库扫描 | 状态 → 待上网 | inventory / lot 扣减 |
| 装袋/主单 | 可能挂大包/主单号 | 通常不改库存数量 |
| 仓租日结 | 不改 | 账单 + 账户流水(仓储/财务) |
排障顺序建议:先确认扫描是否成功写订单操作日志 → 再对库存 → 再看仓租 lot。
运营可见报错表见同页「运营」Tab §5;文案多来自:
| 场景 | 后端入口(示意) |
|------|------------------|
| 入库扫描 | `InboundRecordService` + `OrderService` 入库计费(重复扫:「订单入库处理中…」) |
| 出库扫描 | `OutboundRecordService`(未付款 / 状态不允许出库) |
| 装袋 / 大包 | `ShipBagService` |
| 打板 / 主单 | `ShipMasterService` |
| 打印标签 | `LabelPrintService` |
| 仓租拦截 / 库存不足 | 见仓储 `WarehouseRentGuard`、`WarehouseService.Helpers` |
---
## 5. 权限与菜单
路由 `meta.permission` 形如 `Operation.InboundScan.Query`;指引页 `Operation.Guide` 供同步子菜单。
无权限时侧栏不显示对应扫描页,与 RBAC 菜单树一致。
---
## 6. 相关前端入口
| 页面 | 路径 |
|------|------|
| 入库扫描 | `/operation/inboundScan` |
| 出库扫描 | `/operation/outboundScan` |
| 本指引 | `/operation/guide` |

View File

@ -0,0 +1,189 @@
# 操作中心运营指引
> 本文面向 **操作员、跟单客服**,说明仓内扫枪:入库、出库、装袋、主单、打单怎么走,以及 **后端常见报错怎么排查**。
> 接口与状态机衔接见同页 **「开发」** Tab。
> SKU / 库存 / 仓租见 [仓储指引](/warehouse/guide);订单状态细表见 [订单指引](/order/guide);待排货配置见 [渠道指引](/channel/guide)。
---
## 1. 操作模块管什么?
操作 = 「货到了仓之后,人拿扫枪做的事」:
| 菜单 | 一句话 |
|------|--------|
| **入库扫描** | 确认收到:写实测件重尺 → 重算应收 → 尝试排货 |
| **出库扫描** | 确认发出:已付款单离开仓库 → 待上网 |
| **快递到仓** | 快递包裹到仓签收/登记 |
| **装袋作业 / 大包管理** | 多票装进大包,方便交承运 |
| **打板 / 主单** | 主单维度作业与单据 |
| **打印标签** | 面单 / 标签补打 |
| **代发打包出库** | 履约仓打包出库场景 |
**和仓储的边界:** 主数据与库存账本在仓储;**扫一下改变「货在不在、单到哪一步」** 在操作。
---
## 2. 幸福路径(例子)
假设运单已是 **已预报**(客户下过单,货到仓):
```
① 入库扫描:称重/量尺 → 系统重算应收并排货
├─ 成功 → 订单「待支付」→ 客户付款 →「待发货」
└─ 排货失败 →「待排货」(货已收,不是丢件)
② 客户付清 → 待发货
③ 出库扫描 →「待上网」→ 轨迹中心等服务商节点
④(可选)装袋 / 主单 / 补打标签
```
对照练习:培训手册「练习包」→ 仓内操作卡片。
---
## 3. 入库扫描必记
扫描成功时系统大致做三件事(详见订单指引):
1. 写入库 **实测** 长宽高、实重
2. **重算客户应收**(可能比预报贵或便宜)
3. **自动排货**(选服务渠道、算成本)
| 结果 | 订单状态 | 操作要不要拦货? |
|------|----------|------------------|
| 排货成功 | **待支付** | 不用拦,等付款后再出库 |
| 排货失败 | **待排货** | 货先收着;通知运营修买价/排货,**不要当丢件** |
对客话术见培训手册「话术」Tab:货已收到,渠道匹配中。
---
## 4. 出库 / 装袋 / 主单 / 打单
| 场景 | 何时用 | 注意 |
|------|--------|------|
| **出库扫描** | 已付款(待发货)要离仓 | 未付款、待排货一般不应出库 |
| **装袋 / 大包** | 多票汇总交给承运 | 先保证单票状态正确 |
| **打板 / 主单** | 主单维度交接 | 与轨迹上网节点配合 |
| **打印标签** | 面单丢了或要补打 | 打印失败 **通常不挡** 订单状态,可稍后重打 |
| **代发打包** | 履约仓按单打包出库 | 与普通出库场景区分权限 |
出库后轨迹侧:见 [轨迹指引](/track/guide);「一直已预报」先确认是否已出库。
---
## 5. 常见报错 ↔ 解决思路
> 文案来自后端 `BusinessException`(以界面提示为准)。
> **排查口诀:** 先对单号 → 再对订单状态/是否付款 → 再对袋板约束与标签模板。
> 仓租欠费拦截、库存不足详见 [仓储指引 §4](/warehouse/guide)。
### 5.1 入库扫描
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 请扫描或输入单号 / 运单号不能为空 | 未扫 | 焦点进输入框再扫 |
| 未找到对应订单,请检查单号 | 号错、未预报、扫了别的号类型 | 对客户单号/运单号;先确认已预报 |
| 订单入库处理中,请勿重复扫描 | 上一笔入库计费还在跑 | 等几秒再扫;勿连扫同一单 |
| 客户存在未结清仓租账单… | 仓租 unpaid | [仓租日账单](/warehouse/storageRent) 补扣后再入 |
| (成功后)状态变 **待排货** | 排货/买价未命中 | **不是丢件**;通知运营修排货;订单「重跑入库计费」 |
| 入库后客户说比预报贵 | 实测件重尺变了 | 正常;对预报 vs 入库尺寸 |
### 5.2 出库扫描
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 请扫描或输入单号 / 运单号不能为空 | 未扫 | 再扫 |
| 未找到对应订单,请检查单号 | 号错 | 核对运单号 |
| 发货实重与长宽高不能为空且须大于 0 | 出库件重尺没填全 | 补实重与长宽高 |
| **订单未付款,禁止出库** | 未付清 | 等付款至待发货 |
| 订单已出库 | 重复扫 | 勿再出;看状态是否已待上网 |
| 订单状态为「xxx」,不允许出库 | 未到待发货等 | 对照订单状态;勿跳步 |
| 库存不足 / SKU 库存可用不足 | 仓配账面不够 | [库存](/warehouse/inventory) 对数量 |
### 5.3 装袋 / 大包
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 请输入大包号 / 未找到大包 | 未开袋或号错 | 先开袋再扫 |
| 袋型仅支持 sack / box | 袋型非法 | 选麻袋或箱子 |
| 已出库或已作废的大包不可改属性 | 袋已关流程 | 开新袋 |
| 仅装袋中的大包可继续装/拆 / 可封袋 | 袋状态不对 | 确认仍是「装袋中」 |
| 请扫描运单号 / 未找到对应订单 | 未扫或号错 | 扫运单号 |
| 运单状态为「xxx」,**仅待发货可入袋** | 未到待发货 | 先入库+付款 |
| 运单未付款,禁止入袋 | 未付款 | 先付款 |
| 该运单已在本袋中 / 已在其它大包中 | 重复装袋 | 从原袋移出或换袋 |
| 目的国不一致:袋=…,运单=… | 混装目的国 | 换同目的国袋,或清空袋目的国约束 |
| 空袋不能封袋 / 袋内无运单 | 没装件 | 先装件再封 |
| 请先移出袋内运单再作废 | 袋里还有件 | 拆空再作废 |
| 仅已封袋的大包可出库 | 未封袋 | 先封袋 |
| 运单缺少可用件重尺,无法大包出库 | 无入库/可用尺寸 | 补件重尺后再大包出库 |
| 未配置大包标签模板… | 缺模板 | 标签设计建大包类型模板 |
### 5.4 打板 / 主单
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 请输入主单号 / 未找到主单 | 未建或号错 | 先建主单 |
| 已交运或已作废的主单不可改属性 | 流程已关 | 开新主单 |
| 仅打板中的主单可继续装板/拆板 / 可封板 | 状态不对 | 确认仍是「打板中」 |
| 请扫描大包号 / 未找到大包 | 袋号错 | 对大包号 |
| **仅已封袋或已出库的大包可上主单** | 袋未封 | 先封袋 |
| 该大包已归属其它主单 / 已在本主单中 | 重复上板 | 从原主单移除 |
| 请扫描运单号 / 未找到订单 | 号错 | 再扫 |
| 草稿/已删除运单不能上主单 | 单无效 | 换有效运单 |
| 该运单已归属其它主单 / 已在本主单中 | 重复 | 从原主单拆下 |
| 空主单不能封板 | 板上无袋/无件 | 装完再封 |
| 请填写外部 MAWB/提单号 | 交运缺号 | 填外部提单号 |
| 已交运主单不可改 MAWB… | 已交运 | 按换绑流程(二期)或找开发 |
| **仅已封板主单可交运** | 未封板 | 先封板再交运 |
| 未配置主单标签模板… | 缺模板 | 标签设计建主单类型模板 |
### 5.5 打印标签
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 请扫描或输入单号 | 未扫 | 再扫 |
| 未找到对应订单,请检查号码或类型 | 号/类型不对 | 换客户单号/运单号/追踪号试 |
| 标签模板不存在 / 内容为空 | 模板未建或未保存 | 标签设计保存启用 |
| 找到包裹但未绑定到任何订单… | 包裹未绑单 | 先订单绑定包裹/库存 |
| 找到 SKU 但没有绑定中的订单… | SKU 未绑单 | 先完成库存绑定 |
| 浏览器打不出 | 弹窗拦截/驱动 | 允许弹窗;换机试打(一般不挡订单状态) |
### 5.6 现象级(不一定有固定文案)
| 现象 | 可能原因 | 解决思路 |
|------|----------|----------|
| 扫了没反应 | 焦点不在输入框 / 扫枪无回车 | 点输入框;确认后缀回车 |
| 未付款做出库被拦 | 系统校验 | 以提示为准;先付款 |
| 有出库无轨迹 | 服务商未上网或未映射 | 轨迹订单刷新;见 [轨迹指引](/track/guide) |
---
## 6. 菜单入口
| 功能 | 路径 |
|------|------|
| 操作指引 | [/operation/guide](/operation/guide) |
| 入库扫描 | [/operation/inboundScan](/operation/inboundScan) |
| 出库扫描 | [/operation/outboundScan](/operation/outboundScan) |
| 快递到仓 | [/operation/parcelArrival](/operation/parcelArrival) |
| 装袋作业 | [/operation/bagPack](/operation/bagPack) |
| 大包管理 | [/operation/bagManage](/operation/bagManage) |
| 打板作业 | [/operation/masterBoard](/operation/masterBoard) |
| 主单管理 | [/operation/masterBill](/operation/masterBill) |
| 打印标签 | [/operation/printLabel](/operation/printLabel) |
| 代发打包 | [/operation/fulfillPack](/operation/fulfillPack) |
| 仓储指引 | [/warehouse/guide](/warehouse/guide) |
---
## 7. 和别的模块怎么配合
```
已预报(订单)
→ 入库扫描(操作)→ 库存/lot(仓储)+ 待支付/待排货(订单)
→ 付款 → 出库扫描(操作)→ 待上网(订单)→ 轨迹拉取(轨迹)
```
仓租日结看仓储;运费与待排货看订单/渠道。

View File

@ -0,0 +1,13 @@
<script lang="ts" setup>
import GuideAudienceTabs from '@/components/GuideAudienceTabs/index.vue';
import opsContent from './guide-ops.md?raw';
import devContent from './guide-dev.md?raw';
defineOptions({
name: 'OperationGuide',
});
</script>
<template>
<GuideAudienceTabs :ops-content="opsContent" :dev-content="devContent" />
</template>

View File

@ -359,3 +359,5 @@ flowchart TD
| 轨迹 | `PublishForecastTrackAsync` |
| 批次消费 | `OrderBatchOrderActionHandler`(ForecastBilling) |
| Outbox | `Messaging/ParcelCreate/*`、`Messaging/OrderSideEffects/*` |
运营可见报错表见同页「运营」Tab §7;下单/计费文案多在 `OrderService.ParcelBilling.cs`,支付用券在 `OrderService.PayCoupon.cs`,改单在 `OrderService.OrderEdit.cs`。渠道侧配置类报错见渠道开发指引。

View File

@ -1,6 +1,6 @@
# 订单中心运营指引
> 本文面向 **运营、客服** 同学,说明查价、下单、入库、付款、出库怎么走,以及常见报错怎么排查。
> 本文面向 **运营、客服** 同学,说明查价、下单、入库、付款、出库怎么走,以及 **后端常见报错怎么排查**(文案对齐 `BusinessException`)。
> 接口、Outbox、计费代码见同页 **「开发」** Tab;渠道配置见 [渠道指引](/channel/guide)。
> JSON / Body / 对象数组等基础概念见 [Like API 指引 · 运营](/api/apiDebugger) 开篇「写给小白」。
@ -229,19 +229,55 @@
## 7. 常见报错 ↔ 怎么回客户 / 怎么查
> 文案来自后端 `BusinessException`(以界面提示为准)。
> **排查口诀:** 先对必填与产品 → 再对快照/分区/卖价(渠道)→ 再对状态与付款。
> 渠道配置细表见 [渠道指引 §7](/channel/guide);仓内扫描见 [操作指引](/operation/guide)。
### 7.1 下单 / 预报(落库前或草稿失败)
| 客户或系统提示 | 可能原因 | 运营动作 |
|----------------|----------|----------|
| 客户单号已存在 | 同客户重复用同一个客户单号 | 换客户单号,或查是否已下过 |
| 销售产品不存在或未启用 | 产品停用 / 编码错 | 查销售产品状态 |
| 未命中价格/规则快照 | 改过配置 **没发布** | 渠道 → 销售产品 → 发布 rules / price |
| 收件地址命中黑名单 | 地址在禁运区 | 换地址,或调整黑名单 |
| 价格分区未匹配 | 邮编/国家不在价格分区 | 补分区明细或核对地址 |
| 未配置计重规则 | 产品没绑计重 / 未发布 | 产品配置 + 发布规则 |
| 卖价未匹配到有效价格 | 重量段、货物属性、分区对不上卖价表 | 查卖价矩阵 |
| 一直待排货 | 见上一节 | 先看订单上的待排货原因 |
| 查价有价、下单失败 | 查价未校验邮编/黑名单;下单更严 | 用完整地址再试下单 |
| 客户单号不能为空 / 客户单号已存在 | 空号或同客户重复 | 换客户单号,或查是否已下过 |
| 客户ID不能为空 / 客户不存在或状态不可用 | 未选客户或客户停用 | 选有效客户 |
| 产品代码不能为空 / 销售产品不存在或未启用 | 产品停用 / 编码错 | 查销售产品状态 |
| 仓库ID不能为空 / 仓库不存在 | 未选仓 | 选仓库 |
| 件重尺必须大于 0 | 尺寸/重量 ≤0 | 补预报件重尺 |
| 收件国家不能为空 / 收件人信息不完整 | 地址不全 | 补国家、姓名、电话、地址等 |
| 发件人姓名不能为空 | 发件缺姓名 | 补发件人 |
| 申报明细不能为空 / 必填字段不完整 / 申报币种不能为空 | 申报行缺字段 | 按行补中英文名、数量、价值、币种等 |
| 货物属性不合法 / 出口报关方式不合法 | 枚举值错 | 按下单页选项重选 |
| 9610…必须选择出口资质备案 / 必须填写电商平台 | 9610 缺备案或平台 | 维护默认备案;填平台码 |
| 出口资质备案不存在或不属于当前客户 | 备案串客户 | 换本客户备案 |
| **收件地址命中黑名单区域** | 禁运 | 换地址,或调黑名单(渠道) |
| 未命中价格/规则快照版本… | 改配置没发布或快照缺失 | 渠道 → 发布 rules / price |
| 价格分区未匹配(规则快照) | 邮编/国家未覆盖 | 补分区明细;产品关联后发布 |
| 未配置计重规则 / 未配置计重进位 | 产品未绑或未发布 | 产品配置 + 发布规则 |
| 计费重无效,无法计费… | 计重结果异常 | 对尺寸与计重规则 |
| **产品卖价未匹配到有效价格:…** | 重量段/属性/价区对不上 | 查卖价矩阵后发布价格 |
| 附加服务不在产品可选范围 / 产品未配置附加服务 | 勾了未开放服务 | 去掉或产品上开放 |
| 查价有价、下单失败 | 查价可跳过邮编/黑名单;下单更严 | 用完整地址再下单 |
**草稿单:** 计费失败时可能留下草稿,打开订单看 **预报失败原因**,按上表对号入座。
**草稿单:** 计费失败可能留 `draft`,打开订单看 **预报失败原因**,按上表对号入座。
### 7.2 入库后 / 待排货 / 改费
| 客户或系统提示 | 可能原因 | 运营动作 |
|----------------|----------|----------|
| 一直待排货 / 排货规则未匹配到可用服务渠道 | 排货空、买价未发布、客户白名单 | 见 §6.3;渠道修完后 **重算应付** |
| 订单关联的销售产品未启用,无法计费 | 入库后产品被停用 | 启用产品或换绑后重算 |
| 订单缺少收货件重尺记录 | 入库尺寸未写上 | 操作侧重扫或补尺寸 |
| 订单已付款,不能修改应收费用 | 已付仍改应收 | 走退款/调账流程,勿直接改 |
| 优惠券相关(门槛/未解锁/互斥) | 见营销 | [营销指引 §8](/marketing/guide) |
### 7.3 付款后出库 / 轨迹
| 客户或系统提示 | 可能原因 | 运营动作 |
|----------------|----------|----------|
| 订单未付款,禁止出库 | 未付清 | 催付至待发货 |
| 订单已出库 / 状态为「xxx」,不允许出库 | 重复或状态不对 | 对订单状态;勿跳步 |
| 订单缺少发货件重尺记录 | 出库尺寸空 | 补发货件重尺 |
| 订单运单号为空,无法同步轨迹 | 无 ServiceNo | 等出号后再刷轨迹 |
| 库存/仓租拦截 | 仓配库存或欠仓租 | [仓储指引](/warehouse/guide)、[操作指引](/operation/guide) |
---
@ -249,7 +285,7 @@
| 菜单 | 路径 | 运营用途 |
|------|------|----------|
| 新手指引 | `/order/guide` | 本文 |
| 订单指引 | `/order/guide` | 本文 |
| 我要查价 | `/order/priceCheck` | 试运费、看对客说明 |
| 我要下单 | `/order/placeOrder` | 单笔 / 批量 Excel |
| 我的订单 | `/order/myOrders` | 查状态、费用、付款、拦截 |

View File

@ -135,3 +135,13 @@ OMS 扩展字段(不一定进 Upsert Body):`Authorization`、`AppendInitia
| OMS 发轨迹 | `OrderService.ParcelBilling.cs`(Publish/Enqueue)、`Messaging/*Track*` |
| TrackCenter 拉取/推送 | `TrackPullService` / `TrackPushService`、`TrackRefreshEventHandler` / `TrackPushEventHandler` |
| 前端菜单 | `/track/*`(OMS 前端代理到轨迹中心 API 以部署为准) |
运营可见报错表见同页「运营」Tab §8;文案多来自:
| 场景 | 后端入口(示意) |
|------|------------------|
| 状态 / 内容 / 标记 | `TrackStatusService` / `TrackContentService` / `TrackFlagService` |
| 拉取 | `TrackPullService` |
| 推送配置 / 事件 | `TrackPushService` / `TrackPushEventHandler` |
| 轨迹订单 | `TrackOrderService` |
| OMS 查询/同步 | `SmallBagTrackOrderClient`、`OrderParcelTrackUpsertEventHandler` |

View File

@ -1,6 +1,6 @@
# 轨迹中心运营指引
> 本文面向 **运营、客服** 同学,说明轨迹怎么从服务商进来、怎么标准化、怎么推给客户或 OMS,以及查不到轨迹时怎么排查。
> 本文面向 **运营、客服** 同学,说明轨迹怎么从服务商进来、怎么标准化、怎么推给客户或 OMS,以及 **后端常见报错怎么排查**。
> Handler / API / 表结构见同页 **「开发」** Tab。
---
@ -152,7 +152,7 @@
| 菜单 | 路径 | 用途 |
|------|------|------|
| 新手指引 | `/track/guide` | 本文 |
| 轨迹指引 | `/track/guide` | 本文 |
| 轨迹订单 | `/track/order` | 查单、时间轴、补录、刷新、推送 |
| 预警订单 | `/track/warningOrder` | 处理已触发预警 |
| 轨迹状态 / 内容 / 标记 | `/track/state` 等 | 主数据 |
@ -162,14 +162,71 @@
---
## 8. 客服常见问答
## 8. 常见报错 ↔ 解决思路
> 文案来自 TrackCenter / OMS `BusinessException`(以界面提示为准)。
> **排查口诀:** 先确认轨迹订单在不在 → 再对拉取映射 → 再对推送开关与顺序。
### 8.1 主数据(状态 / 内容 / 标记)
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 该应用下轨迹状态/内容/标记(代码/中文/英文)已存在 | 同 App 下重复 | 换编码或文案 |
| 轨迹状态/内容/标记不存在 | 已删 | 刷新;重建 |
| 该状态/标记关联轨迹内容,禁止删除 | 仍被内容引用 | 先改内容解绑再删 |
| 禁止自己映射自己 / 映射已经存在 | 内容互映配置错 | 改映射目标 |
| 存在非法轨迹标记 | 标记 ID 无效 | 只选本应用下有效标记 |
### 8.2 拉取配置
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 轨迹拉取配置不存在 / 配置不存在 | 已删或 ID 错 | 从拉取列表重进 |
| 配置已经存在 / 配置已存在 | 同 App+服务商重复,或映射/优先级重复 | 改已有配置;勿建第二套主配置 |
| 请选择订单类型 | 优先级缺订单类型 | 选小包/大包/主单 |
| **兜底配置禁止被删除** | 删了客户 `*` 优先级 | 保留兜底行;只改间隔/单号类型 |
| 找不到数据 | 编辑了已删行 | 刷新后重开 |
### 8.3 推送配置 / 推送过程
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 配置已存在 | 同客户已有推送主配置 | 改已有配置 |
| TrackContentId/Code/Status…配置已存在 | 推送映射重复 | 合并重复节点 |
| 该客户…未关联服务商,无法推送 | 客户未绑服务商 | 客户主数据补服务商关联 |
| 推送顺序异常(或推送记录失败) | Sort 跳步 / 可交换节点未配 | 调映射 Sort;救急用手工推 |
| 异常单不自动推 | 设计如此 | 用手工推送 |
### 8.4 轨迹订单操作
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 订单不存在 | 轨迹单未建或号错 | 确认 OMS 已排货同步;对运单号 |
| 订单状态未发生变化 | 改状态与当前相同 | 无需重复操作 |
| 轨迹不存在 | 明细已删 | 刷新时间轴 |
| 请求参数异常 | 入参缺字段 | 按页必填补全 |
| 应用必须≥0 / 轨迹内容 code 不能为空 / 订单类型不能为空 / 轨迹发生时间不能为空 | 人工补录缺参 | 按提示补全 |
| 在当前应用中未找到指定 code 的轨迹内容 | 补录选了不存在的内容码 | 先建轨迹内容 |
| 当前应用下未找到任何可用的轨迹内容 | 主数据空 | 先配状态与内容 |
| 请求接口通需要应用上下文,应用 key 不能为空 | AppKey 未配 | 查应用/网关配置 |
### 8.5 OMS 侧联调提示
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 轨迹服务未启用 / 未配置 | `Oms:TrackService` 关或空 | 开配置填 BaseUrl/AppKey |
| 服务单号为空,无法查询/同步轨迹 | 运单号空 | 等预报出号后再查 |
| 轨迹查询失败 | 网关/鉴权/对端异常 | 对 Track 日志与 Authorization |
| 刷新「一个能更新的都没有」 | 无单 / App 不对 / 未配拉取 | 对拉取主配置与服务商 |
### 8.6 客服现象级
| 客户说法 | 可能原因 | 怎么处理 |
|----------|----------|----------|
| 「官网有轨迹,你们没有」 | 未映射 / 拉取间隔还没到 / 单号类型不对 | 刷新;看未映射原文;补映射;查优先级用的是跟踪号还是客户单号 |
| 「一直显示已预报」 | 服务商尚未上网,或拉取未开始 | 看主配置开始节点、静默时间;问仓是否已出库 |
| 「节点乱跳 / 缺段」 | 映射关键词过宽、或推送顺序与业务不一致 | 收紧关键词、加反向词;调整推送 Sort |
| 「我们系统没收回调」 | 自动推送关了、顺序卡了、异常单 | 查推送记录;必要时手工推 |
| 「官网有轨迹,你们没有」 | 未映射 / 间隔未到 / 单号类型不对 | 刷新;看未映射;补映射;查优先级单号类型 |
| 「一直显示已预报」 | 未上网或拉取未开始 | 看主配置开始节点;确认是否已出库 |
| 「节点乱跳 / 缺段」 | 关键词过宽或 Sort 乱 | 收紧关键词;调推送 Sort |
| 「我们系统没收回调」 | 自动推送关 / 顺序卡 / 异常单 | 查推送记录;必要时手工推 |
---

View File

@ -0,0 +1,78 @@
# 仓储中心开发指引
> 面向 **开发**。运营配置与仓租白话见同页「运营」Tab。
> 订单状态机、入库计费见 [订单开发指引](/order/guide)。
---
## 1. 模块职责
仓储提供:SKU 主数据、库存数量、库位、入库预报、仓租费率与日账单。
现场扫描写库存 / 改订单状态在 **操作** 模块完成。
常见 API 前缀:`/warehouse/*`(以 Swagger / 后端 Application 为准)。
---
## 2. 核心表(概念层)
| 概念 | 典型表 / 实体 | 说明 |
|------|----------------|------|
| SKU | `c_sku` | 含 LengthCm/WidthCm/HeightCm,体积 = 长×宽×高/1e6 |
| 库存 | `c_inventory` | CustomerId + WarehouseId + SkuId + BinLocationId + Qty |
| 库位 | 库位主数据表 | 仓内位置 |
| 入库预报 | 预报单头/明细 | 预约进仓,不等于库存已增 |
| 仓租费率 | `c_warehouse_rent_rate` (+ factor/detail) | 费率卡 |
| 仓租批次 | `c_warehouse_rent_lot` | 入库时间、剩余量、UnitCbm、SourceType |
| 仓租账单 | `c_warehouse_rent_bill` / `_line` | 日结;Status:pending/paid/… |
审计列对齐现网约定:`IsDeleted`、`ConcurrencyStamp DEFAULT (UUID())`、`CreateUserId`/`CreateTime`、`UpdateUserId`/`UpdateTime` 可空。禁止库级 `UNIQUE KEY`(业务侧校验)。
---
## 3. 仓租关键逻辑
### 3.1 Lot 从哪来
- 正常:操作入库(或备货入库)写入 lot(`SourceType` 如 inbound/parcel)。
- 存量缺口:迁移脚本 / 回填任务按 `c_inventory` 与已有 lot 差额插入 `SourceType=backfill`(见 `sql/migrate_warehouse_rent_lot_backfill_*.sql`)。
- UnitCbm=0 时可用 SKU 尺寸回填刷新。
### 3.2 日结
按计费日对在仓 lot:库龄天数 × 体积 × 费率明细 → 写 bill/line;扣款成功关联账户流水 `FlowId`。
费率匹配因素常见:仓库、客户组、库龄、体积档(以 `WarehouseStorageRent` Application 为准)。
### 3.3 与运费隔离
仓租费用项字典码一般为 `storageRent`(`t_dict.fee_item`)。
不参与销售产品卖价发布快照;对账时勿与订单应收混在一张「运费」里解释。
---
## 4. 和操作 / 订单的边界
| 动作 | 仓储 | 操作 | 订单 |
|------|------|------|------|
| 建预报 | 写预报单 | — | 可选关联 |
| 入库扫描 | 库存↑、lot↑ | 扫枪入口 | 重算应收、排货、状态→待支付/待排货 |
| 出库扫描 | 库存↓、lot 扣减 | 扫枪入口 | 状态→待上网等 |
| 仓租日结 | 账单 + 扣款 | — | 不改运单状态 |
排障:库存不对先对 inventory 与 lot;订单状态不对先看操作扫描与 [订单指引](/order/guide)。
运营可见报错表见同页「运营」Tab §4;文案多来自:
| 场景 | 后端入口(示意) |
|------|------------------|
| SKU / 库存 / 库位 / 预报 / 包裹 | `WarehouseService.*` |
| 快递到仓 | `WarehouseService.ParcelArrival` |
| 仓租费率 / 日账单 | `WarehouseRentService` |
| 欠费拦截入库/上架 | `WarehouseRentGuard` → 「未结清仓租账单…」 |
---
## 5. 相关脚本
- `sql/migrate_warehouse_storage_rent_*.sql`:建仓租表 + 费用项种子
- `sql/migrate_warehouse_rent_lot_backfill_*.sql`:库存缺口回填 lot
- 合集:`sql/migrate_merged_20261114_20261115.sql`(含上述段)

View File

@ -0,0 +1,195 @@
# 仓储中心运营指引
> 本文面向 **仓管、运营、财务** 同学,说明 SKU / 库存 / 库位 / 入库预报 / 仓租怎么理解、怎么配,以及 **后端常见报错怎么排查**。
> 表结构与日结逻辑见同页 **「开发」** Tab。
> 现场扫枪入库、出库见 [操作指引](/operation/guide);运单状态见 [订单指引](/order/guide)。
---
## 1. 仓储模块管什么?
可以把仓储想成「货在仓里的账本」:货是什么、在哪、剩多少、住了几天要不要收仓租。
| 菜单 | 一句话 |
|------|--------|
| **SKU** | 货品主数据:编码、名称、长宽高重量 |
| **库存** | 某个客户在某仓某库位上还剩多少件 |
| **库位** | 仓内货架/格子编码 |
| **入库预报** | 客户预约「货要进仓」(还没真正收到) |
| **我的包裹** | 仓内包裹视角列表(按权限) |
| **仓租设置** | 费率卡 + 日账单(和运单运费是另一本账) |
**和操作的边界:**
仓储负责主数据与账本;**入库扫描 / 出库扫描** 在 [操作](/operation/guide) 里做,扫完会写库存、改订单状态。
---
## 2. 推荐上手顺序(照着做)
新仓或新货主接入时,建议:
```
① 建 SKU(务必填长宽高,否则仓租体积常为 0)
② 配库位(可选,但有库位更好对账)
③ 客户提交入库预报(或代客建预报)
④ 操作侧入库扫描收货 → 回仓储看库存是否增加
⑤ 配仓租费率(按仓/客户组/库龄/体积等)
⑥ 看日账单:pending / paid,流水是否进账户
```
---
## 3. 核心概念(白话 + 例子)
### 3.1 SKU
客户或运营维护的「货品身份证」。
**例:** SKU `BOX-A`,30×20×10 cm → 单件体积约 0.006 m³。仓租按体积计费时,缺尺寸会算成 0。
### 3.2 库存 vs 仓租批次(lot)
| | 库存 | 仓租批次 |
|--|------|----------|
| 回答什么 | 现在还剩几件 | 这批货哪天进的、还剩多少、单件体积 |
| 谁在用 | 备货、出库扣减 | 按「在仓天数 × 体积」算日租 |
同一客户同一 SKU,可能有多批不同入库时间的 lot;日结按批算龄。
### 3.3 入库预报 ≠ 已入库
| | 入库预报 | 真正入库 |
|--|----------|----------|
| 含义 | 预约/通知:货要来 | 操作扫描确认收到 |
| 库存 | 一般不增加 | 增加库存 / 写 lot |
| 入口 | [入库预报](/warehouse/inboundNotice) | [入库扫描](/operation/inboundScan) |
**例:** 客户建了预报 100 件,货还在路上 → 库存仍是 0;仓库扫收入库后才变 100。
### 3.4 仓租(和运费分开)
- **运费**:一票国际件从下单到出库,见订单/渠道。
- **仓租**:货在仓里「住店」的钱,按费率卡日结,进账户流水。
| 账单状态(常见) | 含义 |
|------------------|------|
| pending | 已出账,待扣/待付 |
| paid | 已扣成功 |
| unpaid / zero | 扣失败或金额为 0(以页面为准) |
费率可按仓库、客户组、库龄天数、体积档等组合(以 [仓租设置](/warehouse/storageRent) 页配置为准)。
---
## 4. 常见报错 ↔ 解决思路
> 文案来自后端 `BusinessException`(以界面提示为准)。
> **排查口诀:** 先看状态允不允许 → 再看必填/唯一 → 再看库存与仓租是否卡住。
### 4.1 SKU
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| SKU 编码和名称不能为空 | 没填编码或名称 | 补全后保存 |
| SKU 编码已存在 | 同客户/范围内编码重复 | 换编码,或查是否已建过 |
| SKU 仍有库存,不能删除 | 还有库存行 | 先出完/移库清零,或停用代替删除 |
| SKU 不存在 / SKU ID 无效 | 已被删或 ID 错 | 刷新列表;核对客户与仓库 |
| 未配置 SKU 标签模板(类型 sku) | 标签设计缺模板 | 标签设计建 `sku` 类型模板 |
| 平台 SKU 不能为空 | 平台映射必填 | 补平台 SKU |
### 4.2 库位 / 库存
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 仓库ID不能为空 | 未选仓库 | 选仓库 |
| 库位编码不能为空 / 已存在 | 编码空或重复 | 换唯一编码 |
| 库位不存在 / 库位仓库不匹配 | 库位删了或跨仓 | 换本仓库位 |
| SKU 和仓库不能为空 | 移库/调整缺参 | 补 SKU、仓库 |
| 源库位与目标库位不能相同 | 移库选了同一库位 | 换目标库位 |
| 源库位库存不足 / 库存不足 / 库存可用不足 | 账面不够或已冻结 | 对库存数量与冻结;少移/少出 |
| SKU {id} 库存不足,缺少 N 件 | 批量扣减不够 | 补货或减少需求量 |
### 4.3 入库预报(仓储预约)
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 请至少添加一个箱子 | 预报无箱 | 至少加一箱及 SKU 行 |
| 箱内 SKU 行数据不完整 | 箱明细缺 SKU/数量等 | 按行补全 |
| 仅预报或待入库状态可编辑 | 已收货/完成 | 不能再改;新建预报 |
| 仅预报状态可删除 | 已进入后续状态 | 不可删;作废流程按现场 |
| 入库单已完成收货 | 重复收货 | 去库存核对,勿再收 |
| 请提交收货箱数据 | 收货提交空 | 勾选/填写实收箱 |
| 实收数量不能为负 | 数量填错 | 改为 ≥0 |
| 上架库位不能为空 | 收货未选库位 | 指定库位 |
| 箱 / 箱内行不存在 | 前端脏数据 | 刷新预报重开 |
| 该预报没有箱子,无法打印箱唛 | 无箱 | 先加箱 |
| 未配置箱唛标签模板(类型 box) | 缺模板 | 标签设计建 `box` 模板 |
| 入库预报不存在 / ID 无效 | 已删或错 ID | 从列表重进 |
| **客户存在未结清仓租账单,请先到仓租日账单补扣后再入库/上架** | 有未付仓租 | [仓租日账单](/warehouse/storageRent) 补扣后再收货/上架 |
### 4.4 我的包裹 / 上架
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 快递单号不能为空 / 已存在 | 空号或重复 | 换单号或查原包裹 |
| 已上架包裹不可编辑 / 不可删除 | 已上架 | 勿改;用库存调整 |
| 包裹已上架 | 重复上架 | 去库存看 |
| 请指定上架明细 / SKU 和库位不能为空 | 上架行不完整 | 每行选 SKU+库位+数量 |
| 商品数量必须大于 0 | 数量 ≤0 | 改正数量 |
| 包裹不存在 / 明细不存在 | 数据不一致 | 刷新;核对包裹 ID |
### 4.5 快递到仓(操作菜单,逻辑在仓储)
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 国内快递单号不能为空 | 未扫/未填 | 扫快递单号 |
| 仓库不存在 | 仓库无效 | 换仓库 |
| 未找到对应包裹,请确认快递单号与仓库 | 预报包裹未建或仓不对 | 先在「我的包裹」建包裹 |
| 同一仓库下存在多条相同快递单号… | 重复包裹 | 在「我的包裹」合并/清理后再到仓 |
| 包裹已上架,无法再到仓 | 已上架 | 无需再到仓 |
### 4.6 仓租
| 系统提示 | 可能原因 | 解决思路 |
|----------|----------|----------|
| 仓租费率不存在 | 已删或 ID 错 | 刷新费率列表 |
| 费率名称不能为空 / 已存在 | 空名或重名 | 换名 |
| 仓租账单不存在 | 账单已删 | 从日账单列表重进 |
| 客户不存在 | 客户 ID 无效 | 核对客户 |
| 仓租账单号生成失败 | 号段/并发异常 | 重试;仍失败找开发 |
| 体积/金额为 0 | SKU 无尺寸或费率未匹配 | 补尺寸;查费率因素是否命中 |
### 4.7 现象级(不一定有固定文案)
| 现象 | 可能原因 | 解决思路 |
|------|----------|----------|
| 有预报但库存没有 | 只做了预报,没收货/上架/运单入库扫描 | 仓储收货或 [操作入库扫描](/operation/inboundScan) |
| 日账单对不上库存 | lot 未回填或出库未扣 lot | 对库存与 lot;开发看回填/日结 |
| 客户说「怎么还有仓储费」 | 货还在仓或昨日已出账 | 看日账单日期与剩余件数 |
---
## 5. 菜单入口
| 功能 | 路径 |
|------|------|
| 仓储指引 | [/warehouse/guide](/warehouse/guide) |
| SKU | [/warehouse/sku](/warehouse/sku) |
| 库存 | [/warehouse/inventory](/warehouse/inventory) |
| 库位 | [/warehouse/binLocation](/warehouse/binLocation) |
| 入库预报 | [/warehouse/inboundNotice](/warehouse/inboundNotice) |
| 仓租 | [/warehouse/storageRent](/warehouse/storageRent) |
| 入库扫描(操作) | [/operation/inboundScan](/operation/inboundScan) |
---
## 6. 和别的模块怎么配合
```
客户建预报(仓储)→ 仓库入库扫描(操作)→ 库存/lot 增加(仓储)
↓
订单变为待支付/待排货(订单)
↓
日结仓租账单(仓储/财务)
```
运单出库后库存减少;仓租只对仍在仓的 lot 计费。

View File

@ -0,0 +1,13 @@
<script lang="ts" setup>
import GuideAudienceTabs from '@/components/GuideAudienceTabs/index.vue';
import opsContent from './guide-ops.md?raw';
import devContent from './guide-dev.md?raw';
defineOptions({
name: 'WarehouseGuide',
});
</script>
<template>
<GuideAudienceTabs :ops-content="opsContent" :dev-content="devContent" />
</template>