产品功能-薪酬统计分析
This commit is contained in:
parent
cbf784a2e9
commit
dfae2661a6
|
|
@ -0,0 +1,11 @@
|
|||
import { WeaTools } from "ecCom";
|
||||
import { postFetch } from "../util/request";
|
||||
|
||||
//薪酬统计维度下拉列表
|
||||
export const dimensionSelectList = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/dimension/selectList", "GET", params);
|
||||
};
|
||||
// 保存薪酬统计维度
|
||||
export const dimensionSave = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/report/statistics/dimension/save", params);
|
||||
};
|
||||
|
|
@ -32,6 +32,7 @@ import SysConfig from "./pages/sysConfig";
|
|||
import RuleConfig from "./pages/ruleConfig";
|
||||
import Appconfig from "./pages/appConfig";
|
||||
import FieldManagement from "./pages/fieldManagement";
|
||||
import AnalysisOfSalaryStatistics from "./pages/analysisOfSalaryStatistics"
|
||||
|
||||
import stores from "./stores";
|
||||
import "./style/index";
|
||||
|
|
@ -78,6 +79,7 @@ const DataAcquisition = (props) => props.children;
|
|||
// sysconfig-1 规则配置
|
||||
// appconfig 应用配置
|
||||
// fieldManagement 字段管理
|
||||
// analysisOfSalaryStatistics 薪酬统计分析
|
||||
|
||||
const Routes = (
|
||||
<Route
|
||||
|
|
@ -150,6 +152,7 @@ const Routes = (
|
|||
<Route key="sysconfig-1" path="sysconfig-1" component={RuleConfig}/>
|
||||
<Route key="appconfig" path="appconfig" component={Appconfig}/>
|
||||
<Route key="fieldManagement" path="fieldManagement" component={FieldManagement}/>
|
||||
<Route key="analysisOfSalaryStatistics" path="analysisOfSalaryStatistics" component={AnalysisOfSalaryStatistics}/>
|
||||
</Route>
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
export const condition = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
checkbox: false,
|
||||
checkboxValue: false,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["dimType"],
|
||||
fieldcol: 14,
|
||||
label: "维度类型",
|
||||
labelcol: 6,
|
||||
options: [],
|
||||
detailtype: 2,
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["dimCode"],
|
||||
fieldcol: 14,
|
||||
label: "统计维度",
|
||||
labelcol: 6,
|
||||
options: [],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["dimName"],
|
||||
fieldcol: 14,
|
||||
label: "统计维度名称",
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3,
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "TEXTAREA",
|
||||
domkey: ["remark"],
|
||||
fieldcol: 14,
|
||||
label: "描述",
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2,
|
||||
},
|
||||
],
|
||||
title: "基础设置",
|
||||
defaultshow: true,
|
||||
},
|
||||
];
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 新增统计维度弹框
|
||||
* Description:
|
||||
* Date: 2023/4/11
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { condition } from "./conditions";
|
||||
import { commonEnumList } from "../../../apis/ruleconfig";
|
||||
import { dimensionSelectList } from "../../../apis/statistics";
|
||||
import { getSearchs } from "../../../util";
|
||||
import "../index.less";
|
||||
|
||||
class DimensionSlide extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
date: ""
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const promise = this.initCondition();
|
||||
nextProps.form.initFormFields(condition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
initCondition = async () => {
|
||||
const [dimTypeEnum, dimCodeList] = await Promise.all([this.commonEnumList(), this.dimensionSelectList()]);
|
||||
console.log(dimTypeEnum, dimCodeList, condition);
|
||||
};
|
||||
commonEnumList = () => {
|
||||
const payload = {
|
||||
enumClass: "com.engine.salary.report.enums.SalaryStatisticsDimensionTypeEnum"
|
||||
};
|
||||
return commonEnumList(payload);
|
||||
};
|
||||
dimensionSelectList = () => {
|
||||
return dimensionSelectList();
|
||||
};
|
||||
handleSave = () => {
|
||||
this.props.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setState({ date: new Date() });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { form } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props}
|
||||
initLoadCss hasScroll
|
||||
style={{ width: 900, height: 350 }}
|
||||
className="dimensionSlideWrapper"
|
||||
title={
|
||||
<div className="dimensionTitle">
|
||||
<span>新建统计维度</span>
|
||||
<Button type="primary" onClick={this.handleSave}>保存</Button>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
{getSearchs(form, condition, 1)}
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default DimensionSlide;
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 统计维度管理列表
|
||||
* Description:
|
||||
* Date: 2023/4/11
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
|
||||
class DimensionTable extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default DimensionTable;
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 统计弹框
|
||||
* Description:
|
||||
* Date: 2023/4/10
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import "../index.less";
|
||||
|
||||
class StatisticsModal extends Component {
|
||||
render() {
|
||||
const { typeKey, onCancel } = this.props;
|
||||
const buttons = typeKey === "addReport" ? [
|
||||
<Button type="primary">保存并进行详细统计设置</Button>
|
||||
] : [];
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props}
|
||||
style={{ width: 640 }}
|
||||
buttons={buttons}
|
||||
onCancel={onCancel}
|
||||
initLoadCss
|
||||
className="dimensionModalWrapper"
|
||||
>
|
||||
{this.props.children}
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default StatisticsModal;
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪酬统计分析
|
||||
* Description:
|
||||
* Date: 2023/4/10
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaInputSearch, WeaReqTop } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import StatisticsModal from "./components/statisticsModal";
|
||||
import DimensionSlide from "./components/dimensionSlide";
|
||||
import "./index.less";
|
||||
|
||||
@inject("taxAgentStore", "attendanceStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "statistics",
|
||||
slideReq: {
|
||||
visible: false
|
||||
},
|
||||
modalReq: {
|
||||
title: "", visible: false,
|
||||
typeKey: ""
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
handleReqBtnsClick = (key) => {
|
||||
if (key === "search") {
|
||||
|
||||
} else {
|
||||
const { modalReq } = this.state;
|
||||
const title = key === "dimension" ?
|
||||
<div className="dimensionTitle">
|
||||
<span>统计维度管理</span>
|
||||
<Button type="primary" onClick={this.handleAddDimension}>新建统计维度</Button>
|
||||
</div>
|
||||
: "新建报表";
|
||||
this.setState({
|
||||
modalReq: {
|
||||
...modalReq,
|
||||
title, visible: true, typeKey: key
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
handleCancel = () => {
|
||||
const { modalReq } = this.state;
|
||||
this.setState({
|
||||
modalReq: {
|
||||
...modalReq, visible: false
|
||||
}
|
||||
});
|
||||
};
|
||||
handleAddDimension = () => {
|
||||
const { slideReq } = this.state;
|
||||
this.setState({
|
||||
slideReq: {
|
||||
...slideReq, visible: true
|
||||
}
|
||||
});
|
||||
};
|
||||
handleClose = () => {
|
||||
const { slideReq } = this.state;
|
||||
this.setState({
|
||||
slideReq: {
|
||||
...slideReq, visible: false
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { showOperateBtn }, attendanceStore: { statisticsForm } } = this.props;
|
||||
const { selectedKey, modalReq, slideReq } = this.state;
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={() => this.handleReqBtnsClick("addReport")}>新建报表</Button>,
|
||||
<Button type="ghost" onClick={() => this.handleReqBtnsClick("dimension")}>维度统计管理</Button>,
|
||||
<WeaInputSearch placeholder="请输入报表名称" className="search"
|
||||
onSearch={() => this.handleReqBtnsClick("search")}/>
|
||||
];
|
||||
const tabs = [
|
||||
{ key: "statistics", title: "统计表" },
|
||||
{ key: "detail", title: "员工明细" }
|
||||
];
|
||||
return (
|
||||
<WeaReqTop
|
||||
title="薪酬统计分析" icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" buttons={!showOperateBtn ? buttons.slice(-1) : buttons} buttonSpace={10}
|
||||
showDropIcon={false} tabDatas={tabs} className="xc_tj_fx_wrapper"
|
||||
selectedKey={selectedKey} onChange={selectedKey => this.setState({ selectedKey })}
|
||||
>
|
||||
<div style={{ height: 2000, background: "#fff" }}>
|
||||
<StatisticsModal {...modalReq} onCancel={this.handleCancel}>
|
||||
<div>123</div>
|
||||
</StatisticsModal>
|
||||
<DimensionSlide {...slideReq} onCancel={this.handleClose} form={statisticsForm}/>
|
||||
</div>
|
||||
</WeaReqTop>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
.xc_tj_fx_wrapper {
|
||||
.search {
|
||||
top: -3px;
|
||||
margin-right: 10px;
|
||||
width: 220px;
|
||||
}
|
||||
}
|
||||
|
||||
//统计维度弹框
|
||||
.dimensionModalWrapper, .dimensionSlideWrapper {
|
||||
.dimensionTitle {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.wea-select, .ant-select, .ant-select-selection {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,4 +5,6 @@ import { WeaForm } from "comsMobx";
|
|||
export class AttendanceStore {
|
||||
@observable form = new WeaForm();
|
||||
@observable refenceform = new WeaForm();
|
||||
//薪酬统计 新增form
|
||||
@observable statisticsForm = new WeaForm();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue