diff --git a/src/api/warehouse/index.ts b/src/api/warehouse/index.ts index b4723df..8c29e58 100644 --- a/src/api/warehouse/index.ts +++ b/src/api/warehouse/index.ts @@ -128,6 +128,12 @@ export const saveWarehouseBinLocation = (body: Record) => export const getWarehouseInboundList = (body: Record) => postList('/warehouse/inbound/list', body) export const getWarehouseInboundDetail = (id: number, customerId?: number) => getData('/warehouse/inbound/detail', { id, customerId }) +/** H5 上架扫描:按预报单号 / 箱唛 / NoticeNo-Seq 定位待收货预报详情 */ +export const lookupWarehouseInboundByScan = (body: { + code: string + warehouseId?: number + customerId?: number +}) => postOk('/warehouse/inbound/lookup-by-scan', body) export const saveWarehouseInbound = (body: Record) => postOk('/warehouse/inbound/save', body) export const deleteWarehouseInbound = (id: number) => postOk('/warehouse/inbound/delete', { id }) export const confirmWarehouseInboundReceive = (body: Record) => diff --git a/src/assets/icons/h5/ops-putaway.svg b/src/assets/icons/h5/ops-putaway.svg new file mode 100644 index 0000000..6938bf3 --- /dev/null +++ b/src/assets/icons/h5/ops-putaway.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/icons/h5/ops-relocate.svg b/src/assets/icons/h5/ops-relocate.svg new file mode 100644 index 0000000..715e75a --- /dev/null +++ b/src/assets/icons/h5/ops-relocate.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/locale/en-US.ts b/src/locale/en-US.ts index db1fd83..3fa3c4b 100644 --- a/src/locale/en-US.ts +++ b/src/locale/en-US.ts @@ -760,7 +760,9 @@ export default { 'user.senderAddress.tip.addressType': 'Domestic sender / return / pickup / overseas receiver; one default per type', 'user.senderAddress.tip.addressName': 'Short name for quick pick when placing orders', - 'user.senderAddress.tip.countryCode': 'Pick from country master; province and city must also use dropdowns', + 'user.senderAddress.tip.countryCode': 'Pick from country master data', + 'user.senderAddress.tip.province': 'Prefer dropdown; if master data is incomplete, type and press Enter', + 'user.senderAddress.tip.city': 'Prefer dropdown; if master data is incomplete, type and press Enter', 'user.senderAddress.tip.isDefault': 'Replaces the previous default for this type', 'user.senderAddress.hint.defaultOn': 'Default', 'user.senderAddress.hint.defaultOff': 'Not default', @@ -780,13 +782,14 @@ export default { 'user.senderAddress.message.setDefaultSuccess': 'Default address updated for this type', 'user.senderAddress.message.typeRequired': 'Address type is required', 'user.senderAddress.message.senderNameRequired': 'Contact is required', + 'user.senderAddress.message.phoneRequired': 'Phone is required', 'user.senderAddress.message.countryRequired': 'Country is required', 'user.senderAddress.message.provinceRequired': 'Province / state is required', 'user.senderAddress.message.cityRequired': 'City is required', 'user.senderAddress.message.addressRequired': 'Street address is required', 'user.senderAddress.placeholder.countryCode': 'Select country', - 'user.senderAddress.placeholder.province': 'Select province / state', - 'user.senderAddress.placeholder.city': 'Select city', + 'user.senderAddress.placeholder.province': 'Select or type province / state', + 'user.senderAddress.placeholder.city': 'Select or type city', 'order.customs9610.status.pending': 'Pending declare', 'order.customs9610.status.declared': 'Declared', 'order.customs9610.search.keyword': 'Service No. / Client No. / Customs order No.', diff --git a/src/locale/zh-CN.ts b/src/locale/zh-CN.ts index 617e789..adc94ab 100644 --- a/src/locale/zh-CN.ts +++ b/src/locale/zh-CN.ts @@ -752,7 +752,9 @@ export default { 'user.senderAddress.section.other': '其他', 'user.senderAddress.tip.addressType': '国内发件 / 国内退件 / 国内揽收 / 海外收件,同类型可各设一个默认', 'user.senderAddress.tip.addressName': '便于识别的短名称,如下单页快速选用', - 'user.senderAddress.tip.countryCode': '从国家地区主数据选择;省/州、城市也必须从下拉选择', + 'user.senderAddress.tip.countryCode': '从国家地区主数据选择', + 'user.senderAddress.tip.province': '优先从下拉选择;主数据不全时可直接输入,回车确认', + 'user.senderAddress.tip.city': '优先从下拉选择;主数据不全时可直接输入,回车确认', 'user.senderAddress.tip.isDefault': '开启后将替换该类型下原有默认地址', 'user.senderAddress.hint.defaultOn': '已设为默认', 'user.senderAddress.hint.defaultOff': '非默认', @@ -772,13 +774,14 @@ export default { 'user.senderAddress.message.setDefaultSuccess': '已设为同类型默认地址', 'user.senderAddress.message.typeRequired': '请选择地址类型', 'user.senderAddress.message.senderNameRequired': '请填写联系人', + 'user.senderAddress.message.phoneRequired': '请填写手机', 'user.senderAddress.message.countryRequired': '请选择国家二字码', 'user.senderAddress.message.provinceRequired': '请选择省/州', 'user.senderAddress.message.cityRequired': '请选择城市', 'user.senderAddress.message.addressRequired': '请填写详细地址', 'user.senderAddress.placeholder.countryCode': '请选择国家', - 'user.senderAddress.placeholder.province': '请选择省/州', - 'user.senderAddress.placeholder.city': '请选择城市', + 'user.senderAddress.placeholder.province': '选择或输入省/州', + 'user.senderAddress.placeholder.city': '选择或输入城市', 'order.customs9610.status.pending': '待申报', 'order.customs9610.status.declared': '已申报', 'order.customs9610.search.keyword': '运单号/客户单号/海关订单号', diff --git a/src/router/index.ts b/src/router/index.ts index 0abfc39..72553ba 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -315,6 +315,28 @@ const router = createRouter({ adminPortalOnly: true, }, }, + { + path: 'ops/putaway', + name: 'H5AdminOpsPutaway', + component: () => import('@/views/h5/admin-center/ops/putaway.vue'), + meta: { + requiresAuth: true, + locale: 'h5Admin.ops.putaway', + h5HideHeader: true, + adminPortalOnly: true, + }, + }, + { + path: 'ops/relocate', + name: 'H5AdminOpsRelocate', + component: () => import('@/views/h5/admin-center/ops/relocate.vue'), + meta: { + requiresAuth: true, + locale: 'h5Admin.ops.relocate', + h5HideHeader: true, + adminPortalOnly: true, + }, + }, { path: 'ops/outbound', name: 'H5AdminOpsOutbound', diff --git a/src/views/h5/admin-center/components/H5OpsHubSheet.vue b/src/views/h5/admin-center/components/H5OpsHubSheet.vue index f3adad2..fe7c841 100644 --- a/src/views/h5/admin-center/components/H5OpsHubSheet.vue +++ b/src/views/h5/admin-center/components/H5OpsHubSheet.vue @@ -61,6 +61,8 @@ import { useI18n } from 'vue-i18n'; import { hasPermission } from '@/utils/rbac-permission'; import iconParcel from '@/assets/icons/h5/ops-parcel.svg?url'; import iconInbound from '@/assets/icons/h5/ops-inbound.svg?url'; +import iconPutaway from '@/assets/icons/h5/ops-putaway.svg?url'; +import iconRelocate from '@/assets/icons/h5/ops-relocate.svg?url'; import iconOutbound from '@/assets/icons/h5/ops-outbound.svg?url'; import iconFulfill from '@/assets/icons/h5/ops-fulfill.svg?url'; import iconBag from '@/assets/icons/h5/ops-bag.svg?url'; @@ -79,7 +81,16 @@ const emit = defineEmits<{ const { t } = useI18n(); const router = useRouter(); -const items = [ +type HubItem = { + key: string; + labelKey: string; + path: string; + icon: string; + permission?: string; + permissionAny?: string[]; +}; + +const items: HubItem[] = [ { key: 'parcel', labelKey: 'h5Admin.ops.parcelArrival', @@ -94,6 +105,23 @@ const items = [ icon: iconInbound, permission: 'Operation.InboundScan.Query', }, + { + key: 'putaway', + labelKey: 'h5Admin.ops.putaway', + path: '/h5/admin/ops/putaway', + icon: iconPutaway, + permissionAny: [ + 'Warehouse.InboundNotice.ConfirmReceive', + 'Warehouse.InboundNotice.Save', + ], + }, + { + key: 'relocate', + labelKey: 'h5Admin.ops.relocate', + path: '/h5/admin/ops/relocate', + icon: iconRelocate, + permission: 'Warehouse.Inventory.Relocate', + }, { key: 'outbound', labelKey: 'h5Admin.ops.outbound', @@ -124,9 +152,14 @@ const items = [ }, ]; -const visibleItems = computed(() => - items.filter((item) => hasPermission(item.permission)), -); +function canSeeHubItem(item: HubItem) { + if (item.permissionAny?.length) { + return item.permissionAny.some((p) => hasPermission(p)); + } + return item.permission ? hasPermission(item.permission) : false; +} + +const visibleItems = computed(() => items.filter((item) => canSeeHubItem(item))); function close() { emit('update:visible', false); diff --git a/src/views/h5/admin-center/locale/en-US.ts b/src/views/h5/admin-center/locale/en-US.ts index 0bb2c91..344d3f7 100644 --- a/src/views/h5/admin-center/locale/en-US.ts +++ b/src/views/h5/admin-center/locale/en-US.ts @@ -163,12 +163,46 @@ export default { 'h5Admin.ops.fab': 'Ops', 'h5Admin.ops.hubTitle': 'Warehouse ops', - 'h5Admin.ops.hubHint': 'Arrival, inbound, outbound, pick, bag & board', + 'h5Admin.ops.hubHint': 'Arrival, inbound, putaway, relocate, outbound, pick, bag & board', 'h5Admin.ops.noPermission': 'No ops permission', 'h5Admin.ops.parcelArrival': 'Parcel arrival', 'h5Admin.ops.parcelArrivalDesc': 'Scan domestic tracking to arrive', 'h5Admin.ops.inbound': 'Inbound scan', 'h5Admin.ops.inboundDesc': 'Scan waybill and enter dimensions', + 'h5Admin.ops.putaway': 'Putaway scan', + 'h5Admin.ops.putawayDesc': 'Scan notice/box mark to receive & putaway', + 'h5Admin.ops.putaway.scanPlaceholder': 'Scan notice no. or box mark', + 'h5Admin.ops.putaway.lookup': 'Lookup', + 'h5Admin.ops.putaway.confirm': 'Confirm putaway', + 'h5Admin.ops.putaway.applyBin': 'Apply bin to all', + 'h5Admin.ops.putaway.pending': 'Pending putaway', + 'h5Admin.ops.putaway.emptyPending': 'No pending inbound notices', + 'h5Admin.ops.putaway.codeRequired': 'Scan or enter notice no. / box mark', + 'h5Admin.ops.putaway.binRequired': 'Bin required for lines with received qty', + 'h5Admin.ops.putaway.qtyInvalid': 'Received qty cannot be negative', + 'h5Admin.ops.putaway.success': 'Putaway succeeded', + 'h5Admin.ops.putaway.failed': 'Putaway failed', + 'h5Admin.ops.putaway.loadFailed': 'Load failed', + 'h5Admin.ops.putaway.selectBin': 'Select bin', + 'h5Admin.ops.putaway.plannedQty': 'Planned', + 'h5Admin.ops.putaway.receivedQty': 'Received', + 'h5Admin.ops.putaway.bin': 'Bin', + 'h5Admin.ops.relocate': 'Relocate', + 'h5Admin.ops.relocateDesc': 'Scan SKU then move between bins', + 'h5Admin.ops.relocate.scanPlaceholder': 'Scan or enter SKU code', + 'h5Admin.ops.relocate.lookup': 'Lookup', + 'h5Admin.ops.relocate.confirm': 'Confirm relocate', + 'h5Admin.ops.relocate.pickSku': 'Pick SKU', + 'h5Admin.ops.relocate.stockList': 'Warehouse stock', + 'h5Admin.ops.relocate.emptyStock': 'No stock', + 'h5Admin.ops.relocate.codeRequired': 'Scan or enter SKU code', + 'h5Admin.ops.relocate.notFound': 'No matching inventory', + 'h5Admin.ops.relocate.loadFailed': 'Load failed', + 'h5Admin.ops.relocate.sourceBin': 'Source bin', + 'h5Admin.ops.relocate.targetBin': 'Target bin', + 'h5Admin.ops.relocate.selectSource': 'Select source bin', + 'h5Admin.ops.relocate.selectTarget': 'Select target bin', + 'h5Admin.ops.relocate.qty': 'Qty', 'h5Admin.ops.outbound': 'Outbound scan', 'h5Admin.ops.outboundDesc': 'Scan waybill and verify weight', 'h5Admin.ops.fulfillPack': 'Fulfill pick', diff --git a/src/views/h5/admin-center/locale/zh-CN.ts b/src/views/h5/admin-center/locale/zh-CN.ts index c24d346..e3909c0 100644 --- a/src/views/h5/admin-center/locale/zh-CN.ts +++ b/src/views/h5/admin-center/locale/zh-CN.ts @@ -163,12 +163,46 @@ export default { 'h5Admin.ops.fab': '操作', 'h5Admin.ops.hubTitle': '仓操入口', - 'h5Admin.ops.hubHint': '到仓、入库、出库、拣货、装袋与打板', + 'h5Admin.ops.hubHint': '到仓、入库、上架、换库位、出库、拣货、装袋与打板', 'h5Admin.ops.noPermission': '暂无操作权限', 'h5Admin.ops.parcelArrival': '快递到仓', 'h5Admin.ops.parcelArrivalDesc': '扫国内快递单确认到仓', 'h5Admin.ops.inbound': '入库扫描', 'h5Admin.ops.inboundDesc': '扫运单入库并录入材积', + 'h5Admin.ops.putaway': '上架扫描', + 'h5Admin.ops.putawayDesc': '扫预报/箱唛确认收货上架', + 'h5Admin.ops.putaway.scanPlaceholder': '扫描预报单号或箱唛', + 'h5Admin.ops.putaway.lookup': '查询', + 'h5Admin.ops.putaway.confirm': '确认上架', + 'h5Admin.ops.putaway.applyBin': '库位应用到全部', + 'h5Admin.ops.putaway.pending': '待上架', + 'h5Admin.ops.putaway.emptyPending': '暂无待上架预报', + 'h5Admin.ops.putaway.codeRequired': '请扫描或输入预报单号 / 箱唛', + 'h5Admin.ops.putaway.binRequired': '有实收的明细必须选择库位', + 'h5Admin.ops.putaway.qtyInvalid': '实收数量不能为负', + 'h5Admin.ops.putaway.success': '上架成功', + 'h5Admin.ops.putaway.failed': '上架失败', + 'h5Admin.ops.putaway.loadFailed': '加载失败', + 'h5Admin.ops.putaway.selectBin': '选择库位', + 'h5Admin.ops.putaway.plannedQty': '预报', + 'h5Admin.ops.putaway.receivedQty': '实收', + 'h5Admin.ops.putaway.bin': '库位', + 'h5Admin.ops.relocate': '换库位', + 'h5Admin.ops.relocateDesc': '扫 SKU 选择源/目标库位调拨', + 'h5Admin.ops.relocate.scanPlaceholder': '扫描或输入 SKU 编码', + 'h5Admin.ops.relocate.lookup': '查询', + 'h5Admin.ops.relocate.confirm': '确认换库位', + 'h5Admin.ops.relocate.pickSku': '选择 SKU', + 'h5Admin.ops.relocate.stockList': '当前仓库存', + 'h5Admin.ops.relocate.emptyStock': '暂无库存', + 'h5Admin.ops.relocate.codeRequired': '请扫描或输入 SKU 编码', + 'h5Admin.ops.relocate.notFound': '未找到匹配库存', + 'h5Admin.ops.relocate.loadFailed': '加载失败', + 'h5Admin.ops.relocate.sourceBin': '源库位', + 'h5Admin.ops.relocate.targetBin': '目标库位', + 'h5Admin.ops.relocate.selectSource': '选择源库位', + 'h5Admin.ops.relocate.selectTarget': '选择目标库位', + 'h5Admin.ops.relocate.qty': '调拨数量', 'h5Admin.ops.outbound': '出库扫描', 'h5Admin.ops.outboundDesc': '扫运单出库并核对重量', 'h5Admin.ops.fulfillPack': '代发拣货', diff --git a/src/views/h5/admin-center/ops/putaway.vue b/src/views/h5/admin-center/ops/putaway.vue new file mode 100644 index 0000000..7829ec3 --- /dev/null +++ b/src/views/h5/admin-center/ops/putaway.vue @@ -0,0 +1,570 @@ + + + + + diff --git a/src/views/h5/admin-center/ops/relocate.vue b/src/views/h5/admin-center/ops/relocate.vue new file mode 100644 index 0000000..58a1629 --- /dev/null +++ b/src/views/h5/admin-center/ops/relocate.vue @@ -0,0 +1,517 @@ + + + + + diff --git a/src/views/h5/admin-center/workplace/index.vue b/src/views/h5/admin-center/workplace/index.vue index a9ac1d6..828d76d 100644 --- a/src/views/h5/admin-center/workplace/index.vue +++ b/src/views/h5/admin-center/workplace/index.vue @@ -11,19 +11,21 @@
-
- +
+
+ +
+
-
@@ -46,7 +48,7 @@
-
+
+ +
+
-
@@ -417,31 +421,104 @@ async function onTouchEnd() { } .h5-biz__top { - display: grid; - grid-template-columns: minmax(0, 1fr) auto auto; - align-items: center; + display: flex; + flex-direction: column; gap: 8px; + padding: 10px 12px; + border-radius: 12px; + background: #fff; + border: 1px solid rgba(26, 46, 56, 0.06); } -.h5-biz__identity { +.h5-biz__top-row { + display: flex; + align-items: center; + gap: 8px; min-width: 0; } +.h5-biz__identity { + flex: 1 1 auto; + min-width: 0; + + :deep(.banner) { + padding: 0; + } + + :deep(.banner-row) { + min-height: 0; + } + + :deep(.banner-hello) { + gap: 8px; + } + + :deep(.banner-hello__greet) { + font-size: 12px; + } + + :deep(.banner-hello__name) { + font-size: 15px; + } + + :deep(.banner-hello__clock-date), + :deep(.banner-hello__clock-sep) { + font-size: 11px; + } + + :deep(.banner-hello__clock-time) { + font-size: 12px; + } +} + .h5-biz__inbox { - justify-self: end; + width: 100%; + margin: 0 !important; + padding: 4px 6px 4px 10px !important; + border-radius: 10px !important; + background: rgba(15, 23, 42, 0.035) !important; + border: none !important; + + :deep(.wk-inbox__badge-label) { + font-size: 11px; + } + + :deep(.wk-inbox__title) { + font-size: 12px; + } + + /* 空态文案与「站内信」标签重复,H5 只保留入口 */ + :deep(p.wk-inbox__state) { + display: none; + } + + :deep(.wk-inbox__stage:not(:has(.wk-inbox__ticker))) { + flex: 1 1 auto; + } + + :deep(.wk-inbox__all) { + height: 26px; + padding: 0 10px; + border-radius: 999px; + font-size: 11px; + } + + :deep(.wk-inbox__nav) { + display: none; + } } .h5-biz__refresh { + flex: 0 0 auto; width: 36px; height: 36px; border: none; border-radius: 10px; - background: #fff; + background: rgba(15, 23, 42, 0.04); color: rgba(26, 46, 56, 0.55); display: inline-flex; align-items: center; justify-content: center; - box-shadow: 0 1px 2px rgba(26, 46, 56, 0.04); &:disabled { opacity: 0.5; @@ -512,32 +589,60 @@ async function onTouchEnd() { } .h5-biz__filters { + display: flex; + flex-direction: column; + gap: 8px; + min-width: 0; + padding: 10px; + border-radius: 12px; + background: #fff; + border: 1px solid rgba(26, 46, 56, 0.06); +} + +.h5-biz__filters-primary, +.h5-biz__filters-secondary { display: flex; align-items: center; gap: 8px; min-width: 0; } -.h5-biz__filters-scroll { +.h5-biz__filters-primary, +.h5-biz__filters-secondary { + :deep(.wp-seg) { + display: flex; + min-width: 0; + } + + :deep(.wp-seg__item) { + display: inline-flex; + align-items: center; + justify-content: center; + flex: 1 1 0; + min-height: 30px; + padding: 0 6px; + } +} + +.h5-biz__filters-primary :deep(.wp-seg) { flex: 1 1 auto; - min-width: 0; - display: flex; - gap: 6px; - overflow-x: auto; - -webkit-overflow-scrolling: touch; - padding-bottom: 2px; +} + +.h5-biz__filters-secondary :deep(.wp-seg) { + flex: 1 1 0; } .h5-biz__threshold-btn { flex: 0 0 auto; - height: 28px; - padding: 0 10px; + height: 30px; + padding: 0 12px; border-radius: 999px; border: 1px solid rgba(26, 46, 56, 0.1); - background: #fff; - color: rgba(26, 46, 56, 0.7); + background: #f7f8fa; + color: rgba(26, 46, 56, 0.72); font-size: 12px; font-weight: 600; + white-space: nowrap; } .h5-biz__map-card { diff --git a/src/views/h5/customer-center/components/H5AddressSheet.vue b/src/views/h5/customer-center/components/H5AddressSheet.vue index 911b3d6..312914d 100644 --- a/src/views/h5/customer-center/components/H5AddressSheet.vue +++ b/src/views/h5/customer-center/components/H5AddressSheet.vue @@ -136,6 +136,7 @@ :options="provinceOptions" :loading="provinceLoading" allow-search + allow-create allow-clear :disabled="!form.countryCode" @change="onProvinceChange" @@ -148,8 +149,9 @@ :options="cityOptions" :loading="cityLoading" allow-search + allow-create allow-clear - :disabled="!form.province" + :disabled="!form.countryCode" /> @@ -270,6 +272,16 @@ function toSelectOptions(list: CountryRegionOption[]) { return list.map((x) => ({ label: x.label || x.value, value: x.value })); } +/** 主数据缺失时保留已有/手填值,避免回显空白 */ +function ensureOption( + options: Array<{ label: string; value: string }>, + value?: string, +) { + const v = String(value || '').trim(); + if (!v || options.some((x) => x.value === v)) return options; + return [...options, { label: v, value: v }]; +} + async function loadCountryOptions() { countryLoading.value = true; try { @@ -293,14 +305,16 @@ async function loadProvinceOptions(countryCode: string, keepValue = false) { try { provinceRaw.value = countryCode ? await getCountryProvinceOptions(countryCode) : []; provinceOptions.value = toSelectOptions(provinceRaw.value); - if (!keepValue || !provinceOptions.value.some((x) => x.value === form.province)) { + if (!keepValue) { form.province = ''; form.city = ''; cityOptions.value = []; + } else { + provinceOptions.value = ensureOption(provinceOptions.value, form.province); } } catch { provinceRaw.value = []; - provinceOptions.value = []; + provinceOptions.value = keepValue ? ensureOption([], form.province) : []; if (!keepValue) { form.province = ''; form.city = ''; @@ -318,11 +332,13 @@ async function loadCityOptions(provinceName: string, keepValue = false) { cityOptions.value = province ? toSelectOptions(await getCountryCityOptions(province.id)) : []; - if (!keepValue || !cityOptions.value.some((x) => x.value === form.city)) { + if (!keepValue) { form.city = ''; + } else { + cityOptions.value = ensureOption(cityOptions.value, form.city); } } catch { - cityOptions.value = []; + cityOptions.value = keepValue ? ensureOption([], form.city) : []; if (!keepValue) form.city = ''; } finally { cityLoading.value = false; diff --git a/src/views/home/workplace/biz-ops/ChinaOriginMap.vue b/src/views/home/workplace/biz-ops/ChinaOriginMap.vue index 04a73c5..f7942ad 100644 --- a/src/views/home/workplace/biz-ops/ChinaOriginMap.vue +++ b/src/views/home/workplace/biz-ops/ChinaOriginMap.vue @@ -21,7 +21,15 @@ @click="toggleHighlight(item.key)" > {{ item.label }} - {{ item.value }} + + {{ item.value }} + @@ -58,13 +66,25 @@ onMounted(async () => { ready.value = true }) +type MetricTone = 'up' | 'warn' + const metricItems = computed(() => { const s = props.slice.customerSummary return [ { key: 'total' as const, label: '客户总数', value: formatCount(s.total) }, - { key: 'neu' as const, label: '新增', value: `+${formatCount(s.neu)}` }, + { + key: 'neu' as const, + label: '新增', + value: `+${formatCount(s.neu)}`, + tone: (s.neu > 0 ? 'up' : undefined) as MetricTone | undefined, + }, { key: 'online' as const, label: '在线', value: formatCount(s.online) }, - { key: 'idle7' as const, label: '超7天', value: formatCount(s.idle7) }, + { + key: 'idle7' as const, + label: '超7天', + value: formatCount(s.idle7), + tone: (s.idle7 > 0 ? 'warn' : undefined) as MetricTone | undefined, + }, ] }) @@ -319,6 +339,14 @@ function onClick(params: any) { font-variant-numeric: tabular-nums; color: #1a2e38; transition: color 0.15s ease; + + &.is-up { + color: #0f766e; + } + + &.is-warn { + color: #c45c4a; + } } .china-map.is-dense { @@ -331,27 +359,59 @@ function onClick(params: any) { } } + /* 指标条改文档流,避免盖住华南;四等分便于点按切换热力 */ .china-map__metrics { - left: 6px; - right: 6px; - bottom: 6px; - width: auto; - overflow-x: auto; - -webkit-overflow-scrolling: touch; - padding: 4px 2px; + position: static; + left: auto; + right: auto; + bottom: auto; + width: 100%; + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: 4px; + margin-top: 6px; + padding: 4px; + border-radius: 10px; + background: #f7f8fa; + border: 1px solid rgba(26, 46, 56, 0.06); + box-shadow: none; + overflow: visible; } .china-map__metric { - padding: 2px 8px; - flex: 0 0 auto; + align-items: center; + justify-content: center; + gap: 2px; + min-height: 40px; + padding: 6px 4px; + border-radius: 8px; + flex: none; + + & + &::before { + display: none; + } + + &:active, + &.is-active { + background: #fff; + box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-primary-color, #1d7281) 22%, transparent); + + .china-map__metric-v { + color: var(--app-primary-color, #1d7281); + } + } } .china-map__metric-k { - font-size: 9px; + font-size: 10px; + line-height: 1.2; + text-align: center; } .china-map__metric-v { - font-size: 11px; + font-size: 14px; + line-height: 1.2; + text-align: center; } } diff --git a/src/views/user/senderAddress/index.vue b/src/views/user/senderAddress/index.vue index 409f6a0..d1ca0df 100644 --- a/src/views/user/senderAddress/index.vue +++ b/src/views/user/senderAddress/index.vue @@ -103,6 +103,16 @@ function toSelectOptions(list: CountryRegionOption[]) { return list.map((x) => ({ label: x.label || x.value, value: x.value })) } +/** 主数据缺失时保留已有/手填值,避免回显空白 */ +function ensureOption( + options: Array<{ label: string; value: string }>, + value?: string, +) { + const v = String(value || '').trim() + if (!v || options.some((x) => x.value === v)) return options + return [...options, { label: v, value: v }] +} + async function loadCountryOptions() { countryLoading.value = true try { @@ -126,14 +136,18 @@ async function loadProvinceOptions(countryCode: string, keepValue = false) { try { provinceRaw.value = countryCode ? await getCountryProvinceOptions(countryCode) : [] provinceOptions.value = toSelectOptions(provinceRaw.value) - if (!keepValue || !provinceOptions.value.some((x) => x.value === formModel.province)) { + if (!keepValue) { formModel.province = '' formModel.city = '' cityOptions.value = [] + } else { + provinceOptions.value = ensureOption(provinceOptions.value, formModel.province) } } catch { provinceRaw.value = [] - provinceOptions.value = [] + provinceOptions.value = keepValue + ? ensureOption([], formModel.province) + : [] if (!keepValue) { formModel.province = '' formModel.city = '' @@ -151,11 +165,13 @@ async function loadCityOptions(provinceName: string, keepValue = false) { cityOptions.value = province ? toSelectOptions(await getCountryCityOptions(province.id)) : [] - if (!keepValue || !cityOptions.value.some((x) => x.value === formModel.city)) { + if (!keepValue) { formModel.city = '' + } else { + cityOptions.value = ensureOption(cityOptions.value, formModel.city) } } catch { - cityOptions.value = [] + cityOptions.value = keepValue ? ensureOption([], formModel.city) : [] if (!keepValue) formModel.city = '' } finally { cityLoading.value = false @@ -350,6 +366,10 @@ function validateForm() { $baseMessage(t('user.senderAddress.message.senderNameRequired'), 'warning') return false } + if (!String(formModel.phone || '').trim()) { + $baseMessage(t('user.senderAddress.message.phoneRequired'), 'warning') + return false + } if (!String(formModel.countryCode || '').trim()) { $baseMessage(t('user.senderAddress.message.countryRequired'), 'warning') return false @@ -577,7 +597,7 @@ onMounted(() => { - + { - + { - +