feature/2.16.1.2410.01-薪酬统计报表薪资明细添加模板切换和模板创建功能

This commit is contained in:
lys 2024-11-08 10:02:24 +08:00
parent 97a5d37044
commit 641c5f367f
5 changed files with 54 additions and 15 deletions

View File

@ -5,6 +5,7 @@
* Date: 2024/3/26
*/
import React, { Component } from "react";
import { toJS } from "mobx";
import { inject, observer } from "mobx-react";
import { WeaTableNew } from "comsMobx";
import { WeaLoadingGlobal, WeaLocaleProvider, WeaSelect } from "ecCom";
@ -131,28 +132,34 @@ class SalaryDetails extends Component {
}).catch(() => this.setState({ loading: false }));
};
handleExportSalaryList = (key) => {
let { selectedRowKeys, payload, columns } = this.state;
const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
let { selectedRowKeys, payload, columns: tempCols } = this.state;
const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
if (key === "SELECTED" && selectedRowKeys.length === 0) {
message.warning(getLabel(543345, "请选择需要导出的数据!"));
return;
}
WeaLoadingGlobal.start();
const promise = API.exportSalaryList({
...payload, ids: key === "SELECTED" ? selectedRowKeys : [], columns: _.map(columns, o => o.column)
...payload, ids: key === "SELECTED" ? selectedRowKeys : [], columns: _.map(columns, o => o.column || o.dataIndex)
});
};
getColumns = () => {
const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
const {
columns, dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum, transferDialog
columns: tempCols, dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum, transferDialog
} = this.state;
const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/report/statistics/employee/salaryListSum" : "";
const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
if (!_.isEmpty(columns) && !transferDialog.visible && !transferDialog.cancel) {
this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154,
sumRowlistUrl, payload: { ...payload, updateSum },
columns: _.map(columns, (it, idx) => ({
dataIndex: it.column, title: it.text, calcDetail: true,
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.width,
dataIndex: it.column || it.dataIndex, title: it.text || it.title, calcDetail: true,
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : (it.width || it.oldWidth),
fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "",
ellipsis: true
}))
@ -219,11 +226,15 @@ class SalaryDetails extends Component {
render() {
const { loading, dataSource, transferDialog, tempDialog, tempPageList, templateId } = this.state;
const { attendanceStore: { tableStore }, dateRange, showSearchAd } = this.props;
const { attendanceStore: { tableStore }, dateRange, showSearchAd, salaryDetailShowType } = this.props;
return (<React.Fragment>
<div className="query-div">
<WeaSelect style={{ width: 200 }} hasAddBtn options={tempPageList} addOnClick={this.handelAddTemp} showSearch
optionFilterProp="children" value={templateId} onChange={this.changePageListTemplate}/>
{
salaryDetailShowType === "1" &&
<WeaSelect style={{ width: 200 }} hasAddBtn options={tempPageList} addOnClick={this.handelAddTemp}
showSearch optionFilterProp="children" value={templateId}
onChange={this.changePageListTemplate}/>
}
<MonthRangePicker dateRange={dateRange} viewAttr={2} onChange={this.props.onChange}/>
<AdvanceInputBtn onOpenAdvanceSearch={() => this.setState({
transferDialog: { ...this.state.transferDialog, cancel: true }

View File

@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react";
import { WeaDatePicker, WeaInputSearch, WeaLocaleProvider, WeaReqTop } from "ecCom";
import { Button, Dropdown, Menu } from "antd";
import { condition, reportCondition } from "./components/conditions";
import { commonEnumList, reportGetForm } from "../../apis/ruleconfig";
import { commonEnumList, reportGetForm, sysinfo } from "../../apis/ruleconfig";
import { dimensionGetForm } from "../../apis/statistics";
import EmployeeDetails from "./components/employeeDetails";
import SalaryDetails from "./components/salaryDetails";
@ -50,12 +50,16 @@ class Index extends Component {
title: "", visible: false,
typeKey: "", id: ""
},
logDialogVisible: false, filterConditions: "[]"
logDialogVisible: false, filterConditions: "[]",
salaryDetailShowType: "0" //薪资明细列表显示方式
};
}
componentDidMount() {
this.initReportFormCondition();
sysinfo().then(({ status, data }) => {
if (status) this.setState({ salaryDetailShowType: data.SALARY_DETAILS_REPORT_SHOW_TYPE });
});
}
initReportFormCondition = (payload = {}) => {
@ -277,7 +281,7 @@ class Index extends Component {
const {
selectedKey, modalReq, slideReq, conditions, reportConditions,
reportName, keyword, year, logDialogVisible, filterConditions,
dateRange, showSearchAd, isQuery
dateRange, showSearchAd, isQuery, salaryDetailShowType
} = this.state;
const buttons = selectedKey === "statistics" ? [
<Button type="primary" onClick={() => this.handleReqBtnsClick("addReport")}>{getLabel(111, "新建报表")}</Button>,
@ -336,8 +340,8 @@ class Index extends Component {
iconBgcolor="#F14A2D" tabDatas={tabs} className="xc_tj_fx_wrapper"
buttons={(!statisticsReportBtn && selectedKey === "statistics") ? buttons.slice(-1) : buttons} buttonSpace={10}
onChange={selectedKey => this.setState({ selectedKey }, () => this.state.selectedKey === "statistics" && this.initReportFormCondition())}
showDropIcon={selectedKey !== "detail"} onDropMenuClick={this.onDropMenuClick}
dropMenuDatas={dropMenuDatas}>
showDropIcon={(selectedKey === "statistics") || (selectedKey === "salaryDetail" && salaryDetailShowType !== "1")}
onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}>
{
selectedKey === "statistics" ?
<ReportList
@ -350,6 +354,7 @@ class Index extends Component {
keyword={keyword} year={year}
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
/> : <SalaryDetails ref={dom => this.salaryRef = dom} dateRange={dateRange} isQuery={isQuery}
salaryDetailShowType={salaryDetailShowType}
showSearchAd={showSearchAd} handleOpenAdvanceSearch={this.handleOpenAdvanceSearch}
handleAdvanceSearch={this.handleAdvanceSearch} onAdSearch={this.onAdSearch}
onCancel={() => this.setState({ showSearchAd: false })}

View File

@ -5,6 +5,10 @@
width: 220px;
}
.ant-btn-group {
margin-right: 10px;
}
.employeeYearWrapper {
display: flex;
align-items: center;

View File

@ -196,6 +196,16 @@ export const conditions = [
options: [],
labelcol: 8,
viewAttr: 2
},
{
conditionType: "SELECT",
domkey: ["SALARY_DETAILS_REPORT_SHOW_TYPE"],
fieldcol: 10,
label: "薪资明细显示模式",
lanId: 111,
options: [],
labelcol: 8,
viewAttr: 2
}
],
title: "薪资报表",

View File

@ -51,6 +51,13 @@ class RuleConfig extends Component {
{ key: "1", showname: getLabel(111, "实时组织信息"), selected: false }
]
};
} else if (getKey(o) === "SALARY_DETAILS_REPORT_SHOW_TYPE") {
return {
...o, options: [
{ key: "0", showname: getLabel(111, "定制列"), selected: true },
{ key: "1", showname: getLabel(111, "模板"), selected: false }
]
};
} else if (getKey(o) === "OPEN_APPLICATION_ENCRYPT") {
return { ...o, viewAttr: sysinfo.showEncryptOperationButton === "true" ? 2 : 1 };
} else if (getKey(o) === "taxDeclarationFunction") {
@ -78,7 +85,7 @@ class RuleConfig extends Component {
form.updateFields({ [item]: { value: sysinfo["salaryAcctEmployeeRule"] || "" } });
} else if (item === "taxDeclarationFunction") {
form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "1") } });
} else if (item === "REPORT_ORGANIZATIN_TYPE") {
} else if (item === "REPORT_ORGANIZATIN_TYPE" || item === "SALARY_DETAILS_REPORT_SHOW_TYPE") {
form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "0") } });
} else if (item === "taxAgentShowStatus" || item === "salaryShowStatus" || item === "adjustShowStatus") {
form.updateFields({ [item]: { value: sysinfo[item] || "1" } });
@ -128,6 +135,7 @@ class RuleConfig extends Component {
case "salaryShowStatus":
case "adjustShowStatus":
case "REPORT_ORGANIZATIN_TYPE":
case "SALARY_DETAILS_REPORT_SHOW_TYPE":
if (!this.handleDebounce) {
this.handleDebounce = _.debounce(() => {
const confTitle = {
@ -138,7 +146,8 @@ class RuleConfig extends Component {
taxAgentShowStatus: getLabel(111, "显示【个税扣缴义务人】信息"),
salaryShowStatus: getLabel(111, "显示工资单页签"),
adjustShowStatus: getLabel(111, "显示调薪记录页签"),
REPORT_ORGANIZATIN_TYPE: getLabel(111, "组织信息")
REPORT_ORGANIZATIN_TYPE: getLabel(111, "组织信息"),
SALARY_DETAILS_REPORT_SHOW_TYPE: getLabel(111, "薪资明细显示模式")
};
this.unifiedSettings(key, confTitle[key]);
this.handleDebounce = null;