Эх сурвалжийг харах

添加二次分配计算界面

code4eat 2 жил өмнө
parent
commit
56ba9a4875

+ 11 - 1
.umirc.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-18 10:05:15
+ * @LastEditTime: 2023-05-23 13:21:41
  * @FilePath: /BudgetManaSystem/.umirc.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -294,6 +294,16 @@ export default defineConfig({
           path: '/secondaryDistribute/employeeInfoCheck',
           component: './secondaryDistribute/employeeInfoCheck',
         },
+        {
+          name: '非考核项目核定',
+          path: '/secondaryDistribute/nonCheckProjectApprove',
+          component: './secondaryDistribute/nonCheckProjectApprove',
+        },
+        {
+          name: '二次分配计算',
+          path: '/secondaryDistribute/secondaryDitriComputed',
+          component: './secondaryDistribute/secondaryDitriComputed',
+        },
       ]
     },
   ],

+ 1 - 57
src/pages/budgetMana/monthlyDataCheck/index.tsx

@@ -4,7 +4,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-16 09:42:52
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-04-21 09:59:12
+ * @LastEditTime: 2023-05-22 15:34:11
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -658,62 +658,6 @@ const MonthlyDataCheck: React.FC = () => {
     };
 
 
-
-
-    interface RecordType {
-        key: string;
-        title: string;
-        description: string;
-    }
-
-
-    const mockData: RecordType[] = Array.from({ length: 20 }).map((_, i) => ({
-        key: i.toString(),
-        title: `content${i + 1}`,
-        description: `description of content${i + 1}`,
-    }));
-
-    const initialTargetKeys = mockData.filter((item) => Number(item.key) > 10).map((item) => item.key);
-
-
-    const TransferNode = () => {
-
-        const [targetKeys, setTargetKeys] = useState(initialTargetKeys);
-        const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
-
-        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]);
-        };
-
-
-
-        return (
-            <Transfer
-                dataSource={mockData}
-                titles={['未添加人员', '已添加人员']}
-                targetKeys={targetKeys}
-                selectedKeys={selectedKeys}
-                onChange={onChange}
-                listStyle={{
-                    width: '45%'
-                }}
-                onSelectChange={onSelectChange}
-                render={(item) => item.title}
-            />
-        )
-    }
-
-
-
     const dataList: any[] = [];
 
     const generateList = (data: getTreeDataRespType[]) => {

+ 642 - 0
src/pages/secondaryDistribute/nonCheckProjectApprove/index.tsx

@@ -0,0 +1,642 @@
+
+
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2022-12-16 09:42:52
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-05-23 13:30:17
+ * @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, useRef, useState } from 'react';
+import './style.less';
+
+import { TreeProps, 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, ModalForm, ProColumns, ProFormDependency, ProFormDigit, ProFormInstance, ProFormRadio, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-components';
+import { createFromIconfontCN } from '@ant-design/icons';
+import { commitRequest,delRequest, generateDataRequest, getCurrentCommitStatusReq, getNonCheckProjectTableData, getTreeData, getTreeDataRespType, addNonCheckProjectTableData, editNonCheckProjectTableData } from './service';
+import { TransferItem, TransferProps } from 'antd/es/transfer';
+import { getComputeDate } from '@/pages/Home/service';
+
+
+import 'dayjs/locale/zh-cn';
+import React from 'react';
+import DirectoryTree from 'antd/es/tree/DirectoryTree';
+import { getDeepestTreeData } from '@/utils/tooljs';
+import { ColumnsType } from 'antd/es/table';
+import { TableRowSelection } from 'antd/es/table/interface';
+import { difference } from 'lodash';
+import { getCurrentCheckStatus } from '@/services/auth';
+import { getDataByKeyFromDic, getPubDicData } from '@/services/getDic';
+import { getCheckUnitDepMapTableDataByUnitClass } from '@/pages/setting/checkUnitSet/checkUnitDepMap/service';
+import { getNonCheckTableData } from '@/pages/setting/projectSetting/checkUnitProjectSet/service';
+import { getEmps, getProjects } from '@/pages/budgetMana/monthlyDataCheck/service';
+
+
+
+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 NonCheckProjectApprove: React.FC = () => {
+
+    const [treeData, set_treeData] = useState<getTreeDataRespType[]>([]);
+    const [tableColumn, set_tableColumn] = useState<ProColumns[]>([]);
+    const [currentSelectedTreeNode, set_currentSelectedTreeNode] = useState<any | undefined>();
+
+    const [currentComputeDate, set_currentComputeDate] = useState<string | undefined>();
+
+    const [ifShowTip, set_ifShowTip] = useState(false);
+
+    const [commitStatus, set_commitStatus] = useState('0'); //提交状态
+
+    const [empInfoSearchKeywords, set_empInfoSearchKeywords] = useState('');
+
+    const [empFilterParams, set_empFilterParams] = useState<any | undefined>(undefined);
+
+    const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([]);
+    const [searchValue, setSearchValue] = useState('');
+    const [autoExpandParent, setAutoExpandParent] = useState(true);
+
+    const [auditType, set_auditType] = useState('0');  //审核状态
+
+    const formRef = useRef<ProFormInstance>();
+
+    const tableRef = useRef<ActionType>();
+
+
+    const column: ProColumns[] = [
+        {
+            title: '项目名称',
+            dataIndex: 'assessmentName',
+        },
+        {
+            title: '分配方式',
+            dataIndex: 'distributionTypeName',
+        },
+        {
+            title: '数值',
+            dataIndex: 'value',
+        },
+        {
+            title: '工号',
+            dataIndex: 'userId',
+        },
+        {
+            title: '姓名',
+            dataIndex: 'targetValueName',
+        },
+        {
+            title: '来源',
+            dataIndex: 'source',
+        },
+        {
+            title: '说明',
+            dataIndex: 'description',
+            ellipsis:true
+        },
+        {
+            title: '状态',
+            dataIndex: 'submitName',
+            renderText(text, record, index, action) {
+                return record.submit == 1 ? text : <span style={{ color: '#FF8C19' }}>{text}</span>
+            },
+        },
+    ];
+
+
+    const delHandle = async (record: any) => {
+
+        const {  id } = record;
+
+        const currentComputeDateResp = await getComputeDate();
+        if (currentComputeDateResp) {
+            const resp = await delRequest({
+                computeDate: currentComputeDateResp,
+                id: id,
+                unitCode: currentSelectedTreeNode.code
+            });
+            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 getCheckStatus = async (computeDate: string) => {
+        const resp = await getCurrentCheckStatus(computeDate);
+        if (resp) {
+            set_auditType(`${resp}`);  //0 未审核 1 已审核
+        }
+    }
+
+    const getCurrentCommitStatus = async () => {
+        if (currentSelectedTreeNode) {
+            const resp = await getCurrentCommitStatusReq({
+                computeDate: currentComputeDate as string,
+                unitCode: currentSelectedTreeNode.code
+            });
+            set_commitStatus(`${resp}`);
+        }
+    }
+
+    const getTableData = async (params: any, sort: any, filter: any) => {
+        // console.log({ currentSelectedTreeNode });
+        // console.log({ params, sort, filter });
+
+        if (currentSelectedTreeNode && currentComputeDate) {
+            const resp = await getNonCheckProjectTableData({
+                computeDate: currentComputeDate,
+                unitCode: currentSelectedTreeNode.code,
+                ...params,
+            });
+            if (resp) {
+                return {
+                    data: resp,
+                    success: true,
+                }
+            }
+            return {
+                data: [],
+                success: true
+            }
+        }
+
+        return []
+    }
+
+
+    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
+
+        const result = {
+            computeDate: currentComputeDate as string,
+            unitCode: currentSelectedTreeNode.code,
+            deptCode: formVal.deptCode,
+            nonAssessmentCode: formVal.nonAssessmentCode.value,
+            targetValue: formVal.targetValue,
+            value: formVal.value,
+            description: formVal.description
+        }
+
+        if (type == 'ADD') {
+            const resp = await addNonCheckProjectTableData({ ...result });
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+        }
+        if (type == 'EDIT') {
+            const resp = await editNonCheckProjectTableData({id:formVal.id,...result});
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+        }
+
+        return true;
+    }
+
+
+
+    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
+
+        return (
+            <ModalForm
+                title={`${type == 'EDIT' ? '编辑' : '新增'}非考核项目`}
+                width={352}
+                initialValues={type == 'EDIT' ? { ...record, nonAssessmentCode: { label: record.assessmentName, value: record.assessmentCode },targetValue:record.userId } : {}}
+                trigger={
+                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>添加</span>
+                }
+                formRef={formRef}
+                onFinish={(val) => {
+                    return updateTable(type == 'EDIT' ? { ...record, ...val} : { ...val }, type);
+                }}
+                modalProps={{ destroyOnClose: true }}
+                colProps={{ span: 24 }}
+                grid
+            >
+                <ProFormSelect label="科室:"
+                    name='deptCode'
+                    request={async () => {
+                        const resp = await getCheckUnitDepMapTableDataByUnitClass({
+                            unitCode: currentSelectedTreeNode.code,
+                            pageSize: 500,
+                            current: 1
+                        });
+                        if (resp) {
+                            return resp.list.map(a => ({ label: a.deptName, value: a.deptCode }))
+                        }
+
+                        return []
+                    }}
+                    rules={[{ required: true, message: '科室不能为空!' }]}
+                />
+                <ProFormSelect
+                    name="nonAssessmentCode"
+                    label="项目名称"
+                    placeholder="请选择"
+                    rules={[{ required: true }]}
+                    request={async () => {
+                        const resp = await getProjects();
+                        if (resp) {
+                            return resp.map((a: any) => ({
+                                label: a.name, value: a.code, d: a
+                            }))
+                        }
+                        return []
+                    }}
+                    fieldProps={{
+                        labelInValue: true,
+                        onChange: (value) => {
+
+                            const { d: { distributionTypeName } } = value;
+                            formRef.current?.setFieldValue('distributionTypeName', distributionTypeName);
+                        }
+                    }}
+                />
+                <ProFormDependency name={['nonAssessmentCode']}>
+                    {
+                        ({ nonAssessmentCode }) => {
+                            return (
+                                <ProFormText disabled name="distributionTypeName" label="分配方式" />
+                            )
+                        }
+                    }
+                </ProFormDependency>
+                <ProFormDigit label="数值" name="value" min={-1000000000000000} rules={[{ required: true }]} />
+                <ProFormDependency name={['distributionTypeName']}>
+                    {
+                        ({ distributionTypeName }) => {
+
+                            return (
+                                <ProFormSelect
+                                    name="targetValue"
+                                    label="姓名"
+                                    placeholder="请选择"
+                                    rules={[{ required: distributionTypeName == '绝对数' ? true : false }]}
+                                    params={currentSelectedTreeNode.code}
+                                    fieldProps={{
+                                        showSearch: true,
+                                    }}
+                                    request={async () => {
+                                        const resp = await getEmps(currentSelectedTreeNode.code);
+
+                                        if (resp) {
+                                            return resp.map((a: any) => ({
+                                                label: a.name, value: a.userId, d: a
+                                            }))
+                                        }
+                                        return []
+                                    }}
+                                />
+                            )
+                        }
+                    }
+                </ProFormDependency>
+
+                <ProFormTextArea
+                    name="description"
+                    label="说明"
+                    colProps={{ span: 24 }}
+                    placeholder="请输入"
+                />
+
+            </ModalForm>
+        )
+    }
+
+
+
+    const confirmGenerateHandle = async () => {
+        const resp = await generateDataRequest({
+            computeDate: currentComputeDate as string,
+            unitCode: currentSelectedTreeNode.code
+        });
+        if (resp) {
+            message.success('生成数据成功');
+            tableRef.current?.reload();
+        } else {
+            message.success('生成数据错误!');
+        }
+    }
+
+    const generateFunc = () => {
+
+        let msg = '生成操作会覆盖已有的数据,是否继续?';
+        Modal.confirm({
+            title: '注意',
+            okText: '确定',
+            cancelText: '取消',
+            content: msg,
+            onOk: () => confirmGenerateHandle()
+
+        });
+    }
+
+    const commitBtnhandle = () => {
+        Modal.confirm({
+            title: '注意',
+            okText: '确定',
+            cancelText: '取消',
+            content: `${commitStatus == '1' ? '取消提交' : '提交'}当前选择的核算单元的数据?`,
+            onOk: async () => {
+                const resp = await commitRequest({
+                    computeDate: currentComputeDate as string,
+                    unitCode: currentSelectedTreeNode.code,
+                    type: commitStatus == '1' ? '0' : '1',  //1 提交 0 取消
+                });
+                if (resp) {
+                    message.success('提交成功!');
+                    getTreeReqFunc(currentComputeDate as string);
+                    getCurrentCommitStatus();
+                }
+            }
+
+        })
+    }
+
+    const searchEmpHandle = () => {
+        set_empFilterParams({
+            name: empInfoSearchKeywords
+        })
+        // tableRef.current?.reload();
+    }
+
+
+    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();
+
+        if (currentComputeDate && currentSelectedTreeNode) {
+            getCurrentCommitStatus();
+        }
+    }, [currentSelectedTreeNode, currentComputeDate]);
+
+
+
+
+    useEffect(() => {
+        //初始化左侧树结构数据后
+
+        if (treeData?.length > 0) {
+            if (!currentSelectedTreeNode) {
+                if (treeData[0].child && treeData[0].child.length > 0) {
+                    const [node, nodeParent] = getDeepestTreeData(treeData[0], 'child');
+
+                    set_currentSelectedTreeNode(node);
+                    setExpandedKeys([nodeParent.code]);
+                    getCurrentCommitStatus();
+                }
+            }
+        }
+    }, [treeData]);
+
+
+    useEffect(() => {
+        if (auditType == '1') {
+            //当审核中时,禁掉所有操作
+            set_commitStatus('1');
+        }
+    }, [auditType])
+
+    useEffect(() => {
+        set_tableColumn(column as ProColumns[]);
+        getCurrentComputeDate();
+
+    }, []);
+
+
+    return (
+        <div className='NonCheckProjectApprove'>
+            <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: 'space-between', alignItems: 'center', height: 32,
+                                        borderRadius: '4px',
+                                        overflow: 'hidden',
+                                        color: '#17181A',
+                                        textOverflow: 'ellipsis',
+                                        whiteSpace: 'nowrap'
+
+                                    }}>
+                                        {title}
+                                        {!nodeData.map && <span className={nodeData.unitType ? 'point lastChild' : 'point'}></span>}
+                                    </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,
+                                            name: ''
+                                        });
+                                    }
+                                }} placeholder="输入工号/姓名" suffix={
+                                    <IconFont type="iconsousuo" onClick={() => searchEmpHandle()} />
+                                } />
+                            </div>
+
+                            <div className='btnGroupWrap'>
+                                <Popover open={ifShowTip} content={auditType == '1' ? '当前处于审核中,无法操作!' : '当前处于提交中,无法操作!'} >
+                                    <div className={commitStatus != '0' || auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
+                                        /**
+                                         * 当审核中,三个操作按钮都不可点击
+                                         * 当非审核中,生成和添加不可操作
+                                         */
+                                        onMouseEnter={() => auditType == '0' ? commitStatus == '1' ? set_ifShowTip(true) : set_ifShowTip(false) : set_ifShowTip(true)}
+                                        onMouseLeave={() => set_ifShowTip(false)}
+                                    >
+                                        {/* <span key="2" onClick={commitStatus == '0' ? () => generateFunc() : () => { }}>获取</span> */}
+                                        <UpDataActBtn record type='ADD' />
+                                    </div>
+                                </Popover>
+                                <div key="4" className={auditType == '1' ? 'commit disabled' : 'commit'} onClick={() => auditType == '0' ? commitBtnhandle() : () => { }}>{commitStatus == '1' ? '取消提交' : '提交'}</div>
+                            </div>
+
+                        </div>
+                        {currentSelectedTreeNode && <BMSTable params={empFilterParams} pagination={false} actionRef={tableRef} rowKey='id' columns={commitStatus == '0' ? [...tableColumn, {
+                            title: '操作',
+                            key: 'option',
+                            width:120,
+                            valueType: 'option',
+                            renderText: (_,record: any) => [
+                                <UpDataActBtn key={'edit'} record={record} type='EDIT' />,
+                                <Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delHandle(record)}>
+                                    <a key={'del'}>删除</a>
+                                </Popconfirm>
+                            ],
+                        },] : [...tableColumn]} request={(params, sort, filter) => getTableData(params, sort, filter)} />}
+                    </div>
+                </BMSPagecontainer>
+            </div >
+        </div >
+    );
+
+};
+
+export default NonCheckProjectApprove;

