diff --git a/hzhub-portal-dealer/src/api/auth/index.ts b/hzhub-portal-dealer/src/api/auth/index.ts index c1b21b9..53112bb 100644 --- a/hzhub-portal-dealer/src/api/auth/index.ts +++ b/hzhub-portal-dealer/src/api/auth/index.ts @@ -1,8 +1,11 @@ -import type { EmailCodeDTO, LoginDTO, LoginVO, RegisterDTO } from './types'; -import { post } from '@/utils/request'; +import type { EmailCodeDTO, LoginDTO, LoginVO, RegisterDTO, TenantResp } from './types'; +import { post, get } from '@/utils/request'; export const login = (data: LoginDTO) => post('/auth/login', data).json(); +// 获取租户列表 +export const tenantList = () => get('/auth/tenant/list').json(); + // 邮箱验证码 export const emailCode = (data: EmailCodeDTO) => post('/resource/email/code', data).json(); diff --git a/hzhub-portal-dealer/src/api/auth/types.ts b/hzhub-portal-dealer/src/api/auth/types.ts index 84eaced..5c6cf41 100644 --- a/hzhub-portal-dealer/src/api/auth/types.ts +++ b/hzhub-portal-dealer/src/api/auth/types.ts @@ -16,6 +16,19 @@ export interface LoginVO { userInfo?: LoginUser; } +// 租户选项 +export interface TenantOption { + companyName: string; + domain?: string; + tenantId: string; +} + +// 租户列表响应 +export interface TenantResp { + tenantEnabled: boolean; + voList: TenantOption[]; +} + /** * LoginUser,登录用户身份权限 */ diff --git a/hzhub-portal-dealer/src/api/erp/index.ts b/hzhub-portal-dealer/src/api/erp/index.ts new file mode 100644 index 0000000..0cd2f1d --- /dev/null +++ b/hzhub-portal-dealer/src/api/erp/index.ts @@ -0,0 +1,92 @@ +import request from '@/utils/request'; + +/** + * 测试 ERP 数据库连接 + */ +export function testErpConnection() { + return request.get<{ + status: string; + database: string; + version: string; + error?: string; + }>('/erp/test/connection').json(); +} + +/** + * ERP 健康检查 + */ +export function erpHealth() { + return request.get('/erp/test/health').json(); +} + +/** + * 客户档案接口类型 + */ +export interface CustomerVO { + customerCode: string; + customerName: string; + companyCode: string; + companyName: string; + brand: string; + brandName: string; + contactName: string; + salesAreaCode: string; + salesAreaName: string; + salesPersonCode: string; + salesPersonName: string; + saleDocCode: string; + saleDocName: string; + pricePlanCode: string; + pricePlanName: string; + customerType: string; + address: string; + phone: string; + email: string; + sdOrgCode: string; + sdOrgName: string; + province: string; + city: string; + isStop: number; +} + +/** + * 分页查询客户列表 + * 使用动态API: /erp/dynamic/v1/customer/list + */ +export function getCustomerList(params: { + pageNum: number; + pageSize: number; + keyword?: string; + companyCode?: string; + salesAreaCode?: string; + brand?: string; +}) { + return request.get<{ rows: CustomerVO[]; total: number; code: number; msg: string }>( + '/erp/dynamic/v1/customer/list', + params + ).json(); +} + +/** + * 获取客户详情 + * 使用动态API: /erp/dynamic/v1/customer/detail + */ +export function getCustomerDetail(customerCode: string) { + return request.get<{ code: number; msg: string; data: CustomerVO }>(`/erp/dynamic/v1/customer/detail?customerCode=${customerCode}`).json(); +} + +/** + * 获取销区列表 + * 使用动态API: /erp/dynamic/v1/customer/sales-areas + */ +export function getSalesAreas() { + return request.get<{ code: number; msg: string; data: CustomerVO[] }>('/erp/dynamic/v1/customer/sales-areas').json(); +} + +/** + * 获取品牌列表 + * 使用动态API: /erp/dynamic/v1/customer/brands + */ +export function getBrands() { + return request.get<{ code: number; msg: string; data: CustomerVO[] }>('/erp/dynamic/v1/customer/brands').json(); +} \ No newline at end of file diff --git a/hzhub-portal-dealer/src/components/LoginDialog/components/FormLogin/AccountPassword.vue b/hzhub-portal-dealer/src/components/LoginDialog/components/FormLogin/AccountPassword.vue index b289a35..cbf8d6d 100644 --- a/hzhub-portal-dealer/src/components/LoginDialog/components/FormLogin/AccountPassword.vue +++ b/hzhub-portal-dealer/src/components/LoginDialog/components/FormLogin/AccountPassword.vue @@ -1,26 +1,36 @@ @@ -58,6 +111,18 @@ async function handleSubmit() { style="width: 230px" @submit.prevent="handleSubmit" > + + + + + + +