|
|
|
@ -9,7 +9,7 @@ import { ColumnType } from "antd/lib/table";
|
|
|
|
|
import { PaginationData } from "rc-pagination";
|
|
|
|
|
import styles from "@/pages/atdTable/components/index.less";
|
|
|
|
|
import { exceptStr, paginationAction } from "@/utils/common";
|
|
|
|
|
import { Button, Dropdown, MenuProps, Space, Table } from "antd";
|
|
|
|
|
import { Button, Dropdown, Menu, Space, Table } from "antd";
|
|
|
|
|
import { MoreOutlined } from "@ant-design/icons";
|
|
|
|
|
|
|
|
|
|
interface OwnProps {
|
|
|
|
@ -96,24 +96,34 @@ const Index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
opts = {
|
|
|
|
|
...opts,
|
|
|
|
|
render: (__: any, record: any) => {
|
|
|
|
|
let items: MenuProps["items"] = [
|
|
|
|
|
{
|
|
|
|
|
key: "DeleteTodoList",
|
|
|
|
|
label: i18n["删除待办"],
|
|
|
|
|
onClick: () => handleSalaryFileOperate("DEL-PENDITNG-TO-DO", record, [record?.id])
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: "DeleteFiles",
|
|
|
|
|
label: i18n["删除档案"],
|
|
|
|
|
onClick: () => handleSalaryFileOperate("DEL-SALARY-FILES", record, [record?.id])
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
!showDelSalaryFileBtn && (items = _.dropRight(items));
|
|
|
|
|
const items = !showDelSalaryFileBtn ? (
|
|
|
|
|
<Menu>
|
|
|
|
|
<Menu.Item key="DeleteTodoList">
|
|
|
|
|
<span style={{ width: "100%", height: "100%" }}
|
|
|
|
|
onClick={(e) => handleSalaryFileOperate("DEL-PENDITNG-TO-DO", [record?.id])}>
|
|
|
|
|
{i18n["删除待办"]}
|
|
|
|
|
</span>
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
</Menu>
|
|
|
|
|
) : <Menu>
|
|
|
|
|
<Menu.Item key="DeleteTodoList">
|
|
|
|
|
<span style={{ width: "100%", height: "100%" }}
|
|
|
|
|
onClick={(e) => handleSalaryFileOperate("DEL-PENDITNG-TO-DO", [record?.id])}>
|
|
|
|
|
{i18n["删除待办"]}
|
|
|
|
|
</span>
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
<Menu.Item key="DeleteFiles">
|
|
|
|
|
<span style={{ width: "100%", height: "100%" }}
|
|
|
|
|
onClick={(e) => handleSalaryFileOperate("DEL-SALARY-FILES", [record?.id])}>
|
|
|
|
|
{i18n["删除档案"]}
|
|
|
|
|
</span>
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
</Menu>;
|
|
|
|
|
return (<Space>
|
|
|
|
|
<Button type="link" onClick={() => handleSalaryFileOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
|
|
|
|
<Button type="link"
|
|
|
|
|
onClick={() => handleSalaryFileOperate("ADD-TO-SALARYPAYMENT", record, [record?.id])}>{i18n["设为发薪人员"]}</Button>
|
|
|
|
|
<Dropdown menu={{ items }} placement="bottomRight">
|
|
|
|
|
<Dropdown overlay={items} placement="bottomRight">
|
|
|
|
|
<Button type="link" icon={<MoreOutlined/>}/>
|
|
|
|
|
</Dropdown>
|
|
|
|
|
</Space>);
|
|
|
|
@ -133,18 +143,21 @@ const Index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
opts = {
|
|
|
|
|
...opts,
|
|
|
|
|
render: (__: any, record: any) => {
|
|
|
|
|
const downsizingItems: MenuProps["items"] = [
|
|
|
|
|
{
|
|
|
|
|
key: "DeleteTodoList",
|
|
|
|
|
label: i18n["删除待办"],
|
|
|
|
|
onClick: () => handleSalaryFileOperate("DEL-SUSPEND-TO-DO", record, [record?.id])
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
const downsizingItems = (
|
|
|
|
|
<Menu>
|
|
|
|
|
<Menu.Item key="DeleteTodoList">
|
|
|
|
|
<span style={{ width: "100%", height: "100%" }}
|
|
|
|
|
onClick={(e) => handleSalaryFileOperate("DEL-SUSPEND-TO-DO", record, [record?.id])}>
|
|
|
|
|
{i18n["删除待办"]}
|
|
|
|
|
</span>
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
</Menu>
|
|
|
|
|
);
|
|
|
|
|
return (<Space>
|
|
|
|
|
<Button type="link" onClick={() => handleSalaryFileOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
|
|
|
|
<Button type="link"
|
|
|
|
|
onClick={() => handleSalaryFileOperate("SALARY-SUSPENSION", record, [record?.id])}>{i18n["停薪"]}</Button>
|
|
|
|
|
<Dropdown menu={{ items: downsizingItems }} placement="bottomRight">
|
|
|
|
|
<Dropdown overlay={downsizingItems} placement="bottomRight">
|
|
|
|
|
<Button type="link" icon={<MoreOutlined/>}/>
|
|
|
|
|
</Dropdown>
|
|
|
|
|
</Space>);
|
|
|
|
@ -155,21 +168,23 @@ const Index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
opts = {
|
|
|
|
|
...opts,
|
|
|
|
|
render: (__: any, record: any) => {
|
|
|
|
|
let stopItems: MenuProps["items"] = [
|
|
|
|
|
{
|
|
|
|
|
key: "CancelSuspension",
|
|
|
|
|
label: i18n["删除档案"],
|
|
|
|
|
onClick: () => handleSalaryFileOperate("DEL-SALARY-FILES", record, [record?.id])
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
!showDelSalaryFileBtn && (stopItems = _.dropRight(stopItems));
|
|
|
|
|
const stopItems = showDelSalaryFileBtn ? (
|
|
|
|
|
<Menu>
|
|
|
|
|
<Menu.Item key="CancelSuspension">
|
|
|
|
|
<span style={{ width: "100%", height: "100%" }}
|
|
|
|
|
onClick={(e) => handleSalaryFileOperate("DEL-SALARY-FILES", record, [record?.id])}>
|
|
|
|
|
{i18n["删除档案"]}
|
|
|
|
|
</span>
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
</Menu>
|
|
|
|
|
) : null;
|
|
|
|
|
return (<Space>
|
|
|
|
|
<Button type="link" onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
|
|
|
|
<Button type="link"
|
|
|
|
|
onClick={() => handleSalaryFileOperate("CANCEL-SALARY-SUSPENSION", record, [record?.id])}>{i18n["取消停薪"]}</Button>
|
|
|
|
|
{
|
|
|
|
|
!_.isEmpty(stopItems) &&
|
|
|
|
|
<Dropdown menu={{ items: stopItems }} placement="bottomRight">
|
|
|
|
|
<Dropdown overlay={stopItems} placement="bottomRight">
|
|
|
|
|
<Button type="link" icon={<MoreOutlined/>}/>
|
|
|
|
|
</Dropdown>
|
|
|
|
|
}
|
|
|
|
|