custom/五院杭州中心
This commit is contained in:
parent
179a0995b1
commit
ac54a3073e
|
|
@ -22,7 +22,7 @@ class Index extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
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 }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getAcctresultList();
|
||||
this.getCompareDifferentList();
|
||||
} else if (type === "turn") {
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
const { size: pageSize, pageNum: current } = params;
|
||||
this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current, pageSize }
|
||||
}, () => this.getAcctresultList(true));
|
||||
}, () => this.getCompareDifferentList());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
getAcctresultList = (isPageChange = false) => {
|
||||
getCompareDifferentList = () => {
|
||||
const { pageInfo } = this.state,
|
||||
{ calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props;
|
||||
this.setState({ loading: true });
|
||||
|
|
@ -63,54 +63,26 @@ class Index extends Component {
|
|||
subcompanyIds: !_.isEmpty(subcompanyIds) ? subcompanyIds.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 }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status && !_.isEmpty(data)) {
|
||||
const { columns, pageInfo: { pageNum: current, pageSize, total, list: dataSource } } = data;
|
||||
this.setState({ pageInfo: { current, pageSize, total } }, () => {
|
||||
const { pageInfo, sumRow } = this.state;
|
||||
const { pageInfo } = this.state;
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, showTotalCell: true, sumRowlistUrl: "", calcDetail: true, tableScrollHeight: 179,
|
||||
sumRow,
|
||||
dataSource, pageInfo, showTotalCell: false, 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)
|
||||
});
|
||||
});
|
||||
!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 }));
|
||||
};
|
||||
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 });
|
||||
onAdSearch = (bool = true) => {
|
||||
this.getAcctresultList();
|
||||
this.getCompareDifferentList();
|
||||
bool && this.openAdvanceSearch();
|
||||
};
|
||||
postMessageToChild = (payload = {}) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue