Merge branch 'feature/2.9.9.2312.01-薪资核算查看权限' into release/2.9.10.2312.02

# Conflicts:
#	pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
This commit is contained in:
黎永顺 2023-12-29 10:14:39 +08:00
commit 3a83207915
7 changed files with 139 additions and 14 deletions

View File

@ -30,6 +30,7 @@ import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail";
import CompareDetail from "./pages/calculateDetail/compareDetail";
import DoCalcDetail from "./pages/calculate/doCalc";
import OfflineCompare from "./pages/calculate/calcOc";
import CalcView from "./pages/calculate/calcView";
import GenerateDeclarationDetail from "./pages/declare/generateDeclarationDetail";
import TemplatePreview from "./pages/payroll/templatePreview";
import PayrollTemplatePreview from "./pages/payroll/templatePreview/tmpPreview"; //重构的工资单模板预览页面
@ -82,6 +83,7 @@ const DataAcquisition = (props) => props.children;
// calculate 薪资核算
// calculateDetail 核算详情
// DoCalcDetail 核算详情页面-新
// CalcView 核算查看页面-新
// OfflineCompare 薪资核算线下对比-新
// placeOnFileDetail 核算归档详情
// compareDetail 线下线上对比
@ -145,7 +147,8 @@ const Routes = (
<Route key="calculateDetail" path="calculateDetail" component={CalculateDetail}/>
<Route key="doCalc" path="calculate/:salaryAcctRecordId" component={DoCalcDetail}/>
<Route key="calcOc" path="calcOc/:salaryAcctRecordId" component={OfflineCompare}/>
<Route key="placeOnFileDetail" path="placeOnFileDetail/:salaryAcctRecordId" component={PlaceOnFileDetail}/>
<Route key="calcView" path="calcView/:salaryAcctRecordId" component={CalcView}/>
<Route key="placeOnFileDetail" path="placeOnFileDetail" component={PlaceOnFileDetail}/>
<Route key="compareDetail" path="compareDetail" component={CompareDetail}/>
<Route key="payroll" path="payroll" component={Payroll}/>
<Route key="watermarkPreview" path="payroll/watermark/preview" component={WatermarkPreview}/>

View File

@ -0,0 +1,107 @@
/*
* Author: 黎永顺
* name: 薪资核算查看
* Description:
* Date: 2023/12/7
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTop } from "ecCom";
import { Dropdown, Menu, message } from "antd";
import Layout from "../doCalc/layout";
import SalaryEditCalc from "../doCalc/components/salaryEditCalc";
import AdvanceInputBtn from "../doCalc/components/advanceInputBtn";
import { convertToUrlString } from "../../../util/url";
import { getExportField } from "../../../apis/calculate";
import CustomCalcExportDialog from "../doCalc/components/customCalcExportDialog";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@inject("calculateStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
showChildren: false,
customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] }
};
this.calc = null;
}
init = () => this.setState({ showChildren: true });
handleMenuClick = ({ key }) => {
const { calculateStore: { ECSearchForm }, routeParams: { salaryAcctRecordId } } = this.props;
const { consolidatedTaxation, ...extra } = ECSearchForm.getFormParams();
const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation };
switch (key) {
case "exportAll":
const url = `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${salaryAcctRecordId}&ids=&${convertToUrlString(payload)}`;
window.open(`${window.ecologyContentPath || ""}${url}`, "_blank");
break;
case "export_selected":
const { calcTableRef: { wrappedInstance: { state: { selectedRowKeys } } } } = this.calc;
if (selectedRowKeys.length === 0) {
message.warning(getLabel(543306, "未选择条目"));
return;
}
const url1 = `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${salaryAcctRecordId}&ids=${selectedRowKeys.join(",")}&${convertToUrlString(payload)}`;
window.open(`${window.ecologyContentPath || ""}${url1}`, "_blank");
break;
case "export_custom":
getExportField({ salaryAcctRecordId }).then(({ status, data }) => {
if (status) {
const { checkItems, itemsByGroup } = data;
this.setState({
customExpDialog: {
...this.state.customExpDialog, visible: true, salaryAcctRecordId,
checkItems, itemsByGroup
}
});
}
});
break;
default:
break;
}
};
render() {
const { showChildren, customExpDialog } = this.state;
const btns = [
<Dropdown.Button type="primary" style={{ marginRight: "10px" }}
onClick={() => this.handleMenuClick({ key: "exportAll" })}
overlay={<Menu onClick={(e) => this.handleMenuClick(e)}>
<Menu.Item key="export_selected">{getLabel(543715, "导出所选")}</Menu.Item>
<Menu.Item key="export_custom">{getLabel(544270, "自定义导出")}</Menu.Item>
</Menu>}>{getLabel(81272, "")}</Dropdown.Button>,
<AdvanceInputBtn onOpenAdvanceSearch={() => this.calc.openAdvanceSearch()}
onAdvanceSearch={() => this.calc.onAdSearch(false)}
/>
];
return (
<Layout {...this.props} init={this.init}>
<WeaTop title={getLabel(111, "薪资核算详情")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
showDropIcon={false} buttons={btns}
>
<div className="salary-calculate-view">
{showChildren && <SalaryEditCalc {...this.props} calcDetail ref={dom => this.calc = dom}/>}
{/* 薪资核算-自定义导出*/}
<CustomCalcExportDialog
{...customExpDialog}
onCancel={() => {
this.setState({
customExpDialog: { ...customExpDialog, visible: false }
});
}}
/>
</div>
</WeaTop>
</Layout>
);
}
}
export default Index;

View File

@ -0,0 +1,8 @@
.salary-calculate-view {
width: 100%;
height: 100%;
background-color: #f1f1f1;
position: relative;
z-index: 0;
padding: 8px 16px;
}

View File

@ -123,7 +123,7 @@ class Calculate extends Component {
break;
case "3":
//查看详情
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/placeOnFileDetail/${id}?id=${id}`);
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calcView/${id}`);
break;
case "4":
//重新核算

View File

@ -177,7 +177,10 @@ class EditCalcTable extends Component {
};
queryCalcResultList = () => {
const { pageInfo } = this.state;
const { calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props;
const {
calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId },
calcDetail = false
} = this.props;
const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams();
const payload = {
salaryAcctRecordId, ...pageInfo, ...extra, otherConditions,
@ -196,12 +199,12 @@ class EditCalcTable extends Component {
const { pageInfo, selectedRowKeys } = this.state;
const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";
this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, payload,
showTotalCell: this.props.showTotalCell, sumRowlistUrl,
columns: _.every(traverse(columns), (it, idx) => !it.fixed) ? _.map(traverse(columns), (it, idx) => ({
dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload,
calcDetail,
columns: _.every(traverse(columns, calcDetail), (it, idx) => !it.fixed) ? _.map(traverse(columns, calcDetail), (it, idx) => ({
...it,
fixed: idx < 2 ? "left" : false
})) : traverse(columns)
})) : traverse(columns, calcDetail)
});
});
}
@ -253,18 +256,18 @@ class EditCalcTable extends Component {
export default EditCalcTable;
const traverse = (arr) => {
const traverse = (arr, calcDetail) => {
return _.map(arr, item => {
if (!_.isEmpty(item.children)) {
return {
title: item.text, width: item.width + "px", ellipsis: true,
dataIndex: item.column, children: traverse(item.children),
dataIndex: item.column, children: traverse(item.children, calcDetail),
fixed: item.fixed || false, dataType: item.dataType, align: "center"
};
} else {
return {
title: item.text, width: item.width + "px", fixed: item.fixed || false,
dataIndex: item.column, ellipsis: true, lockStatus: item.lockStatus,
dataIndex: item.column, ellipsis: true, lockStatus: item.lockStatus, calcDetail,
pattern: item.pattern, dataType: item.dataType, align: "center"
};
}

View File

@ -25,10 +25,14 @@ class Layout extends Component {
if (isOpenDevolution) {
const { routeParams: { salaryAcctRecordId } } = this.props;
salaryacctAcctresultCheckAuth({ salaryAcctRecordId }).then(({ status, data }) => {
this.setState({ store: { ...this.state.store, loading: false, hasRight: status && data } });
this.setState({ store: { ...this.state.store, loading: false, hasRight: status && data } }, () => {
this.state.store.hasRight && this.props.init && this.props.init();
});
});
} else {
this.setState({ store: { ...this.state.store, loading: false, hasRight: true } });
this.setState({ store: { ...this.state.store, loading: false, hasRight: true } }, () => {
this.props.init && this.props.init();
});
}
}).catch(() => this.setState({ store: { ...this.state.store, loading: false } }));
};

View File

@ -163,7 +163,7 @@ export default class PlaceOnFileDetail extends React.Component {
};
return (
<Layout {...this.props}>
// <Layout {...this.props}>
<div className="placeOnFileDetail">
<CustomTab
searchOperationItem={
@ -229,7 +229,7 @@ export default class PlaceOnFileDetail extends React.Component {
closeMaskOnClick={() => this.setState({ slideVisiable: false })}/>
}
</div>
</Layout>
// </Layout>
);
}
}