+ 163 - 0
src/pages/secondaryDistribute/nonCheckProjectApprove/service.ts

@@ -0,0 +1,163 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2022-12-21 11:13:51
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-05-22 17:06:04
+ * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlyInfoCheck/service.ts
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+
+
+import { request } from '@@/plugin-request';
+
+
+
+
+//获取树结构单元数据
+
+export type getTreeDataRespType = {
+    code: number,
+    name: string,
+    map:boolean,
+    parentCode:string,
+    unitType?:string,
+    child: getTreeDataRespType[]
+}
+
+export const getTreeData = (computeDate: string) => {
+
+    return request<getTreeDataRespType[]>('/performance/secondSetting/getNonAssessmentUnitList', {
+        method: 'GET',
+        params: { computeDate }
+    })
+}
+
+
+
+//获取非考核项目
+
+export type GetNonCheckProjectParams = {
+    computeDate: string; //核算年月
+    unitCode: string; //核算单元代码
+    name?: string; //人员信息 (工号、姓名)
+    current: number;
+    pageSize: number;
+}
+
+export const getNonCheckProjectTableData = (params: GetNonCheckProjectParams) => {
+
+    return request('/performance/secondSetting/getNonAssessmentList', {
+        method: 'GET',
+        params: { ...params }
+    })
+
+}
+
+
+
+//添加非考核项目
+export const addNonCheckProjectTableData = (data:{
+    "computeDate":string, //核算年月
+    "unitCode":string, //核算单元代码
+    "deptCode":string, //科室代码
+    "nonAssessmentCode":number, //非考核项目代码
+    "targetValue":string, //工号
+    "value":string, //值
+    "description":string //说明
+}) => {
+
+    return request('/performance/secondSetting/addNonAssessment', {
+        method: 'POST',
+        data
+    })
+
+}
+
+//添加非考核项目
+export const editNonCheckProjectTableData = (data:{
+    "id":number,
+    "computeDate":string, //核算年月
+    "unitCode":string, //核算单元代码
+    "deptCode":string, //科室代码
+    "nonAssessmentCode":number, //非考核项目代码
+    "targetValue":string, //工号
+    "value":string, //值
+    "description":string //说明
+}) => {
+
+    return request('/performance/secondSetting/editNonAssessment', {
+        method: 'POST',
+        data
+    })
+
+}
+
+
+
+//获取当前提交状态
+export const getCurrentCommitStatusReq = (params:{
+    computeDate:string,
+    unitCode:string
+}) => {
+
+    return request('/performance/secondSetting/getNonAssessmentSubmitStatus', {
+        method: 'GET',
+        params: params
+    })
+
+}
+
+
+
+
+//删除
+export const delRequest = (params:{
+    computeDate:string,
+    id:string,
+    unitCode:string
+}) => {
+
+    return request('/performance/secondSetting/deleteNonAssessment', {
+        method: 'POST',
+        params: params
+    })
+
+}
+
+
+//生成数据
+
+export type GenerateDataRequestParamsType = {
+    computeDate: string,
+    unitCode: string,
+}
+
+export const generateDataRequest = (data: GenerateDataRequestParamsType) => {
+ 
+    return request('/performance/secondSetting/generateEmployee', {
+        method: 'POST',
+        params:data
+    })
+
+}
+
+
+//提交请求
+
+export type CommitRequestParamsType = {
+    computeDate:string,
+    unitCode:string,
+    type:string
+}
+export const commitRequest = (data:CommitRequestParamsType) => {
+ 
+    return request('/performance/secondSetting/submitNonAssessment', {
+        method: 'POST',
+        params:data
+    })
+
+}
+
+

