custom/汇通建设
This commit is contained in:
parent
18f2e6c08a
commit
0d0a7a9367
|
|
@ -1,4 +1,4 @@
|
|||
import { postFetch, postExportFetch } from "../../../util/request";
|
||||
import { postExportFetch, postFetch } from "../../../util/request";
|
||||
|
||||
//汇通建设-薪酬送审数据穿透(分页)
|
||||
export const getXcssDataDetail = params => {
|
||||
|
|
@ -16,3 +16,7 @@ export const exportXcssDataDetail = (params) => {
|
|||
export const exportXczfsqDataDetail = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/salaryacct/htjs/exportXczfsqDataDetail", params);
|
||||
};
|
||||
// 汇通建设-社保福利台账报表
|
||||
export const getHTCommonListReport = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/siaccount/detail/htCommonListReport", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import moment from "moment";
|
||||
|
||||
export const htconditions = [
|
||||
{
|
||||
items: [
|
||||
|
|
@ -40,9 +42,28 @@ export const htconditions = [
|
|||
lanId: 27511,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
title: ""
|
||||
}
|
||||
];
|
||||
export const htReportConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["billMonth"],
|
||||
fieldcol: 16,
|
||||
label: "账单月份",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: moment(new Date()).format("YYYY-MM"),
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
title: ""
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
height: 100%;
|
||||
padding: 8px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.ht_query {
|
||||
display: flex;
|
||||
|
|
@ -25,6 +27,8 @@
|
|||
}
|
||||
|
||||
.custom_huitong_list {
|
||||
flex: 1;
|
||||
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
* 汇通建设二开
|
||||
* 社保福利台账报表
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/11/22
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import { Button, Spin } from "antd";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import * as API from "../../../../apis/custom-apis/huitong";
|
||||
import { htReportConditions } from "../dataDetail/conditions";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("HTStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false,
|
||||
dataSource: [], columns: [], conditions: []
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setState({
|
||||
conditions: _.map(htReportConditions, item => ({
|
||||
...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
|
||||
}))
|
||||
}, () => {
|
||||
const { HTStore: { queryForm } } = this.props, { conditions } = this.state;
|
||||
queryForm.initFormFields(conditions);
|
||||
});
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleReceive = ({ data }) => {
|
||||
const { pageInfo } = this.state;
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getHTCommonListReport();
|
||||
} else if (type === "turn") {
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
this.setState({ pageInfo: { ...pageInfo, ...params } }, () => this.getHTCommonListReport());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const i18n = {
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"总计": getLabel(523, "总计")
|
||||
};
|
||||
const childFrameObj = document.getElementById("unitTable");
|
||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
getHTCommonListReport = () => {
|
||||
const { HTStore: { queryForm } } = this.props, { pageInfo } = this.state;
|
||||
const payload = { ...pageInfo, ...queryForm.getFormParams() };
|
||||
this.setState({ loading: true });
|
||||
API.getHTCommonListReport(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, pageInfo: result } = data;
|
||||
const { list: dataSource, pageNum: current, pageSize, total } = result;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
|
||||
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"
|
||||
}));
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleExport = () => {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { HTStore: { queryForm } } = this.props, { conditions, pageInfo, loading } = this.state;
|
||||
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">
|
||||
{
|
||||
getSearchs(queryForm, conditions, 2, false, () => {
|
||||
if (!this.handleDebounce) {
|
||||
this.handleDebounce = _.debounce(() => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => this.getHTCommonListReport());
|
||||
this.handleDebounce = null;
|
||||
}, 500);
|
||||
}
|
||||
this.handleDebounce();
|
||||
})
|
||||
}
|
||||
</div>
|
||||
<div className="custom_huitong_list">
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/unitTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable"
|
||||
id="unitTable"
|
||||
/>
|
||||
</Spin>
|
||||
</div>
|
||||
</div>
|
||||
</WeaTop>);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
import React from "react";
|
||||
import Route from "react-router/lib/Route";
|
||||
import DataDetail from "./huitong/dataDetail";
|
||||
import SocialSecurityReport from "./huitong/socialSecurityReport";
|
||||
|
||||
const CustomRoutes = [
|
||||
<Route key="customPage_dataDetail_huitong" path="customPage_dataDetail_huitong/:subcompanyId/:salaryMonth/:type"
|
||||
component={DataDetail}/>
|
||||
component={DataDetail}/>,
|
||||
<Route key="socialSecurityReport_huitong" path="socialSecurityReport_huitong" component={SocialSecurityReport}/>
|
||||
];
|
||||
|
||||
export default CustomRoutes;
|
||||
|
|
|
|||
Loading…
Reference in New Issue