产品-薪酬统计分析管理
This commit is contained in:
parent
ac9aab6f5f
commit
c048565890
|
|
@ -43,14 +43,14 @@ export const reportStatisticsItemSave = (params) => {
|
|||
return postFetch("/api/bs/hrmsalary/report/statistics/item/save", params);
|
||||
};
|
||||
//保存数据范围及负责设置
|
||||
export const reportStatisticsItemSaveSearchCondition = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/report/statistics/item/saveSearchCondition", params);
|
||||
export const reportStatisticsSaveSearchCondition = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/report/statistics/report/saveSearchCondition", params);
|
||||
};
|
||||
//删除自定义统计项目
|
||||
export const reportStatisticsItemDelete = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/report/statistics/item/delete", params);
|
||||
};
|
||||
//获取薪酬统计报表查询条件
|
||||
export const reportStatisticsItemGetSearchCondition = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/report/statistics/item/getSearchCondition", params);
|
||||
export const reportStatisticsGetSearchCondition = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/report/getSearchCondition", "GET", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ export const condition = [
|
|||
{
|
||||
colSpan: 2,
|
||||
conditionType: "RANGEPICKER",
|
||||
domkey: ["hiredate"],
|
||||
domkey: ["hiredate1", "hiredate2"],
|
||||
fieldcol: 18,
|
||||
label: getLabel(111, "入职日期"),
|
||||
labelcol: 6,
|
||||
|
|
|
|||
|
|
@ -63,7 +63,16 @@ class ReportContent extends Component {
|
|||
const { countResult, columns, pageInfo: { list } } = data;
|
||||
this.setState({
|
||||
countResult,
|
||||
columns: _.map(columns, it => ({ ...it, dataIndex: it.column, title: it.text, align: "center" })),
|
||||
columns: _.map(columns, it => ({
|
||||
...it,
|
||||
dataIndex: it.column, width: 150,
|
||||
title: it.text, align: "center",
|
||||
children: !_.isNil(it.children) ? _.map(it.children, child => ({
|
||||
...child,
|
||||
dataIndex: child.column, width: 150,
|
||||
title: child.text, align: "center"
|
||||
})) : []
|
||||
})),
|
||||
dataSource: list || []
|
||||
}, () => {
|
||||
this.postMessageToChild({
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ import { Button, message, Modal } from "antd";
|
|||
import { condition } from "./condition";
|
||||
import { getSearchs } from "../../../util";
|
||||
import {
|
||||
reportStatisticsGetSearchCondition,
|
||||
reportStatisticsItemDelete,
|
||||
reportStatisticsItemGetSearchCondition,
|
||||
reportStatisticsItemSaveSearchCondition,
|
||||
reportStatisticsSaveSearchCondition,
|
||||
statisticsItemList
|
||||
} from "../../../apis/statistics";
|
||||
import { commonEnumList } from "../../../apis/ruleconfig";
|
||||
|
|
@ -72,12 +72,9 @@ class StatisticalMicroSettingsSlide extends Component {
|
|||
nextProps.form.initFormFields(condition);
|
||||
}
|
||||
if (nextProps.id !== this.props.id && !_.isEmpty(nextProps.id)) {
|
||||
this.reportStatisticsItemGetSearchCondition(nextProps.id);
|
||||
this.reportStatisticsGetSearchCondition(nextProps.id);
|
||||
this.statisticsItemList(nextProps.id).then(r => {
|
||||
});
|
||||
this.setState({
|
||||
salaryMonth: [moment().startOf("year").format("YYYY-MM"), moment().format("YYYY-MM")]
|
||||
});
|
||||
}
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
nextProps.form.resetForm();
|
||||
|
|
@ -85,18 +82,37 @@ class StatisticalMicroSettingsSlide extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
reportStatisticsItemGetSearchCondition = (id) => {
|
||||
reportStatisticsItemGetSearchCondition({ id }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
console.log(data);
|
||||
reportStatisticsGetSearchCondition = (id) => {
|
||||
const { conditions } = this.state;
|
||||
const { form } = this.props;
|
||||
reportStatisticsGetSearchCondition({ id }).then(({ status, data }) => {
|
||||
if (status && !_.isEmpty(data)) {
|
||||
const { salaryEndMonth, salaryStartMonth, ...formData } = data.data;
|
||||
this.setState({
|
||||
salaryMonth: [salaryStartMonth || moment().startOf("year").format("YYYY-MM"), salaryEndMonth || moment().format("YYYY-MM")]
|
||||
});
|
||||
const fields = _.map(conditions[0].items, it => it.domkey[0]);
|
||||
fields.map(item => {
|
||||
const value = item.indexOf("hiredate") !== -1 ? {
|
||||
value: formData["hiredate"] || []
|
||||
} : {
|
||||
value: !_.isNil(formData[item]) ? _.map(formData[item], val => val.id).join(",") : "",
|
||||
valueSpan: !_.isNil(formData[item]) ? _.map(formData[item], val => val.name).join(",") : "",
|
||||
valueObj: !_.isNil(formData[item]) ? formData[item] : []
|
||||
};
|
||||
const key = item.indexOf("hiredate") !== -1 ? "hiredate1__hiredate2" : item;
|
||||
form.updateFields({
|
||||
[key]: value
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
reportStatisticsItemSaveSearchCondition = () => {
|
||||
reportStatisticsSaveSearchCondition = () => {
|
||||
const { salaryMonth, dataSource } = this.state;
|
||||
const { form, id, dimension } = this.props;
|
||||
const { form, id, dimension, onClose } = this.props;
|
||||
const [salaryStartMonth, salaryEndMonth] = salaryMonth;
|
||||
const { hiredate, department, employee, position, subCompany, taxAgent } = form.getFormDatas();
|
||||
const { department, employee, position, subCompany, taxAgent, ...extra } = form.getFormDatas();
|
||||
const { value, valueSpan } = taxAgent;
|
||||
if (!salaryEndMonth && !salaryStartMonth) {
|
||||
this.refs.weaError.showError();
|
||||
|
|
@ -104,21 +120,21 @@ class StatisticalMicroSettingsSlide extends Component {
|
|||
}
|
||||
const payload = {
|
||||
dimension, id,
|
||||
hiredate: hiredate.value,
|
||||
hiredate: extra["hiredate1__hiredate2"].value || [],
|
||||
department: _.map(department.valueObj, it => ({ id: it.id, name: it.name })),
|
||||
employee: _.map(employee.valueObj, it => ({ id: it.id, name: it.name })),
|
||||
position: _.map(position.valueObj, it => ({ id: it.id, name: it.name })),
|
||||
subCompany: _.map(subCompany.valueObj, it => ({ id: it.id, name: it.name })),
|
||||
taxAgent: value ? _.map(value.split(","), (it, idx) => ({ id: it, name: valueSpan.split(",")[idx] })) : [],
|
||||
items: dataSource,
|
||||
salaryEndMonth,
|
||||
salaryStartMonth
|
||||
salaryEndMonth: salaryEndMonth + "-01",
|
||||
salaryStartMonth: salaryStartMonth + "-01"
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
reportStatisticsItemSaveSearchCondition(payload).then(({ status, errormsg }) => {
|
||||
reportStatisticsSaveSearchCondition(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
|
||||
onClose(true);
|
||||
message.success(getLabel(111, "保存成功"));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
|
|
@ -237,6 +253,7 @@ class StatisticalMicroSettingsSlide extends Component {
|
|||
<WeaSlideModal
|
||||
className="microSlideWrapper"
|
||||
{...this.props}
|
||||
onClose={() => this.props.onClose()}
|
||||
top={0}
|
||||
measureT="%"
|
||||
width={800}
|
||||
|
|
@ -244,7 +261,7 @@ class StatisticalMicroSettingsSlide extends Component {
|
|||
height={100}
|
||||
measureY="%"
|
||||
direction={"right"}
|
||||
title={<TitleDialog loading={loading} onSave={this.reportStatisticsItemSaveSearchCondition}/>}
|
||||
title={<TitleDialog loading={loading} onSave={this.reportStatisticsSaveSearchCondition}/>}
|
||||
content={
|
||||
<React.Fragment>
|
||||
<WeaSearchGroup title={getLabel(111, "统计时间范围")} col={2} showGroup needTigger>
|
||||
|
|
|
|||
|
|
@ -132,9 +132,9 @@ class Index extends Component {
|
|||
<StatisticalMicroSettingsSlide
|
||||
{...statisticalPayload} form={settingForm}
|
||||
taxAgentAdminOption={taxAgentAdminOption}
|
||||
onClose={() => this.setState({
|
||||
onClose={(isRefresh) => this.setState({
|
||||
statisticalPayload: { visible: false, id: "", dimension: "" }
|
||||
})}
|
||||
}, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId))}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue