diff --git a/src/api/app/referral.ts b/src/api/app/referral.ts new file mode 100644 index 0000000..10825a9 --- /dev/null +++ b/src/api/app/referral.ts @@ -0,0 +1,157 @@ +/** + * 推荐客户管理 API + */ +import request from '@/utils/request'; +import { MODULES_API_URL } from '@/config/setting'; + +/** 推荐状态枚举 */ +export const ReferralStatusOptions = [ + { value: 0, label: '待确认' }, + { value: 1, label: '有效' }, + { value: 2, label: '无效' }, + { value: 3, label: '已结算' } +]; + +/** 推荐记录 */ +export interface ReferralRecord { + id?: number; + referralCode?: string; + referrerId?: number; + referrerName?: string; + referrerPhone?: string; + customerName?: string; + customerPhone?: string; + customerCompany?: string; + requirement?: string; + appointmentTime?: string; + remarks?: string; + referralFee?: string | number; + referralStatus?: number; + invalidReason?: string; + invalidTime?: string; + confirmedTime?: string; + settledTime?: string; + createTime?: string; +} + +/** 查询参数 */ +export interface ReferralParam { + pageNum?: number; + pageSize?: number; + referralStatus?: number; + referrerId?: number; + customerName?: string; + customerPhone?: string; + referralCode?: string; + startDate?: string; + endDate?: string; +} + +/** + * 分页查询推荐记录 + */ +export async function pageReferral(params: ReferralParam) { + const res = await request.get<{ + code: number; + message: string; + data: { + list: ReferralRecord[]; + total: number; + pageNum: number; + pageSize: number; + }; + }>(MODULES_API_URL + '/app/lead/referral/admin/page', { params }); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 获取推荐统计 + */ +export async function getStatistics(params: ReferralParam) { + const res = await request.get<{ + code: number; + message: string; + data: Record; + }>(MODULES_API_URL + '/app/lead/referral/admin/statistics', { params }); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 确认推荐有效 + */ +export async function confirmReferral(id: number) { + const res = await request.put<{ code: number; message: string }>( + MODULES_API_URL + '/app/lead/referral/admin/confirm/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 作废推荐 + */ +export async function invalidateReferral(id: number, reason?: string) { + const res = await request.put<{ code: number; message: string }>( + MODULES_API_URL + '/app/lead/referral/admin/invalid/' + id, + { reason } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 结算推荐费 + */ +export async function settleReferral( + id: number, + amount?: number, + remarks?: string +) { + const res = await request.put<{ code: number; message: string }>( + MODULES_API_URL + '/app/lead/referral/admin/settle/' + id, + { amount, remarks } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量结算推荐费 + */ +export async function batchSettleReferrals(ids: number[]) { + const res = await request.put<{ code: number; message: string }>( + MODULES_API_URL + '/app/lead/referral/admin/settle/batch', + ids + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 导出推荐数据 + */ +export async function exportReferrals(params: ReferralParam) { + const res = await request.get<{ + code: number; + message: string; + data: Record[]; + }>(MODULES_API_URL + '/app/lead/referral/admin/export', { params }); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/house/info/index.ts b/src/api/house/info/index.ts new file mode 100644 index 0000000..8e4c250 --- /dev/null +++ b/src/api/house/info/index.ts @@ -0,0 +1,121 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { HouseInfo, HouseInfoParam } from '@/api/house/info/model'; +/** + * 分页查询房源信息 + */ +export async function pageHouseInfo(params: HouseInfoParam) { + const res = await request.get>>( + '/house/info/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询房源信息列表 + */ +export async function listHouseInfo(params?: HouseInfoParam) { + const res = await request.get>('/house/info', { + params + }); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询房源信息 + */ +export async function getHouseInfo(id: number) { + const res = await request.get>('/house/info/' + id); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加房源信息 + */ +export async function addHouseInfo(data: HouseInfo) { + const res = await request.post>('/house/info', data); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改房源信息 + */ +export async function updateHouseInfo(data: HouseInfo) { + const res = await request.put>('/house/info', data); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 绑定房源信息 + */ +export async function bindHouseInfo(data: HouseInfo) { + const res = await request.put>('/house/info/bind', data); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量添加设备 + */ +export async function addBatchHouseInfo(data: HouseInfo[]) { + const res = await request.post>('/house/info/batch', data); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除房源信息 + */ +export async function removeHouseInfo(id?: number) { + const res = await request.delete>('/house/info/' + id); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除房源信息 + */ +export async function removeBatchHouseInfo(data: (number | undefined)[]) { + const res = await request.delete>('/house/info/batch', { + data + }); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量修改房源信息 + */ +export async function updateBatchHouseInfo(data: any) { + const res = await request.put>('/house/info/batch', data); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/house/info/model/index.ts b/src/api/house/info/model/index.ts new file mode 100644 index 0000000..48bd77d --- /dev/null +++ b/src/api/house/info/model/index.ts @@ -0,0 +1,60 @@ +import type { PageParam } from '@/api'; + +export interface HouseInfo { + houseId?: number; + userId?: number; + houseTitle?: string; + cityByHouse?: string; + houseType?: string; + leaseMethod?: string; + rent?: number; + monthlyRent?: number; + extent?: number; + floor?: string; + roomNumber?: string; + realName?: string; + nickname?: string; + houseLabel?: any; + address?: string; + longitude?: string; + latitude?: string; + phone?: string; + password?: string; + toward?: string; + files?: string; + videoUrl?: string; + content?: string; + recommend?: number; + mustSee?: number; + expirationTime?: string; + province?: string; + city?: string; + region?: string; + area?: string; + status?: number; + comments?: any; + sortNumber?: number; + deleted?: number; + tenantId?: number; + createTime?: string; + updateTime?: string; + isEdit?: boolean; + commission?: number; + premium?: string; + propertyFees?: string; + tenancy?: string; + supporting?: string; +} + +/** + * 搜索条件 + */ +export interface HouseInfoParam extends PageParam { + houseId?: number; + houseTitle?: string; + userId?: number; + region?: string; + status?: number; + nickname?: string; + keywords?: any; +} diff --git a/src/api/house/reservation/index.ts b/src/api/house/reservation/index.ts new file mode 100644 index 0000000..4fb04f3 --- /dev/null +++ b/src/api/house/reservation/index.ts @@ -0,0 +1,119 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { + Reservation, + ReservationParam +} from '@/api/house/reservation/model'; +/** + * 分页查询用户详细资料 + */ +export async function pageReservation(params: ReservationParam) { + const res = await request.get>>( + '/house/reservation/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询用户详细资料列表 + */ +export async function listReservation(params?: ReservationParam) { + const res = await request.get>( + '/house/reservation', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加用户详细资料 + */ +export async function addReservation(data: Reservation) { + const res = await request.post>( + '/house/reservation', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改用户详细资料 + */ +export async function updateReservation(data: Reservation) { + const res = await request.put>('/house/reservation', data); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 绑定用户详细资料 + */ +export async function bindReservation(data: Reservation) { + const res = await request.put>( + '/house/reservation/bind', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量添加设备 + */ +export async function addBatchReservation(data: Reservation[]) { + const res = await request.post>( + '/house/reservation/batch', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除用户详细资料 + */ +export async function removeReservation(id?: number) { + const res = await request.delete>( + '/house/reservation/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除用户详细资料 + */ +export async function removeBatchReservation(data: (number | undefined)[]) { + const res = await request.delete>( + '/house/reservation/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/house/reservation/model/index.ts b/src/api/house/reservation/model/index.ts new file mode 100644 index 0000000..36eb966 --- /dev/null +++ b/src/api/house/reservation/model/index.ts @@ -0,0 +1,37 @@ +import type { PageParam } from '@/api'; + +export interface Reservation { + logId?: number; + logNo?: string; + type?: string; + money?: number; + houseId?: number; + realName?: string; + phone?: string; + payTime?: string; + payStatus?: number; + expirationTime?: string; + province?: string; + city?: string; + region?: string; + area?: string; + address?: string; + isSettled?: string; + status?: number; + comments?: any; + sortNumber?: number; + deleted?: number; + tenantId?: number; + createTime?: string; + updateTime?: string; +} + +/** + * 搜索条件 + */ +export interface ReservationParam extends PageParam { + logId?: number; + userId?: number; + status?: number; + keywords?: any; +} diff --git a/src/views/cms/recommendation/index.vue b/src/views/cms/recommendation/index.vue new file mode 100644 index 0000000..e2980ec --- /dev/null +++ b/src/views/cms/recommendation/index.vue @@ -0,0 +1,646 @@ + + + + + diff --git a/src/views/house/info/components/info-edit.vue b/src/views/house/info/components/info-edit.vue new file mode 100644 index 0000000..aafd3a5 --- /dev/null +++ b/src/views/house/info/components/info-edit.vue @@ -0,0 +1,829 @@ + + + + + diff --git a/src/views/house/info/components/search.vue b/src/views/house/info/components/search.vue new file mode 100644 index 0000000..aae2873 --- /dev/null +++ b/src/views/house/info/components/search.vue @@ -0,0 +1,127 @@ + + + + diff --git a/src/views/house/info/index.vue b/src/views/house/info/index.vue new file mode 100644 index 0000000..b585315 --- /dev/null +++ b/src/views/house/info/index.vue @@ -0,0 +1,426 @@ + + + + + + + diff --git a/src/views/house/reservation/components/reservation-edit.vue b/src/views/house/reservation/components/reservation-edit.vue new file mode 100644 index 0000000..a678337 --- /dev/null +++ b/src/views/house/reservation/components/reservation-edit.vue @@ -0,0 +1,739 @@ + + + + + diff --git a/src/views/house/reservation/components/search.vue b/src/views/house/reservation/components/search.vue new file mode 100644 index 0000000..e0ad415 --- /dev/null +++ b/src/views/house/reservation/components/search.vue @@ -0,0 +1,42 @@ + + + + diff --git a/src/views/house/reservation/index.vue b/src/views/house/reservation/index.vue new file mode 100644 index 0000000..8f17161 --- /dev/null +++ b/src/views/house/reservation/index.vue @@ -0,0 +1,360 @@ + + + + + + +