社保福利台账详情页面的补缴添加编辑功能

This commit is contained in:
黎永顺 2022-12-16 10:47:59 +08:00
parent d6fde20bd1
commit 9b6c8ed544
5 changed files with 170 additions and 62 deletions

View File

@ -17,10 +17,14 @@ export const queryList = (params) => {
export const queryInsuranceTabTotal = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/queryInsuranceTabTotal', params);
};
//删除待办
//删除待办-待增员
export const updateRunStatus = (params) => {
return postFetch('/api/bs/hrmsalary/archives/updateRunStatus', params);
};
//删除待办-待减员
export const cancelStayDel = (params) => {
return postFetch('/api/bs/hrmsalary/archives/cancelStayDel', params);
};
//全量增员
export const allStayAddToPay = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/allStayAddToPay', 'GET', params);

View File

@ -174,17 +174,17 @@ export default class Archives extends React.Component {
placement="bottomRight"
content={<Menu onClick={({ key }) => {
if (key === "stopSalary") {
Modal.warning({
Modal.confirm({
title: "信息确认",
content: `确定要删除该条待办人员吗?`,
onOk: () => this.deleteTodoList({ runStatus: "5", ids: [record.baseInfo] })
onOk: () => this.cancelStayDel({ runStatus: "3", ids: [record.baseInfo] })
});
} else {
this.stayDelToStop([record.baseInfo]);
}
}}>
<Menu.Item key="stayDelToStop">减员</Menu.Item>
{/*<Menu.Item key="stopSalary">删除待办</Menu.Item>*/}
<Menu.Item key="stopSalary">删除待办</Menu.Item>
</Menu>} title="">
<i className="icon-coms-more"/>
</Popover>
@ -401,6 +401,8 @@ export default class Archives extends React.Component {
case "suspend":
if (key === "1") {
this.stayDelToStop(selectedRowKeys);
} else if (key === "2") {
this.cancelStayDel({ runStatus: "3", ids: selectedRowKeys });
}
break;
default:
@ -454,7 +456,7 @@ export default class Archives extends React.Component {
}
});
};
//删除待办
//删除待办-待增员
deleteTodoList = (payload) => {
API.updateRunStatus(payload).then(({ status, errormsg }) => {
if (status) {
@ -466,6 +468,18 @@ export default class Archives extends React.Component {
}
});
};
//删除待办-待减员
cancelStayDel = (payload) => {
API.cancelStayDel(payload).then(({ status, errormsg }) => {
if (status) {
message.success("操作成功");
this.query();
this.onSelectChange([]);
} else {
message.error(errormsg || "操作失败");
}
});
};
getTipChildren = () => {
const { selectedKey } = this.state;
@ -649,6 +663,7 @@ export default class Archives extends React.Component {
overlay={
<Menu onClick={this.handleMenuItemClick}>
<Menu.Item key="1">批量减员</Menu.Item>
<Menu.Item key="2">批量删除待办</Menu.Item>
</Menu>
}
type="primary"

View File

@ -9,6 +9,7 @@ import CustomPaginationTable from "../../../components/customPaginationTable";
import moment from "moment";
import _ from "lodash";
import ProgressModal from "../../../components/progressModal";
import { getCalculateProgress } from "../../../apis/calculate";
import "./index.less";
const MonthPicker = DatePicker.MonthPicker;
@ -318,39 +319,54 @@ export default class StandingBook extends React.Component {
break;
}
};
handleOk = (formVal) => {
handleOk = async (formVal) => {
const { save } = this.props.standingBookStore;
const { billMonth, ...extra } = formVal;
const payload = {
billMonth: moment(billMonth).format("YYYY-MM"),
...extra
};
save(payload).then(({ data }) => {
this.setState({
progressVisible: true
}, () => {
this.timer = setInterval(() => {
if (this.state.progress !== 100) {
this.setState({
progress: this.state.progress + 10
});
const { data: saveData } = await save(payload);
this.setState({
progressVisible: true
}, () => {
this.timer = setInterval(() => {
getCalculateProgress(moment(billMonth).format("YYYY-MM")).then(({ status, data }) => {
if (status) {
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("核算成功");
this.handleClose();
this.getCommonList({
...this.state.tableParams,
current: this.state.current
});
this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : "", saveData);
});
}
} else {
clearInterval(this.timer);
this.setState({
progressVisible: false,
progress: 0
}, () => {
message.success("核算成功");
this.handleClose();
this.getCommonList({
...this.state.tableParams,
current: this.state.current
});
this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : "", data);
});
}
}, 1000);
});
}).catch(() => {
clearInterval(this.timer);
this.setState({
progressVisible: false,
progress: 0
});
});
}, 600);
});
};

View File

@ -37,6 +37,14 @@
margin-right: 0px;
}
}
.tdEllipsis {
display: inline-block;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
//退差

View File

@ -14,8 +14,10 @@ import { getQueryString } from "../../../../util/url";
import ProgressModal from "../../../../components/progressModal";
import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal";
import AdjustmentSlide from "./adjustmentSlide";
import { getCalculateProgress } from "../../../../apis/calculate";
import _ from "lodash";
import "./index.less";
import RegEditDetial from "./regEditDetial";
@inject("standingBookStore")
@observer
@ -46,6 +48,11 @@ export default class NormalIndex extends Component {
fieldData: {}, //选中的表单头信息
importParams: { //导入信息的弹框表示
visible: false
},
returnEditPersonSlide: {
title: "",
editId: "",
visible: false
}
};
this.timer = null;
@ -192,7 +199,6 @@ export default class NormalIndex extends Component {
...it,
width: 150,
fixed: "left",
render: (text, r) => {
const { userName, employeeId } = r;
return (
@ -362,40 +368,52 @@ export default class NormalIndex extends Component {
handleCommonAccountClick() {
const { billMonth, selectedKey, paymentOrganization } = this.props;
const { commonAccount } = this.props.standingBookStore;
commonAccount({
billMonth,
paymentOrganization,
includes: []
}).then(() => {
this.setState({
progressVisible: true
}, () => {
this.timer = setInterval(() => {
if (this.state.progress !== 100) {
this.setState({
progress: this.state.progress + 10
});
commonAccount({ billMonth, paymentOrganization, includes: [] });
this.setState({
progressVisible: true
}, () => {
this.timer = setInterval(() => {
getCalculateProgress(billMonth).then(({ status, data }) => {
if (status) {
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
});
});
}
} else {
clearInterval(this.timer);
message.success("核算成功");
this.setState({
progressVisible: false,
progress: 0
});
selectedKey === "1"
? this.getNormalList({
billMonth,
paymentOrganization,
current: this.state.current
})
: this.getSupplementaryList({
billMonth,
paymentOrganization,
current: this.state.current
});
}
}, 1000);
});
}).catch(() => {
clearInterval(this.timer);
this.setState({
progressVisible: false,
progress: 0
});
});
}, 600);
});
}
@ -410,15 +428,25 @@ export default class NormalIndex extends Component {
window.open(url, "_self");
};
handleEditNormalStandingBook = (record) => {
const { userName, id: editId } = record;
const { returnEditPersonSlide } = this.state;
this.setState({
returnEditPersonSlide: { ...returnEditPersonSlide, visible: true, title: userName, editId }
});
};
handleCloseNormalStandingBookModal = () => {
const { returnPersonModal, returnEditPersonSlide } = this.state;
this.setState({
returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" }
}, () => {
});
};
render() {
const { remarks, billMonth, selectedKey, paymentOrganization } = this.props;
const { selectedRowKeys, addProps, adjustSlide, importParams } = this.state;
const {
loading,
form,
condition,
saveLoading
} = this.props.standingBookStore;
const { selectedRowKeys, addProps, adjustSlide, importParams, returnEditPersonSlide } = this.state;
const { loading, form, condition, saveLoading } = this.props.standingBookStore;
let { list, columns, total } = this.state.tableData;
const rowSelection = {
selectedRowKeys,
@ -457,9 +485,43 @@ export default class NormalIndex extends Component {
});
}
};
columns = _.map(toJS(columns), item => {
if (item.dataIndex === "employeeId") {
return { ...item };
}
return {
...item,
render: (text) => {
return <span className="tdEllipsis" title={text}>{text}</span>;
}
};
});
if (selectedKey === "3") {
columns = [
...columns,
{
title: "操作",
dataIndex: "operate",
fixed: "right",
width: "120px",
render: (text, record) => {
return (
<div className="optWrapper">
<a
href="javascript:void(0);"
className="mr10"
onClick={() => this.handleEditNormalStandingBook(record)}
>编辑</a>
</div>
);
}
}
];
}
return (
<div className="normalWapper">
{selectedKey === "1" &&
{
selectedKey === "1" &&
<div className="topContent">
<div className="month">
<span>
@ -478,7 +540,8 @@ export default class NormalIndex extends Component {
{remarks}
</span>
</div>
</div>}
</div>
}
<div className="tabOption">
{this.props.type !== "detail" && this.props.selectedKey == "3"
? <span style={{ display: "flex", alignItems: "center" }}>
@ -624,6 +687,8 @@ export default class NormalIndex extends Component {
scroll={{ x: 1200, y: "calc(100vh - 233px)" }}
/>
</Spin>
{/*编辑弹框*/}
<RegEditDetial {...returnEditPersonSlide} onCancel={this.handleCloseNormalStandingBookModal}/>
<AdjustmentSlide
{...adjustSlide}
onCancel={() => {