From 8cdaa3c69c09a155159dde6dcd4e47e67909e193 Mon Sep 17 00:00:00 2001 From: zhouyanli <593579392@qq.com> Date: Thu, 5 Nov 2026 09:27:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=B8=AE=E5=8A=A9=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E3=80=81=E7=94=B5=E8=AF=9D=E3=80=81=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/income/index.ts | 29 ++ src/api/income/types.ts | 134 +++++++++ src/api/merchant/index.ts | 88 ++++++ src/api/merchant/types.ts | 214 +++++++++++++++ src/api/system/platformConfig/index.ts | 65 +++++ src/api/system/platformConfig/types.ts | 116 ++++++++ src/api/system/servicePhone/index.ts | 73 +++++ src/api/system/servicePhone/types.ts | 120 ++++++++ src/api/withdrawal/index.ts | 17 ++ src/api/withdrawal/types.ts | 97 +++++++ src/views/biz/device/index.vue | 8 +- src/views/biz/help/index.vue | 2 +- src/views/biz/income/statistics.vue | 365 +++++++++++++++++++++++++ src/views/biz/merchant/detail.vue | 285 +++++++++++++++++++ src/views/income/income-stat.vue | 12 + src/views/income/statistics.vue | 12 + src/views/login.vue | 4 +- src/views/system/params/index.vue | 171 ++++++++++++ src/views/system/phone/index.vue | 329 ++++++++++++++-------- 19 files changed, 2026 insertions(+), 115 deletions(-) create mode 100644 src/api/income/index.ts create mode 100644 src/api/income/types.ts create mode 100644 src/api/merchant/index.ts create mode 100644 src/api/merchant/types.ts create mode 100644 src/api/system/platformConfig/index.ts create mode 100644 src/api/system/platformConfig/types.ts create mode 100644 src/api/system/servicePhone/index.ts create mode 100644 src/api/system/servicePhone/types.ts create mode 100644 src/api/withdrawal/index.ts create mode 100644 src/api/withdrawal/types.ts create mode 100644 src/views/biz/income/statistics.vue create mode 100644 src/views/biz/merchant/detail.vue create mode 100644 src/views/income/income-stat.vue create mode 100644 src/views/income/statistics.vue create mode 100644 src/views/system/params/index.vue diff --git a/src/api/income/index.ts b/src/api/income/index.ts new file mode 100644 index 0000000..bbcb410 --- /dev/null +++ b/src/api/income/index.ts @@ -0,0 +1,29 @@ +import type { IncomeRecordQuery, IncomeRecordVO, IncomeStatisticsPeriodType, IncomeStatisticsVO } from '@/api/income/types'; +import type { PageResult } from '@/api/types'; +import type { AxiosPromise } from '@/utils/api-types'; +import request from '@/utils/request'; + +/** + * 查询收入明细列表 + * @param query + * @returns {*} + */ +export const listIncome = (query?: IncomeRecordQuery): AxiosPromise> => { + return request({ + url: '/merchantManage/incomeRecord/list', + method: 'get', + params: query + }); +}; + +/** + * 查询收入统计 + * @param periodType month 按月(趋势按天) / year 按年(趋势按月) + */ +export const getIncomeStatistics = (periodType: IncomeStatisticsPeriodType): AxiosPromise => { + return request({ + url: '/merchantManage/incomeRecord/statistics', + method: 'get', + params: { periodType } + }); +}; diff --git a/src/api/income/types.ts b/src/api/income/types.ts new file mode 100644 index 0000000..4e114b5 --- /dev/null +++ b/src/api/income/types.ts @@ -0,0 +1,134 @@ +export interface IncomeRecordVO { + /** + * 收入ID + */ + incomeId: string | number; + /** + * 商户ID + */ + merchantId?: string | number | null; + /** + * 商户名称 + */ + merchantName?: string | null; + /** + * 房间ID + */ + roomId?: string | number | null; + /** + * 房间名称 + */ + roomName?: string | null; + /** + * 房间号(如「101室」) + */ + roomNo?: string | null; + /** + * 设备ID + */ + deviceId?: string | number | null; + /** + * 设备名称 + */ + deviceName?: string | null; + /** + * 设备编号 + */ + deviceNo?: string | null; + /** + * 设备类型(0:电表,1:水表) + */ + deviceType?: string | null; + /** + * 用户ID + */ + userId?: string | number | null; + /** + * 充值记录ID + */ + rechargeId?: string | number | null; + /** + * 金额,后端以字符串返回(如 "0.00") + */ + amount?: string | number | null; + /** + * 收入类型(0电费 1水费) + */ + incomeType?: string | null; + /** + * 收入渠道 + */ + incomeChannel?: string | null; + /** + * 交易时间 + */ + occurredAt?: string | null; + /** + * 状态 + */ + status?: string | null; +} + +/** 统计周期:month 按月 / year 按年 */ +export type IncomeStatisticsPeriodType = 'month' | 'year'; + +export interface IncomeTrendPoint { + /** + * 金额,后端以字符串返回(如 "0.00") + */ + amount: string | number; + /** + * X 轴刻度(如「1月」「3日」) + */ + label: string; + /** + * 周期序号 + */ + periodIndex: number; +} + +export interface IncomeStatisticsVO { + /** + * 对比对象文案(如「较上年」「较上月」) + */ + compareLabel?: string; + /** + * 增长率(百分数,字符串如 "12.34" / "-5.20") + */ + growthRate?: string | number; + /** + * 月份(按年统计时为 null) + */ + month?: number | null; + /** + * 统计周期 + */ + periodType?: IncomeStatisticsPeriodType; + /** + * 合计标题(如「2026年合计收入」) + */ + title?: string; + /** + * 合计收入,后端以字符串返回(如 "0.00") + */ + totalAmount?: string | number; + /** + * 趋势数据 + */ + trendList?: IncomeTrendPoint[]; + /** + * 年份 + */ + year?: number; +} + +export interface IncomeRecordQuery extends PageQuery { + /** + * 设备类型(0:电表,1:水表) + */ + deviceType?: string; + /** + * 日期范围参数(beginOccurredAt / endOccurredAt) + */ + params?: any; +} diff --git a/src/api/merchant/index.ts b/src/api/merchant/index.ts new file mode 100644 index 0000000..74c3c7a --- /dev/null +++ b/src/api/merchant/index.ts @@ -0,0 +1,88 @@ +import type { MerchantDeviceVO, MerchantForm, MerchantQuery, MerchantVO } from '@/api/merchant/types'; +import type { PageResult } from '@/api/types'; +import type { AxiosPromise } from '@/utils/api-types'; +import request from '@/utils/request'; + +/** + * 查询水电业务商户(房东)列表 + * @param query + * @returns {*} + */ +export const listMerchant = (query?: MerchantQuery): AxiosPromise> => { + return request({ + url: '/merchantManage/merchant/list', + method: 'get', + params: query + }); +}; + +/** + * 查询水电业务商户(房东)详细 + * @param merchantId + */ +export const getMerchant = (merchantId: string | number): AxiosPromise => { + return request({ + url: '/merchantManage/merchant/' + merchantId, + method: 'get' + }); +}; + +/** + * 新增水电业务商户(房东) + * @param data + */ +export const addMerchant = (data: MerchantForm) => { + return request({ + url: '/merchantManage/merchant', + method: 'post', + data: data + }); +}; + +/** + * 修改水电业务商户(房东) + * @param data + */ +export const updateMerchant = (data: MerchantForm) => { + return request({ + url: '/merchantManage/merchant', + method: 'put', + data: data + }); +}; + + + +/** + * 查询商户名下的设备(详情页「设备分配」) + * @param merchantId 商户ID + */ +export const listMerchantDevices = (merchantId: string | number): AxiosPromise => { + return request({ + url: '/merchantManage/merchant/' + merchantId + '/devices', + method: 'get' + }); +}; + +/** + * 修改水电业务商户(房东)状态 + * @param merchantId 商户ID + * @param status 状态(0正常 1禁用) + */ +export const changeMerchantStatus = (merchantId: string | number, status: string) => { + return request({ + url: '/merchantManage/merchant/status/' + merchantId + '/' + status, + method: 'put' + }); +}; + +/** + * 删除水电业务商户(房东) + * @param merchantId + */ +export const delMerchant = (merchantId: string | number | Array) => { + return request({ + url: '/merchantManage/merchant/' + merchantId, + method: 'delete' + }); +}; diff --git a/src/api/merchant/types.ts b/src/api/merchant/types.ts new file mode 100644 index 0000000..c5325b3 --- /dev/null +++ b/src/api/merchant/types.ts @@ -0,0 +1,214 @@ +export interface MerchantVO { + /** + * 商户ID + */ + merchantId: string | number; + /** + * 房东用户ID + */ + ownerUserId: string | number; + /** + * 商户编号 + */ + merchantNo: string; + /** + * 商户名称 + */ + merchantName: string; + /** + * 联系人 + */ + contactName: string; + /** + * 联系电话 + */ + contactPhone: string; + /** + * 商户头像 + */ + avatarUrl: string | null; + /** + * 默认电费单价(元/度),后端以字符串返回(如 "0.0000") + */ + defaultElectricPrice: string | number; + /** + * 默认水费单价(元/吨),后端以字符串返回(如 "0.0000") + */ + defaultWaterPrice: string | number; + /** + * 状态(0正常 1禁用) + */ + status: string; + /** + * 绑定设备数 + */ + bindingDeviceCount?: number; + /** + * 用户数 + */ + userCount?: number; + /** + * 本月收入,后端以字符串返回(如 "0.00") + */ + monthIncome?: string | number; + /** + * 累计收入,后端以字符串返回(如 "0.00") + */ + totalIncome?: string | number; + /** + * 创建时间(详情页展示) + */ + createTime?: string; + /** + * 更新时间(详情页展示) + */ + updateTime?: string; +} + +/** + * 商户名下的设备(详情页「设备分配」列表) + */ +export interface MerchantDeviceVO { + /** 设备ID */ + deviceId: string | number; + /** 设备编号 */ + deviceNo: string; + /** 设备名称 */ + deviceName: string; + /** 设备类型(0:电表,1:水表) */ + deviceType: string; + /** 房间号,如「101室」 */ + roomNo?: string | null; + /** 房间名称(后端可能为空,回退 roomNo / roomId) */ + roomName?: string | null; + /** 房间ID */ + roomId?: string | number | null; + /** 剩余金额,后端以字符串返回(如 "0.00") */ + remainingBalance?: string | number | null; + /** 当前单价,后端可能为空 */ + currentUnitPrice?: string | number | null; + /** 设备启用状态 */ + status?: string; + /** 开关状态(0正常 1强制拉闸 2欠费拉闸 3离线) */ + switchStatus?: string; + /** 通讯类型 */ + communicationType?: string | null; +} + +export interface MerchantForm extends BaseEntity { + /** + * 商户ID + */ + merchantId?: string | number; + /** + * 房东用户ID + */ + ownerUserId?: number; + /** + * 商户编号 + */ + merchantNo?: string; + /** + * 商户名称 + */ + merchantName?: string; + /** + * 联系人 + */ + contactName?: string; + /** + * 联系电话 + */ + contactPhone?: string; + /** + * 商户头像 + */ + avatarUrl?: string; + /** + * 默认电费单价(元/度) + */ + defaultElectricPrice?: number; + /** + * 默认水费单价(元/吨) + */ + defaultWaterPrice?: number; + /** + * 状态(0正常 1禁用) + */ + status?: string; + /** + * 创建后台账号ID + */ + createBy?: number; + /** + * 创建时间 + */ + createTime?: string; + /** + * 更新后台账号ID + */ + updateBy?: number; + /** + * 更新时间 + */ + updateTime?: string; +} + +export interface MerchantQuery extends PageQuery { + /** + * 房东用户ID + */ + ownerUserId?: string | number; + /** + * 商户编号 + */ + merchantNo?: string; + /** + * 商户名称 + */ + merchantName?: string; + /** + * 联系人 + */ + contactName?: string; + /** + * 联系电话 + */ + contactPhone?: string; + /** + * 商户头像 + */ + avatarUrl?: string; + /** + * 默认电费单价(元/度) + */ + defaultElectricPrice?: number; + /** + * 默认水费单价(元/吨) + */ + defaultWaterPrice?: number; + /** + * 状态(0正常 1禁用) + */ + status?: string; + /** + * 创建后台账号ID + */ + createBy?: number; + /** + * 创建时间 + */ + createTime?: string; + /** + * 更新后台账号ID + */ + updateBy?: number; + /** + * 更新时间 + */ + updateTime?: string; + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/system/platformConfig/index.ts b/src/api/system/platformConfig/index.ts new file mode 100644 index 0000000..8480f1b --- /dev/null +++ b/src/api/system/platformConfig/index.ts @@ -0,0 +1,65 @@ +import type { PlatformConfigForm, PlatformConfigQuery, PlatformConfigVO } from './types'; +import type { PageResult } from '@/api/types'; +import type { AxiosPromise } from '@/utils/api-types'; +import request from '@/utils/request'; + +/** + * 查询水电充值平台配置列表 + * @param query + * @returns {*} + */ +export const listPlatformConfig = (query?: PlatformConfigQuery): AxiosPromise> => { + return request({ + url: '/rechargeManage/platformConfig/list', + method: 'get', + params: query + }); +}; + +/** + * 查询水电充值平台配置详细 + * @param configId + */ +export const getPlatformConfig = (configId: string | number): AxiosPromise => { + return request({ + url: '/rechargeManage/platformConfig/' + configId, + method: 'get' + }); +}; + +/** + * 新增水电充值平台配置 + * @param data + */ +export const addPlatformConfig = (data: PlatformConfigForm) => { + return request({ + url: '/rechargeManage/platformConfig', + method: 'post', + data: data + }); +}; + +/** + * 修改水电充值平台配置 + * @param data + */ +export const updatePlatformConfig = (data: PlatformConfigForm) => { + return request({ + url: '/rechargeManage/platformConfig', + method: 'put', + data: data + }); +}; + + + +/** + * 删除水电充值平台配置 + * @param configId + */ +export const delPlatformConfig = (configId: string | number | Array) => { + return request({ + url: '/rechargeManage/platformConfig/' + configId, + method: 'delete' + }); +}; diff --git a/src/api/system/platformConfig/types.ts b/src/api/system/platformConfig/types.ts new file mode 100644 index 0000000..e74db5d --- /dev/null +++ b/src/api/system/platformConfig/types.ts @@ -0,0 +1,116 @@ +export interface PlatformConfigVO { + /** + * 配置ID + */ + configId: string | number; + /** + * 配置键 + */ + configKey: string; + /** + * 配置值 + */ + configValue: string; + /** + * 值类型(0string 1integer 2decimal) + */ + valueType: string; + /** + * 配置说明 + */ + remark: string; + /** + * 状态(0启用 1停用) + */ + status: string; +} + +export interface PlatformConfigForm extends BaseEntity { + /** + * 配置ID + */ + configId?: string | number; + /** + * 配置键 + */ + configKey?: string; + /** + * 配置值 + */ + configValue?: string; + /** + * 值类型(0string 1integer 2decimal) + */ + valueType?: string; + /** + * 配置说明 + */ + remark?: string; + /** + * 状态(0启用 1停用) + */ + status?: string; + /** + * 创建部门 + */ + createDept?: number; + /** + * 创建后台账号ID + */ + createBy?: number; + /** + * 创建时间 + */ + createTime?: string; + /** + * 更新后台账号ID + */ + updateBy?: number; + /** + * 更新时间 + */ + updateTime?: string; +} + +export interface PlatformConfigQuery extends PageQuery { + /** + * 配置键 + */ + configKey?: string; + /** + * 配置值 + */ + configValue?: string; + /** + * 值类型(0string 1integer 2decimal) + */ + valueType?: string; + /** + * 状态(0启用 1停用) + */ + status?: string; + /** + * 创建部门 + */ + createDept?: number; + /** + * 创建后台账号ID + */ + createBy?: number; + /** + * 创建时间 + */ + createTime?: string; + /** + * 更新后台账号ID + */ + updateBy?: number; + /** + * 更新时间 + */ + updateTime?: string; + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/system/servicePhone/index.ts b/src/api/system/servicePhone/index.ts new file mode 100644 index 0000000..5e7287a --- /dev/null +++ b/src/api/system/servicePhone/index.ts @@ -0,0 +1,73 @@ +import type { ServicePhoneForm, ServicePhoneQuery, ServicePhoneVO } from '@/api/system/servicePhone/types'; +import type { PageResult } from '@/api/types'; +import type { AxiosPromise } from '@/utils/api-types'; +import request from '@/utils/request'; + +/** + * 查询客服及服务电话列表 + * @param query + * @returns {*} + */ +export const listServicePhone = (query?: ServicePhoneQuery): AxiosPromise> => { + return request({ + url: '/system/servicePhone/list', + method: 'get', + params: query + }); +}; + +/** + * 查询客服及服务电话详细 + * @param phoneId + */ +export const getServicePhone = (phoneId: string | number): AxiosPromise => { + return request({ + url: '/system/servicePhone/' + phoneId, + method: 'get' + }); +}; + +/** + * 新增客服及服务电话 + * @param data + */ +export const addServicePhone = (data: ServicePhoneForm) => { + return request({ + url: '/system/servicePhone', + method: 'post', + data: data + }); +}; + +/** + * 修改客服及服务电话 + * @param data + */ +export const updateServicePhone = (data: ServicePhoneForm) => { + return request({ + url: '/system/servicePhone', + method: 'put', + data: data + }); +};/** + * 启用 / 停用客服及服务电话 + * @param phoneId + * @param status 状态(0启用 1停用) + */ +export const changeServicePhoneStatus = (phoneId: string | number, status: string) => { + return request({ + url: '/system/servicePhone/' + phoneId + '/' + status, + method: 'put' + }); +}; + +/** + * 删除客服及服务电话 + * @param phoneId + */ +export const delServicePhone = (phoneId: string | number | Array) => { + return request({ + url: '/system/servicePhone/' + phoneId, + method: 'delete' + }); +}; diff --git a/src/api/system/servicePhone/types.ts b/src/api/system/servicePhone/types.ts new file mode 100644 index 0000000..08ec4d5 --- /dev/null +++ b/src/api/system/servicePhone/types.ts @@ -0,0 +1,120 @@ +export interface ServicePhoneVO { + /** + * 服务电话ID + */ + phoneId: string | number; + /** + * 电话类型 + */ + phoneType: string; + /** + * 电话号码 + */ + phoneNumber: string; + /** + * 说明 + */ + description: string; + /** + * 排序号 + */ + sortNo: number; + /** + * 状态(0启用 1停用) + */ + status: string; +} + +export interface ServicePhoneForm extends BaseEntity { + /** + * 服务电话ID + */ + phoneId?: string | number; + /** + * 电话类型 + */ + phoneType?: string; + /** + * 电话号码 + */ + phoneNumber?: string; + /** + * 说明 + */ + description?: string; + /** + * 排序号 + */ + sortNo?: number; + /** + * 状态(0启用 1停用) + */ + status?: string; + /** + * 创建部门 + */ + createDept?: number; + /** + * 创建后台账号ID + */ + createBy?: number; + /** + * 创建时间 + */ + createTime?: string; + /** + * 更新后台账号ID + */ + updateBy?: number; + /** + * 更新时间 + */ + updateTime?: string; +} + +export interface ServicePhoneQuery extends PageQuery { + /** + * 电话类型 + */ + phoneType?: string; + /** + * 电话号码 + */ + phoneNumber?: string; + /** + * 说明 + */ + description?: string; + /** + * 排序号 + */ + sortNo?: number; + /** + * 状态(0启用 1停用) + */ + status?: string; + /** + * 创建部门 + */ + createDept?: number; + /** + * 创建后台账号ID + */ + createBy?: number; + /** + * 创建时间 + */ + createTime?: string; + /** + * 更新后台账号ID + */ + updateBy?: number; + /** + * 更新时间 + */ + updateTime?: string; + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/withdrawal/index.ts b/src/api/withdrawal/index.ts new file mode 100644 index 0000000..235c6ab --- /dev/null +++ b/src/api/withdrawal/index.ts @@ -0,0 +1,17 @@ +import type { PageResult } from '@/api/types'; +import type { WithdrawalQuery, WithdrawalVO } from '@/api/withdrawal/types'; +import type { AxiosPromise } from '@/utils/api-types'; +import request from '@/utils/request'; + +/** + * 查询商户提现申请列表 + * @param query + * @returns {*} + */ +export const listWithdrawal = (query?: WithdrawalQuery): AxiosPromise> => { + return request({ + url: '/merchantManage/merchantWithdrawalOrder/list', + method: 'get', + params: query + }); +}; diff --git a/src/api/withdrawal/types.ts b/src/api/withdrawal/types.ts new file mode 100644 index 0000000..cfc1c58 --- /dev/null +++ b/src/api/withdrawal/types.ts @@ -0,0 +1,97 @@ +export interface WithdrawalVO { + /** + * 提现ID + */ + withdrawalId: string | number; + /** + * 商户ID + */ + merchantId?: string | number | null; + /** + * 钱包ID + */ + walletId?: string | number | null; + /** + * 申请人用户ID + */ + applicantUserId?: string | number | null; + /** + * 申请人姓名 + */ + applicantName?: string | null; + /** + * 申请编号 + */ + applyNo?: string | null; + /** + * 提现金额,后端以字符串返回(如 "100.00") + */ + amount?: string | number | null; + /** + * 银行卡账户ID + */ + bankAccountId?: string | number | null; + /** + * 银行名称 + */ + bankName?: string | null; + /** + * 脱敏卡号 + */ + cardNoMasked?: string | null; + /** + * 收款账户展示文案(如「中国银行 22」) + */ + receiveAccount?: string | null; + /** + * 渠道订单号(打款后回填) + */ + channelOrderNo?: string | null; + /** + * 审核状态(状态码含义以后端为准) + */ + status?: string | null; + /** + * 驳回原因 + */ + rejectReason?: string | null; + /** + * 审核人ID + */ + reviewerId?: string | number | null; + /** + * 审核时间 + */ + reviewedAt?: string | null; + /** + * 打款时间 + */ + paidAt?: string | null; + /** + * 申请时间 + */ + createTime?: string | null; +} + +export interface WithdrawalQuery extends PageQuery { + /** + * 申请编号 + */ + applyNo?: string; + /** + * 申请人姓名 + */ + applicantName?: string; + /** + * 商户ID + */ + merchantId?: string | number; + /** + * 审核状态 + */ + status?: string; + /** + * 日期范围参数(beginCreateTime / endCreateTime) + */ + params?: any; +} diff --git a/src/views/biz/device/index.vue b/src/views/biz/device/index.vue index cc81fa1..debfe76 100644 --- a/src/views/biz/device/index.vue +++ b/src/views/biz/device/index.vue @@ -57,7 +57,13 @@ - + + + +