import { requestClient } from '#/api/request';
|
|
export namespace MesPdPriceApi {
|
/** 阶梯电价测算请求 */
|
export interface PriceCalcReq {
|
calcType: number; // 测算类型(1服务套餐/2电压等级)
|
packageId?: number; // 服务套餐ID(calcType=1 时必填)
|
voltageLevelId?: number; // 电压等级ID(calcType=2 时必填)
|
quantity: number; // 用电量(kWh)
|
}
|
|
/** 阶梯电价测算分档明细 */
|
export interface PriceCalcDetail {
|
startValue?: number; // 档位下限(含,kWh)
|
endValue?: number; // 档位上限(不含,kWh,可空=上不封顶)
|
tierQuantity?: number; // 落入本档电量(kWh)
|
pricePerUnit?: number; // 档位单价
|
subtotal?: number; // 小计
|
}
|
|
/** 阶梯电价测算响应 */
|
export interface PriceCalcResp {
|
packageName?: string; // 服务套餐名称
|
voltageLevelName?: string; // 电压等级名称
|
originalPrice?: number; // 原价(未优惠)
|
discountAmount?: number; // 优惠金额
|
finalPrice?: number; // 优惠后总价
|
details?: PriceCalcDetail[]; // 分档明细
|
}
|
}
|
|
/** 阶梯电价测算 */
|
export function calcPrice(data: MesPdPriceApi.PriceCalcReq) {
|
return requestClient.post<MesPdPriceApi.PriceCalcResp>(
|
'/mes/pd/price/calc',
|
data,
|
);
|
}
|