salary-management-front/pc4mobx/hrmSalary/pages/payrollFiles/components/allWithoutPay.js

61 lines
2.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import * as API from "../../../apis/payrollFiles";
import { Menu, message, Modal } from "antd";
import "../index.less";
const getLabel = WeaLocaleProvider.getLabel;
class AllWithoutPay extends Component {
handleClick = ({ key }) => {
const { selectedRowKeys = [], refreshList } = this.props;
if (key === "batchWithoutpay") {
if (selectedRowKeys.length === 0) {
message.warning(getLabel(543306, "未选择条目"));
return;
}
API.gotoStop(selectedRowKeys).then(({ status, data, errormsg }) => {
if (status) {
const { msg } = data;
message.info(msg || getLabel(30700, "操作成功"));
refreshList();
} else {
message.error(errormsg || getLabel(30651, "操作失败"));
}
});
} else {
const { pageInfo } = this.props;
if (pageInfo.total === 0) {
message.warning(getLabel(543325, "您没有需要处理的待停薪人员!"));
return;
}
Modal.warning({
title: getLabel(131329, "信息确认"),
content: `${getLabel(543723, "确定要将所有待停薪人员")}${getLabel(18609, "共")}${pageInfo.total}${getLabel(30690, "条数据")}${getLabel(543327, "设为停薪人员吗")}`,
onOk: () => {
API.allGotoStop({}).then(({ status, data, errormsg }) => {
if (status) {
const { msg } = data;
message.info(msg || getLabel(30700, "操作成功"));
refreshList();
} else {
message.error(errormsg || getLabel(30651, "操作失败"));
}
});
}
});
}
};
render() {
return (
<Menu className="dropdownMenuWrapper" onClick={this.handleClick}>
<Menu.Item key="allWithoutpay">{getLabel(543326, "全部停薪")}</Menu.Item>
<Menu.Item key="batchWithoutpay">{getLabel(543724, "批量停薪")}</Menu.Item>
</Menu>
);
}
}
export default AllWithoutPay;