From 8f3a41956e3c2db5e6229e6fc1db9756b695b174 Mon Sep 17 00:00:00 2001 From: zzh <1368735060@qq.com> Date: Sat, 21 Nov 2026 12:22:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BC=80=E7=A5=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=B8=8E=E5=93=81=E7=89=8C=E6=96=87=E6=A1=88=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=EF=BC=88PC/H5=20=E7=9F=AD=E5=90=8D=E5=85=A8=E7=A7=B0=E5=90=8C?= =?UTF-8?q?=E6=BA=90=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- index.html | 53 +- src/api/finance/invoice.ts | 450 ++++++ src/api/system/otherConfig.ts | 21 + .../EdiAssistant/AiAdvisorShell.vue | 5 +- src/components/agent-side-rail/index.vue | 7 +- src/components/customer-side-rail/index.vue | 7 +- src/components/top-nav/index.vue | 9 +- src/composables/useSystemConfig.ts | 7 +- src/constants/pageButtonCatalog.ts | 19 + src/locale/edi/en-US.ts | 6 +- src/locale/edi/zh-CN.ts | 6 +- src/locale/en-US.ts | 142 +- src/locale/marketing/en-US.ts | 2 +- src/locale/marketing/zh-CN.ts | 6 +- src/locale/zh-CN.ts | 142 +- src/router/guard/permission.ts | 1 + src/router/index.ts | 11 + src/router/routes/newModules/finance.ts | 13 + src/router/routes/newModules/user.ts | 16 + src/utils/agentPortalCopy.ts | 4 +- src/utils/brandCopy.ts | 111 ++ src/utils/brandLogo.ts | 43 +- src/utils/inviteLink.ts | 4 +- src/utils/login-portal.ts | 2 + src/utils/menu-i18n.ts | 2 + src/utils/menu-icon.ts | 2 + src/utils/route-name-mapper.ts | 4 + src/views/finance/invoiceManage/index.vue | 1270 +++++++++++++++++ src/views/h5/admin-center/layout.vue | 3 +- src/views/h5/admin-center/locale/en-US.ts | 2 +- src/views/h5/admin-center/locale/zh-CN.ts | 2 +- src/views/h5/admin-center/login/index.vue | 5 +- .../h5/customer-center/invoice/index.vue | 784 ++++++++++ src/views/h5/customer-center/layout.vue | 3 +- src/views/h5/customer-center/locale/en-US.ts | 22 +- src/views/h5/customer-center/locale/zh-CN.ts | 22 +- src/views/h5/customer-center/login/index.vue | 9 +- src/views/h5/customer-center/me/index.vue | 12 + src/views/login/components/LoginHero.vue | 7 +- src/views/login/components/LoginLockLogo.vue | 5 +- .../login/components/pwd-login/index.vue | 8 +- src/views/login/index.vue | 5 +- src/views/login/locale/en-US.ts | 10 +- src/views/login/locale/zh-CN.ts | 10 +- src/views/register/index.vue | 10 +- src/views/register/locale/en-US.ts | 2 +- src/views/register/locale/zh-CN.ts | 6 +- src/views/site/SiteAdvisorShell.vue | 5 +- src/views/site/SiteHeader.vue | 7 +- src/views/site/SiteMessageCard.vue | 5 +- src/views/site/index.vue | 23 +- src/views/system/otherConfig/index.vue | 453 ++++-- src/views/user/invoice/index.vue | 977 +++++++++++++ 53 files changed, 4564 insertions(+), 198 deletions(-) create mode 100644 src/api/finance/invoice.ts create mode 100644 src/utils/brandCopy.ts create mode 100644 src/views/finance/invoiceManage/index.vue create mode 100644 src/views/h5/customer-center/invoice/index.vue create mode 100644 src/views/user/invoice/index.vue diff --git a/index.html b/index.html index b03def7..8e14db4 100644 --- a/index.html +++ b/index.html @@ -87,16 +87,24 @@ root.style.setProperty('--ai-bg', pageBg); root.style.setProperty('--ai-canvas', pageBg); try { - /* 运营端 /h5/admin 勿复用客户中心标题,避免浏览器顶栏串文案 */ + /* 运营端 /h5/admin 勿复用客户中心标题,避免浏览器顶栏串文案;短名优先读本地品牌缓存 */ + var brandName = 'BCD'; + try { + var brandRaw = localStorage.getItem('oms_brand_copy'); + if (brandRaw) { + var brandObj = JSON.parse(brandRaw); + if (brandObj && brandObj.navName) brandName = String(brandObj.navName); + } + } catch (eBrand) {} document.title = isAdminH5 ? isEn - ? 'BCD Ops Center' - : 'BCD运营中心' + ? brandName + ' Ops Center' + : brandName + '运营中心' : isH5 ? isEn - ? 'BCD Customer Center' - : 'BCD客户中心' - : 'BCD I Faster & Simpler'; + ? brandName + ' Customer Center' + : brandName + '客户中心' + : brandName + ' I Faster & Simpler'; } catch (e2) {} if (path === '/login') { var plane = document.createElement('link'); @@ -113,6 +121,39 @@ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" /> BCD I Faster & Simpler + diff --git a/src/api/finance/invoice.ts b/src/api/finance/invoice.ts new file mode 100644 index 0000000..577a7ff --- /dev/null +++ b/src/api/finance/invoice.ts @@ -0,0 +1,450 @@ +import { axiosInstance } from '@/api/rbac' +import { assertBusinessOk, omsUrl, parseListPayload, unwrapData } from '@/api/oms/common' + +export const INVOICE_STATUS = { + Draft: 'draft', + PendingApproval: 'pendingApproval', + Approved: 'approved', + Issued: 'issued', + Rejected: 'rejected', + Voided: 'voided', + RedFlushed: 'redFlushed', +} as const + +export const INVOICE_SOURCE_TYPE = { + ParcelOrder: 'parcelOrder', + PickupOrder: 'pickupOrder', + StorageRent: 'storageRent', +} as const + +export const INVOICE_TYPE = { + Normal: 'normal', + Special: 'special', +} as const + +export const INVOICE_MEDIUM = { + Electronic: 'electronic', + Paper: 'paper', +} as const + +export const DEFAULT_INVOICE_TAX_RATE = 0.06 + +export interface InvoiceProfile { + id: number + customerId: number + titleName: string + taxNo: string + addressPhone?: string + bankNameAccount?: string + isDefault: boolean + remark?: string + createTime?: string + updateTime?: string +} + +export interface InvoiceProfileSavePayload { + id?: number + customerId?: number + titleName: string + taxNo: string + addressPhone?: string + bankNameAccount?: string + isDefault?: boolean + remark?: string +} + +export interface InvoiceSelectableItem { + sourceType: string + sourceTypeName: string + sourceId: number + sourceNo: string + baseAmount: number + occupiedAmount: number + remainingAmount: number + currency: string + paidTime?: string +} + +export interface InvoiceSelectableParams { + customerId?: number + sourceType?: string + keyword?: string + page?: number + pageSize?: number +} + +export interface InvoiceApplyLine { + id?: number + sourceType: string + sourceTypeName?: string + sourceId: number + sourceNo: string + amount: number + currency?: string + remark?: string +} + +export interface InvoiceApply { + id: number + applyNo: string + customerId: number + customerCode?: string + customerName?: string + invoiceType: string + invoiceTypeName?: string + medium: string + mediumName?: string + titleName: string + taxNo: string + addressPhone?: string + bankNameAccount?: string + amountTotal: number + taxRate: number + currency: string + status: string + statusName?: string + applicantSource?: string + invoiceCode?: string + invoiceNumber?: string + invoiceDate?: string + invoicePdfUrl?: string + remark?: string + approvalInstanceId?: number | null + approvalInstanceNo?: string + approvalPending: boolean + rejectReason?: string + issueTime?: string + issueBy?: string + createTime?: string + updateTime?: string + decision?: string + message?: string + lines?: InvoiceApplyLine[] +} + +export interface InvoiceApplyListParams { + page?: number + pageSize?: number + customerId?: number + status?: string + invoiceType?: string + keyword?: string + startTime?: string + endTime?: string +} + +export interface InvoiceApplyLineInput { + sourceType: string + sourceId: number + amount: number + remark?: string +} + +export interface InvoiceApplyCreatePayload { + customerId?: number + invoiceType: string + medium: string + profileId?: number + titleName?: string + taxNo?: string + addressPhone?: string + bankNameAccount?: string + taxRate?: number + remark?: string + submit?: boolean + lines: InvoiceApplyLineInput[] +} + +export interface InvoiceApplyUpdatePayload extends InvoiceApplyCreatePayload { + id: number +} + +export interface InvoiceIssuePayload { + id: number + invoiceCode?: string + invoiceNumber: string + invoiceDate?: string + invoicePdfUrl?: string + remark?: string +} + +export type InvoiceExportParams = Omit + +function pickRaw(item: any, ...keys: string[]) { + for (const key of keys) { + const value = item?.[key] + if (value !== undefined && value !== null) return value + } + return undefined +} + +function toNumber(value: unknown, fallback = 0) { + const n = Number(value) + return Number.isFinite(n) ? n : fallback +} + +function toOptionalNumber(value: unknown): number | null { + const n = Number(value) + return Number.isFinite(n) && n > 0 ? n : null +} + +export function roundInvoiceMoney(value: number) { + return Math.round((Number(value) || 0) * 100) / 100 +} + +export function invoiceLineKey(sourceType: string, sourceId: number) { + return `${sourceType}:${sourceId}` +} + +export function mapInvoiceProfile(item: any): InvoiceProfile { + return { + id: toNumber(pickRaw(item, 'id', 'Id')), + customerId: toNumber(pickRaw(item, 'customerId', 'CustomerId')), + titleName: String(pickRaw(item, 'titleName', 'TitleName') ?? ''), + taxNo: String(pickRaw(item, 'taxNo', 'TaxNo') ?? ''), + addressPhone: pickRaw(item, 'addressPhone', 'AddressPhone') || undefined, + bankNameAccount: pickRaw(item, 'bankNameAccount', 'BankNameAccount') || undefined, + isDefault: Boolean(pickRaw(item, 'isDefault', 'IsDefault')), + remark: pickRaw(item, 'remark', 'Remark') || undefined, + createTime: pickRaw(item, 'createTime', 'CreateTime') || undefined, + updateTime: pickRaw(item, 'updateTime', 'UpdateTime') || undefined, + } +} + +export function mapInvoiceSelectableItem(item: any): InvoiceSelectableItem { + return { + sourceType: String(pickRaw(item, 'sourceType', 'SourceType') ?? ''), + sourceTypeName: String(pickRaw(item, 'sourceTypeName', 'SourceTypeName') ?? ''), + sourceId: toNumber(pickRaw(item, 'sourceId', 'SourceId')), + sourceNo: String(pickRaw(item, 'sourceNo', 'SourceNo') ?? ''), + baseAmount: toNumber(pickRaw(item, 'baseAmount', 'BaseAmount')), + occupiedAmount: toNumber(pickRaw(item, 'occupiedAmount', 'OccupiedAmount')), + remainingAmount: toNumber(pickRaw(item, 'remainingAmount', 'RemainingAmount')), + currency: String(pickRaw(item, 'currency', 'Currency') ?? 'CNY'), + paidTime: pickRaw(item, 'paidTime', 'PaidTime') || undefined, + } +} + +export function mapInvoiceApplyLine(item: any): InvoiceApplyLine { + return { + id: toOptionalNumber(pickRaw(item, 'id', 'Id')) || undefined, + sourceType: String(pickRaw(item, 'sourceType', 'SourceType') ?? ''), + sourceTypeName: pickRaw(item, 'sourceTypeName', 'SourceTypeName') || undefined, + sourceId: toNumber(pickRaw(item, 'sourceId', 'SourceId')), + sourceNo: String(pickRaw(item, 'sourceNo', 'SourceNo') ?? ''), + amount: toNumber(pickRaw(item, 'amount', 'Amount')), + currency: pickRaw(item, 'currency', 'Currency') || 'CNY', + remark: pickRaw(item, 'remark', 'Remark') || undefined, + } +} + +export function mapInvoiceApply(item: any): InvoiceApply { + const approvalId = toOptionalNumber(pickRaw(item, 'approvalInstanceId', 'ApprovalInstanceId')) + const linesRaw = pickRaw(item, 'lines', 'Lines') + return { + id: toNumber(pickRaw(item, 'id', 'Id')), + applyNo: String(pickRaw(item, 'applyNo', 'ApplyNo') ?? ''), + customerId: toNumber(pickRaw(item, 'customerId', 'CustomerId')), + customerCode: pickRaw(item, 'customerCode', 'CustomerCode') || undefined, + customerName: pickRaw(item, 'customerName', 'CustomerName') || undefined, + invoiceType: String(pickRaw(item, 'invoiceType', 'InvoiceType') ?? ''), + invoiceTypeName: pickRaw(item, 'invoiceTypeName', 'InvoiceTypeName') || undefined, + medium: String(pickRaw(item, 'medium', 'Medium') ?? ''), + mediumName: pickRaw(item, 'mediumName', 'MediumName') || undefined, + titleName: String(pickRaw(item, 'titleName', 'TitleName') ?? ''), + taxNo: String(pickRaw(item, 'taxNo', 'TaxNo') ?? ''), + addressPhone: pickRaw(item, 'addressPhone', 'AddressPhone') || undefined, + bankNameAccount: pickRaw(item, 'bankNameAccount', 'BankNameAccount') || undefined, + amountTotal: toNumber(pickRaw(item, 'amountTotal', 'AmountTotal')), + taxRate: toNumber(pickRaw(item, 'taxRate', 'TaxRate'), DEFAULT_INVOICE_TAX_RATE), + currency: String(pickRaw(item, 'currency', 'Currency') ?? 'CNY'), + status: String(pickRaw(item, 'status', 'Status') ?? ''), + statusName: pickRaw(item, 'statusName', 'StatusName') || undefined, + applicantSource: pickRaw(item, 'applicantSource', 'ApplicantSource') || undefined, + invoiceCode: pickRaw(item, 'invoiceCode', 'InvoiceCode') || undefined, + invoiceNumber: pickRaw(item, 'invoiceNumber', 'InvoiceNumber') || undefined, + invoiceDate: pickRaw(item, 'invoiceDate', 'InvoiceDate') || undefined, + invoicePdfUrl: pickRaw(item, 'invoicePdfUrl', 'InvoicePdfUrl') || undefined, + remark: pickRaw(item, 'remark', 'Remark') || undefined, + approvalInstanceId: approvalId, + approvalInstanceNo: String(pickRaw(item, 'approvalInstanceNo', 'ApprovalInstanceNo') ?? '').trim() || undefined, + approvalPending: Boolean(pickRaw(item, 'approvalPending', 'ApprovalPending')), + rejectReason: pickRaw(item, 'rejectReason', 'RejectReason') || undefined, + issueTime: pickRaw(item, 'issueTime', 'IssueTime') || undefined, + issueBy: pickRaw(item, 'issueBy', 'IssueBy') || undefined, + createTime: pickRaw(item, 'createTime', 'CreateTime') || undefined, + updateTime: pickRaw(item, 'updateTime', 'UpdateTime') || undefined, + decision: pickRaw(item, 'decision', 'Decision') || undefined, + message: pickRaw(item, 'message', 'Message') || undefined, + lines: Array.isArray(linesRaw) ? linesRaw.map(mapInvoiceApplyLine) : undefined, + } +} + +/** 编辑草稿时把本单占用加回可开票余额,避免来源从 selectable 消失 */ +export function mergeSelectableWithApplyLines( + items: InvoiceSelectableItem[], + lines: InvoiceApplyLine[] = [], +): InvoiceSelectableItem[] { + const map = new Map() + for (const item of items) { + map.set(invoiceLineKey(item.sourceType, item.sourceId), { ...item }) + } + for (const line of lines) { + const key = invoiceLineKey(line.sourceType, line.sourceId) + const existing = map.get(key) + if (existing) { + existing.remainingAmount = roundInvoiceMoney(existing.remainingAmount + line.amount) + } else { + map.set(key, { + sourceType: line.sourceType, + sourceTypeName: line.sourceTypeName || line.sourceType, + sourceId: line.sourceId, + sourceNo: line.sourceNo, + baseAmount: line.amount, + occupiedAmount: 0, + remainingAmount: line.amount, + currency: line.currency || 'CNY', + }) + } + } + return Array.from(map.values()) +} + +function buildListQuery(params: InvoiceApplyListParams) { + return { + page: params.page, + pageSize: params.pageSize, + customerId: params.customerId || undefined, + status: params.status && params.status !== 'all' ? params.status : undefined, + invoiceType: params.invoiceType && params.invoiceType !== 'all' ? params.invoiceType : undefined, + keyword: params.keyword?.trim() || undefined, + startTime: params.startTime || undefined, + endTime: params.endTime || undefined, + } +} + +/** GET /finance/invoice/profile/list */ +export async function getInvoiceProfileList(customerId?: number) { + const res = await axiosInstance.get(omsUrl('/finance/invoice/profile/list'), { + params: { customerId: customerId || undefined }, + }) + const data = unwrapData(res.data) + const list = Array.isArray(data) ? data : data?.items ?? data?.Items ?? [] + return (Array.isArray(list) ? list : []).map(mapInvoiceProfile) +} + +/** POST /finance/invoice/profile/save */ +export async function saveInvoiceProfile(body: InvoiceProfileSavePayload) { + const res = await axiosInstance.post(omsUrl('/finance/invoice/profile/save'), body) + return mapInvoiceProfile(unwrapData(res.data)) +} + +/** POST /finance/invoice/profile/delete */ +export async function deleteInvoiceProfile(id: number) { + const res = await axiosInstance.post(omsUrl('/finance/invoice/profile/delete'), { id }) + assertBusinessOk(res.data) +} + +/** GET /finance/invoice/selectable */ +export async function getInvoiceSelectable(params: InvoiceSelectableParams) { + const res = await axiosInstance.get(omsUrl('/finance/invoice/selectable'), { + params: { + customerId: params.customerId || undefined, + sourceType: params.sourceType || undefined, + keyword: params.keyword?.trim() || undefined, + page: params.page || 1, + pageSize: params.pageSize || 50, + }, + }) + const payload = parseListPayload(res.data) + return { + items: (payload.items || []).map(mapInvoiceSelectableItem), + total: payload.total, + } +} + +/** GET /finance/invoice/list */ +export async function getInvoiceApplyList(params: InvoiceApplyListParams) { + const res = await axiosInstance.get(omsUrl('/finance/invoice/list'), { + params: buildListQuery(params), + }) + const payload = parseListPayload(res.data) + return { + items: (payload.items || []).map(mapInvoiceApply), + total: payload.total, + } +} + +/** GET /finance/invoice/detail */ +export async function getInvoiceApplyDetail(id: number) { + const res = await axiosInstance.get(omsUrl('/finance/invoice/detail'), { params: { id } }) + return mapInvoiceApply(unwrapData(res.data)) +} + +/** POST /finance/invoice/apply */ +export async function createInvoiceApply(body: InvoiceApplyCreatePayload) { + const res = await axiosInstance.post(omsUrl('/finance/invoice/apply'), body) + return mapInvoiceApply(unwrapData(res.data)) +} + +/** POST /finance/invoice/update */ +export async function updateInvoiceApply(body: InvoiceApplyUpdatePayload) { + const res = await axiosInstance.post(omsUrl('/finance/invoice/update'), body) + return mapInvoiceApply(unwrapData(res.data)) +} + +/** POST /finance/invoice/submit */ +export async function submitInvoiceApply(id: number) { + const res = await axiosInstance.post(omsUrl('/finance/invoice/submit'), { id }) + return mapInvoiceApply(unwrapData(res.data)) +} + +/** POST /finance/invoice/issue */ +export async function issueInvoiceApply(body: InvoiceIssuePayload) { + const res = await axiosInstance.post(omsUrl('/finance/invoice/issue'), body) + return mapInvoiceApply(unwrapData(res.data)) +} + +/** POST /finance/invoice/void */ +export async function voidInvoiceApply(id: number, remark?: string) { + const res = await axiosInstance.post(omsUrl('/finance/invoice/void'), { + id, + remark: remark?.trim() || undefined, + }) + return mapInvoiceApply(unwrapData(res.data)) +} + +/** GET /finance/invoice/export → Excel 文件流 */ +export async function exportInvoiceApplies(params: InvoiceExportParams) { + const res = await axiosInstance.get(omsUrl('/finance/invoice/export'), { + params: buildListQuery(params), + responseType: 'blob', + }) + const blob = res.data as Blob + const ct = (res.headers['content-type'] || '').toString() + if (ct.includes('application/json')) { + const text = await blob.text() + try { + const json = JSON.parse(text) + throw new Error(json.msg ?? json.message ?? json.Message ?? '导出失败') + } catch (e: any) { + if (e?.message && e.message !== '导出失败') throw e + throw new Error(text || '导出失败') + } + } + const disposition = (res.headers['content-disposition'] || '').toString() + let fileName = `invoice-applies-${new Date().toISOString().slice(0, 10)}.xlsx` + const match = disposition.match(/filename\*?=(?:UTF-8'')?["']?([^"';]+)/i) + if (match?.[1]) { + fileName = decodeURIComponent(match[1].trim()) + } + const url = URL.createObjectURL(blob) + const a = document.createElement('a') + a.href = url + a.download = fileName.endsWith('.xlsx') ? fileName : `${fileName}.xlsx` + a.style.display = 'none' + document.body.appendChild(a) + a.click() + document.body.removeChild(a) + URL.revokeObjectURL(url) +} diff --git a/src/api/system/otherConfig.ts b/src/api/system/otherConfig.ts index 41b0c2e..0866d47 100644 --- a/src/api/system/otherConfig.ts +++ b/src/api/system/otherConfig.ts @@ -93,6 +93,27 @@ export interface BrandLogoDto { mascotUrl?: string } +export interface BrandCopyDto { + navName?: string + navFullName?: string + aiWelcomeTitleZh?: string + aiWelcomeTitleShortZh?: string + aiWelcomeTitleEn?: string + aiWelcomeTitleShortEn?: string +} + +/** 获取品牌文案(匿名可读;对象存储 JSON,非数据库) */ +export async function getBrandCopy() { + const res = await axiosInstance.get(omsUrl('/system/other-config/brand-copy')) + return unwrapData(res.data) +} + +/** 保存品牌文案到对象存储 */ +export async function saveBrandCopy(body: BrandCopyDto) { + const res = await axiosInstance.post(omsUrl('/system/other-config/brand-copy/save'), body) + return unwrapData(res.data) +} + /** 获取品牌 Logo(系统顶栏 / 官网 / 标签 / 吉祥物)可访问地址 */ export async function getBrandLogo() { const res = await axiosInstance.get(omsUrl('/system/other-config/brand-logo')) diff --git a/src/components/EdiAssistant/AiAdvisorShell.vue b/src/components/EdiAssistant/AiAdvisorShell.vue index 4c9cd22..62cc21a 100644 --- a/src/components/EdiAssistant/AiAdvisorShell.vue +++ b/src/components/EdiAssistant/AiAdvisorShell.vue @@ -493,6 +493,7 @@ import { useRbacUserStore } from '@/store/modules/rbac-user'; import { isMobileUserAgent, isWeChatBrowser } from '@/utils/device'; import { openWecomKf } from '@/utils/wecomKf'; import { resolveTextModelId } from '@/views/system/aiAssistant/providerCatalog'; +import { brandCopy } from '@/utils/brandCopy'; import EdiAvatar from './EdiAvatar.vue'; import EdiChatDialog from './EdiChatDialog.vue'; import EdiComposer from './EdiComposer.vue'; @@ -1171,7 +1172,7 @@ function ensureWelcomeMessage() { role: 'assistant', content: isOpsAudience.value ? t('ediAssistant.ops.welcomeMsg') - : t('ediAssistant.welcomeMsg'), + : t('ediAssistant.welcomeMsg', { name: brandCopy.navName }), }); saveThreads(); } @@ -1286,7 +1287,7 @@ function resolveTagReply(tagId: string) { return t('ediAssistant.trackWaybillDemo', { no: waybillDisplayNo.value }); } if (def.track) return t('ediAssistant.trackHint'); - if (def.replyKey) return t(def.replyKey); + if (def.replyKey) return t(def.replyKey, { name: brandCopy.navName }); return t('ediAssistant.emptyReply'); } diff --git a/src/components/agent-side-rail/index.vue b/src/components/agent-side-rail/index.vue index c4ef298..1a382fa 100644 --- a/src/components/agent-side-rail/index.vue +++ b/src/components/agent-side-rail/index.vue @@ -17,13 +17,13 @@ @@ -289,6 +289,7 @@ import { openWindow, regexUrl } from '@/utils'; import { MenuService, AuthService } from '@/api/rbac'; import type { MenuTreeDto } from '@/api/rbac'; import { brandLogoImages } from '@/utils/brandLogo'; +import { brandCopy } from '@/utils/brandCopy'; import { initHiprintClientState, setHiprintClientEnabled, diff --git a/src/composables/useSystemConfig.ts b/src/composables/useSystemConfig.ts index f5d91b7..6845aef 100644 --- a/src/composables/useSystemConfig.ts +++ b/src/composables/useSystemConfig.ts @@ -1,4 +1,5 @@ import { ref } from 'vue'; +import { brandCopy } from '@/utils/brandCopy'; // RBAC 系统暂不使用系统配置接口 // import { sysSysInfoGet } from '@/api/SimpleAdmin/common'; @@ -22,12 +23,12 @@ export function useSystemConfig() { const fetchSysInfo = async () => { try { loading.value = true; - // RBAC 系统使用默认配置 + // RBAC 系统使用默认配置(短名/全称跟品牌文案) const defaultConfig = { - SYS_NAME: 'BCD', + SYS_NAME: brandCopy.navName, SYS_VERSION: 'v1.0.0', SYS_LOGO: '/src/assets/logo.png', - SYS_FULL_NAME: 'Business & Customer & Delivery', + SYS_FULL_NAME: brandCopy.navFullName, }; sysInfo.value = defaultConfig; logoUrl.value = defaultConfig.SYS_LOGO; diff --git a/src/constants/pageButtonCatalog.ts b/src/constants/pageButtonCatalog.ts index b93a35c..f288264 100644 --- a/src/constants/pageButtonCatalog.ts +++ b/src/constants/pageButtonCatalog.ts @@ -198,6 +198,8 @@ export const PERMISSION_ACTION_LABELS: Record = { OrderNow: '立刻下单', SavePermissions: '保存权限', SelectAll: '全选', + Issue: '开具', + Void: '作废', DeselectAll: '取消全选', ExpandAll: '全部展开', CollapseAll: '全部收起', @@ -345,6 +347,8 @@ export const PAGE_BUTTON_PARENT_ALIASES: Record = { 'User.Marketing.Member': 'User.Marketing.Member', 'User.Marketing.Coupons': 'User.Marketing.Coupons', 'User.Marketing.Commission': 'User.Marketing.Commission', + 'User.Invoice': 'User.Invoice', + 'Finance.InvoiceManage': 'Finance.InvoiceManage', 'Kb.Category.Query': 'Knowledge.Category', 'Kb.Article.Query': 'Knowledge.Article', 'Knowledge.Category.Query': 'Knowledge.Category', @@ -932,6 +936,11 @@ const CORE_GROUPS: PageButtonGroup[] = [ { code: 'Transfer', name: '转余额' }, { code: 'Withdraw', name: '提现' }, ]), + B('User.Invoice', [ + { code: 'Query', name: '查询' }, + { code: 'Create', name: '申请开票' }, + { code: 'Submit', name: '提交' }, + ]), // ── 财务 ── B('Finance.Analysis', [ @@ -960,6 +969,16 @@ const CORE_GROUPS: PageButtonGroup[] = [ { code: 'Reset', name: '重置' }, { code: 'Export', name: '导出' }, ]), + B('Finance.InvoiceManage', [ + { code: 'Query', name: '查询' }, + { code: 'Search', name: '搜索' }, + { code: 'Reset', name: '重置' }, + { code: 'Export', name: '导出' }, + { code: 'Create', name: '新增' }, + { code: 'Submit', name: '提交' }, + { code: 'Issue', name: '开具' }, + { code: 'Void', name: '作废' }, + ]), // ── 营销 ── B('Marketing.Analysis', [ diff --git a/src/locale/edi/en-US.ts b/src/locale/edi/en-US.ts index d18a89c..2fa72f3 100644 --- a/src/locale/edi/en-US.ts +++ b/src/locale/edi/en-US.ts @@ -15,7 +15,7 @@ export default { 'ediAssistant.greet.night': 'Still up late', 'ediAssistant.quickLabel': 'Try asking', 'ediAssistant.welcomeMsg': - "Hi — I'm Xiaodi, your BCD logistics buddy. Tap below or type your own question.", + "Hi — I'm Xiaodi, your {name} logistics buddy. Tap below or type your own question.", 'ediAssistant.historyTitle': 'Chat history', 'ediAssistant.newChat': 'New chat', 'ediAssistant.emptyHistory': 'No conversations yet', @@ -78,7 +78,7 @@ export default { 'ediAssistant.quickAfterSales': 'Something went wrong?', 'ediAssistant.quickHuman': 'Talk to online advisor', 'ediAssistant.replySmall': - 'Yes~ BCD welcomes SMB sellers and shipments others decline — special routes, complex cargo, and low-volume orders are in scope. Tell me origin, destination, and cargo type to get started.', + 'Yes~ {name} welcomes SMB sellers and shipments others decline — special routes, complex cargo, and low-volume orders are in scope. Tell me origin, destination, and cargo type to get started.', 'ediAssistant.replyPrice': 'For a quote, destination country + actual weight (kg) is enough — e.g. US 0.5kg. Postal code/dims help; origin city is not required.', 'ediAssistant.replyQuoteSpeed': @@ -104,7 +104,7 @@ export default { 'ediAssistant.noAdvisor': 'No exclusive advisor assigned yet', 'ediAssistant.noWechatQr': 'WeChat QR code not uploaded', 'ediAssistant.greeting': - "Hi, I'm Xiaodi~ your BCD logistics buddy.\n\nAsk me about tracking, transit times, declared values, customs, and more. What shall we start with?", + "Hi, I'm Xiaodi~ your {name} logistics buddy.\n\nAsk me about tracking, transit times, declared values, customs, and more. What shall we start with?", 'ediAssistant.send': 'Send', 'ediAssistant.close': 'Close', 'ediAssistant.back': 'Back', diff --git a/src/locale/edi/zh-CN.ts b/src/locale/edi/zh-CN.ts index 5225d46..8d7cd11 100644 --- a/src/locale/edi/zh-CN.ts +++ b/src/locale/edi/zh-CN.ts @@ -14,7 +14,7 @@ export default { 'ediAssistant.greet.evening': '晚上好', 'ediAssistant.greet.night': '这么晚还在忙呀', 'ediAssistant.quickLabel': '试试这样问', - 'ediAssistant.welcomeMsg': '你好呀,我是小迪,BCD 的物流小助手~可以直接问我,也可以点下面的入口。', + 'ediAssistant.welcomeMsg': '你好呀,我是小迪,{name} 的物流小助手~可以直接问我,也可以点下面的入口。', 'ediAssistant.historyTitle': '历史记录', 'ediAssistant.newChat': '新会话', 'ediAssistant.emptyHistory': '还没有会话哦', @@ -76,7 +76,7 @@ export default { 'ediAssistant.quickAfterSales': '出问题了怎么办?', 'ediAssistant.quickHuman': '联系在线顾问', 'ediAssistant.replySmall': - '可以的~ BCD 很欢迎中小卖家和别人不太接的单:特殊线路、复杂货型、小批量都在服务范围内。告诉我起运地、目的地和货型,咱们就开始吧。', + '可以的~ {name} 很欢迎中小卖家和别人不太接的单:特殊线路、复杂货型、小批量都在服务范围内。告诉我起运地、目的地和货型,咱们就开始吧。', 'ediAssistant.replyPrice': '查价只需目的国和实重(kg)就好,例如:美国 0.5kg。有邮编/尺寸会更准;不需要起运地哦。', 'ediAssistant.replyQuoteSpeed': @@ -101,7 +101,7 @@ export default { 'ediAssistant.noAdvisor': '暂未分配专属顾问', 'ediAssistant.noWechatQr': '暂未上传微信二维码', 'ediAssistant.greeting': - '嗨,我是小迪~ BCD 的物流小助手\n\n查轨迹、渠道时效、申报价值和清关问题,都可以问我。今天想先聊哪一件呀?', + '嗨,我是小迪~ {name} 的物流小助手\n\n查轨迹、渠道时效、申报价值和清关问题,都可以问我。今天想先聊哪一件呀?', 'ediAssistant.send': '发送', 'ediAssistant.close': '关闭', 'ediAssistant.back': '返回', diff --git a/src/locale/en-US.ts b/src/locale/en-US.ts index 9ec6565..59d87e5 100644 --- a/src/locale/en-US.ts +++ b/src/locale/en-US.ts @@ -69,11 +69,13 @@ export default { 'menu.user.exportQualification': 'Export Qualification', 'menu.user.profile': 'Personal Center', 'menu.user.recharge': 'Recharge', + 'menu.user.invoice': 'My Invoices', 'menu.finance': 'Finance', 'menu.finance.analysis': 'Financial Analysis', 'menu.finance.rechargeRecord': 'Recharge Records', 'menu.finance.accountFlow': 'Account Transactions', 'menu.finance.receivablePayable': 'Receivables & Payables', + 'menu.finance.invoiceManage': 'Invoice Management', 'menu.agentAdmin': 'Channel Agents', 'menu.agentAdmin.analysis': 'Agent Analysis', 'menu.agentAdmin.list': 'Agents', @@ -4261,10 +4263,26 @@ export default { 'system.otherConfig.actions.save': 'Save', 'system.otherConfig.actions.cancel': 'Cancel', 'system.otherConfig.actions.paymentQr': 'Payment QR', - 'system.otherConfig.actions.brandLogo': 'Brand logo', - 'system.otherConfig.brandLogo.title': 'Brand logo', + 'system.otherConfig.actions.brandLogo': 'Brand settings', + 'system.otherConfig.brandLogo.title': 'Brand settings', 'system.otherConfig.brandLogo.tip': - 'Used for system top nav, official site header, browser tab icon, and boot mascot. Takes effect immediately; shows text LOGO when empty. Prefer square PNG.', + 'Copy is stored as object JSON and cached locally for instant paint; logos cover top nav, site, tab icon, and boot mascot.', + 'system.otherConfig.brandLogo.imagesTitle': 'Brand images', + 'system.otherConfig.brandLogo.tab.copy': 'Brand copy', + 'system.otherConfig.brandLogo.tab.images': 'Brand images', + 'system.otherConfig.brandLogo.copy.navTitle': 'Top nav / site', + 'system.otherConfig.brandLogo.copy.navHint': 'Shared by top nav and site header', + 'system.otherConfig.brandLogo.copy.navName': 'Short name', + 'system.otherConfig.brandLogo.copy.navFullName': 'Full name', + 'system.otherConfig.brandLogo.copy.aiTitle': 'AI advisor welcome', + 'system.otherConfig.brandLogo.copy.aiHint': 'Hero title on the advisor page', + 'system.otherConfig.brandLogo.copy.aiWelcomeTitleZh': 'Chinese title', + 'system.otherConfig.brandLogo.copy.aiWelcomeTitleShortZh': 'Chinese short title', + 'system.otherConfig.brandLogo.copy.aiWelcomeTitleEn': 'English title', + 'system.otherConfig.brandLogo.copy.aiWelcomeTitleShortEn': 'English short title', + 'system.otherConfig.brandLogo.copy.save': 'Save copy', + 'system.otherConfig.brandLogo.copy.saveSuccess': 'Brand copy saved', + 'system.otherConfig.brandLogo.copy.saveFailed': 'Failed to save brand copy', 'system.otherConfig.brandLogo.portal': 'System top nav', 'system.otherConfig.brandLogo.site': 'Official site', 'system.otherConfig.brandLogo.favicon': 'Browser tab', @@ -5399,6 +5417,124 @@ export default { 'finance.receivablePayable.table.receiveTime': 'Receive time', 'finance.receivablePayable.table.shipTime': 'Ship time', + 'finance.invoiceManage.search.keywordPlaceholder': 'Apply no. / invoice no. / title', + 'finance.invoiceManage.search.statusPlaceholder': 'Status', + 'finance.invoiceManage.search.statusAll': 'All statuses', + 'finance.invoiceManage.search.invoiceTypePlaceholder': 'Invoice type', + 'finance.invoiceManage.search.invoiceTypeAll': 'All types', + 'finance.invoiceManage.search.customerIdPlaceholder': 'Customer ID', + 'finance.invoiceManage.search.dateRange': 'Applied time', + 'finance.invoiceManage.search.dateStart': 'From', + 'finance.invoiceManage.search.dateEnd': 'To', + 'finance.invoiceManage.search.actions.search': 'Search', + 'finance.invoiceManage.search.actions.reset': 'Reset', + 'finance.invoiceManage.search.actions.export': 'Export', + 'finance.invoiceManage.search.actions.create': 'New apply', + 'finance.invoiceManage.search.actions.apply': 'Request invoice', + 'finance.invoiceManage.search.actions.profiles': 'Invoice titles', + 'finance.invoiceManage.status.draft': 'Draft', + 'finance.invoiceManage.status.pendingApproval': 'Pending approval', + 'finance.invoiceManage.status.approved': 'Approved', + 'finance.invoiceManage.status.issued': 'Issued', + 'finance.invoiceManage.status.rejected': 'Rejected', + 'finance.invoiceManage.status.voided': 'Voided', + 'finance.invoiceManage.status.redFlushed': 'Red-flushed', + 'finance.invoiceManage.type.normal': 'Normal VAT', + 'finance.invoiceManage.type.special': 'Special VAT', + 'finance.invoiceManage.medium.electronic': 'Electronic', + 'finance.invoiceManage.medium.paper': 'Paper', + 'finance.invoiceManage.source.parcelOrder': 'Parcel order', + 'finance.invoiceManage.source.pickupOrder': 'Pickup order', + 'finance.invoiceManage.source.storageRent': 'Storage rent', + 'finance.invoiceManage.table.applyNo': 'Apply no.', + 'finance.invoiceManage.table.customer': 'Customer', + 'finance.invoiceManage.table.invoiceType': 'Type', + 'finance.invoiceManage.table.medium': 'Medium', + 'finance.invoiceManage.table.titleName': 'Title', + 'finance.invoiceManage.table.amountTotal': 'Amount', + 'finance.invoiceManage.table.status': 'Status', + 'finance.invoiceManage.table.invoiceNumber': 'Invoice no.', + 'finance.invoiceManage.table.createTime': 'Created', + 'finance.invoiceManage.actions.detail': 'Detail', + 'finance.invoiceManage.actions.edit': 'Edit', + 'finance.invoiceManage.actions.submit': 'Submit', + 'finance.invoiceManage.actions.issue': 'Issue', + 'finance.invoiceManage.actions.void': 'Void', + 'finance.invoiceManage.actions.viewApproval': 'Approval', + 'finance.invoiceManage.drawer.create': 'New invoice apply', + 'finance.invoiceManage.drawer.edit': 'Edit invoice apply', + 'finance.invoiceManage.drawer.detail': 'Invoice detail', + 'finance.invoiceManage.drawer.customerId': 'Customer ID', + 'finance.invoiceManage.drawer.profile': 'Invoice title', + 'finance.invoiceManage.drawer.profilePlaceholder': 'Select a saved title', + 'finance.invoiceManage.drawer.titleName': 'Invoice title', + 'finance.invoiceManage.drawer.taxNo': 'Tax no.', + 'finance.invoiceManage.drawer.addressPhone': 'Address / phone', + 'finance.invoiceManage.drawer.bankNameAccount': 'Bank & account', + 'finance.invoiceManage.drawer.invoiceType': 'Invoice type', + 'finance.invoiceManage.drawer.medium': 'Medium', + 'finance.invoiceManage.drawer.taxRate': 'Tax rate', + 'finance.invoiceManage.drawer.remark': 'Remark', + 'finance.invoiceManage.drawer.submitNow': 'Submit after save', + 'finance.invoiceManage.drawer.saveDraft': 'Save draft', + 'finance.invoiceManage.drawer.submit': 'Submit', + 'finance.invoiceManage.drawer.selectable': 'Billable sources', + 'finance.invoiceManage.drawer.selectableKeyword': 'Source no.', + 'finance.invoiceManage.drawer.sourceType': 'Source type', + 'finance.invoiceManage.drawer.sourceTypeAll': 'All sources', + 'finance.invoiceManage.drawer.selectedAmount': 'Selected total', + 'finance.invoiceManage.drawer.needCustomer': 'Enter a customer ID', + 'finance.invoiceManage.drawer.needLines': 'Select invoice lines', + 'finance.invoiceManage.drawer.needTitle': 'Enter invoice title and tax no.', + 'finance.invoiceManage.drawer.loadMore': 'Load more', + 'finance.invoiceManage.selectable.sourceNo': 'Source no.', + 'finance.invoiceManage.selectable.sourceType': 'Source', + 'finance.invoiceManage.selectable.baseAmount': 'Base amount', + 'finance.invoiceManage.selectable.remaining': 'Remaining', + 'finance.invoiceManage.selectable.amount': 'Amount', + 'finance.invoiceManage.selectable.paidTime': 'Paid time', + 'finance.invoiceManage.selectable.empty': 'No billable sources', + 'finance.invoiceManage.detail.lines': 'Lines', + 'finance.invoiceManage.detail.taxNo': 'Tax no.', + 'finance.invoiceManage.detail.rejectReason': 'Reject reason', + 'finance.invoiceManage.detail.pdf': 'Invoice PDF', + 'finance.invoiceManage.detail.issueTime': 'Issued at', + 'finance.invoiceManage.detail.issueBy': 'Issued by', + 'finance.invoiceManage.issue.title': 'Issue invoice', + 'finance.invoiceManage.issue.invoiceCode': 'Invoice code', + 'finance.invoiceManage.issue.invoiceNumber': 'Invoice number', + 'finance.invoiceManage.issue.invoiceDate': 'Invoice date', + 'finance.invoiceManage.issue.pdfUrl': 'Invoice PDF URL', + 'finance.invoiceManage.issue.remark': 'Remark', + 'finance.invoiceManage.issue.needNumber': 'Enter the invoice number', + 'finance.invoiceManage.void.title': 'Void invoice', + 'finance.invoiceManage.void.confirm': 'Voiding will release occupied amounts. Continue?', + 'finance.invoiceManage.void.remark': 'Reason (optional)', + 'finance.invoiceManage.profile.title': 'Invoice titles', + 'finance.invoiceManage.profile.add': 'Add title', + 'finance.invoiceManage.profile.edit': 'Edit title', + 'finance.invoiceManage.profile.default': 'Default', + 'finance.invoiceManage.profile.setDefault': 'Set default', + 'finance.invoiceManage.profile.deleteConfirm': 'Delete this invoice title?', + 'finance.invoiceManage.profile.empty': 'No invoice titles yet', + 'finance.invoiceManage.profile.titleName': 'Invoice title', + 'finance.invoiceManage.profile.taxNo': 'Tax no.', + 'finance.invoiceManage.profile.addressPhone': 'Address / phone', + 'finance.invoiceManage.profile.bankNameAccount': 'Bank & account', + 'finance.invoiceManage.profile.isDefault': 'Set as default', + 'finance.invoiceManage.profile.remark': 'Remark', + 'finance.invoiceManage.profile.save': 'Save', + 'finance.invoiceManage.message.loadError': 'Failed to load invoices', + 'finance.invoiceManage.message.exportSuccess': 'Export completed', + 'finance.invoiceManage.message.exportError': 'Export failed', + 'finance.invoiceManage.message.saveSuccess': 'Saved', + 'finance.invoiceManage.message.submitSuccess': 'Submitted', + 'finance.invoiceManage.message.issueSuccess': 'Issued', + 'finance.invoiceManage.message.voidSuccess': 'Voided', + 'finance.invoiceManage.message.profileSaved': 'Title saved', + 'finance.invoiceManage.message.profileDeleted': 'Title deleted', + 'finance.invoiceManage.message.approvalMissing': 'No approval instance', + 'user.recharge.record.message.exportError': 'Export failed', 'user.recharge.record.pagination.total': '{count} total', 'user.recharge.record.pagination.prev': 'Prev', diff --git a/src/locale/marketing/en-US.ts b/src/locale/marketing/en-US.ts index 0faa104..6cea07c 100644 --- a/src/locale/marketing/en-US.ts +++ b/src/locale/marketing/en-US.ts @@ -518,7 +518,7 @@ export default { 'marketing.register.title': 'Register', 'marketing.register.subtitle': 'Member pricing and welcome benefits', - 'marketing.register.brandHint': 'Welcome to BCD customer portal', + 'marketing.register.brandHint': 'Welcome to {name} customer portal', 'marketing.register.brandHint.web': 'Register with email & phone', 'marketing.register.brandHint.wechat': 'Register with WeChat', 'marketing.register.choose.group': 'Choose how to register', diff --git a/src/locale/marketing/zh-CN.ts b/src/locale/marketing/zh-CN.ts index fd52ca9..a1aed99 100644 --- a/src/locale/marketing/zh-CN.ts +++ b/src/locale/marketing/zh-CN.ts @@ -515,9 +515,9 @@ export default { 'marketing.register.title': '客户注册', 'marketing.register.subtitle': '注册即享会员价与新人福利', - 'marketing.register.brandHint': '欢迎注册 BCD 客户门户', - 'marketing.register.brandHint.web': '网页注册 BCD 客户账号', - 'marketing.register.brandHint.wechat': '微信扫码注册 BCD 客户账号', + 'marketing.register.brandHint': '欢迎注册 {name} 客户门户', + 'marketing.register.brandHint.web': '网页注册 {name} 客户账号', + 'marketing.register.brandHint.wechat': '微信扫码注册 {name} 客户账号', 'marketing.register.choose.group': '选择注册方式', 'marketing.register.choose.web': '网页注册', 'marketing.register.choose.webDesc': '填写资料,立即开通客户门户', diff --git a/src/locale/zh-CN.ts b/src/locale/zh-CN.ts index 2a30850..7294a9e 100644 --- a/src/locale/zh-CN.ts +++ b/src/locale/zh-CN.ts @@ -69,11 +69,13 @@ export default { 'menu.user.exportQualification': '出口资质备案', 'menu.user.profile': '个人中心', 'menu.user.recharge': '资金充值', + 'menu.user.invoice': '我的发票', 'menu.finance': '财务', 'menu.finance.analysis': '财务分析', 'menu.finance.rechargeRecord': '充值记录', 'menu.finance.accountFlow': '资金流水', 'menu.finance.receivablePayable': '应收应付', + 'menu.finance.invoiceManage': '发票管理', 'menu.agentAdmin': '渠道代理', 'menu.agentAdmin.analysis': '代理分析', 'menu.agentAdmin.list': '代理管理', @@ -4273,10 +4275,26 @@ export default { 'system.otherConfig.actions.save': '保存', 'system.otherConfig.actions.cancel': '取消', 'system.otherConfig.actions.paymentQr': '收款码', - 'system.otherConfig.actions.brandLogo': '品牌 Logo', - 'system.otherConfig.brandLogo.title': '品牌 Logo', + 'system.otherConfig.actions.brandLogo': '品牌配置', + 'system.otherConfig.brandLogo.title': '品牌配置', 'system.otherConfig.brandLogo.tip': - '用于系统顶栏、官网头部、浏览器标签与启动页吉祥物。更换后立即生效;未上传时显示文字 LOGO。建议上传正方形 PNG。', + '文案存对象存储并本地缓存秒开;Logo 用于顶栏、官网、标签与启动页。保存文案或上传图片后立即生效。', + 'system.otherConfig.brandLogo.imagesTitle': '品牌图片', + 'system.otherConfig.brandLogo.tab.copy': '品牌文案', + 'system.otherConfig.brandLogo.tab.images': '品牌图片', + 'system.otherConfig.brandLogo.copy.navTitle': '顶栏 / 官网', + 'system.otherConfig.brandLogo.copy.navHint': '顶栏与官网共用', + 'system.otherConfig.brandLogo.copy.navName': '短名', + 'system.otherConfig.brandLogo.copy.navFullName': '全称', + 'system.otherConfig.brandLogo.copy.aiTitle': 'AI 顾问欢迎语', + 'system.otherConfig.brandLogo.copy.aiHint': '官网顾问页大标题,中英分开', + 'system.otherConfig.brandLogo.copy.aiWelcomeTitleZh': '中文主标题', + 'system.otherConfig.brandLogo.copy.aiWelcomeTitleShortZh': '中文短标题', + 'system.otherConfig.brandLogo.copy.aiWelcomeTitleEn': '英文主标题', + 'system.otherConfig.brandLogo.copy.aiWelcomeTitleShortEn': '英文短标题', + 'system.otherConfig.brandLogo.copy.save': '保存文案', + 'system.otherConfig.brandLogo.copy.saveSuccess': '品牌文案已保存', + 'system.otherConfig.brandLogo.copy.saveFailed': '保存品牌文案失败', 'system.otherConfig.brandLogo.portal': '系统顶栏', 'system.otherConfig.brandLogo.site': '官网', 'system.otherConfig.brandLogo.favicon': '网站标签', @@ -5416,6 +5434,124 @@ export default { 'finance.receivablePayable.table.receiveTime': '收货时间', 'finance.receivablePayable.table.shipTime': '发货时间', + 'finance.invoiceManage.search.keywordPlaceholder': '申请单号 / 发票号 / 抬头', + 'finance.invoiceManage.search.statusPlaceholder': '状态', + 'finance.invoiceManage.search.statusAll': '全部状态', + 'finance.invoiceManage.search.invoiceTypePlaceholder': '发票类型', + 'finance.invoiceManage.search.invoiceTypeAll': '全部类型', + 'finance.invoiceManage.search.customerIdPlaceholder': '客户ID', + 'finance.invoiceManage.search.dateRange': '申请时间', + 'finance.invoiceManage.search.dateStart': '申请起', + 'finance.invoiceManage.search.dateEnd': '申请止', + 'finance.invoiceManage.search.actions.search': '搜索', + 'finance.invoiceManage.search.actions.reset': '重置', + 'finance.invoiceManage.search.actions.export': '导出', + 'finance.invoiceManage.search.actions.create': '新建申请', + 'finance.invoiceManage.search.actions.apply': '申请开票', + 'finance.invoiceManage.search.actions.profiles': '抬头管理', + 'finance.invoiceManage.status.draft': '草稿', + 'finance.invoiceManage.status.pendingApproval': '待审批', + 'finance.invoiceManage.status.approved': '已审批待开票', + 'finance.invoiceManage.status.issued': '已开票', + 'finance.invoiceManage.status.rejected': '已驳回', + 'finance.invoiceManage.status.voided': '已作废', + 'finance.invoiceManage.status.redFlushed': '已红冲', + 'finance.invoiceManage.type.normal': '普通发票', + 'finance.invoiceManage.type.special': '专用发票', + 'finance.invoiceManage.medium.electronic': '电子', + 'finance.invoiceManage.medium.paper': '纸质', + 'finance.invoiceManage.source.parcelOrder': '运单', + 'finance.invoiceManage.source.pickupOrder': '揽收单', + 'finance.invoiceManage.source.storageRent': '仓租', + 'finance.invoiceManage.table.applyNo': '申请单号', + 'finance.invoiceManage.table.customer': '客户', + 'finance.invoiceManage.table.invoiceType': '发票类型', + 'finance.invoiceManage.table.medium': '介质', + 'finance.invoiceManage.table.titleName': '发票抬头', + 'finance.invoiceManage.table.amountTotal': '开票金额', + 'finance.invoiceManage.table.status': '状态', + 'finance.invoiceManage.table.invoiceNumber': '发票号码', + 'finance.invoiceManage.table.createTime': '申请时间', + 'finance.invoiceManage.actions.detail': '详情', + 'finance.invoiceManage.actions.edit': '编辑', + 'finance.invoiceManage.actions.submit': '提交', + 'finance.invoiceManage.actions.issue': '开具', + 'finance.invoiceManage.actions.void': '作废', + 'finance.invoiceManage.actions.viewApproval': '审批详情', + 'finance.invoiceManage.drawer.create': '新建开票申请', + 'finance.invoiceManage.drawer.edit': '编辑开票申请', + 'finance.invoiceManage.drawer.detail': '开票详情', + 'finance.invoiceManage.drawer.customerId': '客户ID', + 'finance.invoiceManage.drawer.profile': '发票抬头', + 'finance.invoiceManage.drawer.profilePlaceholder': '选择已保存抬头', + 'finance.invoiceManage.drawer.titleName': '发票抬头', + 'finance.invoiceManage.drawer.taxNo': '税号', + 'finance.invoiceManage.drawer.addressPhone': '地址电话', + 'finance.invoiceManage.drawer.bankNameAccount': '开户行及账号', + 'finance.invoiceManage.drawer.invoiceType': '发票类型', + 'finance.invoiceManage.drawer.medium': '介质', + 'finance.invoiceManage.drawer.taxRate': '税率', + 'finance.invoiceManage.drawer.remark': '备注', + 'finance.invoiceManage.drawer.submitNow': '保存后立即提交', + 'finance.invoiceManage.drawer.saveDraft': '保存草稿', + 'finance.invoiceManage.drawer.submit': '提交申请', + 'finance.invoiceManage.drawer.selectable': '可开票来源', + 'finance.invoiceManage.drawer.selectableKeyword': '来源单号', + 'finance.invoiceManage.drawer.sourceType': '来源类型', + 'finance.invoiceManage.drawer.sourceTypeAll': '全部来源', + 'finance.invoiceManage.drawer.selectedAmount': '已选合计', + 'finance.invoiceManage.drawer.needCustomer': '请填写客户ID', + 'finance.invoiceManage.drawer.needLines': '请选择开票明细', + 'finance.invoiceManage.drawer.needTitle': '请填写发票抬头和税号', + 'finance.invoiceManage.drawer.loadMore': '加载更多', + 'finance.invoiceManage.selectable.sourceNo': '来源单号', + 'finance.invoiceManage.selectable.sourceType': '来源', + 'finance.invoiceManage.selectable.baseAmount': '原金额', + 'finance.invoiceManage.selectable.remaining': '可开票', + 'finance.invoiceManage.selectable.amount': '开票金额', + 'finance.invoiceManage.selectable.paidTime': '支付时间', + 'finance.invoiceManage.selectable.empty': '暂无可开票来源', + 'finance.invoiceManage.detail.lines': '开票明细', + 'finance.invoiceManage.detail.taxNo': '税号', + 'finance.invoiceManage.detail.rejectReason': '驳回原因', + 'finance.invoiceManage.detail.pdf': '发票PDF', + 'finance.invoiceManage.detail.issueTime': '开具时间', + 'finance.invoiceManage.detail.issueBy': '开具人', + 'finance.invoiceManage.issue.title': '开具发票', + 'finance.invoiceManage.issue.invoiceCode': '发票代码', + 'finance.invoiceManage.issue.invoiceNumber': '发票号码', + 'finance.invoiceManage.issue.invoiceDate': '开票日期', + 'finance.invoiceManage.issue.pdfUrl': '发票PDF地址', + 'finance.invoiceManage.issue.remark': '备注', + 'finance.invoiceManage.issue.needNumber': '请填写发票号码', + 'finance.invoiceManage.void.title': '作废发票', + 'finance.invoiceManage.void.confirm': '作废后将释放来源占用,确认继续?', + 'finance.invoiceManage.void.remark': '作废原因(选填)', + 'finance.invoiceManage.profile.title': '发票抬头', + 'finance.invoiceManage.profile.add': '新增抬头', + 'finance.invoiceManage.profile.edit': '编辑抬头', + 'finance.invoiceManage.profile.default': '默认', + 'finance.invoiceManage.profile.setDefault': '设为默认', + 'finance.invoiceManage.profile.deleteConfirm': '确认删除该抬头?', + 'finance.invoiceManage.profile.empty': '暂无发票抬头', + 'finance.invoiceManage.profile.titleName': '发票抬头', + 'finance.invoiceManage.profile.taxNo': '税号', + 'finance.invoiceManage.profile.addressPhone': '地址电话', + 'finance.invoiceManage.profile.bankNameAccount': '开户行及账号', + 'finance.invoiceManage.profile.isDefault': '设为默认抬头', + 'finance.invoiceManage.profile.remark': '备注', + 'finance.invoiceManage.profile.save': '保存', + 'finance.invoiceManage.message.loadError': '加载发票数据失败', + 'finance.invoiceManage.message.exportSuccess': '导出成功', + 'finance.invoiceManage.message.exportError': '导出失败', + 'finance.invoiceManage.message.saveSuccess': '保存成功', + 'finance.invoiceManage.message.submitSuccess': '提交成功', + 'finance.invoiceManage.message.issueSuccess': '开具成功', + 'finance.invoiceManage.message.voidSuccess': '已作废', + 'finance.invoiceManage.message.profileSaved': '抬头已保存', + 'finance.invoiceManage.message.profileDeleted': '抬头已删除', + 'finance.invoiceManage.message.approvalMissing': '暂无审批实例', + 'user.recharge.record.message.exportError': '导出失败', 'user.recharge.record.pagination.total': '共 {count} 条', 'user.recharge.record.pagination.prev': '上一页', diff --git a/src/router/guard/permission.ts b/src/router/guard/permission.ts index e0e366a..74cd221 100644 --- a/src/router/guard/permission.ts +++ b/src/router/guard/permission.ts @@ -89,6 +89,7 @@ export default function setupPermissionGuard(router: Router) { path.startsWith('/user/marketing') || path.startsWith('/user/profile') || path.startsWith('/user/recharge') || + path.startsWith('/user/invoice') || (path.startsWith('/h5') && !isAdminH5); Message.warning( isCustomerPortal diff --git a/src/router/index.ts b/src/router/index.ts index 72553ba..0b6af79 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -496,6 +496,17 @@ const router = createRouter({ h5HideHeader: true, }, }, + { + path: 'invoice', + name: 'H5Invoice', + component: () => import('@/views/h5/customer-center/invoice/index.vue'), + meta: { + requiresAuth: true, + locale: 'h5.invoice.title', + h5HideTabBar: true, + h5HideHeader: true, + }, + }, { path: 'place-order', name: 'H5PlaceOrder', diff --git a/src/router/routes/newModules/finance.ts b/src/router/routes/newModules/finance.ts index 270394a..af7371e 100644 --- a/src/router/routes/newModules/finance.ts +++ b/src/router/routes/newModules/finance.ts @@ -70,6 +70,19 @@ const FINANCE: AppRouteRecordRaw = { icon: 'icon-file', }, }, + { + path: 'invoiceManage', + name: 'FinanceInvoiceManage', + component: () => import('@/views/finance/invoiceManage/index.vue'), + meta: { + locale: 'menu.finance.invoiceManage', + requiresAuth: true, + roles: ['*'], + menuPermission: 'Finance.InvoiceManage', + order: 4, + icon: 'icon-file', + }, + }, ], }; diff --git a/src/router/routes/newModules/user.ts b/src/router/routes/newModules/user.ts index 64abf57..2381a6e 100644 --- a/src/router/routes/newModules/user.ts +++ b/src/router/routes/newModules/user.ts @@ -146,6 +146,22 @@ const USER: AppRouteRecordRaw = { customerPortalOnly: true, }, }, + { + path: 'invoice', + name: 'UserInvoice', + component: () => import('@/views/user/invoice/index.vue'), + meta: { + locale: 'menu.user.invoice', + requiresAuth: true, + roles: ['*'], + hideInMenu: true, + ignoreCache: true, + syncInMenu: true, + menuPermission: 'User.Invoice', + order: 14, + customerPortalOnly: true, + }, + }, ], }; diff --git a/src/utils/agentPortalCopy.ts b/src/utils/agentPortalCopy.ts index 581a0a8..8b03019 100644 --- a/src/utils/agentPortalCopy.ts +++ b/src/utils/agentPortalCopy.ts @@ -1,5 +1,7 @@ /** 代理门户:催付款 / 邀请话术文案 */ +import { brandCopy } from '@/utils/brandCopy' + export function buildPendingPaymentReminderText(opts: { customerName?: string pendingCount?: number @@ -39,6 +41,6 @@ export const AGENT_INVITE_TEMPLATES: Array<{ key: 'formal', label: '商务简介', build: (code, url) => - `【BCD Express 渠道邀请】请通过专属链接完成注册绑定:${url}\n代理编号:${code}\n注册后即可查价下单,运单派送完成后按约定结算返佣。`, + `【${brandCopy.navName} Express 渠道邀请】请通过专属链接完成注册绑定:${url}\n代理编号:${code}\n注册后即可查价下单,运单派送完成后按约定结算返佣。`, }, ] diff --git a/src/utils/brandCopy.ts b/src/utils/brandCopy.ts new file mode 100644 index 0000000..ccab0e3 --- /dev/null +++ b/src/utils/brandCopy.ts @@ -0,0 +1,111 @@ +import { reactive } from 'vue' +import { resolveAdminApiPath } from '@/utils/adminApi' +import { unwrapData } from '@/api/oms/common' + +/** 品牌文案本地缓存(首屏秒开,不依赖首屏打库) */ +export const BRAND_COPY_CACHE_KEY = 'oms_brand_copy' + +export type BrandCopy = { + navName: string + navFullName: string + aiWelcomeTitleZh: string + aiWelcomeTitleShortZh: string + aiWelcomeTitleEn: string + aiWelcomeTitleShortEn: string +} + +export const DEFAULT_BRAND_COPY: BrandCopy = { + navName: 'BCD', + navFullName: 'Business & Customer & Delivery', + aiWelcomeTitleZh: 'BCD · 一站式跨境物流顾问', + aiWelcomeTitleShortZh: 'BCD · 跨境物流顾问', + aiWelcomeTitleEn: 'BCD · One-stop cross-border logistics advisor', + aiWelcomeTitleShortEn: 'BCD · Logistics advisor', +} + +function normalizeBrandCopy(raw?: Partial | null): BrandCopy { + return { + navName: String(raw?.navName || '').trim() || DEFAULT_BRAND_COPY.navName, + navFullName: String(raw?.navFullName || '').trim() || DEFAULT_BRAND_COPY.navFullName, + aiWelcomeTitleZh: + String(raw?.aiWelcomeTitleZh || '').trim() || DEFAULT_BRAND_COPY.aiWelcomeTitleZh, + aiWelcomeTitleShortZh: + String(raw?.aiWelcomeTitleShortZh || '').trim() || DEFAULT_BRAND_COPY.aiWelcomeTitleShortZh, + aiWelcomeTitleEn: + String(raw?.aiWelcomeTitleEn || '').trim() || DEFAULT_BRAND_COPY.aiWelcomeTitleEn, + aiWelcomeTitleShortEn: + String(raw?.aiWelcomeTitleShortEn || '').trim() || DEFAULT_BRAND_COPY.aiWelcomeTitleShortEn, + } +} + +function readCachedBrandCopy(): BrandCopy { + if (typeof localStorage === 'undefined') return { ...DEFAULT_BRAND_COPY } + try { + const parsed = JSON.parse(localStorage.getItem(BRAND_COPY_CACHE_KEY) || '') as Partial + return normalizeBrandCopy(parsed) + } catch { + return { ...DEFAULT_BRAND_COPY } + } +} + +function writeCachedBrandCopy(copy: BrandCopy) { + try { + localStorage.setItem(BRAND_COPY_CACHE_KEY, JSON.stringify(copy)) + } catch { + /* ignore quota */ + } +} + +function applyBrandCopy(copy: BrandCopy) { + const next = normalizeBrandCopy(copy) + brandCopy.navName = next.navName + brandCopy.navFullName = next.navFullName + brandCopy.aiWelcomeTitleZh = next.aiWelcomeTitleZh + brandCopy.aiWelcomeTitleShortZh = next.aiWelcomeTitleShortZh + brandCopy.aiWelcomeTitleEn = next.aiWelcomeTitleEn + brandCopy.aiWelcomeTitleShortEn = next.aiWelcomeTitleShortEn + writeCachedBrandCopy(next) + return next +} + +/** 响应式品牌文案:模块加载即用本地缓存,后台再刷新 */ +export const brandCopy = reactive(readCachedBrandCopy()) + +export function resolveAiWelcomeTitle(isZh: boolean, short = false): string { + if (isZh) { + return short ? brandCopy.aiWelcomeTitleShortZh : brandCopy.aiWelcomeTitleZh + } + return short ? brandCopy.aiWelcomeTitleShortEn : brandCopy.aiWelcomeTitleEn +} + +function mapBrandCopyDto(data?: Record | null): BrandCopy { + return normalizeBrandCopy({ + navName: data?.navName ?? data?.NavName, + navFullName: data?.navFullName ?? data?.NavFullName, + aiWelcomeTitleZh: data?.aiWelcomeTitleZh ?? data?.AiWelcomeTitleZh, + aiWelcomeTitleShortZh: data?.aiWelcomeTitleShortZh ?? data?.AiWelcomeTitleShortZh, + aiWelcomeTitleEn: data?.aiWelcomeTitleEn ?? data?.AiWelcomeTitleEn, + aiWelcomeTitleShortEn: data?.aiWelcomeTitleShortEn ?? data?.AiWelcomeTitleShortEn, + }) +} + +/** 匿名拉取品牌文案(对象存储 JSON),写入本地缓存 */ +export async function refreshBrandCopy(): Promise { + try { + const res = await fetch(resolveAdminApiPath('/system/other-config/brand-copy'), { + method: 'GET', + headers: { Accept: 'application/json' }, + credentials: 'omit', + }) + if (!res.ok) return { ...brandCopy } + const body = await res.json() + return applyBrandCopy(mapBrandCopyDto(unwrapData(body))) + } catch { + return { ...brandCopy } + } +} + +/** 管理端保存成功后立刻应用到界面与本地缓存 */ +export function rememberBrandCopy(data?: Record | null): BrandCopy { + return applyBrandCopy(mapBrandCopyDto(data)) +} diff --git a/src/utils/brandLogo.ts b/src/utils/brandLogo.ts index b3a5cb5..1de2200 100644 --- a/src/utils/brandLogo.ts +++ b/src/utils/brandLogo.ts @@ -1,7 +1,9 @@ import { reactive, ref } from 'vue' import type { BrandLogoDto } from '@/api/system/otherConfig' +import { streamFileBlob } from '@/api/fileStorage' import { resolveOmsAssetUrl, unwrapData } from '@/api/oms/common' import { resolveAdminApiPath } from '@/utils/adminApi' +import { refreshBrandCopy } from '@/utils/brandCopy' export type BrandLogoUrls = { portal: string @@ -160,11 +162,16 @@ function blobToDataUrl(blob: Blob): Promise { }) } -/** 把已拿到的图片地址读成 data URL。跨域读不到字节时抛错,调用方再决定是否退回远程地址。 */ -async function embedImageUrl(url: string): Promise { - const res = await fetch(url, { credentials: 'omit', cache: 'force-cache' }) - if (!res.ok) throw new Error(`HTTP ${res.status}`) - const blob = await res.blob() +function isCosAssetUrl(url: string): boolean { + try { + const host = new URL(url).hostname.toLowerCase() + return host.startsWith('cos.') || host.includes('myqcloud.com') + } catch { + return false + } +} + +async function blobToBrandDataUrl(blob: Blob): Promise { if (blob.size <= 0 || blob.size > 1_500_000) throw new Error('image size') if (blob.type && !blob.type.startsWith('image/')) throw new Error('not image') const data = await blobToDataUrl(blob) @@ -172,6 +179,23 @@ async function embedImageUrl(url: string): Promise { return data } +/** + * 把图片地址读成 data URL。 + * 生产环境 cos.test / 自定义域证书异常时,直连 fetch 会 ERR_CERT_COMMON_NAME_INVALID, + * 再经鉴权 /file-storage/stream 由后端 SDK 拉对象(不经坏证书域名)。 + */ +async function embedImageUrl(url: string): Promise { + try { + const res = await fetch(url, { credentials: 'omit', cache: 'force-cache' }) + if (!res.ok) throw new Error(`HTTP ${res.status}`) + return await blobToBrandDataUrl(await res.blob()) + } catch (directErr) { + if (!isCosAssetUrl(url) && !url.includes('/uploads/')) throw directErr + const blob = await streamFileBlob(url) + return blobToBrandDataUrl(blob) + } +} + function publishBrandImage(channel: BrandChannel, value: string) { brandLogoImages[channel] = value if (channel === 'favicon') applyDocumentFavicon(value) @@ -309,8 +333,11 @@ async function embedChannel(channel: BrandChannel, url: string, generation: numb publishBrandImage(channel, data) } catch { if (generation !== brandImageGeneration) return + // 直连/stream 都失败时:开发态可退回远程 URL(有 /__cos__);生产勿把坏证书 COS 地址塞进 if (!readImageStore().images[channel]?.startsWith('data:')) { - publishBrandImage(channel, url) + if (import.meta.env.DEV || !isCosAssetUrl(url)) { + publishBrandImage(channel, url) + } } } } @@ -386,12 +413,14 @@ function hasLocalBrandImage(): boolean { * 第一次没有缓存:在启动页盖住期间把图片收成 data URL,页面出来时已经在布局里。 */ export async function bootstrapBrandAssets() { + // 文案已从 localStorage 同步灌入;图片有缓存则后台刷新,无缓存则等一轮 + void refreshBrandCopy() if (hasLocalBrandImage()) { void refreshBrandImages() return } await Promise.race([ - refreshBrandImages(), + Promise.all([refreshBrandImages(), refreshBrandCopy()]), new Promise((resolve) => { window.setTimeout(resolve, 8000) }), diff --git a/src/utils/inviteLink.ts b/src/utils/inviteLink.ts index a65c766..f614c23 100644 --- a/src/utils/inviteLink.ts +++ b/src/utils/inviteLink.ts @@ -1,5 +1,7 @@ /** 客户侧邀请落地页:公众号 OAuth 注册(携带 ?ref=) */ +import { brandCopy } from '@/utils/brandCopy'; + export function buildInviteRegisterUrl(inviteCode: string, origin = window.location.origin): string { const code = inviteCode.trim(); if (!code) return ''; @@ -41,7 +43,7 @@ export function buildInviteShareText(inviteCode: string, inviteUrl: string): str const code = inviteCode.trim(); const url = inviteUrl.trim(); if (!code || !url) return url || code; - return `【BCD Express】送你一个专属邀请,微信打开链接注册即可:${url}\n邀请码:${code}`; + return `【${brandCopy.navName} Express】送你一个专属邀请,微信打开链接注册即可:${url}\n邀请码:${code}`; } /** 渠道代理分享话术(默认微信私聊) */ diff --git a/src/utils/login-portal.ts b/src/utils/login-portal.ts index ddaf045..d9db6be 100644 --- a/src/utils/login-portal.ts +++ b/src/utils/login-portal.ts @@ -102,6 +102,7 @@ export function resolveCustomerEntryPath(path?: string | null): string { } if (raw.startsWith('/order/priceCheck')) return '/h5/price' if (raw === '/assistant' || raw.startsWith('/assistant/')) return '/h5/assistant' + if (raw.startsWith('/user/invoice')) return '/h5/invoice' if ( raw.startsWith('/user/profile') || raw.startsWith('/user/recharge') || @@ -129,6 +130,7 @@ const CUSTOMER_PORTAL_ONLY_PATH_PREFIXES = [ '/user/profile', '/user/marketing', '/user/recharge', + '/user/invoice', '/h5', ] as const diff --git a/src/utils/menu-i18n.ts b/src/utils/menu-i18n.ts index a712342..d25e01c 100644 --- a/src/utils/menu-i18n.ts +++ b/src/utils/menu-i18n.ts @@ -18,6 +18,8 @@ export const MENU_NAME_TO_LOCALE_KEY: Record = { 充值记录: 'menu.finance.rechargeRecord', 资金流水: 'menu.finance.accountFlow', 应收应付: 'menu.finance.receivablePayable', + 发票管理: 'menu.finance.invoiceManage', + 我的发票: 'menu.user.invoice', 营销: 'menu.marketing', 营销指引: 'menu.marketing.marketingGuide', 订单: 'menu.order', diff --git a/src/utils/menu-icon.ts b/src/utils/menu-icon.ts index e140779..1a8fe6a 100644 --- a/src/utils/menu-icon.ts +++ b/src/utils/menu-icon.ts @@ -32,6 +32,8 @@ export const SUB_MENU_DEFAULT_ICONS: Record = { 'menu.finance.rechargeRecord': 'IconList', 'menu.finance.accountFlow': 'IconSwap', 'menu.finance.receivablePayable': 'IconFile', + 'menu.finance.invoiceManage': 'IconFile', + 'menu.user.invoice': 'IconFile', 'menu.kb.training': 'IconBook', 'menu.order.orderGuide': 'IconBook', 'menu.order.priceCheck': 'IconSearch', diff --git a/src/utils/route-name-mapper.ts b/src/utils/route-name-mapper.ts index 8285d46..0fb21fc 100644 --- a/src/utils/route-name-mapper.ts +++ b/src/utils/route-name-mapper.ts @@ -107,6 +107,8 @@ const routeNameMap: Record = { '/user': 'User', 'user_recharge': 'VipRechargeDeposit', '/user/recharge': 'VipRechargeDeposit', + 'user_invoice': 'UserInvoice', + '/user/invoice': 'UserInvoice', 'finance': 'Finance', '/finance': 'FinanceAnalysis', 'finance_analysis': 'FinanceAnalysis', @@ -117,6 +119,8 @@ const routeNameMap: Record = { '/finance/accountFlow': 'FinanceAccountFlow', 'finance_receivable_payable': 'FinanceReceivablePayable', '/finance/receivablePayable': 'FinanceReceivablePayable', + 'finance_invoice_manage': 'FinanceInvoiceManage', + '/finance/invoiceManage': 'FinanceInvoiceManage', // 渠道相关 'channel': 'Channel', diff --git a/src/views/finance/invoiceManage/index.vue b/src/views/finance/invoiceManage/index.vue new file mode 100644 index 0000000..3fa25a8 --- /dev/null +++ b/src/views/finance/invoiceManage/index.vue @@ -0,0 +1,1270 @@ + + + + + diff --git a/src/views/h5/admin-center/layout.vue b/src/views/h5/admin-center/layout.vue index 8aaa46d..17bad42 100644 --- a/src/views/h5/admin-center/layout.vue +++ b/src/views/h5/admin-center/layout.vue @@ -39,6 +39,7 @@ import { H5_ADMIN_TAB_KEEP_ALIVE, useH5TabScrollMemory, } from '@/views/h5/composables/useH5TabEnterOnce'; +import { brandCopy } from '@/utils/brandCopy'; defineOptions({ name: 'H5AdminCenterLayout' }); @@ -60,7 +61,7 @@ const headerTitle = computed(() => { }); function syncDocumentTitle() { - document.title = t('h5Admin.documentTitle'); + document.title = t('h5Admin.documentTitle', { name: brandCopy.navName }); } async function refreshOrderBadge() { diff --git a/src/views/h5/admin-center/locale/en-US.ts b/src/views/h5/admin-center/locale/en-US.ts index 344d3f7..0418538 100644 --- a/src/views/h5/admin-center/locale/en-US.ts +++ b/src/views/h5/admin-center/locale/en-US.ts @@ -1,6 +1,6 @@ export default { 'h5Admin.center.title': 'Ops Center', - 'h5Admin.documentTitle': 'BCD Ops Center', + 'h5Admin.documentTitle': '{name} Ops Center', 'h5Admin.tab.workplace': 'Home', 'h5Admin.tab.eddie': 'Xiaodi', 'h5Admin.tab.orders': 'Orders', diff --git a/src/views/h5/admin-center/locale/zh-CN.ts b/src/views/h5/admin-center/locale/zh-CN.ts index e3909c0..82df248 100644 --- a/src/views/h5/admin-center/locale/zh-CN.ts +++ b/src/views/h5/admin-center/locale/zh-CN.ts @@ -1,6 +1,6 @@ export default { 'h5Admin.center.title': '运营中心', - 'h5Admin.documentTitle': 'BCD运营中心', + 'h5Admin.documentTitle': '{name}运营中心', 'h5Admin.tab.workplace': '工作台', 'h5Admin.tab.eddie': '小迪', 'h5Admin.tab.orders': '运单', diff --git a/src/views/h5/admin-center/login/index.vue b/src/views/h5/admin-center/login/index.vue index 5ec3eb9..7a1aae9 100644 --- a/src/views/h5/admin-center/login/index.vue +++ b/src/views/h5/admin-center/login/index.vue @@ -24,7 +24,7 @@ - + @@ -118,6 +118,7 @@ import { useLoginCaptchaGate } from '@/composables/useLoginCaptchaGate'; import LoginCaptchaField from '@/components/LoginCaptchaField/index.vue'; import { ADMIN_H5_HOME_PATH, isAdminH5Path } from '@/utils/login-portal'; import { BRAND_TEXT_LOGO, brandLogoImages } from '@/utils/brandLogo'; +import { brandCopy } from '@/utils/brandCopy'; import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue'; import H5LoginPortalSwitch from '@/views/h5/components/H5LoginPortalSwitch.vue'; @@ -236,7 +237,7 @@ async function handleSubmit() { } onMounted(() => { - document.title = t('h5Admin.documentTitle'); + document.title = t('h5Admin.documentTitle', { name: brandCopy.navName }); if (isLogin() && rbacUserStore.loginPortalType === OmsLoginType.User) { router.replace(resolveRedirectPath()); } diff --git a/src/views/h5/customer-center/invoice/index.vue b/src/views/h5/customer-center/invoice/index.vue new file mode 100644 index 0000000..0fceb37 --- /dev/null +++ b/src/views/h5/customer-center/invoice/index.vue @@ -0,0 +1,784 @@ + + + + + diff --git a/src/views/h5/customer-center/layout.vue b/src/views/h5/customer-center/layout.vue index 66284ae..6401e73 100644 --- a/src/views/h5/customer-center/layout.vue +++ b/src/views/h5/customer-center/layout.vue @@ -62,6 +62,7 @@ import { H5_CUSTOMER_TAB_KEEP_ALIVE, useH5TabScrollMemory, } from '@/views/h5/composables/useH5TabEnterOnce'; +import { brandCopy } from '@/utils/brandCopy'; defineOptions({ name: 'H5CustomerCenterLayout' }); @@ -114,7 +115,7 @@ const headerTitle = computed(() => { }); function syncDocumentTitle() { - document.title = t('h5.documentTitle'); + document.title = t('h5.documentTitle', { name: brandCopy.navName }); } async function refreshOrderBadge() { diff --git a/src/views/h5/customer-center/locale/en-US.ts b/src/views/h5/customer-center/locale/en-US.ts index 99a4e95..3805960 100644 --- a/src/views/h5/customer-center/locale/en-US.ts +++ b/src/views/h5/customer-center/locale/en-US.ts @@ -1,6 +1,6 @@ export default { 'h5.center.title': 'Customer Center', - 'h5.documentTitle': 'BCD Customer Center', + 'h5.documentTitle': '{name} Customer Center', 'h5.noticePopup.title': 'Notice', 'h5.noticePopup.markRead': 'Mark as read', 'h5.noticePopup.later': 'Later', @@ -326,9 +326,8 @@ export default { 'h5.wxQr.success': 'Signed in', 'h5.login.title': 'Sign in', - 'h5.login.brand': 'BCD Customer Center', - 'h5.login.brandName': 'BCD', - 'h5.login.brandHint': 'Welcome to your BCD portal', + 'h5.login.brand': '{name} Customer Center', + 'h5.login.brandHint': 'Welcome to your {name} portal', 'h5.login.backToSite': 'Back to website', 'h5.login.tab.wechat': 'WeChat', 'h5.login.tab.password': 'Account', @@ -379,6 +378,20 @@ export default { 'h5.recharge.backMe': 'Back to Me', 'h5.recharge.done': 'Done', + 'h5.invoice.title': 'Invoices', + 'h5.invoice.apply': 'Request invoice', + 'h5.invoice.profiles': 'Titles', + 'h5.invoice.empty': 'No invoice applies yet', + 'h5.invoice.submit': 'Submit', + 'h5.invoice.needProfile': 'Enter invoice title and tax no.', + 'h5.invoice.needLines': 'Select invoice lines', + 'h5.invoice.success': 'Invoice apply submitted', + 'h5.invoice.failed': 'Submit failed', + 'h5.invoice.loadMore': 'Load more', + 'h5.invoice.selectableEmpty': 'No billable sources', + 'h5.invoice.selectedAmount': 'Selected total', + 'h5.invoice.back': 'Back', + 'h5.orderType.title': 'Choose order type', 'h5.orderType.subtitle': 'Select the type of order to create', 'h5.orderType.logistics': 'Shipping order', @@ -709,6 +722,7 @@ export default { 'h5.me.inviteDesc': 'Invite & earn', 'h5.me.commission': 'Commission', 'h5.me.commissionDesc': 'Withdraw / balance', + 'h5.me.invoice': 'Invoice', 'h5.me.placeOrder': 'Order', 'h5.me.placeOrderDesc': 'Ship in a few taps', 'h5.me.section.services': 'Services', diff --git a/src/views/h5/customer-center/locale/zh-CN.ts b/src/views/h5/customer-center/locale/zh-CN.ts index 4a15bee..0f53443 100644 --- a/src/views/h5/customer-center/locale/zh-CN.ts +++ b/src/views/h5/customer-center/locale/zh-CN.ts @@ -1,6 +1,6 @@ export default { 'h5.center.title': '客户中心', - 'h5.documentTitle': 'BCD客户中心', + 'h5.documentTitle': '{name}客户中心', 'h5.noticePopup.title': '公告', 'h5.noticePopup.markRead': '已读', 'h5.noticePopup.later': '稍后', @@ -325,9 +325,8 @@ export default { 'h5.wxQr.success': '登录成功', 'h5.login.title': '登录', - 'h5.login.brand': 'BCD客户中心', - 'h5.login.brandName': 'BCD', - 'h5.login.brandHint': '欢迎登录 BCD 客户门户', + 'h5.login.brand': '{name}客户中心', + 'h5.login.brandHint': '欢迎登录 {name} 客户门户', 'h5.login.backToSite': '返回官网', 'h5.login.tab.wechat': '微信登录', 'h5.login.tab.password': '账号登录', @@ -378,6 +377,20 @@ export default { 'h5.recharge.backMe': '返回我的', 'h5.recharge.done': '完成', + 'h5.invoice.title': '发票', + 'h5.invoice.apply': '申请开票', + 'h5.invoice.profiles': '抬头', + 'h5.invoice.empty': '暂无开票申请', + 'h5.invoice.submit': '提交申请', + 'h5.invoice.needProfile': '请填写发票抬头和税号', + 'h5.invoice.needLines': '请选择开票明细', + 'h5.invoice.success': '已提交开票申请', + 'h5.invoice.failed': '提交失败', + 'h5.invoice.loadMore': '加载更多', + 'h5.invoice.selectableEmpty': '暂无可开票来源', + 'h5.invoice.selectedAmount': '已选合计', + 'h5.invoice.back': '返回', + 'h5.orderType.title': '选择下单类型', 'h5.orderType.subtitle': '请先选择要创建的订单类型', 'h5.orderType.logistics': '物流订单', @@ -696,6 +709,7 @@ export default { 'h5.me.inviteDesc': '邀友有礼', 'h5.me.commission': '佣金', 'h5.me.commissionDesc': '提现/转余额', + 'h5.me.invoice': '开票', 'h5.me.placeOrder': '去下单', 'h5.me.placeOrderDesc': '填好收件,一键寄出', 'h5.me.section.services': '常用服务', diff --git a/src/views/h5/customer-center/login/index.vue b/src/views/h5/customer-center/login/index.vue index 9f85d95..691a87e 100644 --- a/src/views/h5/customer-center/login/index.vue +++ b/src/views/h5/customer-center/login/index.vue @@ -13,7 +13,7 @@ - {{ t('h5.login.brandName') }} + {{ brandCopy.navName }} @@ -47,9 +47,9 @@ - + - +