diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryApproval/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryApproval/index.js
new file mode 100644
index 00000000..a967a73d
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryApproval/index.js
@@ -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 (
);
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryDiffence/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryDiffence/index.js
new file mode 100644
index 00000000..a13bb9cb
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryDiffence/index.js
@@ -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 ();
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
index 986bb1bb..83ec56e6 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
@@ -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 {
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
index ff3ef53f..3f841a86 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
@@ -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;
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
index 4f4944c7..d6d91fd7 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
@@ -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();
accountExceptInfo && reqBtns.unshift( this.downloadTxtfile(accountExceptInfo)}/>);
break;
+ case "approval":
+ isOpenApproval && (reqBtns = [
+ ,
+ this.calcApproval.openAdvanceSearch()}
+ onAdvanceSearch={() => this.calcApproval.onAdSearch(false)}/>
+ ]);
+ break;
+ case "diffence":
+ isOpenApproval && (reqBtns = [
+ this.calcDiffence.openAdvanceSearch()}
+ onAdvanceSearch={() => this.calcDiffence.onAdSearch(false)}/>
+ ]);
+ break;
default:
break;
}
@@ -212,6 +228,12 @@ class Index extends Component {
case "calc":
dom = this.calc = dom}/>;
break;
+ case "approval":
+ dom = this.calcApproval = dom}/>;
+ break;
+ case "diffence":
+ 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 (
@@ -231,9 +255,10 @@ class Index extends Component {
} iconBgcolor="#F14A2D"
- onChange={key => this.setState({ selectedKey: key }, () => setOtherConditions([]))}
- buttons={this.renderReqBtns()}
- >
+ onChange={key => this.setState({ selectedKey: key }, () => {
+ ECSearchForm.resetForm();
+ setOtherConditions([]);
+ })} buttons={this.renderReqBtns()}>
{this.renderContent()}
{
progressVisible &&