Merge branch 'release/2.9.42311.01' into release/2.9.42310.01-个税

This commit is contained in:
黎永顺 2023-11-09 15:36:38 +08:00
commit c194711c78
3 changed files with 15 additions and 10 deletions

View File

@ -12,6 +12,7 @@ import ChartsRangeSettingsModal from "./chartsRangeSettingsModal";
import { mapBarOptions, mapLineOptions, mapPieOptions } from "./condition"; import { mapBarOptions, mapLineOptions, mapPieOptions } from "./condition";
import { queryRangeSetting, reportStatisticsReportGetData } from "../../../apis/statistics"; import { queryRangeSetting, reportStatisticsReportGetData } from "../../../apis/statistics";
import PovitpivotChartModal from "./povitpivotChartModal"; import PovitpivotChartModal from "./povitpivotChartModal";
import { getSalaryMonthValue } from "./statisticalMicroSettingsSlide";
import "../index.less"; import "../index.less";
class ReportContent extends Component { class ReportContent extends Component {
@ -43,7 +44,7 @@ class ReportContent extends Component {
componentWillReceiveProps(nextProps, nextContext) { componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.report !== this.props.report && nextProps.report.dimensionId) { 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: {} }); this.setState({ viewType: "dataView", chartsInfo: {} });
} }
} }
@ -81,8 +82,13 @@ class ReportContent extends Component {
dataSource, columns, showSum, countResult dataSource, columns, showSum, countResult
}), "*"); }), "*");
}; };
reportStatisticsReportGetData = (id, dimensionId, isShare) => { reportStatisticsReportGetData = (params) => {
const payload = { id, dimensionId, isShare }; 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 }); this.setState({ loading: true });
reportStatisticsReportGetData(payload).then(({ status, data }) => { reportStatisticsReportGetData(payload).then(({ status, data }) => {
this.setState({ loading: false }); this.setState({ loading: false });
@ -191,13 +197,13 @@ class ReportContent extends Component {
handleChangeChartOpts = (chartsType, viewType) => { handleChangeChartOpts = (chartsType, viewType) => {
this.setState({ chartsInfo: {} }); this.setState({ chartsInfo: {} });
if (this.refs.chart && viewType !== "setting" && viewType !== "dataView" && !this.state.rangSet.visible) this.refs.chart.clear(); 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; const { rangSet } = this.state;
viewType !== "setting" && this.setState({ chartsType, viewType }, () => { viewType !== "setting" && this.setState({ chartsType, viewType }, () => {
const { viewType, chartsType } = this.state; const { viewType, chartsType } = this.state;
viewType !== "dataView" ? viewType !== "dataView" ?
this.queryRangeSetting({ reportId, chartsType }, true) : this.queryRangeSetting({ reportId, chartsType }, true) :
this.reportStatisticsReportGetData(reportId, dimensionId, isShare); this.reportStatisticsReportGetData(this.props.report);
}); });
viewType === "setting" && this.setState({ rangSet: { ...rangSet, visible: true, reportId } }, () => { viewType === "setting" && this.setState({ rangSet: { ...rangSet, visible: true, reportId } }, () => {
this.queryRangeSetting({ reportId, chartsType }); this.queryRangeSetting({ reportId, chartsType });
@ -213,8 +219,7 @@ class ReportContent extends Component {
}; };
handleGetData = () => { handleGetData = () => {
const { report } = this.props; const { report } = this.props;
const { id, dimensionId, isShare } = report; this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(report));
this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(id, dimensionId, isShare));
}; };
renderCharts = () => { renderCharts = () => {
const { chartsInfo, viewType } = this.state; const { chartsInfo, viewType } = this.state;

View File

@ -436,7 +436,7 @@ export const MonthRangePicker = (props) => {
</div>; </div>;
}; };
// 获取所属月份值 // 获取所属月份值
const getSalaryMonthValue = (dateType) => { export const getSalaryMonthValue = (dateType) => {
let start = "", end = ""; let start = "", end = "";
switch (dateType) { switch (dateType) {
case 1: case 1:

View File

@ -113,7 +113,7 @@ class Index extends Component {
ref={dom => this.leftTabRef = dom} ref={dom => this.leftTabRef = dom}
onChangeTab={report => onChangeTab={report =>
this.setState({ this.setState({
report, report: !_.isNil(report) ? report : this.state.report,
statisticalPayload: { visible: false, id: "", dimension: "" } statisticalPayload: { visible: false, id: "", dimension: "" }
})} })}
/> />
@ -152,7 +152,7 @@ class Index extends Component {
taxAgentAdminOption={taxAgentOption} isShare={isShare} taxAgentAdminOption={taxAgentOption} isShare={isShare}
onClose={(isRefresh) => this.setState({ onClose={(isRefresh) => this.setState({
statisticalPayload: { visible: false, id: "", dimension: "" } statisticalPayload: { visible: false, id: "", dimension: "" }
}, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId, report.isShare))} }, () => isRefresh && this.leftTabRef.reportStatisticsReportList())}
/> />
</div> </div>
</div> </div>