Merge branch 'release/2.9.42311.01' into release/2.9.42310.01-个税
This commit is contained in:
commit
c194711c78
|
|
@ -12,6 +12,7 @@ import ChartsRangeSettingsModal from "./chartsRangeSettingsModal";
|
|||
import { mapBarOptions, mapLineOptions, mapPieOptions } from "./condition";
|
||||
import { queryRangeSetting, reportStatisticsReportGetData } from "../../../apis/statistics";
|
||||
import PovitpivotChartModal from "./povitpivotChartModal";
|
||||
import { getSalaryMonthValue } from "./statisticalMicroSettingsSlide";
|
||||
import "../index.less";
|
||||
|
||||
class ReportContent extends Component {
|
||||
|
|
@ -43,7 +44,7 @@ class ReportContent extends Component {
|
|||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.report !== this.props.report && nextProps.report.dimensionId) {
|
||||
this.reportStatisticsReportGetData(nextProps.report.id, nextProps.report.dimensionId, nextProps.report.isShare);
|
||||
this.reportStatisticsReportGetData(nextProps.report);
|
||||
this.setState({ viewType: "dataView", chartsInfo: {} });
|
||||
}
|
||||
}
|
||||
|
|
@ -81,8 +82,13 @@ class ReportContent extends Component {
|
|||
dataSource, columns, showSum, countResult
|
||||
}), "*");
|
||||
};
|
||||
reportStatisticsReportGetData = (id, dimensionId, isShare) => {
|
||||
const payload = { id, dimensionId, isShare };
|
||||
reportStatisticsReportGetData = (params) => {
|
||||
const { id, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start } = params;
|
||||
const [salaryStartMonth, salaryEndMonth] = getSalaryMonthValue(timeType);
|
||||
const payload = {
|
||||
id, dimensionId, isShare,
|
||||
salaryStartMonth: (salaryStartMonth || start) + "-01", salaryEndMonth: (salaryEndMonth || end) + "-01"
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
reportStatisticsReportGetData(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
|
|
@ -191,13 +197,13 @@ class ReportContent extends Component {
|
|||
handleChangeChartOpts = (chartsType, viewType) => {
|
||||
this.setState({ chartsInfo: {} });
|
||||
if (this.refs.chart && viewType !== "setting" && viewType !== "dataView" && !this.state.rangSet.visible) this.refs.chart.clear();
|
||||
const { report: { id: reportId, dimensionId, isShare } } = this.props;
|
||||
const { report: { id: reportId } } = this.props;
|
||||
const { rangSet } = this.state;
|
||||
viewType !== "setting" && this.setState({ chartsType, viewType }, () => {
|
||||
const { viewType, chartsType } = this.state;
|
||||
viewType !== "dataView" ?
|
||||
this.queryRangeSetting({ reportId, chartsType }, true) :
|
||||
this.reportStatisticsReportGetData(reportId, dimensionId, isShare);
|
||||
this.reportStatisticsReportGetData(this.props.report);
|
||||
});
|
||||
viewType === "setting" && this.setState({ rangSet: { ...rangSet, visible: true, reportId } }, () => {
|
||||
this.queryRangeSetting({ reportId, chartsType });
|
||||
|
|
@ -213,8 +219,7 @@ class ReportContent extends Component {
|
|||
};
|
||||
handleGetData = () => {
|
||||
const { report } = this.props;
|
||||
const { id, dimensionId, isShare } = report;
|
||||
this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(id, dimensionId, isShare));
|
||||
this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(report));
|
||||
};
|
||||
renderCharts = () => {
|
||||
const { chartsInfo, viewType } = this.state;
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ export const MonthRangePicker = (props) => {
|
|||
</div>;
|
||||
};
|
||||
// 获取所属月份值
|
||||
const getSalaryMonthValue = (dateType) => {
|
||||
export const getSalaryMonthValue = (dateType) => {
|
||||
let start = "", end = "";
|
||||
switch (dateType) {
|
||||
case 1:
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class Index extends Component {
|
|||
ref={dom => this.leftTabRef = dom}
|
||||
onChangeTab={report =>
|
||||
this.setState({
|
||||
report,
|
||||
report: !_.isNil(report) ? report : this.state.report,
|
||||
statisticalPayload: { visible: false, id: "", dimension: "" }
|
||||
})}
|
||||
/>
|
||||
|
|
@ -152,7 +152,7 @@ class Index extends Component {
|
|||
taxAgentAdminOption={taxAgentOption} isShare={isShare}
|
||||
onClose={(isRefresh) => this.setState({
|
||||
statisticalPayload: { visible: false, id: "", dimension: "" }
|
||||
}, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId, report.isShare))}
|
||||
}, () => isRefresh && this.leftTabRef.reportStatisticsReportList())}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue