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

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) => { export const queryInsuranceTabTotal = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/queryInsuranceTabTotal', params); return WeaTools.callApi('/api/bs/hrmsalary/archives/queryInsuranceTabTotal', params);
}; };
//删除待办 //删除待办-待增员
export const updateRunStatus = (params) => { export const updateRunStatus = (params) => {
return postFetch('/api/bs/hrmsalary/archives/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) => { export const allStayAddToPay = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/allStayAddToPay', 'GET', 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" placement="bottomRight"
content={<Menu onClick={({ key }) => { content={<Menu onClick={({ key }) => {
if (key === "stopSalary") { if (key === "stopSalary") {
Modal.warning({ Modal.confirm({
title: "信息确认", title: "信息确认",
content: `确定要删除该条待办人员吗?`, content: `确定要删除该条待办人员吗?`,
onOk: () => this.deleteTodoList({ runStatus: "5", ids: [record.baseInfo] }) onOk: () => this.cancelStayDel({ runStatus: "3", ids: [record.baseInfo] })
}); });
} else { } else {
this.stayDelToStop([record.baseInfo]); this.stayDelToStop([record.baseInfo]);
} }
}}> }}>
<Menu.Item key="stayDelToStop">减员</Menu.Item> <Menu.Item key="stayDelToStop">减员</Menu.Item>
{/*<Menu.Item key="stopSalary">删除待办</Menu.Item>*/} <Menu.Item key="stopSalary">删除待办</Menu.Item>
</Menu>} title=""> </Menu>} title="">
<i className="icon-coms-more"/> <i className="icon-coms-more"/>
</Popover> </Popover>
@ -401,6 +401,8 @@ export default class Archives extends React.Component {
case "suspend": case "suspend":
if (key === "1") { if (key === "1") {
this.stayDelToStop(selectedRowKeys); this.stayDelToStop(selectedRowKeys);
} else if (key === "2") {
this.cancelStayDel({ runStatus: "3", ids: selectedRowKeys });
} }
break; break;
default: default:
@ -454,7 +456,7 @@ export default class Archives extends React.Component {
} }
}); });
}; };
//删除待办 //删除待办-待增员
deleteTodoList = (payload) => { deleteTodoList = (payload) => {
API.updateRunStatus(payload).then(({ status, errormsg }) => { API.updateRunStatus(payload).then(({ status, errormsg }) => {
if (status) { 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 = () => { getTipChildren = () => {
const { selectedKey } = this.state; const { selectedKey } = this.state;
@ -649,6 +663,7 @@ export default class Archives extends React.Component {
overlay={ overlay={
<Menu onClick={this.handleMenuItemClick}> <Menu onClick={this.handleMenuItemClick}>
<Menu.Item key="1">批量减员</Menu.Item> <Menu.Item key="1">批量减员</Menu.Item>
<Menu.Item key="2">批量删除待办</Menu.Item>
</Menu> </Menu>
} }
type="primary" type="primary"

View File

@ -9,6 +9,7 @@ import CustomPaginationTable from "../../../components/customPaginationTable";
import moment from "moment"; import moment from "moment";
import _ from "lodash"; import _ from "lodash";
import ProgressModal from "../../../components/progressModal"; import ProgressModal from "../../../components/progressModal";
import { getCalculateProgress } from "../../../apis/calculate";
import "./index.less"; import "./index.less";
const MonthPicker = DatePicker.MonthPicker; const MonthPicker = DatePicker.MonthPicker;
@ -318,39 +319,54 @@ export default class StandingBook extends React.Component {
break; break;
} }
}; };
handleOk = (formVal) => { handleOk = async (formVal) => {
const { save } = this.props.standingBookStore; const { save } = this.props.standingBookStore;
const { billMonth, ...extra } = formVal; const { billMonth, ...extra } = formVal;
const payload = { const payload = {
billMonth: moment(billMonth).format("YYYY-MM"), billMonth: moment(billMonth).format("YYYY-MM"),
...extra ...extra
}; };
save(payload).then(({ data }) => { const { data: saveData } = await save(payload);
this.setState({ this.setState({
progressVisible: true progressVisible: true
}, () => { }, () => {
this.timer = setInterval(() => { this.timer = setInterval(() => {
if (this.state.progress !== 100) { getCalculateProgress(moment(billMonth).format("YYYY-MM")).then(({ status, data }) => {
this.setState({ if (status) {
progress: this.state.progress + 10 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 { } else {
clearInterval(this.timer); clearInterval(this.timer);
this.setState({ this.setState({
progressVisible: false, progressVisible: false,
progress: 0 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; 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 ProgressModal from "../../../../components/progressModal";
import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal"; import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal";
import AdjustmentSlide from "./adjustmentSlide"; import AdjustmentSlide from "./adjustmentSlide";
import { getCalculateProgress } from "../../../../apis/calculate";
import _ from "lodash"; import _ from "lodash";
import "./index.less"; import "./index.less";
import RegEditDetial from "./regEditDetial";
@inject("standingBookStore") @inject("standingBookStore")
@observer @observer
@ -46,6 +48,11 @@ export default class NormalIndex extends Component {
fieldData: {}, //选中的表单头信息 fieldData: {}, //选中的表单头信息
importParams: { //导入信息的弹框表示 importParams: { //导入信息的弹框表示
visible: false visible: false
},
returnEditPersonSlide: {
title: "",
editId: "",
visible: false
} }
}; };
this.timer = null; this.timer = null;
@ -192,7 +199,6 @@ export default class NormalIndex extends Component {
...it, ...it,
width: 150, width: 150,
fixed: "left", fixed: "left",
render: (text, r) => { render: (text, r) => {
const { userName, employeeId } = r; const { userName, employeeId } = r;
return ( return (
@ -362,40 +368,52 @@ export default class NormalIndex extends Component {
handleCommonAccountClick() { handleCommonAccountClick() {
const { billMonth, selectedKey, paymentOrganization } = this.props; const { billMonth, selectedKey, paymentOrganization } = this.props;
const { commonAccount } = this.props.standingBookStore; const { commonAccount } = this.props.standingBookStore;
commonAccount({ commonAccount({ billMonth, paymentOrganization, includes: [] });
billMonth, this.setState({
paymentOrganization, progressVisible: true
includes: [] }, () => {
}).then(() => { this.timer = setInterval(() => {
this.setState({ getCalculateProgress(billMonth).then(({ status, data }) => {
progressVisible: true if (status) {
}, () => { if (this.state.progress !== 100) {
this.timer = setInterval(() => { this.setState({
if (this.state.progress !== 100) { progress: (Number(data.progress).toFixed(2)) * 100
this.setState({ });
progress: this.state.progress + 10 } 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 { } else {
clearInterval(this.timer); clearInterval(this.timer);
message.success("核算成功");
this.setState({ this.setState({
progressVisible: false, progressVisible: false,
progress: 0 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"); 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() { render() {
const { remarks, billMonth, selectedKey, paymentOrganization } = this.props; const { remarks, billMonth, selectedKey, paymentOrganization } = this.props;
const { selectedRowKeys, addProps, adjustSlide, importParams } = this.state; const { selectedRowKeys, addProps, adjustSlide, importParams, returnEditPersonSlide } = this.state;
const { const { loading, form, condition, saveLoading } = this.props.standingBookStore;
loading,
form,
condition,
saveLoading
} = this.props.standingBookStore;
let { list, columns, total } = this.state.tableData; let { list, columns, total } = this.state.tableData;
const rowSelection = { const rowSelection = {
selectedRowKeys, 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 ( return (
<div className="normalWapper"> <div className="normalWapper">
{selectedKey === "1" && {
selectedKey === "1" &&
<div className="topContent"> <div className="topContent">
<div className="month"> <div className="month">
<span> <span>
@ -478,7 +540,8 @@ export default class NormalIndex extends Component {
{remarks} {remarks}
</span> </span>
</div> </div>
</div>} </div>
}
<div className="tabOption"> <div className="tabOption">
{this.props.type !== "detail" && this.props.selectedKey == "3" {this.props.type !== "detail" && this.props.selectedKey == "3"
? <span style={{ display: "flex", alignItems: "center" }}> ? <span style={{ display: "flex", alignItems: "center" }}>
@ -624,6 +687,8 @@ export default class NormalIndex extends Component {
scroll={{ x: 1200, y: "calc(100vh - 233px)" }} scroll={{ x: 1200, y: "calc(100vh - 233px)" }}
/> />
</Spin> </Spin>
{/*编辑弹框*/}
<RegEditDetial {...returnEditPersonSlide} onCancel={this.handleCloseNormalStandingBookModal}/>
<AdjustmentSlide <AdjustmentSlide
{...adjustSlide} {...adjustSlide}
onCancel={() => { onCancel={() => {