Merge branch 'master' into feature/2.9.42310.01-薪资项目拓扑图
This commit is contained in:
commit
20c9897d06
|
|
@ -24,6 +24,7 @@ module.exports = {
|
|||
"/salaryFileTable.*": "blank",
|
||||
"/OCTable.*": "blank",
|
||||
"/unitTable.*": "blank",
|
||||
"/custom-project.*": "blank",
|
||||
"/manage.*": "manage",
|
||||
"/portal.*": "template",
|
||||
"/passport/oauth-in": "blank",
|
||||
|
|
|
|||
|
|
@ -37,17 +37,22 @@ const calcFixedTotal: FunctionComponent<Props> = (props) => {
|
|||
const dataSourceUrl = useCallback((payload) => {
|
||||
return API.CalculateService.getAcctResultsum(props.dataSourceUrl, payload);
|
||||
}, [props.dataSourceUrl]);
|
||||
const debounceFetcher = _.debounce(() => {
|
||||
debounceFetcher && debounceFetcher.cancel();
|
||||
setLoading(true);
|
||||
dataSourceUrl(props.payload).then(({ data }) => {
|
||||
setLoading(false);
|
||||
const { data: result, status } = data;
|
||||
if (status) setSumRow(result.sumRow || {});
|
||||
});
|
||||
}, 800);
|
||||
useEffect(() => {
|
||||
if (!_.isEmpty(props.payload) && !props.sumRow) {
|
||||
setLoading(true);
|
||||
dataSourceUrl(props.payload).then(({ data }) => {
|
||||
setLoading(false);
|
||||
const { data: result, status } = data;
|
||||
if (status) setSumRow(result.sumRow || {});
|
||||
});
|
||||
(props.payload?.updateSum || _.isNil(props.payload?.updateSum)) && debounceFetcher();
|
||||
} else {
|
||||
setSumRow(props.sumRow);
|
||||
}
|
||||
return () => debounceFetcher && debounceFetcher.cancel();
|
||||
}, [props.payload, props.sumRow]);
|
||||
return (<>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Date: 2023/9/14
|
||||
*/
|
||||
import React, { FunctionComponent, useEffect, useState } from "react";
|
||||
import { Button, Table, Typography } from "antd";
|
||||
import { Button, Space, Table, Typography } from "antd";
|
||||
import { LockOutlined } from "@ant-design/icons";
|
||||
import CustomTableTitle from "@/pages/calcTable/customTableTitle";
|
||||
import CalcExplainFooter from "@/pages/calcTable/calcExplainFooter";
|
||||
|
|
@ -66,7 +66,11 @@ const index: FunctionComponent<Props> = (props) => {
|
|||
setTableScrollHeight(tableScrollHeight);
|
||||
setColumns([...convertColumns(_.map(columns, o => ({ ...o, i18n: i18nRes }))), {
|
||||
title: i18nRes["操作"], dataIndex: "operate", fixed: "right", width: 120,
|
||||
render: (__, record) => (<Button type="link" onClick={() => handleEdit(record?.id)}>{i18nRes["编辑"]}</Button>)
|
||||
render: (__, record) => (<Space>
|
||||
<Button type="link" onClick={() => handleEdit(record?.id)}>{i18nRes["编辑"]}</Button>
|
||||
<Button type="link"
|
||||
onClick={() => handleLockEmp(record)}>{record.lockStatus === "LOCK" ? i18nRes["解锁"] : i18nRes["锁定"]}</Button>
|
||||
</Space>)
|
||||
}]);
|
||||
}
|
||||
};
|
||||
|
|
@ -87,7 +91,8 @@ const index: FunctionComponent<Props> = (props) => {
|
|||
onClick={() => handleDiagramTd(item?.dataIndex, record?.id)}
|
||||
/>
|
||||
{
|
||||
item.lockStatus === "LOCK" ? <LockOutlined title={i18n["锁定的项目值"]}/> : null
|
||||
(item.lockStatus === "LOCK" || record.lockStatus === "LOCK") ?
|
||||
<LockOutlined title={i18n["锁定的项目值"]}/> : null
|
||||
}
|
||||
</span>
|
||||
)
|
||||
|
|
@ -122,6 +127,15 @@ const index: FunctionComponent<Props> = (props) => {
|
|||
"*"
|
||||
);
|
||||
};
|
||||
const handleLockEmp = (record: any) => {
|
||||
const { id, lockStatus } = record;
|
||||
window.parent.postMessage({
|
||||
type: "turn",
|
||||
payload: { id: "LOCKEMP", params: { lockStatus: lockStatus === "UNLOCK" ? "LOCK" : "UNLOCK", acctEmpIds: [id] } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
};
|
||||
const sizeChange = (pageobj: IPage) => {
|
||||
};
|
||||
const onChange = (pageobj: IPage) => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,107 @@
|
|||
/*
|
||||
* 大成二开项目
|
||||
* 薪酬统计报表-薪资明细表格
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/5/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { FunctionComponent, useEffect, useState } from "react";
|
||||
import { exceptStr, paginationAction } from "@/utils/common";
|
||||
import { PaginationData } from "rc-pagination";
|
||||
import { Table, Typography } from "antd";
|
||||
import SumTotal from "./sumTotal";
|
||||
import styles from "../index.less";
|
||||
|
||||
const { Text } = Typography;
|
||||
export type extraType = {
|
||||
selectedRowKeys: React.Key[];
|
||||
i18n: Partial<{}>;
|
||||
sumRow: Partial<{}>;
|
||||
scrollHeight: number;
|
||||
showTotalCell: boolean
|
||||
}
|
||||
|
||||
interface OwnProps {
|
||||
}
|
||||
|
||||
type Props = OwnProps;
|
||||
|
||||
const salaryDetailTable: FunctionComponent<Props> = (props) => {
|
||||
const [columns, setColumns] = useState<Array<any>>([]);
|
||||
const [dataSource, setDataSource] = useState<Array<any>>([]);
|
||||
const [pageInfo, setPageInfo] = useState<Partial<PaginationData>>({});
|
||||
const [parent, setParent] = useState<Partial<extraType>>({});//参数
|
||||
useEffect(() => {
|
||||
window.parent.postMessage({ type: "init" }, "*");
|
||||
window.addEventListener("message", receiveMessageFromIndex, false);
|
||||
return () => {
|
||||
window.removeEventListener("message", receiveMessageFromIndex, false);
|
||||
};
|
||||
}, []);
|
||||
const receiveMessageFromIndex = (event: any) => {
|
||||
const data: any = exceptStr(event.data);
|
||||
if (!_.isEmpty(data)) {
|
||||
const {
|
||||
i18n, columns, dataSource, pageInfo, showTotalCell, tableScrollHeight: scrollHeight, selectedRowKeys,
|
||||
sumRow
|
||||
} = data;
|
||||
setColumns(_.map(columns, item => ({
|
||||
...item, render: (text: string, record: any) => {
|
||||
if (record.showRed) {
|
||||
return (<Text type="danger">{text}</Text>);
|
||||
} else {
|
||||
return (<Text>{text}</Text>);
|
||||
}
|
||||
}
|
||||
})));
|
||||
setDataSource(dataSource);
|
||||
setPageInfo(pageInfo);
|
||||
setParent({ i18n, showTotalCell, scrollHeight, selectedRowKeys, sumRow });
|
||||
}
|
||||
};
|
||||
const onChange = (current: number, pageSize: number) => {
|
||||
setPageInfo((prevState) => {
|
||||
const { pageSize: size } = prevState;
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "PAGEINFO", params: { ...pageInfo, current: size === pageSize ? current : 1, pageSize } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
return { ...pageInfo, current: size === pageSize ? current : 1, pageSize };
|
||||
});
|
||||
};
|
||||
const rowSelection = {
|
||||
columnWidth: 60, selectedRowKeys: parent.selectedRowKeys,
|
||||
renderCell: (value: boolean, record: any, index: number, originNode: React.ReactNode) => (record?.showCheck === "1" ? originNode : null),
|
||||
onChange: (selectedRowKeys: React.Key[]) => {
|
||||
setParent({ ...parent, selectedRowKeys: selectedRowKeys });
|
||||
window.parent.postMessage(
|
||||
{ type: "turn", payload: { id: "CHECKBOX", params: { selectedRowKeys } } }, "*"
|
||||
);
|
||||
}
|
||||
};
|
||||
return (<Table rowKey="id" className={styles.DC_table} dataSource={dataSource}
|
||||
size="small" columns={columns} rowSelection={rowSelection}
|
||||
scroll={{ x: 1200, y: `calc(100vh - ${parent?.scrollHeight || 109}px)` }}
|
||||
pagination={!_.isNil(pageInfo) ? {
|
||||
...paginationAction(pageInfo, parent.i18n, onChange),
|
||||
size: "default"
|
||||
} : false}
|
||||
expandable={{ expandedRowKeys: _.map(dataSource, it => it.id), expandIcon: () => null }}
|
||||
summary={() => (!parent.showTotalCell ? <></> :
|
||||
<Table.Summary fixed={true}>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={0}><Text
|
||||
type="danger">{parent["i18n"]?.["总计"]}</Text></Table.Summary.Cell>
|
||||
<SumTotal columns={columns} sumRow={parent.sumRow}/>
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
)}
|
||||
/>);
|
||||
};
|
||||
|
||||
export default salaryDetailTable;
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
*
|
||||
* 合计行
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/5/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { FunctionComponent } from "react";
|
||||
import { Table, Typography } from "antd";
|
||||
import { ColumnType } from "antd/lib/table";
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
interface OwnProps {
|
||||
columns: ColumnType<any>[];
|
||||
sumRow: any;
|
||||
}
|
||||
|
||||
type Props = OwnProps;
|
||||
|
||||
const sumTotal: FunctionComponent<Props> = (props) => {
|
||||
return (<>
|
||||
{
|
||||
_.map(props.columns, (item: any, index) => {
|
||||
return <Table.Summary.Cell index={index + 1} key={index + 1}>
|
||||
<Text>{!_.isEmpty(props?.sumRow) ? props?.sumRow[item.dataIndex] : "-"}</Text>
|
||||
</Table.Summary.Cell>;
|
||||
})
|
||||
}
|
||||
</>);
|
||||
};
|
||||
|
||||
export default sumTotal;
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
.DC_table {
|
||||
background: #fff;
|
||||
|
||||
:global {
|
||||
|
||||
.ant-table-tbody > tr.ant-table-row:hover > td {
|
||||
background: #e9f7ff;
|
||||
}
|
||||
|
||||
.anticon-more {
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ant-spin-container {
|
||||
.ant-pagination {
|
||||
font-size: 12px;
|
||||
align-items: center;
|
||||
margin-right: 8px;
|
||||
|
||||
.ant-pagination-item, .ant-pagination-prev, .ant-pagination-next {
|
||||
min-width: 28px;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
border-radius: 6px;
|
||||
|
||||
& > button {
|
||||
border-radius: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-pagination-item-active {
|
||||
background: var(--ant-primary-color);
|
||||
border: none;
|
||||
|
||||
& > a {
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-pagination-options {
|
||||
.ant-select {
|
||||
font-size: 12px;
|
||||
|
||||
.ant-select-selector {
|
||||
height: 28px;
|
||||
border-radius: 6px;
|
||||
|
||||
.ant-select-selection-search-input {
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.ant-select-selection-item {
|
||||
line-height: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-select-item {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-pagination-options-quick-jumper {
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
|
||||
& > input {
|
||||
border-radius: 6px;
|
||||
height: 28px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table-thead > tr > th {
|
||||
background-color: #f7fbfe;
|
||||
}
|
||||
|
||||
th, td {
|
||||
font-size: 12px;
|
||||
|
||||
.ant-form-item {
|
||||
margin-bottom: 0;
|
||||
|
||||
.ant-input-number {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -26,6 +26,7 @@ const Index: FunctionComponent<Props> = (props) => {
|
|||
const [runStatuses, setRunStatuses] = useState<string>("");
|
||||
const [showOperateBtn, setShowOperateBtn] = useState<boolean>(false);
|
||||
const [showDelSalaryFileBtn, setShowDelSalaryFileBtn] = useState<boolean>(false);//待定薪、停薪员工 是否允许删除薪资档案
|
||||
const [DCChiefPermission, setDCChiefPermission] = useState<undefined>(undefined);//二开权限(大成)
|
||||
|
||||
useEffect(() => {
|
||||
window.parent.postMessage({ type: "init" }, "*");
|
||||
|
|
@ -40,7 +41,7 @@ const Index: FunctionComponent<Props> = (props) => {
|
|||
if (!_.isEmpty(data)) {
|
||||
const {
|
||||
columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {},
|
||||
selectedKey, showOperateBtn, showDelSalaryFileBtn
|
||||
selectedKey, showOperateBtn, showDelSalaryFileBtn, DCChiefPermission
|
||||
} = data;
|
||||
setShowOperateBtn(showOperateBtn);
|
||||
setRunStatuses(selectedKey);
|
||||
|
|
@ -50,6 +51,7 @@ const Index: FunctionComponent<Props> = (props) => {
|
|||
setSelectedRowKeys(selectedRowKeys);
|
||||
setColumns(columns);
|
||||
setShowDelSalaryFileBtn(showDelSalaryFileBtn);
|
||||
setDCChiefPermission(DCChiefPermission);
|
||||
}
|
||||
};
|
||||
const onChange = (current: number, pageSize: number) => {
|
||||
|
|
@ -115,7 +117,12 @@ const Index: FunctionComponent<Props> = (props) => {
|
|||
];
|
||||
!showDelSalaryFileBtn && (items = _.dropRight(items));
|
||||
return (<Space>
|
||||
<Button type="link" onClick={() => handleSalaryFileOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
||||
{
|
||||
(_.isNil(DCChiefPermission) || DCChiefPermission) ?
|
||||
<Button type="link"
|
||||
onClick={() => handleSalaryFileOperate("EDIT", record)}>{i18n["编辑"]}</Button> :
|
||||
<Button type="link" onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||
}
|
||||
<Button type="link"
|
||||
onClick={() => handleSalaryFileOperate("ADD-TO-SALARYPAYMENT", record, [record?.id])}>{i18n["设为发薪人员"]}</Button>
|
||||
<Dropdown menu={{ items }} placement="bottomRight">
|
||||
|
|
@ -139,8 +146,13 @@ const Index: FunctionComponent<Props> = (props) => {
|
|||
];
|
||||
return (
|
||||
<Space>
|
||||
<Button type="link"
|
||||
onClick={() => handleSalaryFileOperate("CHANGE-SALARY", record)}>{i18n["调薪"]}</Button>
|
||||
{
|
||||
(((_.isNil(DCChiefPermission) || DCChiefPermission) && runStatuses === "fixed") || runStatuses === "ext") ?
|
||||
<Button type="link"
|
||||
onClick={() => handleSalaryFileOperate("CHANGE-SALARY", record)}>{i18n["调薪"]}</Button> :
|
||||
<Button type="link"
|
||||
onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||
}
|
||||
<Dropdown menu={{ items }} placement="bottomRight">
|
||||
<Button type="link" icon={<MoreOutlined/>}/>
|
||||
</Dropdown>
|
||||
|
|
@ -215,7 +227,12 @@ const Index: FunctionComponent<Props> = (props) => {
|
|||
...opts,
|
||||
render: (__: any, record: any) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||
{
|
||||
(DCChiefPermission && (runStatuses === "pending" || runStatuses === "fixed")) ?
|
||||
<Button type="link"
|
||||
onClick={() => handleSalaryFileOperate(runStatuses === "fixed" ? "CHANGE-SALARY" : "EDIT", record)}>{runStatuses === "fixed" ? i18n["调薪"] : i18n["编辑"]}</Button> :
|
||||
<Button type="link" onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||
}
|
||||
<Button type="link" onClick={() => handleSalaryFileOperate("log", record)}>{i18n["操作日志"]}</Button>
|
||||
</Space>
|
||||
)
|
||||
|
|
@ -223,7 +240,7 @@ const Index: FunctionComponent<Props> = (props) => {
|
|||
} else {
|
||||
return [];
|
||||
}
|
||||
}, [columns, runStatuses, i18n, showOperateBtn, showDelSalaryFileBtn]);
|
||||
}, [columns, runStatuses, i18n, showOperateBtn, showDelSalaryFileBtn, DCChiefPermission]);
|
||||
return (<Table
|
||||
rowKey="id" size="small" className={styles.tableWrapper}
|
||||
columns={cols} dataSource={dataSource} rowSelection={rowSelection}
|
||||
|
|
|
|||
Loading…
Reference in New Issue