+ 196 - 0
src/pages/secondaryDistribute/nonCheckProjectApprove/style.less

@@ -0,0 +1,196 @@
+.NonCheckProjectApprove {
+    display: flex;
+    flex-direction: row;
+    // height: 100%;
+    background: #F5F7FA;
+
+    .leftTree {
+        position: fixed;
+        top: 64px;
+        width: 220px;
+        height: calc(100vh - 80px);
+        background: #FFF;
+        border-radius: 4px;
+        padding: 16px;
+        overflow: hidden;
+        margin-right: 16px;
+        // border-right:16px solid #F5F7FA;
+
+        .searchInput {
+            border: 1px solid #CFD7E6;
+        }
+        
+        .point {
+            display: block;
+            content: '';
+            width: 6px;
+            height: 6px;
+            border-radius: 50%;
+            z-index:99;
+            background: #FF9832;
+
+            &.lastChild {
+                background: #FF1966;
+            }
+        }
+
+
+        .bms-ant-tree.bms-ant-tree-directory .bms-ant-tree-treenode-selected:hover::before,
+        .bms-ant-tree.bms-ant-tree-directory .bms-ant-tree-treenode-selected::before {
+            border-radius: 4px;
+            background: rgb(240 242 245 / 100%);
+        }
+
+        .bms-ant-tree.bms-ant-tree-directory .bms-ant-tree-treenode .bms-ant-tree-node-content-wrapper.bms-ant-tree-node-selected {
+            font-weight: bold;
+        }
+    }
+
+    .rightContent {
+        position: relative;
+        border-radius: 4px;
+        width: calc(100% - 220px);
+        padding: 16px;
+        margin-left: 236px;
+        background: #FFF;
+
+        .checkBtn {
+            position: absolute;
+            cursor: pointer;
+            top: 0;
+            right: 0;
+            padding: 0 14px;
+            height: 24px;
+            line-height: 24px;
+            background: #3376FE;
+            border-radius: 4px;
+            text-align: center;
+            font-size: 14px;
+            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+            font-weight: 400;
+            color: #FFF;
+        }
+
+        .midLine {
+            display: flex;
+            flex-direction: row;
+            justify-content: center;
+            align-items: center;
+            height: 24px;
+            line-height: 24px;
+            background: #F0FCFC;
+            font-size: 12px;
+            color: #515866;
+            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+            font-weight: 400;
+            margin-top: 12px;
+            margin-bottom: 15px;
+
+            &>span {
+                cursor: pointer;
+                font-size: 12px;
+                font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+                font-weight: 500;
+                color: #00B3B3;
+                padding-right: 4px;
+            }
+
+        }
+
+        .bms-ant-tabs-nav {
+            &::before {
+                border-bottom: none !important;
+            }
+        }
+
+        .tabContent {
+            display: flex;
+            flex-direction: column;
+
+            .tableToolbar {
+                display: flex;
+                flex-direction: row;
+                justify-content: space-between;
+                align-items: center;
+                margin-top: 16px;
+                margin-bottom: 16px;
+
+                .search {
+                    display: flex;
+                    flex-direction: row;
+                    justify-content: flex-start;
+                    align-items: center;
+
+                    .searchInput {
+                        width: 167px;
+                        height: 24px;
+                        background: #FFF;
+                        border-radius: 4px;
+                        border: 1px solid #CFD7E6;
+                    }
+
+                    &>span {
+                        font-size: 14px;
+                        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+                        font-weight: 400;
+                        color: #17181A;
+                    }
+                }
+                
+                .btnGroupWrap {
+                    display: flex;
+                    flex-direction: row;
+                    align-items: center;
+
+                    .btnGroup {
+                        &>span {
+                            display: inline-block;
+                            text-align: center;
+                            width: 56px;
+                            height: 24px;
+                            line-height: 21px;
+                            background: #FAFCFF;
+                            border-radius: 4px;
+                            cursor: pointer;
+                            border: 1px solid #DAE2F2;
+                            margin-right: 8px;
+    
+                            &:last-child {
+                                margin-right: 0;
+                            }
+                        }
+                        &.disabled {
+                            &>span {
+                                cursor: not-allowed;
+                                color: rgb(0 0 0 / 50%);
+                                background-color: #f0f2f5;
+                            }
+                        }
+                    }
+                    .commit {
+                        display: inline-block;
+                        text-align: center;
+                        padding: 0 14px;
+                        height: 24px;
+                        line-height: 23px;
+                        background: #3377FF;
+                        border-radius: 4px;
+                        cursor: pointer;
+                        font-size: 14px;
+                        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+                        font-weight: 400;
+                        margin-left: 8px;
+                        color: #FFF;
+
+                        &.disabled {
+                            cursor: not-allowed;
+                            color: rgb(0 0 0 / 50%);
+                            background-color: #f0f2f5;
+                        }
+                    }
+                }
+        
+            }
+        }
+    }
+}

