custom/领悦
This commit is contained in:
parent
8f6f762a44
commit
c25586045a
|
|
@ -1,6 +1,28 @@
|
|||
import { postFetch } from "../../../util/request";
|
||||
import { postExportFetch, postFetch } from "../../../util/request";
|
||||
|
||||
// 薪资项目调整记录列表
|
||||
export const getLYSalaryReportList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/salaryReport/list", params);
|
||||
};
|
||||
export const getLYSalaryReportListSum = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/salaryReport/sum", params);
|
||||
};
|
||||
export const batchDeleteSalaryReport = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/salaryReport/batchDelete", params);
|
||||
};
|
||||
export const exportSalaryReport = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/ly/salaryReport/export", params);
|
||||
};
|
||||
export const getLYSIReportGenerateList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/SIReport/generate", params);
|
||||
};
|
||||
export const getLYSIReportGenerateListSum = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/SIReport/sum", params);
|
||||
};
|
||||
export const batchDeleteSIReport = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/ly/SIReport/batchDelete", params);
|
||||
};
|
||||
export const exportSIReport = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/ly/socialReport/export", params);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
import React from "react";
|
||||
import Route from "react-router/lib/Route";
|
||||
import CustomPageLingYue from "./lingyue";
|
||||
import CustomSalarySummary from "./lingyue/salarySummary";
|
||||
import CustomSocialFundSummary from "./lingyue/socialFundSummary";
|
||||
|
||||
const CustomRoutes = [
|
||||
<Route key="customPage_lingyue" path="customPage_lingyue" component={CustomPageLingYue}/>
|
||||
<Route key="customPage_salarySummary_lingyue" path="customPage_salarySummary_lingyue"
|
||||
component={CustomSalarySummary}/>,
|
||||
<Route key="customPage_socailFundSummary_lingyue" path="customPage_socailFundSummary_lingyue"
|
||||
component={CustomSocialFundSummary}/>
|
||||
];
|
||||
|
||||
export default CustomRoutes;
|
||||
|
|
|
|||
|
|
@ -14,12 +14,27 @@ import { getIframeParentHeight } from "../../../../util";
|
|||
import * as API from "../../../../apis/custom-apis/lingyue";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const interfaceType = {
|
||||
"salarySum": {
|
||||
list: API.getLYSalaryReportList,
|
||||
sum: API.getLYSalaryReportListSum,
|
||||
export: API.exportSalaryReport,
|
||||
batchDel: API.batchDeleteSalaryReport
|
||||
},
|
||||
"socialFundSum": {
|
||||
list: API.getLYSIReportGenerateList,
|
||||
sum: API.getLYSIReportGenerateListSum,
|
||||
export: API.exportSIReport,
|
||||
batchDel: API.batchDeleteSIReport
|
||||
}
|
||||
};
|
||||
|
||||
class List extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false
|
||||
dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false,
|
||||
selectedRowKeys: [], sumDataSource: {}, payload: {}
|
||||
};
|
||||
this.handleDebounce = null;
|
||||
}
|
||||
|
|
@ -33,18 +48,22 @@ class List extends Component {
|
|||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.isQuery !== this.props.isQuery) this.getLYSalaryReportList();
|
||||
if (nextProps.isQuery !== this.props.isQuery) this.getLYList();
|
||||
}
|
||||
|
||||
handleReceive = ({ data }) => {
|
||||
const { pageInfo } = this.state;
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getLYSalaryReportList();
|
||||
this.getLYList();
|
||||
} else if (type === "turn") {
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
this.setState({ pageInfo: { ...pageInfo, ...params } }, () => this.getLYSalaryReportList());
|
||||
this.setState({ pageInfo: { ...pageInfo, ...params } }, () => this.getLYList(false));
|
||||
break;
|
||||
case "CHECKBOX":
|
||||
const { selectedRowKeys } = params;
|
||||
this.setState({ selectedRowKeys });
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -60,29 +79,46 @@ class List extends Component {
|
|||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
|
||||
getLYSalaryReportList = () => {
|
||||
const { query } = this.props, { pageInfo } = this.state;
|
||||
getLYList = (isSum = true) => {
|
||||
const { query, type } = this.props, { pageInfo, selectedRowKeys } = this.state;
|
||||
const payload = { ...pageInfo, ...query };
|
||||
API.getLYSalaryReportList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: true });
|
||||
interfaceType[type]["list"](payload).then(async ({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { data: { sumRow: sumDataSource } } = isSum ?
|
||||
await interfaceType[type]["sum"](payload) : { data: this.state.sumDataSource };
|
||||
const { columns, data: result } = data;
|
||||
const { list: dataSource, pageNum: current, pageSize, total } = result;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource, columns
|
||||
}, () => this.postMessageToChild({
|
||||
scrollHeight: 108, dataSource, pageInfo: this.state.pageInfo,
|
||||
unitTableType: "custom_lingyue", columns: traverseCols(columns)
|
||||
}));
|
||||
dataSource, columns, sumDataSource, payload
|
||||
}, () => {
|
||||
this.postMessageToChild({
|
||||
scrollHeight: 108, dataSource, pageInfo: this.state.pageInfo, selectedRowKeys,
|
||||
unitTableType: "custom_lingyue", columns: traverseCols(columns), showTotalCell: true,
|
||||
sumDataSource: this.state.sumDataSource
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleOperate = (key) => {
|
||||
const { payload } = this.state;
|
||||
switch (key) {
|
||||
case "EXPORTALL":
|
||||
console.log(payload);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, dataSource } = this.state;
|
||||
return (
|
||||
<div className="custom_lingyue_list"
|
||||
style={{ height: getIframeParentHeight(".wea-new-top-content", dataSource.length, 0) + "px" }}>
|
||||
style={{ height: getIframeParentHeight(".wea-new-top-content", dataSource.length, 0) + 43.84 + "px" }}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
|
|
@ -102,13 +138,13 @@ const traverseCols = arr => {
|
|||
return _.map(arr, item => {
|
||||
if (!_.isEmpty(item.children)) {
|
||||
return {
|
||||
title: item.text, width: item.width + "px", ellipsis: true,
|
||||
title: item.text, width: item.width, ellipsis: true,
|
||||
dataIndex: item.column, children: traverseCols(item.children),
|
||||
fixed: item.fixed || false, align: "center"
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
title: item.text, width: item.width + "px", fixed: item.fixed || false,
|
||||
title: item.text, width: item.width, fixed: item.fixed || false,
|
||||
dataIndex: item.column, ellipsis: true, align: "center"
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
/*
|
||||
* 薪酬二开项目
|
||||
* 领悦
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/22
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDatePicker, WeaInputSearch, WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import List from "./components/list";
|
||||
import moment from "moment";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
query: { salaryMonth: moment().format("YYYY-MM"), ffgsqc: "" }, isQuery: false
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const { query, isQuery } = this.state;
|
||||
const { salaryMonth, ffgsqc } = query;
|
||||
const buttons = [
|
||||
<WeaDatePicker format="YYYY-MM" value={salaryMonth}
|
||||
onChange={value => this.setState({
|
||||
query: { ...query, salaryMonth: value }
|
||||
}, () => this.setState({ isQuery: !isQuery }))}/>,
|
||||
<WeaInputSearch value={ffgsqc} onChange={value => this.setState({ query: { ...query, ffgsqc: value } })}
|
||||
onSearch={() => this.setState({ isQuery: !isQuery })}/>
|
||||
];
|
||||
return (
|
||||
<WeaTop
|
||||
title={getLabel(111, "薪资汇总表")} icon={<i className="icon-coms-fa"/>} buttons={buttons}
|
||||
iconBgcolor="#F14A2D" showDropIcon={false} className="custom_salary_lingyue">
|
||||
<div className="lingyue-body"><List query={query} isQuery={isQuery}/></div>
|
||||
</WeaTop>);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 薪酬二开项目
|
||||
* 领悦
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/22
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDatePicker, WeaInputSearch, WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Layout extends Component {
|
||||
render() {
|
||||
const { title, query, onChange, listRef } = this.props;
|
||||
const { salaryMonth, ffgsqc, isQuery } = query;
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={() => this.listRef.handleOperate("BATCHDEL")}>{getLabel(111, "批量删除")}</Button>,
|
||||
<WeaDatePicker format="YYYY-MM" value={salaryMonth}
|
||||
onChange={value => onChange({ ...query, salaryMonth: value, isQuery: !isQuery })}/>,
|
||||
<WeaInputSearch value={ffgsqc} onChange={value => onChange({ ...query, ffgsqc: value })}
|
||||
onSearch={() => onChange({ ...query, isQuery: !isQuery })}/>
|
||||
];
|
||||
const dropMenuDatas = [
|
||||
{ key: "EXPORTALL", icon: <i className="iconfont icon-daochu"/>, content: getLabel(81272, "导出全部") }
|
||||
];
|
||||
return (
|
||||
<WeaTop
|
||||
title={title} icon={<i className="icon-coms-fa"/>} buttons={buttons} showDropIcon={true}
|
||||
iconBgcolor="#F14A2D" className="custom_salary_lingyue" dropMenuDatas={dropMenuDatas}
|
||||
onDropMenuClick={key => this.listRef.handleOperate(key)}>
|
||||
<div className="lingyue-body">{this.props.children}</div>
|
||||
</WeaTop>);
|
||||
}
|
||||
}
|
||||
|
||||
export default Layout;
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
*
|
||||
* 薪资汇总表
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/28
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import moment from "moment";
|
||||
import Layout from "../layout";
|
||||
import List from "../components/list";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
query: { salaryMonth: moment().format("YYYY-MM"), ffgsqc: "" }, isQuery: false
|
||||
};
|
||||
this.listRef = null;
|
||||
}
|
||||
|
||||
handleLayoutChange = ({ isQuery, ...val }) => this.setState({ query: { ...this.state.query, ...val } },
|
||||
() => this.setState({ isQuery }));
|
||||
|
||||
render() {
|
||||
const { query, isQuery } = this.state;
|
||||
return (
|
||||
<Layout title={getLabel(111, "薪资汇总表")} query={query} onChange={this.handleLayoutChange}
|
||||
listRef={this.listRef}>
|
||||
<List query={query} isQuery={isQuery} type="salarySum" ref={dom => this.listRef = dom}/>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
*
|
||||
* 社保公积金汇总表
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/28
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import Layout from "../layout";
|
||||
import List from "../components/list";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
query: { salaryMonth: moment().format("YYYY-MM"), ffgsqc: "" }, isQuery: false
|
||||
};
|
||||
this.listRef = null;
|
||||
}
|
||||
|
||||
handleLayoutChange = ({ isQuery, ...val }) => this.setState({ query: { ...this.state.query, ...val } },
|
||||
() => this.setState({ isQuery }));
|
||||
|
||||
render() {
|
||||
const { query, isQuery } = this.state;
|
||||
return (
|
||||
<Layout title={getLabel(111, "社保公积金汇总表")} query={query} onChange={this.handleLayoutChange}
|
||||
listRef={this.listRef}>
|
||||
<List query={query} isQuery={isQuery} type="socialFundSum"/>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
Loading…
Reference in New Issue