diff --git a/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js b/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js index 6a80e8fb..aa5f1bed 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js @@ -36,8 +36,8 @@ class PovitpivotChartModal extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { - const { id, dimensionId, dimensionValue, isShare } = nextProps; - this.getDataPerspective({ id, dimensionId, dimensionValue, isShare }); + const { id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth } = nextProps; + this.getDataPerspective({ id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth }); } else { this.setState({ dataSource: [], @@ -64,11 +64,11 @@ class PovitpivotChartModal extends Component { }); } else if (type === "turn") { if (id === "PAGEINFO") { - const { id, dimensionId, dimensionValue, isShare } = this.props; + const { id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth } = this.props; const { pageNum: current, size: pageSize } = params; this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getDataPerspective({ - id, dimensionId, dimensionValue, isShare + id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth })); } } diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js index 7509d3df..9716234a 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js @@ -29,8 +29,8 @@ class ReportContent extends Component { chartsType: "0", chartsInfo: {}, povitView: { - visible: false, id: "", isShare: false, - dimensionId: "", dimensionValue: "" + visible: false, id: "", isShare: false, dimensionId: "", dimensionValue: "", salaryStartMonth: "", + salaryEndMonth: "" }, rangSet: { visible: false, reportId: "", @@ -69,10 +69,15 @@ class ReportContent extends Component { if (id === "PIVOTCHART") { const { record } = params; const { dimension: dimensionValue } = record; - const { id: pivotId, dimensionId, isShare } = this.props.report; + const { + id: pivotId, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start + } = this.props.report; + const [salaryStartMonth, salaryEndMonth] = getSalaryMonthValue(timeType); + this.setState({ povitView: { - visible: true, id: pivotId, dimensionId, dimensionValue, isShare + visible: true, id: pivotId, dimensionId, dimensionValue, isShare, + salaryStartMonth: (salaryStartMonth || start) + "-01", salaryEndMonth: (salaryEndMonth || end) + "-01" } }); } else if (id === "PAGEINFO_REPORT") { @@ -282,7 +287,7 @@ class ReportContent extends Component { onCancel={() => this.setState({ povitView: { visible: false, id: "", dimensionId: "", dimensionValue: "", - isShare: false + isShare: false, salaryStartMonth: "", salaryEndMonth: "" } })} />