|
@@ -0,0 +1,620 @@
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * @Author: code4eat awesomedema@gmail.com
|
|
|
|
+ * @Date: 2022-12-16 09:42:52
|
|
|
|
+ * @LastEditors: code4eat awesomedema@gmail.com
|
|
|
|
+ * @LastEditTime: 2023-05-10 14:33:11
|
|
|
|
+ * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
|
|
|
|
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+import BMSPagecontainer from '@/components/BMSPageContainer';
|
|
|
|
+
|
|
|
|
+import { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
|
|
+import './style.less';
|
|
|
|
+
|
|
|
|
+import { Tree, TreeProps, Tabs, Input, Modal, Transfer, Popconfirm, message, Popover } from 'antd';
|
|
|
|
+import { DataNode } from 'antd/es/tree';
|
|
|
|
+
|
|
|
|
+import expandedIcon from '../../../../static/treenode_open.png';
|
|
|
|
+import closeIcon from '../../../../static/treenode_collapse.png';
|
|
|
|
+import { BMSTable } from '@/components/BMSTable';
|
|
|
|
+import { ActionType, ProColumns, ProColumnType } from '@ant-design/pro-components';
|
|
|
|
+import { createFromIconfontCN } from '@ant-design/icons';
|
|
|
|
+import { checkRequest, delPersonRequest, generateDataRequest, getDepInfoTableData, getPersonInfoTableData, getProjectInfoTableData, getTotalEmps, getTreeData, getTreeDataRespType, PersonInfoTableDataType, saveEmpsRequest } from './service';
|
|
|
|
+import { TransferDirection } from 'antd/es/transfer';
|
|
|
|
+import { getComputeDate } from '@/pages/Home/service';
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+import 'dayjs/locale/zh-cn';
|
|
|
|
+import locale from 'antd/es/date-picker/locale/zh_CN';
|
|
|
|
+import { getCurrentCheckStatus } from '@/services/auth';
|
|
|
|
+import React from 'react';
|
|
|
|
+import DirectoryTree from 'antd/es/tree/DirectoryTree';
|
|
|
|
+import { getDeepestTreeData } from '@/utils/tooljs';
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+const IconFont = createFromIconfontCN({
|
|
|
|
+ scriptUrl: '//at.alicdn.com/t/c/font_1927152_4nm5kxbv4m3.js',
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+const SearchIcon = createFromIconfontCN({
|
|
|
|
+ scriptUrl: '//at.alicdn.com/t/c/font_1927152_g1njmm1kh7b.js',
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+export type TableListItem = {
|
|
|
|
+ key: number;
|
|
|
|
+ name: string;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+const MonthlyInfoCheck: React.FC = () => {
|
|
|
|
+
|
|
|
|
+ const [treeData, set_treeData] = useState<getTreeDataRespType[]>([]);
|
|
|
|
+ const [tableColumn, set_tableColumn] = useState<ProColumns[]>([]);
|
|
|
|
+ const [currentSelectedTreeNode, set_currentSelectedTreeNode] = useState<any | undefined>();
|
|
|
|
+ const [currentSelectedTabKey, set_currentSelectedTabKey] = useState<string>('1');
|
|
|
|
+ const [currentComputeDate, set_currentComputeDate] = useState<string | undefined>();
|
|
|
|
+
|
|
|
|
+ const [ifShowTip, set_ifShowTip] = useState(false);
|
|
|
|
+
|
|
|
|
+ const [auditType, set_auditType] = useState('0');
|
|
|
|
+
|
|
|
|
+ const [empInfoSearchKeywords, set_empInfoSearchKeywords] = useState('');
|
|
|
|
+
|
|
|
|
+ const [empFilterParams, set_empFilterParams] = useState<any | undefined>(undefined);
|
|
|
|
+
|
|
|
|
+ const [depInfoSearchKeywords, set_depInfoSearchKeywords] = useState('');
|
|
|
|
+
|
|
|
|
+ const [depFilterParams, set_depFilterParams] = useState<any | undefined>(undefined);
|
|
|
|
+
|
|
|
|
+ const [itemInfoSearchKeywords, set_itemInfoSearchKeywords] = useState('');
|
|
|
|
+
|
|
|
|
+ const [itemFilterParams, set_itemFilterParams] = useState<any | undefined>(undefined);
|
|
|
|
+
|
|
|
|
+ const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([]);
|
|
|
|
+ const [searchValue, setSearchValue] = useState('');
|
|
|
|
+ const [autoExpandParent, setAutoExpandParent] = useState(true);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const tableRef = useRef<ActionType>();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const column = [
|
|
|
|
+ {
|
|
|
|
+ title: '工号',
|
|
|
|
+ dataIndex: 'empNo',
|
|
|
|
+ key: 'empNo',
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '姓名',
|
|
|
|
+ dataIndex: 'empName',
|
|
|
|
+ key: 'empName',
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '岗位层级',
|
|
|
|
+ dataIndex: 'positionLevelName',
|
|
|
|
+ key: 'positionLevelName',
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '职务',
|
|
|
|
+ dataIndex: 'jobTitleName',
|
|
|
|
+ key: 'jobTitleName',
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '岗位系数',
|
|
|
|
+ dataIndex: 'positionRate',
|
|
|
|
+ key: 'positionRate',
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '年资',
|
|
|
|
+ dataIndex: 'seniority',
|
|
|
|
+ key: 'seniority',
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const delPersonHandle = async (record: any) => {
|
|
|
|
+
|
|
|
|
+ const { props: { record: { id } } } = record;
|
|
|
|
+
|
|
|
|
+ const currentComputeDateResp = await getComputeDate();
|
|
|
|
+ if (currentComputeDateResp) {
|
|
|
|
+ const resp = await delPersonRequest({
|
|
|
|
+ computeDate: currentComputeDateResp,
|
|
|
|
+ id: id
|
|
|
|
+ });
|
|
|
|
+ if (resp) {
|
|
|
|
+ tableRef.current?.reload();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const onSelect: TreeProps['onSelect'] = (selectedKeys, info) => {
|
|
|
|
+ // console.log('selected', selectedKeys, info);
|
|
|
|
+ const { node } = info;
|
|
|
|
+ set_currentSelectedTreeNode(node);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const getCurrentComputeDate = async () => {
|
|
|
|
+ const resp = await getComputeDate();
|
|
|
|
+ set_currentComputeDate(resp);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const onTabChange = (activeKey: string) => {
|
|
|
|
+ set_currentSelectedTabKey(activeKey);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const getTableData = async (type: 'PERSON' | 'DEP' | 'CHARGE', params: any, sort: any, filter: any) => {
|
|
|
|
+ // console.log({ currentSelectedTreeNode });
|
|
|
|
+ // console.log({ params, sort, filter });
|
|
|
|
+
|
|
|
|
+ if (currentSelectedTreeNode && currentComputeDate) {
|
|
|
|
+ if (type == 'PERSON') {
|
|
|
|
+ const resp = await getPersonInfoTableData({
|
|
|
|
+ computeDate: currentComputeDate,
|
|
|
|
+ unitCode: currentSelectedTreeNode.code,
|
|
|
|
+ ...params,
|
|
|
|
+ });
|
|
|
|
+ if (resp) {
|
|
|
|
+ return {
|
|
|
|
+ data: resp.list,
|
|
|
|
+ success: true,
|
|
|
|
+ total: resp.totalCount,
|
|
|
|
+ pageSize: resp.pageSize,
|
|
|
|
+ totalPage: resp.totalPage,
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ data: [],
|
|
|
|
+ success: true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (type == 'DEP') {
|
|
|
|
+ const resp = await getDepInfoTableData({
|
|
|
|
+ computeDate: currentComputeDate,
|
|
|
|
+ unitCode: currentSelectedTreeNode.code,
|
|
|
|
+ ...params
|
|
|
|
+ });
|
|
|
|
+ if (resp) {
|
|
|
|
+ return {
|
|
|
|
+ data: resp.list,
|
|
|
|
+ success: true,
|
|
|
|
+ total: resp.totalCount,
|
|
|
|
+ pageSize: resp.pageSize,
|
|
|
|
+ totalPage: resp.totalPage,
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ data: [],
|
|
|
|
+ success: true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (type == 'CHARGE') {
|
|
|
|
+ const resp = await getProjectInfoTableData({
|
|
|
|
+ computeDate: currentComputeDate,
|
|
|
|
+ unitCode: currentSelectedTreeNode.code,
|
|
|
|
+ ...params
|
|
|
|
+ });
|
|
|
|
+ if (resp) {
|
|
|
|
+
|
|
|
|
+ return {
|
|
|
|
+ data: resp.list,
|
|
|
|
+ success: true,
|
|
|
|
+ total: resp.totalCount,
|
|
|
|
+ pageSize: resp.pageSize,
|
|
|
|
+ totalPage: resp.totalPage,
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ data: [],
|
|
|
|
+ success: true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return []
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const TransferNode = React.forwardRef((props, ref) => {
|
|
|
|
+ const [_data, _set_data] = useState<any>();
|
|
|
|
+ const [targetKeys, setTargetKeys] = useState<string[]>(['admin']);
|
|
|
|
+ const [datasource, set_datasource] = useState<any[]>([]);
|
|
|
|
+ const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ useImperativeHandle(ref, () => ({
|
|
|
|
+ save: async () => {
|
|
|
|
+ const items = datasource.filter(a => targetKeys.includes(a.empNo));
|
|
|
|
+ const resp = await saveEmpsRequest(items);
|
|
|
|
+ if (resp) {
|
|
|
|
+ tableRef.current?.reload();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }));
|
|
|
|
+
|
|
|
|
+ const onChange = (nextTargetKeys: string[], direction: TransferDirection, moveKeys: string[]) => {
|
|
|
|
+ // console.log('targetKeys:', nextTargetKeys);
|
|
|
|
+ // console.log('direction:', direction);
|
|
|
|
+ // console.log('moveKeys:', moveKeys);
|
|
|
|
+ setTargetKeys(nextTargetKeys);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const onSelectChange = (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => {
|
|
|
|
+ // console.log('sourceSelectedKeys:', sourceSelectedKeys);
|
|
|
|
+ // console.log('targetSelectedKeys:', targetSelectedKeys);
|
|
|
|
+ setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const getData = async () => {
|
|
|
|
+ const resp = await getTotalEmps({
|
|
|
|
+ computeDate: currentComputeDate as string,
|
|
|
|
+ unitCode: currentSelectedTreeNode.code
|
|
|
|
+ });
|
|
|
|
+ if (resp) {
|
|
|
|
+ //_set_data(resp);
|
|
|
|
+ const allData = resp.allEmployees.concat(resp.checkEmployees);
|
|
|
|
+ set_datasource(allData);
|
|
|
|
+ const defaultSelctedkeys = resp.checkEmployees.map((item: any) => item.empNo);
|
|
|
|
+ setTargetKeys(defaultSelctedkeys);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ getData();
|
|
|
|
+ }, [])
|
|
|
|
+
|
|
|
|
+ return (
|
|
|
|
+ <Transfer
|
|
|
|
+ dataSource={datasource}
|
|
|
|
+ titles={['未添加人员', '已添加人员']}
|
|
|
|
+ targetKeys={targetKeys}
|
|
|
|
+ selectedKeys={selectedKeys}
|
|
|
|
+ onChange={onChange}
|
|
|
|
+ listStyle={{
|
|
|
|
+ width: '45%'
|
|
|
|
+ }}
|
|
|
|
+ locale={{
|
|
|
|
+ itemUnit: '人',
|
|
|
|
+ itemsUnit: '人',
|
|
|
|
+ searchPlaceholder: '请输入姓名'
|
|
|
|
+ }}
|
|
|
|
+ rowKey={record => record.empNo}
|
|
|
|
+ showSearch
|
|
|
|
+ pagination
|
|
|
|
+ onSelectChange={onSelectChange}
|
|
|
|
+ render={(item) => item.name}
|
|
|
|
+ />
|
|
|
|
+ )
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ const addPersonFunc = () => {
|
|
|
|
+ const ref = React.createRef<{ save: any }>();
|
|
|
|
+ Modal.confirm({
|
|
|
|
+ title: '添加人员',
|
|
|
|
+ width: 800,
|
|
|
|
+ content: <TransferNode ref={ref}></TransferNode>,
|
|
|
|
+ onOk: () => {
|
|
|
|
+ return ref.current && ref.current.save();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const confirmGenerateHandle = async (type: number) => {
|
|
|
|
+ const resp = await generateDataRequest({
|
|
|
|
+ computeDate: currentComputeDate as string,
|
|
|
|
+ generateType: type
|
|
|
|
+ });
|
|
|
|
+ if (resp) {
|
|
|
|
+ message.success('生成数据成功');
|
|
|
|
+ tableRef.current?.reload();
|
|
|
|
+ } else {
|
|
|
|
+ message.success('生成数据错误!');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const generateFunc = (type: number) => {
|
|
|
|
+
|
|
|
|
+ let msg = '';
|
|
|
|
+
|
|
|
|
+ if (type == 1) msg = '生成操作会根据基础设定的单元人员对照信息重新生成数据,手动调整的人员信息将会丢失,确定继续生成操作?';
|
|
|
|
+ if (type == 2) msg = '生成操作会覆盖现有的科室数据,确定继续生成操作?';
|
|
|
|
+ if (type == 3) msg = '生成操作会覆盖现有的收费项目数据,确定继续生成操作?';
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Modal.confirm({
|
|
|
|
+ title: '注意',
|
|
|
|
+ content: msg,
|
|
|
|
+ onOk: () => confirmGenerateHandle(type)
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const searchEmpHandle = () => {
|
|
|
|
+ set_empFilterParams({
|
|
|
|
+ empInfo: empInfoSearchKeywords
|
|
|
|
+ })
|
|
|
|
+ // tableRef.current?.reload();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const searchDepHandle = () => {
|
|
|
|
+ set_depFilterParams({
|
|
|
|
+ deptName: depInfoSearchKeywords
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const searchItemHandle = () => {
|
|
|
|
+ set_itemFilterParams({
|
|
|
|
+ itemName: itemInfoSearchKeywords
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const checkHandle = async (type: string) => {
|
|
|
|
+
|
|
|
|
+ const resp = await checkRequest({
|
|
|
|
+ computeDate: currentComputeDate as string,
|
|
|
|
+ auditType: type == '0' ? '1' : '0', //审核类型 1审核 0取消审核
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (resp) {
|
|
|
|
+ if (type == '0') {
|
|
|
|
+ message.success('审核提交成功!');
|
|
|
|
+ set_auditType('1');
|
|
|
|
+ }
|
|
|
|
+ if (type == '1') {
|
|
|
|
+ message.success('取消审核提交成功!');
|
|
|
|
+ set_auditType('0');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const getCheckStatus = async (computeDate: string) => {
|
|
|
|
+ const resp = await getCurrentCheckStatus(computeDate);
|
|
|
|
+ if (resp) {
|
|
|
|
+ set_auditType(`${resp}`); //0 未审核 1 已审核
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const dataList: any[] = [];
|
|
|
|
+
|
|
|
|
+ const getParentKey = (key: React.Key, tree: any[]): React.Key => {
|
|
|
|
+ let parentKey: React.Key;
|
|
|
|
+ for (let i = 0; i < tree.length; i++) {
|
|
|
|
+ const node = tree[i];
|
|
|
|
+ if (node.child) {
|
|
|
|
+ if (node.child.some((item: { code: React.Key; }) => item.code === key)) {
|
|
|
|
+ parentKey = node.code;
|
|
|
|
+ } else if (getParentKey(key, node.child)) {
|
|
|
|
+ parentKey = getParentKey(key, node.child);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return parentKey!;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const onTreeSearchKeyChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
|
|
+
|
|
|
|
+ const { value } = e.target;
|
|
|
|
+ const newExpandedKeys = dataList
|
|
|
|
+ .map((item) => {
|
|
|
|
+ if (item.name.indexOf(value) > -1) {
|
|
|
|
+ return getParentKey(item.code, treeData);
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ const b = newExpandedKeys.filter((item, i, self) => item && self.indexOf(item) === i);
|
|
|
|
+
|
|
|
|
+ setExpandedKeys(newExpandedKeys as React.Key[]);
|
|
|
|
+ setSearchValue(value);
|
|
|
|
+ setAutoExpandParent(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const onExpand = (newExpandedKeys: React.Key[]) => {
|
|
|
|
+ setExpandedKeys(newExpandedKeys);
|
|
|
|
+ setAutoExpandParent(false);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const generateList = (data: getTreeDataRespType[]) => {
|
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
|
+ const node = data[i];
|
|
|
|
+ const { code, name } = node;
|
|
|
|
+ dataList.push({ code: code, name: name });
|
|
|
|
+ if (node.child) {
|
|
|
|
+ generateList(node.child);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ generateList(treeData as any);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const getTreeReqFunc = async (computeDate: string) => {
|
|
|
|
+ const resp = await getTreeData(computeDate);
|
|
|
|
+ set_treeData(resp);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ useEffect(() => {
|
|
|
|
+
|
|
|
|
+ if (currentComputeDate) {
|
|
|
|
+ getTreeReqFunc(currentComputeDate);
|
|
|
|
+ getCheckStatus(currentComputeDate);
|
|
|
|
+ }
|
|
|
|
+ }, [currentComputeDate]);
|
|
|
|
+
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ tableRef.current?.reload();
|
|
|
|
+ }, [currentSelectedTreeNode]);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ //初始化左侧树结构数据后
|
|
|
|
+
|
|
|
|
+ if (treeData?.length > 0) {
|
|
|
|
+
|
|
|
|
+ if (treeData[0].child && treeData[0].child.length > 0) {
|
|
|
|
+ const [node, nodeParent] = getDeepestTreeData(treeData[0], 'child');
|
|
|
|
+
|
|
|
|
+ set_currentSelectedTreeNode(node);
|
|
|
|
+ setExpandedKeys([nodeParent.code]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }, [treeData]);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ set_tableColumn(column as ProColumns[]);
|
|
|
|
+ getCurrentComputeDate();
|
|
|
|
+
|
|
|
|
+ }, []);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return (
|
|
|
|
+ <div className='MonthlyInfoCheck'>
|
|
|
|
+ <div className='leftTree'>
|
|
|
|
+ <div className='search'>
|
|
|
|
+ <Input
|
|
|
|
+ className='searchInput'
|
|
|
|
+ placeholder="请输入类目名称"
|
|
|
|
+ size='small'
|
|
|
|
+ allowClear
|
|
|
|
+
|
|
|
|
+ style={{ marginBottom: 16 }}
|
|
|
|
+ onChange={onTreeSearchKeyChange}
|
|
|
|
+ suffix={
|
|
|
|
+ <SearchIcon type='iconsousuo' />
|
|
|
|
+ }
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ {
|
|
|
|
+ treeData && treeData.length > 0 && currentSelectedTreeNode && (
|
|
|
|
+ <DirectoryTree
|
|
|
|
+ fieldNames={{ title: 'name', key: 'code', children: 'child' }}
|
|
|
|
+ rootStyle={{ height: '100%', paddingBottom: 50, overflowY: 'scroll', overflowX: 'hidden' }}
|
|
|
|
+ onSelect={onSelect}
|
|
|
|
+ onExpand={onExpand}
|
|
|
|
+ expandedKeys={expandedKeys}
|
|
|
|
+ autoExpandParent={autoExpandParent}
|
|
|
|
+ selectedKeys={[currentSelectedTreeNode.code]}
|
|
|
|
+ blockNode={true}
|
|
|
|
+ icon={() => null}
|
|
|
|
+ titleRender={
|
|
|
|
+ (nodeData: any) => {
|
|
|
|
+ const strTitle = nodeData.name as string;
|
|
|
|
+ const index = strTitle.indexOf(searchValue);
|
|
|
|
+ const beforeStr = strTitle.substring(0, index);
|
|
|
|
+ const afterStr = strTitle.slice(index + searchValue.length);
|
|
|
|
+ const title =
|
|
|
|
+ index > -1 ? (
|
|
|
|
+ <span>
|
|
|
|
+ {beforeStr}
|
|
|
|
+ <span className="site-tree-search-value" style={{ color: 'red', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{searchValue}</span>
|
|
|
|
+ {afterStr}
|
|
|
|
+ </span>
|
|
|
|
+ ) : (
|
|
|
|
+ <span className='strTitle'>{strTitle}</span>
|
|
|
|
+ );
|
|
|
|
+ return <div style={{
|
|
|
|
+ display: 'flex', flexDirection: 'row',
|
|
|
|
+ width: '100%',
|
|
|
|
+ justifyContent: 'flex-start', alignItems: 'center', height: 32,
|
|
|
|
+ borderRadius: '4px',
|
|
|
|
+ overflow: 'hidden',
|
|
|
|
+ color: '#17181A',
|
|
|
|
+ textOverflow: 'ellipsis',
|
|
|
|
+ whiteSpace: 'nowrap'
|
|
|
|
+
|
|
|
|
+ }}>{title}</div>
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ defaultSelectedKeys={[treeData[0].child[0].code]}
|
|
|
|
+ treeData={treeData as unknown as DataNode[]}
|
|
|
|
+ // treeData={treeDataNew}
|
|
|
|
+ switcherIcon={(props: any) => {
|
|
|
|
+ const { expanded } = props;
|
|
|
|
+ return !expanded ? <img style={{ width: 20, height: 20, position: 'relative', top: 5 }} src={expandedIcon} /> : <img style={{ width: 20, height: 20, position: 'relative', top: 5 }} src={closeIcon} />
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ </div>
|
|
|
|
+ {/* <div style={{width:16,height:'92vh',background:'#F5F7FA'}}></div> */}
|
|
|
|
+ <div className='rightContent'>
|
|
|
|
+ <BMSPagecontainer title={`核算年月:${currentComputeDate}`} ghost>
|
|
|
|
+ <div className='tabContent'>
|
|
|
|
+ <div className='tableToolbar'>
|
|
|
|
+ <div className='search'>
|
|
|
|
+ <span>人员:</span><Input className='searchInput' allowClear onChange={(e) => {
|
|
|
|
+
|
|
|
|
+ set_empInfoSearchKeywords(e.target.value)
|
|
|
|
+ if (e.target.value.length == 0) {
|
|
|
|
+ set_empFilterParams({
|
|
|
|
+ ...empFilterParams,
|
|
|
|
+ empInfo: ''
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }} placeholder="输入工号/姓名" suffix={
|
|
|
|
+ <IconFont type="iconsousuo" onClick={() => searchEmpHandle()} />
|
|
|
|
+ } />
|
|
|
|
+ </div>
|
|
|
|
+ <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
|
|
|
|
+ <div className={auditType != '0' ? 'btnGroup disabled' : 'btnGroup'}
|
|
|
|
+ onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
|
|
|
|
+ onMouseLeave={() => set_ifShowTip(false)}
|
|
|
|
+ >
|
|
|
|
+ {/* <span key="1">调整</span> */}
|
|
|
|
+ <span key="2" onClick={auditType == '0' ? () => generateFunc(1) : () => { }}>生成</span>
|
|
|
|
+ <span key="3" onClick={auditType == '0' ? () => addPersonFunc() : () => { }}>添加</span>
|
|
|
|
+ </div>
|
|
|
|
+ </Popover>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ {currentSelectedTreeNode && <BMSTable params={empFilterParams} actionRef={tableRef} rowKey='empNo' columns={auditType == '0' ? [...tableColumn, {
|
|
|
|
+ title: '操作',
|
|
|
|
+ key: 'option',
|
|
|
|
+ valueType: 'option',
|
|
|
|
+ render: (record: any) => [
|
|
|
|
+
|
|
|
|
+ <Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delPersonHandle(record)}>
|
|
|
|
+ <a key={'del'}>删除</a>
|
|
|
|
+ </Popconfirm>
|
|
|
|
+ ],
|
|
|
|
+ },] : [...tableColumn]} request={(params, sort, filter) => getTableData('PERSON', params, sort, filter)} />}
|
|
|
|
+ </div>
|
|
|
|
+ </BMSPagecontainer>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+export default MonthlyInfoCheck;
|