hotfix/2.12.1.2404.02

档案tab总数显示的优化
This commit is contained in:
黎永顺 2024-04-26 14:57:06 +08:00
parent 8751c14002
commit f1670a0380
4 changed files with 36 additions and 24 deletions

View File

@ -45,7 +45,7 @@ class Index extends Component {
}
componentDidMount() {
this.getSalaryFileList(this.props);
this.getSalaryFileList(this.props, true);
window.addEventListener("message", this.handleReceive, false);
window.addEventListener("resize", this.handleResize, false);
}
@ -152,7 +152,7 @@ class Index extends Component {
const childFrameObj = document.getElementById("atdTable");
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
};
getSalaryFileList = (props) => {
getSalaryFileList = (props, init = false) => {
const { pageInfo } = this.state;
const {
payrollFilesStore: { salaryFileQueryForm, queryList }, selectedKey, onChangeTopTabCount
@ -166,7 +166,7 @@ class Index extends Component {
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource
}, () => {
onChangeTopTabCount(selectedKey, total);
onChangeTopTabCount(selectedKey, total, init);
});
}
}).catch(() => this.setState({ loading: false }));

View File

@ -85,15 +85,21 @@ class SalaryFiles extends Component {
break;
}
};
queryInsuranceTabTotal = (active, total) => {
API.queryTabTotal().then(({ status, data }) => {
if (status) {
const key = _.find(tabList, o => o.viewcondition === active).groupid;
this.setState({
topTabCount: { ...this.state.topTabCount, ...data, [key]: total }
});
}
});
queryInsuranceTabTotal = (active, total, init) => {
const key = _.find(tabList, o => o.viewcondition === active).groupid;
if (init) {
API.queryTabTotal().then(({ status, data }) => {
if (status) {
this.setState({
topTabCount: { ...this.state.topTabCount, ...data, [key]: total }
});
}
});
} else {
this.setState({
topTabCount: { ...this.state.topTabCount, [key]: total }
});
}
};
handleReqBtnsCLick = (type, importType) => {
const { state, handleSalaryOpts } = this.salaryFileListRef.wrappedInstance || {};

View File

@ -68,7 +68,7 @@ class Index extends Component {
handleReceive = async ({ data }) => {
const { type, payload: { id, params } = {} } = data;
if (type === "init") {
this.getWelfareList(this.props);
this.getWelfareList(this.props, true);
} else if (type === "turn") {
const { record: { baseInfo, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params;
const { runStatuses, showOperateBtn } = this.props;
@ -154,7 +154,7 @@ class Index extends Component {
getPaymentForm = async (props) => {
return API.getPaymentForm({ ...props });
};
getWelfareList = (props) => {
getWelfareList = (props, init = false) => {
const { pageInfo } = this.state;
const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount, showOperateBtn } = props;
const params = { ...pageInfo, ...welfareForm.getFormParams() };
@ -182,7 +182,7 @@ class Index extends Component {
})
}, () => {
const { pageInfo, selectedRowKeys, columns, dataSource } = this.state;
onChangeTopTabCount(runStatuses, total);
onChangeTopTabCount(runStatuses, total, init);
this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, runStatuses,
columns, showOperateBtn

View File

@ -46,15 +46,21 @@ class Index extends Component {
this.setState({ showExtEmpsWitch: extEmpsWitch === "1" });
}
queryInsuranceTabTotal = (active, total) => {
API.queryInsuranceTabTotal().then(({ status, data }) => {
if (status) {
const key = _.find(tabList, o => o.viewcondition === active).groupid;
this.setState({
topTabCount: { ...this.state.topTabCount, ...data, [key]: total }
});
}
});
queryInsuranceTabTotal = (active, total, init) => {
const key = _.find(tabList, o => o.viewcondition === active).groupid;
if (init) {
API.queryInsuranceTabTotal().then(({ status, data }) => {
if (status) {
this.setState({
topTabCount: { ...this.state.topTabCount, ...data, [key]: total }
});
}
});
} else {
this.setState({
topTabCount: { ...this.state.topTabCount, [key]: total }
});
}
};
handleOpenAdvanceSearch = () => this.setState({ showSearchAd: true });
handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery });