custom/五院杭州中心
This commit is contained in:
parent
82322ade91
commit
179a0995b1
|
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* 杭州五院二开
|
||||
* 工资申请表流程审批列表
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2025/4/29
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { Spin } from "antd";
|
||||
import EditCalcAdvanceSearchPannel from "../salaryEditCalc/editCalcAdvanceSearchPannel";
|
||||
import { postFetch } from "../../../../../util/request";
|
||||
import { traverse } from "../salaryEditCalc/editCalcTable";
|
||||
import cs from "classnames";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
showSearchAd: false, showTotalCell: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
loading: false, sumRow: {}
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getAcctresultList();
|
||||
} else if (type === "turn") {
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
const { size: pageSize, pageNum: current } = params;
|
||||
this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current, pageSize }
|
||||
}, () => this.getAcctresultList(true));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
getAcctresultList = (isPageChange = false) => {
|
||||
const { pageInfo } = this.state,
|
||||
{ calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props;
|
||||
this.setState({ loading: true });
|
||||
const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams();
|
||||
const payload = {
|
||||
salaryAcctRecordId, ...pageInfo, ...extra, otherConditions,
|
||||
departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
|
||||
positionIds: !_.isEmpty(positionIds) ? positionIds.split(",") : [],
|
||||
subcompanyIds: !_.isEmpty(subcompanyIds) ? subcompanyIds.split(",") : [],
|
||||
statuses: !_.isEmpty(statuses) ? statuses.split(",") : []
|
||||
};
|
||||
postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/acctresult/list", payload)
|
||||
.then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status && !_.isEmpty(data)) {
|
||||
const { columns, pageInfo: { pageNum: current, pageSize, total, list: dataSource } } = data;
|
||||
this.setState({ pageInfo: { current, pageSize, total } }, () => {
|
||||
const { pageInfo, sumRow } = this.state;
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, showTotalCell: true, sumRowlistUrl: "", calcDetail: true, tableScrollHeight: 179,
|
||||
sumRow,
|
||||
columns: _.every(traverse(columns, true), (it, idx) => !it.fixed) ? _.map(traverse(columns, true), (it, idx) => ({
|
||||
...it, fixed: idx < 2 ? "left" : false
|
||||
})) : traverse(columns, true)
|
||||
});
|
||||
});
|
||||
!isPageChange && this.getAcctresultListSum({
|
||||
dataSource, pageInfo: { current, pageSize, total }, showTotalCell: true, sumRowlistUrl: "",
|
||||
calcDetail: true, tableScrollHeight: 179,
|
||||
columns: _.every(traverse(columns, true), (it, idx) => !it.fixed) ? _.map(traverse(columns, true), (it, idx) => ({
|
||||
...it, fixed: idx < 2 ? "left" : false
|
||||
})) : traverse(columns, true)
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
getAcctresultListSum = (tableData) => {
|
||||
const { calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams();
|
||||
const payload = {
|
||||
salaryAcctRecordId, ...extra, otherConditions,
|
||||
departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
|
||||
positionIds: !_.isEmpty(positionIds) ? positionIds.split(",") : [],
|
||||
subcompanyIds: !_.isEmpty(subcompanyIds) ? subcompanyIds.split(",") : [],
|
||||
statuses: !_.isEmpty(statuses) ? statuses.split(",") : []
|
||||
};
|
||||
postFetch("/api/bs/hrmsalary/salaryacct/acctresult/sum", payload)
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { sumRow } = data;
|
||||
this.setState({ sumRow }, () => {
|
||||
this.postMessageToChild({ ...tableData, sumRow });
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
|
||||
onAdSearch = (bool = true) => {
|
||||
this.getAcctresultList();
|
||||
bool && this.openAdvanceSearch();
|
||||
};
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const i18n = {
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"总计": getLabel(523, "总计")
|
||||
};
|
||||
const childFrameObj = document.getElementById("approvalTable");
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
|
||||
render() {
|
||||
const { showSearchAd, loading, pageInfo } = this.state, { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const { pageSize, total } = pageInfo;
|
||||
const columnNum = total > pageSize ? pageSize : total;
|
||||
return (<div className="salary-edit-calc-content">
|
||||
<div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<EditCalcAdvanceSearchPannel
|
||||
salaryAcctRecordId={salaryAcctRecordId}
|
||||
onToggleSwitch={this.openAdvanceSearch}
|
||||
onAdSearch={this.onAdSearch}/>
|
||||
</div>
|
||||
<div style={{ height: `calc((39px * ${columnNum}) + 188.53px)`, maxHeight: "678px" }}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/calcTable"
|
||||
id="approvalTable"
|
||||
/>
|
||||
</Spin>
|
||||
</div>
|
||||
</div>);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* 杭州五院二开
|
||||
* 差异对比表
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2025/4/29
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { Spin } from "antd";
|
||||
import EditCalcAdvanceSearchPannel from "../salaryEditCalc/editCalcAdvanceSearchPannel";
|
||||
import { postFetch } from "../../../../../util/request";
|
||||
import { traverse } from "../salaryEditCalc/editCalcTable";
|
||||
import cs from "classnames";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
showSearchAd: false, showTotalCell: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
loading: false, sumRow: {}
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getAcctresultList();
|
||||
} else if (type === "turn") {
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
const { size: pageSize, pageNum: current } = params;
|
||||
this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current, pageSize }
|
||||
}, () => this.getAcctresultList(true));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
getAcctresultList = (isPageChange = false) => {
|
||||
const { pageInfo } = this.state,
|
||||
{ calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props;
|
||||
this.setState({ loading: true });
|
||||
const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams();
|
||||
const payload = {
|
||||
salaryAcctRecordId, ...pageInfo, ...extra, otherConditions,
|
||||
departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
|
||||
positionIds: !_.isEmpty(positionIds) ? positionIds.split(",") : [],
|
||||
subcompanyIds: !_.isEmpty(subcompanyIds) ? subcompanyIds.split(",") : [],
|
||||
statuses: !_.isEmpty(statuses) ? statuses.split(",") : []
|
||||
};
|
||||
postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/acctresult/list", payload)
|
||||
.then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status && !_.isEmpty(data)) {
|
||||
const { columns, pageInfo: { pageNum: current, pageSize, total, list: dataSource } } = data;
|
||||
this.setState({ pageInfo: { current, pageSize, total } }, () => {
|
||||
const { pageInfo, sumRow } = this.state;
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, showTotalCell: true, sumRowlistUrl: "", calcDetail: true, tableScrollHeight: 179,
|
||||
sumRow,
|
||||
columns: _.every(traverse(columns, true), (it, idx) => !it.fixed) ? _.map(traverse(columns, true), (it, idx) => ({
|
||||
...it, fixed: idx < 2 ? "left" : false
|
||||
})) : traverse(columns, true)
|
||||
});
|
||||
});
|
||||
!isPageChange && this.getAcctresultListSum({
|
||||
dataSource, pageInfo: { current, pageSize, total }, showTotalCell: true, sumRowlistUrl: "",
|
||||
calcDetail: true, tableScrollHeight: 179,
|
||||
columns: _.every(traverse(columns, true), (it, idx) => !it.fixed) ? _.map(traverse(columns, true), (it, idx) => ({
|
||||
...it, fixed: idx < 2 ? "left" : false
|
||||
})) : traverse(columns, true)
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
getAcctresultListSum = (tableData) => {
|
||||
const { calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams();
|
||||
const payload = {
|
||||
salaryAcctRecordId, ...extra, otherConditions,
|
||||
departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
|
||||
positionIds: !_.isEmpty(positionIds) ? positionIds.split(",") : [],
|
||||
subcompanyIds: !_.isEmpty(subcompanyIds) ? subcompanyIds.split(",") : [],
|
||||
statuses: !_.isEmpty(statuses) ? statuses.split(",") : []
|
||||
};
|
||||
postFetch("/api/bs/hrmsalary/salaryacct/acctresult/sum", payload)
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { sumRow } = data;
|
||||
this.setState({ sumRow }, () => {
|
||||
this.postMessageToChild({ ...tableData, sumRow });
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
|
||||
onAdSearch = (bool = true) => {
|
||||
this.getAcctresultList();
|
||||
bool && this.openAdvanceSearch();
|
||||
};
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const i18n = {
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"总计": getLabel(523, "总计")
|
||||
};
|
||||
const childFrameObj = document.getElementById("diffenceTable");
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
|
||||
render() {
|
||||
const { showSearchAd, loading, pageInfo } = this.state, { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const { pageSize, total } = pageInfo;
|
||||
const columnNum = total > pageSize ? pageSize : total;
|
||||
return (<div className="salary-edit-calc-content">
|
||||
<div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<EditCalcAdvanceSearchPannel
|
||||
salaryAcctRecordId={salaryAcctRecordId}
|
||||
onToggleSwitch={this.openAdvanceSearch}
|
||||
onAdSearch={this.onAdSearch}/>
|
||||
</div>
|
||||
<div style={{ height: `calc((39px * ${columnNum}) + 188.53px)`, maxHeight: "678px" }}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/calcTable"
|
||||
id="diffenceTable"
|
||||
/>
|
||||
</Spin>
|
||||
</div>
|
||||
</div>);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -325,7 +325,7 @@ class EditCalcTable extends Component {
|
|||
|
||||
export default EditCalcTable;
|
||||
|
||||
const traverse = (arr, calcDetail) => {
|
||||
export const traverse = (arr, calcDetail) => {
|
||||
return _.map(arr, item => {
|
||||
if (!_.isEmpty(item.children)) {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.salary-flex-between {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ import {
|
|||
import AdvanceInputBtn from "./components/advanceInputBtn";
|
||||
import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm";
|
||||
import SalaryEditCalc from "./components/salaryEditCalc";
|
||||
import SalaryApproval from "./components/salaryApproval";
|
||||
import SalaryDiffence from "./components/salaryDiffence";
|
||||
import ProgressModal from "../../../components/progressModal";
|
||||
import CustomCalcExportDialog from "./components/customCalcExportDialog";
|
||||
import SalaryEditCalcImport from "./components/salaryEditCalcImport";
|
||||
|
|
@ -40,6 +42,8 @@ class Index extends Component {
|
|||
|
||||
};
|
||||
this.calc = null;
|
||||
this.calcApproval = null;
|
||||
this.calcDiffence = null;
|
||||
this.timer = null;
|
||||
}
|
||||
|
||||
|
|
@ -181,13 +185,25 @@ class Index extends Component {
|
|||
onAdvanceSearch={() => this.calc.onAdSearch(false)}/>
|
||||
];
|
||||
!canEdit && reqBtns.splice(0, 1);
|
||||
isOpenApproval && reqBtns.unshift(<Button type="ghost" onClick={() => {
|
||||
window.open(`${approvalWorkflowUrl}&salaryAcctRecordId=${salaryAcctRecordId}`, "_blank");
|
||||
}}>{getLabel(111, "发起审批")}</Button>);
|
||||
accountExceptInfo && reqBtns.unshift(<i className="iconfont icon-jinggao"
|
||||
title={getLabel(111, "存在异常信息,点击下载!")}
|
||||
onClick={() => this.downloadTxtfile(accountExceptInfo)}/>);
|
||||
break;
|
||||
case "approval":
|
||||
isOpenApproval && (reqBtns = [
|
||||
<Button type="primary" onClick={() => {
|
||||
window.open(`${approvalWorkflowUrl}&salaryAcctRecordId=${salaryAcctRecordId}`, "_blank");
|
||||
}}>{getLabel(111, "发起审批")}</Button>,
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={() => this.calcApproval.openAdvanceSearch()}
|
||||
onAdvanceSearch={() => this.calcApproval.onAdSearch(false)}/>
|
||||
]);
|
||||
break;
|
||||
case "diffence":
|
||||
isOpenApproval && (reqBtns = [
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={() => this.calcDiffence.openAdvanceSearch()}
|
||||
onAdvanceSearch={() => this.calcDiffence.onAdSearch(false)}/>
|
||||
]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -212,6 +228,12 @@ class Index extends Component {
|
|||
case "calc":
|
||||
dom = <SalaryEditCalc {...this.props} calcDetail={!canEdit} ref={dom => this.calc = dom}/>;
|
||||
break;
|
||||
case "approval":
|
||||
dom = <SalaryApproval {...this.props} ref={dom => this.calcApproval = dom}/>;
|
||||
break;
|
||||
case "diffence":
|
||||
dom = <SalaryDiffence {...this.props} ref={dom => this.calcDiffence = dom}/>;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -221,9 +243,11 @@ class Index extends Component {
|
|||
render() {
|
||||
const tabs = [
|
||||
{ key: "person", title: getLabel(543547, "人员确认") },
|
||||
{ key: "calc", title: getLabel(538011, "薪资核算") }
|
||||
{ key: "calc", title: getLabel(538011, "薪资核算") },
|
||||
{ key: "approval", title: getLabel(111, "工资申请表流程审批") },
|
||||
{ key: "diffence", title: getLabel(111, "差异对比表") }
|
||||
];
|
||||
const { calculateStore: { setOtherConditions } } = this.props;
|
||||
const { calculateStore: { setOtherConditions, ECSearchForm } } = this.props;
|
||||
const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state;
|
||||
return (
|
||||
<Layout {...this.props} init={this.init}>
|
||||
|
|
@ -231,9 +255,10 @@ class Index extends Component {
|
|||
<WeaReqTop
|
||||
title={getLabel(538011, "薪资核算")} tabDatas={tabs} selectedKey={selectedKey}
|
||||
buttonSpace={10} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
onChange={key => this.setState({ selectedKey: key }, () => setOtherConditions([]))}
|
||||
buttons={this.renderReqBtns()}
|
||||
>
|
||||
onChange={key => this.setState({ selectedKey: key }, () => {
|
||||
ECSearchForm.resetForm();
|
||||
setOtherConditions([]);
|
||||
})} buttons={this.renderReqBtns()}>
|
||||
<div className="salary-calculate-do-calc-content">{this.renderContent()}</div>
|
||||
{
|
||||
progressVisible &&
|
||||
|
|
|
|||
Loading…
Reference in New Issue