custom/五院杭州中心

This commit is contained in:
lys 2025-05-06 09:12:11 +08:00
parent 179a0995b1
commit ac54a3073e
1 changed files with 8 additions and 36 deletions

View File

@ -22,7 +22,7 @@ class Index extends Component {
super(props); super(props);
this.state = { this.state = {
showSearchAd: false, showTotalCell: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, showSearchAd: false, showTotalCell: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
loading: false, sumRow: {} loading: false
}; };
} }
@ -37,21 +37,21 @@ class Index extends Component {
handleReceive = async ({ data }) => { handleReceive = async ({ data }) => {
const { type, payload: { id, params } = {} } = data; const { type, payload: { id, params } = {} } = data;
if (type === "init") { if (type === "init") {
this.getAcctresultList(); this.getCompareDifferentList();
} else if (type === "turn") { } else if (type === "turn") {
switch (id) { switch (id) {
case "PAGEINFO": case "PAGEINFO":
const { size: pageSize, pageNum: current } = params; const { size: pageSize, pageNum: current } = params;
this.setState({ this.setState({
pageInfo: { ...this.state.pageInfo, current, pageSize } pageInfo: { ...this.state.pageInfo, current, pageSize }
}, () => this.getAcctresultList(true)); }, () => this.getCompareDifferentList());
break; break;
default: default:
break; break;
} }
} }
}; };
getAcctresultList = (isPageChange = false) => { getCompareDifferentList = () => {
const { pageInfo } = this.state, const { pageInfo } = this.state,
{ calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props; { calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props;
this.setState({ loading: true }); this.setState({ loading: true });
@ -63,54 +63,26 @@ class Index extends Component {
subcompanyIds: !_.isEmpty(subcompanyIds) ? subcompanyIds.split(",") : [], subcompanyIds: !_.isEmpty(subcompanyIds) ? subcompanyIds.split(",") : [],
statuses: !_.isEmpty(statuses) ? statuses.split(",") : [] statuses: !_.isEmpty(statuses) ? statuses.split(",") : []
}; };
postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/acctresult/list", payload) postFetch("/api/bs/hrmsalary/salaryArchive/wy/compareDifferentList", payload)
.then(({ status, data }) => { .then(({ status, data }) => {
this.setState({ loading: false }); this.setState({ loading: false });
if (status && !_.isEmpty(data)) { if (status && !_.isEmpty(data)) {
const { columns, pageInfo: { pageNum: current, pageSize, total, list: dataSource } } = data; const { columns, pageInfo: { pageNum: current, pageSize, total, list: dataSource } } = data;
this.setState({ pageInfo: { current, pageSize, total } }, () => { this.setState({ pageInfo: { current, pageSize, total } }, () => {
const { pageInfo, sumRow } = this.state; const { pageInfo } = this.state;
this.postMessageToChild({ this.postMessageToChild({
dataSource, pageInfo, showTotalCell: true, sumRowlistUrl: "", calcDetail: true, tableScrollHeight: 179, dataSource, pageInfo, showTotalCell: false, sumRowlistUrl: "", calcDetail: true, tableScrollHeight: 179,
sumRow,
columns: _.every(traverse(columns, true), (it, idx) => !it.fixed) ? _.map(traverse(columns, true), (it, idx) => ({ columns: _.every(traverse(columns, true), (it, idx) => !it.fixed) ? _.map(traverse(columns, true), (it, idx) => ({
...it, fixed: idx < 2 ? "left" : false ...it, fixed: idx < 2 ? "left" : false
})) : traverse(columns, true) })) : traverse(columns, true)
}); });
}); });
!isPageChange && this.getAcctresultListSum({
dataSource, pageInfo: { current, pageSize, total }, showTotalCell: true, sumRowlistUrl: "",
calcDetail: true, tableScrollHeight: 179,
columns: _.every(traverse(columns, true), (it, idx) => !it.fixed) ? _.map(traverse(columns, true), (it, idx) => ({
...it, fixed: idx < 2 ? "left" : false
})) : traverse(columns, true)
});
} }
}).catch(() => this.setState({ loading: false })); }).catch(() => this.setState({ loading: false }));
}; };
getAcctresultListSum = (tableData) => {
const { calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props;
const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams();
const payload = {
salaryAcctRecordId, ...extra, otherConditions,
departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
positionIds: !_.isEmpty(positionIds) ? positionIds.split(",") : [],
subcompanyIds: !_.isEmpty(subcompanyIds) ? subcompanyIds.split(",") : [],
statuses: !_.isEmpty(statuses) ? statuses.split(",") : []
};
postFetch("/api/bs/hrmsalary/salaryacct/acctresult/sum", payload)
.then(({ status, data }) => {
if (status) {
const { sumRow } = data;
this.setState({ sumRow }, () => {
this.postMessageToChild({ ...tableData, sumRow });
});
}
});
};
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
onAdSearch = (bool = true) => { onAdSearch = (bool = true) => {
this.getAcctresultList(); this.getCompareDifferentList();
bool && this.openAdvanceSearch(); bool && this.openAdvanceSearch();
}; };
postMessageToChild = (payload = {}) => { postMessageToChild = (payload = {}) => {