diff --git a/frontend/src/api/https/index.ts b/frontend/src/api/https/index.ts index cc727db..02baa00 100644 --- a/frontend/src/api/https/index.ts +++ b/frontend/src/api/https/index.ts @@ -6,6 +6,7 @@ import { errorCodeType } from './errorCodeType' import { generateAcceptLanguageHeader } from '@/utils/language' // 路由 import router from '@/router' +export const envUrl1 = import.meta.env.VITE_API_BASE_URL const envUrl = import.meta.env.VITE_API_BASE_URL console.log('API Base URL:', envUrl) diff --git a/frontend/src/api/invoice.ts b/frontend/src/api/invoice.ts index d9e2dfc..e29889f 100644 --- a/frontend/src/api/invoice.ts +++ b/frontend/src/api/invoice.ts @@ -12,7 +12,7 @@ export interface Invoice { order_package_name: string; created_at: string; updated_at: string; - status: 'pending' | 'completed' | 'rejected'; + status: 'pending' | 'success' | 'rejected'; status_display: string; amount: number; title: string; @@ -117,3 +117,11 @@ export function uploadInvoice(data: FormData): Promise { export function rejectInvoice(id: string, data: any): Promise { return Axios.post(`/api/v1/invoices/${id}/reject`, data) } + +/** + * 管理员发票开票 + */ +export function issueInvoice(id: string, data: { invoice_file_url: string, issued_at: string }): Promise { + return Axios.post(`/api/v1/invoices/${id}/issue`, data) +} + diff --git a/frontend/src/api/lead.ts b/frontend/src/api/lead.ts new file mode 100644 index 0000000..083aa84 --- /dev/null +++ b/frontend/src/api/lead.ts @@ -0,0 +1,86 @@ +import Axios from './https' + +// 企业线索接口类型定义 +export interface Lead { + id: string; + lead_no: string; + company_name: string; + contact_name: string; + contact_phone: string; + contact_email: string; + requirement: string; + extra_info: string; + status: 'pending' | 'contacting' | 'completed' | 'rejected'; + follow_up_date: string | null; + follow_up_record: string; + internal_note: string; + created_at: string; + updated_at: string; +} + +// 查询请求参数 +export interface LeadQueryRequest { + page?: number; + page_size?: number; + search?: string; + status?: string; +} + +// 通用响应接口 +export interface ApiResponse { + code: string; + message: string; + timestamp: string; + data?: T; +} + +// 分页数据响应接口 +export interface LeadQueryResponse { + code: string; + message: string; + timestamp: string; + data: { + leads: Lead[]; + total_count: number; + page: number; + page_size: number; + }; +} + +/** + * 获取企业线索列表 + */ +export function getLeads(params?: LeadQueryRequest): Promise { + return Axios.get('/api/leads', { params }) +} + +/** + * 获取企业线索统计数据 (假设有这个接口,如果没有则前端计算或者等后续补充) + */ +export function getLeadSummary(): Promise> { + return Axios.get('/api/leads/summary') +} + +/** + * 获取企业线索详情 + */ +export function getLeadDetail(id: string | number): Promise> { + return Axios.get(`/api/leads/${id}`) +} + +/** + * 更新企业线索 + */ +export function updateLead(id: string | number, data: Partial): Promise> { + return Axios.put(`/api/leads/${id}`, data) +} + +/** + * 删除企业线索 + */ +export function deleteLead(id: string | number): Promise> { + return Axios.delete(`/api/leads/${id}`) +} + + + diff --git a/frontend/src/api/package.ts b/frontend/src/api/package.ts new file mode 100644 index 0000000..1b68171 --- /dev/null +++ b/frontend/src/api/package.ts @@ -0,0 +1,53 @@ +import Axios from './https' + +// 套餐接口类型定义 +export interface Package { + id: string | number; + name: string; + price: number; + price_description?: string; + duration_description: string; + status: number; // 1: enabled, 2: disabled + type: string; + sort_order: number; + description?: string; + features?: any; + remark?: string; + created_at: string; + updated_at: string; +} + +// 套餐列表响应定义 +export interface PackageListResponse { + packages: Package[]; + total_count: number; +} + +// 通用响应接口 +export interface ApiResponse { + code: string; + message: string; + timestamp: string; + data?: T; +} + +/** + * 获取套餐列表 + */ +export function getPackages(): Promise> { + return Axios.get('/api/packages') +} + +/** + * 获取套餐详情 + */ +export function getPackageDetail(id: string | number): Promise> { + return Axios.get(`/api/packages/${id}`) +} + +/** + * 更新套餐 + */ +export function updatePackage(id: string | number, data: Partial): Promise> { + return Axios.put(`/api/packages/${id}`, data) +} diff --git a/frontend/src/i18n/locales/zh.json b/frontend/src/i18n/locales/zh.json index c18b71c..26bda95 100644 --- a/frontend/src/i18n/locales/zh.json +++ b/frontend/src/i18n/locales/zh.json @@ -152,6 +152,19 @@ "recordPlaceholder": "记录与客户的沟通情况,反馈,下一步计划...", "remarkPlaceholder": "内部使用的备注信息,客户不可见", "statusRequired": "请选择状态" + }, + "validation": { + "nameRequired": "请输入企业名称", + "contactRequired": "请输入联系人" + }, + "messages": { + "fetchError": "获取列表失败", + "fetchDetailError": "获取详情失败", + "updateSuccess": "更新成功", + "updateError": "更新失败", + "deleteSuccess": "删除成功", + "deleteError": "删除失败", + "deleteConfirm": "确认删除该线索吗?此操作不可撤销。" } }, @@ -162,6 +175,8 @@ "id": "套餐ID", "name": "套餐名称", "price": "价格", + "free": "免费", + "customPlan": "定制方案", "cycle": "周期", "createdAt": "创建时间", "updatedAt": "更新时间", @@ -179,12 +194,14 @@ "price": "价格", "cycle": "周期/描述", "description": "套餐描述", + "priceDescription": "价格描述", "features": "套餐特性", "status": "状态", "sort": "显示顺序", "remark": "备注", "save": "保存更改", "descPlaceholder": "体验完整功能,适合新用户试用评估", + "priceDescPlaceholder": "例如:定制方案 / 按需定价", "remarkPlaceholder": "请输入备注", "featurePlaceholder": "请输入特性内容" } @@ -196,7 +213,7 @@ "stats": { "all": "全部发票申请", "pending": "待处理申请", - "success": "已开票", + "completed": "已开票", "rejected": "已驳回" }, "filter": { @@ -205,7 +222,7 @@ "statusLabel": "开票状态:", "allStatus": "全部状态", "pending": "待处理", - "success": "已开票", + "completed": "已开票", "rejected": "已驳回", "timeLabel": "申请时间:", "reset": "重置", diff --git a/frontend/src/views/EnterpriseLeads/components/LeadDetailDialog.vue b/frontend/src/views/EnterpriseLeads/components/LeadDetailDialog.vue index 3873221..883e094 100644 --- a/frontend/src/views/EnterpriseLeads/components/LeadDetailDialog.vue +++ b/frontend/src/views/EnterpriseLeads/components/LeadDetailDialog.vue @@ -1,23 +1,23 @@