|
|
@ -14,303 +14,422 @@ const { Text } = Typography;
|
|
|
|
export function renderCols(initialState: any[], type: string, i18n?: AnyObject, extraParams?: Partial<extraType>) {
|
|
|
|
export function renderCols(initialState: any[], type: string, i18n?: AnyObject, extraParams?: Partial<extraType>) {
|
|
|
|
return React.useMemo(() => {
|
|
|
|
return React.useMemo(() => {
|
|
|
|
if (type === "welfareRecord") {
|
|
|
|
if (type === "welfareRecord") {
|
|
|
|
return [..._.map(_.filter(initialState, o => o.dataIndex !== "id"), g => {
|
|
|
|
return [
|
|
|
|
let col = { ...g, ellipsis: true, fixed: g.dataIndex === "billMonth", width: 180 };
|
|
|
|
..._.map(
|
|
|
|
switch (g.dataIndex) {
|
|
|
|
_.filter(initialState, (o) => o.dataIndex !== "id"),
|
|
|
|
case "billMonth":
|
|
|
|
(g) => {
|
|
|
|
col = {
|
|
|
|
let col = { ...g, ellipsis: true, fixed: g.dataIndex === "billMonth", width: 180 };
|
|
|
|
...col,
|
|
|
|
switch (g.dataIndex) {
|
|
|
|
width: 120,
|
|
|
|
case "billMonth":
|
|
|
|
render: (text: string, record: any) => {
|
|
|
|
col = {
|
|
|
|
const { billStatus } = record;
|
|
|
|
...col,
|
|
|
|
return (<Button type="link"
|
|
|
|
width: 120,
|
|
|
|
onClick={() => postMessageToParent((billStatus === "0" && extraParams?.permission) ? "CALC" : "VIEW", record)}>{text}</Button>);
|
|
|
|
render: (text: string, record: any) => {
|
|
|
|
}
|
|
|
|
const { billStatus } = record;
|
|
|
|
};
|
|
|
|
return (
|
|
|
|
break;
|
|
|
|
<Button type="link" onClick={() => postMessageToParent(billStatus === "0" && extraParams?.permission ? "CALC" : "VIEW", record)}>
|
|
|
|
case "billStatus":
|
|
|
|
{text}
|
|
|
|
col = {
|
|
|
|
</Button>
|
|
|
|
...col, width: 100, render: (text: string) => (
|
|
|
|
);
|
|
|
|
<Text style={{ maxWidth: "100%" }} ellipsis>
|
|
|
|
}
|
|
|
|
{text === "1" ? i18n?.["已归档"] : i18n?.["未归档"]}
|
|
|
|
};
|
|
|
|
</Text>
|
|
|
|
break;
|
|
|
|
)
|
|
|
|
case "billStatus":
|
|
|
|
};
|
|
|
|
col = {
|
|
|
|
break;
|
|
|
|
...col,
|
|
|
|
case "paymentOrganization":
|
|
|
|
width: 100,
|
|
|
|
col = { ...col, width: 200 };
|
|
|
|
render: (text: string) => (
|
|
|
|
break;
|
|
|
|
<Text style={{ maxWidth: "100%" }} ellipsis>
|
|
|
|
case "socialNum":
|
|
|
|
{text === "1" ? i18n?.["已归档"] : i18n?.["未归档"]}
|
|
|
|
case "otherNum":
|
|
|
|
</Text>
|
|
|
|
case "fundNum":
|
|
|
|
)
|
|
|
|
col = { ...col, width: 118 };
|
|
|
|
};
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "remarks":
|
|
|
|
case "paymentOrganization":
|
|
|
|
col = { ...col, width: 200 };
|
|
|
|
col = { ...col, width: 200 };
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
case "socialNum":
|
|
|
|
col = { ...col };
|
|
|
|
case "otherNum":
|
|
|
|
break;
|
|
|
|
case "fundNum":
|
|
|
|
}
|
|
|
|
col = { ...col, width: 118 };
|
|
|
|
return col;
|
|
|
|
break;
|
|
|
|
}), {
|
|
|
|
case "remarks":
|
|
|
|
dataIndex: "operate", title: i18n?.["操作"], width: 185, fixed: "right",
|
|
|
|
col = { ...col, width: 200 };
|
|
|
|
render: (__: string, record: any) => {
|
|
|
|
break;
|
|
|
|
const { billStatus } = record;
|
|
|
|
default:
|
|
|
|
const items: MenuProps["items"] = [
|
|
|
|
col = { ...col };
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
key: "DeleteList",
|
|
|
|
|
|
|
|
label: i18n?.["删除"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("DELRC", record)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "Log",
|
|
|
|
|
|
|
|
label: i18n?.["操作日志"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("log", record)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
return col;
|
|
|
|
return (
|
|
|
|
}
|
|
|
|
<Space>
|
|
|
|
),
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataIndex: "operate",
|
|
|
|
|
|
|
|
title: i18n?.["操作"],
|
|
|
|
|
|
|
|
width: 185,
|
|
|
|
|
|
|
|
fixed: "right",
|
|
|
|
|
|
|
|
render: (__: string, record: any) => {
|
|
|
|
|
|
|
|
const { billStatus } = record;
|
|
|
|
|
|
|
|
const items: MenuProps["items"] = [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "DeleteList",
|
|
|
|
|
|
|
|
label: i18n?.["删除"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("DELRC", record)
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
!extraParams?.permission ?
|
|
|
|
key: "Log",
|
|
|
|
|
|
|
|
label: i18n?.["操作日志"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("log", record)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
|
|
{!extraParams?.permission ? (
|
|
|
|
<Space>
|
|
|
|
<Space>
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}>{i18n?.["查看"]}</Button>
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}>
|
|
|
|
<Dropdown menu={{
|
|
|
|
{i18n?.["查看"]}
|
|
|
|
items: [{
|
|
|
|
</Button>
|
|
|
|
key: "Log",
|
|
|
|
<Dropdown
|
|
|
|
label: i18n?.["操作日志"],
|
|
|
|
menu={{
|
|
|
|
onClick: () => postMessageToParent("log", record)
|
|
|
|
items: [
|
|
|
|
}]
|
|
|
|
{
|
|
|
|
}} placement="bottomRight">
|
|
|
|
key: "Log",
|
|
|
|
<Button type="link" icon={<MoreOutlined/>}/>
|
|
|
|
label: i18n?.["操作日志"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("log", record)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
placement="bottomRight"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<Button type="link" icon={<MoreOutlined />} />
|
|
|
|
</Dropdown>
|
|
|
|
</Dropdown>
|
|
|
|
</Space> :
|
|
|
|
</Space>
|
|
|
|
|
|
|
|
) : (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
{
|
|
|
|
{billStatus === "0" && (
|
|
|
|
billStatus === "0" &&
|
|
|
|
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<Button type="link"
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("CALC", record)}>
|
|
|
|
onClick={() => postMessageToParent("CALC", record)}>{i18n?.["核算"]}</Button>
|
|
|
|
{i18n?.["核算"]}
|
|
|
|
<Button type="link"
|
|
|
|
</Button>
|
|
|
|
onClick={() => postMessageToParent("FILE", record)}>{i18n?.["归档"]}</Button>
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("FILE", record)}>
|
|
|
|
|
|
|
|
{i18n?.["归档"]}
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
<Dropdown menu={{ items }} placement="bottomRight">
|
|
|
|
<Dropdown menu={{ items }} placement="bottomRight">
|
|
|
|
<Button type="link" icon={<MoreOutlined/>}/>
|
|
|
|
<Button type="link" icon={<MoreOutlined />} />
|
|
|
|
</Dropdown>
|
|
|
|
</Dropdown>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
)}
|
|
|
|
{
|
|
|
|
{billStatus === "1" && (
|
|
|
|
billStatus === "1" &&
|
|
|
|
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<Button type="link"
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}>
|
|
|
|
onClick={() => postMessageToParent("VIEW", record)}>{i18n?.["查看"]}</Button>
|
|
|
|
{i18n?.["查看"]}
|
|
|
|
<Button type="link"
|
|
|
|
</Button>
|
|
|
|
onClick={() => postMessageToParent("RECALC", record)}>{i18n?.["重新核算"]}</Button>
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("RECALC", record)}>
|
|
|
|
<Dropdown menu={{
|
|
|
|
{i18n?.["重新核算"]}
|
|
|
|
items: [
|
|
|
|
</Button>
|
|
|
|
{
|
|
|
|
<Dropdown
|
|
|
|
key: "Log",
|
|
|
|
menu={{
|
|
|
|
label: i18n?.["操作日志"],
|
|
|
|
items: [
|
|
|
|
onClick: () => postMessageToParent("log", record)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
key: "Log",
|
|
|
|
]
|
|
|
|
label: i18n?.["操作日志"],
|
|
|
|
}} placement="bottomRight">
|
|
|
|
onClick: () => postMessageToParent("log", record)
|
|
|
|
<Button type="link" icon={<MoreOutlined/>}/>
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
placement="bottomRight"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<Button type="link" icon={<MoreOutlined />} />
|
|
|
|
</Dropdown>
|
|
|
|
</Dropdown>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
)}
|
|
|
|
</Space>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
} else if (type === "bonusplan") {
|
|
|
|
|
|
|
|
return [..._.map(initialState, g => {
|
|
|
|
|
|
|
|
let col = { ...g, ellipsis: true, fixed: false, width: 150 };
|
|
|
|
|
|
|
|
switch (g.dataIndex) {
|
|
|
|
|
|
|
|
case "taxYear":
|
|
|
|
|
|
|
|
case "fileStatusDesc":
|
|
|
|
|
|
|
|
col = { ...col, width: 80 };
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "billStatus":
|
|
|
|
|
|
|
|
col = {
|
|
|
|
|
|
|
|
...col, width: 100, render: (text: string) => (
|
|
|
|
|
|
|
|
<Text style={{ maxWidth: "100%" }} ellipsis>
|
|
|
|
|
|
|
|
{text === "1" ? i18n?.["已归档"] : i18n?.["未归档"]}
|
|
|
|
|
|
|
|
</Text>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "optimizedBonusSum":
|
|
|
|
|
|
|
|
col = { ...col, width: 220 };
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "employeeCount":
|
|
|
|
|
|
|
|
col = {
|
|
|
|
|
|
|
|
...col, title: <Space>
|
|
|
|
|
|
|
|
<Text>{g.title}</Text>
|
|
|
|
|
|
|
|
<Tooltip placement="top"
|
|
|
|
|
|
|
|
title={i18n?.["若同一个人 在两个个税扣缴义务人下 同一纳税年度 同时发年终奖,统计为两个人"]}>
|
|
|
|
|
|
|
|
<QuestionCircleFilled/>
|
|
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
|
|
</Space>
|
|
|
|
</Space>
|
|
|
|
};
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
|
|
|
|
col = { ...col };
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return col;
|
|
|
|
];
|
|
|
|
}), {
|
|
|
|
} else if (type === "bonusplan") {
|
|
|
|
dataIndex: "operate", title: i18n?.["操作"], width: 185, fixed: "right",
|
|
|
|
return [
|
|
|
|
render: (__: string, record: any) => {
|
|
|
|
..._.map(initialState, (g) => {
|
|
|
|
const { fileStatus } = record;
|
|
|
|
let col = { ...g, ellipsis: true, fixed: false, width: 150 };
|
|
|
|
const items: MenuProps["items"] = [
|
|
|
|
switch (g.dataIndex) {
|
|
|
|
{
|
|
|
|
case "taxYear":
|
|
|
|
key: "FileList",
|
|
|
|
case "fileStatusDesc":
|
|
|
|
label: fileStatus === 0 ? i18n?.["归档"] : i18n?.["取消归档"],
|
|
|
|
col = { ...col, width: 80 };
|
|
|
|
onClick: () => postMessageToParent("FILE", record)
|
|
|
|
break;
|
|
|
|
},
|
|
|
|
case "billStatus":
|
|
|
|
{
|
|
|
|
col = {
|
|
|
|
key: "DeleteList",
|
|
|
|
...col,
|
|
|
|
label: i18n?.["删除"],
|
|
|
|
width: 100,
|
|
|
|
onClick: () => postMessageToParent("DEL", record)
|
|
|
|
render: (text: string) => (
|
|
|
|
},
|
|
|
|
<Text style={{ maxWidth: "100%" }} ellipsis>
|
|
|
|
{
|
|
|
|
{text === "1" ? i18n?.["已归档"] : i18n?.["未归档"]}
|
|
|
|
key: "Log",
|
|
|
|
</Text>
|
|
|
|
label: i18n?.["操作日志"],
|
|
|
|
)
|
|
|
|
onClick: () => postMessageToParent("log", record)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
];
|
|
|
|
case "optimizedBonusSum":
|
|
|
|
return (
|
|
|
|
col = { ...col, width: 220 };
|
|
|
|
<Space>
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "employeeCount":
|
|
|
|
|
|
|
|
col = {
|
|
|
|
|
|
|
|
...col,
|
|
|
|
|
|
|
|
title: (
|
|
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
|
|
<Text>{g.title}</Text>
|
|
|
|
|
|
|
|
<Tooltip placement="top" title={i18n?.["若同一个人 在两个个税扣缴义务人下 同一纳税年度 同时发年终奖,统计为两个人"]}>
|
|
|
|
|
|
|
|
<QuestionCircleFilled />
|
|
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
col = { ...col };
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return col;
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataIndex: "operate",
|
|
|
|
|
|
|
|
title: i18n?.["操作"],
|
|
|
|
|
|
|
|
width: 185,
|
|
|
|
|
|
|
|
fixed: "right",
|
|
|
|
|
|
|
|
render: (__: string, record: any) => {
|
|
|
|
|
|
|
|
const { fileStatus } = record;
|
|
|
|
|
|
|
|
const items: MenuProps["items"] = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
!extraParams?.permission ?
|
|
|
|
key: "FileList",
|
|
|
|
|
|
|
|
label: fileStatus === 0 ? i18n?.["归档"] : i18n?.["取消归档"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("FILE", record)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "DeleteList",
|
|
|
|
|
|
|
|
label: i18n?.["删除"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("DEL", record)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "Log",
|
|
|
|
|
|
|
|
label: i18n?.["操作日志"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("log", record)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
|
|
{!extraParams?.permission ? (
|
|
|
|
<Space>
|
|
|
|
<Space>
|
|
|
|
<Button type="link"
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}>
|
|
|
|
onClick={() => postMessageToParent("VIEW", record)}>{i18n?.["查看详情"]}</Button>
|
|
|
|
{i18n?.["查看详情"]}
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
<Dropdown menu={{ items: items.slice(-1) }} placement="bottomRight">
|
|
|
|
<Dropdown menu={{ items: items.slice(-1) }} placement="bottomRight">
|
|
|
|
<Button type="link" icon={<MoreOutlined/>}/>
|
|
|
|
<Button type="link" icon={<MoreOutlined />} />
|
|
|
|
</Dropdown>
|
|
|
|
</Dropdown>
|
|
|
|
</Space> :
|
|
|
|
</Space>
|
|
|
|
|
|
|
|
) : (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<Button type="link"
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}>
|
|
|
|
onClick={() => postMessageToParent("VIEW", record)}>{i18n?.["查看详情"]}</Button>
|
|
|
|
{i18n?.["查看详情"]}
|
|
|
|
<Button type="link"
|
|
|
|
</Button>
|
|
|
|
onClick={() => postMessageToParent("EDIT", record)}>{i18n?.["编辑"]}</Button>
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("EDIT", record)}>
|
|
|
|
|
|
|
|
{i18n?.["编辑"]}
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
<Dropdown menu={{ items }} placement="bottomRight">
|
|
|
|
<Dropdown menu={{ items }} placement="bottomRight">
|
|
|
|
<Button type="link" icon={<MoreOutlined/>}/>
|
|
|
|
<Button type="link" icon={<MoreOutlined />} />
|
|
|
|
</Dropdown>
|
|
|
|
</Dropdown>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
)}
|
|
|
|
</Space>
|
|
|
|
</Space>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
];
|
|
|
|
} else if (type === "bonusStrategy") {
|
|
|
|
} else if (type === "bonusStrategy") {
|
|
|
|
const { selectedKey } = extraParams as { selectedKey: string };
|
|
|
|
const { selectedKey } = extraParams as { selectedKey: string };
|
|
|
|
return [..._.map(initialState, g => {
|
|
|
|
return [
|
|
|
|
let col = { ...g, ellipsis: true, fixed: false, width: 120 };
|
|
|
|
..._.map(initialState, (g) => {
|
|
|
|
switch (g.dataIndex) {
|
|
|
|
let col = { ...g, ellipsis: true, fixed: false, width: 120 };
|
|
|
|
case "username":
|
|
|
|
switch (g.dataIndex) {
|
|
|
|
col = { ...col, fixed: "left" };
|
|
|
|
case "username":
|
|
|
|
break;
|
|
|
|
col = { ...col, fixed: "left" };
|
|
|
|
case "taxAgentName":
|
|
|
|
break;
|
|
|
|
col = { ...col, width: 200, fixed: "left" };
|
|
|
|
case "taxAgentName":
|
|
|
|
break;
|
|
|
|
col = { ...col, width: 200, fixed: "left" };
|
|
|
|
case "idNo":
|
|
|
|
break;
|
|
|
|
col = { ...col, width: 150 };
|
|
|
|
case "idNo":
|
|
|
|
break;
|
|
|
|
col = { ...col, width: 150 };
|
|
|
|
case "originalTaxTypeDesc":
|
|
|
|
break;
|
|
|
|
case "originalBonus":
|
|
|
|
case "originalTaxTypeDesc":
|
|
|
|
case "originalTax":
|
|
|
|
case "originalBonus":
|
|
|
|
case "originalIncome":
|
|
|
|
case "originalTax":
|
|
|
|
col = {
|
|
|
|
case "originalIncome":
|
|
|
|
...col,
|
|
|
|
col = {
|
|
|
|
render: (text: string) => (<div style={{ color: "rgb(93, 156, 236)" }}>{text}</div>)
|
|
|
|
...col,
|
|
|
|
};
|
|
|
|
render: (text: string) => <div style={{ color: "rgb(93, 156, 236)" }}>{text}</div>
|
|
|
|
break;
|
|
|
|
};
|
|
|
|
case "optimizedTaxTypeDesc":
|
|
|
|
break;
|
|
|
|
case "optimizedBonus":
|
|
|
|
case "optimizedTaxTypeDesc":
|
|
|
|
case "optimizedTax":
|
|
|
|
case "optimizedBonus":
|
|
|
|
case "optimizedIncome":
|
|
|
|
case "optimizedTax":
|
|
|
|
col = { ...col, render: (text: string) => (<Text type="success">{text}</Text>) };
|
|
|
|
case "optimizedIncome":
|
|
|
|
break;
|
|
|
|
col = { ...col, render: (text: string) => <Text type="success">{text}</Text> };
|
|
|
|
case "companySave":
|
|
|
|
break;
|
|
|
|
case "employeeGain":
|
|
|
|
case "companySave":
|
|
|
|
col = { ...col, render: (text: string) => (<Text type="warning">{text}</Text>) };
|
|
|
|
case "employeeGain":
|
|
|
|
break;
|
|
|
|
col = { ...col, render: (text: string) => <Text type="warning">{text}</Text> };
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
col = { ...col };
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
col = { ...col };
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
return col;
|
|
|
|
}
|
|
|
|
}), {
|
|
|
|
return col;
|
|
|
|
dataIndex: "operate", title: i18n?.["操作"], width: 185, fixed: "right",
|
|
|
|
}),
|
|
|
|
render: (__: string, record: any) => {
|
|
|
|
{
|
|
|
|
let items: MenuProps["items"] = [
|
|
|
|
dataIndex: "operate",
|
|
|
|
{
|
|
|
|
title: i18n?.["操作"],
|
|
|
|
key: "DeleteList",
|
|
|
|
width: 185,
|
|
|
|
label: i18n?.["删除"],
|
|
|
|
fixed: "right",
|
|
|
|
onClick: () => postMessageToParent("DEL", record)
|
|
|
|
render: (__: string, record: any) => {
|
|
|
|
},
|
|
|
|
let items: MenuProps["items"] = [
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "Log",
|
|
|
|
|
|
|
|
label: i18n?.["操作日志"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("log", record)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
selectedKey === "getAnnualbonusaddupList" && items.shift();
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
!extraParams?.permission ?
|
|
|
|
key: "DeleteList",
|
|
|
|
|
|
|
|
label: i18n?.["删除"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("DEL", record)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "Log",
|
|
|
|
|
|
|
|
label: i18n?.["操作日志"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("log", record)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
selectedKey === "getAnnualbonusaddupList" && items.shift();
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
|
|
{!extraParams?.permission ? (
|
|
|
|
<Space>
|
|
|
|
<Space>
|
|
|
|
{
|
|
|
|
{selectedKey === "getAnnualbonusstrategyList" && (
|
|
|
|
selectedKey === "getAnnualbonusstrategyList" &&
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}>
|
|
|
|
<Button type="link"
|
|
|
|
{i18n?.["查看详情"]}
|
|
|
|
onClick={() => postMessageToParent("VIEW", record)}>{i18n?.["查看详情"]}</Button>
|
|
|
|
</Button>
|
|
|
|
}
|
|
|
|
)}
|
|
|
|
<Button type="link"
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("log", record)}>
|
|
|
|
onClick={() => postMessageToParent("log", record)}>{i18n?.["操作日志"]}</Button>
|
|
|
|
{i18n?.["操作日志"]}
|
|
|
|
</Space> :
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
|
|
) : (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<Button type="link"
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("EDIT", record)}>
|
|
|
|
onClick={() => postMessageToParent("EDIT", record)}>{i18n?.["编辑"]}</Button>
|
|
|
|
{i18n?.["编辑"]}
|
|
|
|
{
|
|
|
|
</Button>
|
|
|
|
selectedKey === "getAnnualbonusstrategyList" &&
|
|
|
|
{selectedKey === "getAnnualbonusstrategyList" && (
|
|
|
|
<Button type="link"
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}>
|
|
|
|
onClick={() => postMessageToParent("VIEW", record)}>{i18n?.["查看详情"]}</Button>
|
|
|
|
{i18n?.["查看详情"]}
|
|
|
|
}
|
|
|
|
</Button>
|
|
|
|
{
|
|
|
|
)}
|
|
|
|
selectedKey === "getAnnualbonusaddupList" &&
|
|
|
|
{selectedKey === "getAnnualbonusaddupList" && (
|
|
|
|
<Button type="link"
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("DEL", record)}>
|
|
|
|
onClick={() => postMessageToParent("DEL", record)}>{i18n?.["删除"]}</Button>
|
|
|
|
{i18n?.["删除"]}
|
|
|
|
}
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
)}
|
|
|
|
<Dropdown menu={{ items }} placement="bottomRight">
|
|
|
|
<Dropdown menu={{ items }} placement="bottomRight">
|
|
|
|
<Button type="link" icon={<MoreOutlined/>}/>
|
|
|
|
<Button type="link" icon={<MoreOutlined />} />
|
|
|
|
</Dropdown>
|
|
|
|
</Dropdown>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
)}
|
|
|
|
</Space>
|
|
|
|
</Space>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
];
|
|
|
|
} else if (type === "variableSalary") {
|
|
|
|
} else if (type === "variableSalary") {
|
|
|
|
return [..._.map(initialState, g => {
|
|
|
|
return [
|
|
|
|
return { ...g, ellipsis: true, fixed: false, width: 150 };
|
|
|
|
..._.map(initialState, (g) => {
|
|
|
|
}), {
|
|
|
|
return { ...g, ellipsis: true, fixed: false, width: 150 };
|
|
|
|
dataIndex: "operate", title: i18n?.["操作"], width: 185, fixed: "right",
|
|
|
|
}),
|
|
|
|
render: (__: string, record: any) => {
|
|
|
|
{
|
|
|
|
return (
|
|
|
|
dataIndex: "operate",
|
|
|
|
<Space>
|
|
|
|
title: i18n?.["操作"],
|
|
|
|
<Button type="link"
|
|
|
|
width: 185,
|
|
|
|
onClick={() => postMessageToParent("EDIT", record)}>{i18n?.["编辑"]}</Button>
|
|
|
|
fixed: "right",
|
|
|
|
<Button type="link"
|
|
|
|
render: (__: string, record: any) => {
|
|
|
|
onClick={() => postMessageToParent("DEL", record)}>{i18n?.["删除"]}</Button>
|
|
|
|
return (
|
|
|
|
</Space>
|
|
|
|
<Space>
|
|
|
|
);
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("EDIT", record)}>
|
|
|
|
|
|
|
|
{i18n?.["编辑"]}
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("DEL", record)}>
|
|
|
|
|
|
|
|
{i18n?.["删除"]}
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
];
|
|
|
|
|
|
|
|
} else if (type === "dataAcquisition") {
|
|
|
|
|
|
|
|
const { isSpecial } = extraParams as { isSpecial: boolean };
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
..._.map(initialState, (g) => {
|
|
|
|
|
|
|
|
let col = { ...g, ellipsis: true, width: 110 };
|
|
|
|
|
|
|
|
switch (g.dataIndex) {
|
|
|
|
|
|
|
|
case "username":
|
|
|
|
|
|
|
|
case "departmentName":
|
|
|
|
|
|
|
|
col = { ...col, fixed: true };
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "taxAgentName":
|
|
|
|
|
|
|
|
col = { ...col, fixed: true, width: 180 };
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "mobile":
|
|
|
|
|
|
|
|
col = { ...col, width: 125 };
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "operate":
|
|
|
|
|
|
|
|
col = {
|
|
|
|
|
|
|
|
...col,
|
|
|
|
|
|
|
|
width: 176,
|
|
|
|
|
|
|
|
fixed: "right",
|
|
|
|
|
|
|
|
render: (__: string, record: any) => {
|
|
|
|
|
|
|
|
let items: MenuProps["items"] = [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "DeleteList",
|
|
|
|
|
|
|
|
label: i18n?.["删除"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("DEL", record)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "Log",
|
|
|
|
|
|
|
|
label: i18n?.["操作日志"],
|
|
|
|
|
|
|
|
onClick: () => postMessageToParent("log", record)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
isSpecial && items.shift();
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("EDIT", record)}>
|
|
|
|
|
|
|
|
{i18n?.["编辑"]}
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
{isSpecial ? (
|
|
|
|
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("DEL", record)}>
|
|
|
|
|
|
|
|
{i18n?.["删除"]}
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
) : (
|
|
|
|
|
|
|
|
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}>
|
|
|
|
|
|
|
|
{i18n?.["查看明细"]}
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
<Dropdown menu={{ items }} placement="bottomRight">
|
|
|
|
|
|
|
|
<Button type="link" icon={<MoreOutlined />} />
|
|
|
|
|
|
|
|
</Dropdown>
|
|
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
col = { ...col };
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return col;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return initialState;
|
|
|
|
return initialState;
|
|
|
|
}, [initialState, type, i18n, extraParams]);
|
|
|
|
}, [initialState, type, i18n, extraParams]);
|
|
|
|