custom/汇通建设
This commit is contained in:
parent
7079068f61
commit
59d2b845d6
|
|
@ -20,3 +20,11 @@ export const exportXczfsqDataDetail = (params) => {
|
|||
export const getHTCommonListReport = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/siaccount/detail/htCommonListReport", params);
|
||||
};
|
||||
// 汇通建设-社保福利台账报表
|
||||
export const getHTCommonListReportSum = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/siaccount/detail/htCommonListReportSum", params);
|
||||
};
|
||||
// 汇通建设-社保福利台账报表导出
|
||||
export const exportHtCommonList = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/siaccount/detail/exportHtCommonList", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
padding: 8px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
|
||||
.ht_query {
|
||||
.ht_query, .ht_report_query {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
background: #FFF;
|
||||
|
|
@ -20,6 +20,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
.ht_report_query {
|
||||
justify-content: flex-start;
|
||||
|
||||
.wea-search-group {
|
||||
flex: .2;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import { Button, Spin } from "antd";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import * as API from "../../../../apis/custom-apis/huitong";
|
||||
|
|
@ -24,7 +24,7 @@ class Index extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false,
|
||||
dataSource: [], columns: [], conditions: []
|
||||
dataSource: [], columns: [], conditions: [], sumDataSource: {}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ class Index extends Component {
|
|||
const { pageInfo } = this.state;
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getHTCommonListReport();
|
||||
this.getHTCommonListReport(true);
|
||||
} else if (type === "turn") {
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
|
|
@ -67,35 +67,49 @@ class Index extends Component {
|
|||
const childFrameObj = document.getElementById("unitTable");
|
||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
getHTCommonListReport = () => {
|
||||
getHTCommonListReport = (init) => {
|
||||
const { HTStore: { queryForm } } = this.props, { pageInfo } = this.state;
|
||||
const payload = { ...pageInfo, ...queryForm.getFormParams() };
|
||||
this.setState({ loading: true });
|
||||
API.getHTCommonListReport(payload).then(({ status, data }) => {
|
||||
API.getHTCommonListReport(payload).then(async ({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { data: { sumRow } } = init ? await API.getHTCommonListReportSum(payload) : { data: { sumRow: {} } };
|
||||
const { columns, pageInfo: result } = data;
|
||||
const { list: dataSource, pageNum: current, pageSize, total } = result;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
|
||||
sumDataSource: init ? sumRow : this.state.sumDataSource,
|
||||
columns: _.map(columns, o => ({ title: o.text, dataIndex: o.column, width: o.width, ellipsis: true }))
|
||||
}, () => this.postMessageToChild({
|
||||
scrollHeight: 108, dataSource: this.state.dataSource, columns: this.state.columns,
|
||||
pageInfo: this.state.pageInfo, unitTableType: "999"
|
||||
scrollHeight: 152, dataSource: this.state.dataSource, columns: this.state.columns,
|
||||
pageInfo: this.state.pageInfo, unitTableType: "999", showRowSelection: false,
|
||||
showTotalCell: true, sumDataSource: this.state.sumDataSource
|
||||
}));
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleExport = () => {
|
||||
const { HTStore: { queryForm } } = this.props;
|
||||
const payload = { ...queryForm.getFormParams() };
|
||||
WeaLoadingGlobal.start();
|
||||
const promise = API.exportHtCommonList(payload);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { HTStore: { queryForm } } = this.props, { conditions, pageInfo, loading } = this.state;
|
||||
const { HTStore: { queryForm } } = this.props, { conditions, pageInfo, loading, dataSource } = this.state;
|
||||
const dom = document.querySelector(".wea-new-top-content");
|
||||
let height = 330;
|
||||
if (dataSource.length > 0 && dom) {
|
||||
const tableHeight = dataSource.length * 46 + 162;
|
||||
const containerHeight = parseFloat(dom.style.height) - 68;
|
||||
height = containerHeight > tableHeight ? tableHeight : containerHeight;
|
||||
}
|
||||
return (<WeaTop title={getLabel(111, "社保福利台账报表")} className="custom_data_huitong"
|
||||
icon={<i className="icon-coms-fa"/>} showDropIcon={false} iconBgcolor="#F14A2D"
|
||||
buttons={[<Button type="primary" onClick={this.handleExport}>{getLabel(111, "导出")}</Button>]}>
|
||||
<div className="huitong-body">
|
||||
<div className="ht_query">
|
||||
<div className="ht_report_query">
|
||||
{
|
||||
getSearchs(queryForm, conditions, 1, false, () => {
|
||||
if (!this.handleDebounce) {
|
||||
|
|
@ -108,7 +122,7 @@ class Index extends Component {
|
|||
})
|
||||
}
|
||||
</div>
|
||||
<div className="custom_huitong_list">
|
||||
<div className="custom_huitong_list" style={{ height }}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
|
|
|
|||
Loading…
Reference in New Issue