2022-04-22 14:35:51 +08:00
|
|
|
|
/*
|
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
|
* Description: 正常缴纳月份
|
|
|
|
|
|
* Date: 2022-04-20 08:56:08
|
2022-06-29 10:13:21 +08:00
|
|
|
|
* LastEditTime: 2022-06-29 09:53:36
|
2022-04-22 14:35:51 +08:00
|
|
|
|
*/
|
|
|
|
|
|
import React, { Component } from "react";
|
2022-07-20 10:33:23 +08:00
|
|
|
|
import { Button, Icon, message, Modal, Spin, Tooltip } from "antd";
|
2022-04-22 14:35:51 +08:00
|
|
|
|
import { inject, observer } from "mobx-react";
|
2023-05-31 18:58:35 +08:00
|
|
|
|
import { WeaFormItem, WeaInput, WeaSearchGroup, WeaTab } from "ecCom";
|
2023-01-03 10:08:52 +08:00
|
|
|
|
import { calcPageNo } from "../../../../util";
|
2022-06-28 18:07:41 +08:00
|
|
|
|
import { getQueryString } from "../../../../util/url";
|
2022-07-21 17:34:10 +08:00
|
|
|
|
import ProgressModal from "../../../../components/progressModal";
|
2022-09-13 16:39:15 +08:00
|
|
|
|
import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal";
|
2022-12-05 14:21:08 +08:00
|
|
|
|
import AdjustmentSlide from "./adjustmentSlide";
|
2023-04-26 17:27:32 +08:00
|
|
|
|
import { getCalculateProgress } from "../../../../apis/calculate";
|
2023-01-03 10:08:52 +08:00
|
|
|
|
import RegEditDetial from "./regEditDetial";
|
|
|
|
|
|
import SupplementarySlide from "./supplementarySlide";
|
2022-04-22 14:35:51 +08:00
|
|
|
|
import _ from "lodash";
|
|
|
|
|
|
import "./index.less";
|
|
|
|
|
|
|
|
|
|
|
|
@inject("standingBookStore")
|
|
|
|
|
|
@observer
|
|
|
|
|
|
export default class NormalIndex extends Component {
|
|
|
|
|
|
constructor(props) {
|
|
|
|
|
|
super(props);
|
|
|
|
|
|
this.state = {
|
|
|
|
|
|
date: "",
|
2022-04-22 19:09:02 +08:00
|
|
|
|
current: 1,
|
2022-07-21 17:34:10 +08:00
|
|
|
|
pageSize: 10,
|
2022-04-22 14:35:51 +08:00
|
|
|
|
selectedRowKeys: [],
|
|
|
|
|
|
addProps: {
|
|
|
|
|
|
title: "",
|
2022-06-28 18:07:41 +08:00
|
|
|
|
visible: false
|
2022-04-22 14:35:51 +08:00
|
|
|
|
},
|
2022-12-05 14:21:08 +08:00
|
|
|
|
adjustSlide: {
|
|
|
|
|
|
title: "调差",
|
|
|
|
|
|
visible: false
|
|
|
|
|
|
},
|
2022-04-22 14:35:51 +08:00
|
|
|
|
tableData: {
|
|
|
|
|
|
list: [],
|
|
|
|
|
|
columns: [],
|
2022-06-28 18:07:41 +08:00
|
|
|
|
total: 0
|
2022-04-22 14:35:51 +08:00
|
|
|
|
},
|
2022-07-21 17:34:10 +08:00
|
|
|
|
searchValue: "",
|
2023-05-31 17:11:19 +08:00
|
|
|
|
workcode: "",
|
2022-07-21 17:34:10 +08:00
|
|
|
|
progressVisible: false,
|
2022-09-08 17:04:36 +08:00
|
|
|
|
progress: 0,
|
2022-09-13 16:39:15 +08:00
|
|
|
|
fieldData: {}, //选中的表单头信息
|
|
|
|
|
|
importParams: { //导入信息的弹框表示
|
2022-09-08 17:04:36 +08:00
|
|
|
|
visible: false
|
2022-12-16 10:47:59 +08:00
|
|
|
|
},
|
|
|
|
|
|
returnEditPersonSlide: {
|
|
|
|
|
|
title: "",
|
|
|
|
|
|
editId: "",
|
|
|
|
|
|
visible: false
|
2023-03-16 17:03:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
showSum: false,
|
2023-05-31 16:31:44 +08:00
|
|
|
|
siaccountSum: {},
|
|
|
|
|
|
showSearchAd: false
|
2022-04-22 14:35:51 +08:00
|
|
|
|
};
|
2022-07-21 17:34:10 +08:00
|
|
|
|
this.timer = null;
|
2022-12-05 13:54:30 +08:00
|
|
|
|
this.timerDelete = null;
|
2022-04-22 14:35:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
2022-10-26 16:54:15 +08:00
|
|
|
|
const { selectedKey, location } = this.props;
|
2022-04-22 19:09:02 +08:00
|
|
|
|
const { current } = this.state;
|
2022-10-26 16:54:15 +08:00
|
|
|
|
const billMonth = location.query.billMonth;
|
|
|
|
|
|
const paymentOrganization = location.query.paymentOrganization;
|
2022-04-22 14:35:51 +08:00
|
|
|
|
selectedKey === "1"
|
2022-06-09 18:30:19 +08:00
|
|
|
|
? this.getNormalList({ billMonth, current, paymentOrganization })
|
|
|
|
|
|
: this.getSupplementaryList({ billMonth, current, paymentOrganization });
|
2023-03-16 17:03:24 +08:00
|
|
|
|
window.addEventListener("message", this.handleReceive, false);
|
2022-04-22 14:35:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-03-16 17:03:24 +08:00
|
|
|
|
handleReceive = async ({ data }) => {
|
|
|
|
|
|
const { type, payload: { id, params } = {} } = data;
|
|
|
|
|
|
if (type === "init") {
|
2023-04-26 17:27:32 +08:00
|
|
|
|
this.postMessageToChild();
|
2023-03-16 17:03:24 +08:00
|
|
|
|
} else if (type === "turn") {
|
|
|
|
|
|
if (id === "PAGEINFO") {
|
|
|
|
|
|
const { pageNum: current, size: pageSize } = params;
|
|
|
|
|
|
this.setState({ current, pageSize }, () => {
|
|
|
|
|
|
const { billMonth, paymentOrganization, selectedKey } = this.props;
|
|
|
|
|
|
const { current, pageSize } = this.state;
|
|
|
|
|
|
selectedKey === "1" ?
|
|
|
|
|
|
this.getNormalList({
|
|
|
|
|
|
billMonth, current, pageSize, paymentOrganization
|
|
|
|
|
|
}) :
|
|
|
|
|
|
this.getSupplementaryList({
|
|
|
|
|
|
billMonth, current, pageSize, paymentOrganization
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
} else if (id === "ROWSELECT") {
|
|
|
|
|
|
const { selectedRowKeys } = params;
|
|
|
|
|
|
this.setState({ selectedRowKeys });
|
|
|
|
|
|
} else if (id === "EDIT") {
|
|
|
|
|
|
this.handleEditNormalStandingBook(params);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2022-07-21 17:34:10 +08:00
|
|
|
|
componentWillUnmount() {
|
|
|
|
|
|
if (this.timer) {
|
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
|
}
|
2022-12-05 13:54:30 +08:00
|
|
|
|
if (this.timerDelete) {
|
|
|
|
|
|
clearInterval(this.timerDelete);
|
|
|
|
|
|
}
|
2023-03-16 17:03:24 +08:00
|
|
|
|
window.removeEventListener("message", this.handleReceive, false);
|
2022-07-21 17:34:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-22 14:35:51 +08:00
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
|
|
|
if (nextProps.selectedKey != this.props.selectedKey) {
|
2022-06-09 18:30:19 +08:00
|
|
|
|
const { billMonth, paymentOrganization } = nextProps;
|
2022-09-29 15:45:23 +08:00
|
|
|
|
this.setState({
|
2023-03-16 17:03:24 +08:00
|
|
|
|
current: 1, selectedRowKeys: []
|
2022-11-01 15:50:54 +08:00
|
|
|
|
}, () => {
|
2022-09-29 15:45:23 +08:00
|
|
|
|
const { current } = this.state;
|
|
|
|
|
|
nextProps.selectedKey === "1"
|
|
|
|
|
|
? this.getNormalList({ billMonth, current, paymentOrganization })
|
2023-03-16 17:03:24 +08:00
|
|
|
|
: this.getSupplementaryList({ billMonth, current, paymentOrganization });
|
2022-11-01 15:50:54 +08:00
|
|
|
|
});
|
2022-04-22 14:35:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-03-16 17:03:24 +08:00
|
|
|
|
postMessageToChild = () => {
|
2023-04-26 17:27:32 +08:00
|
|
|
|
const billMonth = getQueryString("billMonth");
|
|
|
|
|
|
const paymentOrganization = getQueryString("paymentOrganization");
|
2023-03-16 17:03:24 +08:00
|
|
|
|
const childFrameObj = document.getElementById("atdTable");
|
2023-04-26 17:27:32 +08:00
|
|
|
|
const { current, pageSize, tableData, selectedRowKeys, showSum, siaccountSum, searchValue: userName } = this.state;
|
2023-03-16 17:03:24 +08:00
|
|
|
|
const { list: dataSource, total, columns } = tableData;
|
|
|
|
|
|
const pageInfo = { current, pageSize, total };
|
|
|
|
|
|
childFrameObj.contentWindow.postMessage(JSON.stringify({
|
|
|
|
|
|
dataSource, columns, pageInfo,
|
2023-04-26 17:27:32 +08:00
|
|
|
|
selectedRowKeys, selectedKey: this.props.selectedKey,
|
|
|
|
|
|
sumpayload: { billMonth, paymentOrganization, userName },
|
2023-03-16 17:03:24 +08:00
|
|
|
|
showOperates: !getQueryString("type")
|
|
|
|
|
|
}), "*");
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2023-05-31 18:58:35 +08:00
|
|
|
|
handleSearch = () => {
|
2022-06-09 18:30:19 +08:00
|
|
|
|
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
2022-05-19 16:30:21 +08:00
|
|
|
|
selectedKey === "1"
|
2022-06-28 18:07:41 +08:00
|
|
|
|
? this.getNormalList({
|
2022-07-20 10:33:23 +08:00
|
|
|
|
billMonth,
|
|
|
|
|
|
current: 1,
|
|
|
|
|
|
paymentOrganization,
|
2023-05-31 18:58:35 +08:00
|
|
|
|
userName: this.state.searchValue,
|
|
|
|
|
|
workcode: this.state.workcode
|
2022-07-20 10:33:23 +08:00
|
|
|
|
})
|
2022-06-28 18:07:41 +08:00
|
|
|
|
: this.getSupplementaryList({
|
2022-07-20 10:33:23 +08:00
|
|
|
|
billMonth,
|
|
|
|
|
|
current: 1,
|
|
|
|
|
|
paymentOrganization,
|
2023-05-31 18:58:35 +08:00
|
|
|
|
userName: this.state.searchValue,
|
|
|
|
|
|
workcode: this.state.workcode
|
2022-07-20 10:33:23 +08:00
|
|
|
|
});
|
2023-05-31 18:58:35 +08:00
|
|
|
|
};
|
2022-05-19 16:30:21 +08:00
|
|
|
|
|
2022-04-22 14:35:51 +08:00
|
|
|
|
handleSave = () => {
|
2022-06-28 18:07:41 +08:00
|
|
|
|
const {
|
|
|
|
|
|
siaccountCommonSave,
|
|
|
|
|
|
siaccountSupplementarySave,
|
|
|
|
|
|
form
|
|
|
|
|
|
} = this.props.standingBookStore;
|
2022-06-09 18:30:19 +08:00
|
|
|
|
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
2022-04-22 14:35:51 +08:00
|
|
|
|
if (selectedKey === "1") {
|
2022-04-22 19:09:02 +08:00
|
|
|
|
const { includes, excludes } = form.getFormParams();
|
2022-04-22 14:35:51 +08:00
|
|
|
|
const payload = {
|
|
|
|
|
|
billMonth,
|
|
|
|
|
|
includes: includes.split(","),
|
2022-06-28 18:07:41 +08:00
|
|
|
|
excludes: _.isEmpty(excludes) ? excludes.split(",") : []
|
2022-04-22 14:35:51 +08:00
|
|
|
|
};
|
|
|
|
|
|
siaccountCommonSave(payload).then(() => {
|
|
|
|
|
|
message.success("添加成功");
|
2022-06-28 18:07:41 +08:00
|
|
|
|
this.getNormalList({
|
|
|
|
|
|
billMonth,
|
|
|
|
|
|
paymentOrganization,
|
|
|
|
|
|
current: this.state.current
|
|
|
|
|
|
});
|
2022-04-22 14:35:51 +08:00
|
|
|
|
this.setState({
|
|
|
|
|
|
addProps: {
|
|
|
|
|
|
...this.state.addProps,
|
|
|
|
|
|
title: "",
|
2022-06-28 18:07:41 +08:00
|
|
|
|
visible: false
|
|
|
|
|
|
}
|
2022-04-22 14:35:51 +08:00
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
2022-06-28 18:07:41 +08:00
|
|
|
|
const paymentOrganization = getQueryString("paymentOrganization");
|
|
|
|
|
|
form.validateForm().then(f => {
|
2022-04-22 14:35:51 +08:00
|
|
|
|
if (f.isValid) {
|
|
|
|
|
|
const {
|
|
|
|
|
|
includes,
|
|
|
|
|
|
billMonth: billMonthList,
|
|
|
|
|
|
excludes,
|
2022-06-28 18:07:41 +08:00
|
|
|
|
projects
|
2022-04-22 14:35:51 +08:00
|
|
|
|
} = form.getFormParams();
|
|
|
|
|
|
const payload = {
|
|
|
|
|
|
billMonth,
|
|
|
|
|
|
billMonthList: billMonthList.split(","),
|
|
|
|
|
|
includes: includes.split(","),
|
2022-05-26 09:46:28 +08:00
|
|
|
|
// excludes: excludes.split(","),
|
2022-04-22 14:35:51 +08:00
|
|
|
|
projects: projects.split(","),
|
2022-06-28 18:07:41 +08:00
|
|
|
|
paymentOrganization
|
2022-04-22 14:35:51 +08:00
|
|
|
|
};
|
|
|
|
|
|
siaccountSupplementarySave(payload).then(() => {
|
|
|
|
|
|
message.success("添加成功");
|
2022-04-22 19:09:02 +08:00
|
|
|
|
this.getSupplementaryList({
|
|
|
|
|
|
billMonth,
|
2022-06-29 10:13:21 +08:00
|
|
|
|
current: this.state.current,
|
|
|
|
|
|
paymentOrganization
|
2022-04-22 19:09:02 +08:00
|
|
|
|
});
|
2022-06-28 18:07:41 +08:00
|
|
|
|
this.setState(
|
|
|
|
|
|
{
|
|
|
|
|
|
addProps: {
|
|
|
|
|
|
...this.state.addProps,
|
|
|
|
|
|
title: "",
|
|
|
|
|
|
visible: false
|
|
|
|
|
|
}
|
2022-04-22 14:35:51 +08:00
|
|
|
|
},
|
2022-06-28 18:07:41 +08:00
|
|
|
|
() => {
|
|
|
|
|
|
form.resetForm();
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
2022-04-22 14:35:51 +08:00
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
f.showErrors();
|
|
|
|
|
|
this.setState({ date: new Date() }); // 改变一个state的变量,强制页面刷新
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2023-03-16 17:03:24 +08:00
|
|
|
|
getNormalList = async (payload = {}) => {
|
2022-04-22 14:35:51 +08:00
|
|
|
|
const { getNormalList } = this.props.standingBookStore;
|
|
|
|
|
|
getNormalList({ ...payload }).then(({ list, columns = [], total }) => {
|
|
|
|
|
|
this.setState({
|
2023-03-16 17:03:24 +08:00
|
|
|
|
tableData: { list, total, columns }
|
|
|
|
|
|
}, () => this.postMessageToChild());
|
2022-04-22 14:35:51 +08:00
|
|
|
|
});
|
|
|
|
|
|
};
|
2023-03-16 17:03:24 +08:00
|
|
|
|
getSupplementaryList = async (payload = {}) => {
|
2022-04-22 14:35:51 +08:00
|
|
|
|
const { getSupplementaryList } = this.props.standingBookStore;
|
2022-06-28 18:07:41 +08:00
|
|
|
|
getSupplementaryList({
|
|
|
|
|
|
...payload
|
|
|
|
|
|
}).then(({ list, columns = [], total }) => {
|
|
|
|
|
|
this.setState({
|
2023-03-16 17:03:24 +08:00
|
|
|
|
tableData: { list, columns, total }
|
|
|
|
|
|
}, () => this.postMessageToChild());
|
2022-06-28 18:07:41 +08:00
|
|
|
|
});
|
2022-04-22 14:35:51 +08:00
|
|
|
|
};
|
2022-06-28 18:07:41 +08:00
|
|
|
|
onSelectChange = selectedRowKeys => {
|
2022-04-22 14:35:51 +08:00
|
|
|
|
this.setState({ selectedRowKeys });
|
|
|
|
|
|
};
|
|
|
|
|
|
handleBatchDelete = () => {
|
|
|
|
|
|
const { siaccountCommonDelete } = this.props.standingBookStore;
|
|
|
|
|
|
const { list } = this.state.tableData;
|
|
|
|
|
|
const { selectedRowKeys } = this.state;
|
2022-06-09 18:30:19 +08:00
|
|
|
|
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
2022-04-22 14:35:51 +08:00
|
|
|
|
if (_.isEmpty(selectedRowKeys)) {
|
|
|
|
|
|
message.warning("未勾选数据!");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
const includes = _.map(
|
2022-06-28 18:07:41 +08:00
|
|
|
|
_.filter(list, it => selectedRowKeys.includes(it.id)),
|
|
|
|
|
|
item => item.employeeId
|
2022-04-22 14:35:51 +08:00
|
|
|
|
);
|
2022-09-29 15:45:23 +08:00
|
|
|
|
const ids = _.map(
|
|
|
|
|
|
_.filter(list, it => selectedRowKeys.includes(it.id)),
|
|
|
|
|
|
item => item.id
|
|
|
|
|
|
);
|
2022-04-22 14:35:51 +08:00
|
|
|
|
Modal.confirm({
|
|
|
|
|
|
title: "确认信息",
|
|
|
|
|
|
content: "确认删除勾选的数据吗?",
|
|
|
|
|
|
onOk: () => {
|
2022-12-05 13:54:30 +08:00
|
|
|
|
this.setState({
|
|
|
|
|
|
progressVisible: true
|
|
|
|
|
|
}, () => {
|
|
|
|
|
|
this.timerDelete = setInterval(() => {
|
|
|
|
|
|
if (this.state.progress !== 100) {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
progress: this.state.progress + 10
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
clearInterval(this.timerDelete);
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
progressVisible: false,
|
|
|
|
|
|
progress: 0
|
|
|
|
|
|
}, () => {
|
|
|
|
|
|
message.success("删除成功");
|
|
|
|
|
|
selectedKey === "1"
|
|
|
|
|
|
? this.getNormalList({
|
|
|
|
|
|
billMonth,
|
|
|
|
|
|
paymentOrganization,
|
|
|
|
|
|
current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length)
|
|
|
|
|
|
})
|
|
|
|
|
|
: this.getSupplementaryList({
|
|
|
|
|
|
billMonth,
|
|
|
|
|
|
current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length),
|
|
|
|
|
|
paymentOrganization
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}, 800);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2022-06-29 10:13:21 +08:00
|
|
|
|
siaccountCommonDelete({
|
|
|
|
|
|
billMonth,
|
|
|
|
|
|
includes,
|
2022-09-29 15:45:23 +08:00
|
|
|
|
ids,
|
2022-06-29 10:13:21 +08:00
|
|
|
|
paymentOrganization
|
|
|
|
|
|
}).then(() => {
|
2022-12-05 13:54:30 +08:00
|
|
|
|
clearInterval(this.timerDelete);
|
2022-04-22 14:35:51 +08:00
|
|
|
|
message.success("删除成功");
|
2022-12-05 13:54:30 +08:00
|
|
|
|
this.setState({ selectedRowKeys: [], progressVisible: false, progress: 0 });
|
2022-04-22 14:35:51 +08:00
|
|
|
|
selectedKey === "1"
|
2022-06-28 18:07:41 +08:00
|
|
|
|
? this.getNormalList({
|
2022-07-20 10:33:23 +08:00
|
|
|
|
billMonth,
|
|
|
|
|
|
paymentOrganization,
|
2022-11-01 15:50:54 +08:00
|
|
|
|
current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length)
|
2022-07-20 10:33:23 +08:00
|
|
|
|
})
|
2022-04-22 19:09:02 +08:00
|
|
|
|
: this.getSupplementaryList({
|
2022-07-20 10:33:23 +08:00
|
|
|
|
billMonth,
|
2022-11-01 15:50:54 +08:00
|
|
|
|
current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length),
|
2022-07-20 10:33:23 +08:00
|
|
|
|
paymentOrganization
|
|
|
|
|
|
});
|
2022-04-22 14:35:51 +08:00
|
|
|
|
});
|
2022-12-05 13:54:30 +08:00
|
|
|
|
|
2022-04-22 14:35:51 +08:00
|
|
|
|
},
|
2022-07-20 10:33:23 +08:00
|
|
|
|
onCancel: () => {
|
|
|
|
|
|
}
|
2022-04-22 14:35:51 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
handleAdd = () => {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
addProps: {
|
|
|
|
|
|
...this.state.addProps,
|
|
|
|
|
|
title: "添加缴纳人员",
|
2022-06-28 18:07:41 +08:00
|
|
|
|
visible: true
|
|
|
|
|
|
}
|
2022-04-22 14:35:51 +08:00
|
|
|
|
});
|
|
|
|
|
|
};
|
2022-05-26 09:46:28 +08:00
|
|
|
|
|
2023-05-31 18:58:35 +08:00
|
|
|
|
handleCommonAccountClick = () => {
|
2022-07-21 17:34:10 +08:00
|
|
|
|
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
2022-06-28 18:07:41 +08:00
|
|
|
|
const { commonAccount } = this.props.standingBookStore;
|
2022-12-16 10:47:59 +08:00
|
|
|
|
commonAccount({ billMonth, paymentOrganization, includes: [] });
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
progressVisible: true
|
|
|
|
|
|
}, () => {
|
|
|
|
|
|
this.timer = setInterval(() => {
|
|
|
|
|
|
getCalculateProgress(billMonth).then(({ status, data }) => {
|
|
|
|
|
|
if (status) {
|
2023-03-07 16:15:17 +08:00
|
|
|
|
if (!data.status) {
|
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
progressVisible: false,
|
|
|
|
|
|
progress: 0
|
|
|
|
|
|
});
|
|
|
|
|
|
message.error(data.message);
|
|
|
|
|
|
}
|
2022-12-16 10:47:59 +08:00
|
|
|
|
if (this.state.progress !== 100) {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
progress: (Number(data.progress).toFixed(2)) * 100
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
progressVisible: false,
|
|
|
|
|
|
progress: 0
|
|
|
|
|
|
}, () => {
|
|
|
|
|
|
message.success("核算成功");
|
|
|
|
|
|
selectedKey === "1"
|
|
|
|
|
|
? this.getNormalList({
|
|
|
|
|
|
billMonth,
|
|
|
|
|
|
paymentOrganization,
|
|
|
|
|
|
current: this.state.current
|
|
|
|
|
|
})
|
|
|
|
|
|
: this.getSupplementaryList({
|
|
|
|
|
|
billMonth,
|
|
|
|
|
|
paymentOrganization,
|
|
|
|
|
|
current: this.state.current
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2022-07-21 17:34:10 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
progressVisible: false,
|
|
|
|
|
|
progress: 0
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2022-12-16 10:47:59 +08:00
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
progressVisible: false,
|
|
|
|
|
|
progress: 0
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
}, 600);
|
2022-06-28 18:07:41 +08:00
|
|
|
|
});
|
2023-05-31 18:58:35 +08:00
|
|
|
|
};
|
2022-07-20 10:33:23 +08:00
|
|
|
|
|
|
|
|
|
|
handleExport = () => {
|
|
|
|
|
|
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
|
|
|
|
|
const urlObj = {
|
|
|
|
|
|
"1": "/api/bs/hrmsalary/welfare/common/export",
|
|
|
|
|
|
"3": "/api/bs/hrmsalary/welfare/supplementary/export"
|
|
|
|
|
|
};
|
|
|
|
|
|
const url = `${window.location
|
|
|
|
|
|
.origin}${urlObj[selectedKey]}?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
|
|
|
|
|
|
window.open(url, "_self");
|
|
|
|
|
|
};
|
2022-12-16 10:47:59 +08:00
|
|
|
|
handleEditNormalStandingBook = (record) => {
|
|
|
|
|
|
const { userName, id: editId } = record;
|
|
|
|
|
|
const { returnEditPersonSlide } = this.state;
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
returnEditPersonSlide: { ...returnEditPersonSlide, visible: true, title: userName, editId }
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
2022-12-20 17:22:28 +08:00
|
|
|
|
handleCloseNormalStandingBookModal = (refreshList = false) => {
|
2022-12-20 10:52:24 +08:00
|
|
|
|
const { returnEditPersonSlide } = this.state;
|
2022-12-16 10:47:59 +08:00
|
|
|
|
this.setState({
|
|
|
|
|
|
returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" }
|
|
|
|
|
|
}, () => {
|
2023-01-10 13:51:14 +08:00
|
|
|
|
if (refreshList) {
|
|
|
|
|
|
const { current } = this.state;
|
|
|
|
|
|
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
|
|
|
|
|
selectedKey === "1"
|
|
|
|
|
|
? this.getNormalList({
|
|
|
|
|
|
billMonth,
|
|
|
|
|
|
paymentOrganization,
|
|
|
|
|
|
current
|
|
|
|
|
|
})
|
|
|
|
|
|
: this.getSupplementaryList({
|
|
|
|
|
|
billMonth,
|
|
|
|
|
|
paymentOrganization,
|
|
|
|
|
|
current
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2022-12-16 10:47:59 +08:00
|
|
|
|
});
|
|
|
|
|
|
};
|
2023-05-31 18:58:35 +08:00
|
|
|
|
getSearchs = () => {
|
|
|
|
|
|
return <WeaSearchGroup needTigger showGroup title="其他条件">
|
|
|
|
|
|
<WeaFormItem label="工号" labelCol={{ span: 4 }} wrapperCol={{ span: 8 }}>
|
2023-05-31 17:11:19 +08:00
|
|
|
|
<WeaInput
|
|
|
|
|
|
value={this.state.workcode}
|
|
|
|
|
|
onChange={v => this.setState({ workcode: v })}
|
|
|
|
|
|
/>
|
|
|
|
|
|
</WeaFormItem>
|
|
|
|
|
|
</WeaSearchGroup>;
|
2023-05-31 18:58:35 +08:00
|
|
|
|
};
|
2022-12-16 10:47:59 +08:00
|
|
|
|
|
2022-04-22 14:35:51 +08:00
|
|
|
|
render() {
|
2023-02-14 16:21:48 +08:00
|
|
|
|
const { remarks, billMonth, selectedKey, paymentOrganization, standingBookStore } = this.props;
|
2023-05-31 18:58:35 +08:00
|
|
|
|
const { addProps, adjustSlide, importParams, returnEditPersonSlide, showSearchAd } = this.state;
|
2023-02-14 16:21:48 +08:00
|
|
|
|
const { loading } = standingBookStore;
|
2023-05-31 18:58:35 +08:00
|
|
|
|
const btn1 = [
|
|
|
|
|
|
<Button type="primary" onClick={this.handleBatchDelete}>批量删除</Button>,
|
2023-07-14 15:31:57 +08:00
|
|
|
|
<Button type="primary" onClick={this.handleAdd}>添加缴纳人员</Button>
|
2023-05-31 18:58:35 +08:00
|
|
|
|
];
|
|
|
|
|
|
const btn2 = [
|
|
|
|
|
|
<Button type="primary" onClick={this.handleCommonAccountClick}>核算</Button>,
|
|
|
|
|
|
<Button type="primary"
|
|
|
|
|
|
onClick={() => this.setState({ adjustSlide: { ...adjustSlide, visible: true } })}>调差</Button>
|
|
|
|
|
|
];
|
|
|
|
|
|
const btn3 = [
|
|
|
|
|
|
<Button type="primary" onClick={() => {
|
|
|
|
|
|
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/sbofflineComparison?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`);
|
|
|
|
|
|
}}>线下对比</Button>
|
|
|
|
|
|
];
|
|
|
|
|
|
const btn4 = [
|
|
|
|
|
|
<Button type="primary"
|
|
|
|
|
|
onClick={() => this.setState({ importParams: { ...importParams, visible: true } })}>导入数据</Button>
|
|
|
|
|
|
];
|
|
|
|
|
|
const btn5 = [
|
|
|
|
|
|
<Button type="primary" onClick={this.handleExport}>导出全部</Button>
|
|
|
|
|
|
];
|
|
|
|
|
|
let btn = [];
|
|
|
|
|
|
(this.props.type !== "detail" && this.props.selectedKey == "3") && (btn = [...btn, ...btn1]);
|
|
|
|
|
|
(selectedKey === "1" && this.props.type !== "detail") && (btn = [...btn, ...btn2]);
|
|
|
|
|
|
selectedKey === "1" && (btn = [...btn, ...btn3]);
|
|
|
|
|
|
this.props.type !== "detail" && (btn = [...btn, ...btn4]);
|
|
|
|
|
|
btn = [...btn, ...btn5];
|
2022-04-22 14:35:51 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<div className="normalWapper">
|
2022-12-16 10:47:59 +08:00
|
|
|
|
{
|
|
|
|
|
|
selectedKey === "1" &&
|
2022-04-22 14:35:51 +08:00
|
|
|
|
<div className="topContent">
|
|
|
|
|
|
<div className="month">
|
|
|
|
|
|
<span>
|
|
|
|
|
|
账单月份
|
2022-06-28 18:07:41 +08:00
|
|
|
|
<Tooltip placement="topLeft" title="提示:正常缴纳,账单月份即社保福利缴纳月份">
|
2022-07-20 10:33:23 +08:00
|
|
|
|
<Icon type="question-circle"/>
|
2022-04-22 14:35:51 +08:00
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</span>
|
2022-06-28 18:07:41 +08:00
|
|
|
|
<span>
|
|
|
|
|
|
{billMonth}
|
|
|
|
|
|
</span>
|
2022-04-22 14:35:51 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<span>备注:</span>
|
2022-06-28 18:07:41 +08:00
|
|
|
|
<span>
|
|
|
|
|
|
{remarks}
|
|
|
|
|
|
</span>
|
2022-04-22 14:35:51 +08:00
|
|
|
|
</div>
|
2022-12-16 10:47:59 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
}
|
2023-05-31 16:31:44 +08:00
|
|
|
|
<WeaTab
|
|
|
|
|
|
datas={[]} selectedKey="" advanceHeight={200} searchsAd={this.getSearchs()}
|
|
|
|
|
|
searchType={["base", "advanced"]} showSearchAd={showSearchAd}
|
|
|
|
|
|
setShowSearchAd={bool => this.setState({ showSearchAd: bool })}
|
2023-05-31 17:11:19 +08:00
|
|
|
|
onSearchChange={searchValue => this.setState({ searchValue })}
|
2023-05-31 18:58:35 +08:00
|
|
|
|
buttons={btn} onSearch={this.handleSearch} onAdSearch={this.handleSearch}
|
|
|
|
|
|
onAdReset={() => this.setState({ workcode: "" })} searchsBasePlaceHolder="请输入员工姓名"
|
2023-05-31 17:11:19 +08:00
|
|
|
|
/>
|
|
|
|
|
|
<SupplementarySlide
|
|
|
|
|
|
{...addProps}
|
|
|
|
|
|
billMonth={billMonth} paymentOrganization={paymentOrganization}
|
|
|
|
|
|
onCancel={(isRefresh) => {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
addProps: {
|
|
|
|
|
|
...addProps,
|
|
|
|
|
|
visible: false
|
|
|
|
|
|
}
|
|
|
|
|
|
}, () => {
|
|
|
|
|
|
isRefresh && this.getSupplementaryList({
|
|
|
|
|
|
billMonth,
|
|
|
|
|
|
current: this.state.current,
|
|
|
|
|
|
paymentOrganization
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
}}
|
2023-05-31 16:31:44 +08:00
|
|
|
|
/>
|
2023-05-31 17:11:19 +08:00
|
|
|
|
{/*核算进度条*/}
|
|
|
|
|
|
<ProgressModal
|
|
|
|
|
|
title={selectedKey === "3" ? "正在删除请稍后" : "正在核算请稍后"}
|
|
|
|
|
|
visible={this.state.progressVisible}
|
|
|
|
|
|
onCancel={() => {
|
|
|
|
|
|
this.setState({ progressVisible: false, progress: 0 });
|
|
|
|
|
|
}}
|
|
|
|
|
|
progress={this.state.progress}
|
|
|
|
|
|
/>
|
|
|
|
|
|
{/*导入弹框*/}
|
|
|
|
|
|
{
|
|
|
|
|
|
importParams.visible &&
|
|
|
|
|
|
<AcctResultImportModal
|
|
|
|
|
|
visiable={importParams.visible}
|
|
|
|
|
|
fieldData={this.state.fieldData}
|
|
|
|
|
|
onAdd={fieldData => {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
fieldData
|
|
|
|
|
|
});
|
|
|
|
|
|
}}
|
|
|
|
|
|
onCancel={() => {
|
|
|
|
|
|
this.setState({ importParams: { ...importParams, visible: false }, fieldData: {} }, () => {
|
|
|
|
|
|
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
|
|
|
|
|
const { current } = this.state;
|
|
|
|
|
|
selectedKey === "1"
|
|
|
|
|
|
? this.getNormalList({ billMonth, current, paymentOrganization })
|
|
|
|
|
|
: this.getSupplementaryList({ billMonth, current, paymentOrganization });
|
|
|
|
|
|
});
|
|
|
|
|
|
}}
|
|
|
|
|
|
isStandingBook
|
|
|
|
|
|
standingBookTabKey={selectedKey}
|
|
|
|
|
|
/>
|
|
|
|
|
|
}
|
2022-04-22 14:35:51 +08:00
|
|
|
|
{/* table */}
|
2023-02-13 10:41:40 +08:00
|
|
|
|
<div className="tableWrapper">
|
2023-03-16 17:03:24 +08:00
|
|
|
|
<Spin spinning={loading}>
|
|
|
|
|
|
<iframe
|
|
|
|
|
|
style={{ border: 0, width: "100%", height: "100%" }}
|
2023-05-31 18:58:35 +08:00
|
|
|
|
// src="http://localhost:7607/#/standingbookTable"
|
|
|
|
|
|
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/standingbookTable"
|
2023-03-16 17:03:24 +08:00
|
|
|
|
id="atdTable"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</Spin>
|
2022-12-16 10:47:59 +08:00
|
|
|
|
{/*编辑弹框*/}
|
|
|
|
|
|
<RegEditDetial {...returnEditPersonSlide} onCancel={this.handleCloseNormalStandingBookModal}/>
|
2022-12-05 14:21:08 +08:00
|
|
|
|
<AdjustmentSlide
|
|
|
|
|
|
{...adjustSlide}
|
|
|
|
|
|
onCancel={() => {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
adjustSlide: {
|
|
|
|
|
|
...adjustSlide,
|
|
|
|
|
|
visible: false
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>
|
2022-04-22 14:35:51 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|