+ 650 - 0
src/pages/secondaryDistribute/secondaryDitriComputed/index.tsx

@@ -0,0 +1,650 @@
+
+
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2022-12-16 09:42:52
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-05-24 17:12:52
+ * @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, useRef, useState } from 'react';
+import './style.less';
+
+import { TreeProps, Input, Modal, message, Popover, Table, Switch } 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, ProFormDigit, ProFormInstance } from '@ant-design/pro-components';
+import { createFromIconfontCN } from '@ant-design/icons';
+import { commitRequest, getCurrentCommitStatusReq, getSecondaryDistriComputeTableData, getTreeData, getTreeDataRespType, save } from './service';
+
+import { getComputeDate } from '@/pages/Home/service';
+
+
+import 'dayjs/locale/zh-cn';
+import React from 'react';
+import DirectoryTree from 'antd/es/tree/DirectoryTree';
+import { getDeepestTreeData } from '@/utils/tooljs';
+
+import { getCurrentCheckStatus } from '@/services/auth';
+import math, { sparse } from 'mathjs';
+
+
+
+const SearchIcon = createFromIconfontCN({
+    scriptUrl: '//at.alicdn.com/t/c/font_1927152_g1njmm1kh7b.js',
+});
+
+
+
+export type TableListItem = {
+    key: number;
+    name: string;
+};
+
+
+const useDebounce = (value: string, delay: number) => {
+    const [debouncedValue, setDebouncedValue] = useState(value);
+
+    useEffect(() => {
+        const handler = setTimeout(() => {
+            setDebouncedValue(value);
+        }, delay);
+
+        return () => {
+            clearTimeout(handler);
+        };
+    }, [value, delay]);
+
+    return debouncedValue;
+}
+
+
+const SecondaryDitriComputed: React.FC = () => {
+
+    const [treeData, set_treeData] = useState<getTreeDataRespType[]>([]);
+    const [tableColumn, set_tableColumn] = useState<ProColumns[]>([]);
+    const [currentSelectedTreeNode, set_currentSelectedTreeNode] = useState<any | undefined>();
+
+    const [currentComputeDate, set_currentComputeDate] = useState<string | undefined>();
+
+    const [ifShowTip, set_ifShowTip] = useState(false);
+
+    const [commitStatus, set_commitStatus] = useState('0'); //提交状态
+
+    const [empFilterParams, set_empFilterParams] = useState<any | undefined>(undefined);
+
+    const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([]);
+    const [searchValue, setSearchValue] = useState('');
+    const [autoExpandParent, setAutoExpandParent] = useState(true);
+
+    const [ifEditMode, set_ifEditMode] = useState(false);
+
+    const [auditType, set_auditType] = useState('0');  //审核状态
+
+    const tableRef = useRef<ActionType>();
+
+    const [needSaveData, set_needSaveData] = useState<any | undefined>(undefined);
+
+    const [inputsRefKeys, set_inputsRefKeys] = useState<string[]>([]);
+
+    const inputsRef = useRef<{ [key: string]: any }>({});
+
+    const [pageData, set_pageData] = useState({ total: 0, completedTotal: 0, leftTotal: 0 });
+
+    const [dataSource, set_dataSource] = useState([]);
+
+    const [currentInputRefKeys, set_currentInputRefKeys] = useState<string | undefined>(undefined);
+
+
+    const column: ProColumns[] = [
+        {
+            title: '工号',
+            dataIndex: 'account',
+        },
+        {
+            title: '姓名',
+            dataIndex: 'name',
+        },
+    ];
+
+
+    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 getCheckStatus = async (computeDate: string) => {
+        const resp = await getCurrentCheckStatus(computeDate);
+        if (resp) {
+            set_auditType(`${resp}`);  //0 未审核 1 已审核
+        }
+    }
+
+    const getCurrentCommitStatus = async () => {
+        if (currentSelectedTreeNode) {
+            const resp = await getCurrentCommitStatusReq({
+                computeDate: currentComputeDate as string,
+                unitCode: currentSelectedTreeNode.code
+            });
+            set_commitStatus(`${resp}`);
+        }
+    }
+
+    const gennerateColumns = (data: { title: any; userList: any; }, inputsRefKeys?: string[]) => {
+        const { title } = data;
+        const _columns = title.map((item: any, index: number) => {
+            return {
+                title: item.name,
+                dataIndex: `${item.code}`,
+                renderText: (_: any, record: any) => {
+                    if (ifEditMode) {
+                        return <ProFormDigit noStyle min={-1000000000} fieldProps={{
+                            ref: ref => {
+                                inputsRef.current[`${record.account}-${item.code}`] = ref;
+                                //console.log({ref});
+                            },
+                            onPressEnter: (event) => {
+                                if (event.code === 'Enter') {
+                                    event.preventDefault();
+                                    const index = inputsRefKeys ? inputsRefKeys.findIndex(a => a == `${record.account}-${item.code}`) : -1;
+                                    //console.log({index,input:inputsRef.current,inputsRefKeys});
+                                    const nextInput = inputsRefKeys ? inputsRef.current[inputsRefKeys[index + 1]] : null;
+                                    if (nextInput) {
+                                        inputsRefKeys && set_currentInputRefKeys(inputsRefKeys[index + 1]);
+                                        nextInput.focus();
+                                    }
+                                }
+                            },
+                            onFocus: () => set_currentInputRefKeys(`${record.account}-${item.code}`),
+                            defaultValue: _, onChange(value) {
+                                //if(!value)return;
+                                const updatedUserList = needSaveData.userList.map((a: any) => {
+                                    if (a.account == record.account) {
+                                        const arr = a.itemValue.map((b: any) => {
+                                            if (b.code == item.code) {
+                                                return { ...b, value: value ? value : 0 } //value有为undefined的可能
+                                            } else {
+                                                return b
+                                            }
+                                        });
+                                        return { ...a, itemValue: arr }
+                                    } else {
+                                        return a
+                                    }
+                                });
+
+                                set_needSaveData({ ...needSaveData, userList: updatedUserList })
+
+                            },
+                        }} width={80} />
+                    } else {
+                        return <span style={{ display: 'inline-block', width: 80 }}>{_}</span>
+                    }
+                },
+            }
+        });
+        set_tableColumn([...column, ..._columns, {
+            title: '总奖金',
+            dataIndex: 'totalScore',
+        },
+        {
+            title: '状态',
+            dataIndex: 'submitName',
+            renderText(text, record, index, action) {
+                return record.submit == 1 ? text : <span style={{ color: '#FF8C19' }}>{text}</span>
+            },
+        },
+        ]);
+
+
+    }
+
+    const getTableData = async (params: any) => {
+        // console.log({ currentSelectedTreeNode });
+        // console.log({ params, sort, filter });
+
+        if (currentSelectedTreeNode && currentComputeDate) {
+            const resp = await getSecondaryDistriComputeTableData({
+                computeDate: currentComputeDate,
+                unitCode: currentSelectedTreeNode.code,
+                ...params,
+            });
+            if (resp) {
+                set_needSaveData(resp);
+                //buildTableData(resp);
+            }
+        }
+
+        return []
+    }
+
+
+
+    const confirmGenerateHandle = async () => {
+        // const resp = await generateDataRequest({
+        //     computeDate: currentComputeDate as string,
+        //     unitCode: currentSelectedTreeNode.code
+        // });
+        // if (resp) {
+        //     message.success('生成数据成功');
+        //     tableRef.current?.reload();
+        // } else {
+        //     message.success('生成数据错误!');
+        // }
+    }
+
+    const buildTableData = (resp: any, inputsRefKeys?: string[]) => {
+        const { title, userList } = resp;
+        const _columns = gennerateColumns(resp, inputsRefKeys);
+        const data = userList.map((item: any) => {
+            let total = 0;
+            let rowData: { [key: string]: any } = {};
+
+            item.itemValue.forEach((b: any) => {
+                const needTitle = title.filter((a: any) => a.code == b.code);
+                if (needTitle.length > 0) {
+                    rowData[`${needTitle[0].code}`] = b.value
+                }
+                total = total + b.value;
+            });
+
+            return { ...item, ...rowData, id: Math.random(), _columns, totalScore: Number(total.toFixed(2)) }
+        });
+
+        const compeltedTotal = data.reduce((prev: any, cur: any) => prev + cur.totalScore, 0);
+        const leftTotal = resp.totalBonus - compeltedTotal;
+        set_pageData({ ...pageData, total: resp.totalBonus.toFixed(2), completedTotal: compeltedTotal.toFixed(2), leftTotal: Number(leftTotal.toFixed(2)) });
+
+        set_dataSource(data)
+    }
+
+    const generateFunc = () => {
+
+        let msg = '生成操作会覆盖已有的数据,是否继续?';
+        Modal.confirm({
+            title: '注意',
+            okText: '确定',
+            cancelText: '取消',
+            content: msg,
+            onOk: () => confirmGenerateHandle()
+
+        });
+    }
+
+    const commitBtnhandle = () => {
+        Modal.confirm({
+            title: '注意',
+            okText: '确定',
+            cancelText: '取消',
+            content: `${commitStatus == '1' ? '取消提交' : '提交'}当前选择的核算单元的数据?`,
+            onOk: async () => {
+                const resp = await commitRequest({
+                    computeDate: currentComputeDate as string,
+                    unitCode: currentSelectedTreeNode.code,
+                    type: commitStatus == '1' ? '0' : '1',  //1 提交 0 取消
+                });
+                if (resp) {
+                    message.success('提交成功!');
+                    getTreeReqFunc(currentComputeDate as string);
+                    getCurrentCommitStatus();
+                }
+            }
+
+        })
+    }
+
+
+    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);
+    }
+
+    const saveHandle = async () => {
+
+        if (pageData.leftTotal == 0) {
+            const resp  = await save(needSaveData);
+            if(resp){
+                message.success('操作成功!');
+                set_ifEditMode(false);
+            }
+        } else {
+            Modal.confirm({
+                title: '提交时需有单元的剩余分配金额必须是0'
+            })
+        }
+    }
+
+    useEffect(() => {
+
+        if (currentComputeDate) {
+            getTreeReqFunc(currentComputeDate);
+            getCheckStatus(currentComputeDate);
+        }
+    }, [currentComputeDate]);
+
+    useEffect(() => {
+        //tableRef.current?.reload();
+
+        if (currentComputeDate && currentSelectedTreeNode) {
+            getCurrentCommitStatus();
+            getTableData({});
+        }
+    }, [currentSelectedTreeNode, currentComputeDate]);
+
+    //console.log({inputsRef,inputsRefKeys});
+
+    useEffect(() => {
+        //初始化左侧树结构数据后
+
+        if (treeData?.length > 0) {
+            if (!currentSelectedTreeNode) {
+                if (treeData[0].child && treeData[0].child.length > 0) {
+                    const [node, nodeParent] = getDeepestTreeData(treeData[0], 'child');
+
+                    set_currentSelectedTreeNode(node);
+                    setExpandedKeys([nodeParent.code]);
+                    getCurrentCommitStatus();
+                }
+            }
+        }
+    }, [treeData]);
+
+    let timer: string | number | NodeJS.Timeout | undefined;
+
+    useEffect(() => {
+        //根据输入行的值重新计算
+        clearTimeout(timer);
+        timer = setTimeout(function () {
+            if (needSaveData) {
+                buildTableData(needSaveData, inputsRefKeys);
+            }
+        }, 300); // 这里的 500 是防抖的时间,单位是毫秒
+        
+    }, [needSaveData]);
+
+    useEffect(() => {
+        if (dataSource && Object.keys(inputsRef.current).length > 0) {
+            currentInputRefKeys && inputsRef.current[currentInputRefKeys].focus();
+        }
+    }, [dataSource])
+
+
+    useEffect(() => {
+        if (auditType == '1') {
+            //当审核中时,禁掉所有操作
+            set_commitStatus('1');
+        }
+    }, [auditType]);
+
+    useEffect(() => {
+
+        let keys: string[] = [];
+
+        if (ifEditMode && needSaveData) {
+            //获取所有输入框的ref key
+            const { userList } = needSaveData;
+            userList.forEach((a: any) => {
+                a.itemValue.forEach((b: any) => {
+                    keys.push(`${a.account}-${b.code}`)
+                })
+            });
+            set_inputsRefKeys(keys);
+
+        }
+
+        if (needSaveData) {
+            if (ifEditMode) {
+                gennerateColumns(needSaveData, keys)
+            } else {
+                gennerateColumns(needSaveData)
+            }
+
+        }
+
+        if (!ifEditMode) {
+            set_currentInputRefKeys(undefined);
+            getTableData({}); //重新拉数据
+        }
+
+    }, [ifEditMode]);
+
+    useEffect(() => {
+        if (ifEditMode && Object.keys(inputsRef.current).length > 0 && inputsRefKeys.length > 0) {
+
+            // if(inputsRef.current[`${inputsRefKeys[0]}`]){
+            //     inputsRef.current[`${inputsRefKeys[0]}`].focus();
+            //     set_currentInputRefKeys(inputsRefKeys[0]);
+            // }
+            inputsRef.current[`${inputsRefKeys[0]}`].focus();
+            set_currentInputRefKeys(inputsRefKeys[0]);
+        }
+    }, [inputsRef, inputsRefKeys])
+
+    useEffect(() => {
+        set_tableColumn(column as ProColumns[]);
+        getCurrentComputeDate();
+    }, []);
+
+
+    return (
+        <div className='SecondaryDitriComputed'>
+            <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: 'space-between', alignItems: 'center', height: 32,
+                                        borderRadius: '4px',
+                                        overflow: 'hidden',
+                                        color: '#17181A',
+                                        textOverflow: 'ellipsis',
+                                        whiteSpace: 'nowrap'
+
+                                    }}>
+                                        {title}
+                                        {!nodeData.map && <span className={nodeData.unitType ? 'point lastChild' : 'point'}></span>}
+                                    </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 className='total'>可分配总额: <i>{pageData.total}</i></span>
+                                <span className='compelted'>已分配总额: <i>{pageData.completedTotal}</i></span>
+                                <span className='left'>剩余分配总额: <i>{pageData.leftTotal}</i></span>
+                            </div>
+
+                            <div className='btnGroupWrap'>
+                                <Popover open={ifShowTip} content={auditType == '1' ? '当前处于审核中,无法操作!' : '当前处于提交中,无法操作!'} >
+                                    <div className={commitStatus != '0' || auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
+                                        /**
+                                         * 当审核中,三个操作按钮都不可点击
+                                         * 当非审核中,生成和添加不可操作
+                                         */
+                                        onMouseEnter={() => auditType == '0' ? commitStatus == '1' ? set_ifShowTip(true) : set_ifShowTip(false) : set_ifShowTip(true)}
+                                        onMouseLeave={() => set_ifShowTip(false)}
+                                    >
+                                        {!ifEditMode && <span key="1" className='editBtn' onClick={commitStatus == '0' ? () => set_ifEditMode(true) : () => { }}>编辑</span>}
+                                        {ifEditMode && <span key="2" className='editBtn' onClick={commitStatus == '0' ? () => saveHandle() : () => { }}>保存</span>}
+                                        {ifEditMode && <span key="3" className='editBtn' onClick={commitStatus == '0' ? () => set_ifEditMode(false) : () => { }}>取消</span>}
+                                    </div>
+                                </Popover>
+                                <div key="4" className={auditType == '1' ? 'commit disabled' : 'commit'} onClick={() => auditType == '0' ? commitBtnhandle() : () => { }}>{commitStatus == '1' ? '取消提交' : '提交'}</div>
+                            </div>
+
+                        </div>
+                        {currentSelectedTreeNode && <BMSTable params={empFilterParams} pagination={false} actionRef={tableRef} rowKey='id' columns={[...tableColumn]} dataSource={dataSource}
+                            summary={(pageData) => {
+                                const Caculate = ({ colData }: { colData: any }) => {
+
+                                    const { dataIndex } = colData;
+
+                                    const total = pageData.reduce((prev, cur) => {
+                                        return prev + cur[`${dataIndex}`]
+                                    }, 0);
+                                    if (dataIndex != 'account' && dataIndex != 'name' && dataIndex != 'submitName') {
+                                        return (
+                                            <span>{Number(total.toFixed(2))}</span>
+                                        )
+                                    }
+                                    if (dataIndex == 'name') {
+                                        return <span>合计</span>
+                                    }
+                                    return <></>
+
+                                }
+
+
+                                return (
+                                    <Table.Summary fixed>
+                                        <Table.Summary.Row>
+                                            {
+                                                tableColumn.map((item, index) => {
+                                                    return (
+                                                        <Table.Summary.Cell key={index} index={index} align='left' rowSpan={1} >
+                                                            <Caculate colData={item} />
+                                                        </Table.Summary.Cell >
+
+                                                    )
+                                                })
+                                            }
+                                        </Table.Summary.Row>
+                                    </Table.Summary>
+                                );
+                            }}
+                        />}
+                    </div>
+                </BMSPagecontainer>
+            </div >
+        </div >
+    );
+
+};
+
+export default SecondaryDitriComputed;

+ 116 - 0
src/pages/secondaryDistribute/secondaryDitriComputed/service.ts

@@ -0,0 +1,116 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2022-12-21 11:13:51
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-05-24 17:11:52
+ * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlyInfoCheck/service.ts
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+
+
+import { request } from '@@/plugin-request';
+
+
+
+
+//获取树结构单元数据
+
+export type getTreeDataRespType = {
+    code: number,
+    name: string,
+    map:boolean,
+    parentCode:string,
+    unitType?:string,
+    child: getTreeDataRespType[]
+}
+
+export const getTreeData = (computeDate: string) => {
+
+    return request<getTreeDataRespType[]>('/performance/second/getSecondUnitList', {
+        method: 'GET',
+        params: { computeDate }
+    })
+}
+
+
+
+//获取二次分配计算
+
+export type GetSecondaryDistriComputeParams = {
+    computeDate: string; //核算年月
+    unitCode: string; //核算单元代码
+    current: number;
+    pageSize: number;
+}
+
+export const getSecondaryDistriComputeTableData = (params: GetSecondaryDistriComputeParams) => {
+
+    return request('/performance/second/getResult', {
+        method: 'GET',
+        params: { ...params }
+    })
+
+}
+
+//保存编辑后结果
+
+export const save = (data:any) => {
+    return request('/performance/second/save', {
+        method: 'POST',
+        data
+    })
+
+}
+
+
+//获取当前提交状态
+export const getCurrentCommitStatusReq = (params:{
+    computeDate:string,
+    unitCode:string
+}) => {
+
+    return request('/performance/second/getSubmitStatus', {
+        method: 'GET',
+        params: params
+    })
+
+}
+
+
+
+// //生成数据
+
+// export type GenerateDataRequestParamsType = {
+//     computeDate: string,
+//     unitCode: string,
+// }
+
+// export const generateDataRequest = (data: GenerateDataRequestParamsType) => {
+ 
+//     return request('/performance/secondSetting/generateEmployee', {
+//         method: 'POST',
+//         params:data
+//     })
+
+// }
+
+
+//提交请求
+
+export type CommitRequestParamsType = {
+    computeDate:string,
+    unitCode:string,
+    type:string
+}
+export const commitRequest = (data:CommitRequestParamsType) => {
+ 
+    return request('/performance/second/submit', {
+        method: 'POST',
+        params:data
+    })
+
+}
+
+

+ 264 - 0
src/pages/secondaryDistribute/secondaryDitriComputed/style.less

@@ -0,0 +1,264 @@
+.SecondaryDitriComputed {
+    display: flex;
+    flex-direction: row;
+    // height: 100%;
+    background: #F5F7FA;
+
+    .leftTree {
+        position: fixed;
+        top: 64px;
+        width: 220px;
+        height: calc(100vh - 80px);
+        background: #FFF;
+        border-radius: 4px;
+        padding: 16px;
+        overflow: hidden;
+        margin-right: 16px;
+        // border-right:16px solid #F5F7FA;
+
+        .searchInput {
+            border: 1px solid #CFD7E6;
+        }
+
+        .point {
+            display: block;
+            content: '';
+            width: 6px;
+            height: 6px;
+            border-radius: 50%;
+            z-index: 99;
+            background: #FF9832;
+
+            &.lastChild {
+                background: #FF1966;
+            }
+        }
+
+
+        .bms-ant-tree.bms-ant-tree-directory .bms-ant-tree-treenode-selected:hover::before,
+        .bms-ant-tree.bms-ant-tree-directory .bms-ant-tree-treenode-selected::before {
+            border-radius: 4px;
+            background: rgb(240 242 245 / 100%);
+        }
+
+        .bms-ant-tree.bms-ant-tree-directory .bms-ant-tree-treenode .bms-ant-tree-node-content-wrapper.bms-ant-tree-node-selected {
+            font-weight: bold;
+        }
+    }
+
+    .rightContent {
+        position: relative;
+        border-radius: 4px;
+        width: calc(100% - 220px);
+        padding: 16px;
+        margin-left: 236px;
+        background: #FFF;
+
+        .checkBtn {
+            position: absolute;
+            cursor: pointer;
+            top: 0;
+            right: 0;
+            padding: 0 14px;
+            height: 24px;
+            line-height: 24px;
+            background: #3376FE;
+            border-radius: 4px;
+            text-align: center;
+            font-size: 14px;
+            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+            font-weight: 400;
+            color: #FFF;
+        }
+
+        .midLine {
+            display: flex;
+            flex-direction: row;
+            justify-content: center;
+            align-items: center;
+            height: 24px;
+            line-height: 24px;
+            background: #F0FCFC;
+            font-size: 12px;
+            color: #515866;
+            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+            font-weight: 400;
+            margin-top: 12px;
+            margin-bottom: 15px;
+
+            &>span {
+                cursor: pointer;
+                font-size: 12px;
+                font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+                font-weight: 500;
+                color: #00B3B3;
+                padding-right: 4px;
+            }
+
+        }
+
+        .bms-ant-tabs-nav {
+            &::before {
+                border-bottom: none !important;
+            }
+        }
+
+        .tabContent {
+            display: flex;
+            flex-direction: column;
+
+            .tableToolbar {
+                display: flex;
+                flex-direction: row;
+                justify-content: space-between;
+                align-items: center;
+                margin-top: 16px;
+                margin-bottom: 16px;
+
+                .search {
+                    display: flex;
+                    flex-direction: row;
+                    justify-content: flex-start;
+                    align-items: center;
+
+                    span {
+                        font-size: 14px;
+                        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+                        font-weight: 400;
+                        color: #17181A;
+                        margin-right: 24px;
+
+                        &.total {
+                            i {
+                                font-style: normal;
+                                font-size: 14px;
+                                font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+                                font-weight: 500;
+                                color: #17181A;
+                            }
+                        }
+                        &.compelted {
+                            i {
+                                font-style: normal;
+                                font-size: 14px;
+                                font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+                                font-weight: 500;
+                                color: #2E6BE6;
+                            }
+                            &::before {
+                                position: relative;
+                                top:2px;
+                                display: inline-block;
+                                content: '';
+                                width: 12px;
+                                height: 12px;
+                                margin-right: 4px;
+                                background: url('../../../../static//bingzhuantu.png');
+                                background-size:cover;
+                        
+                            }
+                        }
+                        &.left {
+                            i {
+                                font-style: normal;
+                                font-size: 14px;
+                                font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+                                font-weight: 500;
+                                color: #14CC8F;
+                            }
+                            &::before {
+                                position: relative;
+                                top:2px;
+                                display: inline-block;
+                                content: '';
+                                width: 12px;
+                                height: 12px;
+                                margin-right: 4px;
+                                background: url('../../../../static/bingzhuantu_green.png');
+                                background-size:cover;
+                        
+                            }
+                        }
+
+                        &:last-child {
+                            margin-right: 0;
+                        }
+                    }
+                }
+
+                .btnGroupWrap {
+                    display: flex;
+                    flex-direction: row;
+                    align-items: center;
+
+                    .btnGroup {
+                        &>span {
+                            display: inline-block;
+                            text-align: center;
+                            width: 56px;
+                            height: 24px;
+                            line-height: 22px;
+                            border-radius: 4px;
+                            cursor: pointer;
+                            margin-right: 8px;
+
+                            &.editBtn {
+                                color:white;
+                                background: #3377FF;
+                            }
+
+                            &:last-child {
+                                margin-right: 0;
+                            }
+                        }
+
+                        &.disabled {
+                            &>span {
+                                cursor: not-allowed;
+                                &.editBtn {
+                                    color: rgb(0 0 0 / 50%);
+                                    background-color: #f0f2f5;
+                                }
+                            }
+                        }
+                    }
+
+                    .commit {
+                        display: inline-block;
+                        text-align: center;
+                        padding: 0 14px;
+                        height: 24px;
+                        line-height: 23px;
+                        background: #3377FF;
+                        border-radius: 4px;
+                        cursor: pointer;
+                        font-size: 14px;
+                        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+                        font-weight: 400;
+                        margin-left: 8px;
+                        color: #FFF;
+
+                        &.disabled {
+                            cursor: not-allowed;
+                            color: rgb(0 0 0 / 50%);
+                            background-color: #f0f2f5;
+                        }
+                    }
+                }
+
+            }
+            .BMSTable {
+                .bms-ant-table-content {
+                    table {
+                        .bms-ant-table-summary {
+                            &>tr>td {
+                                padding: 13px 16px !important;
+                                border-top: 1px solid #dae2f2 !important;
+                            }
+                        } 
+                    }
+                }
+            }
+        }
+    }
+}

+ 2 - 2
src/pages/setting/checkUnitSet/checkUnitDepMap/service.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-21 11:13:51
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-04-24 10:20:21
+ * @LastEditTime: 2023-05-22 15:10:44
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlyInfoCheck/service.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -63,7 +63,7 @@ export const getCheckUnitDepMapTableDataByUnitClass = (params?:{
     current:number,
     pageSize:number,
     unitCode:string,
-    deptName:string
+    deptName?:string
 }) => {
     return request<{list:CheckUnitDepMapTableDataType[]}&pagesDataType>('/performance/unit/getUnitDeptMap', {
         method: 'GET',

+ 41 - 19
src/pages/setting/projectSetting/checkUnitProjectSet/index.tsx

@@ -4,7 +4,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-16 09:42:52
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-19 11:06:04
+ * @LastEditTime: 2023-05-22 14:59:07
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -83,6 +83,8 @@ const CheckUnitProjectSet: React.FC = () => {
 
     const ref = React.createRef<{ save: any; getSelectedKeys: any }>();
 
+    const [currentEditCoreFlag,set_currentEditCoreFlag] = useState(0);
+
 
 
     const tableRef = useRef<ActionType>();
@@ -95,18 +97,22 @@ const CheckUnitProjectSet: React.FC = () => {
             renderText(text, record, index, action) {
                 return <span style={{ display: 'inline-block', height: '26px', lineHeight: '26px' }}>{text}</span>
             },
+            ellipsis:true
         },
         {
             title: '项目名称',
             dataIndex: 'itemName',
+            ellipsis:true
         },
         {
             title: '项目类别',
             dataIndex: 'itemType',
+            ellipsis:true
         },
         {
             title: '点值',
             width: 120,
+            ellipsis:true,
             dataIndex: 'orderPointValue',
             renderText:(text, record, index, action)=>{
                 if (ifEdit && currentEditRow?.id == record.id) {
@@ -126,16 +132,17 @@ const CheckUnitProjectSet: React.FC = () => {
         {
             title: '类型',
             width: 120,
+            ellipsis:true,
             dataIndex: 'coreFlagName',
             renderText:(text, record, index, action)=>{
                 if (ifEdit && currentEditRow && currentEditRow?.id == record.id) {
-                    return <Select defaultValue={record.coreFlag} options={
+                    return <Select defaultValue={record.coreFlag} style={{width:'100%'}} options={
                         [
-                            { label: '核心', value: 1 }, { label: '非核心', value: 0 }
+                            { label: '核心', value: 1 }, { label: '非核心', value: 0 },{ label: '不计', value:2 }
                         ]
-                    } onChange={(a, b) => { set_currentEditRow({ ...currentEditRow, coreFlag: a }) }} />
+                    } onChange={(a, b) => { set_currentEditCoreFlag(a)}} />
                 } else {
-                    return <span style={{ display: 'inline-block', width: 80 }}>{text}</span>
+                    return <span style={{ display: 'inline-block', width:120}}>{text}</span>
                 }
             },
         }
@@ -145,25 +152,30 @@ const CheckUnitProjectSet: React.FC = () => {
         {
             title: '项目代码',
             dataIndex: 'indicatorCode',
+            ellipsis:true,
             renderText(text, record, index, action) {
                 return <span style={{ display: 'inline-block', height: '26px', lineHeight: '26px' }}>{text}</span>
             },
         },
         {
             title: '项目名称',
+            ellipsis:true,
             dataIndex: 'indicatorName',
         },
         {
             title: '类型',
+            ellipsis:true,
             dataIndex: 'indicatorTypeName',
         },
         {
             title: '定义',
+            ellipsis:true,
             dataIndex: 'indicatorDefinition',
         },
         {
             title: '点值',
             width: 120,
+            ellipsis:true,
             dataIndex: 'orderPointValue',
             renderText(text, record, index, action) {
                 if (ifEdit && currentEditRow?.id == record.id) {
@@ -184,6 +196,7 @@ const CheckUnitProjectSet: React.FC = () => {
     const nonCheckTableColumn: ProColumns[] = [
         {
             title: '项目名称',
+            ellipsis:true,
             dataIndex: 'nonAssessmentName',
             renderText(text, record, index, action) {
                 return <span style={{ display: 'inline-block', height: '26px', lineHeight: '26px' }}>{text}</span>
@@ -191,14 +204,17 @@ const CheckUnitProjectSet: React.FC = () => {
         },
         {
             title: '分配方式',
+            ellipsis:true,
             dataIndex: 'distributionTypeName',
         },
         {
             title: '分配对象',
+            ellipsis:true,
             dataIndex: 'distributionTargetName',
         },
         {
             title: '上限值',
+            ellipsis:true,
             dataIndex: 'ceiling',
         },
         {
@@ -224,10 +240,10 @@ const CheckUnitProjectSet: React.FC = () => {
 
 
 
-    const onSelect: TreeProps['onSelect'] = (selectedKeys, info) => {
+    const onSelect: TreeProps['onSelect'] = (selectedKeys, info:any) => {
         // console.log('selected', selectedKeys, info);
-        const { node } = info;
-        set_currentSelectedTreeNode(node);
+        const { node} = info;
+        if(!node.child)set_currentSelectedTreeNode(node);
     };
 
 
@@ -358,6 +374,7 @@ const CheckUnitProjectSet: React.FC = () => {
             title: '添加',
             icon: <></>,
             width: 800,
+            centered:true,
             okText: '确定',
             cancelText: '取消',
             content: <TableTransfer
@@ -470,6 +487,7 @@ const CheckUnitProjectSet: React.FC = () => {
         const [datasource, set_datasource] = useState<any[]>([]);
         const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
         const [targetData,set_targetData] = useState<any[]>([]);
+        const [loading,set_loading] = useState(true);
 
 
         //获取单元
@@ -487,7 +505,7 @@ const CheckUnitProjectSet: React.FC = () => {
                     if (resp1) {
                         let allData = resp;
                         set_targetData(resp1.list);
-                        const defaultSelctedkeys = (resp1.list).map(a => a.itemPointCode);
+                        const defaultSelctedkeys = (resp1.list).map((a:any) => a.itemPointCode);
                         set_datasource(allData);
                         setTargetKeys(defaultSelctedkeys);
                     }
@@ -530,6 +548,8 @@ const CheckUnitProjectSet: React.FC = () => {
                 }
             }
 
+            set_loading(false);
+
         }
 
         const onChange = (nextTargetKeys: string[]) => {
@@ -650,7 +670,8 @@ const CheckUnitProjectSet: React.FC = () => {
                     itemsUnit: '项',
                     searchPlaceholder: '请输入',
                 }}
-                oneWay={true}
+                // oneWay={true}
+            
                 onChange={onChange}
                 onSelectChange={onSelectChange}
                 dataSource={datasource}
@@ -695,6 +716,7 @@ const CheckUnitProjectSet: React.FC = () => {
                             columns={columns as TransferItem[]}
                             dataSource={filteredItems}
                             size="small"
+                            loading={loading}
                             bordered={false}
                             rowKey={'code'}
                             pagination={{ showTitle: false, pageSize: 10, showLessItems: false, simple: true }}
@@ -734,7 +756,7 @@ const CheckUnitProjectSet: React.FC = () => {
                     id: currentEditRow.id,
                     unitCode: currentSelectedTreeNode.code,
                     orderPointValue: `${currentEditRow.orderPointValue}`,
-                    coreFlag: currentEditRow.coreFlag
+                    coreFlag:currentEditCoreFlag
                 }
                 const resp = await editBillingItemData(result);
                 if (resp) flag = true;
@@ -885,7 +907,7 @@ const CheckUnitProjectSet: React.FC = () => {
     return (
         <div className='CheckUnitProjectSet'>
 
-            <ModalForm title={'添加医疗组人员信息'} width={400} submitter={{
+            <ModalForm title={'复制'} width={400} submitter={{
                 render: (props, defaultDoms) => []
             }} open={ifShowModal} modalProps={{
                 closable: false,
@@ -1026,10 +1048,10 @@ const CheckUnitProjectSet: React.FC = () => {
                                                 editBtnHandle();
                                             }
 
-                                        }}>{ifEdit ? '保存' : '编辑'}</a>,
-                                        <Fragment key={'cancel'}>{ifEdit && <a onClick={() => set_ifEdit(false)}>取消</a>}</Fragment>,
+                                        }}>{(ifEdit&&currentEditRow?.id == record.id )? '保存' : '编辑'}</a>,
+                                        <Fragment key={'cancel'}>{(ifEdit&&currentEditRow?.id == record.id ) && <a onClick={() => set_ifEdit(false)}>取消</a>}</Fragment>,
                                         <Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delHandle(record)}>
-                                            {!ifEdit && <a key={'del'}>删除</a>}
+                                            {(currentEditRow?.id != record.id || !ifEdit) && <a key={'del'}>删除</a>}
                                         </Popconfirm>
                                     ],
                                 }]} request={(params, sort, filter) => getTableData('BILL', params, sort, filter)} />}
@@ -1077,10 +1099,10 @@ const CheckUnitProjectSet: React.FC = () => {
                                                 editBtnHandle();
                                             }
 
-                                        }}>{ifEdit ? '保存' : '编辑'}</a>,
-                                        <Fragment key={'cancel'}>{ifEdit && <a onClick={() => set_ifEdit(false)}>取消</a>}</Fragment>,
+                                        }}>{(ifEdit&&currentEditRow?.id == record.id ) ? '保存' : '编辑'}</a>,
+                                        <Fragment key={'cancel'}>{(ifEdit&&currentEditRow?.id == record.id ) && <a onClick={() => set_ifEdit(false)}>取消</a>}</Fragment>,
                                         <Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delHandle(record)}>
-                                            {!ifEdit && <a key={'del'}>删除</a>}
+                                            {(currentEditRow?.id != record.id || !ifEdit) && <a key={'del'}>删除</a>}
                                         </Popconfirm>
                                     ],
                                 }]} request={(params, sort, filter) => getTableData('INDIC', params, sort, filter)} />}
@@ -1118,7 +1140,7 @@ const CheckUnitProjectSet: React.FC = () => {
                                     valueType: 'option',
                                     render: (text, record: any) => [
                                         <Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delHandle(record)}>
-                                            {!ifEdit && <a key={'del'}>删除</a>}
+                                            { <a key={'del'}>删除</a>}
                                         </Popconfirm>
                                     ],
                                 }]} request={(params, sort, filter) => getTableData('NONCHECK', params, sort, filter)} />}

+ 4 - 2
src/pages/setting/projectSetting/costIncomeProjectSet/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-18 17:56:28
+ * @LastEditTime: 2023-05-19 14:17:26
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -494,7 +494,9 @@ export default function CostIncomeProjectSet() {
                 </div>
             </div>
             <div style={{ marginTop: 16 }}>
-                <BMSTable columns={columns as ProColumns[]} pagination={currentSelectedTabKey == '2'&&false} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                {currentSelectedTabKey == '2'?(<BMSTable columns={columns as ProColumns[]} pagination={false}  actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />):(
+                    <BMSTable columns={columns as ProColumns[]}  actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                )}
             </div>
         </BMSPagecontainer>
     )

+ 2 - 2
src/pages/setting/projectSetting/indicProjectMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-17 14:22:00
+ * @LastEditTime: 2023-05-24 17:16:20
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -159,7 +159,7 @@ export default function BilingProjectMana() {
 
         return (
             <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}收费项目`}
+                title={`${type == 'EDIT' ? '编辑' : '新增'}指标项目`}
                 width={352}
                 initialValues={type == 'EDIT' ? { ...record,itemType:{label:record.itemType,value:record.itemTypeCode} } : {coreFlag:1}}
                 trigger={

BIN
static/bingzhuantu.png


BIN
static/bingzhuantu_green.png