custom/领悦业务线

This commit is contained in:
lys 2025-04-07 14:14:45 +08:00
parent 08b6a6c291
commit 0f3c40280c
10 changed files with 433 additions and 2 deletions

View File

@ -82,3 +82,33 @@ export const getSIReportGmgsList = (params) => {
export const getFundReportGmgsList = (params) => {
return postFetch("/api/bs/hrmsalary/ly/FundReport/gmgsList", params);
};
export const getffgsAllList = (params) => {
return postFetch("/api/bs/hrmsalary/ly/salaryReport/ffgsAllList", params);
};
export const getSalaryDepartmentReportList = (params) => {
return postFetch("/api/bs/hrmsalary/ly/salaryDepartmentReport/list", params);
};
export const getSalaryDepartmentReportListSum = (params) => {
return postFetch("/api/bs/hrmsalary/ly/salaryDepartmentReport/sum", params);
};
export const exportSalaryDepartmentReportList = (params) => {
return postExportFetch("/api/bs/hrmsalary/ly/salaryDepartmentReport/export", params);
};
export const getffReportList = (params) => {
return postFetch("/api/bs/hrmsalary/ly/ffReport/list", params);
};
export const getffReportListSum = (params) => {
return postFetch("/api/bs/hrmsalary/ly/ffReport/sum", params);
};
export const exportffReportList = (params) => {
return postExportFetch("/api/bs/hrmsalary/ly/ffReport/export", params);
};
export const getbsReportList = (params) => {
return postFetch("/api/bs/hrmsalary/ly/bsReport/list", params);
};
export const getbsReportListSum = (params) => {
return postFetch("/api/bs/hrmsalary/ly/bsReport/sum", params);
};
export const exportbsReportList = (params) => {
return postExportFetch("/api/bs/hrmsalary/ly/bsReport/export", params);
};

View File

@ -5,6 +5,9 @@ import CustomSISummary from "./lingyue/socialSummary";
import CustomFundSummary from "./lingyue/fundSummary";
import VouncherSummary from "./lingyue/vouncherSummary";
import HistoryVouncherSummary from "./lingyue/historyVouncherSummary";
import SalaryStatisticsReport from "./lingyue/salaryStatisticsReport";
import SalaryPaymentReport from "./lingyue/salaryPaymentReport";
import SalaryTaxReturnForm from "./lingyue/salaryTaxReturnForm";
const CustomRoutes = [
<Route key="customPage_salarySummary_lingyue" path="customPage_salarySummary_lingyue"
@ -15,7 +18,13 @@ const CustomRoutes = [
component={CustomFundSummary}/>,
<Route key="customPage_vouchers_lingyue" path="customPage_vouchers_lingyue" component={VouncherSummary}/>,
<Route key="customPage_historyVouchers_lingyue" path="customPage_historyVouchers_lingyue"
component={HistoryVouncherSummary}/>
component={HistoryVouncherSummary}/>,
<Route key="customPage_salaryStatistic_lingyue" path="customPage_salaryStatistic_lingyue"
component={SalaryStatisticsReport}/>,
<Route key="customPage_paymentReport_lingyue" path="customPage_paymentReport_lingyue"
component={SalaryPaymentReport}/>,
<Route key="customPage_salaryTaxReturnForm_lingyue" path="customPage_salaryTaxReturnForm_lingyue"
component={SalaryTaxReturnForm}/>
];
export default CustomRoutes;

View File

@ -0,0 +1,79 @@
/*
* 薪酬二开项目
* 统一报表基础
* @Author: 黎永顺
* @Date: 2025/4/7
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom";
import FormInfo from "../../../components/FormInfo";
import { getffgsAllList } from "../../../apis/custom-apis/lingyue";
import { baseConditions } from "./components/conditions";
import CustomSelect from "../../../components/CustomSelect";
import { WeaSwitch } from "comsMobx";
import moment from "moment";
import { Button } from "antd";
import "./index.less";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
class Layout extends Component {
constructor(props) {
super(props);
this.state = { conditions: [] };
}
componentDidMount() {
this.init();
}
init = () => {
getffgsAllList().then(({ status, data }) => {
if (status) this.setState({
conditions: _.map(baseConditions, item => ({
...item, items: _.map(item.items, o => {
if (getKey(o) === "fycdgsqc") {
return { ...o, options: _.map(data, o => ({ ...o, name: o.content })) };
}
return { ...o, label: getLabel(o.lanId, o.label), value: moment().format("YYYY-MM") };
})
}))
}, () => this.props.form.initFormFields(this.state.conditions));
});
};
render() {
const { title, form, onChange, onExport } = this.props, { conditions } = this.state;
const buttons = [
<Button type="primary" onClick={onExport}>{getLabel(111, "导出全部")}</Button>
];
const itemRender = {
fycdgsqc: (field, textAreaProps, form, formParams) => {
return (<CustomSelect value={formParams.fycdgsqc} options={field.options}
onChange={v => {
v && form.updateFields({ fycdgsqc: { value: v } });
onChange();
}}/>);
},
salaryMonth: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}
onChange={onChange}/>);
}
};
return (
<WeaTop title={title} icon={<i className="icon-coms-fa"/>} buttons={buttons} showDropIcon={false}
iconBgcolor="#F14A2D" className="custom_salary_lingyue">
<div className="lingyue-body">
<FormInfo className="baseLayoutQuery_lingyue" center={false} colCount={2} form={form}
formFields={conditions} itemRender={itemRender}/>
{this.props.children}
</div>
</WeaTop>);
}
}
export default Layout;

View File

@ -0,0 +1,140 @@
/*
* 领悦业务线报表二开
*
* @Author: 黎永顺
* @Date: 2025/4/7
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import { message, Spin } from "antd";
import * as API from "../../../../apis/custom-apis/lingyue";
import { traverseCols } from "./list";
const getLabel = WeaLocaleProvider.getLabel;
const interfaceType = {
"salaryStatistic": {
list: API.getSalaryDepartmentReportList,
sum: API.getSalaryDepartmentReportListSum
}, "paymentReport": {
list: API.getffReportList,
sum: API.getffReportListSum
}, "taxReturn": {
list: API.getbsReportList,
sum: API.getbsReportListSum
}
};
export default class BaseReportList extends Component {
constructor(props) {
super(props);
this.state = {
dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
loading: false, selectedRowKeys: [], sumDataSource: {}, payload: {}, visible: false,
voucherDialog: { visible: false, ffgsqcLabel: props.ffgsqcLabel, type: props.type }
};
this.handleDebounce = null;
}
componentDidMount() {
window.addEventListener("message", this.handleReceive, false);
}
componentWillUnmount() {
window.removeEventListener("message", this.handleReceive, false);
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.isQuery !== this.props.isQuery) this.setState({
pageInfo: { ...this.state.pageInfo, current: 1 }
}, () => this.getLYList());
}
handleReceive = ({ data }) => {
const { pageInfo } = this.state;
const { type, payload: { id, params } = {} } = data;
if (type === "init") {
this.getLYList();
} else if (type === "turn") {
switch (id) {
case "PAGEINFO":
this.setState({ pageInfo: { ...pageInfo, ...params } }, () => this.getLYList(true));
break;
case "CHECKBOX":
const { selectedRowKeys } = params;
this.setState({ selectedRowKeys });
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 }), "*");
};
getLYList = (updateSum = false) => {
const { form, type } = this.props, { pageInfo, selectedRowKeys } = this.state;
const payload = {
...pageInfo, ...form.getFormParams(),
fycdgsqc: form.getFormParams().fycdgsqc ? form.getFormParams().fycdgsqc.split(",") : []
};
this.setState({ loading: true });
interfaceType[type]["list"](payload).then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
const { columns, data: result } = data;
const { list: dataSource = [], pageNum: current, pageSize, total } = result;
this.setState({
pageInfo: { current, pageSize, total }, dataSource, columns, payload
}, () => {
this.postMessageToChild({
dataSource, pageInfo: this.state.pageInfo, selectedRowKeys, unitTableType: "custom_lingyue",
columns: traverseCols(columns), showTotalCell: true, sumDataSource: {},
scrollHeight: !_.isEmpty(dataSource) ? 195 : 0
});
});
!updateSum && this.getLYListSum({
dataSource, pageInfo: { current, pageSize, total }, selectedRowKeys, unitTableType: "custom_lingyue",
columns: traverseCols(columns), showTotalCell: true, sumDataSource: {},
scrollHeight: !_.isEmpty(dataSource) ? 195 : 0
}, payload);
} else {
message.warning(errormsg);
}
});
};
getLYListSum = (result = {}, payload) => {
const { type } = this.props;
interfaceType[type]["sum"](payload).then(({ status, data }) => {
if (status) this.postMessageToChild({ ...result, sumDataSource: data.sumRow });
});
};
render() {
const { loading, dataSource } = this.state;
const dom = document.querySelector(".wea-new-top-content");
let height = 307.53;
if (dom && dataSource.length > 0) {
height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 47 + 204.53 : dataSource.length < 10 ? dataSource.length * 47 + 204.53 : parseFloat(dom.style.height) - 32;
}
return (<div className="custom_lingyue_list" style={{ height }}>
<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>);
}
}

View File

@ -39,3 +39,35 @@ export const vouchersConditions = [
defaultshow: true
}
];
export const baseConditions = [
{
items: [
{
colSpan: 1,
conditionType: "MONTHPICKER",
domkey: ["salaryMonth"],
fieldcol: 16,
label: "薪资所属月",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 2
},
{
colSpan: 1,
conditionType: "SELECT",
domkey: ["fycdgsqc"],
fieldcol: 16,
label: "发放公司全称",
lanId: 111,
labelcol: 6,
options: [],
value: "",
viewAttr: 2
}
],
title: "",
defaultshow: true
}
];

View File

@ -236,7 +236,7 @@ class List extends Component {
export default List;
const traverseCols = arr => {
export const traverseCols = arr => {
return _.map(arr, item => {
if (!_.isEmpty(item.children)) {
return {

View File

@ -29,6 +29,15 @@
}
}
.baseLayoutQuery_lingyue {
background: #FFF;
margin-bottom: 16px;
.wea-search-group, .wea-content {
padding: 0;
}
}
.custom_lingyue_list {
.ant-spin-nested-loading, .ant-spin-container {
height: 100%;

View File

@ -0,0 +1,44 @@
/*
* 领悦业务线报表二开
* 薪资发放表
* @Author: 黎永顺
* @Date: 2025/4/7
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
import BaseLayout from "../baseLayout";
import { WeaForm } from "comsMobx";
import BaseReportList from "../components/baseReportList";
import { exportffReportList } from "../../../../apis/custom-apis/lingyue";
const form = new WeaForm();
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
constructor(props) {
super(props);
this.state = { isQuery: false };
}
handleExport = async () => {
WeaLoadingGlobal.start();
const payload = {
...form.getFormParams(),
fycdgsqc: form.getFormParams().fycdgsqc ? form.getFormParams().fycdgsqc.split(",") : []
};
const promise = await exportffReportList(payload);
};
render() {
const { isQuery } = this.state;
return (<BaseLayout title={getLabel(111, "薪资发放表")} form={form} onExport={this.handleExport}
onChange={() => this.setState({ isQuery: !isQuery })}>
<BaseReportList form={form} type="paymentReport" isQuery={isQuery}/>
</BaseLayout>);
}
}
export default Index;

View File

@ -0,0 +1,44 @@
/*
* 领悦业务线报表二开
* 薪资统计表 部门
* @Author: 黎永顺
* @Date: 2025/4/7
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
import BaseLayout from "../baseLayout";
import BaseReportList from "../components/baseReportList";
import { WeaForm } from "comsMobx";
import { exportSalaryDepartmentReportList } from "../../../../apis/custom-apis/lingyue";
const form = new WeaForm();
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
constructor(props) {
super(props);
this.state = { isQuery: false };
}
handleExport = async () => {
WeaLoadingGlobal.start();
const payload = {
...form.getFormParams(),
fycdgsqc: form.getFormParams().fycdgsqc ? form.getFormParams().fycdgsqc.split(",") : []
};
const promise = await exportSalaryDepartmentReportList(payload);
};
render() {
const { isQuery } = this.state;
return (<BaseLayout title={getLabel(111, "薪资统计表(部门)")} form={form} onExport={this.handleExport}
onChange={() => this.setState({ isQuery: !isQuery })}>
<BaseReportList form={form} type="salaryStatistic" isQuery={isQuery}/>
</BaseLayout>);
}
}
export default Index;

View File

@ -0,0 +1,44 @@
/*
* 领悦业务线报表二开
* 薪资报税表
* @Author: 黎永顺
* @Date: 2025/4/7
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
import BaseLayout from "../baseLayout";
import { WeaForm } from "comsMobx";
import BaseReportList from "../components/baseReportList";
import { exportbsReportList } from "../../../../apis/custom-apis/lingyue";
const form = new WeaForm();
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
constructor(props) {
super(props);
this.state = { isQuery: false };
}
handleExport = async () => {
WeaLoadingGlobal.start();
const payload = {
...form.getFormParams(),
fycdgsqc: form.getFormParams().fycdgsqc ? form.getFormParams().fycdgsqc.split(",") : []
};
const promise = await exportbsReportList(payload);
};
render() {
const { isQuery } = this.state;
return (<BaseLayout title={getLabel(111, "薪资报税表")} form={form} onExport={this.handleExport}
onChange={() => this.setState({ isQuery: !isQuery })}>
<BaseReportList form={form} type="taxReturn" isQuery={isQuery}/>
</BaseLayout>);
}
}
export default Index;