初步支持峰谷

This commit is contained in:
qiaomu 2025-04-21 14:26:22 +08:00
parent 14b0692c13
commit 31290a776e
4 changed files with 760 additions and 159 deletions

View File

@ -10,25 +10,46 @@ import Card from './components/Card';
import Unit from './components/Unit';
import { outputWithPrecision } from '@u/funcs';
import html2pdf from "html2pdf.js";
import ReactToPrint from 'react-to-print';
import dayjs from "dayjs";
import TopTitle from './components/TopTitle';
import TopContent from './components/TopContent';
// 核心代码
import { useSearchParams } from 'react-router-dom'
import {getRoundNumber} from "@/utils";
function getAmount(amount: string, loss: string, refund: string, price: string): string {
return `${
getRoundNumber(
Number(
getRoundNumber(
Number(
(Number(
(Number(amount) + Number(loss)
)
) -
Number(refund)
)
)
)
) * Number(price)
)}`
}
export const UserReport: FC = () => {
const [searchParams] = useSearchParams()
const tid = searchParams.get("tenement");
const rid = searchParams.get("report");
const amount = useRef<string>();
const { data } = useQuery(
['report-tenement-detail', rid, tid],
() => reportTenementDetail(rid, tid),
{
select: res => {
if (isCorrectResult(res)) return res.detail;
if (isCorrectResult(res)) {
amount.current = res.amount;
return res.detail
}
message.error(res.message || '获取商户电费详情失败');
return null;
}
@ -81,10 +102,10 @@ export const UserReport: FC = () => {
}, [data?.meters])
return (
<>
<style>
{
`
<>
<style>
{
`
td {
padding: 0.2cm
}
@ -104,148 +125,443 @@ export const UserReport: FC = () => {
font-size: 0.34cm;
}
`
}
</style>
<div style={{position: 'fixed',width: '100%', height: '100%', left: 0, right: 0, top: 0, bottom: 0, margin: 'auto', zIndex: 99, background: '#fff', display: 'flex', justifyContent: 'center', alignItems: "center" }}>
<Button loading={downloadLoading} type='primary' tw='' onClick={() => handlePrint()}> </Button>
}
</style>
<div style={{
position: 'fixed',
width: '100%',
height: '100%',
left: 0,
right: 0,
top: 0,
bottom: 0,
margin: 'auto',
zIndex: 99,
background: '#fff',
display: 'flex',
justifyContent: 'center',
alignItems: "center"
}}>
</div>
<div ref={printRef}>
<ContentArea>
<div id="content">
<div>
<img src={Logo} alt="" width={60} height={60}/>
</div>
<div tw='mt-4' style={{fontSize: "18px", fontWeight: 600}}>
{data?.tenement?.fullName} &nbsp;
{dayjs(data?.comprehensive?.startDate).format("MM")}
</div>
<div tw='flex mt-6 flex-row' style={{backgroundColor: "#f0f0f0", padding: '18px 20px'}}>
<div tw='flex flex-1 flex-col'>
<Row gutter={16}>
<Col span={5} style={{display: "flex", flexDirection: "column"}}>
<div></div>
<div style={{fontSize: "20px", fontWeight: 600, flex: 1, display: "flex", alignItems: "center"}}>
{data?.comprehensive?.startDate ? dayjs(data?.comprehensive?.startDate).format("YYYY年MM月") : null}
</div>
{/* <div> {data?.comprehensive?.startDate} - {data?.comprehensive?.endDate} </div> */}
</Col>
<Col span={19}>
<Row gutter={16}>
<Col span={6}> <TopTitle> </TopTitle> <TopContent> {data?.tenement?.id} </TopContent> </Col>
<Col span={6}> <TopTitle></TopTitle><TopContent>{data?.tenement?.fullName}</TopContent> </Col>
<Col span={6}> <TopTitle></TopTitle><TopContent></TopContent> </Col>
<Col span={6}> <TopTitle></TopTitle><TopContent>0.4kv</TopContent> </Col>
</Row>
<Divider dashed tw='mt-2 mb-2 flex flex-col w-full' />
<Row gutter={16}>
<div tw='mt-3 flex-1 flex flex-row'>
<Col span={6}> <TopTitle></TopTitle> <TopContent> {data?.park?.name} </TopContent> </Col>
<Col span={6}> <TopTitle></TopTitle> <TopContent> {data?.tenement?.address} </TopContent> </Col>
<Col span={6}> <TopTitle></TopTitle><TopContent>{data?.comprehensive?.endDate}</TopContent> </Col>
<Col span={6}> <TopTitle></TopTitle><TopContent></TopContent> </Col>
</div>
</Row>
</Col>
</Row>
</div>
</div>
<div>
<div tw='mt-6'>
<Divider tw='mt-2 mb-2 flex flex-col w-full' />
</div>
<div tw='mt-2'>
<div tw='flex flex-row'>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.consumption, 2, '-')} &nbsp;&nbsp; </div>
</Card>
</div>
<div tw='mt-3'>
<Divider tw='mt-2 mb-4 flex flex-col w-full' />
</div>
<div tw='flex flex-row items-center' style={{height: 'fit-content', alignItems: "stretch", flexGrow: "stratch" }}>
<div tw='flex flex-row items-center flex-wrap'>
<Unit> </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.consumption, 2, '-')} &nbsp;&nbsp; </div>
</Card>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> 线 </h4>
<div> {outputWithPrecision(data?.comprehensive?.lossAmount, 2, '-')} &nbsp;&nbsp; </div>
</Card>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.publicAmount, 2, '-')} &nbsp;&nbsp; </div>
</Card>
<Unit> </Unit><Unit> * </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.price, 6, '-')} &nbsp;&nbsp;/ </div>
</Card>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.basicPooled, 2, '-')} </div>
</Card>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.adjustPooled, 2, '-')} </div>
</Card>
</div>
<div tw='flex flex-row items-center' style={{height: '100%', flex: 1}}>
<Unit> = </Unit>
<Card style={{height: 200}}>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.total, 2, '-')} </div>
</Card>
</div>
</div>
</div>
<div>
<div tw='mt-4'>
<Divider tw='mt-2 mb-4 flex flex-col w-full' />
</div>
<div tw="mt-3" style={{fontSize: 12}}>
<table border={1} width={"100%"} cellSpacing="0" >
<thead>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
{/* <td>线损占比</td> */}
<td>线</td>
<td></td>
<td></td>
</tr>
</thead>
<Button loading={downloadLoading} type='primary' tw='' onClick={() => handlePrint()}> </Button>
</div>
<div ref={printRef}>
<ContentArea>
<div id="content">
<div>
<img src={Logo} alt="" width={60} height={60}/>
</div>
<div tw='mt-4' style={{fontSize: "18px", fontWeight: 600}}>
{data?.tenement?.fullName} &nbsp;
{dayjs(data?.comprehensive?.startDate).format("MM")}
</div>
<div tw='flex mt-6 flex-row' style={{backgroundColor: "#f0f0f0", padding: '18px 20px'}}>
<div tw='flex flex-1 flex-col'>
<Row gutter={16}>
<Col span={5} style={{display: "flex", flexDirection: "column"}}>
<div></div>
<div style={{
fontSize: "20px",
fontWeight: 600,
flex: 1,
display: "flex",
alignItems: "center"
}}>
{data?.comprehensive?.startDate ? dayjs(data?.comprehensive?.startDate).format("YYYY年MM月") : null}
</div>
{/* <div> {data?.comprehensive?.startDate} - {data?.comprehensive?.endDate} </div> */}
</Col>
<Col span={19}>
<Row gutter={16}>
<Col span={6}> <TopTitle> </TopTitle>
<TopContent> {data?.tenement?.id} </TopContent> </Col>
<Col span={6}>
<TopTitle></TopTitle><TopContent>{data?.tenement?.fullName}</TopContent>
</Col>
<Col span={6}> <TopTitle></TopTitle><TopContent></TopContent>
</Col>
<Col span={6}> <TopTitle></TopTitle><TopContent>0.4kv</TopContent>
</Col>
</Row>
<Divider dashed tw='mt-2 mb-2 flex flex-col w-full'/>
<Row gutter={16}>
<div tw='mt-3 flex-1 flex flex-row'>
<Col span={6}> <TopTitle></TopTitle>
<TopContent> {data?.park?.name} </TopContent> </Col>
<Col span={6}> <TopTitle></TopTitle>
<TopContent> {data?.tenement?.address} </TopContent> </Col>
<Col span={6}>
<TopTitle></TopTitle><TopContent>{data?.comprehensive?.endDate}</TopContent>
</Col>
<Col span={6}>
<TopTitle></TopTitle><TopContent></TopContent>
</Col>
</div>
</Row>
</Col>
</Row>
</div>
</div>
<div>
<div tw='mt-6'>
<Divider tw='mt-2 mb-2 flex flex-col w-full'/>
</div>
<div tw='mt-2'>
<div tw='flex flex-row'>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {
outputWithPrecision(
`${Number(amount.current || 0)}`, 2, '-')} &nbsp;&nbsp;
</div>
</Card>
</div>
<div tw='mt-3'>
<Divider tw='mt-2 mb-4 flex flex-col w-full'/>
</div>
{
data?.park?.meter04kvType === 0 ? (
<div tw='flex flex-row items-center' style={{
height: 'fit-content',
alignItems: "stretch",
flexGrow: "stratch"
}}>
<div tw='flex flex-row items-center flex-wrap'>
<Unit> </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.consumption, 2, '-')} &nbsp;&nbsp;</div>
</Card>
{
data?.tenement?.feeType === 3 ? null : (
<>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> 线 </h4>
<div> {outputWithPrecision(data?.comprehensive?.lossAmount, 2, '-')} &nbsp;&nbsp;</div>
</Card>
</>
)
}
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.publicAmount, 2, '-')} &nbsp;&nbsp;</div>
</Card>
<Unit> - </Unit>
<Card>
<h4 tw='mt-1 mb-1'> 退 </h4>
<div> {outputWithPrecision(data?.comprehensive?.publicAmount, 2, '-')} &nbsp;&nbsp;</div>
</Card>
<Unit> </Unit><Unit> * </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.price, 6, '-')} &nbsp;&nbsp;/</div>
</Card>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.basicPooled, 2, '-')} </div>
</Card>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.adjustPooled, 2, '-')} </div>
</Card>
</div>
<div tw='flex flex-row items-center' style={{height: '100%', flex: 1}}>
<Unit> = </Unit>
<Card style={{height: 200}}>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.total, 2, '-')} </div>
</Card>
</div>
</div>
) : (
<div tw='' style={{
height: 'fit-content',
alignItems: "stretch",
flexGrow: "stratch"
}}>
<div tw='flex flex-row items-center flex-wrap'>
<Unit> </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.sharpAmount, 2, '-')} &nbsp;&nbsp;</div>
</Card>
{
data?.tenement?.feeType === 3 ? null : (
<>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> 线 </h4>
<div> {outputWithPrecision(data?.comprehensive?.lossSharp, 2, '-')} &nbsp;&nbsp;</div>
</Card>
</>
)
}
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.poolSharp || '0', 2, '-')} &nbsp;&nbsp;</div>
</Card>
<Unit> - </Unit>
<Card>
<h4 tw='mt-1 mb-1'> 退 </h4>
<div> {outputWithPrecision(data?.comprehensive?.refundSharp, 2, '-')} &nbsp;&nbsp;</div>
</Card>
<Unit> </Unit><Unit> * </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.priceSharp, 6, '-')} &nbsp;&nbsp;/</div>
</Card>
<Unit> = </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(getAmount(
data?.comprehensive?.sharpAmount || "0",
data?.tenement?.feeType === 3 ? "0" : (data?.comprehensive?.lossSharp || "0"),
data?.comprehensive?.refundSharp || "0",
data?.comprehensive?.priceSharp || "0",
), 2, '-')} &nbsp;&nbsp;</div>
</Card>
</div>
<div tw='flex flex-row items-center flex-wrap'>
<Unit> </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.peakAmount, 2, '-')} &nbsp;&nbsp;</div>
</Card>
{
data?.tenement?.feeType === 3 ? null : (
<>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> 线 </h4>
<div> {outputWithPrecision(data?.comprehensive?.lossPeak, 2, '-')} &nbsp;&nbsp;</div>
</Card>
</>
)
}
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.poolPeak, 2, '-')} &nbsp;&nbsp;</div>
</Card>
<Unit> - </Unit>
<Card>
<h4 tw='mt-1 mb-1'> 退 </h4>
<div> {outputWithPrecision(data?.comprehensive?.refundPeak, 2, '-')} &nbsp;&nbsp;</div>
</Card>
<Unit> </Unit><Unit> * </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.pricePeak, 6, '-')} &nbsp;&nbsp;/</div>
</Card>
<Unit> = </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(getAmount(
data?.comprehensive?.peakAmount || "0",
data?.tenement?.feeType === 3 ? "0" : (data?.comprehensive?.lossPeak || "0"),
data?.comprehensive?.refundPeak || "0",
data?.comprehensive?.pricePeak || "0",
), 2, '-')} &nbsp;&nbsp;</div>
</Card>
</div>
<div tw='flex flex-row items-center flex-wrap'>
<Unit> </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.flatAmount, 2, '-')} &nbsp;&nbsp;</div>
</Card>
{
data?.tenement?.feeType === 3 ? null : (
<>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> 线 </h4>
<div> {outputWithPrecision(data?.comprehensive?.lossFlat, 2, '-')} &nbsp;&nbsp;</div>
</Card>
</>
)
}
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.poolFlat, 2, '-')} &nbsp;&nbsp;</div>
</Card>
<Unit> - </Unit>
<Card>
<h4 tw='mt-1 mb-1'> 退 </h4>
<div> {outputWithPrecision(data?.comprehensive?.refundFlat, 2, '-')} &nbsp;&nbsp;</div>
</Card>
<Unit> </Unit><Unit> * </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.priceFlat, 6, '-')} &nbsp;&nbsp;/</div>
</Card>
<Unit> = </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(getAmount(
data?.comprehensive?.flatAmount || "0",
data?.tenement?.feeType === 3 ? "0" : (data?.comprehensive?.lossFlat || "0"),
data?.comprehensive?.refundFlat || "0",
data?.comprehensive?.priceFlat || "0",
), 2, '-')} &nbsp;&nbsp;</div>
</Card>
</div>
<div tw='flex flex-row items-center flex-wrap'>
<Unit> </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.valleyAmount, 2, '-')} &nbsp;&nbsp;</div>
</Card>
{
data?.tenement?.feeType === 3 ? null : (
<>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> 线 </h4>
<div> {outputWithPrecision(data?.comprehensive?.lossValley, 2, '-')} &nbsp;&nbsp;</div>
</Card>
</>
)
}
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.poolValley, 2, '-')} &nbsp;&nbsp;</div>
</Card>
<Unit> - </Unit>
<Card>
<h4 tw='mt-1 mb-1'> 退 </h4>
<div> {outputWithPrecision(data?.comprehensive?.refundValley, 2, '-')} &nbsp;&nbsp;</div>
</Card>
<Unit> </Unit><Unit> * </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.priceValley, 6, '-')} &nbsp;&nbsp;/</div>
</Card>
<Unit> = </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(getAmount(
data?.comprehensive?.valleyAmount || "0",
data?.tenement?.feeType === 3 ? "0" : (data?.comprehensive?.lossValley || "0"),
data?.comprehensive?.refundValley || "0",
data?.comprehensive?.priceValley || "0",
), 2, '-')} &nbsp;&nbsp;</div>
</Card>
</div>
<div tw='flex flex-row items-center flex-wrap'>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(getAmount(
data?.comprehensive?.sharpAmount || "0",
data?.tenement?.feeType === 3 ? "0" : (data?.comprehensive?.lossSharp || "0"),
data?.comprehensive?.refundSharp || "0",
data?.comprehensive?.priceSharp || "0",
), 2, '-')} </div>
</Card>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(getAmount(
data?.comprehensive?.peakAmount || "0",
data?.tenement?.feeType === 3 ? "0" : (data?.comprehensive?.lossPeak || "0"),
data?.comprehensive?.refundPeak || "0",
data?.comprehensive?.pricePeak || "0",
), 2, '-')} </div>
</Card>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(getAmount(
data?.comprehensive?.flatAmount || "0",
data?.tenement?.feeType === 3 ? "0" : (data?.comprehensive?.lossFlat || "0"),
data?.comprehensive?.refundFlat || "0",
data?.comprehensive?.priceFlat || "0",
), 2, '-')}</div>
</Card>
<Unit> + </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(getAmount(
data?.comprehensive?.valleyAmount || "0",
data?.tenement?.feeType === 3 ? "0" : (data?.comprehensive?.lossValley || "0"),
data?.comprehensive?.refundValley || "0",
data?.comprehensive?.priceValley || "0",
), 2, '-')}</div>
</Card>
<Unit> = </Unit>
<Card>
<h4 tw='mt-1 mb-1'> </h4>
<div> {outputWithPrecision(data?.comprehensive?.total, 2, '-')} &nbsp;&nbsp;</div>
</Card>
</div>
{/*<div tw='flex flex-row items-center' style={{height: '100%', flex: 1}}>*/}
{/* <Unit> = </Unit>*/}
{/* <Card style={{height: 200}}>*/}
{/* <h4 tw='mt-1 mb-1'> 本期总电费(元): </h4>*/}
{/* <div> {outputWithPrecision(data?.comprehensive?.total, 2, '-')} </div>*/}
{/* </Card>*/}
{/*</div>*/}
</div>
)
}
</div>
<div>
<div tw='mt-4'>
<Divider tw='mt-2 mb-4 flex flex-col w-full'/>
</div>
<div tw="mt-3" style={{fontSize: 12}}>
<table border={1} width={"100%"} cellSpacing="0">
<thead>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
{/* <td>线损占比</td> */}
{
data?.tenement?.feeType === 3 ? null : (
<td>线</td>
)
}
<td>退</td>
<td></td>
<td></td>
</tr>
</thead>
<tbody>
{renderTable()}
</tbody>
</table>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentArea>
</div>
</ContentArea>
</div>
</>
</>
);
};

View File

@ -304,6 +304,10 @@ export interface TenementInfo {
phone: null | string;
/** 简称 */
shortName: null | string;
/** 收费类型 */
feeType: number;
/** 限电状态 */
exceptionalCase: number;
}
export interface MeterByTenement {

View File

@ -170,6 +170,174 @@ export interface ReportTenement extends TenementInfo {
consumptionAmount: string
}
export interface ReportTenementMeters extends Meter04KvInfo, PooledSumDetail, ReportMeterUnit{
finalAmount: string,
/**
*
*/
address: null | string;
/**
*
*/
adjustPooled: string;
/**
*
*/
attachedAt: string;
/**
*
*/
basicPooled: string;
/**
*
*/
buildingName: null | string;
/**
*
*/
code: string;
/**
*
*/
currentTermReadings: string;
/**
*
*/
detachedAt: null | string;
/**
*
*/
displayRatio: string;
/**
*
*/
enabled: boolean;
/**
* 2312
*/
endNumber: number;
/**
*
*/
finalTotal: string;
/**
* id
*/
id: string;
/**
*
*/
lastTermReadings: string;
/**
* 线
*/
lossFlat: string;
/**
* 线
*/
lossFlatFee: string;
/**
* 线
*/
lossPeak: string;
/**
* 线
*/
lossPeakFee: string;
/**
* 线
*/
lossPooled: string;
/**
* 线
*/
lossSharp: string;
/**
* 线
*/
lossSharpFee: string;
/**
* 线
*/
lossValley: string;
/**
* 线
*/
lossValleyFee: string;
/**
*
*/
meterNo: string;
/**
*
*/
nestMeter: ReportTenementMeters[];
/**
*
*/
nestOverall: string;
/**
*
*/
onFloor: null | string;
/**
* ID
*/
parkId: string;
/**
*
*/
peak: Consumption;
/**
*
*/
publicAmount: string;
/**
*
*/
publicPooled: string;
/**
*
*/
ratio: string;
/**
* 退
*/
refundAmount: string;
/**
*
*/
refundFlat: string;
/**
*
*/
refundPeak: string;
/**
*
*/
refundSharp: string;
/**
*
*/
refundValley: string;
/**
*
*/
seq: number;
/**
* 2312
*/
startNumber: number;
/**
* 012
*/
type: number;
[property: string]: any;
}
/**
*
*/
@ -177,22 +345,7 @@ export interface ReportTenementDetail {
park: SimpleParkInfo;
tenement: TenementInfo;
comprehensive: TenementComprehensiveDetail;
meters: (Meter04KvInfo &
PooledSumDetail &
ReportMeterUnit & { /** 合计电费 */ finalTotal: string; loss: Consumption } & {
/** 首次抄表时间 */
currentTermReadings: string,
/** 最近抄表时间 */
lastTermReadings: string,
}
& {
startNumber: number,
endNumber: number,
displayRatio: number,
publicAmount: string,
refundAmount: string,
}
)[];
meters: ReportTenementMeters[];
pooled: (Meter04KvInfo & ReportMeterUnit)[];
@ -226,6 +379,126 @@ export type TenementComprehensiveDetail = PooledSumDetail & {
endDate: string;
/** 本期公摊电量 */
publicAmount: number
/**
*/
sharpAmount: string;
/** 峰电量 */
peakAmount: string;
/** 平电量 */
flatAmount: string;
/** 谷电量 */
valleyAmount: string;
/**
* 线
*/
lossFlat: string;
/**
* 线
*/
lossFlatFee: string;
/**
* 线
*/
lossPeak: string;
/**
* 线
*/
lossPeakFee: string;
/**
* 线
*/
lossPooled: string;
/**
* 线
*/
lossSharp: string;
/**
* 线
*/
lossSharpFee: string;
/**
* 线
*/
lossValley: string;
/**
* 退
*/
refundSharp: string;
/**
* 退
*/
refundPeak: string;
/**
* 退
*/
refundFlat: string;
/**
* 退
*/
refundValley: string;
/**
*
*/
priceSharp: string;
/**
*
*/
pricePeak: string;
/**
*
*/
priceFlat: string;
/**
*
*/
priceValley: string;
refundOverall?: string
poolSharp?: string
poolValley?: string
poolPeak?: string
poolFlat?: string
/**
*
*/
finalFlatFee: string;
/**
*
*/
finalPeakFee: string;
/**
*
*/
finalSharpFee: string;
/**
*
*/
finalValleyFee: string;
/**
*
*/
flatFee: string;
/**
* 线
*/
lossValleyFee: string;
/**
*
*/
peakFee: string;
/**
*
*/
sharpFee: string;
/**
*
*/
valleyFee: string;
/**
*
*/
finalAmount: string;
finalLossFee: string;
};
/**

View File

@ -35,8 +35,8 @@ export function throttle(fn: Function, delay: number) {
}
// 获取列表中序号
export function getIndex(page: number, index: number) : string {
return `${(page - 1) * 20 + Number(index) + 1}`
export function getIndex(page: number, size: number, index: number) : string {
return `${(page - 1) * size + Number(index) + 1}`
}
interface Response {
@ -75,4 +75,12 @@ export function getFetchFileList(files: FileList[]) : string[] {
return files.filter(item => item.status === "done").map(item => {
return item?.response?.data
})
}
export function getRoundNumber(number: number) : string {
return (Math.round(number * 100) / 100).toFixed(2)
}
export function getFileName(url: string) : string {
return url.substring(url.lastIndexOf('/') + 1);
}