code4eat 8 месяцев назад
Родитель
Сommit
1bf7d52d81
100 измененных файлов с 513 добавлено и 20411 удалено
  1. 47 3
      .umirc.ts
  2. BIN
      src/.DS_Store
  3. 26 31
      src/app.tsx
  4. 221 243
      src/components/KCIMLeftList/index.tsx
  5. 33 7
      src/components/KCIMLeftList/style.less
  6. 33 35
      src/components/KCIMTable/style.less
  7. 6 2
      src/constant.ts
  8. 147 147
      src/global.less
  9. 0 261
      src/pages/baseInfoMana/checkGroupMana/index.tsx
  10. 0 96
      src/pages/baseInfoMana/checkGroupMana/service.ts
  11. 0 43
      src/pages/baseInfoMana/checkGroupMana/style.less
  12. 0 120
      src/pages/baseInfoMana/checkGroupMana/tableSelector.tsx
  13. 0 319
      src/pages/baseInfoMana/empMana/index.tsx
  14. 0 106
      src/pages/baseInfoMana/empMana/service.ts
  15. 0 80
      src/pages/baseInfoMana/empMana/style.less
  16. 0 250
      src/pages/baseInfoMana/empMana/tableSelector.tsx
  17. 0 134
      src/pages/baseInfoMana/empMana/transform.tsx
  18. 0 270
      src/pages/baseInfoMana/unitMana/index.tsx
  19. 0 62
      src/pages/baseInfoMana/unitMana/service.ts
  20. 0 78
      src/pages/baseInfoMana/unitMana/style.less
  21. 0 198
      src/pages/baseInfoMana/unitMana/tableSelector.tsx
  22. 0 481
      src/pages/baseSetting/accountingAccountSet/accountingSubMana/index.tsx
  23. 0 42
      src/pages/baseSetting/accountingAccountSet/accountingSubMana/style.less
  24. 0 310
      src/pages/baseSetting/accountingAccountSet/accountingSubMap/index.tsx
  25. 0 54
      src/pages/baseSetting/accountingAccountSet/accountingSubMap/service.ts
  26. 0 42
      src/pages/baseSetting/accountingAccountSet/accountingSubMap/style.less
  27. 0 451
      src/pages/baseSetting/accountingAccountSet/chargeItemMap/index.tsx
  28. 0 76
      src/pages/baseSetting/accountingAccountSet/chargeItemMap/service.ts
  29. 0 260
      src/pages/baseSetting/accountingAccountSet/chargeItemMap/style.less
  30. 0 201
      src/pages/baseSetting/accountingAccountSet/chargeItemMap/tableSelector.tsx
  31. 0 292
      src/pages/baseSetting/accountingAccountSet/costIncomeProjectMana/index.tsx
  32. 0 80
      src/pages/baseSetting/accountingAccountSet/costIncomeProjectMana/service.ts
  33. 0 310
      src/pages/baseSetting/costAllocationSet/allocationLevelSet/index.tsx
  34. 0 75
      src/pages/baseSetting/costAllocationSet/allocationLevelSet/service.ts
  35. 0 42
      src/pages/baseSetting/costAllocationSet/allocationLevelSet/style.less
  36. 0 200
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/editTableModal.tsx
  37. 0 446
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/index.tsx
  38. 0 135
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/service.ts
  39. 0 90
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/style.less
  40. 0 186
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/tableSelector.tsx
  41. 0 441
      src/pages/baseSetting/costAllocationSet/costAllocationParamsDeal/index.tsx
  42. 0 92
      src/pages/baseSetting/costAllocationSet/costAllocationParamsDeal/service.ts
  43. 0 65
      src/pages/baseSetting/costAllocationSet/costAllocationParamsDeal/style.less
  44. 0 330
      src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/index.tsx
  45. 0 87
      src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/service.ts
  46. 0 42
      src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/style.less
  47. 0 281
      src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/transform.tsx
  48. 0 416
      src/pages/baseSetting/costAllocationSet/idleCostSetting/index.tsx
  49. 0 104
      src/pages/baseSetting/costAllocationSet/idleCostSetting/service.ts
  50. 0 42
      src/pages/baseSetting/costAllocationSet/idleCostSetting/style.less
  51. 0 371
      src/pages/baseSetting/costAllocationSet/revenueImputationSet/index.tsx
  52. 0 92
      src/pages/baseSetting/costAllocationSet/revenueImputationSet/service.ts
  53. 0 35
      src/pages/baseSetting/costAllocationSet/revenueImputationSet/style.less
  54. 0 155
      src/pages/baseSetting/costAllocationSet/revenueImputationSet/transform.tsx
  55. 0 820
      src/pages/baseSetting/otherItemSet/departmentCostCalc/index.tsx
  56. 0 130
      src/pages/baseSetting/otherItemSet/departmentCostCalc/service.ts
  57. 0 168
      src/pages/baseSetting/otherItemSet/departmentCostCalc/style.less
  58. 0 301
      src/pages/baseSetting/otherItemSet/departmentCostCalc/transform.tsx
  59. 0 430
      src/pages/baseSetting/otherItemSet/diySqlMana/index.tsx
  60. 0 109
      src/pages/baseSetting/otherItemSet/diySqlMana/service.ts
  61. 0 95
      src/pages/baseSetting/otherItemSet/diySqlMana/style.less
  62. 0 619
      src/pages/baseSetting/otherItemSet/reportItemSet/index.tsx
  63. 0 103
      src/pages/baseSetting/otherItemSet/reportItemSet/service.ts
  64. 0 68
      src/pages/baseSetting/otherItemSet/reportItemSet/style.less
  65. 0 302
      src/pages/baseSetting/otherItemSet/reportItemSet/transform.tsx
  66. 0 316
      src/pages/baseSetting/otherItemSet/reportProjectSetting/index.tsx
  67. 0 69
      src/pages/baseSetting/otherItemSet/reportProjectSetting/service.js
  68. 0 92
      src/pages/baseSetting/otherItemSet/reportProjectSetting/style.less
  69. 0 76
      src/pages/baseSetting/otherItemSet/visitsAndBedDayCostSetting/service.ts
  70. 0 42
      src/pages/baseSetting/otherItemSet/visitsAndBedDayCostSetting/style.less
  71. 0 208
      src/pages/baseSetting/otherItemSet/wholeHospCostAndIncomeSet/index.tsx
  72. 0 73
      src/pages/baseSetting/otherItemSet/wholeHospCostAndIncomeSet/service.ts
  73. 0 34
      src/pages/baseSetting/otherItemSet/wholeHospCostAndIncomeSet/style.less
  74. 0 566
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenter/index.tsx
  75. 0 97
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenter/service.ts
  76. 0 56
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenter/style.less
  77. 0 235
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenterConnect/index.tsx
  78. 0 39
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenterConnect/service.ts
  79. 0 56
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenterConnect/style.less
  80. 0 1069
      src/pages/costAccounting/calcPageTemplate/columns.tsx
  81. 0 408
      src/pages/costAccounting/calcPageTemplate/config.ts
  82. 0 942
      src/pages/costAccounting/calcPageTemplate/index.tsx
  83. 0 401
      src/pages/costAccounting/calcPageTemplate/service.ts
  84. 0 93
      src/pages/costAccounting/calcPageTemplate/style.less
  85. 0 369
      src/pages/costLibraryManagement/basicCostManagement/drugCostManagement/index.tsx
  86. 0 110
      src/pages/costLibraryManagement/basicCostManagement/drugCostManagement/service.ts
  87. 0 55
      src/pages/costLibraryManagement/basicCostManagement/drugCostManagement/style.less
  88. 0 366
      src/pages/costLibraryManagement/basicCostManagement/equipmentCostManagement/index.tsx
  89. 0 102
      src/pages/costLibraryManagement/basicCostManagement/equipmentCostManagement/service.ts
  90. 0 55
      src/pages/costLibraryManagement/basicCostManagement/equipmentCostManagement/style.less
  91. 0 403
      src/pages/costLibraryManagement/basicCostManagement/materialCostManagement/index.tsx
  92. 0 102
      src/pages/costLibraryManagement/basicCostManagement/materialCostManagement/service.ts
  93. 0 55
      src/pages/costLibraryManagement/basicCostManagement/materialCostManagement/style.less
  94. 0 590
      src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/index.tsx
  95. 0 148
      src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/service.ts
  96. 0 254
      src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/style.less
  97. 0 183
      src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/tableSelector.tsx
  98. 0 395
      src/pages/costLibraryManagement/basicCostManagement/spaceCostManagement/index.tsx
  99. 0 55
      src/pages/costLibraryManagement/basicCostManagement/spaceCostManagement/style.less
  100. 0 341
      src/pages/costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison/index.tsx

+ 47 - 3
.umirc.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-08-02 11:28:57
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-11-18 16:40:00
+ * @LastEditTime: 2024-12-03 15:44:40
  * @FilePath: /MediResourceManaSys/.umirc.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -18,6 +18,7 @@ const path = require('path');
 
 
 export default defineConfig({
+  hash:true,
   antd: {
     configProvider: {
       prefixCls: 'mrms-ant',
@@ -63,7 +64,7 @@ export default defineConfig({
   manifest: {
     basePath: '/',
   },
-  publicPath: REACT_APP_ENV == 'dev' ? '/' : '/qualification/',
+  publicPath: REACT_APP_ENV == 'dev' ? '/' : '/medical/',
   proxy: {
     '/gateway': {
       target: 'http://120.27.235.181:5000/gateway',//开发
@@ -78,7 +79,6 @@ export default defineConfig({
       path: '/',
       redirect: '/home',
     },
-    { path: '*', component: '@/pages/404' },
     {
       path: '/noAccess',
       component: './noAccess',
@@ -87,6 +87,50 @@ export default defineConfig({
       path: '/home',
       component: './Home/index',
     },
+    {
+      path:'/personalCenter',
+      name:'个人中心',
+      routes:[
+        // {
+        //   name:'我的资质',
+        //   path: '/personalCenter/qualificationClassfiMana',
+        //   component: './qualificationMana/qualificationClassfiMana/index',
+        // },
+        {
+          name:'我的申请',
+          path: '/personalCenter/myApplication',
+          component: './personalCenter/myApplication/index',
+        },
+      ]
+    },
+    {
+      path:'/qualificationMana',
+      name:'资质管理',
+      routes:[
+        {
+          name:'资质授权',
+          path: '/qualificationMana/qualificationAuth',
+          component: './qualificationMana/qualificationAuth/index',
+        },
+        {
+          name:'资质分类管理',
+          path: '/qualificationMana/qualificationClassfiMana',
+          component: './qualificationMana/qualificationClassfiMana/index',
+        },
+        {
+          name:'资质字典管理',
+          path: '/qualificationMana/qualifiDicMana',
+          component: './qualificationMana/qualifiDicMana/index',
+        },
+        {
+          name:'资质审批',
+          path: '/qualificationMana/qualificationApproval/:type',
+          component: './qualificationMana/qualificationApproval/index',
+        },
+      ]
+    },
+    { path: '*', component: '@/pages/404' },
+    
  
 
    


+ 26 - 31
src/app.tsx

@@ -145,15 +145,15 @@ export async function getInitialState(): Promise<{
   // 默认的计算日期
   let computeDate = `${new Date().getFullYear()}-${(new Date().getMonth() + 1).toString().padStart(2, '0')}`;
 
-  try {
-    // 获取最新计算日期的请求
-    const resp = await getLastComputeDate();
-    if (resp) {
-      computeDate = resp; // 更新计算日期
-    }
-  } catch (error) {
-    console.error('获取计算日期失败:', error); // 捕获和处理错误
-  }
+  // try {
+  //   // 获取最新计算日期的请求
+  //   const resp = await getLastComputeDate();
+  //   if (resp) {
+  //     computeDate = resp; // 更新计算日期
+  //   }
+  // } catch (error) {
+  //   console.error('获取计算日期失败:', error); // 捕获和处理错误
+  // }
 
   // 返回状态
   return {
@@ -216,17 +216,24 @@ export const request: RequestConfig = {
   responseInterceptors: [
     (response: AxiosResponse) => {
       // 拦截响应数据,进行个性化处理
-      const { status, data: { status: code, errorMessage, msg }, config: { method } } = response;
+      const { status, data: { status: code, errorMessage, msg,errorCode }, config: { method } } = response;
 
       try {
 
         if (status == 200) {
           // 网络请求成功
-          if (errorMessage && errorMessage.indexOf('Token') != -1) {
-            console.log({ response, errorMessage });
-            localStorage.removeItem('tokenExpired');
-
-            return false;
+          if (errorCode == 401) {
+            Modal.confirm({
+              title: '抱歉,你的登录已过期,请重新登录!',
+              okText: '确定',
+              cancelText: '取消',
+              maskClosable: false,
+              // cancelButtonProps:
+              onOk: () => {
+                localStorage.removeItem('tokenExpired');
+              },
+            });
+            return false
           }
 
 
@@ -310,7 +317,7 @@ const mappingIcon = (menuData: menuDataItemType[]) => {
   }
   const mappingMenu: menuDataItemType[] = menuData.map(item => ({
     ...item,
-    icon: item.icon && iconEnum[item.icon],
+    icon: item.icon && iconEnum[item.icon as keyof typeof iconEnum],
     children: item.children ? mappingIcon(item.children) : [],
   }));
   return mappingMenu;
@@ -516,25 +523,13 @@ export const layout = ({ initialState, setInitialState }: { initialState: any, s
                 if (node.path == '/home') {
                   node.icon = <Icon component={imgNode} />;
                 }
-                if (node.path == '/baseSetting') {
+                if (node.path == '/qualificationMana') {
 
                   node.icon = <Icon component={setting} />;
                 }
-                if (node.path == '/monthlyInfoSearch') {
+                if (node.path == '/personalCenter') {
                   node.icon = <Icon component={() => <IconFont type='icon-yueduxinxicaiji' />} />;
                 }
-                if (node.path == '/costAccounting') {
-                  node.icon = <Icon component={() => <IconFont type='icon-jixiaoguanli' />} />;
-                }
-                if (node.path == '/reportExport') {
-                  node.icon = <Icon component={() => <IconFont type='icon-jixiaoguanli' />} />;
-                }
-                if (node.path == '/costLibraryManagement') {
-                  node.icon = <Icon component={() => <IconFont type='icon-chengbenkuguanli' />} />;
-                }
-                if (node.path == '/static') {
-                  node.icon = <Icon component={() => <IconFont type='icon-baobiaochaxun' />} />;
-                }
               }
               if (node.children) {
                 node.children.forEach((child: any) => addIconToPath(child, paths));
@@ -542,7 +537,7 @@ export const layout = ({ initialState, setInitialState }: { initialState: any, s
             }
 
             _menu.forEach((item: any) => {
-              addIconToPath(item, ['/home', '/baseInfoMana', '/costAccounting', '/monthlyInfoSearch', '/static', '/reportExport', '/costLibraryManagement', '/baseSetting']);
+              addIconToPath(item, ['/home', '/qualificationMana', '/personalCenter']);
             });
 
             const { newTree, firstLeafNode, firstLeafNodePath } = transformTree(_menu);

+ 221 - 243
src/components/KCIMLeftList/index.tsx

@@ -1,272 +1,250 @@
-
-
 import { createFromIconfontCN } from '@ant-design/icons';
-import Dropdown from '@ant-design/pro-table/es/components/Dropdown';
-import { Input, Tooltip, TreeProps, Empty } from 'antd'
+import { Input, Tooltip, TreeProps, Empty } from 'antd';
 import { Key, useEffect, useState } from 'react';
 import DirectoryTree from 'antd/es/tree/DirectoryTree';
 import { DataNode } from 'antd/es/tree';
 
 import './style.less';
 
-
-import expandedIcon from '../../../static/treenode_open.png';
-import closeIcon from '../../../static/treenode_collapse.png';
-
-
 const IconFont = createFromIconfontCN({
-    scriptUrl: '',
+  scriptUrl: '',
 });
 
-
 interface ListItem {
-    name: string,
-    subText: string,
-    [key: string]: any
+  name: string;
+  subText: string;
+  [key: string]: any;
 }
 
 interface TreeNodeItem {
-    [key: string]: any
+  [key: string]: any;
 }
 
 export interface KCIMLeftListProps {
-    dataSource?: any[],
-    searchKey: string,
-    placeholder?: string,
-    listType?: 'list' | 'tree',
-    icon?: string,
-    contentH?: number|string,
-    rowKey?: string,
-    fieldNames?: { title?: string, key?: string, children?: string },
-    onChange?: (selectedItem: ListItem) => void
+  dataSource: any[];
+  searchKey: string;
+  placeholder?: string;
+  listType?: 'list' | 'tree';
+  icon?: string;
+  contentH?: number | string;
+  rowKey?: string;
+  fieldNames?: { title?: string; key?: string; children?: string };
+  defaultSelectType?: 'leaf' | 'node'; // 新增属性
+  onChange?: (selectedItem: ListItem) => void;
 }
 
-
-function searchTreeAndKeepHierarchy(tree: any[], keyword: string, searchKey: string, children: string) {
-    function search(node: any) {
-        // 深度复制节点,避免修改原始树
-        let newNode = { ...node };
-        if (node[`${searchKey}`].includes(keyword)) {
-            // 如果节点名称包含关键字,返回整个节点及其子节点
-            return newNode;
-        } else if (node[`${children}`] && node[`${children}`].length > 0) {
-            // 如果当前节点不匹配但有子节点,递归搜索子节点
-            let filteredChildren = node[`${children}`].map(search).filter((child: any) => child !== null); // 递归并过滤掉null
-            if (filteredChildren.length > 0) {
-                // 如果有子节点匹配,只返回匹配的子节点
-                newNode[`${children}`] = filteredChildren;
-                return newNode;
-            }
-        }
-        // 如果节点和其子节点都不匹配,返回null
-        return null;
+function searchTreeAndKeepHierarchy(
+  tree: any[],
+  keyword: string,
+  searchKey: string,
+  children: string,
+) {
+  function search(node: any) {
+    let newNode = { ...node };
+    if (node[`${searchKey}`].includes(keyword)) {
+      return newNode;
+    } else if (node[`${children}`] && node[`${children}`].length > 0) {
+      let filteredChildren = node[`${children}`]
+        .map(search)
+        .filter((child: any) => child !== null);
+      if (filteredChildren.length > 0) {
+        newNode[`${children}`] = filteredChildren;
+        return newNode;
+      }
     }
-
-    // 对树的每个根节点进行搜索,并过滤掉不匹配的节点
-    return tree.map(search).filter(node => node !== null);
+    return null;
+  }
+  return tree.map(search).filter((node) => node !== null);
 }
 
-
-
 const findFirstLeafNodeWithParents: any = (node: any, children: string) => {
-    // 定义一个内部递归函数来处理节点和跟踪父节点
-    const findNode: any = (currentNode: any, parents: any[]) => {
-        // 打印当前节点信息,用于调试
-        // console.log({ currentNode });
-
-        // 检查当前节点是否为叶子节点(无子节点或子节点为空数组)
-        if (!currentNode[children] || currentNode[children].length === 0) {
-            return { leafNode: currentNode, parents };
-        }
-
-        // 添加当前节点到父节点列表
-        parents.push(currentNode);
-
-        // 递归查找第一个子节点的第一个叶子节点
-        return findNode(currentNode[children][0], parents);
-    };
-
-    // 调用内部函数,初始父节点列表为空
-    return findNode(node, []);
-}
-
-
-
-
+  const findNode: any = (currentNode: any, parents: any[]) => {
+    if (!currentNode[children] || currentNode[children].length === 0) {
+      return { leafNode: currentNode, parents };
+    }
+    parents.push(currentNode);
+    return findNode(currentNode[children][0], parents);
+  };
+  return findNode(node, []);
+};
 
 export const KCIMLeftList = (props: KCIMLeftListProps) => {
-
-    const { searchKey, placeholder = '请输入', onChange, listType = 'list', dataSource: data = [], icon, contentH = 500, rowKey = 'id', fieldNames = { title: 'title', key: 'key', children: 'children' } } = props;
-    
-    const [dataSource, set_dataSource] = useState<ListItem[] | TreeNodeItem[]>([]);
-    const [showList, set_showList] = useState<ListItem[] | TreeNodeItem[]>([]);
-    const [currentSelected, set_currentSelected] = useState<undefined | any>(undefined);
-    const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([]);
-    const [autoExpandParent, setAutoExpandParent] = useState(true);
-    const [defaultSelectedKeys, set_defaultSelectedKeys] = useState<Key[]>([]);
-
-
-
-
-    const onSelect: TreeProps['onSelect'] = (selectedKeys, info) => {
-        // console.log('selected', selectedKeys, info);
-        const { node } = info;
-        if (!node[fieldNames.children as keyof typeof node] || (node[fieldNames.children as keyof typeof node] as any[]).length === 0) {
-            set_currentSelected(node);
-        }
-        
-    };
-
-    const onExpand = (newExpandedKeys: React.Key[]) => {
-        setExpandedKeys(newExpandedKeys);
-        setAutoExpandParent(false);
+  const {
+    searchKey,
+    placeholder = '请输入',
+    onChange,
+    listType = 'list',
+    dataSource: data = [],
+    icon,
+    contentH = 500,
+    rowKey = 'id',
+    fieldNames = { title: 'title', key: 'key', children: 'children' },
+    defaultSelectType = 'leaf', // 新增属性,默认选中叶子节点
+  } = props;
+
+  const [dataSource, set_dataSource] = useState<ListItem[] | TreeNodeItem[]>([]);
+  const [showList, set_showList] = useState<ListItem[] | TreeNodeItem[]>([]);
+  const [currentSelected, set_currentSelected] = useState<undefined | any>(
+    undefined,
+  );
+  const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([]);
+  const [autoExpandParent, setAutoExpandParent] = useState(true);
+  const [defaultSelectedKeys, set_defaultSelectedKeys] = useState<Key[]>([]);
+
+  const onSelect: TreeProps['onSelect'] = (selectedKeys, info) => {
+    const { node } = info;
+    if (
+      !node[fieldNames.children as keyof typeof node] ||
+      (node[fieldNames.children as keyof typeof node] as any[]).length === 0
+    ) {
+      set_currentSelected(node);
+    }
+  };
+
+  const onExpand = (newExpandedKeys: React.Key[]) => {
+    setExpandedKeys(newExpandedKeys);
+    setAutoExpandParent(false);
+  };
+
+  const getFirstNodeOrLeaf = (node: any) => {
+    if (defaultSelectType === 'leaf') {
+      const result = findFirstLeafNodeWithParents(
+        node,
+        fieldNames.children ? fieldNames.children : 'children',
+      );
+      return {
+        node: result.leafNode,
+        expandedKeys: result.parents.map(
+          (parent: any) => parent[fieldNames.key as string],
+        ),
+      };
+    }
+    return {
+      node: node,
+      expandedKeys: [node[`${fieldNames.key}`]],
     };
-
-
-    useEffect(() => {
-        onChange && onChange(currentSelected);
-    }, [currentSelected])
-
-    useEffect(() => {
-        if (showList.length > 0) {
-            if (listType == 'list') {
-                set_currentSelected(showList[0]);
+  };
+
+  useEffect(() => {
+    onChange && onChange(currentSelected);
+  }, [currentSelected]);
+
+  useEffect(() => {
+    if (showList.length > 0) {
+      if (listType === 'list') {
+        set_currentSelected(showList[0]);
+      } else if (listType === 'tree') {
+        const { node, expandedKeys } = getFirstNodeOrLeaf(showList[0]);
+        setExpandedKeys([...expandedKeys]);
+        set_currentSelected(node);
+        set_defaultSelectedKeys([node[fieldNames.key!]]);
+      }
+    } else {
+      set_currentSelected(undefined);
+    }
+  }, [showList]);
+
+  useEffect(() => {
+    set_dataSource([...data]);
+    set_showList([...data]);
+  }, [data]);
+
+  return (
+    <div className="KCIMLeftList">
+      <div className="toolbar">
+        <Input
+          placeholder={placeholder}
+          allowClear
+          autoComplete="off"
+          suffix={<IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />}
+          onChange={(e) => {
+            if (listType === 'list') {
+              const result = dataSource.filter((item) =>
+                item[`${searchKey}`].includes(e.target.value),
+              );
+              set_showList(result);
             }
-            if (listType == 'tree') {
-                const result = findFirstLeafNodeWithParents(showList[0], fieldNames.children ? fieldNames.children : 'children');
-                // console.log({ result });
-        
-                setExpandedKeys([...(result.parents.map((parent:any) => parent[fieldNames.key as string]))]);
-                set_currentSelected(result.leafNode);
-                set_defaultSelectedKeys([result.leafNode[`${fieldNames.key}`]]);
+            if (listType === 'tree') {
+              const result = searchTreeAndKeepHierarchy(
+                dataSource,
+                e.target.value,
+                searchKey,
+                fieldNames.children ? fieldNames.children : 'children',
+              );
+              set_showList(result);
             }
-
-        } else {
-            set_currentSelected(undefined);
-        }
-    }, [showList]);
-
-
-    useEffect(() => {
-        set_dataSource([...data]);
-        set_showList([...data]);
-    }, [data]);
-
-
-    return (
-        <div className="KCIMLeftList">
-            <div className='toolbar'>
-                <Input placeholder={placeholder} allowClear autoComplete='off'
-                    suffix={
-                        <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />
-                    }
-                    // style={{ width: 156 }}
-                    onChange={(e) => {
-                        if (listType == 'list') {
-                            const result = dataSource.filter(item => item[`${searchKey}`].indexOf(e.target.value) != -1);
-                            set_showList(result);
-                        }
-                        if (listType == 'tree') {
-                            const result = searchTreeAndKeepHierarchy(dataSource, e.target.value, searchKey, fieldNames.children as string);
-                            set_showList(result);
-                        }
-
-                    }}
-
-                />
-                {/* <UpDataActBtn key={'act'} record={undefined} type='ADD_LEFTDATA' /> */}
-
-            </div>
-            <div className='wrap' style={{ height: contentH, overflowY: 'scroll' }}>
-                {
-                    listType == 'list' && showList.map((item, index) => {
-                        return (
-                            <div className={currentSelected ? currentSelected[`${rowKey}`] == item[`${rowKey}`] ? 'list on' : 'list' : 'list'}
-                                key={index}
-                                onClick={() => {
-                                    set_currentSelected(item);
-
-                                    // _currentSelectedType = item;
-                                }}
-                            >
-                                <img className='icon' src={icon ? icon : require('../../../static/departmentIcon.png')} alt="" />
-                                <div className='content'>
-                                    <Tooltip title={item.subText} >
-                                        <div className='name'>{item.name}</div>
-                                        <div className='sub'>{item.subText}</div>
-                                    </Tooltip>
-                                </div>
-
-                                {/* <Dropdown menu={{ items: moreItems }} placement="bottom" onOpenChange={(bool) => { bool && set_currentEditLeftData(item) }}>
-                                        <div className='more'>
-                                            <img src={require('../../../../../static/more_point_gray.png')} alt="" />
-                                        </div>
-                                    </Dropdown> */}
-                            </div>
-                        )
-                    })
-                }
-
-                {
-                    (!showList || showList.length == 0) && (
-                        <div><Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /></div>
-                    )
-                }
-
-                {
-                    listType == 'tree' && dataSource.length > 0 && currentSelected && defaultSelectedKeys.length > 0 && (
-                        <DirectoryTree
-                            className='KC-DirectoryTree'
-                            fieldNames={fieldNames}
-                            rootStyle={{ height: '100%', paddingBottom: 50, overflowY: 'scroll', overflowX: 'hidden' }}
-                            onSelect={onSelect}
-                            onExpand={onExpand}
-                            expandedKeys={expandedKeys}
-                            autoExpandParent={autoExpandParent}
-                            selectedKeys={[currentSelected[`${fieldNames.key}`]]}
-                            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={['B0100']}
-                            treeData={showList as unknown as DataNode[]}
-                            // treeData={treeDataNew}
-                            switcherIcon={(props: any) => {
-                                const { expanded } = props;
-                                return <IconFont style={{fontSize:16,position:'relative',top:2}} type={expanded?'icon-shouqi1':'icon-zhankai1'} />
-                            }}
-                        />
-                    )
-                }
+          }}
+        />
+      </div>
+      <div className="wrap" style={{ height: contentH, overflowY: 'scroll' }}>
+        {listType === 'list' &&
+          showList.map((item, index) => (
+            <div
+              className={
+                currentSelected
+                  ? currentSelected[`${rowKey}`] === item[`${rowKey}`]
+                    ? 'list on'
+                    : 'list'
+                  : 'list'
+              }
+              key={index}
+              onClick={() => {
+                set_currentSelected(item);
+              }}
+            >
+              <img
+                className="icon"
+                src={icon ? icon : require('../../../static/departmentIcon.png')}
+                alt=""
+              />
+              <div className="content">
+                <Tooltip title={item.subText}>
+                  <div className="name">{item.name}</div>
+                  <div className="sub">{item.subText}</div>
+                </Tooltip>
+              </div>
             </div>
-
-        </div>
-    )
-}
+          ))}
+
+        {(!showList || showList.length === 0) && (
+          <div>
+            <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
+          </div>
+        )}
+
+        {listType === 'tree' &&
+          dataSource.length > 0 &&
+          currentSelected &&
+          defaultSelectedKeys.length > 0 && (
+            <DirectoryTree
+              className="KC-DirectoryTree"
+              fieldNames={fieldNames}
+              rootStyle={{
+                height: '100%',
+                paddingBottom: 50,
+                overflowY: 'scroll',
+                overflowX: 'hidden',
+              }}
+              onSelect={onSelect}
+              onExpand={onExpand}
+              expandedKeys={expandedKeys}
+              autoExpandParent={autoExpandParent}
+              selectedKeys={[currentSelected[`${fieldNames.key}`]]}
+              blockNode={true}
+              showIcon={false}
+              treeData={showList as unknown as DataNode[]}
+              switcherIcon={(props: any) => {
+                const { expanded } = props;
+                return (
+                  <IconFont
+                    style={{ fontSize: 16, position: 'relative', top: 2 }}
+                    type={expanded ? 'icon-shouqi1' : 'icon-zhankai1'}
+                  />
+                );
+              }}
+            />
+          )}
+      </div>
+    </div>
+  );
+};

+ 33 - 7
src/components/KCIMLeftList/style.less

@@ -36,6 +36,21 @@
   
       .wrap {
         margin-top: 12px;
+        .mrms-ant-tree.mrms-ant-tree-directory .mrms-ant-tree-treenode {
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+          .mrms-ant-tree-node-content-wrapper {
+            display: flex;
+            .mrms-ant-tree-title {
+              // width: calc(100% - 20px);
+              // overflow: hidden;
+              // text-overflow: ellipsis;
+              // white-space: nowrap;
+            }
+          }
+         
+        }
         .mrms-ant-tree.mrms-ant-tree-directory .mrms-ant-tree-treenode-selected:hover::before,
         .mrms-ant-tree.mrms-ant-tree-directory .mrms-ant-tree-treenode-selected::before {
             border-radius: 4px;
@@ -48,19 +63,30 @@
 
         .KC-DirectoryTree {
           padding: 0 16px;
-          // .mrms-ant-tree-treenode-selected {
-          //      .mrms-ant-tree-title {
-          //         color:#17181A !important;
-          //         font-weight: 500 !important;
-          //      }
-          // }
-
+          
+          .mrms-ant-tree-treenode {
+               display: flex;
+               flex-direction: row;
+               justify-content: flex-start;
+               align-items: center;
+               height: 32px;
+               .mrms-ant-tree-indent {
+                    .mrms-ant-tree-indent-unit {
+                           width:12px !important;
+                    }
+               }
+               .mrms-ant-tree-switcher {
+                    line-height: 30px !important;
+               }
+          }
           
         }
 
         .mrms-ant-tree.mrms-ant-tree-directory .mrms-ant-tree-treenode .mrms-ant-tree-node-content-wrapper.mrms-ant-tree-node-selected {
           color:#17181A !important;
           font-weight: 500 !important;
+          
+          
         }
   
         .list {

+ 33 - 35
src/components/KCIMTable/style.less

@@ -98,45 +98,43 @@
                     }
                 }
 
-                &.mrms-ant-table-row {
-                    .mrms-ant-table-cell {
+                .mrms-ant-table-cell {
                     
-                        font-size: 14px;
-                        font-family: SourceHanSansCN-Medium, SourceHanSansCN;
-                        justify-content: flex-start !important;
-                        color: #17181A;
-                        padding: 8px 8px !important; 
-                        border-bottom: none !important;
-                        border-top: 1px solid rgb(218 226 242) !important;
-
-                        &.mrms-ant-table-cell-with-append {
-                            .mrms-ant-table-row-expand-icon {
-                                  border-radius: 4px !important;
-                                  border: 1px solid #DAE2F2 !important;
-
-                                  &:hover {
-                                    color: #3377ff;
-                                    border: 1px solid #3377ff !important;
-                                  }
-                            }
-                        }
-    
-                        &>.mrms-ant-typography {
-                            line-height:unset;
+                    font-size: 14px;
+                    font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+                    justify-content: flex-start !important;
+                    color: #17181A;
+                    padding: 8px 8px !important; 
+                    border-bottom: none !important;
+                    border-top: 1px solid rgb(218 226 242) !important;
+
+                    &.mrms-ant-table-cell-with-append {
+                        .mrms-ant-table-row-expand-icon {
+                              border-radius: 4px !important;
+                              border: 1px solid #DAE2F2 !important;
+
+                              &:hover {
+                                color: #3377ff;
+                                border: 1px solid #3377ff !important;
+                              }
                         }
-    
-                        &.mrms-ant-table-cell-with-append {
-                            .mrms-ant-table-row-expand-icon {
-                                 
-                            }
+                    }
+
+                    &>.mrms-ant-typography {
+                        line-height:unset;
+                    }
+
+                    &.mrms-ant-table-cell-with-append {
+                        .mrms-ant-table-row-expand-icon {
+                             
                         }
-    
-                        // &:hover {
-                        //     border-radius: 0 !important;
-                        //     background: #FAFBFC !important;
-    
-                        // }
                     }
+
+                    // &:hover {
+                    //     border-radius: 0 !important;
+                    //     background: #FAFBFC !important;
+
+                    // }
                 }
 
 

+ 6 - 2
src/constant.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2024-01-12 13:34:17
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-18 20:24:20
+ * @LastEditTime: 2024-12-06 13:54:19
  * @FilePath: /CostAccountingSys/src/constant.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -17,4 +17,8 @@ export const  tableColumnsWidObj = {
        year:'5%',
        month:'5%',
        shareLevel:'5%'
-}
+}
+
+export const  authTimeType = [
+       {label:'长期授权',value:1},{label:'临期授权',value:2},{label:'单次授权',value:3}
+]

+ 147 - 147
src/global.less

@@ -36,7 +36,7 @@ select:-webkit-autofill {
 
 
 
-.cost-ant-space-item {
+.mrms-ant-space-item {
     &>a {
         color: #3377FF !important;
     }
@@ -49,22 +49,22 @@ textarea {
     border: 1px solid #CFD7E6 !important;
 }
 
-.cost-ant-btn-primary {
+.mrms-ant-btn-primary {
     background: #3377FF;
 }
-.cost-ant-btn-primary[disabled]{
+.mrms-ant-btn-primary[disabled]{
     background:#f5f5f5 ;
 }
 
-.cost-ant-checkbox {
-    &.cost-ant-checkbox-checked {
-          .cost-ant-checkbox-inner {
+.mrms-ant-checkbox {
+    &.mrms-ant-checkbox-checked {
+          .mrms-ant-checkbox-inner {
             background-color:#3377FF;
             background: #3377FF;
           }
     }
-    // &.cost-ant-checkbox-indeterminate {
-    //     &.cost-ant-checkbox-inner {
+    // &.mrms-ant-checkbox-indeterminate {
+    //     &.mrms-ant-checkbox-inner {
     //         &::after {
     //             background-color:#3377FF !important;
     //         }
@@ -72,15 +72,15 @@ textarea {
     // }
 }
 
-.cost-ant-checkbox-indeterminate .cost-ant-checkbox-inner::after {
+.mrms-ant-checkbox-indeterminate .mrms-ant-checkbox-inner::after {
     background-color:#3377FF;
 }
 
-.cost-ant-input-affix-wrapper {
+.mrms-ant-input-affix-wrapper {
     border-radius: 4px !important;
 }
 
-.cost-ant-input {
+.mrms-ant-input {
     border-radius: 4px;
     // border: 1px solid #CFD7E6 !important;
     &::placeholder {
@@ -88,13 +88,13 @@ textarea {
     }
 }
 
-.cost-ant-table-cell {
+.mrms-ant-table-cell {
     a {
         color: #3376FE !important;
     }
 }
 
-.cost-ant-input-number {
+.mrms-ant-input-number {
     border-radius: 4px !important;
 }
 
@@ -105,29 +105,29 @@ textarea {
 
 //Modal
 
-.cost-ant-modal {
-    .cost-ant-modal-content {
+.mrms-ant-modal {
+    .mrms-ant-modal-content {
         padding: 16px !important;
         border-radius: 4px !important;
-        .cost-ant-modal-header {
+        .mrms-ant-modal-header {
              padding: 0 ;
              margin-bottom: 16px;
              border-bottom: none;
         }
-        .cost-ant-modal-body {
+        .mrms-ant-modal-body {
             max-height: 570px;
             // overflow-y: scroll;
             // overflow-x: hidden;
             padding: 0;
 
-            .cost-ant-modal-confirm-body-wrapper {
-                .cost-ant-modal-confirm-body {
-                    .cost-ant-modal-confirm-title {
+            .mrms-ant-modal-confirm-body-wrapper {
+                .mrms-ant-modal-confirm-body {
+                    .mrms-ant-modal-confirm-title {
                         font-size: 16px;
                         height:18px;
                       
                     }
-                    .cost-ant-modal-confirm-content {
+                    .mrms-ant-modal-confirm-content {
                         max-width: 100% !important;
                         max-height: 498px;
                         overflow-y: scroll;
@@ -135,7 +135,7 @@ textarea {
                         margin-block-start:16px;
 
                         .TableTransfer {
-                            .cost-ant-transfer-operation {
+                            .mrms-ant-transfer-operation {
                                 //   align-self: self-end;
                                 //   margin-bottom: 30px;
 
@@ -149,11 +149,11 @@ textarea {
                                 }
                             }
 
-                            .cost-ant-transfer-list {
+                            .mrms-ant-transfer-list {
                                 overflow: hidden;
                                 border: 1px solid #DAE2F2;
 
-                                .cost-ant-transfer-list-header {
+                                .mrms-ant-transfer-list-header {
                                     height: 32px;
                                     font-size: 12px;
                                     border-bottom: 1px solid #DAE2F2;
@@ -162,24 +162,24 @@ textarea {
                                         color: #99A6BF;
                                     }
 
-                                    .cost-ant-transfer-list-header-selected {
+                                    .mrms-ant-transfer-list-header-selected {
                                         color: #515866;
                                     }
                                 }
 
-                                .cost-ant-transfer-list-body {
-                                    .cost-ant-transfer-list-body-search-wrapper {
+                                .mrms-ant-transfer-list-body {
+                                    .mrms-ant-transfer-list-body-search-wrapper {
                                         padding: 8px;
 
-                                        .cost-ant-input-prefix {
+                                        .mrms-ant-input-prefix {
                                             .anticon-search {
                                                 color: #99A6BF;
                                             }
                                         }
                                     }
 
-                                    .cost-ant-transfer-list-body-customize-wrapper {
-                                        .costTable {
+                                    .mrms-ant-transfer-list-body-customize-wrapper {
+                                        .mrmsTable {
                                             border: none !important;
                                             border-radius: 0 !important;
                                         }
@@ -189,10 +189,10 @@ textarea {
 
 
 
-                            .cost-ant-table {
-                                .cost-ant-table-container {
-                                    .cost-ant-table-content {
-                                        .cost-ant-table-thead {
+                            .mrms-ant-table {
+                                .mrms-ant-table-container {
+                                    .mrms-ant-table-content {
+                                        .mrms-ant-table-thead {
 
                                             &>tr>th {
                                                 font-size: 14px;
@@ -207,7 +207,7 @@ textarea {
 
                                         }
 
-                                        .cost-ant-table-tbody {
+                                        .mrms-ant-table-tbody {
                                             &>tr>td {
                                                 padding-left: 8px !important;
                                                 padding-right: 8px !important;
@@ -220,7 +220,7 @@ textarea {
                     }
                 }
 
-                .cost-ant-modal-confirm-btns {
+                .mrms-ant-modal-confirm-btns {
                     display: flex;
                     flex-direction: row;
                     align-items: center;
@@ -235,23 +235,23 @@ textarea {
                         height: 24px;
                         border-radius: 4px;
 
-                        &.cost-ant-btn-default {
+                        &.mrms-ant-btn-default {
                             border: 1px solid #DAE2F2;
                             background-color: #FAFCFF;
                         }
 
-                        &.cost-ant-btn-primary {
+                        &.mrms-ant-btn-primary {
                             background-color: #3376FE;
                         }
                     }
                 }
             }
         }
-        .cost-ant-modal-footer {
+        .mrms-ant-modal-footer {
             border-top: none;
             padding: 0;
             margin-top: 16px;
-            .cost-ant-btn {
+            .mrms-ant-btn {
                  border-radius: 4px !important;
                  height: 24px !important;
                  padding: 0 14px !important;
@@ -259,10 +259,10 @@ textarea {
         }
     }
 
-    .cost-ant-modal-footer {
+    .mrms-ant-modal-footer {
         margin-top: 0;
 
-        .cost-ant-space-item {
+        .mrms-ant-space-item {
             &>button {
                 display: flex;
                 justify-content: center;
@@ -274,12 +274,12 @@ textarea {
 
                 &>span {}
 
-                &.cost-ant-btn-default {
+                &.mrms-ant-btn-default {
                     border: 1px solid #DAE2F2;
                     background-color: #FAFCFF;
                 }
 
-                &.cost-ant-btn-primary {
+                &.mrms-ant-btn-primary {
                     background-color: #3376FE;
                 }
             }
@@ -291,9 +291,9 @@ textarea {
 
 //message
 
-.cost-ant-message {
+.mrms-ant-message {
     .ant-message-notice-success {
-        .cost-ant-message-notice-content {
+        .mrms-ant-message-notice-content {
             .anticon-check-circle {
                 &>svg {
                     color: #52c41a;
@@ -305,19 +305,19 @@ textarea {
 
 //Form
 
-.cost-ant-form {
-    &.cost-ant-form-vertical {
-        .cost-ant-form-item {
+.mrms-ant-form {
+    &.mrms-ant-form-vertical {
+        .mrms-ant-form-item {
             margin-bottom: 16px;
 
-            .cost-ant-form-item-label {
+            .mrms-ant-form-item-label {
                 padding: 0 !important;
                 height: 15px;
                 margin-bottom: 8px;
                 line-height: 15px;
             }
 
-            .cost-ant-form-item-control-input {
+            .mrms-ant-form-item-control-input {
                 min-height: 24px;
             }
         }
@@ -327,20 +327,20 @@ textarea {
 
 
 
-// .cost-ant-form-item-label {
+// .mrms-ant-form-item-label {
 //     padding: 0;
 //     //height: 15px;
 //     line-height: 15px;
 //     margin-bottom: 5px;
 
-//     .cost-ant-form-item-required {
+//     .mrms-ant-form-item-required {
 //       &::before {
 //         margin-right: 0 !important;
 //       }
 //     }
 // }
 
-.cost-ant-input-affix-wrapper {
+.mrms-ant-input-affix-wrapper {
     padding: 0px 8px !important;
     border-radius: 4px;
     border: 1px solid #CFD7E6 !important;
@@ -355,48 +355,48 @@ textarea {
     }
 }
 
-.cost-ant-input-disabled {
+.mrms-ant-input-disabled {
     &::placeholder {
         color: #7A8599 !important;
     }
 }
 
-.cost-ant-input-affix-wrapper-disabled {
+.mrms-ant-input-affix-wrapper-disabled {
     background: #F0F2F5 !important;
 }
 
 
 // //proContsiner 标题样式覆盖
-// .cost-ant-page-header .cost-ant-page-header-heading-title {
+// .mrms-ant-page-header .mrms-ant-page-header-heading-title {
 //      height: 17px !important;
 //      font-size: 16px !important;
 //      line-height: 17px !important;
 // }
 
-.cost-ant-page-header {
-    .cost-ant-page-header-heading-title {
+.mrms-ant-page-header {
+    .mrms-ant-page-header-heading-title {
          font-size: 16px !important;
     }
 }
 
-.cost-ant-page-header .cost-ant-page-header-heading-left {
+.mrms-ant-page-header .mrms-ant-page-header-heading-left {
     margin-block: 0 !important;
 }
 
 
-.cost-ant-pro .cost-ant-pro-layout .cost-ant-pro-sider-fixed {
+.mrms-ant-pro .mrms-ant-pro-layout .mrms-ant-pro-sider-fixed {
     position: absolute !important;
     // min-width:230px !important;
     // width: 230px !important;
 }
 
 //避免logo区域的层级过高,影响父容器
-.cost-ant-pro .cost-ant-pro-layout .cost-ant-pro-sider-fixed {
+.mrms-ant-pro .mrms-ant-pro-layout .mrms-ant-pro-sider-fixed {
     height: calc(100vh - 48px) !important;
     z-index: 0 !important;
 }
 
-.cost-ant-pro .cost-ant-pro-layout .cost-ant-pro-sider-menu {
+.mrms-ant-pro .mrms-ant-pro-layout .mrms-ant-pro-sider-menu {
     height: calc(100vh - 200px) !important;
     overflow-y: scroll !important;
     overflow-x: hidden;
@@ -404,21 +404,21 @@ textarea {
 
 
 
-.cost-ant-menu .cost-ant-menu-root .cost-ant-menu-inline .cost-ant-menu-light .cost-ant-pro-sider-menu  .cost-ant-pro-base-menu{
+.mrms-ant-menu .mrms-ant-menu-root .mrms-ant-menu-inline .mrms-ant-menu-light .mrms-ant-pro-sider-menu  .mrms-ant-pro-base-menu{
      height: calc(100vh - 90px) !important;
 }
 
-.cost-ant-pro-base-menu .cost-ant-pro-base-menu-submenu-has-icon >.cost-ant-menu-sub {
+.mrms-ant-pro-base-menu .mrms-ant-pro-base-menu-submenu-has-icon >.mrms-ant-menu-sub {
     padding-inline-start:0 !important;
 }
 
 
-.cost-ant-menu-submenu {
-    &.cost-ant-menu-submenu-selected {
+.mrms-ant-menu-submenu {
+    &.mrms-ant-menu-submenu-selected {
         color: #3376FE !important; 
     }
 }
-.cost-ant-menu-item-selected {
+.mrms-ant-menu-item-selected {
     color: #3376FE !important; 
     background-color:#F2F6FF !important;
     // margin:8px !important;
@@ -426,31 +426,31 @@ textarea {
          color: #3376FE !important; 
     }
 }
-.cost-ant-menu-light:not(.cost-ant-menu-horizontal) .cost-ant-menu-item:not(.cost-ant-menu-item-selected):hover {
+.mrms-ant-menu-light:not(.mrms-ant-menu-horizontal) .mrms-ant-menu-item:not(.mrms-ant-menu-item-selected):hover {
     background-color: #f0f2f5 !important;
     // margin:8px !important;
 }
 
-.cost-ant-menu-light:not(.cost-ant-menu-horizontal) .cost-ant-menu-submenu-title:hover {
+.mrms-ant-menu-light:not(.mrms-ant-menu-horizontal) .mrms-ant-menu-submenu-title:hover {
     background-color: #f0f2f5 !important;
 }
 
-.cost-ant-tree.cost-ant-tree-directory .cost-ant-tree-treenode:hover::before {
+.mrms-ant-tree.mrms-ant-tree-directory .mrms-ant-tree-treenode:hover::before {
     background: #f0f2f5 !important;
     border-radius: 4px;
 }
 
-.cost-EditableProTable {
-    .cost-ant-pro-card-body {
+.mrms-EditableProTable {
+    .mrms-ant-pro-card-body {
         padding-inline: 0 !important;
         padding-block: 0 !important;
 
-        .cost-ant-table {
+        .mrms-ant-table {
             border: 1px solid #CFD7E6 !important;
             overflow: hidden;
 
-            .cost-ant-table-content {
-                .cost-ant-table-thead {
+            .mrms-ant-table-content {
+                .mrms-ant-table-thead {
                     &>tr>th {
 
                         height: 15px;
@@ -470,9 +470,9 @@ textarea {
                     }
                 }
 
-                .cost-ant-table-tbody {
-                    .cost-ant-table-row {
-                        .cost-ant-table-cell {
+                .mrms-ant-table-tbody {
+                    .mrms-ant-table-row {
+                        .mrms-ant-table-cell {
 
                             height: 15px;
                             line-height: 15px;
@@ -498,16 +498,16 @@ textarea {
     }
 }
 
-.cost-ant-table-wrapper {
-    .cost-ant-table:not(.cost-ant-table-bordered) .cost-ant-table-tbody>tr.cost-ant-table-row.cost-ant-table-row-selected>td:first-child {
+.mrms-ant-table-wrapper {
+    .mrms-ant-table:not(.mrms-ant-table-bordered) .mrms-ant-table-tbody>tr.mrms-ant-table-row.mrms-ant-table-row-selected>td:first-child {
         border-radius: 0 !important;
     }
 
-    .cost-ant-table-content {
-        .cost-ant-table-thead {
+    .mrms-ant-table-content {
+        .mrms-ant-table-thead {
             tr {
                 &:last-child {
-                    .cost-ant-table-cell {
+                    .mrms-ant-table-cell {
                         // border-top: 1px solid #dae2f2;
                     }
                 }
@@ -516,31 +516,31 @@ textarea {
     }
 }
 
-.cost-ant-table-wrapper .cost-ant-table:not(.cost-ant-table-bordered) .cost-ant-table-tbody>tr.cost-ant-table-row:hover>td:first-child {
+.mrms-ant-table-wrapper .mrms-ant-table:not(.mrms-ant-table-bordered) .mrms-ant-table-tbody>tr.mrms-ant-table-row:hover>td:first-child {
     border-start-start-radius: 0 !important;
     border-end-start-radius: 0 !important;
 }
 
-.cost-ant-table-wrapper .cost-ant-table:not(.cost-ant-table-bordered) .cost-ant-table-tbody>tr.cost-ant-table-row:last-child:hover>td {
+.mrms-ant-table-wrapper .mrms-ant-table:not(.mrms-ant-table-bordered) .mrms-ant-table-tbody>tr.mrms-ant-table-row:last-child:hover>td {
     border-bottom-color: #dae2f2 !important;
 }
 
-.cost-ant-table-wrapper .cost-ant-table:not(.cost-ant-table-bordered) .cost-ant-table-tbody>tr.cost-ant-table-row:last-child>td {
+.mrms-ant-table-wrapper .mrms-ant-table:not(.mrms-ant-table-bordered) .mrms-ant-table-tbody>tr.mrms-ant-table-row:last-child>td {
     border-bottom-color: #dae2f2 !important;
 }
 
 
-.cost-ant-table-wrapper .cost-ant-table:not(.cost-ant-table-bordered) .cost-ant-table-tbody>tr.cost-ant-table-row:hover>td:last-child {
+.mrms-ant-table-wrapper .mrms-ant-table:not(.mrms-ant-table-bordered) .mrms-ant-table-tbody>tr.mrms-ant-table-row:hover>td:last-child {
     border-end-end-radius: 0 !important;
     border-start-end-radius: 0 !important;
 }
 
 
-.cost-ant-pro .cost-ant-pro-layout .cost-ant-pro-layout-bg-list {
+.mrms-ant-pro .mrms-ant-pro-layout .mrms-ant-pro-layout-bg-list {
     background: #F7F9FC !important;
 }
 
-// .cost-ant-message-notice .cost-ant-message-success .anticon {
+// .mrms-ant-message-notice .mrms-ant-message-success .anticon {
 //     color: #52c41a !important;
 // }
 .ant-message-success {
@@ -553,22 +553,22 @@ textarea {
 /**
     Select
 **/
-.cost-ant-select {
-    .cost-ant-select-selector {
+.mrms-ant-select {
+    .mrms-ant-select-selector {
         height: 24px !important;
         padding: 0 8px !important;
         border-radius: 4px !important;
         border: 1px solid #CFD7E6 !important;
 
-        .cost-ant-select-selection-item {
+        .mrms-ant-select-selection-item {
             line-height: 24px !important;
         }
 
-        .cost-ant-select-selection-search-input {
+        .mrms-ant-select-selection-search-input {
             height: 24px !important;
         }
 
-        .cost-ant-select-selection-placeholder {
+        .mrms-ant-select-selection-placeholder {
             line-height: 22px !important;
             font-size: 14px;
             font-family: SourceHanSansCN-Normal, SourceHanSansCN;
@@ -576,9 +576,9 @@ textarea {
             color: #99A6BF;
         }
 
-        .cost-ant-select-selection-overflow {
-            .cost-ant-select-selection-overflow-item {
-                .cost-ant-select-selection-item {
+        .mrms-ant-select-selection-overflow {
+            .mrms-ant-select-selection-overflow-item {
+                .mrms-ant-select-selection-item {
                     height: 22px !important;
                     line-height: 22px !important;
                     margin-top: 0 !important;
@@ -588,20 +588,20 @@ textarea {
         }
     }
 
-    .cost-ant-select-arrow {
+    .mrms-ant-select-arrow {
         color: #CFD7E6;
     }
 
-    &.cost-ant-select-disabled {
-        .cost-ant-select-selector {
+    &.mrms-ant-select-disabled {
+        .mrms-ant-select-selector {
             border: 1px solid #DADEE6 !important;
 
-            .cost-ant-select-selection-placeholder {
+            .mrms-ant-select-selection-placeholder {
                 color: #7A8599;
             }
         }
 
-        .cost-ant-select-arrow {
+        .mrms-ant-select-arrow {
             color: #7A8599;
         }
     }
@@ -611,12 +611,12 @@ textarea {
 
 
 
-.cost-ant-tabs {
-    .cost-ant-tabs-tab {
+.mrms-ant-tabs {
+    .mrms-ant-tabs-tab {
         padding: 5px 0 !important;
         padding-top: 12px !important;
     }
-    .cost-ant-tabs-nav {
+    .mrms-ant-tabs-nav {
         &::before {
             border-bottom: none !important;
         }
@@ -626,59 +626,59 @@ textarea {
 
 
 
-.cost-ant-table-wrapper {
+.mrms-ant-table-wrapper {
     overflow: hidden;
 }
 
 
 
-.cost-ant-pro-layout .cost-ant-pro-layout-container {
+.mrms-ant-pro-layout .mrms-ant-pro-layout-container {
     flex: 1;
     overflow-y: scroll;
     background: #F7F9FC !important;
 }
 
 //页面全局底色
-.cost-ant-pro .cost-ant-pro-layout .cost-ant-pro-layout-bg-list {
+.mrms-ant-pro .mrms-ant-pro-layout .mrms-ant-pro-layout-bg-list {
     background: rgb(247 249 252 / 100%);
 }
 
-.cost-ant-pro-page-container-children-content {
+.mrms-ant-pro-page-container-children-content {
     padding-inline: 0 !important;
 }
 
-.cost-ant-pro-sider-actions {
+.mrms-ant-pro-sider-actions {
     display: none !important;
 }
 
 
-.cost-ant-pro-sider-collapsed-button {
+.mrms-ant-pro-sider-collapsed-button {
     top: 95% !important;
     right: 17px !important;
 }
 
 
-.cost-ant-menu .cost-ant-menu-submenu-title .anticon {
+.mrms-ant-menu .mrms-ant-menu-submenu-title .anticon {
     transition: none !important;
 }
 
-.cost-ant-menu .cost-ant-menu-item .anticon+span {
+.mrms-ant-menu .mrms-ant-menu-item .anticon+span {
     transition: none !important;
 }
 
-.cost-ant-menu .cost-ant-menu-item .anticon {
+.mrms-ant-menu .mrms-ant-menu-item .anticon {
     transition: none !important;
 }
 
-.cost-ant-menu .cost-ant-menu-item {
+.mrms-ant-menu .mrms-ant-menu-item {
     transition: none !important;
 }
 
-.cost-ant-menu .cost-ant-menu-submenu-title .anticon+span {
+.mrms-ant-menu .mrms-ant-menu-submenu-title .anticon+span {
     transition: none !important;
 }
 
-.cost-ant-tabs .cost-ant-tabs-tab+.cost-ant-tabs-tab {
+.mrms-ant-tabs .mrms-ant-tabs-tab+.mrms-ant-tabs-tab {
     margin: 0 0 0 24px !important;
 }
 
@@ -690,13 +690,13 @@ textarea {
     }
 }
 
-.cost-ant-layout-sider {
+.mrms-ant-layout-sider {
     max-width: 100% !important;
     min-width: unset !important;
     width: 100% !important; 
 }
 
-.cost-ant-pro .cost-ant-pro-layout .cost-ant-pro-sider .cost-ant-layout-sider-children {
+.mrms-ant-pro .mrms-ant-pro-layout .mrms-ant-pro-sider .mrms-ant-layout-sider-children {
     padding-inline: 0 !important;
     &>div {
        &>ul {
@@ -706,99 +706,99 @@ textarea {
 }
 
 
-.cost-ant-pro-form>div:not(.cost-ant-pro-form-light-filter) .pro-field-lg {
+.mrms-ant-pro-form>div:not(.mrms-ant-pro-form-light-filter) .pro-field-lg {
     width: 100% !important;
 }
 
-.cost-ant-select {
-    .cost-ant-select-selector {
+.mrms-ant-select {
+    .mrms-ant-select-selector {
         border: 1px solid #CFD7E6 !important;
         // color: #99A6BF !important;
 
-        .cost-ant-select-selection-placeholder {
+        .mrms-ant-select-selection-placeholder {
             color: #99A6BF !important;
         }
     }
 
-    .cost-ant-select-arrow {
+    .mrms-ant-select-arrow {
         color: #99A6BF !important;
     }
 }
 
 
-.cost-ant-input-number-input {
+.mrms-ant-input-number-input {
     border-radius: 4px;
     &::placeholder {
         color: #99A6BF !important;
     }
 }
 
-.cost-ant-select-disabled {
-    .cost-ant-select-selector {
+.mrms-ant-select-disabled {
+    .mrms-ant-select-selector {
         border: 1px solid #DADEE6 !important;
         background: #F0F2F5 !important;
 
-        .cost-ant-select-selection-placeholder {
+        .mrms-ant-select-selection-placeholder {
             color: #7A8599 !important;
         }
     }
 
-    .cost-ant-select-arrow {
+    .mrms-ant-select-arrow {
         color: #7A8599 !important;
     }
 }
 
 
 
-.cost-ant-input-number {
+.mrms-ant-input-number {
     border: 1px solid #CFD7E6 !important;
     // color: #99A6BF !important;
     border-radius: 4px;
     box-shadow: none !important;
-    .cost-ant-input-number-input {
+    .mrms-ant-input-number-input {
         height: 22px !important;
         line-height: 22px !important;
     }
 }
 
-.cost-ant-input-number-disabled {
+.mrms-ant-input-number-disabled {
     border: 1px solid #DADEE6 !important;
     background: #F0F2F5 !important;
 
-    .cost-ant-input-number-input {
+    .mrms-ant-input-number-input {
         color: #7A8599 !important;
     }
 }
 
-.cost-ant-input-affix-wrapper-disabled {
+.mrms-ant-input-affix-wrapper-disabled {
     border: 1px solid #DADEE6 !important;
 }
 
-.cost-ant-picker {
+.mrms-ant-picker {
     border-radius: 4px !important;
     border: 1px solid #CFD7E6 !important;
     height: 24px;
-    .cost-ant-picker-input {
+    .mrms-ant-picker-input {
         &>input {
              &::placeholder {
                 color:#99A6BF !important;
              }
         }
-        .cost-ant-picker-suffix {
+        .mrms-ant-picker-suffix {
             color:#99A6BF !important;
         }
     }
 }
 
-.cost-ant-picker-panel-container {
-    .cost-ant-picker-panel {
-        .cost-ant-picker-month-panel {
-            .cost-ant-picker-body {
-                .cost-ant-picker-content {
+.mrms-ant-picker-panel-container {
+    .mrms-ant-picker-panel {
+        .mrms-ant-picker-month-panel {
+            .mrms-ant-picker-body {
+                .mrms-ant-picker-content {
                     tr {
                         td {
-                            &.cost-ant-picker-cell-selected {
-                                .cost-ant-picker-cell-inner {
+                            &.mrms-ant-picker-cell-selected {
+                                .mrms-ant-picker-cell-inner {
                                     background:#3377FF;
                                 }
                             }
@@ -810,11 +810,11 @@ textarea {
     }
 }
 
-.cost-ant-picker-input>input[disabled] {
+.mrms-ant-picker-input>input[disabled] {
     color: #7A8599 !important;
 }
 
-.cost-ant-picker-disabled {
+.mrms-ant-picker-disabled {
     background: #F0F2F5 !important;
     border: 1px solid #DADEE6 !important;
 

+ 0 - 261
src/pages/baseInfoMana/checkGroupMana/index.tsx

@@ -1,261 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-09 10:57:09
- * @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
- */
-
-
-
-
-
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-import { ActionType, DrawerForm, EditableFormInstance, EditableProTable, ProFormInstance, ProFormSelect } from '@ant-design/pro-components';
-import { ModalForm, ProFormDigit, ProFormText, ProFormTextArea } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm } from 'antd';
-import { useEffect, useRef, useState } from 'react'
-
-import { addData, delData, editData, getChackGroupData } from './service';
-
-import './style.less';
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-import KCIMDrawerForm from '@/components/KCIMDrawerForm';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-type TableDataResponse = {
-    data: any[]; 
-    success: boolean; 
-    total: number; 
-    pageSize: number; 
-    totalPage: number;
-};
-
-export default function FenyeTemplate() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-
-    const columns: ProColumns[] = [
-
-        {
-            title: 'ID',
-            dataIndex: 'id',
-        },
-        {
-            title: '查核组名称',
-            dataIndex: 'name',
-        },
-        {
-            title: '组长',
-            dataIndex: 'groupManagerName',
-        },
-        {
-            title: '备注',
-            dataIndex: 'createUserName',
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width:150,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <a key='emp'>人员</a>,
-                    // <a key=''>查核要点</a>
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any):Promise<TableDataResponse|any[]> => {
-        const resp = await getChackGroupData(params);
-        if (resp) {
-
-            if(resp.totalCount == 0 && resp.currPage != 1){
-                 return getTableData({...params,current:resp.currPage - 1});
-            }else{
-                return {
-                    data: resp.list,
-                    success: true,
-                    total: resp.totalCount,
-                    pageSize: resp.pageSize,
-                    totalPage: resp.totalPage,
-                }
-            }
-            
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData(record.id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-
-        const content = formVal.table.map((a: any) => ({
-
-        }))
-
-        if (type == 'ADD') {
-            const result = {
-                name: formVal.name,
-                content: JSON.stringify(formVal.table),
-                remark: formVal.remark
-            }
-            const resp = await addData({ ...result });
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-            const result = {
-                id: formVal.id,
-                name: formVal.name,
-                content: JSON.stringify(formVal.table),
-                remark: formVal.remark
-            }
-            const resp = await editData({ ...result });
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-        }
-
-        return true;
-    }
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
-
-        const formRef = useRef<ProFormInstance<any>>();
-
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}查核组`}
-                width={400}
-                initialValues={type == 'EDIT' ? { ...record, filedType: 'Text' } : { filedType: 'Text' }}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val: any) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                formRef={formRef}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText
-                    name="name"
-                    label="查核组名称:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '名称不能为空!' }]}
-                />
-                <ProFormTextArea
-                    name="remark"
-                    label="备注:"
-                    placeholder="请输入"
-                />
-            </ModalForm>
-        )
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-    }
-
-
-    useEffect(() => {
-
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='checkGroupMana' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem' style={{ marginRight: 16, width: 205 }}>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'请输入查核组名称'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        groupName: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    groupName: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                    <div className='filterItem' style={{ marginRight: 16, width: 220 }}>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 组长名称:</span>
-                        <Input placeholder={'请输入'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        groupManagerName: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    groupManagerName: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                {/* <div className='btnGroup'>
-                    <UpDataActBtn record type='ADD' />
-                </div> */}
-            </div>
-            <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 96
src/pages/baseInfoMana/checkGroupMana/service.ts

@@ -1,96 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-10-12 18:16:15
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-
-export type FenyeTemplateItemType = {
-  id:number;
-  hiId:number;
-  name:string;
-  content:string;
-  remark:string;
-  createUserId:number;
-  createUserName:string;
-  date:string
-}
-
-
-export const getChackGroupData = (params?:any) => {
-  return request<{
-       currPage: number;
-       current:number;
-       list:any[];
-       pageSize:number;
-       totalCount:number;
-       totalPage:number;
-  }>('/manager/CheckGroup/getCheckGroupList', {
-    method: 'GET',
-    params:{...params}
-  });
-};
-
-//获取查核组字典
-export const getCheckData = (params?:any) => {
-  return request<{
-       currPage: number;
-       current:number;
-       list:any[];
-       pageSize:number;
-       totalCount:number;
-       totalPage:number;
-  }>('/manager/CheckGroup/getCheckGroup', {
-    method: 'GET',
-    params:{...params}
-  });
-};
-
-
-//新增表格数据 
-export type AddTableDataType = {
-  name:string;
-  content:string;
-  remark:string;
-}
-export const addData = (data:AddTableDataType) => {
-  return request('/manager/setting/addPageTemplate', {
-    method: 'POST',
-    data
-  });
-};
-
-
-//编辑表格数据
-
-export const editData = (data:{id:number}&AddTableDataType) => {
-  return request('/manager/setting/editPageTemplate', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-
-export const delData = (id:string) => {
-  return request('/manager/setting/deletePageTemplate', {
-    method: 'POST',
-    params:{id}
-  });
-};
-
-
-
-
-
-
-
-

+ 0 - 43
src/pages/baseInfoMana/checkGroupMana/style.less

@@ -1,43 +0,0 @@
-.checkGroupMana {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-    }
-
-  }
-}

+ 0 - 120
src/pages/baseInfoMana/checkGroupMana/tableSelector.tsx

@@ -1,120 +0,0 @@
-import React, { useEffect, useState } from "react";
-import {Input} from 'antd'
-import { KCIMTable } from "@/components/KCIMTable";
-import { createFromIconfontCN } from "@ant-design/icons";
-import { getCheckData } from "../checkGroupMana/service";
-import { getData } from "@/pages/setting/qualitativeOptionsMana/service";
-import { ModalForm } from "@ant-design/pro-components";
-
-// import './style.less';
-
-
-interface TableSelecterProps  {
-    tableSelecterColumn: any[];
-    record: any
-}
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-
-const TableSelecter = ({tableSelecterColumn, record,open,title,onVisibleChange,rowKey='id',request,onFinish }:{
-    tableSelecterColumn:any[],record:any,open:boolean,title:string,onVisibleChange:(bool:boolean)=>void,
-    rowKey?:string,request?:(params:any)=>Promise<any>,onFinish?:(selectedKeys:React.Key[],selectedRows:any[])=>void
-})=>{
-
-    const Table = React.forwardRef(({ }: TableSelecterProps, ref) => {
-
-        const [datasource, set_datasource] = useState<any[]>([]);
-        const [selectedKeys, setSelectedKeys] = useState<React.Key[]>([]);
-        const [selectedRows,set_selectedRows] = useState<any[]>([]);
-        const [showList, set_showList] = useState<any[]>([]);
-        
-        
-        const onSelectChange = (newSelectedRowKeys: React.Key[],selectedRows:any) => {
-            setSelectedKeys([...newSelectedRowKeys]);
-    
-        };
-    
-        const saveHandle = async () => {
-    
-            onFinish&&onFinish(selectedKeys,selectedRows);
-            
-        }
-    
-    
-        return (
-            <div >
-                <Input placeholder={'请输入项目名称'} allowClear autoComplete='off'
-                    suffix={
-                        <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />
-                    }
-                    style={{ marginBottom: 8 }}
-                    onChange={(e) => {
-                        if (e.target.value.length != 0) {
-                            const result = datasource.filter(item => item.indicatorName.indexOf(e.target.value) != -1);
-                            set_showList(result);
-                        } else {
-                            set_showList(datasource);
-                        }
-    
-                    }}
-    
-                />
-                <KCIMTable columns={tableSelecterColumn}
-                    options={{
-                        density: true,
-                        setting: {
-                            listsHeight: 100,
-                        },
-                    }}
-                    rowKey={rowKey}
-                    scroll={{ y: 400 }}
-                    tableAlertRender={false}
-                    rowSelection={{
-                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
-                        // 注释该行则默认不显示下拉选项
-                        // selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
-                        onChange: onSelectChange,
-                    }}
-                    pagination={{ showTitle: false, showSizeChanger: true }}
-                    //dataSource={showList}
-                    request={request?async (params)=>request(params):undefined}
-                />
-                <div className='footer'>
-                    <span className='cancel' onClick={() => close()}>取消</span>
-                    <span className='ok' onClick={() => saveHandle()}>{`确认(${selectedKeys.length > 0 && selectedKeys.length})`}</span>
-                </div>
-            </div>
-    
-        )
-    });
-
-    const close = ()=>{
-        onVisibleChange&&onVisibleChange(false);
-    }
-
-
-    return (
-        <ModalForm className="TableSelecter" title={title} width={600} submitter={{
-            render:false
-        }} open={open} modalProps={{
-            closable: false,
-        }}>
-            <Table
-                // ref={tableSelecterRef}
-                record={undefined}
-                tableSelecterColumn={tableSelecterColumn}
-            ></Table>
-        </ModalForm>
-    )
-
-}
-
-
-
-
-export default TableSelecter

+ 0 - 319
src/pages/baseInfoMana/empMana/index.tsx

@@ -1,319 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-09 10:56:43
- * @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
- */
-
-
-
-
-
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-import { ActionType, DrawerForm, EditableFormInstance, EditableProTable, ProFormCheckbox, ProFormInstance, ProFormSelect } from '@ant-design/pro-components';
-import { ModalForm, ProFormDigit, ProFormText, ProFormTextArea } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Switch } from 'antd';
-import { createRef, useEffect, useRef, useState } from 'react'
-
-import { addData, bindCheckGroupReq, bindUnitReq, delData, editData, getData } from './service';
-
-import './style.less';
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-import KCIMDrawerForm from '@/components/KCIMDrawerForm';
-import TableTransfer from './transform';
-import TableSelecter from './tableSelector';
-import { getCheckData } from '../checkGroupMana/service';
-import { debounce } from 'lodash';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-type TableDataResponse = {
-    data: any[];
-    success: boolean;
-    total: number;
-    pageSize: number;
-    totalPage: number;
-};
-
-
-
-export default function FenyeTemplate() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const [tableSelecterVisible, set_tableSelecterVisible] = useState(false);
-    const [tableSelecterType, set_tableSelecterType] = useState<'UNIT' | 'CHECKGROUP'>('UNIT'); //穿梭框类型
-
-    const [currentEdit, set_currentEdit] = useState<any | undefined>(undefined);
-
-    const columns: ProColumns[] = [
-
-        {
-            title: 'ID',
-            dataIndex: 'id',
-        },
-        // {
-        //     title: '工号',
-        //     dataIndex: 'employeeId',
-        // },
-        {
-            title: '用户名',
-            dataIndex: 'account',
-        },
-        {
-            title: '姓名',
-            dataIndex: 'name',
-        },
-        {
-            title: '查核组',
-            dataIndex: 'groupList',
-            ellipsis:true,
-            renderText(groupList, record, index, action) {
-                if (groupList) {
-                    return groupList.reduce((prev: string, next: any) => `${prev.length > 0 ? prev + ',' : prev}${next.name}`, '')
-                }
-            },
-        },
-        {
-            title: '单位名',
-            dataIndex: 'departList',
-            ellipsis: true,
-            renderText(departList, record, index, action) {
-                if (departList) {
-                    return departList.reduce((prev: string, next: any) => `${prev.length > 0 ? prev + ',' : prev}${next.name}`, '')
-                }
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 160,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <a key='unit' onClick={() => { openTransformModal(record); set_tableSelecterType('UNIT'); }}>单位</a>,
-                    <a key='checkGroup' onClick={() => { openTransformModal(record); set_tableSelecterType('CHECKGROUP'); }}>查核组</a>
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getData(params);
-        if (resp) {
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount
-            }
-        }
-        return []
-    }
-
-
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-        if (type == 'ADD') {
-            const result = {
-                name: formVal.name,
-                content: JSON.stringify(formVal.table),
-                remark: formVal.remark
-            }
-            const resp = await addData({ ...result });
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-            const result = {
-                id: formVal.id,
-                name: formVal.name,
-                employeeId: formVal.employeeId,
-                account: formVal.account,
-                permission: formVal.permission.join(',')
-            }
-            const resp = await editData({ ...result });
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-        }
-
-        return true;
-    }
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
-
-
-        const formRef = useRef<ProFormInstance<any>>();
-
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}权限`}
-                width={600}
-                initialValues={type == 'EDIT' ? { ...record, permission: record.roleList ? record.roleList.split(',') : [] } : {}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑权限</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val: any) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                formRef={formRef}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormCheckbox.Group
-                    name="permission"
-                    layout='horizontal'
-                    label="行业分布"
-                    options={[
-                        { label: '管理员', value: '1' },
-                        { label: '查核组长', value: '2' },
-                        { label: '查核组员', value: '3' },
-                        { label: '单位负责人', value: '4' },
-                        { label: '改善人', value: '5' },
-                        { label: '职能科室负责人', value: '6' },
-                        { label: '职能科室普通人员', value: '7' },
-                        { label: '自查人', value: '8' },
-                    ]}
-                />
-            </ModalForm>
-        )
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-    }
-
-
-    const openTransformModal = (record: any) => {
-        set_currentEdit(record);
-        set_tableSelecterVisible(true);
-    }
-
-
-
-    const tableSelecterCommit = async (keys: React.Key[], rows: any[]) => {
-        if (tableSelecterType == 'CHECKGROUP') {
-            const result = {
-                employeeId: currentEdit.employeeId,
-                employeeName: currentEdit.name,
-                groupList: rows.map((a: any) => ({
-                    code: a.code,
-                    name: a.name,
-                    isManager: a.flag ? 1 : 0
-                }))
-            }
-            const resp = await bindCheckGroupReq(result);
-            if (resp) {
-                set_tableSelecterVisible(false);
-                tableRef.current?.reload();
-            }
-        }
-        if (tableSelecterType == 'UNIT') {
-            const result = {
-                employeeId: currentEdit.employeeId,
-                employeeName: currentEdit.name,
-                departmentList: rows.map((a: any) => ({
-                    code: a.code,
-                    name: a.name,
-                    isManager: a.flag ? 1 : 0,
-                    isFunction: 0
-                }))
-            };
-            const resp = await bindUnitReq(result);
-            if (resp) {
-                set_tableSelecterVisible(false);
-                tableRef.current?.reload();
-            }
-
-        }
-    }
-
-    const debouncedFetch = debounce(async (keyWords, callback) => {
-        const resp = await getCheckData({ pageSize: 20, current: 1, filter: keyWords });
-        if (resp) {
-            callback(resp.list.map((a: any) => ({
-                label: a.name,
-                value: a.code,
-            })));
-        } else {
-            callback([]);
-        }
-    }, 300);
-
-
-    useEffect(() => {
-
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='empMana' title={false}>
-            <TableSelecter
-                onVisibleChange={(bool) => set_tableSelecterVisible(bool)}
-                title='关联'
-                rowKey={tableSelecterType == 'UNIT' ? 'code' : 'id'}
-                tableSelecterType={tableSelecterType}
-                record={currentEdit}
-                open={tableSelecterVisible}
-                onFinish={(keys, rows) => tableSelecterCommit(keys, rows)}
-            />
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem' style={{ marginRight: 16, width: 220 }}>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'请输入姓名/工号'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        filter: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    filter: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                {/* <div className='btnGroup'>
-                    <UpDataActBtn record type='ADD' />
-                </div> */}
-            </div>
-            <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 106
src/pages/baseInfoMana/empMana/service.ts

@@ -1,106 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-10-12 15:56:04
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-
-export type FenyeTemplateItemType = {
-  id:number;
-  hiId:number;
-  name:string;
-  content:string;
-  remark:string;
-  createUserId:number;
-  createUserName:string;
-  date:string
-}
-
-
-export const getData = (params?:any) => {
-  return request('/manager/Employee/getEmployee', {
-    method: 'GET',
-    params:{...params}
-  });
-};
-
-
-//新增表格数据 
-export type AddTableDataType = {
-  name:string;
-  content:string;
-  remark:string;
-}
-export const addData = (data:AddTableDataType) => {
-  return request('/manager/setting/addPageTemplate', {
-    method: 'POST',
-    data
-  });
-};
-
-
-//编辑权限
-export const editData = (data:{id:number,account:string,name:string,employeeId:number,permission:string}) => {
-  return request('/manager/Employee/editEmployeePermission', {
-    method: 'POST',
-    data
-  });
-};
-
-//关联单位
-export const bindUnitReq = (data:{
-  employeeId:string,
-  employeeName:string,
-  departmentList:{
-    code:string,
-    name:string,
-    isManager:number,
-    isFunction:number
-  }[]
-}) => {
-  return request('/manager/Employee/editDepartment', {
-    method: 'POST',
-    data
-  });
-};
-
-//关联查核组
-export const bindCheckGroupReq = (data:{
-  employeeId:string,
-  employeeName:string,
-  groupList:{
-    code:string,
-    name:string,
-    isManager:number,
-  }[]
-}) => {
-  return request('/manager/Employee/editCheckGroup', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-
-export const delData = (id:string) => {
-  return request('/manager/setting/deletePageTemplate', {
-    method: 'POST',
-    params:{id}
-  });
-};
-
-
-
-
-
-
-
-

+ 0 - 80
src/pages/baseInfoMana/empMana/style.less

@@ -1,80 +0,0 @@
-
-
-
-.TableSelecter {
-
-  .pfm-ant-modal-footer {
-    display: none !important;
-  }
-  
-  .footer {
-       display: flex;
-       flex-direction:row;
-       justify-content: flex-end;
-       margin-top: 15px;
-       span {
-           display: inline-block;
-           width: 56px;
-           height: 24px;  
-           font-size: 14px;
-           line-height: 23px;
-           text-align: center;
-           border-radius: 4px;
-           cursor: pointer;
-
-           &.ok {
-               color: #FFFFFF;
-               background:#3377FF;
-               margin-left: 8px;
-           }
-           &.cancel {
-               border: 1px solid #DAE2F2;
-           }
-       }
-
-  }
-}
-
-.empMana {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-    }
-
-  }
-}

+ 0 - 250
src/pages/baseInfoMana/empMana/tableSelector.tsx

@@ -1,250 +0,0 @@
-import React, { useEffect, useState } from "react";
-import { Input, Switch } from 'antd'
-import { KCIMTable } from "@/components/KCIMTable";
-import { createFromIconfontCN } from "@ant-design/icons";
-import { getChackGroupData, getCheckData } from "../checkGroupMana/service";
-
-import { ModalForm, ProColumns } from "@ant-design/pro-components";
-import { getData } from "../unitMana/service";
-import { set } from "lodash";
-
-// import './style.less';
-
-
-interface TableSelecterProps {
-    record: any
-}
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-
-const TableSelecter = ({ tableSelecterType, record, open, title, onVisibleChange, rowKey = 'id', request, onFinish }: {
-    record: any, open: boolean, title: string, onVisibleChange: (bool: boolean) => void,
-    tableSelecterType: 'UNIT' | 'CHECKGROUP',
-    rowKey?: string, request?: (params: any) => Promise<any>, onFinish?: (selectedKeys: React.Key[], selectedRows: any[]) => void
-}) => {
-
-
-    const Table = React.forwardRef(({ }: TableSelecterProps, ref) => {
-
-        const [datasource, set_datasource] = useState<any[]>([]);
-        const [selectedKeys, setSelectedKeys] = useState<React.Key[]>([]);
-        const [selectedRows, set_selectedRows] = useState<any[]>([]);
-        const [showList, set_showList] = useState<any[]>([]);
-
-
-        const unitColumns: ProColumns[] = [
-            {
-                title: 'Code',
-                dataIndex: 'code',
-            },
-            {
-                title: '单位名',
-                dataIndex: 'name',
-            },
-            {
-                title: '是否单位管理人',
-                dataIndex: 'flag',
-                renderText(flag, record, index, action) {
-                    return <Switch size='small' checked={flag} onChange={(bool) => onSwitchChange(bool, record)} />
-                },
-            }
-        ];
-        const checkGroupColumns: ProColumns[] = [
-            {
-                title: 'ID',
-                dataIndex: 'id',
-            },
-            {
-                title: '查核组名',
-                dataIndex: 'name',
-            },
-            {
-                title: '是否查核组长',
-                dataIndex: 'flag',
-                renderText(flag, record, index, action) {
-                    return <Switch size='small' checked={flag} onChange={(bool) => onSwitchChange(bool, record)} />
-                },
-            }
-        ];
-
-
-        const onSwitchChange = (bool: boolean, record: any) => {
-            const newData = datasource.map((item) => {
-                if (item.code == record.code) {
-                    return {
-                        ...item,
-                        flag: bool
-                    }
-                } else {
-                    return item
-                }
-            });
-            const newShowList = showList.map((item) => {
-                if (item.code == record.code) {
-                    return {
-                        ...item,
-                        flag: bool
-                    }
-                } else {
-                    return item
-                }
-            });
-
-            
-            set_datasource([...newData]);
-            set_showList([...newShowList]);
-        }
-
-        const onSelectChange = (newSelectedRowKeys: React.Key[], selectedRows: any) => {
-            setSelectedKeys([...newSelectedRowKeys]);
-            set_selectedRows([...selectedRows]);
-
-        };
-
-        const saveHandle = async () => {
-            const selectedRowCodes = selectedRows.map((a)=>a.code);
-            const rows = datasource.filter((a)=>selectedRowCodes.includes(a.code));
-            onFinish && onFinish(selectedKeys, rows);
-        }
-
-        const getTableData = async () => {
-            if(tableSelecterType == 'UNIT'){
-                const resp = await getData();
-                const checkedUnitCodes = record.departList?record.departList.map((a:any)=>a.code):[];
-                let selectedCodes:string[] = [];
-                let selectedRows:any[] = [];
-                if (resp) {
-                    const data = resp.map((a:any)=>{
-                        if(checkedUnitCodes.includes(a.code)){
-                            selectedCodes.push(a.code);
-                            selectedRows.push(a);
-                            const needItem = record.departList.filter((b:any)=>a.code == b.code);
-                            
-                             return {
-                                ...a,
-                                flag:needItem[0].isManager?true:false
-                             }
-                        }else{
-                             return a
-                        }
-                    });
-
-                    set_showList(data);
-                    set_selectedRows([...selectedRows]);
-                    setSelectedKeys([...selectedCodes]);
-                    set_datasource([...datasource, ...data]);
-                }
-            }
-            if(tableSelecterType == 'CHECKGROUP'){
-                const resp = await getCheckData({pageSize:500,current:1});
-                const checkedUnitCodes = record.groupList?record.groupList.map((a:any)=>a.code):[];
-                let selectedCodes:string[] = [];
-                let selectedRows:any[] = [];
-                if (resp) {
-                    const data = resp.list.map((a:any)=>{
-                          if(checkedUnitCodes.includes(a.code)){
-                            selectedCodes.push(a.code);
-                            selectedRows.push(a);
-                            const needItem = record.groupList.filter((b:any)=>a.code == b.code);
-                               return {
-                                  ...a,
-                                  flag:needItem[0].isManager?true:false
-                               }
-                          }else{
-                               return a
-                          }
-                    });
-                    set_showList(data);
-                    set_selectedRows([...selectedRows]);
-                    setSelectedKeys([...selectedCodes]);
-                    set_datasource([...datasource, ...data]);
-                }
-            }
-
-            return Promise.resolve([]);
-        }
-
- 
-
-        useEffect(() => {
-            getTableData()
-        }, [])
-
-
-        return (
-            <div >
-                <Input placeholder={tableSelecterType == 'UNIT'?'请输入单位名称':'请输入查核组名称'} allowClear autoComplete='off'
-                    suffix={
-                        <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />
-                    }
-                    style={{ marginBottom: 8 }}
-                    onChange={(e) => {
-                        if (e.target.value.length != 0) {
-                            const result = datasource.filter(item => item.name.indexOf(e.target.value) != -1);
-                            set_showList(result);
-                        } else {
-                            set_showList(datasource);
-                        }
-
-                    }}
-
-                />
-                <KCIMTable columns={tableSelecterType == 'UNIT' ? unitColumns : checkGroupColumns}
-                    options={{
-                        density: true,
-                        setting: {
-                            listsHeight: 100,
-                        },
-                    }}
-                    rowKey={rowKey}
-                    scroll={{ y: 400 }}
-                    tableAlertRender={false}
-                    rowSelection={{
-                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
-                        // 注释该行则默认不显示下拉选项
-                        // selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
-                        selectedRowKeys:selectedKeys,
-                        onChange: onSelectChange,
-                    }}
-                    pagination={{ showTitle: false, showSizeChanger: true }}
-                    dataSource={showList}
-
-                />
-                <div className='footer'>
-                    <span className='cancel' onClick={() => close()}>取消</span>
-                    <span className='ok' onClick={() => saveHandle()}>{`确认(${selectedKeys.length > 0 && selectedKeys.length})`}</span>
-                </div>
-            </div>
-
-        )
-    });
-
-    const close = () => {
-        onVisibleChange && onVisibleChange(false);
-    }
-
-
-    return (
-        <ModalForm className="TableSelecter" title={title} width={500} submitter={{
-            render: false
-        }} open={open} modalProps={{
-            closable: false,
-        }}>
-            <Table
-                // ref={tableSelecterRef}
-                record={undefined}
-            ></Table>
-        </ModalForm>
-    )
-
-}
-
-
-
-
-export default TableSelecter

+ 0 - 134
src/pages/baseInfoMana/empMana/transform.tsx

@@ -1,134 +0,0 @@
-import React, { useEffect, useImperativeHandle, useState } from "react";
-import {Transfer} from 'antd'
-import { TransferItem, TransferProps } from 'antd/es/transfer';
-import { ColumnsType } from 'antd/es/table';
-import { difference } from "lodash";
-import { TableRowSelection } from 'antd/es/table/interface';
-import { KCIMTable } from "@/components/KCIMTable";
-
-
-interface TableTransferProps extends TransferProps<TransferItem> {
-    leftColumns: ColumnsType<any>;
-    rightColumns: ColumnsType<any>;
-}
-
-const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, ...restProps }: TableTransferProps, ref) => {
-
-    const [_data, _set_data] = useState<any>();
-    const [targetKeys, setTargetKeys] = useState<string[]>([]);
-    const [datasource, set_datasource] = useState<any[]>([]);
-    const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
-
-    //获取单元
-    const getFuncList = 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);
-        // }
-    }
-
-    const onChange = (nextTargetKeys: string[]) => {
-        setTargetKeys(nextTargetKeys);
-    };
-
-    const onSelectChange = (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => {
-        //console.log('sourceSelectedKeys:', sourceSelectedKeys,'targetSelectedKeys:',targetSelectedKeys);
-        setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]);
-    };
-
-    useImperativeHandle(ref, () => ({
-        save: async () => {
-            // const items = datasource.filter(a => targetKeys.includes(a.empNo));
-            // const resp = await saveEmpsRequest(items);
-            // if (resp) {
-            //     tableRef.current?.reload();
-            // }
-        }
-    }));
-
-    useEffect(() => {
-        getFuncList();
-    }, [])
-
-    return (
-        <Transfer className='TableTransfer' showSearch
-            titles={['待选项', '已选项']}
-            locale={{
-                itemUnit: '项',
-                itemsUnit: '项',
-                searchPlaceholder: '请输入',
-            }}
-            oneWay={true}
-            onChange={onChange}
-            onSelectChange={onSelectChange}
-            dataSource={datasource}
-            rowKey={record => record.empNo}
-            targetKeys={targetKeys}
-            selectedKeys={selectedKeys}
-            filterOption={(inputValue, item) => {
-                return item.name!.indexOf(inputValue) !== -1
-
-            }}
-        >
-            {({
-                direction,
-                filteredItems,
-                onItemSelectAll,
-                onItemSelect,
-                selectedKeys: listSelectedKeys,
-                disabled: listDisabled,
-            }) => {
-
-                // console.log({ filteredItems, listSelectedKeys,direction });
-                const columns = direction === 'left' ? leftColumns : rightColumns;
-
-                const rowSelection: TableRowSelection<TransferItem> = {
-                    getCheckboxProps: (item) => ({ disabled: listDisabled || item.disabled }),
-                    onSelectAll(selected, selectedRows) {
-                        const treeSelectedKeys = selectedRows.map(({ empNo }) => empNo);
-                        const diffKeys = selected
-                            ? difference(treeSelectedKeys, listSelectedKeys)
-                            : difference(listSelectedKeys, treeSelectedKeys);
-                        onItemSelectAll(diffKeys as string[], selected);
-                    },
-                    onSelect({ empNo }, selected) {
-                        onItemSelect(empNo as string, selected);
-                    },
-                    selectedRowKeys: listSelectedKeys,
-                };
-
-                return (
-                    <KCIMTable
-                        rowSelection={rowSelection}
-                        columns={columns as TransferItem[]}
-                        dataSource={filteredItems}
-                        size="small"
-                        bordered={false}
-                        rowKey={'empNo'}
-                        pagination={{ showTitle: false, pageSize: 9, showLessItems: false, simple: true, showTotal: () => false }}
-                        tableAlertRender={false}
-                        style={{ pointerEvents: listDisabled ? 'none' : undefined }}
-                        onRow={({ empNo, disabled: itemDisabled }) => ({
-                            onClick: () => {
-                                if (itemDisabled || listDisabled) return;
-                                onItemSelect(empNo as string, !listSelectedKeys.includes(empNo as string));
-                            },
-                        })}
-                    />
-                );
-            }}
-        </Transfer>
-    )
-});
-
-export default TableTransfer
-
-

+ 0 - 270
src/pages/baseInfoMana/unitMana/index.tsx

@@ -1,270 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-09 10:56:09
- * @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
- */
-
-
-
-
-
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-import { ActionType, DrawerForm, EditableFormInstance, EditableProTable, ProFormInstance, ProFormSelect } from '@ant-design/pro-components';
-import { ModalForm, ProFormDigit, ProFormText, ProFormTextArea } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm } from 'antd';
-import React, { useEffect, useRef, useState } from 'react'
-
-import { addData, delData, editData, getData } from './service';
-
-import './style.less';
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-import KCIMDrawerForm from '@/components/KCIMDrawerForm';
-import TableSelecter from './tableSelector';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-type TableDataResponse = {
-    data: any[]; 
-    success: boolean; 
-    total: number; 
-    pageSize: number; 
-    totalPage: number;
-};
-
-export default function FenyeTemplate() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-
-    const [tableSelecterVisible, set_tableSelecterVisible] = useState(false);
-    const [tableSelecterType, set_tableSelecterType] = useState<'EMP' | 'CHECKGROUP'>('EMP'); //穿梭框类型
-
-    const [currentEdit,set_currentEdit] = useState<any|undefined>(undefined);
-
-    const columns: ProColumns[] = [
-
-        {
-            title: 'Code',
-            dataIndex: 'code',
-        },
-        {
-            title: '展示排序',
-            dataIndex: 'sort',
-        },
-        {
-            title: '单位名',
-            dataIndex: 'name',
-        },
-        {
-            title: '职能科室',
-            dataIndex: 'createUserName',
-        },
-        {
-            title: '单位负责人',
-            dataIndex: 'manager',
-            renderText(list, record, index, action) {
-                 if(list){
-                      return list.reduce((prev:string,cur:any)=>`${prev.length>0?prev+',':''}${cur.name}`,'')
-                 }
-            },
-        },
-        {
-            title: '备注',
-            dataIndex: 'remark',
-        },
-        {
-            title: '是否作废',
-            dataIndex: 'remark',
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 140,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <a key={'emp'} onClick={() => { openTransformModal(record);set_tableSelecterType('EMP');}} >人员</a>,
-                    // <a key={'theme'}>主题</a>,
-                    // <a key={'checkPoint'}>查核要点</a>
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getData(params);
-        if (resp) {
-            return {
-                data: resp,
-                success: true,
-            }
-            
-        }
-        return []
-    }
-
-    const openTransformModal = (record:any) => {
-        set_currentEdit(record);
-        set_tableSelecterVisible(true);
-    }
-
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-
-        const content = formVal.table.map((a: any) => ({
-
-        }))
-
-        if (type == 'ADD') {
-            const result = {
-                name: formVal.name,
-                content: JSON.stringify(formVal.table),
-                remark: formVal.remark
-            }
-            const resp = await addData({ ...result });
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-            const result = {
-                id: formVal.id,
-                name: formVal.name,
-                content: JSON.stringify(formVal.table),
-                remark: formVal.remark
-            }
-            const resp = await editData({ ...result });
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-        }
-
-        return true;
-    }
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
-
-
-        const formRef = useRef<ProFormInstance<any>>();
-        
-
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}单位`}
-                width={400}
-                initialValues={type == 'EDIT' ? { ...record, filedType: 'Text' } : { filedType: 'Text' }}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val: any) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                formRef={formRef}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText
-                    name="name"
-                    label="单位名称:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '名称不能为空!' }]}
-                />
-                <ProFormDigit name="sort" label='展示排序' />
-                <ProFormTextArea
-                    name="remark"
-                    label="备注:"
-                    placeholder="请输入"
-                />
-
-                
-            </ModalForm>
-        )
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-    }
-
-    const tableSelecterCommit = async (keys:React.Key[],rows:any[]) => {
-        
-    }
-
-
-    useEffect(() => {
-
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='unitMana' title={false}>
-            
-            <TableSelecter
-                onVisibleChange={(bool) => set_tableSelecterVisible(bool)}
-                title='关联'
-                rowKey='id'
-                tableSelecterType={tableSelecterType}
-                record={currentEdit}
-                open={tableSelecterVisible}
-                onFinish={(keys,rows)=>tableSelecterCommit(keys,rows)}
-            />
-
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem' style={{ marginRight: 16, width: 250 }}>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'请输入单位/负责人'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        filter: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    filter: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                {/* <div className='btnGroup'>
-                    <UpDataActBtn record type='ADD' />
-                </div> */}
-            </div>
-            <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 62
src/pages/baseInfoMana/unitMana/service.ts

@@ -1,62 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-10-12 17:11:48
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-
-export const getData = (params?:any) => {
-  return request('/manager/Department/getDepartmentList', {
-    method: 'GET',
-    params:{...params}
-  });
-};
-
-
-//新增表格数据 
-export type AddTableDataType = {
-  name:string;
-  content:string;
-  remark:string;
-}
-export const addData = (data:AddTableDataType) => {
-  return request('/manager/setting/addPageTemplate', {
-    method: 'POST',
-    data
-  });
-};
-
-
-//编辑表格数据
-
-export const editData = (data:{id:number}&AddTableDataType) => {
-  return request('/manager/setting/editPageTemplate', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-
-export const delData = (id:string) => {
-  return request('/manager/setting/deletePageTemplate', {
-    method: 'POST',
-    params:{id}
-  });
-};
-
-
-
-
-
-
-
-

+ 0 - 78
src/pages/baseInfoMana/unitMana/style.less

@@ -1,78 +0,0 @@
-
-.TableSelecter {
-
-  .pfm-ant-modal-footer {
-    display: none !important;
-  }
-  
-  .footer {
-       display: flex;
-       flex-direction:row;
-       justify-content: flex-end;
-       margin-top: 15px;
-       span {
-           display: inline-block;
-           width: 56px;
-           height: 24px;  
-           font-size: 14px;
-           line-height: 23px;
-           text-align: center;
-           border-radius: 4px;
-           cursor: pointer;
-
-           &.ok {
-               color: #FFFFFF;
-               background:#3377FF;
-               margin-left: 8px;
-           }
-           &.cancel {
-               border: 1px solid #DAE2F2;
-           }
-       }
-
-  }
-}
-
-.unitMana {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-    }
-
-  }
-}

+ 0 - 198
src/pages/baseInfoMana/unitMana/tableSelector.tsx

@@ -1,198 +0,0 @@
-import React, { useEffect, useState } from "react";
-import { Input, Switch } from 'antd'
-import { KCIMTable } from "@/components/KCIMTable";
-import { createFromIconfontCN } from "@ant-design/icons";
-import { getCheckData } from "../checkGroupMana/service";
-
-import { ModalForm, ProColumns } from "@ant-design/pro-components";
-import { getData } from "../empMana/service";
-
-// import './style.less';
-
-
-interface TableSelecterProps {
-    record: any
-}
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-
-const TableSelecter = ({ tableSelecterType, record, open, title, onVisibleChange, rowKey = 'id', request, onFinish }: {
-    record: any, open: boolean, title: string, onVisibleChange: (bool: boolean) => void,
-    tableSelecterType:string,
-    rowKey?: string, request?: (params: any) => Promise<any>, onFinish?: (selectedKeys: React.Key[], selectedRows: any[]) => void
-}) => {
-
-
-    const Table = React.forwardRef(({ }: TableSelecterProps, ref) => {
-
-        const [datasource, set_datasource] = useState<any[]>([]);
-        const [selectedKeys, setSelectedKeys] = useState<React.Key[]>([]);
-        const [selectedRows, set_selectedRows] = useState<any[]>([]);
-        const [showList, set_showList] = useState<any[]>([]);
-
-
-        const empColumns: ProColumns[] = [
-            {
-                title: 'ID',
-                dataIndex: 'id',
-            },
-            {
-                title: '姓名',
-                dataIndex: 'name',
-            },
-        ];
-        const checkGroupColumns: ProColumns[] = [
-            {
-                title: 'ID',
-                dataIndex: 'id',
-            },
-            {
-                title: '查核组名',
-                dataIndex: 'id',
-            },
-            {
-                title: '是否查核组长',
-                dataIndex: 'flag',
-                renderText(flag, record, index, action) {
-                    return <Switch size='small' checked={flag == '1'} onChange={(bool) => onSwitchChange(bool, record)} />
-                },
-            }
-        ];
-
-
-        const onSwitchChange = (bool: boolean, record: any) => {
-            const newData = datasource.map((item) => {
-                if (item.id == record.id) {
-                    return {
-                        ...item,
-                        flag: bool
-                    }
-                } else {
-                    return item
-                }
-            });
-            const newShowList = showList.map((item) => {
-                if (item.id == record.id) {
-                    return {
-                        ...item,
-                        flag: bool
-                    }
-                } else {
-                    return item
-                }
-            });
-
-            // console.log({newData,newShowList});
-            set_datasource([...newData]);
-            set_showList([...newShowList]);
-        }
-
-        const onSelectChange = (newSelectedRowKeys: React.Key[], selectedRows: any) => {
-            setSelectedKeys([...newSelectedRowKeys]);
-
-        };
-
-        const saveHandle = async () => {
-
-            onFinish && onFinish(selectedKeys, selectedRows);
-
-        }
-
-        const getTableData = async () => {
-            const resp = await getData({
-                current: 1,
-                pageSize: 500
-            });
-            if (resp) {
-                set_showList(resp.list);
-                set_datasource([...datasource, ...resp.list]);
-            }
-
-            return Promise.resolve([]);
-        }
-
-        useEffect(()=>{
-            console.log({record});
-        },[record]);
-
-        useEffect(() => {
-            getTableData()
-        }, [])
-
-
-        return (
-            <div >
-                <Input placeholder={'请输入名称'} allowClear autoComplete='off'
-                    suffix={
-                        <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />
-                    }
-                    style={{ marginBottom: 8 }}
-                    onChange={(e) => {
-                        if (e.target.value.length != 0) {
-                            const result = datasource.filter(item => item.name.indexOf(e.target.value) != -1);
-                            set_showList(result);
-                        } else {
-                            set_showList(datasource);
-                        }
-
-                    }}
-
-                />
-                <KCIMTable columns={tableSelecterType == 'EMP' ? empColumns : checkGroupColumns}
-                    options={{
-                        density: true,
-                        setting: {
-                            listsHeight: 100,
-                        },
-                    }}
-                    rowKey={rowKey}
-                    scroll={{ y: 400 }}
-                    tableAlertRender={false}
-                    rowSelection={{
-                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
-                        // 注释该行则默认不显示下拉选项
-                        // selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
-                        onChange: onSelectChange,
-                    }}
-                    pagination={{ showTitle: false, showSizeChanger: true }}
-                    dataSource={showList}
-
-                />
-                <div className='footer'>
-                    <span className='cancel' onClick={() => close()}>取消</span>
-                    <span className='ok' onClick={() => saveHandle()}>{`确认(${selectedKeys.length > 0 && selectedKeys.length})`}</span>
-                </div>
-            </div>
-
-        )
-    });
-
-    const close = () => {
-        onVisibleChange && onVisibleChange(false);
-    }
-
-
-    return (
-        <ModalForm className="TableSelecter" title={title} width={600} submitter={{
-            render: false
-        }} open={open} modalProps={{
-            closable: false,
-        }}>
-            <Table
-                // ref={tableSelecterRef}
-                record={undefined}
-            ></Table>
-        </ModalForm>
-    )
-
-}
-
-
-
-
-export default TableSelecter

+ 0 - 481
src/pages/baseSetting/accountingAccountSet/accountingSubMana/index.tsx

@@ -1,481 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-10-12 10:38: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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-
-import { ActionType, ProFormDependency, ProFormInstance, ProFormText, ProFormSelect, ProFormRadio } from '@ant-design/pro-components';
-import { ModalForm } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Tag, Tabs } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, delData, editData, getAccountingSubjectList, getAccountTypeDictReq } from './service';
-
-import './style.less';
-import { renameChildListToChildren } from '@/utils/tooljs';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-let currentRow: any = undefined;
-
- export const searchTree = (tree:any[], searchTerm:string) => {
-    const searchTermLower = searchTerm.toLowerCase();
-
-    function searchNode(node:any) {
-        const matchedChildren: any[] = [];
-
-        if (node.children && node.children.length > 0) {
-            node.children.forEach((child: any) => {
-                const matchedChild = searchNode(child);
-                if (matchedChild) {
-                    matchedChildren.push(matchedChild);
-                }
-            });
-        }
-
-        if (node.accountingName.toLowerCase().includes(searchTermLower) || node.accountingCode.toLowerCase().includes(searchTermLower)) {
-            return {
-                ...node,
-                children: matchedChildren.length > 0 ? matchedChildren : node.children
-            };
-        } else if (matchedChildren.length > 0) {
-            return {
-                ...node,
-                children: matchedChildren
-            };
-        }
-
-        return null;
-    }
-
-    return tree.map(rootNode => searchNode(rootNode)).filter(node => node !== null);
- }
-
-
- function sortTreeByCode(tree:any[], codeKey = 'accountingCode', childrenKey = 'children') {
-    // 首先对当前层级的节点按照 codeKey 进行排序
-    tree.sort((a, b) => {
-        return Number(a[codeKey]) - Number(b[codeKey]); // 按照 code 从小到大排序
-    });
-
-    // 然后对于每个节点的子节点,不进行排序,只递归下去
-    tree.forEach(node => {
-        if (node[childrenKey] && node[childrenKey].length > 0) {
-            sortTreeByCode(node[childrenKey], codeKey, childrenKey); // 递归处理子节点
-        }
-    });
-
-    return tree; // 返回排序后的树
-}
-
-
-
-export default function AccountingSubMana() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ accountType: 1 });
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [selectableLevelList, setSelectableLevelList] = useState([]);//可选的分摊层级列表
-    const [tabs, set_tabs] = useState<any[]>([]);
-    const [accountType, set_accountType] = useState<Key>(1);
-    const columns: ProColumns[] = [
-
-        {
-            title: '会计科目名称',
-            width: 400,
-            ellipsis: true,
-            fixed: 'left',
-            dataIndex: 'accountingName',
-        },
-        {
-            title: '会计科目编码',
-            dataIndex: 'accountingCode',
-        },
-        {
-            title: '会计科目类别',
-            dataIndex: 'typeName',
-        },
-        {
-            title: '成本类别',
-            hideInTable: accountType == 1,
-            dataIndex: 'costType',
-            renderText(type) {
-                return type == 1 ? '医疗成本' : type == 2 ? '医疗全成本' : '医院全成本'
-            },
-        },
-        {
-            title: '成本属性',
-            hideInTable: accountType == 1,
-            dataIndex: 'isBaseCost',
-            renderText(type) {
-                return type == 1 ? '固定成本' : '变动成本'
-            },
-        },
-        {
-            title: '可控类型',
-            dataIndex: 'controlType',
-            renderText(type) {
-                return type == 1 ? '不可控' : '可控'
-            },
-        },
-        {
-            title: '诊别',
-            dataIndex: 'medicalType',
-            renderText(type) {
-                return type == 0 ? '全院' : type == 1 ? '门诊' : '住院'
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 120,
-            fixed: 'right',
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn record={record} type='ADDCHILD' />,
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const {filter} = params;
-        const resp = await getAccountingSubjectList({ ...params, accountType,pageSize:500 });
-        if (resp) {
-            let data = [];
-            if(filter){
-                 data = searchTree(renameChildListToChildren(resp.list, 'child'),filter) 
-            }else{
-                data = renameChildListToChildren(resp.list, 'child')
-            }
-            return {
-                data:sortTreeByCode(data),
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData(record.id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | "ADDCHILD") => {
-
-        if (type == 'ADD' || type == 'ADDCHILD') {
-
-            let id = 0;
-            (type == 'ADDCHILD') && (id = formVal.id);
-
-            const result = accountType == 1 ? { ...formVal, accountingType: accountType, id: id } : { ...formVal, accountingType: accountType, id: id, };
-
-            const resp = await addData(result);
-            if (resp) {
-                currentRow = undefined;
-                tableRef.current?.reload();
-                message.success('操作成功!');
-
-            }
-
-        }
-        if (type == 'EDIT') {
-            try {
-                const resp = await editData({ ...formVal, isIncomeGroutSetSelect: false, isShareParamSelect: false, accountType });
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-            } catch (error) {
-                console.log({ error });
-            }
-
-        }
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADDCHILD' }) => {
-
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}会计科目`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record
-                } : { controlType: 1, medicalType: 0 }}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : type == 'ADDCHILD' ? <a className='add'>添加</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : type == 'ADDCHILD' ? { ...val, id: record.id } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText name='typeName' hidden />
-                <ProFormText
-                    label="会计科目编码"
-                    disabled={type == 'EDIT'}
-                    rules={[
-                        {
-                            required: true,
-                            message: '会计科目编码是必填项',
-                        },
-                    ]}
-                    name="accountingCode"
-                />
-                <ProFormText
-                    label="会计科目名"
-                    rules={[
-                        {
-                            required: true,
-                            message: '会计科目名是必填项',
-                        },
-                    ]}
-                    name="accountingName"
-                />
-                <ProFormDependency name={['accountingCode']}>
-                    {
-                        ({ accountingCode }) => {
-                            return accountType == 2 ? (
-                                <>
-                                    <ProFormSelect
-                                        rules={[
-                                            {
-                                                required: true,
-                                                message: '',
-                                            },
-                                        ]}
-                                        options={[
-                                            {
-                                                value: 0,
-                                                label: '不是',
-                                            },
-                                            {
-                                                value: 1,
-                                                label: '是',
-                                            },
-                                        ]}
-                                        name="isBaseCost"
-                                        label="是否固定成本"
-                                    />
-                                    <ProFormRadio.Group
-                                        name="costType"
-                                        label="成本类别"
-                                        rules={[
-                                            {
-                                                required: true,
-                                                message: '成本类别是必填项',
-                                            },
-                                        ]}
-                                        options={[
-                                            {
-                                                label: '医疗成本',
-                                                value: 1,
-                                            },
-                                            {
-                                                label: '医疗全成本',
-                                                value: 2,
-                                            },
-                                            {
-                                                label: '医院全成本',
-                                                value: 3,
-                                            },
-                                        ]}
-                                    />
-                                </>
-                            ) : <></>
-                        }
-                    }
-                </ProFormDependency>
-                <ProFormSelect
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择会计科目类别',
-                        },
-                    ]}
-                    request={async () => {
-                        const resp = await getAccountTypeDictReq(accountType as number);
-                        if (resp) {
-                            return resp.map((a: any) => ({ label: a.name, value: a.code }))
-                        }
-                        return []
-
-                    }}
-                    fieldProps={{
-                        onChange(value, option: any) {
-                            const { label } = option;
-                            formRef.current?.setFieldValue('typeName', label);
-                        },
-                    }}
-                    name="type"
-                    label="会计科目类别"
-                />
-                <ProFormRadio.Group
-                    name="controlType"
-                    label="可控类型"
-                    rules={[
-                        {
-                            required: true,
-                            message: '可控类型是必填项',
-                        },
-                    ]}
-                    options={[
-                        {
-                            label: '不可控',
-                            value: 1,
-                        },
-                        {
-                            label: '可控',
-                            value: 2,
-                        },
-                    ]}
-                />
-                <ProFormRadio.Group
-                    name="medicalType"
-                    label="就诊类别"
-                    rules={[
-                        {
-                            required: true,
-                            message: '就诊类别是必填项',
-                        },
-                    ]}
-                    options={[
-                        {
-                            label: '全院',
-                            value: 0,
-                        },
-                        {
-                            label: '门诊',
-                            value: 1,
-                        },
-                        {
-                            label: '住院',
-                            value: 3,
-                        },
-                    ]}
-                />
-
-            </ModalForm>
-        )
-    }
-
-    const onTabChanged = (key: Key) => {
-        set_accountType(key);
-        tableRef.current?.reload();
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    useEffect(() => {
-        set_tabs([
-            {
-                label: '收入',
-                key: 1,
-            },
-            {
-                label: '支出',
-                key: 2,
-            },
-        ])
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='AccountingSubMana' title={false}>
-            <div className='toolBar' >
-                <Tabs
-                    defaultActiveKey={tabs.length > 0 ? tabs[0].key : undefined}
-                    items={tabs}
-                    key={'key'}
-                    onChange={(key) => onTabChanged(key)}
-                />
-                <div className='filter' style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center',marginBottom:16 }}>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'会计科目编码/名称'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        filter: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    filter: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                    <div className='btnGroup'>
-                        <UpDataActBtn record type='ADD' />
-                    </div>
-                </div>
-
-            </div>
-
-            <div>
-                <KCIMTable pagination={false} columns={columns as ProColumns[]} scroll={{ y: 'calc(100vh - 270px)' }} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 42
src/pages/baseSetting/accountingAccountSet/accountingSubMana/style.less

@@ -1,42 +0,0 @@
-.AccountingSubMana {
-  padding: 16px;
-  padding-top: 0;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    // display: flex;
-    // flex-direction: row;
-    // justify-content: space-between;
-    // align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-        .add {
-          cursor: pointer;
-          display: inline-block;
-          font-size: 14px;
-          font-weight: 400;
-          color: #FFFFFF;
-          line-height: 24px;
-          padding: 0 14px;
-          background: #3377FF;
-          border-radius: 4px;
-        }
-    }
-  }
-}

+ 0 - 310
src/pages/baseSetting/accountingAccountSet/accountingSubMap/index.tsx

@@ -1,310 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-10-12 16:04:21
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-
-import { ActionType, ProFormDependency, ProFormInstance, ProFormText, ProFormSelect } from '@ant-design/pro-components';
-import { ModalForm } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Tag, Tabs } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { getAccountProductConnectableList, getAccountProductConnectList, saveAccountProductConnected } from './service';
-
-import './style.less';
-import TableSelecter from '@/components/KCIMTableSelector';
-import { renameChildListToChildren } from '@/utils/tooljs';
-import { searchTree } from '../accountingSubMana';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-const tableSelectorColumns = [
-    {
-        title: 'Id',
-        width:60,
-        dataIndex: 'id',
-    },
-    // {
-    //     title: '会计科目编码',
-    //     width:300,
-    //     dataIndex: 'accountingCode',
-    // },
-    {
-        title: '成本收入项目',
-        dataIndex: 'name',
-    },
-];
-
-
-function sortTreeByCode(tree:any[], codeKey = 'accountingCode', childrenKey = 'children') {
-    // 首先对当前层级的节点按照 codeKey 进行排序
-    tree.sort((a, b) => {
-        return Number(a[codeKey]) - Number(b[codeKey]); // 按照 code 从小到大排序
-    });
-
-    // 然后对于每个节点的子节点,不进行排序,只递归下去
-    tree.forEach(node => {
-        if (node[childrenKey] && node[childrenKey].length > 0) {
-            sortTreeByCode(node[childrenKey], codeKey, childrenKey); // 递归处理子节点
-        }
-    });
-
-    return tree; // 返回排序后的树
-}
-
-
-let currentRow:any = undefined;
-
-export default function AccountingSubMap() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ accountType: 1 });
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [tabs, set_tabs] = useState<any[]>([]);
-    const [accountType, set_accountType] = useState<Key>(1);
-    const [tableSelecterVisible,set_tableSelecterVisible] = useState(false);
-    const columns: ProColumns[] = [
-
-        {
-            title: '会计科目名称',
-            width: 400,
-            ellipsis: true,
-            dataIndex: 'accountingName',
-        },
-        {
-            title: '会计科目编码',
-            width:300,
-            ellipsis:true,
-            dataIndex: 'accountingCode',
-        },
-        {
-            title: '收入项目',
-            dataIndex: 'productVOs',
-            ellipsis:true,
-            renderText(productVOs, record) {
-                if (Array.isArray(productVOs)) {
-                    return productVOs.map((item, index) => { return <Tag key={index}>{item.productName}</Tag> })
-                } else {
-                    return <></>
-                }
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 80,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                const { isParent } = record;
-                return !isParent ? [
-                  <a
-                    key="config"
-                    onClick={() => {
-                      currentRow = record;
-                      set_tableSelecterVisible(true);
-                    }}
-                  >
-                    设置对应
-                  </a>,
-                ] : []
-            },
-        },
-
-    ]
-    const columnsTwo: ProColumns[] = [
-
-        {
-            title: '会计科目名称',
-            width: 400,
-            ellipsis: true,
-            dataIndex: 'accountingName',
-        },
-        {
-            title: '会计科目编码',
-            width:300,
-            dataIndex: 'accountingCode',
-        },
-        {
-            title: '成本项目',
-            dataIndex: 'productVOs',
-            ellipsis:true,
-            renderText(productVOs, record) {
-                if (Array.isArray(productVOs)) {
-                    return productVOs.map((item, index) => { return <Tag key={index}>{item.productName}</Tag> })
-                } else {
-                    return <></>
-                }
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 80,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                const { isParent } = record;
-                return !isParent ? [
-                  <a
-                    key="config"
-                    onClick={() => {
-                      currentRow = record;
-                      set_tableSelecterVisible(true);
-                    }}
-                  >
-                    设置对应
-                  </a>,
-                ] : []
-            },
-        },
-
-    ]
-
-
-
-    const getTableData = async (params: any) => {
-        const {filter} = params;
-        const resp = await getAccountProductConnectList({ ...params, accountType,pageSize:500 });
-        if (resp) {
-            let data = [];
-            if(filter){
-                 data = searchTree(renameChildListToChildren(resp.list, 'child'),filter) 
-            }else{
-                data = renameChildListToChildren(resp.list, 'child')
-            }
-            return {
-                data: sortTreeByCode(data),
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-
-    
-
-    const onTabChanged = (key: Key) => {
-        set_accountType(key);
-        tableRef.current?.reload();
-    }
-//productCode,productName
-    const getTableSelectorData = async () => {
-        const {responsibilityId,productVOs = []} = currentRow;
-        const defaultRows = productVOs?productVOs.map((a:any)=>({id:a.id,name:`${a.productName}[${a.productCode}]`})):[];
-        const resp = await getAccountProductConnectableList({responsibilityId,pageSize:500,current:1});
-        if(resp){
-            return [...resp,...defaultRows]
-        }        
-    }
-
-
-    const tableSelecterCommit = async (keys:Key[],rows:any[]) => {
-        const {id} = currentRow;
-        const resp = await saveAccountProductConnected({id,products:keys});
-        if(resp){
-             set_tableSelecterVisible(false)
-             tableRef.current?.reload();
-        }
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    useEffect(() => {
-        set_tabs([
-            {
-                label: '收入',
-                key: 1,
-            },
-            {
-                label: '支出',
-                key: 2,
-            },
-        ])
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='AccountingSubMap' title={false}>
-            <TableSelecter
-                columns={[...tableSelectorColumns]}
-                onVisibleChange={(bool) => set_tableSelecterVisible(bool)}
-                title='关联成本收入项目'
-                rowKey={'id'}
-                request={getTableSelectorData}
-                defaultSelectedKeys={(currentRow&&currentRow.productVOs)?[...(currentRow.productVOs).map((a:any)=>a.id)]:[]}
-                record={currentRow}
-                open={tableSelecterVisible}
-                onFinish={(keys, rows) => tableSelecterCommit(keys, rows)}
-            />
-            <div className='toolBar' >
-                <Tabs
-                    defaultActiveKey={tabs.length > 0 ? tabs[0].key : undefined}
-                    items={tabs}
-                    key={'key'}
-                    onChange={(key) => onTabChanged(key)}
-                />
-               <div className='filter' style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center'}}>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'会计科目编码/名称'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        filter: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    filter: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-            </div>
-
-            <div>
-                <KCIMTable pagination={false} columns={(accountType == 1?columns:columnsTwo) as ProColumns[]} scroll={{ y: 'calc(100vh - 230px)' }} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 54
src/pages/baseSetting/accountingAccountSet/accountingSubMap/service.ts

@@ -1,54 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-12-07 15:01:32
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-export const getAccountProductConnectList = (params:any) => {
-  return request('/costAccount/accountProduct/list', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-//获取责任中心对应可绑定科室列表
-export const getAccountProductConnectableList = (params:any) => {
-  
-  return request('/costAccount/product/getProducts', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-
-//保存绑定信息
-export const saveAccountProductConnected = (body:any) => {
-  return request('/costAccount/accountProduct/save', {
-    method: 'POST',
-    data:{...body},
-  });
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 42
src/pages/baseSetting/accountingAccountSet/accountingSubMap/style.less

@@ -1,42 +0,0 @@
-.AccountingSubMap {
-  padding: 16px;
-  padding-top: 0;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-        .add {
-          cursor: pointer;
-          display: inline-block;
-          font-size: 14px;
-          font-weight: 400;
-          color: #FFFFFF;
-          line-height: 24px;
-          padding: 0 14px;
-          background: #3377FF;
-          border-radius: 4px;
-        }
-    }
-  }
-}

+ 0 - 451
src/pages/baseSetting/accountingAccountSet/chargeItemMap/index.tsx

@@ -1,451 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-09 10:55:13
- * @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
- */
-
-
-import { createFromIconfontCN } from '@ant-design/icons';
-import { ActionType } from '@ant-design/pro-components';
-import { ModalForm, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
-import { ProColumns } from '@ant-design/pro-table';
-import { Dropdown, Input, MenuProps, message, Tooltip, Popconfirm, TreeProps } from 'antd';
-
-import { Key } from 'react';
-import { useEffect, useRef, useState } from 'react';
-import DirectoryTree from 'antd/es/tree/DirectoryTree';
-import { DataNode } from 'antd/es/tree';
-
-import { getAccountingItemMap, addTableData, delData, getAccountingList, batchDelTableData } from './service';
-
-
-import './style.less';
-
-import expandedIcon from '../../../../../static/treenode_open.png';
-import closeIcon from '../../../../../static/treenode_collapse.png';
-
-
-import '../../../../utils/zhongtaiB'
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-import { getTargetDic } from '@/services/auth';
-import TableSelecter from './tableSelector';
-import { getDeepestTreeData } from '@/utils/tooljs';
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-let _currentSelectedType: any = undefined;
-
-const ChargeItemMap = () => {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-
-    const [currentSelectedType, set_currentSelectedType] = useState<any | undefined>(undefined);
-    const [treeData, set_treeData] = useState<any[]>([]);
-    const [currentSelectedTreeNode, set_currentSelectedTreeNode] = useState<null | any>(null);
-    const [expandedKeys, set_expandedKeys] = useState<Key[]>([]);
-    const [autoExpandParent, set_autoExpandParent] = useState(true);
-    const [searchValue, set_searchValue] = useState('');
-    const [currentTreeDataFilter, set_currentTreeDataFilter] = useState({ name: '全部', code: 0 });
-    const [treeFilterVisible, set_treeFilterVisible] = useState(false);
-    const [selectedRowKeys,set_selectedRowKeys] = useState<Key[]>([]);
-
-    const [tableSelecterVisible, set_tableSelecterVisible] = useState(false);
-
-    const [treeDataDefault, set_treeDataDefault] = useState<any[]>([]);
-
-    const [leftDataSearchKeyVal, set_leftDataSearchKeyVal] = useState<undefined | string>(undefined);
-
-    const tableRef = useRef<ActionType>();
-
-    const column: ProColumns[] = [
-
-        {
-            title: '收费项目代码',
-            ellipsis: true,
-            width: 120,
-            dataIndex: 'itemCode',
-
-        },
-        {
-            title: '收费项目名称',
-            dataIndex: 'itemName',
-
-        },
-        {
-            title: '收费项目类别',
-            width: 100,
-            dataIndex: 'typeName',
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 60,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record.id)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>
-                ]
-            },
-        },
-    ]
-
-
-    const getTableData = async (params: any) => {
-
-        const resp = await getAccountingItemMap({ ...params });
-        if (resp) {
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        } else {
-            return []
-        }
-    }
-
-
-    //获取左侧列表
-    const getPageLeftData = async () => {
-        const resp = await getAccountingList('', currentTreeDataFilter.code);
-        if(resp){
-            set_treeData(resp);
-            set_treeDataDefault(resp);
-            set_currentSelectedTreeNode(null);
-        } 
-    }
-
-    const delTableData = async (id: number) => {
-        const resp = await delData(id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-        }
-    }
-
-
-    const tableSelecterCommit = async (keys: Key[], rows: any[]) => {
-
-        const arr = rows.map((a, index) => ({
-            itemCode: a.itemCode,
-            itemName: a.itemName,
-            type: a.itemType,
-        }));
-        const result = {
-            accountingCode: currentSelectedTreeNode.accountingCode,
-            accountingName: currentSelectedTreeNode.accountingName,
-            itemMaps: arr
-        }
-        const resp = await addTableData(result);
-        if (resp) {
-            message.success('操作成功');
-            set_tableSelecterVisible(false);
-            tableRef.current?.reload();
-        }
-    }
-
-
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    const batchDelHandle = async () => {
-        const resp = await batchDelTableData(selectedRowKeys);
-        if (resp) {
-            message.success('操作成功!');
-            set_selectedRowKeys([]);
-            tableRef.current?.reload();
-        }
-    }
-
-
-    const onSelect: TreeProps['onSelect'] = (selectedKeys, info: any) => {
-        const { node } = info;
-        if (!node.children || node.children.length == 0) {
-            set_currentSelectedTreeNode(node);
-        }
-    };
-
-    const onExpand = (newExpandedKeys: React.Key[]) => {
-        // setExpandedKeys(newExpandedKeys);
-        // setAutoExpandParent(false);
-        set_expandedKeys(newExpandedKeys);
-        set_autoExpandParent(false);
-    };
-
-
-    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.children) {
-                if (node.children.some((item: { accountingCode: React.Key; }) => item.accountingCode === key)) {
-                    parentKey = node.accountingCode;
-                } else if (getParentKey(key, node.children)) {
-                    parentKey = getParentKey(key, node.children);
-                }
-            }
-        }
-        return parentKey!;
-    };
-
-    const generateList = (data: any[]) => {
-        for (let i = 0; i < data.length; i++) {
-            const node = data[i];
-            dataList.push(node);
-            if (node.children) {
-                generateList(node.children);
-            }
-        }
-    };
-
-    generateList(treeData as any);
-
-
-    const onTreeSearchKeyChange = (e: React.ChangeEvent<HTMLInputElement>) => {
-
-        const { value } = e.target;
-
-        const newExpandedKeys = dataList
-            .map((item) => {
-                if (item.accountingName.indexOf(value) > -1) {
-                    return getParentKey(item.accountingCode, treeData);
-                }
-                return null;
-            });
-
-        set_expandedKeys(newExpandedKeys as React.Key[]);
-        set_searchValue(value);
-        set_autoExpandParent(true);
-    }
-
-    //左侧树结构筛选
-    const changeTreeDataFilter = (obj: any) => {
-
-        set_currentTreeDataFilter(obj);
-        set_treeFilterVisible(false);
-    }
-
-
-
-    useEffect(() => {
-
-        if (currentSelectedTreeNode) {
-            set_tableDataFilterParams({ ...tableDataFilterParams, accountingCode: currentSelectedTreeNode.accountingCode });
-        }
-    }, [currentSelectedTreeNode])
-
-    useEffect(() => {
-        //初始化左侧树结构数据后
-        
-        if (treeData?.length > 0) {
-            if (!currentSelectedTreeNode) {
-                if (treeData[0].children && treeData[0].children.length > 0) {
-                    const [node, nodeParent] = getDeepestTreeData(treeData[0], 'children');
-                    set_currentSelectedTreeNode(node);
-                    set_expandedKeys([nodeParent.accountingCode]);
-                } else {
-                    set_currentSelectedTreeNode(treeData[0]);
-                    set_expandedKeys([treeData[0].accountingCode]);
-                }
-
-            }
-        }
-    }, [treeData]);
-
-    useEffect(() => {
-        getPageLeftData();
-    }, [currentTreeDataFilter])
-
-    useEffect(() => {
-        getPageLeftData();
-    }, [])
-
-
-
-    return (
-        <KCIMPagecontainer title={false} className='ChargeItemMap'>
-            <TableSelecter
-                onVisibleChange={(bool) => set_tableSelecterVisible(bool)}
-                title='添加'
-                rowKey={'itemCode'}
-                defaultSelectedKeys={[]}
-                record={_currentSelectedType}
-                open={tableSelecterVisible}
-                onFinish={(keys, rows) => tableSelecterCommit(keys, rows)}
-            />
-
-            {selectedRowKeys.length > 0 && (
-                <div className='bottomBar'>
-                    <span>已选择<a>{selectedRowKeys.length}</a>项</span>
-                    <a onClick={() => batchDelHandle()}>批量删除</a>
-                </div>
-            )}
-
-            {
-                treeFilterVisible && (
-                    <div className='selecterList'>
-                        <div onClick={() => changeTreeDataFilter({ name: '全部', code: 0 })} className={currentTreeDataFilter.code == 0 ? 'list on' : 'list'}>全部</div>
-                        <div onClick={() => changeTreeDataFilter({ name: '已对照', code: 1 })} className={currentTreeDataFilter.code == 1 ? 'list on' : 'list'}>{'已对照'}</div>
-                        <div onClick={() => changeTreeDataFilter({ name: '未对照', code: 3 })} className={currentTreeDataFilter.code == 3 ? 'list on' : 'list'}>{'未对照'}</div>
-                    </div>
-                )
-            }
-
-            <div className='left'>
-                <div className='toolbar'>
-                    <Input placeholder={'会计科目名称'} allowClear autoComplete='off'
-                        suffix={
-                            <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} />
-                        }
-                        value={leftDataSearchKeyVal}
-                        style={{ width: 156 }}
-                        onChange={onTreeSearchKeyChange}
-                    />
-                    <Tooltip placement="top" title={currentTreeDataFilter.name}>
-                        <div className={currentTreeDataFilter.code == 0 ? 'filter' : currentTreeDataFilter.code == 1 ? 'filter blue' : 'filter orange'} onClick={() => set_treeFilterVisible(true)}></div>
-                    </Tooltip>
-
-
-                </div>
-
-                <div className='wrap'>
-                    {
-                        treeData && treeData.length > 0 && currentSelectedTreeNode && (
-                            <DirectoryTree
-                                fieldNames={{ title: 'accountingName', key: 'accountingCode' }}
-                                rootStyle={{ height: '100%', paddingBottom: 50, padding: '0 16px' }}
-                                onSelect={onSelect}
-                                onExpand={onExpand}
-                                expandedKeys={expandedKeys}
-                                autoExpandParent={autoExpandParent}
-                                selectedKeys={[currentSelectedTreeNode.accountingCode]}
-                                blockNode={true}
-
-                                icon={() => null}
-
-                                titleRender={
-                                    (nodeData: any) => {
-                                        const strTitle = nodeData.accountingName 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: '#3377ff', 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={[currentSelectedTreeNode.accountingCode]}
-                                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>
-            <div className='right'>
-                <div className='toolBar'>
-                    <div className='filter'>
-                        <div className='filterItem'>
-                            <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                            <Input placeholder={'收费项目名称'} allowClear autoComplete='off'
-                                suffix={
-                                    <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('itemName')} />
-                                }
-                                onChange={(e) => {
-                                    set_tableDataSearchKeywords(e.target.value);
-                                    if (e.target.value.length == 0) {
-                                        set_tableDataFilterParams({
-                                            ...tableDataFilterParams,
-                                            itemName: ''
-                                        });
-                                    }
-                                }}
-                                onPressEnter={(e) => {
-
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        itemName: (e.target as HTMLInputElement).value
-                                    });
-                                }}
-
-                            />
-                        </div>
-                    </div>
-                    <div className='btnGroup'>
-                        <span className='add' onClick={() => set_tableSelecterVisible(true)}>添加</span>
-                    </div>
-                </div>
-                <div style={{ marginTop: 16 }}>
-                    {currentSelectedTreeNode && <KCIMTable actionRef={tableRef} columns={column}
-                        scroll={{ y: 500 }}
-                        rowKey='id'
-                        params={tableDataFilterParams}
-                        request={(params) => getTableData(params)}
-                        tableAlertRender={false}
-                        rowSelection={{
-                            onChange(selectedRowKeys, selectedRows, info) {
-                                set_selectedRowKeys(selectedRowKeys);
-                            },
-                        }}
-                    />}
-                </div>
-            </div>
-        </KCIMPagecontainer>
-    )
-}
-
-
-export default ChargeItemMap;
-function getParentKey(code: any, treeData: any[]) {
-    throw new Error('Function not implemented.');
-}
-

+ 0 - 76
src/pages/baseSetting/accountingAccountSet/chargeItemMap/service.ts

@@ -1,76 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-07 11:12:10
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-30 10:34:32
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { string } from 'mathjs';
-import { Key } from 'react';
-import { request } from 'umi';
-
-
-//获取左侧数据
-export const getAccountingList = (accountingName:string,type:number) => {
-  return request('/costAccount/setting/getAccountingList', {
-    method: 'GET',
-    params:{accountingName,type}
-  });
-};
-
-//获取右侧表格数据
-
-export const getAccountingItemMap = (params:{accountingCode:string,itemName?:string,pageSize:number,current:number}) => {
-    return request('/costAccount/setting/getAccountingItemMap', {
-      method: 'GET',
-      params:{...params}
-    });
-};
-
-//获取可添加列表
-export const getAddableTableData = (type:number,name?:string) => {
-  return request('/costAccount/setting/getAccountingItemDictList', {
-    method: 'GET',
-    params:{type,name}
-  });
-};
-
-
-
-//新增表格数据
-
-export const addTableData = (data:any) => {
-  return request('/costAccount/setting/addAccountingItemMap', {
-    method: 'POST',
-    data
-  });
-};
-
-
-
-
-//删除表格操作
-export const delData = (id:number) => {
-    return request('/costAccount/setting/deleteAccountingItemMap', {
-      method: 'POST',
-      params:{id}
-    });
-};
-
-
-//批量删除表格数据
-export const batchDelTableData = (ids:Key[]) => {
-  return request('/costAccount/setting/batchDeleteAccountingItemMap', {
-    method: 'POST',
-    data:[...ids]
-  });
-};
-
-
-
-
-

+ 0 - 260
src/pages/baseSetting/accountingAccountSet/chargeItemMap/style.less

@@ -1,260 +0,0 @@
-.row-dragging {
-
-  .cost-ant-table-cell {
-    width: 130px;
-  }
-}
-
-.TableSelecter {
-
-  .pfm-ant-modal-footer {
-    display: none !important;
-  }
-
-  .footer {
-    display: flex;
-    flex-direction: row;
-    justify-content: flex-end;
-    margin-top: 15px;
-
-    span {
-      display: inline-block;
-      width: 56px;
-      height: 24px;
-      font-size: 14px;
-      line-height: 23px;
-      text-align: center;
-      border-radius: 4px;
-      cursor: pointer;
-
-      &.ok {
-        color: #FFFFFF;
-        background: #3377FF;
-        margin-left: 8px;
-      }
-
-      &.cancel {
-        border: 1px solid #DAE2F2;
-      }
-    }
-
-  }
-}
-
-.ChargeItemMap {
-  width: 100%;
-  height: calc(100vh - 48px);
-  position: relative;
-
-  .bottomBar {
-    position: absolute;
-    bottom: -16px;
-    left: -16px;
-    width: 102.5%;
-    height: 48px;
-    display: flex;
-    padding: 0 16px;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    background: #FFFFFF;
-    box-shadow: 0px -8px 16px 0px rgba(64, 85, 128, 0.1);
-
-    &>span {
-      font-size: 14px;
-      font-weight: 400;
-      color: #17181A;
-    }
-
-    &>a {
-      width: 80px;
-      height: 24px;
-      line-height: 24px;
-      font-size: 14px;
-      font-weight: 400;
-      color: #FFFFFF;
-      text-align: center;
-      background: #3377FF;
-      border-radius: 4px;
-    }
-  }
-
-  .selecterList {
-    position: absolute;
-    z-index: 99;
-    top: 44px;
-    left: 180px;
-    width: 120px;
-    height: 104px;
-    background: #FFFFFF;
-    box-shadow: 0px 8px 16px 0px rgba(64, 85, 128, 0.1);
-    border-radius: 4px;
-    padding: 4px;
-
-    .list {
-      position: relative;
-      height: 32px;
-      line-height: 16px;
-      border-radius: 2px;
-      font-size: 14px;
-      cursor: pointer;
-      padding: 8px;
-      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-      font-weight: 400;
-      color: #17181A;
-
-      &.on {
-        font-weight: 500;
-        background: rgba(51, 119, 255, 0.08);
-
-        &::after {
-          position: absolute;
-          right: 8px;
-          display: inline-block;
-          content: '';
-          width: 16px;
-          height: 16px;
-          background: url('../../../../../static/gou_blue.png');
-          background-size: contain;
-        }
-      }
-    }
-  }
-
-  .left {
-    float: left;
-    border-radius: 4px;
-    width: 220px;
-    height: calc(100vh - 80px);
-    overflow: hidden;
-    margin-right: 16px;
-    padding: 16px 0px;
-    background: #FFFFFF;
-
-
-    .toolbar {
-      display: flex;
-      flex-direction: row;
-      justify-content: space-between;
-      align-items: center;
-      padding: 0 16px;
-
-      .filter {
-        position: relative;
-        width: 24px;
-        height: 24px;
-        background: #FAFCFF;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-        margin-left: 8px;
-        cursor: pointer;
-        background: url('../../../../../static/filter.png');
-        background-size: 16px 16px;
-        background-position: center;
-        background-repeat: no-repeat;
-
-        &.orange {
-          &::after {
-            position: absolute;
-            z-index: 9;
-            top: 1px;
-            right: 1px;
-            display: inline-block;
-            content: '';
-            width: 4px;
-            height: 4px;
-            border-radius: 50%;
-            background: #FF9832;
-          }
-        }
-
-        &.blue {
-          &::after {
-            position: absolute;
-            z-index: 9;
-            top: 1px;
-            right: 1px;
-            display: inline-block;
-            content: '';
-            width: 4px;
-            height: 4px;
-            border-radius: 50%;
-            background: #3377FF;
-          }
-        }
-      }
-    }
-
-    .wrap {
-      margin-top: 16px;
-      height: calc((100vh - 80px) - 75px);
-      overflow: hidden;
-      overflow-y: scroll;
-      // border: 1px solid red;
-
-      .cos-ant-tree.cos-ant-tree-directory .cos-ant-tree-treenode-selected:hover::before,
-      .cos-ant-tree.cos-ant-tree-directory .cos-ant-tree-treenode-selected::before {
-        border-radius: 4px;
-        background: rgb(240 242 245 / 100%);
-      }
-
-      .cos-ant-tree.cos-ant-tree-directory .cos-ant-tree-treenode .cos-ant-tree-node-content-wrapper.cos-ant-tree-node-selected {
-        font-weight: bold;
-
-      }
-
-      .cost-ant-tree.cost-ant-tree-directory .cost-ant-tree-treenode-selected::before {
-        border-radius: 4px;
-        background: rgb(240 242 245 / 100%);
-      }
-
-    }
-  }
-
-  .right {
-    float: left;
-    width: calc(100% - 236px);
-    padding: 16px;
-    border-radius: 4px;
-    background: #FFFFFF;
-
-    .toolBar {
-      display: flex;
-      flex-direction: row;
-      justify-content: space-between;
-      align-items: center;
-
-      .filter {
-        display: flex;
-        flex-direction: row;
-        justify-content: flex-start;
-        align-items: center;
-
-        .filterItem {
-          display: flex;
-          flex-direction: row;
-          justify-content: center;
-          align-items: center;
-        }
-      }
-
-      .btnGroup {
-        .add {
-          cursor: pointer;
-          display: inline-block;
-          font-size: 14px;
-          font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-          font-weight: 400;
-          color: #FFFFFF;
-          line-height: 24px;
-          padding: 0 14px;
-          background: #3377FF;
-          border-radius: 4px;
-          margin-left: 8px;
-        }
-      }
-
-
-    }
-  }
-}

+ 0 - 201
src/pages/baseSetting/accountingAccountSet/chargeItemMap/tableSelector.tsx

@@ -1,201 +0,0 @@
-import React, { Key, useEffect, useState } from "react";
-import { Input, Select } from 'antd'
-import { KCIMTable } from "@/components/KCIMTable";
-import { createFromIconfontCN } from "@ant-design/icons";
-
-
-import { ModalForm, ProColumns, ProFormSelect, ProFormText } from "@ant-design/pro-components";
-
-import { set } from "lodash";
-import { getAddableTableData } from "./service";
-
-
-// import './style.less';
-
-
-interface TableSelecterProps {
-    record: any
-}
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-
-const TableSelecter = ({ record, open, title, onVisibleChange, rowKey = 'id', request, onFinish, defaultSelectedKeys }: {
-    record: any, open: boolean, title: string, onVisibleChange: (bool: boolean) => void, defaultSelectedKeys: Key[],
-    rowKey?: string, request?: (params: any) => Promise<any>, onFinish?: (selectedKeys: React.Key[], selectedRows: any[]) => void
-}) => {
-
-
-    const Table = React.forwardRef(({ }: TableSelecterProps, ref) => {
-
-        const [datasource, set_datasource] = useState<any[]>([]);
-        const [selectedKeys, setSelectedKeys] = useState<React.Key[]>([]);
-        const [selectedRows, set_selectedRows] = useState<any[]>([]);
-        const [showList, set_showList] = useState<any[]>([]);
-        const [type, set_type] = useState<number>(3);
-        const [keyword, set_keyword] = useState<string | undefined>(undefined);
-
-
-        const columns: ProColumns[] = [
-            {
-                title: '收费项目代码',
-                ellipsis:true,
-                dataIndex: 'itemCode',
-            },
-            {
-                title: '收费项目名称',
-                ellipsis:true,
-                dataIndex: 'itemName',
-            }
-        ];
-
-
-        const onSelectChange = (newSelectedRowKeys: React.Key[], selectedRows: any) => {
-            setSelectedKeys([...newSelectedRowKeys]);
-            set_selectedRows([...selectedRows]);
-
-        };
-
-        const saveHandle = async () => {
-            const selectedRowCodes = selectedRows.map((a) => a[`${rowKey}`]);
-            const rows = datasource.filter((a) => selectedRowCodes.includes(a[`${rowKey}`]));
-            onFinish && onFinish(selectedKeys, rows);
-        }
-
-        const getTableData = async () => {
-            const resp = await getAddableTableData(type);
-
-            let selectedCodes: string[] = [];
-            let selectedRows: any[] = [];
-            if (resp) {
-                const data = resp.map((a: any) => {
-                    if (defaultSelectedKeys.includes(a[`${rowKey}`])) {
-                        selectedCodes.push(a[`${rowKey}`]);
-                        selectedRows.push(a);
-                        const needItem = record.departList.filter((b: any) => a[`${rowKey}`] == b[`${rowKey}`]);
-
-                        return {
-                            ...a,
-                            flag: needItem[0].isManager ? true : false
-                        }
-                    } else {
-                        return a
-                    }
-                });
-
-                set_showList(data);
-                set_selectedRows([...selectedRows]);
-                setSelectedKeys([...selectedCodes]);
-                set_datasource([...datasource, ...data]);
-            }
-
-
-            return Promise.resolve([]);
-        }
-
-        useEffect(() => {
-            // console.log({code, keyword});
-            const result = datasource.filter((a) => {
-                return a.itemName.indexOf(keyword) != -1 
-            });
-
-            set_showList([...result]);
-        }, [keyword]);
-
-        useEffect(()=>{
-            getTableData()
-        },[type]);
-
-
-        return (
-            <div >
-                <div className="filter" style={{marginBottom:8,display:'flex',flexDirection:'row',alignItems:'center'}}>
-                    <ProFormSelect
-                         noStyle
-                         style={{marginRight:8}}
-                         options={[
-                            {label:'药品',value:1},
-                            {label:'材料',value:2},
-                            {label:'项目',value:3}
-                         ]}
-                         fieldProps={{
-                             defaultValue:3,
-                             onChange(value, option) {
-                                set_type(value);
-                                set_keyword('');
-                             },
-                         }}
-                    />
-                    <ProFormText noStyle placeholder={'项目名称'}
-                        fieldProps={{
-                            value:keyword,
-                            suffix: <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />,
-                            onChange: (e) => {
-                                if (e.target.value.length != 0) {
-                                    set_keyword(e.target.value);
-                                } else {
-                                    set_keyword('');
-                                }
-                            }
-                        }}
-                    />
-                </div>
-
-                <KCIMTable columns={columns}
-                    options={{
-                        density: true,
-                        setting: {
-                            listsHeight: 100,
-                        },
-                    }}
-                    rowKey={rowKey}
-                    scroll={{ y: 400 }}
-                    tableAlertRender={false}
-                    rowSelection={{
-                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
-                        // 注释该行则默认不显示下拉选项
-                        // selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
-                        selectedRowKeys: selectedKeys,
-                        onChange: onSelectChange,
-                    }}
-                    pagination={{ showTitle: false, showSizeChanger: true,simple:true }}
-                    dataSource={showList}
-
-                />
-                <div className='footer'>
-                    <span className='cancel' onClick={() => close()}>取消</span>
-                    <span className='ok' onClick={() => saveHandle()}>{`确认(${selectedKeys.length > 0 && selectedKeys.length})`}</span>
-                </div>
-            </div>
-
-        )
-    });
-
-    const close = () => {
-        onVisibleChange && onVisibleChange(false);
-    }
-
-
-    return (
-        <ModalForm className="TableSelecter" title={title} width={400} submitter={{
-            render: false
-        }} open={open} modalProps={{
-            closable: false,
-        }}>
-            <Table
-                // ref={tableSelecterRef}
-                record={undefined}
-            ></Table>
-        </ModalForm>
-    )
-
-}
-
-
-
-
-export default TableSelecter

+ 0 - 292
src/pages/baseSetting/accountingAccountSet/costIncomeProjectMana/index.tsx

@@ -1,292 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-29 15:47:04
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-import FormItem from 'antd/es/form/FormItem';
-
-import { ActionType, ProFormInstance, ProFormText } from '@ant-design/pro-components';
-import { ModalForm } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Tag } from 'antd';
-import { useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { delData, editData, addCostProject, getCostProjecttList, importDataPost } from './service';
-
-import './style.less';
-import KCIMUpload from '@/components/KCIMUpload';
-import { downloadTemplateReq } from '@/utils/tooljs';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-export default function CostIncomeProjectMana() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const columns: ProColumns[] = [
-
-        {
-            title: 'Id',
-            dataIndex: 'id',
-        },
-        {
-            title: '成本编号',
-            dataIndex: 'productCode',
-        },
-        {
-            title: '成本项目名称',
-            dataIndex: 'productName',
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 120,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getCostProjecttList({ ...params });
-        if (resp) {
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData(record.id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-
-        if (type == 'ADD') {
-
-            const result = { ...formVal };
-            const resp = await addCostProject(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-            try {
-                const { responsibilityLevel = 0, selectedSharelevel = [], shareId } = formVal;
-                let body = {};
-                if (selectedSharelevel.length == 0) {
-                    //没有修改分摊层级
-                    body = { ...formVal }
-                }
-
-                if (Object.prototype.toString.call(selectedSharelevel) == '[object Object]') {
-                    //修改了分摊层级
-                    //  console.log('修改了分摊层级');
-                    body = { ...formVal, shareId: selectedSharelevel.id, shareName: selectedSharelevel.shareName, shareLevel: selectedSharelevel.leverSort }
-                }
-
-                const resp = await editData({ ...body });
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-            } catch (error) {
-                console.log({ error });
-            }
-
-        }
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
-
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}成本项目`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                } : {}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText
-                    label="成本项目编码"
-                    rules={[
-                        {
-                            required: true,
-                            message: '成本项目编码是必填项',
-                        },
-                    ]}
-                    name="productCode"
-                />
-                <ProFormText
-                    label="成本项目名"
-                    rules={[
-                        {
-                            required: true,
-                            message: '成本项目名是必填项',
-                        },
-                    ]}
-                    name="productName"
-                />
-            </ModalForm>
-        )
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    const downloadTemplate = async () => {
-        await downloadTemplateReq('/costAccount/excel/getImportProductTemplate');
-    };
-    
-      const importData = () => {
-        return (
-          <ModalForm
-            width={360}
-            title={`导入数据`}
-            trigger={
-              <a className="import" key="3">
-                导入
-              </a>
-            }
-            submitter={{
-              render: (props, defaultDoms) => {
-                const needBtn = defaultDoms.filter((b) => {
-                  return b.key != 'rest';
-                });
-                return [
-                  ...needBtn,
-                ];
-              },
-            }}
-            onFinish={async (values) => {
-              const {
-                importFile: { fileList },
-              } = values;
-    
-              let formData = new FormData();
-              formData.append('file', fileList[0].originFileObj);
-              const resp = await importDataPost(formData);
-     
-              if (resp) {
-                tableRef.current?.reload();  
-                return true;
-              }
-            }}
-          >
-            <FormItem name={'importFile'}>
-              <KCIMUpload downloadTemplateFile={() => downloadTemplate()} />
-            </FormItem>
-          </ModalForm>                                                                                                                                                                                                                                                           
-        );
-      };
-
-    useEffect(() => {
-
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='CostIncomeProjectMana' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem' style={{ marginLeft: 16, width: 205 }}>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'成本项目名称'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        filter: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    filter: ((e.target) as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    {importData()}
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div style={{ marginTop: 16 }}>
-                <KCIMTable scroll={{y:`calc(100vh - 235px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 80
src/pages/baseSetting/accountingAccountSet/costIncomeProjectMana/service.ts

@@ -1,80 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-13 16:04:14
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-export const getCostProjecttList = (params:any) => {
-  return request('/costAccount/product/list', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-
-
-//新增
-export type AddTableDataType = {
-  productCode:string,
-  productName:string
-}
-export async function addCostProject(body:AddTableDataType) {
-  return request('/costAccount/product/save', {
-    method: 'POST',
-    data:{...body},
-  });
-}
-
-
-//导入
-export const importDataPost = (data:any) => {
-  return request('/costAccount/excel/importProduct', {
-    method: 'POST',
-    data
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/product/edit', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (id:string) => {
-  return request('/costAccount/product/delete', {
-    method: 'POST',
-    data:[id]
-  });
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 310
src/pages/baseSetting/costAllocationSet/allocationLevelSet/index.tsx

@@ -1,310 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-09 10:54:49
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-
-import { ActionType, ProFormDependency, ProFormInstance, ProFormText, ProFormSelect, ProFormDigit } from '@ant-design/pro-components';
-import { ModalForm } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Form, Select } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, delData, editData, getApportionmentLevelList } from './service';
-
-import './style.less';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-export default function AllocationLevelSet() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ accountType: 1 });
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [currentRow, setCurrentRow] = useState<any | undefined>(undefined);
-    const [selectableLevelList, setSelectableLevelList] = useState<any[]>([]);//可选的分摊层级列表
-
-    const columns: ProColumns[] = [
-
-        {
-            title: '分摊层级名',
-            dataIndex: 'shareName',
-        },
-        {
-            title: '分摊层级序号',
-            dataIndex: 'leverSort',
-        },
-        {
-            title: '目标层级',
-            dataIndex: 'targetLevel',
-        },
-        {
-            title: '计算方式',
-            dataIndex: 'calcType',
-            renderText(text, record) {
-                return <>{text == 0 ? '合并计算' : '分开计算'}</>
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 90,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getApportionmentLevelList({ ...params });
-        if (resp) {
-            const tempArr = resp.list&&resp.list.map((item:any) => ({ label: item.shareName, value: item.leverSort }))
-            setSelectableLevelList(tempArr);
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData([record.id]);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-        console.log({formVal});
-
-        if (type == 'ADD') {
-  
-            const {targetLevel} = formVal;
-            const result = { ...formVal,targetLevel:(targetLevel.map((a:any) => a.value)).join(',') };
-
-            const resp = await addData(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-            try {
-                const {targetLevel} = formVal;
-                const resp = await editData({ ...formVal,targetLevel:(targetLevel.map((a:any) => a.value?a.value:a)).join(',') });
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-            } catch (error) {
-                console.log({ error });
-            }
-
-        }
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
-        setCurrentRow(record);
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}分摊层级`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                    targetLevel:record.targetLevel?record.targetLevel.split(',').map((a:string)=>Number(a)):[]
-                } : {targetLevel:[]}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormDigit
-                    label="分摊层级序号"
-                    rules={[
-                        {
-                            required: true,
-                            message: '分摊层级序号是必填项',
-                        },
-                    ]}
-                    name="leverSort"
-                    min={1} max={100}
-                />
-
-                <ProFormText
-                    label="分摊层级名"
-                    rules={[
-                        {
-                            required: true,
-                            message: '分摊层级名是必填项',
-                        },
-                    ]}
-                    name="shareName"
-                />
-                <ProFormSelect
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择计算方式',
-                        },
-                    ]}
-                    options={[
-                        {
-                            value: 0,
-                            label: '合并计算',
-                        },
-                        {
-                            value: 1,
-                            label: '分开计算',
-                        },
-                    ]}
-                    name="calcType"
-                    label="计算方式"
-                />
-                <ProFormDependency name={['leverSort']}>
-                    {
-                        ({ leverSort }) => {
-                            try {
-                                const filteredArr = selectableLevelList.filter(item => item.value >= leverSort);
-                                if (filteredArr.length == 0) {
-                                    //当大于最大可选分摊层级
-                                    //formRef?.current?.setFieldsValue({ targetLevel: [{ value: `${leverSort}` }] });
-                                    formRef?.current?.setFieldValue('targetLevel',[{ value: `${leverSort}` }]);
-                                    return <ProFormText name='targetLevel' hidden />
-                                }else{
-                                    if(type == 'ADD'){
-                                        formRef?.current?.setFieldValue('targetLevel',[]);
-                                    }
-                                    if(type == 'EDIT'){
-                                        formRef?.current?.setFieldValue('targetLevel',record.targetLevel?record.targetLevel.split(',').map((a:string)=>Number(a)):[]);
-                                    }
-                                }
-                                return filteredArr.length > 0 && (
-                                    <Form.Item name='targetLevel' label="目标层级" shouldUpdate style={{width:320}} required >
-                                        <Select
-                                            mode="multiple"
-                                            labelInValue={true}
-                                            placeholder='请选择'
-                                            maxTagCount={2}
-                                        >
-                                            {filteredArr.map((item, index) => (
-                                                <Select.Option key={index} value={item.value}>
-                                                    {`${item.label}层级${item.value}`}
-                                                </Select.Option>
-                                            ))}
-                                        </Select>
-                                    </Form.Item>
-                                )
-                            } catch (error) {
-                                console.log({ error })
-                            }
-
-                        }
-                    }
-                </ProFormDependency>
-
-            </ModalForm>
-        )
-    }
-
-
-    return (
-        <KCIMPagecontainer className='AllocationLevelSet' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'分摊层级名称'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo"  style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('name')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        name: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    name: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div>
-                <KCIMTable scroll={{y:`calc(100vh - 234px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 75
src/pages/baseSetting/costAllocationSet/allocationLevelSet/service.ts

@@ -1,75 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-14 15:03:54
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { Key } from 'react';
-import { request } from 'umi';
-
-//获取table列表数据
-export const getApportionmentLevelList = (params:any) => {
-  return request('/costAccount/costsharelevel/list', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-
-
-//新增
-export type AddTableDataType = {
-  leverSort:number,
-  shareName:string,
-  calcType:number,
-  targetLevel:any
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/costsharelevel/save', {
-    method: 'POST',
-    data:{...data}
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/costsharelevel/update', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (ids:Key[]) => {
-  return request('/costAccount/costsharelevel/delete', {
-    method: 'POST',
-    data:[...ids]
-  });
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 42
src/pages/baseSetting/costAllocationSet/allocationLevelSet/style.less

@@ -1,42 +0,0 @@
-.AllocationLevelSet {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    margin-bottom: 16px;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-        .add {
-          cursor: pointer;
-          display: inline-block;
-          font-size: 14px;
-          font-weight: 400;
-          color: #FFFFFF;
-          line-height: 24px;
-          padding: 0 14px;
-          background: #3377FF;
-          border-radius: 4px;
-        }
-    }
-  }
-}

+ 0 - 200
src/pages/baseSetting/costAllocationSet/allocationParamsMap/editTableModal.tsx

@@ -1,200 +0,0 @@
-import React, { Key, useEffect, useState } from "react";
-import { Input, Select } from 'antd'
-import { KCIMTable } from "@/components/KCIMTable";
-import { createFromIconfontCN } from "@ant-design/icons";
-
-
-import { EditableProTable, ModalForm, ProColumns, ProFormSelect, ProFormText } from "@ant-design/pro-components";
-
-import { set } from "lodash";
-import { getHasSetParamsList, getParamsSelectableList } from "./service";
-import { RecordKey } from "@ant-design/pro-utils/es/useEditableArray";
-
-
-// import './style.less';
-
-
-interface TableSelecterProps {
-    record: any
-}
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-const EditTableModal = ({ record, open, title, onVisibleChange, rowKey = 'id', onFinish }: {
-    record: any, open: boolean, title: string, onVisibleChange: (bool: boolean) => void,
-    rowKey?: string, onFinish?: (selectedRows: any[]) => void
-}) => {
-
-
-    const Table = React.forwardRef(({ }: TableSelecterProps, ref) => {
-
-        const [datasource, set_datasource] = useState<any[]>([]);
-        let currentSelectedRow:undefined|any = undefined;
-
-        const columns: ProColumns[] = [
-            {
-                title: '分摊参数',
-                dataIndex: 'shareParamCode',
-                ellipsis:true,
-                valueType:'select',
-                request:async ()=>{
-                     const resp = await getParamsSelectableList({pageSize:500,current:1,id:record.id});
-                     if(resp){
-                           return resp.list.map((a:any)=>({label: a.shareParamName,value: a.shareParamCode,id:a.id}))
-                     }
-                     return []
-                },
-                fieldProps:{
-                    showSearch:true,
-                    style: {
-                        width: '280px', // 设置你想要的宽度
-                    },
-                    onSelect:(a: any,b: any,c:any)=>{
-                        currentSelectedRow = b;
-                    }
-                }
-            },
-            {
-                title: '分摊比例',
-                width:90,
-                dataIndex: 'shareParamPopout',
-                ellipsis:true,
-                valueType:'digit',
-                fieldProps:{
-                    style:{
-                        width:'70px'
-                    }
-                }
-            }, 
-            {
-                title: '操作',
-                width:130,
-                valueType: 'option',
-                fieldProps:{
-                    style:{
-                        gap:'2px !important'
-                    }
-                },
-                render: (text, record, _, action) => [
-                  <a
-                    key="editable"
-                    onClick={() => {
-                      action?.startEditable?.(record.id);
-                    }}
-                  >
-                    编辑
-                  </a>,
-                  <a
-                    key="delete"
-                    onClick={() => {
-                        set_datasource(datasource.filter((item) => item.id !== record.id));
-                    }}
-                  >
-                    删除
-                  </a>,
-                ],
-            },
-        ];
-
-
-
-        const saveHandle = async () => {
-            onFinish && onFinish(datasource);
-        
-        }
-
-        const getTableData = async () => {
-
-            const resp = await getHasSetParamsList(record.id);
-            if(resp){
-                set_datasource(resp);
-            }else{
-                return Promise.resolve([]);
-            }
-        }
-
-        useEffect(() => {
-            getTableData()
-        }, [])
-
-
-        return (
-            <div >
-                <EditableProTable columns={columns}
-                    className='EditableProTable'
-                    options={false}
-                    rowKey={rowKey}
-                    scroll={{ y: 400 }}
-                    tableAlertRender={false}
-                    recordCreatorProps={
-                       {
-                        record: () => ({ id: (Math.random() * 1000000).toFixed(0) }),
-                       }
-                    }
-                    editable={{
-                        onSave: async (rowKey, data, row) => {
-                            // console.log({rowKey, data, row,currentSelectedRow,datasource});                        
-                           
-                            const {index} = data;
-          
-                            if(index > datasource.length - 1){
-                                //新增
-                                const {id,label} = currentSelectedRow;
-                                set_datasource([...datasource,{
-                                    shareParamName:label,
-                                    shareParamCode:data.shareParamCode,
-                                    shareParamPopout:data.shareParamPopout,
-                                    id:id
-                                }]);
-                            }else {
-                                //编辑
-                                const newData = [...datasource];
-                                newData[index] = {
-                                    shareParamName:currentSelectedRow?currentSelectedRow.label:data.shareParamName,
-                                    shareParamCode:data.shareParamCode,
-                                    shareParamPopout:data.shareParamPopout,
-                                    id:currentSelectedRow?currentSelectedRow.id:data.id
-                                };
-                                set_datasource([...newData]);
-                            }
-                            
-                            currentSelectedRow = undefined;
-                        },
-                    }}
-                    value={datasource}
-                
-                />
-                <div className='footer'>
-                    <span className='cancel' onClick={() => close()}>取消</span>
-                    <span className='ok' onClick={() => saveHandle()}>{`确认`}</span>
-                </div>
-            </div>
-
-        )
-    });
-
-    const close = () => {
-        onVisibleChange && onVisibleChange(false);
-    }
-
-
-    return (
-        <ModalForm className="TableSelecter" title={title} width={550} submitter={{
-            render: false
-        }} open={open} modalProps={{
-            closable: false,
-        }}>
-            <Table
-                // ref={tableSelecterRef}
-                record={undefined}
-            ></Table>
-        </ModalForm>
-    )
-
-}
-
-
-export default EditTableModal

+ 0 - 446
src/pages/baseSetting/costAllocationSet/allocationParamsMap/index.tsx

@@ -1,446 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-08-12 10:56:07
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-
-import { ActionType, ProFormDependency, ProFormInstance, ProFormText, ProFormSelect, ProFormTextArea, ProFormTreeSelect } from '@ant-design/pro-components';
-import { ModalForm } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Tag, Tabs } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, copyParamsList, delData, editData, getCostshareparamConnectList, getResponsibilityCenterSelecterList, saveParamsList } from './service';
-
-import './style.less';
-import { getAccountingSubjectList } from '../../accountingAccountSet/accountingSubMana/service';
-import { getChilds } from '@/utils/tooljs';
-import EditTableModal from './editTableModal';
-import TableSelecter from './tableSelector';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-export default function AllocationParamsMap() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>(undefined);
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [currentRow, setCurrentRow] = useState<any | undefined>(undefined);
-    const [selectableLevelList, setSelectableLevelList] = useState([]);//可选的分摊层级列表
-    const [tabs, set_tabs] = useState<any[]>([]);
-    const [accountType, set_accountType] = useState<Key>(1);
-
-    const [selectedResponsibilityId, setSelectedResponsibilityId] = useState(null);
-    const [selectedResponsibility, setSelectedResponsibility] = useState(null);
-
-    const [editTableVisible, set_editTableVisible] = useState(false);
-    const [tableSelecterVisible, set_tableSelecterVisible] = useState(false);
-
-
-    const columns: ProColumns[] = [
-
-        {
-            title: '分摊级别',
-            width:80,
-            ellipsis: true,
-            dataIndex: 'shareLevel',
-        },
-        {
-            title: '责任中心编码',
-            ellipsis: true,
-            width:120,
-            dataIndex: 'responsibilityCode',
-        },
-        {
-            title: '责任中心名',
-            ellipsis: true,
-            width:120,
-            dataIndex: 'responsibilityName',
-        },
-        {
-            title: '分摊参数',
-            ellipsis: true,
-            dataIndex: 'shareParamMap',
-        },
-        {
-            title: '会计科目名称',
-            ellipsis: true,
-            dataIndex: 'accountingNames',
-        },
-        {
-            title: '会计科目编码',
-            ellipsis: true,
-            dataIndex: 'accountingCodes',
-        },
-        {
-            title: '别名',
-            ellipsis: true,
-            width:100,
-            dataIndex: 'alias',
-        },
-        {
-            title: '备注',
-            ellipsis: true,
-            width:200,
-            dataIndex: 'costNode',
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 200,
-            fixed:'right',
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-
-                    <a key='copy' onClick={() => { set_tableSelecterVisible(true); setCurrentRow(record); }}>复制</a>,
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                    <a key='share' onClick={() => { set_editTableVisible(true); setCurrentRow(record) }}>分摊参数</a>
-
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getCostshareparamConnectList({ ...params });
-        if (resp) {
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData([record.id]);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-        console.log({formVal});
-        try {
-            const result = {
-                responsibilityId: formVal.responsibilityId,
-                accountingIds: formVal.accountingIds.join(','),
-                isShareCost: formVal.isShareCost,
-                alias: formVal.alias,
-                costNode: formVal.costNode,
-                responsibilityName: formVal.responsibility?formVal.responsibility.responsibilityName:formVal.responsibilityName,
-                shareLevel: formVal.responsibility?formVal.responsibility.shareLevel:formVal.shareLevel,
-                responsibilityCode: formVal.responsibility?formVal.responsibility.responsibilityCode:formVal.responsibilityCode
-            };
-
-            if (type == 'ADD') {
-                const resp = await addData(result);
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-
-            }
-            if (type == 'EDIT') {
-
-
-                const resp = await editData({...result,id:formVal.id});
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-
-
-            }
-
-        } catch (error) {
-            console.log({ error });
-        }
-
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
-
-        const [ifDisable, setIfDisable] = useState(false);
-        let needDisableIds: any[] = [];
-        let accountingIds: Key[] = record.accountingIdList?record.accountingIdList.map((a:string)=>Number(a)):[];
-
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}成本分摊参数对应`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                    accountings:record.accountingIdList?record.accountingIdList.map((a:string)=>Number(a)):[],
-                } : {}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val, accountingIds } : { ...val, accountingIds }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText name="responsibility" hidden />
-                <ProFormText name="responsibility" hidden />
-                <ProFormSelect
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择责任中心',
-                        },
-                    ]}
-                    fieldProps={{
-                        onChange: async (val, option: any) => {
-                            const { } = option;
-                            const resp = await getResponsibilityCenterSelecterList();
-                
-                            if (resp) {
-                                const selected = resp.filter((item: any) => item.id == val);
-                                if (selected[0]) {
-                                    formRef.current?.setFieldValue('responsibility', selected[0]);
-                                }
-                            }
-
-
-                            if (needDisableIds.includes(val)) {
-                                setIfDisable(false);
-                            } else {
-                                setIfDisable(true);
-                            }
-                        },
-                    }}
-                    request={async () => {
-                        const resp = await getResponsibilityCenterSelecterList();
-                        // const resp = [
-                        //     {
-                        //         calcType: 1,
-                        //         id: 401,
-                        //         responsibilityCode: "B0100",
-                        //         responsibilityId: 401,
-                        //         responsibilityName: "公共费用",
-                        //         shareId: 59,
-                        //         shareLevel: 1,
-                        //         shareName: "公共费用",
-                        //     }
-                        // ]
-                        if (resp) {
-                            return resp.map((item: any) => {
-                                if (item.calcType == 1) {
-                                    needDisableIds.push(item.id);
-                                }
-                                return ({
-                                    label: item.responsibilityName,
-                                    value: item.id,
-                                })
-                            })
-                        }
-                        return []
-                    }}
-                    name="responsibilityId"
-                    label="请选择责任中心"
-                />
-                <ProFormTreeSelect
-                    disabled={ifDisable}
-                    allowClear
-                    rules={[
-                        {
-                            required: ifDisable ? false : true,
-                            message: '请选择会计科目',
-                        },
-                    ]}
-                    request={async () => {
-                        const resp = await getAccountingSubjectList({ accountType:2, pageSize: 500, current: 1 });
-
-                        if (resp) {
-                            return resp.list
-                        }
-                        return []
-                    }}
-                    fieldProps={{
-                        showSearch: true,
-                        multiple: true,
-                        maxTagCount:3,
-                        maxTagPlaceholder:'...',
-                        treeCheckable: true,
-                        treeNodeFilterProp: 'accountingName',
-                        showCheckedStrategy: 'SHOW_CHILD',
-                        fieldNames: {
-                            label: 'accountingName',
-                            value: 'id'
-                        },
-                        onChange(value, labelList, extra) {
-                            // console.log({value,labelList,extra});
-                            accountingIds = value;
-                        },
-                        // onSelect: (value, opt) => {
-                        //     console.log({ value, opt });
-                        //     // console.log(getChilds(opt,'children'));
-                        //     if (opt.children && opt.children.length > 0) {
-                        //         const childs = getChilds(opt, 'children');
-                        //         const ids = childs.map((a) => a.id);
-                        //         accountingIds = ids;
-                        //     }
-                        // }
-                    }}
-                    name="accountings"
-                    label="选择会计科目"
-                />
-                <ProFormSelect
-                    disabled={ifDisable}
-                    rules={[
-                        {
-                            required: ifDisable ? false : true,
-                            message: '请选择',
-                        },
-                    ]}
-                    request={async () => [
-                        { label: '不包含分摊成本', value: 0 },
-                        { label: '包含分摊成本', value: 1 }
-                    ]}
-                    name="isShareCost"
-                    label="是否包含分摊成本"
-                />
-                <ProFormText
-                    name="alias"
-                    label="别名"
-                />
-                <ProFormTextArea
-                    name="costNode"
-                    label="备注"
-                    placeholder="请输入备注"
-                />
-            </ModalForm>
-        )
-    }
-
-    const shareParamsSetCommit = async (rows: any[]) => {
-        const resp = await saveParamsList({ id: currentRow.id, shareParamProportionVOList: rows });
-        if (resp) {
-            set_editTableVisible(false);
-            message.success('操作成功!');
-            tableRef.current?.reload();
-        }
-    }
-
-    const tableSelecterCommit = async (keys: Key[], rows: any) => {
-        const { id } = currentRow;
-        const resp = await copyParamsList({ id, responsibilityIds: keys });
-        if (resp) {
-            set_tableSelecterVisible(false);
-            message.success('操作成功!');
-            tableRef.current?.reload();
-        }
-    }
-
-    return (
-        <KCIMPagecontainer className='AllocationParamsMap' title={false}>
-            <EditTableModal
-                onVisibleChange={(bool) => set_editTableVisible(bool)}
-                title='分摊参数设置'
-                rowKey={'id'}
-                record={currentRow}
-                open={editTableVisible}
-                onFinish={(rows) => shareParamsSetCommit(rows)}
-            />
-            <TableSelecter
-                onVisibleChange={(bool) => set_tableSelecterVisible(bool)}
-                title='选择复制目标'
-                rowKey={'id'}
-                defaultSelectedKeys={[]}
-                record={currentRow}
-                open={tableSelecterVisible}
-                onFinish={(keys, rows) => tableSelecterCommit(keys, rows)}
-            />
-            <div className='toolBar' >
-                <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'责任中心名称'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('name')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        name: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    name: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-            
-            <div>
-                <KCIMTable  scroll={{x:2000,y:`calc(100vh - 234px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 135
src/pages/baseSetting/costAllocationSet/allocationParamsMap/service.ts

@@ -1,135 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-12-07 20:53:36
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { Key } from 'react';
-import { request } from 'umi';
-
-//获取table列表数据
-export const getCostshareparamConnectList = (params:any) => {
-  return request('/costAccount/costaccountshare/list', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-
-//获取当前成本已用本的分摊参数列表
-export const getHasSetParamsList = (id:number)=>{
-  return request(`/costAccount/costaccountshare/getShareParamById`, {
-    method: 'GET',
-    params:{
-         id:id
-    },
-  });
-
-}
-
-
-//获取可选复制目标列表
-export async function getCopyableToList(params:any) {
-  return request(`/costAccount/costaccountshare/getResponsibilityCalType`, {
-    method: 'GET',
-    params:{...params},
-  });
-
-}
-
-
-//获取添加分摊参数时可选列表
-export async function getParamsSelectableList(params:any) {
-  return request(`/costAccount/costaccountshare/getAllShareParamStatusById`, {
-    method: 'GET',
-    params:{
-        ...params
-    },
-  });
-
-}
-
-
-
-//新增
-export type AddTableDataType = any
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/costaccountshare/save', {
-    method: 'POST',
-    data:{...data}
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/costaccountshare/update', {
-    method: 'POST',
-    data
-  });
-};
-
-
-//保存成本分摊参数
-export const saveParamsList = (data:any) => {
-  return request(`/costAccount/costaccountshare/updateShareParam`, {
-    method: 'POST',
-    data
-  });
-}
-
-
-
-//删除表格操作
-export const delData = (ids:Key[]) => {
-  console.log({ids});
-  return request('/costAccount/costaccountshare/delete', {
-    method: 'POST',
-    data:ids
-  });
-};
-
-
-
-
-
-//获取责任中心选择列表
-export const  getResponsibilityCenterSelecterList = ()=> {
-  // const {shareParamName,current,pageSize} = params;
-  return request('/costAccount/responsibility/getLevelTwo', {
-    method: 'GET'
-  });
-}
-
-
-//复制数据
-export const copyParamsList = (body:any) => {
-  return request(`/costAccount/costaccountshare/copyAccountShareData`, {
-    method: 'POST',
-    data:body,
-  });
-
-}
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 90
src/pages/baseSetting/costAllocationSet/allocationParamsMap/style.less

@@ -1,90 +0,0 @@
-
-.TableSelecter {
-
-  .pfm-ant-modal-footer {
-    display: none !important;
-  }
-  
-  .footer {
-       display: flex;
-       flex-direction:row;
-       justify-content: flex-end;
-       margin-top: 15px;
-       span {
-           display: inline-block;
-           width: 56px;
-           height: 24px;  
-           font-size: 14px;
-           line-height: 23px;
-           text-align: center;
-           border-radius: 4px;
-           cursor: pointer;
-
-           &.ok {
-               color: #FFFFFF;
-               background:#3377FF;
-               margin-left: 8px;
-           }
-           &.cancel {
-               border: 1px solid #DAE2F2;
-           }
-       }
-
-  }
-}
-
-.EditableProTable {
-     .cost-ant-table-tbody {
-         .cost-ant-table-row {
-               .cost-ant-table-cell {
-                      &>div {
-                          display: flex;
-                          justify-content: left !important;
-                      }
-               }
-         }
-     }
-}
-
-.AllocationParamsMap {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    margin-bottom: 16px;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-        .add {
-          cursor: pointer;
-          display: inline-block;
-          font-size: 14px;
-          font-weight: 400;
-          color: #FFFFFF;
-          line-height: 24px;
-          padding: 0 14px;
-          background: #3377FF;
-          border-radius: 4px;
-        }
-    }
-  }
-}

+ 0 - 186
src/pages/baseSetting/costAllocationSet/allocationParamsMap/tableSelector.tsx

@@ -1,186 +0,0 @@
-import React, { Key, useEffect, useState } from "react";
-import { Input, Select } from 'antd'
-import { KCIMTable } from "@/components/KCIMTable";
-import { createFromIconfontCN } from "@ant-design/icons";
-
-
-import { ModalForm, ProColumns, ProFormSelect, ProFormText } from "@ant-design/pro-components";
-
-import { set } from "lodash";
-import { getCopyableToList } from "./service";
-
-
-// import './style.less';
-
-
-interface TableSelecterProps {
-    record: any
-}
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-
-const TableSelecter = ({ record, open, title, onVisibleChange, rowKey = 'id', request, onFinish, defaultSelectedKeys }: {
-    record: any, open: boolean, title: string, onVisibleChange: (bool: boolean) => void, defaultSelectedKeys: Key[],
-    rowKey?: string, request?: (params: any) => Promise<any>, onFinish?: (selectedKeys: React.Key[], selectedRows: any[]) => void
-}) => {
-
-
-    const Table = React.forwardRef(({ }: TableSelecterProps, ref) => {
-
-        const [datasource, set_datasource] = useState<any[]>([]);
-        const [selectedKeys, setSelectedKeys] = useState<React.Key[]>([]);
-        const [selectedRows, set_selectedRows] = useState<any[]>([]);
-        const [showList, set_showList] = useState<any[]>([]);
-        const [filter, set_filter] = useState<undefined | any>(undefined);
-        const [code, set_code] = useState<undefined | any>(undefined);
-        const [keyword, set_keyword] = useState<string | undefined>(undefined);
-
-
-        const columns: ProColumns[] = [
-            {
-                title: '责任中心Id',
-                dataIndex: 'id',
-            },
-            {
-                title: '责任中心名',
-                dataIndex: 'responsibilityName',
-            },
-        ];
-
-
-        const onSelectChange = (newSelectedRowKeys: React.Key[], selectedRows: any) => {
-            setSelectedKeys([...newSelectedRowKeys]);
-            set_selectedRows([...selectedRows]);
-
-        };
-
-        const saveHandle = async () => {
-            const selectedRowkeys = selectedRows.map((a) => a[`${rowKey}`]);
-            const rows = datasource.filter((a) => selectedRowkeys.includes(a[`${rowKey}`]));
-            onFinish && onFinish(selectedKeys, rows);
-        }
-
-        const getTableData = async () => {
-
-            // const resp = await getAddableTableData(record.costTypeCode);
-
-            const {id:accountShareId} = record;
-            const resp = await getCopyableToList({accountShareId});
-
-            let selectedKeys: string[] = [];
-            let selectedRows: any[] = [];
-            if (resp) {
-                const data = resp.map((a: any) => {
-                    if (defaultSelectedKeys.includes(a[`${rowKey}`])) {
-                        selectedKeys.push(a[`${rowKey}`]);
-                        selectedRows.push(a);
-                        const needItem = record.departList.filter((b: any) => a[`${rowKey}`] == b[`${rowKey}`]);
-
-                        return {
-                            ...a,
-                        }
-                    } else {
-                        return a
-                    }
-                });
-
-                set_showList(data);
-                set_selectedRows([...selectedRows]);
-                setSelectedKeys([...selectedKeys]);
-                set_datasource([...datasource, ...data]);
-            }
-
-
-            return Promise.resolve([]);
-        }
-
-        useEffect(() => {
-            // console.log({code, keyword});
-            const result = datasource.filter((a) => {
-                 return a.responsibilityName?a.responsibilityName.indexOf(keyword) != -1:false
-            });
-
-            set_showList([...result]);
-        }, [keyword])
-
-        useEffect(() => {
-            getTableData()
-        }, [])
-
-
-        return (
-            <div >
-                <div className="filter" style={{ display: 'flex', flexDirection: 'row', marginBottom: 8 }}>
-                    <ProFormText noStyle placeholder={'请输入'}
-                        fieldProps={{
-                            suffix: <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />,
-                            onChange: (e) => {
-                                if (e.target.value.length != 0) {
-                                    set_keyword(e.target.value);
-                                } else {
-                                    set_keyword('');
-                                }
-                            }
-                        }}
-                    />
-                </div>
-
-                <KCIMTable columns={columns}
-                    options={{
-                        density: true,
-                        setting: {
-                            listsHeight: 100,
-                        },
-                    }}
-                    rowKey={rowKey}
-                    scroll={{ y: 400 }}
-                    tableAlertRender={false}
-                    rowSelection={{
-                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
-                        // 注释该行则默认不显示下拉选项
-                        // selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
-                        selectedRowKeys: selectedKeys,
-                        onChange: onSelectChange,
-                    }}
-                    pagination={{ showTitle: false, showSizeChanger: false,simple:true }}
-                    dataSource={showList}
-
-                />
-                <div className='footer'>
-                    <span className='cancel' onClick={() => close()}>取消</span>
-                    <span className='ok' onClick={() => saveHandle()}>{`确认(${selectedKeys.length > 0 && selectedKeys.length})`}</span>
-                </div>
-            </div>
-
-        )
-    });
-
-    const close = () => {
-        onVisibleChange && onVisibleChange(false);
-    }
-
-
-    return (
-        <ModalForm className="TableSelecter" title={title} width={400} submitter={{
-            render: false
-        }} open={open} modalProps={{
-            closable: false,
-        }}>
-            <Table
-                // ref={tableSelecterRef}
-                record={undefined}
-            ></Table>
-        </ModalForm>
-    )
-
-}
-
-
-
-
-export default TableSelecter

+ 0 - 441
src/pages/baseSetting/costAllocationSet/costAllocationParamsDeal/index.tsx

@@ -1,441 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-10-16 11:26:19
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-
-import { ActionType, ProFormInstance, ProFormText, ProFormSelect, ProFormCascader, ProFormDigit, ProFormDatePicker } from '@ant-design/pro-components';
-import { ModalForm } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Dropdown } from 'antd';
-import type { MenuProps } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, calculateMonthCostShareData, copyMonthCostShareData, delData, editData, getMonthCostShareDataList } from './service';
-
-import './style.less';
-import moment from 'moment';
-import { getCostshareparamList } from '../costAllocationParamsSet/service';
-import { getResponsibilityCenterList } from '../../responsibilityCenterSet/responsibilityCenter/service';
-import { renameChildListToChildren } from '@/utils/tooljs';
-import { tableColumnsWidObj } from '@/constant';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-const currentData = `${new Date().getFullYear()}-${(new Date().getMonth() + 1).toString().padStart(2, '0')}`;
-
-
-
-export default function CostAllocationParamsDeal(
-    { date, ifShowGetBtn, ifShowCancelBtn,responsibilityCode,
-        cancelHandle,getHandle
-     }: { date: string, ifShowGetBtn: boolean, ifShowCancelBtn: boolean,responsibilityCode:string,
-        cancelHandle: () => Promise<boolean>,
-        getHandle:() => Promise<boolean>,
-
-    }
-) {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ computeDate: currentData });
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [computeDate, set_computeDate] = useState(currentData);
-    const [currentEditRow, set_currentEditRow] = useState<undefined | any>(undefined);
-
-
-    const columns: ProColumns[] = [
-        {
-            title: '分摊参数',
-            dataIndex: 'shareParamName',
-            renderText(text, record, index, action) {
-                const {shareParamCode,shareParamName} = record;
-                return `[${shareParamCode}]${shareParamName}`
-            },
-        },
-        {
-            title: '数值',
-            align:'center',
-            dataIndex: 'valueNum',
-            renderText(num, record, index, action) {
-                return (
-                    <div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center',justifyContent:'flex-end',paddingRight:'30%' }}>
-                        {
-                            (currentEditRow && currentEditRow.id == record.id) && (
-                                <>
-                                    <ProFormDigit
-                                        width={80}
-                                        noStyle
-                                        fieldProps={{
-                                            value: num,
-                                            onChange(value) {
-                                                set_currentEditRow({ ...record, valueNum: value ? value : 0 });
-                                            },
-                                        }}
-                                    />
-                                    <img onClick={() => updateTable({ ...record, ...currentEditRow }, 'EDIT')} style={{ width: 16, height: 16, display: 'inline-block', marginLeft: 8, cursor: 'pointer' }} src={require('../../../../../static/confirmIcon.png')} />
-                                </>
-                            )
-                        }
-
-                        {
-                            (!currentEditRow || (currentEditRow && currentEditRow.id != record.id)) && (
-                                <>
-                                    <div>{num.toFixed(2)}</div>
-                                    <img onClick={() => set_currentEditRow(record)} style={{ width: 16, height: 16, display: 'inline-block', marginLeft: 8, cursor: 'pointer' }} src={require('../../../../../static/editIcon.png')} />
-                                </>
-                            )
-                        }
-                    </div>
-                )
-            },
-        },
-        {
-            title: '责任中心',
-            dataIndex: 'responsibilityName',
-            renderText(text, record, index, action) {
-                const {responsibilityCode,responsibilityName} = record;
-                return `[${responsibilityCode}]${responsibilityName}`
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 90,
-            fixed: 'right',
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>
-                ]
-            },
-        },
-
-    ]
-
-    const items: MenuProps['items'] = [
-        {
-            key: '1',
-            label: (
-                <a onClick={()=>cancelHandle().then((isok)=>{
-                       if(isok)tableRef.current?.reload();
-                })} style={{ display: ifShowCancelBtn ? 'inline-block' : 'none' }}>
-                    撤销
-                </a>
-            ),
-        },
-        {
-            key: '2',
-            label: (
-                <a onClick={()=>getHandle().then((isok)=>{
-   
-                    if(isok){
-                        tableRef.current?.reload()
-                    };
-                })} style={{ display: ifShowGetBtn ? 'inline-block' : 'none' }}>
-                    获取
-                </a>
-            ),
-        },
-
-    ];
-
-
-    const getTableData = async (params: any) => {
-        const {computeDate,responsibilityCode} = params;
-        if(computeDate&&responsibilityCode){
-            const resp = await getMonthCostShareDataList({ ...params });
-            if (resp) {
-                return {
-                    data: resp.list,
-                    success: true,
-                    total: resp.totalCount,
-                    pageSize: resp.pageSize,
-                    totalPage: resp.totalPage,
-                }
-            }
-        }
-        return []
-    }
-
-
-    const delTableData = async (record: any) => {
-        const resp = await delData([record.id]);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | "COPY") => {
-
-        const result = {
-            date: computeDate.replace('-', ''),
-            shareParamCode: formVal.shareParamCode,
-            valueNum: formVal.valueNum,
-        };
-
-        if (type == 'ADD') {
-            const resp = await addData({ ...result, responsibilityCode: formVal.responsibilityCode[formVal.responsibilityCode.length - 1] });
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-            try {
-                const resp = await editData({ ...result, id: formVal.id, responsibilityCode: typeof formVal.responsibilityCode == 'string' ? formVal.responsibilityCode : formVal.responsibilityCode[formVal.responsibilityCode.length - 1] });
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-            } catch (error) {
-                console.log({ error });
-            }
-
-        }
-
-        if (type == 'COPY') {
-            const { dataSourceType, toDate, date: fromDate } = formVal;
-            const resp = await copyMonthCostShareData({ dataSourceType, toDate: moment(toDate).format('yyyyMM'), fromDate: moment(fromDate).format('yyyyMM') });
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-        }
-        return true;
-
-    }
-
-    const calculateHandle = async () => {
-        const resp = await calculateMonthCostShareData({ date: computeDate.replace('-', '') });
-        if (resp) {
-            message.success('计算成功!');
-            tableRef?.current?.reload();
-        }
-    };
-
-    useEffect(() => {
-        if (date&&responsibilityCode) {
-            set_computeDate(date);
-            set_tableDataFilterParams({
-                ...tableDataFilterParams,
-                computeDate: date,
-                responsibilityCode:responsibilityCode
-            });
-        }
-    }, [date,responsibilityCode])
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'COPY' }) => {
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}成本分摊参数处理`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                } : {}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : type == 'COPY' ? <span>复制</span> : <span>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-
-                {
-                    type == 'COPY' && (
-                        <>
-                            <ProFormDatePicker
-                                name="date"
-                                width={318}
-                                rules={[
-                                    {
-                                        required: true,
-                                        message: '复制时间是必填项!',
-                                    },
-                                ]}
-                                label="复制数据年月"
-                                fieldProps={{ picker: 'month', locale: locale, format: 'YYYY-MM',autoComplete:'off' }}
-
-                            />
-                            <ProFormDatePicker
-                                name="toDate"
-                                width={318}
-                                label="目标年月"
-                                rules={[
-                                    {
-                                        required: true,
-                                        message: '目标时间是必填项!',
-                                    },
-                                ]}
-                                fieldProps={{ picker: 'month', locale: locale, format: 'YYYY-MM',autoComplete:'off' }}
-                            />
-                            <ProFormSelect
-                                options={[
-                                    {
-                                        value: 1,
-                                        label: '手动输入',
-                                    },
-                                    {
-                                        value: 2,
-                                        label: '文件导入',
-                                    },
-                                    {
-                                        value: 3,
-                                        label: '全部',
-                                    },
-                                ]}
-                                rules={[
-                                    {
-                                        required: true,
-                                        message: '数据类型是必填项!',
-                                    },
-                                ]}
-                                name="dataSourceType"
-                                label="数据类型"
-                            />
-                        </>
-                    )
-                }
-                {
-                    type != 'COPY' && (
-                        <>
-                            <ProFormSelect
-                                name="shareParamCode"
-                                label="选择分摊参数"
-                                request={async (params) => {
-                                    const resp = await getCostshareparamList({ ...params, pageSize: 500 });
-                                    if (resp) {
-                                        return resp.list.map((item: any) => ({ label: item.shareParamName, value: item.shareParamCode }))
-                                    }
-                                }}
-                                placeholder="请选择"
-                                rules={[{ required: true, message: '分摊参数是必选项!' }]}
-                            />
-                            <ProFormCascader
-                                label='责任中心'
-                                name='responsibilityCode'
-                                allowClear
-                                placeholder="请选择"
-                                request={async () => {
-                                    const resp = await getResponsibilityCenterList({ pageSize: 500 });
-                                    if (resp) {
-                                        return resp.list
-                                    }
-                                    return [];
-                                }}
-                                fieldProps={{
-                                    fieldNames: { label: 'responsibilityName', value: 'responsibilityCode', children: 'child', },
-                                }}
-                            />
-                            <ProFormDigit
-                                label="数值"
-                                name="valueNum"
-                                rules={[
-                                    {
-                                        required: true,
-                                        message: '必选项!',
-                                    },
-                                ]}
-                            />
-                        </>
-                    )
-                }
-
-            </ModalForm>
-        )
-    }
-
-    return (
-        <KCIMPagecontainer className='CostAllocationParamsDeal' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'分摊参数代码/名称'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('shareParamCode')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        shareParamCode: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    shareParamCode: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-            
-                </div>
-                <div className='btnGroup'>
-                    <UpDataActBtn record type='COPY' />
-                    <span onClick={() => calculateHandle()}>计算</span>
-                    <UpDataActBtn record type='ADD' />
-                    {
-                        (ifShowCancelBtn && ifShowGetBtn) && (
-                            <Dropdown menu={{ items }} placement="bottomRight">
-                                <IconFont type="icongengduochuizhi" />
-                            </Dropdown>
-                        )
-                    }
-                </div>
-            </div>
-
-            <div>
-                <KCIMTable scroll={{y:`calc(100vh - 343px)`}}  columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 92
src/pages/baseSetting/costAllocationSet/costAllocationParamsDeal/service.ts

@@ -1,92 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-12-05 15:03:16
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { Key } from 'react';
-import { request } from 'umi';
-
-//获月成本分摊参数值处理列表
-export const getMonthCostShareDataList = (params:any) => {
-  return request('/costAccount/shareParamValue/list', {
-    method: 'GET',
-    params: {...params,date:params.computeDate.replace('-',''),computeDate:null},
-  });
-}
-
-
-
-//新增
-export type AddTableDataType = {
-  date:string,
-  shareParamCode:string,
-  responsibilityCode:string,
-  valueNum:number
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/shareParamValue/addData', {
-    method: 'POST',
-    data:{...data}
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/shareParamValue/edit', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (ids:Key[]) => {
-  return request('/costAccount/shareParamValue/delete', {
-    method: 'POST',
-    data:ids
-  });
-};
-
-//计算数据
-export const calculateMonthCostShareData = (params:any) => {
-  return request('/costAccount/shareParamValue/calcData', {
-    method: 'POST',
-    params: {...params},
-  });
-}
-
-//复制数据
-export const copyMonthCostShareData = (body:any) => {
-  return request('/costAccount/shareParamValue/copyData', {
-    method: 'POST',
-    data: {...body},
-  });
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 65
src/pages/baseSetting/costAllocationSet/costAllocationParamsDeal/style.less

@@ -1,65 +0,0 @@
-.CostAllocationParamsDeal {
-  // padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    margin-bottom: 16px;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-
-      &>span {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #17181A;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #FAFCFF;
-        border-radius: 4px;
-        margin-right: 8px;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-
-        &:last-child {
-          position: relative;
-          top:-2px;
-          padding: 0 4px;
-          margin-right: 0;
-          
-        }
-      }
-    }
-  }
-}

+ 0 - 330
src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/index.tsx

@@ -1,330 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-11 15:24:17
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-
-import { ActionType, ProFormDependency, ProFormInstance, ProFormText, ProFormSelect } from '@ant-design/pro-components';
-import { ModalForm } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Modal,Switch,Tooltip } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, delData, editData, getCostshareparamList, setAccountingSub } from './service';
-
-import './style.less';
-import React from 'react';
-import TableTransfer from './transform';
-import { getAccountingSubjectList } from '../../accountingAccountSet/accountingSubMana/service';
-import { getNodesWithChildren } from '@/utils/tooljs';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-const transferTableColumn = [
-    {
-        title: '会计科目编码',
-        dataIndex: 'accountingCode',
-    },
-    {
-        title: '会计科目名称',
-        dataIndex: 'accountingName',
-    },
-]
-
-export default function CostAllocationParamsSet() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({});
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    
-
-    const columns: ProColumns[] = [
-
-        {
-            title: '成本分摊参数名',
-            dataIndex: 'shareParamName',
-        },
-        {
-            title: '成本分摊参数编号',
-            width:160,
-            dataIndex: 'shareParamCode',
-            sorter: (a, b) => {
-                // 比较字符串数字部分大小
-                const codeA = parseInt(a.shareParamCode.slice(1), 10);
-                const codeB = parseInt(b.shareParamCode.slice(1), 10);
-                return codeA - codeB;
-            },
-        },
-        {
-            title: '计算方式',
-            dataIndex: 'calcType',
-            renderText(text, record) {
-                return text == 1 ? '手动填写' : '按对应会计科目计算'
-            },
-        },
-        {
-            title:()=><>启动<Tooltip title="停用的分摊参数在成本分摊报表里不显示"><IconFont style={{paddingLeft:6,fontSize:16,position:'relative',top:1}} type='iconshuoming' /></Tooltip></>,
-            dataIndex: 'status',
-            renderText(number, record) {
-                return <Switch checked={number} size='small' onChange={(bool)=>{
-                    updateTable({...record,status:bool?1:0},'EDIT');
-                }} />
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width:160,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                const {calcType} = record;
-                return calcType != 1?[
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                    <a key={'bind'} onClick={() => {oprnTableTransform(record)}}>会计科目</a>
-                ]:[
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>
-                ]
-            },
-        },
-
-    ]
-
-    
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getCostshareparamList({ ...params });
-        if (resp) {
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData([record.id]);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-
-        if (type == 'ADD') {
-            const result = { ...formVal };
-
-            const resp = await addData(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-            try {
-                const resp = await editData({ ...formVal });
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-            } catch (error) {
-                console.log({ error });
-            }
-
-        }
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}成本分摊参数`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                } : {}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText
-                    label="成本分摊参数名"
-                    rules={[
-                        {
-                            required: true,
-                            message: '成本分摊参数名是必填项',
-                        },
-                    ]}
-                    name="shareParamName"
-                />
-                <ProFormText
-                    label="成本分摊参数编号"
-                    rules={[
-                        {
-                            required: true,
-                            message: '成本分摊参数编号是必填项',
-                        },
-                    ]}
-                    name="shareParamCode"
-                />
-                <ProFormSelect
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择计算方式',
-                        },
-                    ]}
-                    options={[
-                        {
-                            value: 1,
-                            label: '手动填写',
-                        },
-                        {
-                            value: 2,
-                            label: '按对应会计科目计算',
-                        },
-                    ]}
-                    name="calcType"
-                    label="计算方式"
-                />
-            </ModalForm>
-        )
-    }
-
-    const onSaveHandle = async (keys:Key[],rows:any[],record:any) => {
-              const {id} = record;
-              const resp = await setAccountingSub({costShareParamId:id,accountIds:keys});
-              if(resp){
-                  message.success('操作成功!');
-                  tableRef.current?.reload();
-              }
-
-    }
-
-
-    const oprnTableTransform = (record: any) => {
-
-        const ref = React.createRef<{ save: any; }>();
-
-        Modal.confirm({
-            title: `选择会计科目`,
-            icon: <></>,
-            width: 750,
-            centered: true,
-            okText: '确定',
-            cancelText: '取消',
-            content: <TableTransfer
-            ref={ref}
-            keyName="id"
-            record={record}
-            onSave={(keys,rows)=>onSaveHandle(keys,rows,record)}
-            leftColumns={transferTableColumn}
-            rightColumns={transferTableColumn} dataSource={[]}
-        ></TableTransfer>,
-            onOk: () => {
-                return ref.current && ref.current.save();
-            }
-        })
-    }
-
-
-    return (
-        <KCIMPagecontainer className='CostAllocationParamsSet' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'成本分摊参数名称'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('name')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        name: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    name: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div>
-                <KCIMTable scroll={{y:`calc(100vh - 234px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 87
src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/service.ts

@@ -1,87 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-14 17:21:24
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { Key } from 'react';
-import { request } from 'umi';
-
-//获取table列表数据
-export const getCostshareparamList = (params:any) => {
-  return request('/costAccount/costshareparam/list', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-
-
-//新增
-export type AddTableDataType = {
-  shareParamName:string,
-  shareParamCode:string,
-  calcType:number
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/costshareparam/save', {
-    method: 'POST',
-    data:{...data}
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/costshareparam/update', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (ids:Key[]) => {
-  return request('/costAccount/costshareparam/delete', {
-    method: 'POST',
-    data:ids
-  });
-};
-
-
-
-//为成本分摊设置会计科目
-type SetAccountingSubBody = {
-  costShareParamId:number,
-  accountIds:Key[]
-}
-export const setAccountingSub = (body:SetAccountingSubBody) => {
-  return request('/costAccount/costshareparam/updateCostShareParamByAccountId', {
-    method: 'POST',
-    data:{...body}
-  });
-}
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 42
src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/style.less

@@ -1,42 +0,0 @@
-.CostAllocationParamsSet {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    margin-bottom: 16px;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-        .add {
-          cursor: pointer;
-          display: inline-block;
-          font-size: 14px;
-          font-weight: 400;
-          color: #FFFFFF;
-          line-height: 24px;
-          padding: 0 14px;
-          background: #3377FF;
-          border-radius: 4px;
-        }
-    }
-  }
-}

+ 0 - 281
src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/transform.tsx

@@ -1,281 +0,0 @@
-import React, { Key, useEffect, useImperativeHandle, useState } from "react";
-import { Transfer } from 'antd';
-import { TransferItem, TransferProps } from 'antd/es/transfer';
-import { difference } from "lodash";
-import { TableRowSelection } from 'antd/es/table/interface';
-import { KCIMTable } from "@/components/KCIMTable";
-import { ProColumns } from "@ant-design/pro-components";
-import { Tabs } from 'antd';
-import { getAccountingSubjectList } from "../../accountingAccountSet/accountingSubMana/service";
-
-
-function flatten(list: any[]) {
-    let result: any[] = [];
-    list.forEach(item => {
-        result.push(item);
-        if (item.children) {
-            result = result.concat(flatten(item.children));
-        }
-    });
-    return result;
-}
-
-
-function getUniqueSubsetsByProperty(treeData: any[], uniqueProperty: string) {
-    const result: any[] = [];
-    const uniqueSet = new Set();
-
-    function traverse(node: { [x: string]: any; children: string | any[]; }, isRoot = true) {
-        if (!node) return;
-
-        // 获取节点的唯一属性值
-        const uniqueValue = node[uniqueProperty];
-
-        // 如果节点是根节点,不添加到结果集,但处理它的子节点
-        if (!isRoot && !uniqueSet.has(uniqueValue)) {
-            result.push(node);
-            uniqueSet.add(uniqueValue);
-        }
-
-        // 递归处理子节点
-        if (node.children && node.children.length > 0) {
-            for (let child of node.children) {
-                traverse(child, false); // 子节点传递 isRoot = false
-            }
-        }
-    }
-
-    for (let rootNode of treeData) {
-        traverse(rootNode);
-    }
-
-    return result;
-}
-
-
-
-function removeSelectedKeys(nodes: any[], keysToRemove: string[]): any[] {
-    const result = nodes
-        .map(node => {
-            // 检查 id 是否存在
-            if (!node || node.id === undefined || node.id === null) {
-                return node; // 或者返回 null, 取决于你的业务逻辑
-            }
-
-            if (keysToRemove.includes(node.id)) {
-                return null;
-            }
-
-            if (node.children) {
-                node.children = removeSelectedKeys(node.children, keysToRemove);
-                if (node.children.length === 0) {
-                    return null;
-                }
-            }
-
-            return node;
-        })
-        .filter(node => node !== null);
-    return result;
-}
-
-
-
-interface TableTransferProps extends TransferProps<TransferItem> {
-    leftColumns: ProColumns[];
-    rightColumns: ProColumns[];
-    record: any,
-    keyName: string,
-    onSave: (selectedKeys: Key[], selectedRowKeys: any[]) => void;
-}
-
-const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, keyName, record, onSave, ...restProps }: TableTransferProps, ref) => {
-    const [_data, _set_data] = useState<any>();
-    const [targetKeys, setTargetKeys] = useState<string[]>(record.accountingIds ? [...(record.accountingIds.map((a: string) => Number(a)))] : []);
-    const [datasource, set_datasource] = useState<any[]>([]);
-    const [filteredDataSource, setFilteredDataSource] = useState<any[]>([]);
-    const [selectedKeys, setSelectedKeys] = useState<string[]>(record.accountingIds ? [...(record.accountingIds.map((a: string) => Number(a)))] : []);
-    const [accountType, set_accountType] = useState(1);
-    const [tabs, set_tabs] = useState<any[]>([]);
-
-    const getFuncList = async () => {
-        const resp = await getAccountingSubjectList({ accountType: 1, pageSize: 500, current: 1 });
-        if (resp) {
-            set_datasource(resp.list);
-            _set_data(resp.list);
-        }
-    };
-
-    const onChange = (nextTargetKeys: string[]) => {
-        setTargetKeys(nextTargetKeys);
-        const clonedDataSource = JSON.parse(JSON.stringify(datasource));
-        const filteredData = removeSelectedKeys(clonedDataSource, nextTargetKeys);
-        setFilteredDataSource(filteredData);
-    };
-
-    const onSelectChange = (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => {
-        setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]);
-    };
-
-    useEffect(() => {
-        // 过滤出左侧的待选项数据
-        const clonedDataSource = JSON.parse(JSON.stringify(datasource));
-        const filtered = removeSelectedKeys(clonedDataSource, targetKeys);
-        setFilteredDataSource(filtered);
-    }, [datasource, targetKeys]);
-
-    useImperativeHandle(ref, () => ({
-        save: async () => {
-            const items = flatten(datasource).filter(a => targetKeys.includes(a[`${keyName}`]));
-            onSave(targetKeys,getUniqueSubsetsByProperty(items,`${keyName}`));
-        }
-    }));
-
-    const onTabChanged = (key: string) => {
-        set_accountType(Number(key));
-    };
-
-    const handleTreeItemSelect = (key: string, selected: boolean) => {
-        let newSelectedKeys = [...selectedKeys];
-        
-        const updateSelection = (node: TransferItem, isSelected: boolean) => {
-            const keyIndex = newSelectedKeys.indexOf(node[keyName]);
-            if (isSelected && keyIndex === -1) {
-                newSelectedKeys.push(node[keyName]);
-            } else if (!isSelected && keyIndex > -1) {
-                newSelectedKeys.splice(keyIndex, 1);
-            }
-    
-            if (node.children) {
-                node.children.forEach((child: any) => updateSelection(child, isSelected));
-            }
-        };
-    
-        const node = flatten(datasource).find(item => item[keyName] === key);
-    
-        if (node) {
-            updateSelection(node, selected);
-        }
-    
-        // 确保没有重复项
-        newSelectedKeys = Array.from(new Set(newSelectedKeys));
-        setSelectedKeys(newSelectedKeys);
-    };
-    
-    
-    
-
-    useEffect(() => {
-        getFuncList();
-    }, [accountType]);
-
-    useEffect(() => {
-        set_tabs([
-            { label: '收入', key: 1 },
-            { label: '支出', key: 2 },
-        ]);
-    }, []);
-
-    return (
-        <div>
-            <Tabs
-                defaultActiveKey={tabs.length > 0 ? tabs[0].key : undefined}
-                items={tabs}
-                onChange={(key) => onTabChanged(key)}
-            />
-            <Transfer
-                className='TableTransfer'
-                showSearch
-                titles={['待选项', '已选项']}
-                locale={{
-                    itemUnit: '项',
-                    itemsUnit: '项',
-                    searchPlaceholder: '请输入',
-                }}
-                oneWay={false}
-                onChange={onChange}
-                onSelectChange={onSelectChange}
-                dataSource={flatten(datasource)}
-                rowKey={record => record[`${keyName}`]}
-                targetKeys={targetKeys}
-                selectedKeys={selectedKeys}
-                filterOption={(inputValue, item) => item.accountingName.indexOf(inputValue) !== -1}
-            >
-                {({
-                    direction,
-                    filteredItems,
-                    onItemSelectAll,
-                    onItemSelect,
-                    selectedKeys: listSelectedKeys,
-                    disabled: listDisabled,
-                }) => {
-                    const columns = direction === 'left' ? leftColumns : rightColumns;
-
-                    const rowSelection: TableRowSelection<TransferItem> = {
-                        getCheckboxProps: (item) => ({ disabled: listDisabled || item.disabled }),
-                        onSelectAll(selected, selectedRows) {
-                            const treeSelectedKeys = selectedRows.map(a => a[`${keyName}`]);
-                            const diffKeys = selected
-                                ? difference(treeSelectedKeys, listSelectedKeys)
-                                : difference(listSelectedKeys, treeSelectedKeys);
-                            onItemSelectAll(diffKeys as string[], selected);
-                        },
-                        onSelect(item, selected) {
-                            onItemSelect(item[`${keyName}`], selected);
-                            handleTreeItemSelect(item[`${keyName}`], selected);
-                        },
-                        selectedRowKeys: listSelectedKeys,
-                    };
-
-                    // 使用 filteredDataSource 作为数据源,确保左侧表格正确显示未选中的数据
-
-                    const flattenAndFilter = (list: any[], targetKeys: string | any[]) => {
-                        let result: any[] = [];
-                        list.forEach((item: { [x: string]: any; children: any; }) => {
-                            if (targetKeys.includes(item[keyName])) {
-                                // 如果父节点已经选中,不再单独加入子节点
-                                result.push(item);
-                            } else if (item.children) {
-                                // 递归处理子节点
-                                const filteredChildren = flattenAndFilter(item.children, targetKeys);
-                                if (filteredChildren.length > 0) {
-                                    result = result.concat(filteredChildren);
-                                }
-                            }
-                        });
-                        return result;
-                    };
-
-                    const dataSourceToUse = direction === 'left'
-                        ? filteredDataSource // 左侧的未选中项
-                        : flattenAndFilter(datasource, targetKeys); // 右侧的已选中项
-
-
-                    return (
-                        <KCIMTable
-                            rowSelection={rowSelection}
-                            columns={columns as TransferItem[]}
-                            dataSource={dataSourceToUse}
-                            size="small"
-                            bordered={false}
-                            rowKey={keyName}
-                            scroll={{ y: 280 }}
-                            pagination={{ showTitle: false, pageSize: 9, showLessItems: false, simple: true, showTotal: () => false }}
-                            tableAlertRender={false}
-                            style={{ pointerEvents: listDisabled ? 'none' : undefined }}
-                            onRow={(row) => ({
-                                onClick: () => {
-                                    const selected = !listSelectedKeys.includes(row[`${keyName}`]);
-                                    onItemSelect(row[`${keyName}`], selected);
-                                    handleTreeItemSelect(row[`${keyName}`], selected);
-                                },
-                            })}
-                        />
-                    );
-                }}
-            </Transfer>
-        </div>
-    );
-});
-
-export default TableTransfer;

+ 0 - 416
src/pages/baseSetting/costAllocationSet/idleCostSetting/index.tsx

@@ -1,416 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-09 10:54:09
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-
-import { ActionType, ProFormDependency, ProFormInstance, ProFormText, ProFormSelect, ProFormDigit } from '@ant-design/pro-components';
-import { ModalForm, ProFormCascader } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Form, Select } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, delData, editData, getAccountList, getIdleCostTableList, getIdleResponsibleList, getShareParamList } from './service';
-
-import './style.less';
-import { getAccountingSubjectList } from '../../accountingAccountSet/accountingSubMana/service';
-import { getCostshareparamList } from '../costAllocationParamsSet/service';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-function filterTree(trees: any[]) {
-    // 递归筛选函数
-    function filterNode(node: any) {
-        // 如果是叶子节点,直接根据条件返回节点或null
-        if (!node.children || node.children.length === 0) {
-            return node.isBaseCost === 1 ? { ...node } : null;
-        }
-
-        // 对于非叶子节点,先递归筛选子节点
-        const filteredChildren = node.children.map(filterNode).filter((child: any) => child !== null);
-
-        // 如果子节点中有被保留的,或者当前节点自身满足条件,保留当前节点
-        // 注意这里的改变:我们不再检查非叶子节点是否直接满足条件,而是基于其子节点是否被保留
-        if (filteredChildren.length > 0) {
-            return { ...node, children: filteredChildren };
-        } else {
-            // 如果没有子节点被保留,且当前节点不满足条件,返回null
-            return null;
-        }
-    }
-
-    // 遍历树结构集合并应用筛选函数
-    return trees.map(filterNode).filter(root => root !== null);
-}
-
-
-
-
-
-export default function IdleCostSetting() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ accountType: 1 });
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [currentRow, setCurrentRow] = useState<any | undefined>(undefined);
-    const [selectableLevelList, setSelectableLevelList] = useState<any[]>([]);//可选的分摊层级列表
-
-    const columns: ProColumns[] = [
-
-        {
-            title: '闲置成本项目',
-            dataIndex: 'freeAccountName',
-        },
-        {
-            title: '设备成本项目',
-            dataIndex: 'accountName',
-        },
-        {
-            title: '可检查时间参数',
-            dataIndex: 'canParamName',
-        },
-        {
-            title: '实际检查时间参数',
-            dataIndex: 'actualParamName',
-        },
-        {
-            title: '归属责任中心',
-            dataIndex: 'freeResponsibilityName',
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 90,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getIdleCostTableList({ ...params });
-        if (resp) {
-            return {
-                data: resp,
-                success: true,
-                // total: resp.totalCount,
-                // pageSize: resp.pageSize,
-                // totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData(record.id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-    
-        const { freeAccount = [], account, canParam, actualParam,freeResponsibility } = formVal;
-            const result = {
-                freeAccountCode: freeAccount.accountingCode,
-                freeAccountName: freeAccount.accountingName,
-                accountCode: account.accountingCode,
-                accountName: account.accountingName,
-                canParamCode: canParam.shareParamCode,
-                canParamName: canParam.shareParamName,
-                actualParamCode: actualParam.shareParamCode,
-                actualParamName: actualParam.shareParamName,
-                freeResponsibilityName:freeResponsibility.responsibilityName,
-                freeResponsibilityCode:freeResponsibility.responsibilityCode,
-            };
-
-        if (type == 'ADD') {
-            const resp = await addData(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-            try {
-                const { id } = formVal;
-                const resp = await editData({ ...result,id});
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-            } catch (error) {
-                console.log({ error });
-            }
-
-        }
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
-        setCurrentRow(record);
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}闲置成本对应`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                    freeAccount:record.freeAccountCode,
-                    account:record.accountCode,
-                    canParam: record.canParamCode,
-                    actualParam: record.actualParamCode,
-                    freeResponsibility:record.freeResponsibilityCode
-                } : {}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                {/* <ProFormText name='freeAccount' hidden />
-                <ProFormText name='account' hidden /> */}
-                {/* <ProFormCascader
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择闲置成本项目',
-                        },
-                    ]}
-                    request={async ()=>{
-                         const resp = await getAccountList({accountType: 2,pageSize:500,current:1});
-                         return filterTree(resp.list)
-                    }}
-
-                    fieldProps={{
-                        // searchValue:'accountingName',
-                        showSearch:true,
-                        fieldNames:{label:'accountingName',value:'accountingCode',children:'children'},
-                        onChange:(value:any, selectedOptions:any)=>{
-                            formRef.current?.setFieldValue('freeAccount',selectedOptions)
-                        }
-                    }}
-                    name='freeCostItem'
-                    label="闲置成本项目"
-                />
-                <ProFormCascader
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择设备成本项目',
-                        },
-                    ]}
-                    request={async ()=>{
-                         const resp = await getAccountingSubjectList({accountType: 2,pageSize:500,current:1});
-                         return filterTree(resp.list)
-                    }}
-                
-                    fieldProps={{
-                        showSearch:true,
-                        fieldNames:{label:'accountingName',value:'accountingCode',children:'children'},
-                        onChange:(value:any, selectedOptions:any)=>{
-                            formRef.current?.setFieldValue('account',selectedOptions)
-                        }
-                    }}
-                    name='equipmentCostItem'
-                    label="设备成本项目"
-                /> */}
-                <ProFormSelect
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择闲置成本项目',
-                        },
-                    ]}
-                    request={async () => {
-                        const resp = await getAccountList({ pageSize: 500, current: 1 });
-                        return resp
-                    }}
-
-                    fieldProps={{
-                        labelInValue: true,
-                        showSearch: true,
-                        fieldNames: { label: 'accountingName', value: 'accountingCode' },
-                    }}
-                    name="freeAccount"
-                    label="闲置成本项目"
-                />
-                <ProFormSelect
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择设备成本项目',
-                        },
-                    ]}
-                    request={async () => {
-                        const resp = await getAccountList({ pageSize: 500, current: 1 });
-                        return resp
-                    }}
-
-                    fieldProps={{
-                        labelInValue: true,
-                        showSearch: true,
-                        fieldNames: { label: 'accountingName', value: 'accountingCode' },
-                    }}
-                    name="account"
-                    label="设备成本项目"
-                />
-                <ProFormSelect
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择可检查时间参数',
-                        },
-                    ]}
-                    request={async () => {
-                        const resp = await getShareParamList({ pageSize: 500, current: 1 });
-                        return resp
-                    }}
-
-                    fieldProps={{
-                        labelInValue: true,
-                        showSearch: true,
-                        fieldNames: { label: 'shareParamName', value: 'shareParamCode' },
-                    }}
-                    name="canParam"
-                    label="可检查时间参数"
-                />
-                <ProFormSelect
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择实际检查时间参数',
-                        },
-                    ]}
-                    request={async () => {
-                        const resp = await getShareParamList({ pageSize: 500, current: 1 });
-                        return resp
-                    }}
-
-                    fieldProps={{
-                        labelInValue: true,
-                        showSearch: true,
-                        fieldNames: { label: 'shareParamName', value: 'shareParamCode' },
-                    }}
-                    name="actualParam"
-                    label="实际检查时间参数"
-                />
-                <ProFormSelect
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择归属责任中心',
-                        },
-                    ]}
-                    request={async () => {
-                        const resp = await getIdleResponsibleList({ pageSize: 500, current: 1 });
-                        return resp
-                    }}
-
-                    fieldProps={{
-                        labelInValue: true,
-                        showSearch: true,
-                        fieldNames: { label: 'responsibilityName', value: 'responsibilityCode' },
-                    }}
-                    name="freeResponsibility"
-                    label="归属责任中心"
-                />
-
-            </ModalForm>
-        )
-    }
-
-
-    return (
-        <KCIMPagecontainer className='IdleCostSetting' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'闲置成本项目编码/名称'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        filter: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    filter: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div>
-                <KCIMTable scroll={{y:`calc(100vh - 234px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 104
src/pages/baseSetting/costAllocationSet/idleCostSetting/service.ts

@@ -1,104 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-04-26 11:31:11
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { Key } from 'react';
-import { request } from 'umi';
-
-//获取table列表数据
-export const getIdleCostTableList = (params:any) => {
-  return request('/costAccount/freeCost/getList', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-
-//获取会计科目
-export const getAccountList = (params:any) => {
-  return request('/costAccount/freeCost/getAccountList', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-//获取分摊参数
-export const getShareParamList = (params:any) => {
-  return request('/costAccount/freeCost/getShareParamList', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-//获取闲置责任中心
-export const getIdleResponsibleList = (params:any) => {
-  return request('/costAccount/freeCost/getResponsibilityList', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-
-
-//新增
-export type AddTableDataType = {
-  "freeAccountCode":string, //闲置成本代码
-  "freeAccountName":string, //闲置成本名称
-  "accountCode":string, //成本代码
-  "accountName": string, //成本名称
-  "canParamCode": string, //可检查时间参数代码
-  "canParamName":string, //可检查时间参数名称
-  "actualParamCode": string, //实际检查时间参数代码
-  "actualParamName": string //实际检查时间参数名称
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/freeCost/addFreeCost', {
-    method: 'POST',
-    data:{...data}
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/freeCost/editFreeCost', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (id:number) => {
-  return request('/costAccount/freeCost/deleteFreeCost', {
-    method: 'POST',
-    params:{id}
-  });
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 42
src/pages/baseSetting/costAllocationSet/idleCostSetting/style.less

@@ -1,42 +0,0 @@
-.IdleCostSetting {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    margin-bottom: 16px;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-        .add {
-          cursor: pointer;
-          display: inline-block;
-          font-size: 14px;
-          font-weight: 400;
-          color: #FFFFFF;
-          line-height: 24px;
-          padding: 0 14px;
-          background: #3377FF;
-          border-radius: 4px;
-        }
-    }
-  }
-}

+ 0 - 371
src/pages/baseSetting/costAllocationSet/revenueImputationSet/index.tsx

@@ -1,371 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-10-15 15:28:19
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-
-import { ActionType, ProFormDependency, ProFormInstance, ProFormSelect, ProFormDigit } from '@ant-design/pro-components';
-import { ModalForm, ProFormCascader } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { message, Popconfirm, Modal } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, delData, editData, getIncomeCollectionList, incomeCollectionListConnectAccountingSubject } from './service';
-
-import './style.less';
-import { getResponsibilityCenterList } from '../../responsibilityCenterSet/responsibilityCenter/service';
-import TableTransfer from './transform';
-import React from 'react';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-const transferTableColumn = [
-    {
-        title: '会计科目编码',
-        dataIndex: 'accountingCode',
-        ellipsis: true,
-    },
-    {
-        title: '会计科目名',
-        dataIndex: 'accountingName',
-        ellipsis: true,
-    },
-]
-
-export default function AccountingSubMana() {
-
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [currentRow, setCurrentRow] = useState<any | undefined>(undefined);
-
-    const columns: ProColumns[] = [
-
-        {
-            title: '收入归集Id',
-            dataIndex: 'id',
-        },
-        {
-            title: '开单科室状态',
-            dataIndex: 'openDepartmentStatus',
-            renderText(num) {
-                return num == 1 ? '收益中心' : '成本中心'
-            },
-        },
-        {
-            title: '开单科室分配比例',
-            align:'right',
-            dataIndex: 'openDepartmentProportion',
-        },
-        {
-            title: '执行科室',
-            dataIndex: 'startDepartmentStatus',
-            renderText(num) {
-                return num == 1 ? '收益中心' : '成本中心'
-            },
-        },
-        {
-            title: '执行科室比例',
-            align:'right',
-            dataIndex: 'startDepartmentProportion',
-        },
-        {
-            title: '归集到其他责任中心',
-            dataIndex: 'responsibilityName',
-            ellipsis: true,
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 200,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                const { accountStatus } = record;
-                return accountStatus == 0 ? [
-                    <UpDataActBtn key={'edit'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>
-                ] : [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                    <a key='ather' onClick={() => { oprnTableTransform(record); }}>排除会计科目</a>
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getIncomeCollectionList(params);
-        if (resp) {
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData([record.id]);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const oprnTableTransform = (record: any) => {
-
-        const ref = React.createRef<{ save: any; }>();
-
-        Modal.confirm({
-            title: `排除会计科目`,
-            icon: <></>,
-            width: 750,
-            centered: true,
-            okText: '确定',
-            cancelText: '取消',
-            content: <TableTransfer
-                ref={ref}
-                keyName="accountingCode"
-                record={record}
-                onSave={(keys, rows) => onSaveHandle(keys, rows, record)}
-                leftColumns={transferTableColumn}
-                rightColumns={transferTableColumn} dataSource={[]}
-            ></TableTransfer>,
-            onOk: () => {
-                return ref.current && ref.current.save();
-            }
-        })
-    }
-
-    const onSaveHandle = async (keys: Key[], rows: any[], record: any) => {
-    
-        const { id } = record;
-        const resp = await incomeCollectionListConnectAccountingSubject({ id, accountCodes: keys });
-        if(resp){
-               message.success('操作成功!');
-               tableRef.current?.reload();
-        }
-
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-
-        const { openDepartmentProportion, startDepartmentProportion } = formVal;
-        const result = {
-            ...formVal,
-            responsibilityCodes: formVal.responsibilityCodes ? formVal.responsibilityCodes.join('/') : null,
-            startDepartmentProportion: startDepartmentProportion ? startDepartmentProportion : 0,
-            openDepartmentProportion: openDepartmentProportion ? openDepartmentProportion : 0
-        }
-
-        if (type == 'ADD') {
-            const resp = await addData(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-        }
-        if (type == 'EDIT') {
-            try {
-                const resp = await editData(result);
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-            } catch (error) {
-                console.log({ error });
-            }
-
-        }
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
-
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}收入归集设置`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record, responsibilityCodes: record.responsibilityCodes ? record.responsibilityCodes.split('/') : []
-                } : {}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormSelect
-                    name="openDepartmentStatus"
-                    label="开单科室状态"
-                    options={[
-                        { label: '收益中心', value: 1 },
-                        { label: '成本中心', value: 2 }
-                    ]}
-                    placeholder="请选择状态"
-                    rules={[{ required: true, message: '请选择开单科室状态!' }]}
-                />
-                <ProFormDependency name={['openDepartmentStatus']}>
-                    {
-                        ({ openDepartmentStatus }) => {
-
-                            return openDepartmentStatus == 2 ? (
-                                <ProFormDigit
-                                    disabled
-                                    label="开单科室比例"
-                                    initialValue={0}
-                                    rules={[
-                                        {
-                                            required: false,
-                                            message: '开单科室比例是必填项!',
-                                        },
-                                    ]}
-                                    name="openDepartmentProportion"
-                                />
-                            ) : (
-                                <ProFormDigit
-                                    label="开单科室比例"
-                                    rules={[
-                                        {
-                                            required: true,
-                                            message: '开单科室比例是必填项!',
-                                        },
-                                    ]}
-                                    name="openDepartmentProportion"
-                                />
-                            )
-                        }
-                    }
-                </ProFormDependency>
-                <ProFormSelect
-                    name="startDepartmentStatus"
-                    label="执行科室状态"
-                    options={[
-                        { label: '收益中心', value: 1 },
-                        { label: '成本中心', value: 2 }
-                    ]}
-                    placeholder="请选择状态"
-                    rules={[{ required: true, message: '请选择执行科室状态!' }]}
-                />
-                <ProFormDependency name={['startDepartmentStatus']}>
-                    {
-                        ({ startDepartmentStatus }) => {
-                            return startDepartmentStatus == 2 ? (
-                                <ProFormDigit
-                                    disabled
-                                    label="执行科室比例"
-                                    initialValue={0}
-                                    rules={[
-                                        {
-                                            required: false,
-                                            message: '执行科室比例是必填项!',
-                                        },
-                                    ]}
-                                    name="startDepartmentProportion"
-                                />
-                            ) : (
-                                <ProFormDigit
-                                    label="执行科室比例"
-                                    rules={[
-                                        {
-                                            required: true,
-                                            message: '执行科室比例是必填项!',
-                                        },
-                                    ]}
-                                    name="startDepartmentProportion"
-                                />
-                            )
-                        }
-                    }
-                </ProFormDependency>
-                <ProFormDependency name={['openDepartmentStatus', 'startDepartmentStatus']}>
-                    {({ openDepartmentStatus, startDepartmentStatus }) => {
-
-                        return (openDepartmentStatus == 2 && startDepartmentStatus == 2) ? (
-                            <ProFormCascader
-                                placeholder={'请选择'}
-                                label='选择责任中心:'
-                                name='responsibilityCodes'
-                                fieldProps={{
-                                    fieldNames: { label: 'responsibilityName', value: 'responsibilityCode', children: 'child' },
-                                    onChange: (val: any) => {
-
-                                    }
-                                }}
-                                request={async () => {
-                                    const resp = await getResponsibilityCenterList({ pageSize: 50, current: 1 });
-                                    if (resp) {
-                                        return resp.list
-                                    }
-                                }}
-
-                            />
-                        ) : <></>
-                    }}
-                </ProFormDependency>
-            </ModalForm>
-        )
-    }
-
-    useEffect(() => {
-
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='AccountingSubMana' title={false}>
-            <div className='toolBar' style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
-                <div className='title'>收入归集设置</div>
-                <div className='btnGroup'>
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div>
-                <KCIMTable scroll={{y:`calc(100vh - 234px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 92
src/pages/baseSetting/costAllocationSet/revenueImputationSet/service.ts

@@ -1,92 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-20 17:36:02
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { Key } from 'react';
-import { request } from 'umi';
-
-//获收入归集列表
-export async function getIncomeCollectionList(params:any) {
-  return request('/costAccount/costincomegroupset/list', {
-    method: 'GET',
-    params: {...params},
-  });
-}
-
-//获指定收入归集设置对应的会计科目
-export const getIncomeCollectionListHasConnected = (params:any) => {
-
-  return request('/costAccount/costincomegroupset/getIncomeAccountStatus', {
-    method: 'GET',
-    params: {...params},
-  });
-}
-
-
-
-//新增
-export type AddTableDataType = {
-  openDepartmentStatus:number,
-  responsibilityCodes:string,
-  startDepartmentProportion:number,
-  startDepartmentStatus:number
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/costincomegroupset/addCostIncomeGroupSet', {
-    method: 'POST',
-    data: {...data},
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/costincomegroupset/update', {
-    method: 'POST',
-    data: {...data},
-  });
-};
-
-//删除表格操作
-export const delData = (ids:Key[]) => {
-  return request(`/costAccount/costincomegroupset/delete`, {
-    data:ids,
-    method: 'POST',
-  });
-};
-
-//收入归集设置添加会计科目
-export const incomeCollectionListConnectAccountingSubject = (data:any) => {
-  return request(`/costAccount/costincomegroupset/addIncomeAccount`, {
-    data:data,
-    method: 'POST',
-  });
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 35
src/pages/baseSetting/costAllocationSet/revenueImputationSet/style.less

@@ -1,35 +0,0 @@
-.AccountingSubMana {
-  padding: 16px;
-  padding-top: 0;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    padding: 16px 0;
-
-    .title {
-      font-size: 16px;
-      font-weight: 500;
-      color: #17181A;
-    }
-
-    .btnGroup {
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-    }
-  }
-}

+ 0 - 155
src/pages/baseSetting/costAllocationSet/revenueImputationSet/transform.tsx

@@ -1,155 +0,0 @@
-import React, { Key, useEffect, useImperativeHandle, useState } from "react";
-import { Transfer } from 'antd'
-import { TransferItem, TransferProps } from 'antd/es/transfer';
-import { ColumnsType } from 'antd/es/table';
-import { difference } from "lodash";
-import { TableRowSelection } from 'antd/es/table/interface';
-import { KCIMTable } from "@/components/KCIMTable";
-import { ProColumns } from "@ant-design/pro-components";
-import { Tabs} from 'antd';
-
-import { log } from "mathjs";
-import { getAccountingSubjectList } from "../../accountingAccountSet/accountingSubMana/service";
-import { getIncomeCollectionListHasConnected } from "./service";
-
-
-
-interface TableTransferProps extends TransferProps<TransferItem> {
-    leftColumns: ProColumns[];
-    rightColumns: ProColumns[];
-    record: any,
-    keyName: string,
-    onSave: (selectedKeys: Key[], selectedRowKeys: any[]) => void;
-}
-
-const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, keyName, record, onSave, ...restProps }: TableTransferProps, ref) => {
-    
-    const [_data, _set_data] = useState<any>();
-    const [targetKeys, setTargetKeys] = useState<string[]>([]);
-    const [datasource, set_datasource] = useState<any[]>([]);
-    const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
-
-    //获取列表
-    const getFuncList = async () => {
-
-        const {id } = record;
-        const resp = await getAccountingSubjectList({ accountType:1, shareParamId: id, pageSize: 500, current: 1 });
-
-        if (resp) {
-
-            set_datasource(resp.list);
-            _set_data(resp.list);
-            // setTargetKeys(accountingIds);
-        }
-
-    }
-
-    const setInit = async ()=>{
-        const {id} = record;
-        const resp = await getIncomeCollectionListHasConnected({id});
-        if(resp){
-           const tempArr = resp?resp.map((item:any)=>item.accountingCode):[];
-           setTargetKeys([...tempArr]);
-        }
-      }
-
-    const onChange = (nextTargetKeys: string[]) => {
-        setTargetKeys(nextTargetKeys);
-    };
-
-    const onSelectChange = (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => {
-        //console.log('sourceSelectedKeys:', sourceSelectedKeys,'targetSelectedKeys:',targetSelectedKeys);
-        setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]);
-    };
-
-    useImperativeHandle(ref, () => ({
-        save: async () => {
-            const items = datasource.filter(a => targetKeys.includes(a[`${keyName}`]));
-            onSave(targetKeys, items);
-        }
-    }));
-
-    useEffect(() => {
-        getFuncList();
-        setInit();
-    }, []);
-
-
-
-    return (
-        <div>
-            <Transfer className='TableTransfer' showSearch
-                titles={['待选项', '已选项']}
-                locale={{
-                    itemUnit: '项',
-                    itemsUnit: '项',
-                    searchPlaceholder: '请输入',
-                }}
-                oneWay={false}
-                onChange={onChange}
-                onSelectChange={onSelectChange}
-                dataSource={datasource}
-                rowKey={record => record[`${keyName}`]}
-                targetKeys={targetKeys}
-                selectedKeys={selectedKeys}
-                filterOption={(inputValue, item) => {
-                    return item.name!.indexOf(inputValue) !== -1
-                }}
-            >
-                {({
-                    direction,
-                    filteredItems,
-                    onItemSelectAll,
-                    onItemSelect,
-                    selectedKeys: listSelectedKeys,
-                    disabled: listDisabled,
-                }) => {
-
-                    // console.log({ filteredItems, listSelectedKeys,direction });
-                    const columns = direction === 'left' ? leftColumns : rightColumns;
-
-                    const rowSelection: TableRowSelection<TransferItem> = {
-                        getCheckboxProps: (item) => ({ disabled: listDisabled || item.disabled }),
-                        onSelectAll(selected, selectedRows) {
-                            const treeSelectedKeys = selectedRows.map((a) => a[`${keyName}`]);
-                            const diffKeys = selected
-                                ? difference(treeSelectedKeys, listSelectedKeys)
-                                : difference(listSelectedKeys, treeSelectedKeys);
-                            onItemSelectAll(diffKeys as string[], selected);
-                        },
-                        onSelect(item, selected) {
-                            onItemSelect(item[`${keyName}`], selected);
-                        },
-                        selectedRowKeys: listSelectedKeys,
-                    };
-
-                    return (
-                        <KCIMTable
-                            rowSelection={rowSelection}
-                            columns={columns as TransferItem[]}
-                            dataSource={filteredItems}
-                            size="small"
-                            bordered={false}
-                            rowKey={`${keyName}`}
-                            tableStyle={{border:'none'}}
-                            pagination={{ showTitle: false, pageSize: 9, showLessItems: false, simple: true, showTotal: () => false }}
-                            tableAlertRender={false}
-                            style={{ pointerEvents: listDisabled ? 'none' : undefined }}
-                            onRow={(row) => ({
-                                onClick: () => {
-                                    if (row.itemDisabled || listDisabled) return;
-                                    onItemSelect(row[`${keyName}`], !listSelectedKeys.includes(row[`${keyName}`]));
-                                },
-                            })}
-                        />
-                    );
-                }}
-            </Transfer>
-        </div>
-
-    )
-});
-
-export default TableTransfer
-
-

+ 0 - 820
src/pages/baseSetting/otherItemSet/departmentCostCalc/index.tsx

@@ -1,820 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-10-29 14:55:48
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-
-import { ActionType, ProFormInstance } from '@ant-design/pro-components';
-import { ModalForm } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Modal, message, Drawer, Tabs, Input, DatePicker, Popover, Alert, Skeleton } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-import * as XLSX from 'xlsx';
-import { saveAs } from 'file-saver';
-import moment from 'moment';
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, computeProfitReq, getReportDataReq, getReportProjectSettingList, getResponsibleCenters, saveReportRelation } from './service';
-
-import './style.less';
-
-import React from 'react';
-
-import { getDicDataBySysId, getParamsDataBySysId } from '@/services/getDic';
-import { KCIMLeftList } from '@/components/KCIMLeftList';
-import { formatMoneyNumber } from '@/utils/format';
-import { useModel } from '@umijs/max';
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-function findAllParents(tree: any[]) {
-    let parents: any[] = [];
-    // 递归函数来遍历树并找到所有父节点
-    function traverse(nodes: any[]) {
-        for (const node of nodes) {
-            // 检查节点是否有子节点
-            if (node.children && node.children.length > 0) {
-                parents.push(node); // 添加到父节点列表
-                traverse(node.children); // 递归遍历子节点
-            }
-        }
-    }
-
-    traverse(tree); // 开始遍历树
-    return parents; // 返回所有父节点的数组
-}
-
-function countLeafNodes(trees: any[]) {
-    let leafCount = 0;
-
-    // 遍历集合中的每棵树
-    for (let i = 0; i < trees.length; i++) {
-        leafCount += countLeafNodesRecursive(trees[i]);
-    }
-
-    return leafCount;
-}
-
-function countLeafNodesRecursive(node: any) {
-    // 如果当前节点没有子节点,说明它是一个叶子节点
-    if (!node.children || node.children.length === 0) {
-        return 1;
-    }
-
-    let leafCount = 0;
-
-    // 递归计算每个子节点的叶子节点数
-    for (let i = 0; i < node.children.length; i++) {
-        leafCount += countLeafNodesRecursive(node.children[i]);
-    }
-
-    return leafCount;
-}
-
-
-function searchTree(tree: any[], searchTerm: string) {
-    // 定义结果数组
-    let results = [];
-
-    // 定义递归函数来搜索匹配的节点
-    function searchNode(node: any) {
-        // 创建一个变量来标记当前节点或其子节点是否匹配
-        let isMatch = false;
-
-        // 检查当前节点的 name 或 code 是否包含搜索词
-        if (node.reportName.includes(searchTerm)) {
-            isMatch = true;
-        }
-
-        // 复制当前节点,避免修改原始数据
-        let newNode = { ...node, children: [] };
-
-        // 如果有子节点,递归搜索每个子节点
-        if (node.children) {
-            for (let child of node.children) {
-                let childMatch = searchNode(child);
-                // 如果子节点或其子树匹配,添加到新节点的子节点数组中
-                if (childMatch) {
-                    newNode.children.push(childMatch);
-                    isMatch = true;
-                }
-            }
-        }
-
-        // 如果当前节点或其任何子节点匹配,返回新节点
-        // 如果children为空,则不包含children属性
-        if (isMatch) {
-            if (newNode.children.length === 0) {
-                delete newNode.children;
-            }
-            return newNode;
-        } else {
-            return null;
-        }
-    }
-
-    // 遍历树的每个顶级节点
-    for (let node of tree) {
-        let result = searchNode(node);
-        if (result) {
-            results.push(result);
-        }
-    }
-
-    return results;
-}
-
-function processTree(originalData: any[]) {
-    return originalData.map(node => {
-        // 深复制当前节点
-        const newNode = JSON.parse(JSON.stringify(node));
-
-        // 如果当前节点有profitList,处理它
-        if (newNode.profitList && Array.isArray(newNode.profitList)) {
-            newNode.profitList.forEach((profit: any) => {
-                // 添加新的键值对到新节点
-                newNode[`${profit.reportId}`] = formatMoneyNumber(profit.value);
-            });
-            // 如果不需要保留profitList,可以删除
-            // delete newNode.profitList;
-        }
-
-        // 如果节点有子节点,递归处理子节点
-        if (node.child && Array.isArray(node.child)) {
-            newNode.children = processTree(node.child);
-        }
-
-        return newNode;
-    });
-}
-
-// 递归函数,用于处理多层级标题
-function generateColumns(item: any, titleIndex = 0, title: string, hideRatioColumns = false) {
-    // 检查是否需要隐藏"占比"列,如果title包含"占比",且hideRatioColumns为true,则返回null
-    if (hideRatioColumns && item[`${title}`].includes('占比')) {
-        return null;
-    }
-
-    const column: any = title == 'responsibilityName' ? {
-        title: item[`${title}`],
-        dataIndex: `${item.responsibilityCode}`,
-        key: `${item.responsibilityCode}`,
-        align: (item.responsibilityCode.indexOf('amount') != -1) ? 'right' : 'right',
-        ellipsis: true,
-        renderText(num: number, record: any) {
-            if (item.responsibilityCode.indexOf('amount') != -1) {
-                return formatMoneyNumber(num);
-            } else {
-                return num;
-            }
-        },
-    } : {
-        title: item[`${title}`],
-        ellipsis: true,
-        dataIndex: `${item[`reportId`]}`,
-        key: `${item[`reportId`]}`,
-        align: 'right',
-    };
-
-    // 递归处理子列
-    if (item.childTitle && Array.isArray(item.childTitle) && item.childTitle.length > 0) {
-        column.children = item.childTitle
-            .map((a: any, aindex: number) => generateColumns(a, titleIndex + 1, title, hideRatioColumns))
-            .filter((col: any) => col !== null); // 过滤掉null项
-    }
-    if (item.child && Array.isArray(item.child) && item.child.length > 0) {
-        column.children = item.child
-            .map((a: any, aindex: number) => generateColumns(a, titleIndex + 1, title, hideRatioColumns))
-            .filter((col: any) => col !== null); // 过滤掉null项
-    }
-
-    return column;
-}
-
-
-
-
-
-function transformTreeData(tree: any[]) {
-    // 遍历整个树
-    return tree.map(node => {
-        // 解构出data中的字段并添加到当前节点
-        if (Array.isArray(node.data)) {
-            node.data.forEach((item: any) => {
-                // 将data数组中的每个对象转换成当前节点的属性
-                if (item.code && item.value !== undefined) {
-                    node[item.code] = item.value;
-                }
-            });
-        }
-
-        // 递归处理子节点,如果存在子节点
-        if (node.children) {
-            node.children = transformTreeData(node.children);
-        }
-
-        // 返回处理后的节点
-        return node;
-    });
-}
-
-const getNextUnexpandedKeys = (data: any[], expandedKeys: any[] = []) => {
-    let keys: any[] = [];
-
-    const traverse = (nodes: any) => {
-        for (const node of nodes) {
-            // 如果当前节点还没有展开,就把它加入 keys
-            if (!expandedKeys.includes(node.id)) {
-                keys.push(node.id);
-            }
-
-            // 如果当前节点已经展开,继续遍历子节点
-            if (node.children && expandedKeys.includes(node.id)) {
-                traverse(node.children);
-            }
-        }
-    };
-
-    traverse(data);
-
-    return keys;
-};
-
-
-
-export default function DepartmentCostCalc() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ reportType: 0 });
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [tabs, set_tabs] = useState<any[]>([]);
-
-    const { initialState, setInitialState } = useModel('@@initialState');
-    const [computeDate, set_computeDate] = useState<string>(initialState ? initialState.computeDate : '');
-    const [responsibleCenters, set_responsibleCenters] = useState<any[]>([]);
-    const [currentTabKey, set_currentTabKey] = useState<any | undefined>(undefined);
-    const [currentTab, set_currentTab] = useState<any | undefined>(undefined);
-    const [currentSelectedRespon, set_currentSelectedRespon] = useState<any | undefined>(undefined);
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState('');
-    const [allParentsKeys, set_allParentsKeys] = useState<Key[]>([]);
-    const [drawerTableVisible, set_drawerTableVisible] = useState(false);
-    const [dataSource, set_dataSource] = useState<any[]>([]);
-    const [tableColumns, set_tableColumns] = useState<any[]>([]);
-    const [calcResultText, set_calcResultText] = useState<undefined | string>(undefined);
-    const [loadingtransform, set_loadingtransform] = useState(false);
-    const [ifShowPercent, set_ifShowPercent] = useState(true);
-
-    const columns: ProColumns[] = [
-
-        {
-            title: '报表项目名称',
-            dataIndex: 'reportName',
-            width: '50%',
-            ellipsis: true,
-            renderText(text, record, index, action) {
-                const { description } = record;
-                return description ? <Popover content={() => <div dangerouslySetInnerHTML={{ __html: description }} />}><span style={{ cursor: 'pointer' }}>{text}</span><IconFont className="hover-icon" style={{ fontSize: 16, color: '#17181a', paddingLeft: 4, position: 'relative', top: 1 }} type={'iconshuoming'} /></Popover> : text
-            },
-        },
-        {
-            title: '金额(元)',
-            align: 'right',
-            dataIndex: 'amount',
-            renderText(num, record) {
-                const { calcType } = record;
-                if (record.children && calcType == '0') {
-                    return <React.Fragment></React.Fragment>
-                } else {
-                    return formatMoneyNumber(num);
-                }
-            },
-        },
-        {
-            title: '占比',
-            align: 'right',
-            hideInTable: !ifShowPercent,
-            dataIndex: 'percent',
-            renderText(num, record) {
-                const { calcType } = record;
-                if (record.children && calcType == '0') {
-                    return <React.Fragment></React.Fragment>
-                } else {
-                    return num != null ? `${((num * 100).toFixed(2))}%` : num
-                }
-
-            },
-        },
-    ];
-
-
-    // 主函数,生成表格列
-    const generateTableColumns = (title: any[], titleKeyName: string) => {
-        return title.map((item: any, titleIndex: number) => generateColumns(item, titleIndex, titleKeyName, !ifShowPercent));
-    };
-
-
-    const getTableData = async (params: any) => {
-        const { responsibilityCode, filter = undefined } = params;
-        if (!responsibilityCode) return []
-        const resp = await getReportProjectSettingList({ ...params });
-
-        if (resp) {
-            if (filter) {
-                const filterData = searchTree(resp, filter);
-                const allParents = findAllParents(filterData);
-
-                set_allParentsKeys([...(allParents.map((a: any) => a.id))]);
-                set_dataSource([...filterData]);
-                return {
-                    data: filterData,
-                    success: true,
-                }
-            }
-            if (currentTab.value == '1') {
-                const allParents = findAllParents(resp);
-                set_allParentsKeys([...(allParents.map((a: any) => a.id))]);
-
-            }
-            set_dataSource([...resp]);
-
-            return {
-                data: resp,
-                success: true,
-            }
-        }
-        return []
-    }
-
-    const getIfshowPercent = async () => {
-        const { systemId } = JSON.parse(localStorage.getItem('currentSelectedTab') as string)
-        const resp = await getParamsDataBySysId(systemId, '1851077044079824896');
-        if (resp) {
-            set_ifShowPercent(resp.value == '1' ? true : false);
-        }
-    }
-
-
-    const onTabChanged = (key: Key) => {
-        set_currentTabKey(key);
-        const needItem = tabs.filter((a) => a.key == key);
-        if (needItem.length > 0) set_currentTab(needItem[0])
-    }
-
-    const getTabs = async () => {
-
-        const { systemId } = JSON.parse((localStorage.getItem('currentSelectedTab')) as string)
-        const resp = await getDicDataBySysId(systemId, 'PROFIT_REPORT_TYPE');
-        if (resp) {
-            const { dataVoList } = resp;
-            const tempArr = dataVoList.map((a: any) => ({ label: a.name, key: Number(a.code), value: a.value }));
-            const arr = (tempArr.filter((a: any) => a.value != '2'));
-            set_tabs([...arr]);
-            set_currentTabKey(arr[0].key);
-            set_currentTab(arr[0]);
-        }
-    }
-
-    const getResponsibleCenterList = async (reportType: string) => {
-        const resp = await getResponsibleCenters(reportType);
-        if (resp) {
-            set_responsibleCenters(resp);
-        }
-    }
-
-    const onLeftChange = (currentSelected: any) => {
-        set_currentSelectedRespon(currentSelected);
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-    }
-
-    const onekeyComputeProfitHandle = async () => {
-        Modal.confirm({
-            title: '注意',
-            content: '一键计算操作会覆盖当月已计算的数据,是否继续操作?',
-            okText: '确定',
-            cancelText: '取消',
-            onOk: async () => {
-                try {
-                    const promises = tabs.map(tab => computeProfitReq(computeDate, tab.key));  // 对每个tab创建一个请求
-                    const results = await Promise.all(promises);  // 等待所有请求完成
-
-                    const allSuccess = results.every(resp => resp);  // 检查所有请求是否都成功
-                    if (allSuccess) {
-                        message.success('操作成功!');
-                        set_calcResultText('一键计算成功!');
-                    } else {
-                        set_calcResultText('一键计算部分失败!');
-                    }
-
-                    tableRef.current?.reload();  // 重新加载表格数据
-                } catch (error) {
-                    message.error('操作失败,请重试!');
-                    set_calcResultText('一键计算失败!');
-                }
-            },
-        });
-    };
-
-
-    const computeProfitHandle = async () => {
-
-        Modal.confirm({
-            title: '注意',
-            content: '计算操作会覆盖当月已计算的数据,是否继续操作?',
-            okText: '确定',
-            cancelText: '取消',
-            onOk: async (...args) => {
-
-                const resp = await computeProfitReq(computeDate, currentTabKey);
-                if (resp) {
-                    message.success('操作成功!');
-                    set_calcResultText('计算成功!');
-                    tableRef.current?.reload();
-                } else {
-                    set_calcResultText('计算失败!');
-                }
-            },
-        })
-    }
-
-    const openTableDataDrawer = async () => {
-        set_drawerTableVisible(true);
-        set_loadingtransform(true);
-        if (currentTab.value == '3') {
-            const resp = await getReportDataReq(currentTabKey, computeDate, '3');
-            if (resp) {
-                const { title = [], data = [] } = resp;
-                const defaultColumns: ProColumns[] = [
-                    {
-                        title: '报表项目名称',
-                        dataIndex: 'reportName',
-                        key: 'reportName',
-                        width: 220,
-                        fixed: 'left'
-                    }
-                ];
-
-                const tableColumns = generateTableColumns(title, 'responsibilityName');
-                const dataSource = transformTreeData(data);
-                set_tableColumns([...defaultColumns, ...tableColumns]);
-                set_dataSource(dataSource);
-                set_loadingtransform(false);
-                // console.log({ columns: [...defaultColumns, ...tableColumns], dataSource })
-
-            }
-        } else {
-            const resp = await getReportDataReq(currentTabKey, computeDate, currentTab.value);
-            if (resp) {
-                const { title = [], data = [] } = resp;
-                const defaultColumns = [{
-                    title: '科室名称',
-                    dataIndex: 'responsibilityName',
-                    key: 'responsibilityName',
-                    width: 220,
-                    fixed: 'left'
-                }];
-
-                const tableColumns = generateTableColumns(title, 'reportName');
-                const dataSource = processTree(data);
-                set_tableColumns([...defaultColumns, ...tableColumns]);
-
-                set_dataSource(dataSource);
-                set_loadingtransform(false);
-
-                // console.log({ columns: [...defaultColumns, ...tableColumns], dataSource })
-
-            }
-        }
-    }
-
-
-    const getHeaderRows = (columns: any[], level = 0, headerRows: any[] = [], maxLevel = 0) => {
-        headerRows[level] = headerRows[level] || [];
-        columns.forEach((col: { title: any; children: any; }) => {
-            const colSpan = getColSpan(col);
-            headerRows[level].push({ title: col.title, colSpan, rowSpan: col.children ? 1 : maxLevel - level });
-            if (col.children) {
-                getHeaderRows(col.children, level + 1, headerRows, maxLevel);
-            } else {
-                // 填充空白单元格
-                for (let i = level + 1; i < maxLevel; i++) {
-                    headerRows[i] = headerRows[i] || [];
-                    headerRows[i].push({ title: '', colSpan: 1, rowSpan: 1 });
-                }
-            }
-        });
-        return headerRows;
-    };
-
-    const getColSpan: any = (col: { children: any[]; }) => {
-        if (!col.children) return 1;
-        return col.children.reduce((sum, child) => sum + getColSpan(child), 0);
-    };
-
-    const getMaxLevel = (col: any) => {
-        if (!col.children) return 1;
-        return 1 + Math.max(...col.children.map(getMaxLevel));
-    };
-
-    const extractLeafColumns = (columns: any[]) => {
-        let leafColumns: any[] = [];
-        columns.forEach(col => {
-            if (col.children) {
-                leafColumns = leafColumns.concat(extractLeafColumns(col.children));
-            } else {
-                leafColumns.push(col);
-            }
-        });
-        return leafColumns;
-    };
-
-    const addRowWithIndentation = (record: any, level: number, leafColumns: any[], worksheetData: any[]) => {
-        const row = leafColumns.map(col => {
-            let value = record[col.dataIndex] ?? '';
-
-            // 应用 renderText 函数来格式化导出数据,保持与表格渲染时一致
-            if (col.renderText) {
-                value = col.renderText(value, record);
-            }
-
-            return value;
-        });
-
-        // 在第一列前添加缩进空格以表示层级
-        row[0] = ' '.repeat(level * 4) + row[0]; // 每一级增加 4 个空格作为缩进
-
-        worksheetData.push(row);
-
-        // 递归处理子节点
-        if (record.children) {
-            record.children.forEach((child: any) => addRowWithIndentation(child, level + 1, leafColumns, worksheetData));
-        }
-    };
-
-    const handleExport = () => {
-        try {
-            const workbook = XLSX.utils.book_new();
-            const worksheetData: any[] = [];
-
-            // 获取最大层级
-            const maxLevel = tableColumns.reduce((max, col) => Math.max(max, getMaxLevel(col)), 0);
-
-            // 生成多层级表头
-            const headerRows = getHeaderRows(tableColumns, 0, [], maxLevel);
-
-            // 构建表头行
-            headerRows.forEach((row: any, rowIndex) => {
-                const rowData: string[] = [];
-                row.forEach((cell: { title: any; colSpan: number; rowSpan: number; }) => {
-                    rowData.push(cell.title);
-                    for (let i = 1; i < cell.colSpan; i++) {
-                        rowData.push('');
-                    }
-                });
-                worksheetData.push(rowData);
-            });
-
-            // 填充单层表头的空白行
-            if (maxLevel > 1) {
-                const numColumns = headerRows[0].reduce((sum: any, cell: { colSpan: any; }) => sum + cell.colSpan, 0);
-                for (let i = 1; i < maxLevel; i++) {
-                    while (worksheetData[i].length < numColumns) {
-                        worksheetData[i].push('');
-                    }
-                }
-            }
-
-            // 提取最内层表头列
-            const leafColumns = extractLeafColumns(tableColumns);
-
-            // 添加数据并处理树结构
-            dataSource.forEach(record => addRowWithIndentation(record, 0, leafColumns, worksheetData));
-
-            const worksheet = XLSX.utils.aoa_to_sheet(worksheetData);
-
-            // 初始化合并单元格数组
-            worksheet['!merges'] = worksheet['!merges'] || [];
-
-            // 合并单元格
-            headerRows.forEach((row: any, rowIndex) => {
-                let colIndex = 0;
-                row.forEach((cell: { colSpan: number; rowSpan: number; }) => {
-                    if (cell.colSpan > 1 || cell.rowSpan > 1) {
-                        worksheet['!merges']!.push({  // 使用非空断言 '!'
-                            s: { r: rowIndex, c: colIndex },
-                            e: { r: rowIndex + cell.rowSpan - 1, c: colIndex + cell.colSpan - 1 }
-                        });
-                    }
-                    colIndex += cell.colSpan;
-                });
-            });
-
-            // 设置单元格对齐方式
-            Object.keys(worksheet).forEach(cell => {
-                if (cell[0] !== '!') {
-                    worksheet[cell].s = {
-                        alignment: { vertical: 'center', horizontal: 'center' }
-                    };
-                }
-            });
-
-            XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
-
-            const wbout = XLSX.write(workbook, { bookType: 'xlsx', type: 'binary' });
-            const s2ab = (s: string) => {
-                const buf = new ArrayBuffer(s.length);
-                const view = new Uint8Array(buf);
-                for (let i = 0; i < s.length; i++) view[i] = s.charCodeAt(i) & 0xFF;
-                return buf;
-            };
-
-            saveAs(new Blob([s2ab(wbout)], { type: 'application/octet-stream' }), currentTab ? `${currentTab.label}.xlsx` : 'table_data.xlsx');
-        } catch (error) {
-            console.error('Export failed:', error);
-        }
-    };
-
-
-    const handleExpandNext = () => {
-        // 当前所有未展开的节点,第一层优先展开
-        const keysToExpand = getNextUnexpandedKeys(dataSource, allParentsKeys);
-        set_allParentsKeys((prev) => Array.from(new Set([...prev, ...keysToExpand])));
-    };
-
-    const handleCollapseAll = () => {
-        set_allParentsKeys([]);
-    };
-
-
-    useEffect(() => {
-        if (computeDate && currentTabKey != undefined) {
-            getResponsibleCenterList(currentTabKey);
-        }
-        set_allParentsKeys([]);
-        set_dataSource([]);
-    }, [computeDate, currentTabKey]);
-
-    useEffect(() => {
-        if (currentSelectedRespon) {
-            set_tableDataFilterParams({
-                ...tableDataFilterParams,
-                responsibilityCode: currentSelectedRespon.responsibilityCode,
-                reportType: currentTabKey,
-                computeDate: computeDate
-            })
-        }
-        set_allParentsKeys([]);
-        set_dataSource([]);
-    }, [currentSelectedRespon])
-
-
-    useEffect(() => {
-        getTabs();
-        getIfshowPercent();
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='DepartmentCostCalc' title={false}>
-
-            <Drawer className='drawerTable' contentWrapperStyle={{}} bodyStyle={{ padding: 16 }} title={false} open={drawerTableVisible} width={1000} headerStyle={{ display: 'none' }}>
-                <div className='header'>
-                    <div className='title'>{currentTab ? currentTab.label : ''}(单位:元)</div>
-
-                    <div className='btns'>
-                        <span onClick={() => set_drawerTableVisible(false)}>关闭</span>
-                        <span className='close' onClick={() => handleExport()}>导出</span>
-
-                    </div>
-                </div>
-                {/* {loadingtransform && <Skeleton />} */}
-                <KCIMTable loading={loadingtransform} expandable={{ defaultExpandAllRows: true }} className='departmentCostCalcReportTable'
-                    dataSource={dataSource} bordered pagination={false}
-                    scroll={{ x: countLeafNodes(tableColumns) * 200, y: `calc(100vh - ${84 + ((tableColumns.reduce((max, col) => Math.max(max, getMaxLevel(col)), 0)) * 38)}px)` }}
-                    columns={tableColumns as ProColumns[]} rowKey='id' />
-
-            </Drawer>
-
-            <div className='header'>
-                <div className="search">
-                    <span>核算年月:</span>
-                    <DatePicker
-                        onChange={(data, dateString) => {
-                            set_computeDate(dateString);
-                            setInitialState((s: any) => ({ ...s, computeDate: dateString, }))
-                            set_tableDataFilterParams({
-                                ...tableDataFilterParams,
-                                computeDate: dateString,
-                            });
-                        }}
-                        picker="month"
-                        locale={locale}
-                        defaultValue={moment(computeDate, 'YYYY-MM')}
-                        format="YYYY-MM"
-                        autoComplete="off"
-                        placeholder="选择年月"
-                    />
-                </div>
-                <div className='btnGoup'>
-                    <span className='onekeyCalcBtn' onClick={() => onekeyComputeProfitHandle()}>一键计算</span>
-                </div>
-            </div>
-            <div className='content'>
-                <Tabs
-                    defaultActiveKey={tabs.length > 0 ? tabs[0].key : undefined}
-                    items={tabs}
-                    key={'key'}
-                    onChange={(key) => onTabChanged(key)}
-                />
-                {calcResultText && <Alert showIcon onClose={() => set_calcResultText(undefined)} icon={<IconFont type={(calcResultText.indexOf('失败') != -1) ? 'icon-cuowutishi' : 'icon-chenggongtishi'} />} closable style={{ padding: '4px 12px', marginBottom: 16, borderRadius: 4, border: (calcResultText.indexOf('失败') != -1) ? '1px solid #73E6BF' : '', background: (calcResultText.indexOf('失败') != -1) ? '#FFF1F3' : '#EBFFF8' }} message={calcResultText} type={calcResultText.indexOf('失败') != -1 ? 'error' : 'success'} />}
-                <div className='inner'>
-                    <div className='left'>
-                        <KCIMLeftList
-                            fieldNames={{ title: 'responsibilityName', key: 'responsibilityCode', children: 'children' }}
-                            rowKey={'responsibilityCode'}
-                            dataSource={responsibleCenters} searchKey={'responsibilityName'}
-                            onChange={onLeftChange}
-                            contentH={`100%`}
-                            // placeholder={leftListSearchPlaceHolder} 
-                            listType={'tree'}
-
-                        />
-                    </div>
-                    <div className='right'>
-                        <div className='toolBar'>
-                            <div className='filterItem' style={{ width: 228 }}>
-                                <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                                <Input placeholder={'报表项目代码/名称'} allowClear autoComplete='off'
-                                    suffix={
-                                        <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                                    }
-                                    onChange={(e) => {
-                                        set_tableDataSearchKeywords(e.target.value);
-                                        if (e.target.value.length == 0) {
-                                            set_tableDataFilterParams({
-                                                ...tableDataFilterParams,
-                                                filter: ''
-                                            });
-                                        }
-                                    }}
-                                    onPressEnter={(e) => {
-                                        set_tableDataFilterParams({
-                                            ...tableDataFilterParams,
-                                            filter: ((e.target) as HTMLInputElement).value
-                                        });
-                                    }}
-
-                                />
-                            </div>
-                            <div className='btnGroup'>
-                                <span className='btn' onClick={() => handleCollapseAll()}>全部折叠</span>
-                                <span className='btn' style={{ marginRight: 16 }} onClick={() => handleExpandNext()}>展开下一层</span>
-                                <span className='btn' onClick={() => openTableDataDrawer()}>报表数据</span>
-                                <span className='calc' onClick={() => computeProfitHandle()}>计算</span>
-                            </div>
-                        </div>
-                        <KCIMTable pagination={false}
-                            rowClassName={(record) => (record.children ? 'has-children hover-row' : 'hover-row')}
-                            expandable={{
-                                expandedRowKeys: allParentsKeys,
-                                onExpand(expanded, record) {
-                                    const { id } = record;
-                                    if (!expanded) {
-                                        const expandedKeys = allParentsKeys.filter(a => a != id);
-                                        set_allParentsKeys([...expandedKeys]);
-                                    } else {
-                                        set_allParentsKeys([...allParentsKeys, id]);
-                                    }
-                                },
-                            }} columns={columns as ProColumns[]} scroll={{ y: `calc(100vh - 302px)` }} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-                    </div>
-                </div>
-
-
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 130
src/pages/baseSetting/otherItemSet/departmentCostCalc/service.ts

@@ -1,130 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-20 10:39:17
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { Key } from 'react';
-import { request } from 'umi';
-
-//获取table列表数据
-export const getReportProjectSettingList = (params:any) => {
-  return request('/costAccount/costdepartmentprofit/getComputeProfitList', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-
-
-//新增
-export type AddTableDataType = {
-  calcFormula?:string,
-  calcType?:number,
-  isLoss?:number,
-  parentId?:number,
-  reportName?:string,
-  reportType?:number,
-  sort?:number
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/reportForm/save', {
-    method: 'POST',
-    data:{...data}
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/reportForm/edit', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (ids:Key[]) => {
-  return request('/costAccount/reportForm/delete', {
-    method: 'POST',
-    data:ids
-  });
-};
-
-
-//根据关系类型,获取已绑定的关系数据
-export const getHasSetReportRelation = (params:any) => {
-  return request('/costAccount/reportForm/getRelationList', {
-    method: 'GET',
-    params: {...params},
-  });
-}
-
-//保存对应设置
-export const saveReportRelation = (body:any) => {
-  return request('/costAccount/reportForm/saveReportRelation', {
-    method: 'POST',
-    data: {...body},
-  });
-}
-
-//复制数据
-export const copyDataToSelectedType = (body:any) => {
-  return request('/costAccount/reportForm/copyReport', {
-    method: 'POST',
-    data: {...body},
-  });
-}
-
-//获取执行责任中心
-export const getResponsibleCenters = (reportType:string) => {
-  return request('/costAccount/costdepartmentprofit/getProfitResponsibility', {
-    method: 'GET',
-    params:{reportType}
-  });
-}
-
-
-//获取报表数据
-export const getReportDataReq = (reportType:string,computeDate:string,tabkey:string) => {
-  return request(tabkey == '3'?'/costAccount/costdepartmentprofit/getComputeProfitCollect':'/costAccount/costdepartmentprofit/computeProfitReport', {
-    method: 'GET',
-    params:{reportType,computeDate}
-  });
-}
-
-//损益计算
-
-export const computeProfitReq = (computeDate:string,reportType:string) => {
-  return request('/costAccount/costdepartmentprofit/computeProfit', {
-    method: 'POST',
-    params: {computeDate,reportType},
-  });
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 168
src/pages/baseSetting/otherItemSet/departmentCostCalc/style.less

@@ -1,168 +0,0 @@
-.drawerTable {
-  .header {
-    display: flex;
-    width: 100%;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    margin-bottom: 16px;
-
-    .title {
-      font-weight: 500;
-      font-size: 16px;
-      color: #17181A;
-    }
-    .btns {
-      span {
-        display: inline-block;
-        cursor: pointer;
-        padding: 0 14px;
-        height: 24px;
-        line-height: 24px;
-        background: #FAFCFF;
-        border-radius: 4px;
-        font-weight: 400;
-        font-size: 14px;
-        color: #17181A;
-        border: 1px solid #DAE2F2;
-        &.close {
-          color: #fff;
-          background: #3377FF;
-          margin-left: 8px;
-        }
-      }
-    }
-  }
-}
-
-.DepartmentCostCalc {
-  background: #FFFFFF;
-  border-radius: 4px;
-
-  .header {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    border-radius: 4px;
-    padding: 16px;
-    background-color: #fff;
-    border-bottom: 16px solid #F7F9FC;
-
-    .btnGoup {
-      &>span {
-        cursor: pointer;
-        display: inline-block;
-        color: #17181A;
-        line-height: 24px;
-        padding: 0 14px;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-        background: #FAFCFF;
-        margin-right: 8px;
-        font-weight: 400;
-        font-size: 14px;
-        color: #17181A;
-
-        &.onekeyCalcBtn {
-          color: #fff;
-          background: #3377FF;
-        }
-      }
-    }
-  }
-
-  .content {
-    padding: 16px;
-    padding-top: 0;
-
-    .inner {
-      display: flex;
-      width: 100%;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: flex-start;
-
-      .left {
-        width: 220px;
-        height: calc(100vh - 223px);
-
-        border-radius: 4px;
-        padding-top: 8px;
-        margin-right: 16px;
-        border: 1px solid #DAE2F2;
-
-      }
-
-      .right {
-        width: calc(100% - 236px);
-
-        .toolBar {
-          display: flex;
-          flex-direction: row;
-          justify-content: space-between;
-          align-items: center;
-          margin-bottom: 12px;
-
-          .filterItem {
-            display: flex;
-            flex-direction: row;
-            justify-content: center;
-            align-items: center;
-          }
-
-          .btnGroup {
-            &>span {
-              cursor: pointer;
-              display: inline-block;
-              color: #17181A;
-              line-height: 24px;
-              padding: 0 14px;
-              border-radius: 4px;
-              border: 1px solid #DAE2F2;
-              background: #FAFCFF;
-              margin-right: 8px;
-              font-weight: 400;
-              font-size: 14px;
-              color: #17181A;
-
-              &.calc {
-                color: #fff;
-                background: #3377FF;
-              }
-            }
-          }
-        }
-        .KCIMTable {
-          .hover-row {
-            .hover-icon {
-              visibility: hidden;
-            }
-               &:hover {
-                .hover-icon {
-                  visibility: visible;
-                }
-               }
-          }
-          .cost-ant-table-header {
-                .cost-ant-table-thead {
-                    .cost-ant-table-cell {
-                        
-                    }
-                }
-          }
-          .cost-ant-table-body {
-            .cost-ant-table-row {
-                &.has-children {
-                     .cost-ant-table-cell-with-append {
-                         font-weight: bold;
-                     }
-                }
-            }
-          }
-        }
-      }
-    }
-  }
-
-}

+ 0 - 301
src/pages/baseSetting/otherItemSet/departmentCostCalc/transform.tsx

@@ -1,301 +0,0 @@
-import React, { Key, useEffect, useImperativeHandle, useState } from "react";
-import { Transfer } from 'antd'
-import { TransferItem, TransferProps } from 'antd/es/transfer';
-import { ColumnsType } from 'antd/es/table';
-import { difference } from "lodash";
-import { TableRowSelection } from 'antd/es/table/interface';
-import { KCIMTable } from "@/components/KCIMTable";
-import { ProColumns } from "@ant-design/pro-components";
-import { Tabs,Tree } from 'antd';
-
-import { log } from "mathjs";
-import { getAccountingSubjectList } from "../../accountingAccountSet/accountingSubMana/service";
-import { getApportionmentLevelList } from "../../costAllocationSet/allocationLevelSet/service";
-import { getResponsibilityCenterList } from "../../responsibilityCenterSet/responsibilityCenter/service";
-import { findAllParents, renameChildListToChildren, searchLeaves } from "@/utils/tooljs";
-import { getHasSetReportRelation } from "./service";
-
-
-
-interface TableTransferProps extends TransferProps<TransferItem> {
-    leftColumns: ProColumns[];
-    rightColumns: ProColumns[];
-    record: any,
-    settingType: number,
-    keyName: string,
-    onSave: (selectedKeys: Key[], selectedRowKeys: any[], settingType: number) => void;
-}
-
-const flattenTreeData = (treeData:any[], childKey = 'children', parentKey = 'parentId') => {
-    let result:any[] = [];
-
-    function flatten(node:any, parentId = null) {
-        // 创建一个新对象,包含原始节点的所有属性,除了 children,并添加 parentId
-        const { [childKey]: _, ...flatNode } = node;
-        result.push({ ...flatNode, [parentKey]: parentId });
-
-        // 如果节点有子节点,递归扁平化这些子节点
-        if (node[childKey] && node[childKey].length > 0) {
-            node[childKey].forEach((childNode:any) => flatten(childNode, node.id));
-        }
-    }
-
-    // 遍历每个根级节点
-    treeData.forEach(node => flatten(node));
-
-    return result;
-}
-
-
-function buildTree(flatData:any[], rootParentId = null, idKey = 'id', parentKey = 'parentId', childrenKey = 'children') {
-    const nodeMap = new Map();
-
-    // 首先,将所有节点存储到一个 Map 中,以便快速访问
-    flatData.forEach(node => nodeMap.set(node[idKey], { ...node }));
-
-    const tree:any[] = [];
-
-    flatData.forEach(node => {
-        const parentNode = nodeMap.get(node[parentKey]);
-
-        if (parentNode) {
-            // 检查父节点是否已经有了 children 属性
-            if (!parentNode[childrenKey]) {
-                parentNode[childrenKey] = [];
-            }
-            // 将当前节点添加到父节点的 children 数组中
-            parentNode[childrenKey].push(nodeMap.get(node[idKey]));
-        } else if (node[parentKey] === rootParentId) {
-            // 如果没有父节点且 parentId 与根 parentId 匹配,则为根节点
-            tree.push(nodeMap.get(node[idKey]));
-        }else{
-            tree.push(nodeMap.get(node[idKey]));
-        }
-    });
-
-    // 清除那些 children 长度为 0 的节点的 children 属性
-    function clearEmptyChildren(node:any) {
-        if (node[childrenKey] && node[childrenKey].length === 0) {
-            delete node[childrenKey];
-        } else if (node[childrenKey]) {
-            node[childrenKey].forEach(clearEmptyChildren);
-        }
-    }
-
-    tree.forEach(clearEmptyChildren);
-
-    return tree;
-}
-
-
-const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, keyName, record, settingType, onSave, ...restProps }: TableTransferProps, ref) => {
-
-    const [_data, _set_data] = useState<any>();
-    const [targetKeys, setTargetKeys] = useState<string[]>(record.accountingIds ? [...((record.accountingIds).map((a: string) => Number(a)))] : []);
-    const [datasource, set_datasource] = useState<any[]>([]);
-    const [selectedKeys, setSelectedKeys] = useState<string[]>(record.accountingIds ? [...((record.accountingIds).map((a: string) => Number(a)))] : []);
-    const [accountType, set_accountType] = useState(1);
-    const [tabs, set_tabs] = useState<any[]>([]);
-
-
-    //获取列表
-    const getFuncList = async () => {
-
-        if (settingType == 1) {
-            const resp = await getAccountingSubjectList({ pageSize: 500, current: 1, accountType });
-            if (resp) {
-                const initData = await getHasSetReportRelation({ reportId: record.id, relation: settingType });
-                if (initData) {
-                    const hasSelectedKeys = initData.map((a: any) => a.code);
-                   
-                    const hasSelectedRows = flattenTreeData(resp.list).filter((a: any) => hasSelectedKeys.includes(a.accountingCode));
-                    const selectedKeys = hasSelectedRows.map((a: any) => a.id)
-                    // setSelectedKeys(selectedKeys);
-                    setTargetKeys(selectedKeys);
-                }
-                set_datasource(resp.list);
-                _set_data(resp.list);
-            }
-
-        }
-        if (settingType == 2) {
-            const resp = await getApportionmentLevelList({ pageSize: 500, current: 1 });
-            if (resp) {
-                const initData = await getHasSetReportRelation({ reportId: record.id, relation: settingType });
-                if (initData) {
-                    const hasSelectedKeys = initData.map((a: any) => Number(a.id));
-                    const hasSelectedRows = resp.list.filter((a: any) => hasSelectedKeys.includes(a.id));
-                    const selectedKeys = hasSelectedRows.map((a: any) => a.id)
-                    // setSelectedKeys(selectedKeys);
-                    setTargetKeys(selectedKeys);
-                }
-                set_datasource(resp.list);
-                _set_data(resp.list);
-            }
-
-
-        }
-        if (settingType == 3) {
-            const resp = await getResponsibilityCenterList({ pageSize: 500, current: 1 });
-            //const opendedArr = renameChildListToChildren(resp.list, 'child');
-            if (resp) {
-                const initData = await getHasSetReportRelation({ reportId: record.id, relation: settingType });
-                if (initData) {
-                    const hasSelectedKeys = initData.map((a: any) => a.code);
-                    const hasSelectedRows = resp.list.filter((a: any) => hasSelectedKeys.includes(a.responsibilityCode));
-                    const selectedKeys = hasSelectedRows.map((a: any) => a.id)
-                    // setSelectedKeys(selectedKeys);
-                    setTargetKeys(selectedKeys);
-                }
-                set_datasource(renameChildListToChildren(resp.list, 'child'));
-                _set_data(renameChildListToChildren(resp.list, 'child'));
-            }
-
-        }
-
-    }
-
-    const onChange = (nextTargetKeys: string[]) => {
-        // console.log({ nextTargetKeys });
-        setTargetKeys(nextTargetKeys);
-    };
-
-    const onSelectChange = (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => {
-        // console.log('sourceSelectedKeys:', sourceSelectedKeys, 'targetSelectedKeys:', targetSelectedKeys);
-        setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]);
-    };
-
-    useImperativeHandle(ref, () => ({
-        save: async () => {
-            if(settingType == 1||settingType == 3){
-                const items = flattenTreeData(datasource).filter(a => targetKeys.includes(a[`${keyName}`]));
-                onSave(targetKeys, items, settingType);
-            }else{
-                const items = datasource.filter(a => targetKeys.includes(a[`${keyName}`]));
-                onSave(targetKeys, items, settingType);
-            }
-            
-        }
-    }));
-
-
-    const onTabChanged = (key: string) => {
-        set_accountType(Number(key));
-    }
-
-    useEffect(() => {
-        getFuncList();
-    }, [accountType]);
-
-
-
-    useEffect(() => {
-        set_tabs([
-            {
-                label: '收入',
-                key: 1,
-            },
-            {
-                label: '支出',
-                key: 2,
-            },
-        ])
-    }, []);
-
-
-    return (
-        <div>
-            {settingType == 1 && (
-                <Tabs
-                    defaultActiveKey={tabs.length > 0 ? tabs[0].key : undefined}
-                    items={tabs}
-                    key={'key'}
-                    onChange={(key) => onTabChanged(key)}
-                />
-            )}
-            <Transfer className='TableTransfer' showSearch
-                titles={['待选项', '已选项']}
-                locale={{
-                    itemUnit: '项',
-                    itemsUnit: '项',
-                    searchPlaceholder: '请输入',
-                }}
-                oneWay={false}
-                onChange={onChange}
-                onSelectChange={onSelectChange}
-                dataSource={settingType == 2?datasource:flattenTreeData(datasource)}
-                rowKey={record => record[`${keyName}`]}
-                targetKeys={targetKeys}
-                selectedKeys={selectedKeys}
-                filterOption={(inputValue, item) => {
-
-                    if(settingType == 1){
-                        return item['accountingName']!.indexOf(inputValue) !== -1
-                    }
-                    if(settingType == 2){
-                        return item['shareName']!.indexOf(inputValue) !== -1
-                    }
-                    if(settingType == 3){
-                        return item['responsibilityName']!.indexOf(inputValue) !== -1
-                    }
-                    return false
-
-                }}
-            
-            >
-                {({
-                    direction,
-                    filteredItems,
-                    onItemSelectAll,
-                    onItemSelect,
-                    selectedKeys: listSelectedKeys,
-                    disabled: listDisabled,
-                }) => {
-
-                    const columns = direction === 'left' ? leftColumns : rightColumns;
-
-                    const rowSelection: TableRowSelection<TransferItem> = {
-                        getCheckboxProps: (item) => ({ disabled: listDisabled || item.disabled }),
-                        onSelectAll(selected, selectedRows) {
-                            const treeSelectedKeys = selectedRows.map((a) => a[`${keyName}`]);
-                            const diffKeys = selected
-                                ? difference(treeSelectedKeys, listSelectedKeys)
-                                : difference(listSelectedKeys, treeSelectedKeys);
-                            onItemSelectAll(diffKeys as string[], selected);
-                        },
-                        onSelect(item, selected) {
-                            onItemSelect(item[`${keyName}`], selected);
-                        },
-                        selectedRowKeys: listSelectedKeys,
-                    };
-
-                    return  (
-                        <KCIMTable
-                            rowSelection={rowSelection}
-                            columns={columns as TransferItem[]}
-                            dataSource={settingType == 2?filteredItems:direction == 'left'?buildTree(filteredItems):filteredItems}
-                            size="small"
-                            bordered={false}
-                            rowKey={keyName}
-                            scroll={{ y:`calc(100vh - )` }}
-                            pagination={{ showTitle: false, pageSize: 9, showLessItems: false, simple: true, showTotal: () => false }}
-                            tableAlertRender={false}
-                            style={{ pointerEvents: listDisabled ? 'none' : undefined }}
-                            onRow={(row) => ({
-                                onClick: () => {
-                                    if (row.itemDisabled || listDisabled) return;
-                                    onItemSelect(row[`${keyName}`], !listSelectedKeys.includes(row[`${keyName}`]));
-                                },
-                            })}
-                        />
-                    )
-                }}
-            </Transfer>
-        </div>
-
-    )
-});
-
-export default TableTransfer
-
-

+ 0 - 430
src/pages/baseSetting/otherItemSet/diySqlMana/index.tsx

@@ -1,430 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-09 10:53:22
- * @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
- */
-
-
-
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-import SQLEditor from '@/components/SQLEditor';
-import { createFromIconfontCN } from '@ant-design/icons';
-
-import { ActionType, arrayMoveImmutable, ProFormText, ProFormTextArea, useRefFunction } from '@ant-design/pro-components';
-import { ModalForm, ProFormDependency, ProFormDigit, ProFormSelect } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Switch } from 'antd';
-import { useEffect, useRef, useState } from 'react';
-import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';
-
-
-import { addData, delData, editData, getSqlListTableData, getSqlTypeList, updateTableSort } from './service';
-
-import './style.less';
-
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-export default function DiySqlMana() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const [dataSource, set_dataSource] = useState<any[]>([]);
-    const [showList, set_showList] = useState<any[]>([]);
-
-    const SortableItem = SortableElement((props: any) => <tr {...props} />);
-    const SortContainer = SortableContainer((props: any) => <tbody {...props} />);
-
-    const [typeList, set_typeList] = useState<any[]>([]);
-    const [showTypeListArr, set_showTypeListArr] = useState<any[]>([]);
-    const [currentSelectedType, set_currentSelectedType] = useState<any | undefined>(undefined);
-
-    const DragHandle = SortableHandle(() => <img width={16} style={{ cursor: 'pointer' }} src={require('../../../../../static/tuozhuai_icon.png')} alt="" />);
-
-    const tableRef = useRef<ActionType>();
-
-    const columns: ProColumns[] = [
-        {
-            dataIndex: 'sort',
-            width: 50,
-            className: 'drag-visible',
-            render: () => <DragHandle />
-        },
-        {
-            title: 'SQL代码',
-            width: 150,
-            ellipsis: true,
-            dataIndex: 'sqlCode',
-        },
-        {
-            title: 'SQL语句',
-            ellipsis: true,
-            dataIndex: 'sql',
-        },
-        {
-            title: 'SQL说明',
-            ellipsis: true,
-            dataIndex: 'sqlDefinition',
-            // render:(_:any)=>_ == 1?'指标':'自定义SQL'
-        },
-        {
-            title: '启用',
-            width: 80,
-            dataIndex: 'status',
-            renderText: (_: any, record: any) => {
-
-                return <Switch size='small' checked={_ ? true : false} onChange={(bool) => switchChangeHandle(bool, record, 'status')} />
-            }
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 120,
-            fixed: 'right',
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='ADD_NEXT' />,
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getSqlListTableData(params);
-        if (resp) {
-            set_dataSource(resp);
-            set_showList(resp);
-        }
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData(record.id);
-        if (resp) {
-            message.success('操作成功!');
-            getTableData({ sqlType: currentSelectedType.code });
-            // message.success('操作成功!');
-        }
-    }
-
-    const switchChangeHandle = (checked: boolean, record: any, key: string) => {
-
-        const newData = dataSource.map((a: any) => {
-            if (a.id == record.id) {
-                return { ...a, [`${key}`]: checked ? 1 : 0 }
-            }
-            return a
-        });
-
-        set_dataSource([...newData]);
-        updateTable({ ...record, [`${key}`]: checked ? 1 : 0 }, 'EDIT')
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | 'ADD' | 'ADD_NEXT') => {
-
-        if (type == 'ADD') {
-            const resp = await addData({
-                sqlCode: formVal.sqlCode,
-                sql: formVal.sql,
-                sqlDefinition: formVal.sqlDefinition,
-                sqlType: currentSelectedType.code,
-                sort: dataSource.length + 1,
-                status: 1
-            });
-            if (resp) {
-
-                getTableData({ sqlType: currentSelectedType.code });
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'ADD_NEXT') {
-            const { sort } = formVal;
-
-            const temp = [...dataSource];
-
-            const index = temp.findIndex(a => a.sort == sort);
-
-            const objectToInsert = {
-                sqlCode: formVal.sqlCode,
-                sql: formVal.sql,
-                sqlDefinition: formVal.sqlDefinition,
-                sqlType: currentSelectedType.code,
-                status: 1
-            }
-
-            temp.splice(index + 1, 0, objectToInsert);
-            const arr = temp.map((a, index) => ({ ...a, sort: index + 1 }));
-
-            updateTableSortHandle(arr);
-
-
-        }
-        if (type == 'EDIT') {
-
-            const resp = await editData({
-                id: formVal.id,
-                sql: formVal.sql,
-                sqlDefinition: formVal.sqlDefinition,
-                sqlType: formVal.sqlType,
-                sort: formVal.sort,
-                status: formVal.status
-            });
-            if (resp) {
-                getTableData({ sqlType: currentSelectedType.code });
-                message.success('操作成功!');
-            }
-        }
-        return true;
-
-    }
-
-    const formRef = useRef();
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADD_NEXT' }) => {
-
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : type == 'ADD_NEXT' ? '插入' : '新增'}自定义SQL`}
-                width={1200}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? { ...record } : {}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : type == 'ADD_NEXT' ? <a>插入</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : type == 'ADD_NEXT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <div className='formContent' style={{ display: 'flex', width: '100%', flexDirection: 'row', alignContent: 'flex-start', overflow: 'hidden' }}>
-                    <div className='left' style={{ width: 240, minWidth: 240, marginRight: 16 ,marginBottom:'-15px'}}>
-                        <ProFormText
-                            name="sqlCode"
-                            label="SQL代码:"
-                            placeholder="请输入"
-                            disabled={type == 'EDIT'}
-                            rules={[{ required: true, message: 'SQL代码不能为空!' }]}
-                        />
-                        <ProFormTextArea  fieldProps={{rows:18}} placeholder="请输入" name={'sqlDefinition'} label='SQL说明:' rules={[{ required: true, message: '说明不能为空!' }]} />
-                    </div>
-                    <div className='right' style={{ width: 'calc(1200px - 288px)', marginBottom: '-15px' }}>
-                        {/* <ProFormTextArea placeholder="请输入" name={'sql'} label='SQL语句:' rules={[{ required: true, message: 'SQL不能为空!' }]} /> */}
-                        <SQLEditor
-                            name="sql"
-                            label="SQL语句:"
-                            rules={[{ required: true, message: 'SQL不能为空!' }]}
-                            form={formRef}
-                            height={'435px'}
-                        />
-                    </div>
-                </div>
-            </ModalForm>
-        )
-    }
-
-    const tableDataSearchHandle = (key: string) => {
-        const result = dataSource.filter((a) => a.sqlDefinition.indexOf(tableDataSearchKeywords) != -1);
-        set_showList(result);
-    }
-
-    const getSqlTypeRequest = async () => {
-        const resp = await getSqlTypeList();
-        if (resp) {
-            set_typeList(resp);
-            set_showTypeListArr(resp);
-        }
-    }
-
-    const updateTableSortHandle = async (data: any[]) => {
-        const resp = await updateTableSort(data);
-        if (resp) {
-            getTableData({ sqlType: currentSelectedType.code });
-        }
-    }
-
-    const onSortEnd = useRefFunction(
-        ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {
-            if (oldIndex !== newIndex) {
-                const newData = arrayMoveImmutable({
-                    array: [...dataSource],
-                    fromIndex: oldIndex,
-                    toIndex: newIndex,
-                }).filter((el) => !!el);
-
-                const updatedSortArr = newData.map((item: any, index: number) => ({ ...item, sort: index + 1 }))
-                set_dataSource([...updatedSortArr]);
-                updateTableSortHandle(updatedSortArr);
-            }
-        },
-    );
-
-    const DraggableContainer = (props: any) => (
-        <SortContainer
-            useDragHandle
-            disableAutoscroll
-            helperClass="row-dragging"
-            onSortEnd={onSortEnd}
-            {...props}
-        />
-    );
-
-    const DraggableBodyRow = (props: any) => {
-        const { className, style, ...restProps } = props;
-
-        // function findIndex base on Table rowKey props and should always be a right array index
-        const index = dataSource.findIndex((x) => x.id === restProps['data-row-key']);
-
-        return <SortableItem index={index} {...restProps} />;
-    };
-
-
-    useEffect(() => {
-        if (showTypeListArr.length > 0) {
-            set_currentSelectedType(showTypeListArr[0]);
-        }
-    }, [showTypeListArr]);
-
-    useEffect(() => {
-        if (currentSelectedType) {
-            getTableData({ sqlType: currentSelectedType.code });
-        }
-    }, [currentSelectedType]);
-
-
-    useEffect(() => {
-        getSqlTypeRequest();
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='DiySqlMana' title={false}>
-            {/* <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label'>检索:</span>
-                        <ProFormSelect
-                            noStyle
-                            allowClear
-                            placeholder="请选择类型"
-                            style={{ width: 160, marginRight: 16 }}
-                            request={async () => {
-                                const resp = await getSqlTypeList();
-
-                                if (resp) {
-                                    return resp.list.map((a: any) => ({ label: a.name, value: a.code }))
-                                }
-
-                            }}
-                            fieldProps={{
-                                onChange(value, option) {
-                                    set_tableDataFilterParams({ ...tableDataFilterParams, sqlType: value })
-                                },
-                            }}
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div style={{ marginTop: 16 }}>
-                <BMSTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div> */}
-
-            <div className='left'>
-                <Input placeholder={'请输入类目名称'} allowClear autoComplete='off'
-                    suffix={
-                        <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />
-                    }
-                    onChange={(e) => {
-                        const result = typeList.filter(item => item.name.indexOf(e.target.value) != -1);
-                        set_showTypeListArr(result);
-                    }}
-
-                />
-                <div className='wrap'>
-                    {
-                        showTypeListArr.map((item, index) => {
-                            return (
-                                <div className={currentSelectedType ? currentSelectedType.code == item.code ? 'type on' : 'type' : 'type'}
-                                    key={index}
-                                    onClick={() => set_currentSelectedType(item)}
-                                >{item.name}</div>
-                            )
-                        })
-                    }
-                </div>
-            </div>
-            <div className='right'>
-                <div className='toolBar'>
-                    <div className='filter'>
-                        <div className='filterItem'>
-                            <span className='label'>检索:</span>
-                            <Input placeholder={'sql说明'} style={{ width: 160 }} allowClear autoComplete='off'
-
-                                suffix={
-                                    <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" onClick={() => tableDataSearchHandle('sqlDefinition')} />
-                                }
-                                onChange={(e) => {
-                                    set_tableDataSearchKeywords(e.target.value);
-                                    if (e.target.value.length == 0) {
-                                        set_tableDataSearchKeywords('');
-                                        getTableData({ sqlType: currentSelectedType.code });
-                                    }
-                                }}
-
-                                onPressEnter={(e) => {
-                                    tableDataSearchHandle('sqlDefinition')
-                                }}
-
-                            />
-                        </div>
-                    </div>
-                    <div className='btnGroup'>
-                        <UpDataActBtn record type='ADD' />
-                    </div>
-                </div>
-                <div style={{ marginTop: 16 }}>
-                    {currentSelectedType && <KCIMTable scroll={{ y: `calc(100vh - 230px)` }}
-                        actionRef={tableRef} columns={columns as ProColumns[]} rowKey='id'
-                        // params={tableDataFilterParams} 
-                        // request={(params) => getTableData(params)} 
-                        dataSource={showList}
-                        tableAlertRender={false}
-
-                        components={{
-                            body: {
-                                wrapper: DraggableContainer,
-                                row: DraggableBodyRow,
-                            },
-                        }}
-                    />}
-                </div>
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 109
src/pages/baseSetting/otherItemSet/diySqlMana/service.ts

@@ -1,109 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-03-21 10:23:18
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-
-export type SQLTableDataType = {
-  id:number,
-  hospId:number,
-  code:number,
-  sqlCode:string,
-  sql:string,
-  sqlDefinition:string,
-  sqlType:string,
-  sqlTypeName:string,
-  sort:number
-}
-
-
-export const getSqlListTableData = (params?:any) => {
-  return request<any[]>('/costAccount/report/getSql', {
-    method: 'GET',
-    params:{...params}
-  });
-};
-
-
-//新增报表
-export type AddSqlTableDataType = {
-  sqlCode:string,
-  sql:string,
-  sqlDefinition:string,
-  sqlType:string,
-  sort:number,
-  status:number
-}
-
-export const addData = (data:AddSqlTableDataType) => {
-  return request('/costAccount/report/addSql', {
-    method: 'POST',
-    data
-  });
-};
-
-
-
-
-
-
-//编辑表格数据
-
-export type EditSqlTableDataType = {
-  id:number,
-  sql:string,
-  sqlDefinition:string,
-  sqlType:string,
-  sort:number,
-  status:number,
-  [key:string]:any
-}
-
-export const editData = (data:EditSqlTableDataType) => {
-  return request('/costAccount/report/editSql', {
-    method: 'POST',
-    data
-  });
-};
-
-export const updateTableSort = (data:EditSqlTableDataType[]) => {
-  return request('/costAccount/report/sortSql', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (id:string) => {
-  return request('/costAccount/report/deleteSql', {
-    method: 'POST',
-    params:{id}
-  });
-};
-
-//获取sql类型
-export const getSqlTypeList = (params?:any) => {
-  return request('/costAccount/report/getSqlType?current=1&pageSize=1000&typeCode=10', {
-    method: 'GET',
-  });
-};
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 95
src/pages/baseSetting/otherItemSet/diySqlMana/style.less

@@ -1,95 +0,0 @@
-.row-dragging {
-
-  .cost-ant-table-cell {
-    width: 130px;
-  }
-}
-
-.DiySqlMana {
-  // padding: 16px;
-  border-radius: 4px;
-
-  .left {
-    float: left;
-    border-radius: 4px;
-    width: 220px;
-    height:calc(100vh - 80px);
-    overflow: scroll;
-    margin-right: 16px;
-    padding: 16px;
-    background: #FFFFFF;
-    
-    .wrap {
-      margin-top: 16px;
-
-      .type {
-        cursor: pointer;
-        height: 32px;
-        line-height: 32px;
-        padding-left: 8px;
-        background: #FFFFFF;
-        border-radius: 4px;
-        font-size: 14px;
-        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-        font-weight: 400;
-        color: #17181A;
-        margin-bottom: 4px;
-
-        &.on {
-          font-weight: 500;
-          color: #17181A;
-          background: #F0F2F5;
-        }
-
-        &:last-child {
-            margin-bottom: 0;
-        }
-      }
-    }
-  }
-
-  .right {
-    float: left;
-    width: calc(100% - 236px);
-    padding: 16px;
-    border-radius: 4px;
-    background: #FFFFFF;
-
-    .toolBar {
-      display: flex;
-      flex-direction: row;
-      justify-content: space-between;
-      align-items: center;
-
-      .filter {
-        display: flex;
-        flex-direction: row;
-        justify-content: flex-start;
-        align-items: center;
-
-        .filterItem {
-          display: flex;
-          flex-direction: row;
-          justify-content: center;
-          align-items: center;
-        }
-      }
-
-      .btnGroup {
-        .add {
-          cursor: pointer;
-          display: inline-block;
-          font-size: 14px;
-          font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-          font-weight: 400;
-          color: #FFFFFF;
-          line-height: 24px;
-          padding: 0 14px;
-          background: #3377FF;
-          border-radius: 4px;
-        }
-      }
-
-    }
-  }
-}

+ 0 - 619
src/pages/baseSetting/otherItemSet/reportItemSet/index.tsx

@@ -1,619 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-11-08 11:54:36
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-
-import { ActionType, ProFormDependency, ProFormInstance, ProFormText, ProFormSelect, ProFormDigit } from '@ant-design/pro-components';
-import { ModalForm, ProFormTextArea } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Modal, message, Popconfirm, Form, Tabs, Switch } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, copyDataToSelectedType, delData, editData, getReportProjectSettingList, saveReportRelation } from './service';
-
-import './style.less';
-import TableTransfer from './transform';
-import React from 'react';
-import { cleanTree } from '@/utils/tooljs';
-import { getDicDataBySysId } from '@/services/getDic';
-
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-let currentRow: any = undefined;
-
-const accountingSubjectColumn = [
-    {
-        title: '会计科目编码',
-        dataIndex: 'accountingCode',
-        ellipsis: true,
-    },
-    {
-        title: '会计科目名',
-        dataIndex: 'accountingName',
-        ellipsis: true,
-    },
-];
-
-const shareParamsColumn = [
-    {
-        title: '分摊层级Id',
-        dataIndex: 'id',
-        ellipsis: true,
-    },
-    {
-        title: '分摊层级名',
-        dataIndex: 'shareName',
-        ellipsis: true,
-    },
-];
-
-const responsibilityColumn = [
-    {
-        title: '责任中心编码',
-        dataIndex: 'responsibilityCode',
-        ellipsis: true,
-    },
-    {
-        title: '责任中心名',
-        dataIndex: 'responsibilityName',
-        ellipsis: true,
-    },
-];
-
-const openRule = () => {
-    Modal.info({
-        title: '报表项目填写注意事项!',
-        width: 800,
-        content: (
-            <div>
-                <h4>计算类型说明 </h4>
-                <span>不设置:</span>
-                一般用于第一层。 对应成本科目:对应的是成本科目,如工资,收入类等
-                <div></div>
-                <span>对应责任中心:</span>
-                对应的是分摊的责任中心,放射科,功能科等
-                <div></div>
-                <span>对应分摊层级:</span>
-                对应的是分摊的层级,如“护理”分摊层级,“医技”分摊层级。
-                <div></div>
-                <span>小计:</span>
-                是对第一层下的所有项目的合计计算。
-                <div></div>
-                <span>计算公式:</span>
-                是按编号对报表项目的项目进行计算结果,支持加/减法。
-                <div style={{ marginBottom: 20 }}></div>
-                <h4>报表项目顺序注意事项</h4>
-                计算类型是小计报表项目需要维护在对应层级的其他项目之后
-                <div></div>
-                计算类型是计算公式的报表项目需要维护在公式里包含的其他项目之后
-            </div>
-        ),
-    });
-};
-
-export default function ReportItemSet() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ reportType: 0 });
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [tabs, set_tabs] = useState<any[]>([]);
-    const [reportType, set_reportType] = useState<Key | undefined>(undefined);
-    const [calcTypes, setCalcTypes] = useState<any[]>([]);
-    const columns: ProColumns[] = [
-        {
-            title: '报表项目名',
-            dataIndex: 'reportName',
-            width: 200
-        },
-        {
-            title: 'Id',
-            dataIndex: 'id',
-            width: 80
-        },
-        {
-            title: '编号',
-            dataIndex: 'num',
-            width: 80
-        },
-        {
-            title: '计算方式',
-            dataIndex: 'calcType',
-            renderText:(num, record) => {
-                const temp = calcTypes.filter((a)=>a.code == num);
-                return temp.length>0?temp[0].name:''
-            },
-
-        },
-        // {
-        //     title: '报表类型',
-        //     dataIndex: 'reportType',
-        //     renderText(num) {
-        //         switch (num) {
-        //             case 0:
-        //                 return <>损益表</>;
-        //             case 1:
-        //                 return <>完全成本法表</>;
-        //             case 2:
-        //                 return <>变动成本表</>;
-        //             case 3:
-        //                 return <>全院损益表</>;
-        //             case 4:
-        //                 return <>全成本报表</>;
-        //         }
-        //     },
-        // },
-        {
-            title: '计算公式',
-            width: 300,
-            dataIndex: 'calcFormula',
-        },
-        {
-            title: '项目类型',
-            dataIndex: 'costType',
-            renderText(num) {
-                switch (num) {
-                    case 1:
-                        return <>收入</>;
-                    case 2:
-                        return <>成本</>;
-                }
-            },
-
-        },
-        {
-            title: '占比计算类型',
-            dataIndex: 'fraction',
-            renderText(num) {
-                switch (num) {
-                    case 1:
-                        return <>分子</>;
-                    case 2:
-                        return <>分母</>;
-                    case 3:
-                        return <>不计算</>;
-                }
-            },
-
-        },
-        {
-            title: '排序',
-            dataIndex: 'sort',
-            width: 80
-        },
-        {
-            title: '说明',
-            dataIndex: 'description',
-            ellipsis: true
-        },
-        {
-            title: '显示',
-            fixed: 'right',
-            width: 60,
-            dataIndex: 'hide',
-            renderText: (_: any, record: any) => {
-                return <Switch  size='small' checked={_ == 1} onChange={(bool) => updateTable({...record,hide:bool?1:0},'EDIT')} />
-            }
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 200,
-            fixed: 'right',
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                const { showAddRelation, parentId, calcType } = record;
-
-                const btnGroup = true ? [
-                    <UpDataActBtn key={'addChild'} record={record} type='ADDCHILD' />,
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                ] : [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                ]
-
-                return showAddRelation ? [
-                    ...btnGroup,
-                    <a key="config3" onClick={() => {
-                        currentRow = record;
-                        if (showAddRelation == 1) oprnTableTransform(record, accountingSubjectColumn, 1);
-                        if (showAddRelation == 2) oprnTableTransform(record, shareParamsColumn, 2);
-                        if (showAddRelation == 3) oprnTableTransform(record, responsibilityColumn, 3);
-
-                    }}>
-                        {showAddRelation == 1
-                            ? '会计科目'
-                            : showAddRelation == 2
-                                ? '分摊层级'
-                                : showAddRelation == 3 && '责任中心'}
-                    </a>
-                ] : btnGroup
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const { reportType } = params;
-        if (reportType == undefined) return []
-        const resp = await getReportProjectSettingList({ ...params });
-        if (resp) {
-            return {
-                data: cleanTree(resp.list),
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData([record.id]);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const onSaveHandle = async (keys: Key[], rows: any[], record: any, settingType: number) => {
-
-        let selectedRowKeysToStr: string[] = [];
-        if (settingType == 2) {
-            keys
-                ? keys.map((item: any) => selectedRowKeysToStr.push(`${item}`))
-                : [];
-        }
-
-        let selectedRowKeys: Key[] = [];
-        if (settingType == 1) {
-            selectedRowKeys = rows.map((a: any) => a.accountingCode)
-        }
-        if (settingType == 2) {
-            selectedRowKeys = keys.map((a: any) => `${a}`)
-        }
-        if (settingType == 3) {
-            selectedRowKeys = rows.map((a: any) => a.responsibilityCode)
-        }
-        const { id: reportId } = record;
-        const resp = await saveReportRelation({
-            reportId,
-            reportType,
-            relation: settingType,
-            relationCodes: selectedRowKeys,
-        });
-        if (resp) {
-            message.success('对照成功!');
-            tableRef.current?.reload();
-        }
-    }
-
-    const oprnTableTransform = (record: any, transferTableColumn: ProColumns[], settingType: number) => {
-
-        const ref = React.createRef<{ save: any; }>();
-
-        Modal.confirm({
-            title: settingType == 1 ? `选择会计科目` : settingType == 2 ? '选择分摊层级' : '选择责任中心',
-            icon: <></>,
-            width: 1000,
-            centered: true,
-            okText: '确定',
-            cancelText: '取消',
-            content: <TableTransfer
-                ref={ref}
-                keyName={settingType == 1 ? `accountingCode` : settingType == 2 ? 'id' : 'responsibilityCode'}
-                record={record}
-                settingType={settingType}
-                onSave={(keys, rows, settingType) => onSaveHandle(keys, rows, record, settingType)}
-                leftColumns={transferTableColumn}
-                rightColumns={transferTableColumn}
-            ></TableTransfer>,
-            onOk: () => {
-                return ref.current && ref.current.save();
-            }
-        })
-    }
-
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | "ADDCHILD" | 'COPY') => {
-
-        if (type == 'ADD' || type == 'ADDCHILD') {
-
-            let parentId = 0;
-            const { calcType = 0, calcFormula = '' } = formVal;
-
-            (type == 'ADDCHILD') && (parentId = formVal.id);
-
-            const result = {
-                ...formVal,
-                calcType,
-                calcFormula,
-                isLoss: formVal.isLoss ? 1 : 0,
-                reportType: Number(reportType),
-                parentId
-            }
-
-            const resp = await addData(result);
-            if (resp) {
-                currentRow = undefined;
-                tableRef.current?.reload();
-                message.success('操作成功!');
-
-            }
-
-        }
-        if (type == 'EDIT') {
-            try {
-                const { reportName, sort, calcType = 0, calcFormula = '', isLoss, parentId, id, fraction, costType, description,hide } = formVal;
-                const result = {
-                    id,
-                    parentId,
-                    reportName,
-                    sort,
-                    reportType,
-                    calcType,
-                    calcFormula,
-                    fraction,
-                    costType,
-                    isLoss: isLoss ? 1 : 0,
-                    description,
-                    hide
-                };
-                const resp = await editData(result);
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-            } catch (error) {
-                console.log({ error });
-            }
-
-        }
-        if (type == 'COPY') {
-            //复制数据
-            const { toReportType } = formVal;
-            const resp = await copyDataToSelectedType({
-                fromReportType: Number(reportType),
-                toReportType,
-            });
-            if (resp) {
-                message.success('复制成功!');
-                tableRef.current?.reload();
-            }
-        }
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADDCHILD' | 'COPY' }) => {
-        const reportType = type == 'EDIT' || type == 'ADDCHILD' ? record.reportType : undefined
-        return (
-            <ModalForm
-                title={type == 'COPY' ? '复制' : `${type == 'EDIT' ? '编辑' : '新增'}报表`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record
-                } : {}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : type == 'ADDCHILD' ? <a className='add'>添加</a> : type == 'COPY' ? <span className='copy' style={{ marginRight: 8 }}>复制</span> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : type == 'ADDCHILD' ? { ...val, id: record.id } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                {
-                    type != 'COPY' && (
-                        <>
-                            <ProFormText
-                                label="报表名"
-                                rules={[
-                                    {
-                                        required: true,
-                                        message: '报表名是必填项!',
-                                    },
-                                ]}
-                                name="reportName"
-                            />
-                            <ProFormDigit
-                                label="排序"
-                                rules={[
-                                    {
-                                        required: true,
-                                        message: '排序必填项!',
-                                    },
-                                ]}
-                                name="sort"
-                            />
-                            {(
-                                //新增顶级不展示
-                                <>
-                                    <ProFormSelect
-                                        name="calcType"
-                                        label="计算类型"
-                                        options={[
-                                            ...(calcTypes.map((a)=>({label:a.name,value:Number(a.code)})))
-                                        ]}
-                                        placeholder="请选择状态"
-                                        rules={[{ required: true, message: '请选择计算类型!' }]}
-                                    />
-
-                                    <ProFormDependency name={['calcType']}>
-                                        {({ calcType }) => {
-                                            // const resp = await getResponsibilityCenterList({pageSize:100,current:1});
-                                            return calcType == 4 ? (
-                                                <ProFormText
-                                                    label="计算公式"
-                                                    rules={[
-                                                        {
-                                                            required: true,
-                                                            message: '计算公式是必填项!',
-                                                        },
-                                                    ]}
-                                                    placeholder="例如:[1] + [2]"
-                                                    name="calcFormula"
-                                                />
-                                            ) : (
-                                                <></>
-                                            );
-                                        }}
-                                    </ProFormDependency>
-                                    <ProFormDependency name={['calcType']}>
-                                        {({ calcType }) => {
-                                            // const resp = await getResponsibilityCenterList({pageSize:100,current:1});
-                                            return calcType == 4 && reportType == 3 ? (
-                                                <Form.Item
-                                                    name="isLoss"
-                                                    label="损益标志"
-                                                    valuePropName="checked"
-                                                >
-                                                    <Switch />
-                                                </Form.Item>
-                                            ) : (
-                                                <></>
-                                            );
-                                        }}
-                                    </ProFormDependency>
-                                </>
-                            )}
-                            <ProFormSelect
-                                name="costType"
-                                label="报表项目类型"
-                                options={[
-                                    { label: '收入', value: 1 },
-                                    { label: '成本', value: 2 },
-                                ]}
-                                placeholder="请选择"
-                                rules={[{ required: true, message: '请选择报表项目类型!' }]}
-                            />
-                            <ProFormSelect
-                                name="fraction"
-                                label="占比计算类型"
-                                options={[
-                                    { label: '分子', value: 1 },
-                                    { label: '分母', value: 2 },
-                                    { label: '不计算', value: 3 },
-                                ]}
-                                placeholder="请选择"
-                                rules={[{ required: true, message: '请选择占比计算类型!' }]}
-                            />
-                            <ProFormTextArea
-                                label="说明"
-                                placeholder='请输入'
-                                name="description"
-                            />
-                        </>
-                    )
-                }
-                {
-                    type == 'COPY' && (
-                        <ProFormSelect
-                            name="toReportType"
-                            label="复制到"
-                            width="sm"
-                            options={tabs.map((a) => ({ label: a.label, value: a.key }))}
-                            placeholder="请选择"
-                            rules={[{ required: true, message: '请选择复制到目标!' }]}
-                        />
-                    )
-                }
-            </ModalForm>
-        )
-    }
-
-    const onTabChanged = (key: Key) => {
-        set_reportType(key);
-        set_tableDataFilterParams({ ...tableDataFilterParams, reportType: key })
-    }
-
-    const getTabs = async () => {
-
-        const { systemId } = JSON.parse((localStorage.getItem('currentSelectedTab')) as string)
-        const resp = await getDicDataBySysId(systemId, 'PROFIT_REPORT_TYPE');
-        if (resp) {
-            const { dataVoList } = resp;
-            set_tabs(dataVoList.map((a: any) => ({ label: a.name, key: Number(a.code) })));
-            set_tableDataFilterParams({ ...tableDataFilterParams, reportType: dataVoList.length > 0 ? dataVoList[0].code : undefined });
-            set_reportType(dataVoList.length > 0 ? dataVoList[0].code : undefined);
-        }
-    }
-
-
-
-
-    useEffect(() => {
-        const fetchData = async () => {
-            const { systemId } = JSON.parse(localStorage.getItem('currentSelectedTab') as string);
-            const resp = await getDicDataBySysId(systemId, 'REPORT_ITEM_CALC_TYPE');
-            setCalcTypes(resp?.dataVoList??[]);  // 假设 resp 返回的是一个键值对
-        };
-        fetchData();
-        getTabs();
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='ReportItemSet' title={false}>
-            <div className='header'>
-                <div className='pageTitle'>报表项目设置</div>
-                <div className='btnGroup'>
-                    <span style={{ marginRight: 8, cursor: 'pointer' }} onClick={() => openRule()}><img style={{ width: 16, marginRight: 4, marginTop: -1 }} src={require('../../../../../static/tip.png')} />说明</span>
-                    <UpDataActBtn record={undefined} type='COPY' />
-                    <UpDataActBtn record={undefined} type='ADD' />
-                </div>
-            </div>
-
-            <div className='toolBar' style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
-                <Tabs
-                    defaultActiveKey={tabs.length > 0 ? tabs[0].key : undefined}
-                    items={tabs}
-                    key={'key'}
-                    onChange={(key) => onTabChanged(key)}
-                />
-            </div>
-
-            <div>
-                <KCIMTable pagination={false} scroll={{ x: 1700, y: `calc(100vh - 191px)` }} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 103
src/pages/baseSetting/otherItemSet/reportItemSet/service.ts

@@ -1,103 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-12-14 16:27:30
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { Key } from 'react';
-import { request } from 'umi';
-
-//获取table列表数据
-export const getReportProjectSettingList = (params:any) => {
-  return request('/costAccount/reportForm/list', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-
-
-//新增
-export type AddTableDataType = {
-  calcFormula?:string,
-  calcType?:number,
-  isLoss?:number,
-  parentId?:number,
-  reportName?:string,
-  reportType?:number,
-  sort?:number
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/reportForm/save', {
-    method: 'POST',
-    data:{...data}
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/reportForm/edit', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (ids:Key[]) => {
-  return request('/costAccount/reportForm/delete', {
-    method: 'POST',
-    data:ids
-  });
-};
-
-
-//根据关系类型,获取已绑定的关系数据
-export const getHasSetReportRelation = (params:any) => {
-  return request('/costAccount/reportForm/getRelationList', {
-    method: 'GET',
-    params: {...params},
-  });
-}
-
-//保存对应设置
-export const saveReportRelation = (body:any) => {
-  return request('/costAccount/reportForm/saveReportRelation', {
-    method: 'POST',
-    data: {...body},
-  });
-}
-
-//复制数据
-export const copyDataToSelectedType = (body:any) => {
-  return request('/costAccount/reportForm/copyReport', {
-    method: 'POST',
-    data: {...body},
-  });
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 68
src/pages/baseSetting/otherItemSet/reportItemSet/style.less

@@ -1,68 +0,0 @@
-.ReportItemSet {
-  padding: 16px;
-  padding-top: 0;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-  .header {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    padding-top: 16px;
-
-    .pageTitle {
-      height: 16px;
-      line-height: 16px;
-      font-weight: 500;
-      font-size: 16px;
-      color: #17181A;
-    }
-
-    .btnGroup {
-
-      .add,
-      .copy {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-
-      .copy {
-        color: #17181A;
-        background: #FAFCFF;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-      }
-    }
-
-  }
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-  }
-}

+ 0 - 302
src/pages/baseSetting/otherItemSet/reportItemSet/transform.tsx

@@ -1,302 +0,0 @@
-import React, { Key, useEffect, useImperativeHandle, useState } from "react";
-import { Transfer } from 'antd'
-import { TransferItem, TransferProps } from 'antd/es/transfer';
-import { ColumnsType } from 'antd/es/table';
-import { difference } from "lodash";
-import { TableRowSelection } from 'antd/es/table/interface';
-import { KCIMTable } from "@/components/KCIMTable";
-import { ProColumns } from "@ant-design/pro-components";
-import { Tabs,Tree } from 'antd';
-
-import { log } from "mathjs";
-import { getAccountingSubjectList } from "../../accountingAccountSet/accountingSubMana/service";
-import { getApportionmentLevelList } from "../../costAllocationSet/allocationLevelSet/service";
-import { getResponsibilityCenterList } from "../../responsibilityCenterSet/responsibilityCenter/service";
-import { findAllParents, renameChildListToChildren, searchLeaves } from "@/utils/tooljs";
-import { getHasSetReportRelation } from "./service";
-
-
-
-interface TableTransferProps extends TransferProps<TransferItem> {
-    leftColumns: ProColumns[];
-    rightColumns: ProColumns[];
-    record: any,
-    settingType: number,
-    keyName: string,
-    onSave: (selectedKeys: Key[], selectedRowKeys: any[], settingType: number) => void;
-}
-
-const flattenTreeData = (treeData:any[], childKey = 'children', parentKey = 'parentId') => {
-    let result:any[] = [];
-
-    function flatten(node:any, parentId = null) {
-        // 创建一个新对象,包含原始节点的所有属性,除了 children,并添加 parentId
-        const { [childKey]: _, ...flatNode } = node;
-        result.push({ ...flatNode, [parentKey]: parentId });
-
-        // 如果节点有子节点,递归扁平化这些子节点
-        if (node[childKey] && node[childKey].length > 0) {
-            node[childKey].forEach((childNode:any) => flatten(childNode, node.id));
-        }
-    }
-
-    // 遍历每个根级节点
-    treeData.forEach(node => flatten(node));
-
-    return result;
-}
-
-
-function buildTree(flatData:any[], rootParentId = null, idKey = 'id', parentKey = 'parentId', childrenKey = 'children') {
-    const nodeMap = new Map();
-
-    // 首先,将所有节点存储到一个 Map 中,以便快速访问
-    flatData.forEach(node => nodeMap.set(node[idKey], { ...node }));
-
-    const tree:any[] = [];
-
-    flatData.forEach(node => {
-        const parentNode = nodeMap.get(node[parentKey]);
-
-        if (parentNode) {
-            // 检查父节点是否已经有了 children 属性
-            if (!parentNode[childrenKey]) {
-                parentNode[childrenKey] = [];
-            }
-            // 将当前节点添加到父节点的 children 数组中
-            parentNode[childrenKey].push(nodeMap.get(node[idKey]));
-        } else if (node[parentKey] === rootParentId) {
-            // 如果没有父节点且 parentId 与根 parentId 匹配,则为根节点
-            tree.push(nodeMap.get(node[idKey]));
-        }else{
-            tree.push(nodeMap.get(node[idKey]));
-        }
-    });
-
-    // 清除那些 children 长度为 0 的节点的 children 属性
-    function clearEmptyChildren(node:any) {
-        if (node[childrenKey] && node[childrenKey].length === 0) {
-            delete node[childrenKey];
-        } else if (node[childrenKey]) {
-            node[childrenKey].forEach(clearEmptyChildren);
-        }
-    }
-
-    tree.forEach(clearEmptyChildren);
-
-    return tree;
-}
-
-
-const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, keyName, record, settingType, onSave, ...restProps }: TableTransferProps, ref) => {
-
-    const [_data, _set_data] = useState<any>();
-    const [targetKeys, setTargetKeys] = useState<string[]>(record.accountingIds ? [...((record.accountingIds).map((a: string) => Number(a)))] : []);
-    const [datasource, set_datasource] = useState<any[]>([]);
-    const [selectedKeys, setSelectedKeys] = useState<string[]>(record.accountingIds ? [...((record.accountingIds).map((a: string) => Number(a)))] : []);
-    const [accountType, set_accountType] = useState(1);
-    const [tabs, set_tabs] = useState<any[]>([]);
-
-
-    //获取列表
-    const getFuncList = async () => {
-
-        if (settingType == 1) {
-            const resp = await getAccountingSubjectList({ pageSize: 500, current: 1, accountType });
-            if (resp) {
-                const initData = await getHasSetReportRelation({ reportId: record.id, relation: settingType });
-                if (initData) {
-                    const hasSelectedKeys = initData.map((a: any) => a.code);
-                    // console.log(flattenTreeData(resp.list));
-                    const hasSelectedRows = flattenTreeData(resp.list,'children').filter((a: any) => hasSelectedKeys.includes(a.accountingCode));
-                    const selectedKeys = hasSelectedRows.map((a: any) => a.accountingCode);
-                    // console.log({hasSelectedRows,hasSelectedKeys,a:flattenTreeData(resp.list,'children')});
-                    // setSelectedKeys(selectedKeys);
-                    setTargetKeys(selectedKeys);
-                }
-                set_datasource(resp.list);
-                _set_data(resp.list);
-            }
-
-        }
-        if (settingType == 2) {
-            const resp = await getApportionmentLevelList({ pageSize: 500, current: 1 });
-            if (resp) {
-                const initData = await getHasSetReportRelation({ reportId: record.id, relation: settingType });
-                if (initData) {
-                    const hasSelectedKeys = initData.map((a: any) => Number(a.id));
-                    const hasSelectedRows = resp.list.filter((a: any) => hasSelectedKeys.includes(a.id));
-                    const selectedKeys = hasSelectedRows.map((a: any) => a.id)
-                    // setSelectedKeys(selectedKeys);
-                    setTargetKeys(selectedKeys);
-                }
-                set_datasource(resp.list);
-                _set_data(resp.list);
-            }
-
-
-        }
-        if (settingType == 3) {
-            const resp = await getResponsibilityCenterList({ pageSize: 500, current: 1 });
-            //const opendedArr = renameChildListToChildren(resp.list, 'child');
-            if (resp) {
-                const initData = await getHasSetReportRelation({ reportId: record.id, relation: settingType });
-                if (initData) {
-                    const hasSelectedKeys = initData.map((a: any) => a.code);
-                    const hasSelectedRows = flattenTreeData(resp.list,'child').filter((a: any) => hasSelectedKeys.includes(a.responsibilityCode));
-                    const selectedKeys = hasSelectedRows.map((a: any) => a.responsibilityCode)
-                    // setSelectedKeys(selectedKeys);
-                    setTargetKeys(selectedKeys);
-                }
-                set_datasource(renameChildListToChildren(resp.list, 'child'));
-                _set_data(renameChildListToChildren(resp.list, 'child'));
-            }
-
-        }
-
-    }
-
-    const onChange = (nextTargetKeys: string[]) => {
-        // console.log({ nextTargetKeys });
-        setTargetKeys(nextTargetKeys);
-    };
-
-    const onSelectChange = (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => {
-        // console.log('sourceSelectedKeys:', sourceSelectedKeys, 'targetSelectedKeys:', targetSelectedKeys);
-        setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]);
-    };
-
-    useImperativeHandle(ref, () => ({
-        save: async () => {
-            if(settingType == 1||settingType == 3){
-                const items = flattenTreeData(datasource).filter(a => targetKeys.includes(a[`${keyName}`]));
-                onSave(targetKeys, items, settingType);
-            }else{
-                const items = datasource.filter(a => targetKeys.includes(a[`${keyName}`]));
-                onSave(targetKeys, items, settingType);
-            }
-            
-        }
-    }));
-
-
-    const onTabChanged = (key: string) => {
-        set_accountType(Number(key));
-    }
-
-    useEffect(() => {
-        getFuncList();
-    }, [accountType]);
-
-
-
-    useEffect(() => {
-        set_tabs([
-            {
-                label: '收入',
-                key: 1,
-            },
-            {
-                label: '支出',
-                key: 2,
-            },
-        ])
-    }, []);
-
-
-    return (
-        <div>
-            {settingType == 1 && (
-                <Tabs
-                    defaultActiveKey={tabs.length > 0 ? tabs[0].key : undefined}
-                    items={tabs}
-                    key={'key'}
-                    onChange={(key) => onTabChanged(key)}
-                />
-            )}
-            <Transfer className='TableTransfer' showSearch
-                titles={['待选项', '已选项']}
-                locale={{
-                    itemUnit: '项',
-                    itemsUnit: '项',
-                    searchPlaceholder: '请输入',
-                }}
-                oneWay={false}
-                onChange={onChange}
-                onSelectChange={onSelectChange}
-                dataSource={settingType == 2?datasource:flattenTreeData(datasource)}
-                rowKey={record => record[`${keyName}`]}
-                targetKeys={targetKeys}
-                selectedKeys={selectedKeys}
-                filterOption={(inputValue, item) => {
-
-                    if(settingType == 1){
-                        return item['accountingName']!.indexOf(inputValue) !== -1
-                    }
-                    if(settingType == 2){
-                        return item['shareName']!.indexOf(inputValue) !== -1
-                    }
-                    if(settingType == 3){
-                        return item['responsibilityName']!.indexOf(inputValue) !== -1
-                    }
-                    return false
-
-                }}
-            
-            >
-                {({
-                    direction,
-                    filteredItems,
-                    onItemSelectAll,
-                    onItemSelect,
-                    selectedKeys: listSelectedKeys,
-                    disabled: listDisabled,
-                }) => {
-
-                    const columns = direction === 'left' ? leftColumns : rightColumns;
-
-                    const rowSelection: TableRowSelection<TransferItem> = {
-                        getCheckboxProps: (item) => ({ disabled: listDisabled || item.disabled }),
-                        onSelectAll(selected, selectedRows) {
-                            const treeSelectedKeys = selectedRows.map((a) => a[`${keyName}`]);
-                            const diffKeys = selected
-                                ? difference(treeSelectedKeys, listSelectedKeys)
-                                : difference(listSelectedKeys, treeSelectedKeys);
-                            onItemSelectAll(diffKeys as string[], selected);
-                        },
-                        onSelect(item, selected) {
-                            onItemSelect(item[`${keyName}`], selected);
-                        },
-                        selectedRowKeys: listSelectedKeys,
-                    };
-
-                    return  (
-                        <KCIMTable
-                            rowSelection={rowSelection}
-                            columns={columns as TransferItem[]}
-                            dataSource={settingType == 2?filteredItems:direction == 'left'?buildTree(filteredItems):filteredItems}
-                            size="small"
-                            bordered={false}
-                            rowKey={keyName}
-                            scroll={{ y: 280 }}
-                            pagination={{ showTitle: false, pageSize: 9, showLessItems: false, simple: true, showTotal: () => false }}
-                            tableAlertRender={false}
-                            style={{ pointerEvents: listDisabled ? 'none' : undefined }}
-                            onRow={(row) => ({
-                                onClick: () => {
-                                    if (row.itemDisabled || listDisabled) return;
-                                    onItemSelect(row[`${keyName}`], !listSelectedKeys.includes(row[`${keyName}`]));
-                                },
-                            })}
-                        />
-                    )
-                }}
-            </Transfer>
-        </div>
-
-    )
-});
-
-export default TableTransfer
-
-

+ 0 - 316
src/pages/baseSetting/otherItemSet/reportProjectSetting/index.tsx

@@ -1,316 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-10-30 14:04:24
- * @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
- */
-
-
-
-import { ModalForm, ProFormText } from '@ant-design/pro-form';
-
-import { Tabs, Popconfirm } from 'antd';
-import { useEffect, useRef, useState } from 'react';
-
-import { addData, delData, editData, getData, getTabs } from './service';
-
-import './style.less';
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { ProFormDependency, ProFormDigit, ProFormInstance, ProFormRadio, ProFormSelect } from '@ant-design/pro-components';
-import { getTargetDic } from '@/services/auth';
-
-
-export default function reportItemSet() {
-
-  const tableRef = useRef();
-  const [tabs, set_tabs] = useState<any[]>([]);
-
-  const [currentEdit, set_currentEdit] = useState<any|undefined>(undefined);
-  const [tableData, set_tableData] = useState<any[]>([]);
-  const [currentTab, set_currentTab] = useState<any|undefined>(undefined);
-
-  const columns = [
-    {
-      title: '报表项目名称',
-      dataIndex: 'columnName',
-    },
-    {
-      title: '报表项目代码',
-      dataIndex: 'columnCode',
-    },
-    {
-      title: '计算方式',
-      dataIndex: 'computeTypeName',
-    },
-    {
-      title: '计算来源',
-      dataIndex: 'computeSourceName',
-    },
-    {
-      title: '序号',
-      dataIndex: 'sort',
-    },
-    {
-      title: '下钻界面',
-      dataIndex: 'redirectName',
-    },
-    {
-      title: '操作',
-      dataIndex: 'option',
-      valueType: 'option',
-      width: '15%',
-      render: (_: any, record: { parentColumnCode: any,id:any }) => {
-        const { parentColumnCode } = record;
-        const delBtn = () => (
-          <Popconfirm
-            key={3}
-            title="是否确定删除?"
-            onConfirm={() => delTableData(record.id)}
-            okText="确定"
-            cancelText="取消"
-          >
-            <a key={3}>删除</a>
-          </Popconfirm>
-        );
-        return parentColumnCode == '0'
-          ? [
-              <UpDataActBtn key={1} record={record} type={'ADD'} />,
-              <UpDataActBtn key={2} record={record} type={'EDIT'} />,
-              delBtn()
-            ]
-          : [<a key={1}>编辑</a>, delBtn()];
-      },
-    },
-  ];
-
-  const getTableData = async (key: any) => {
-    const resp = await getData(key);
-    if (resp) {
-      set_tableData(resp.map((a:any) => ({ ...a, children: a.childColumns })));
-      //const columns = convertToColumnsFunc(title, true);
-    }
-  };
-
-  const delTableData = async (id: any) => {
-    const resp = await delData(id);
-    const { status } = resp;
-    if (status == 200) {
-      getTableData(currentTab.key);
-    }
-  };
-
-  const updateTable = async (formVal: { columnName: any; computeType: number; computeSource: any; parentColumnCode: any; sort: any; dataType: any; redirect: any; redirectParameter: any[]; id: any; }, type: string) => {
-  
-    try {
-      const result = {
-        reportCode: currentTab.key,
-        columnName: formVal.columnName,
-        computeType: formVal.computeType,
-        computeSource: formVal.computeType != 3 ? formVal.computeSource : 3,
-        parentColumnCode: formVal.computeType == 1 ? formVal.parentColumnCode : '',
-        sort: formVal.sort,
-        dataType: formVal.dataType,
-        redirect: formVal.redirect,
-        redirectParameter: formVal.redirectParameter?(formVal.redirectParameter instanceof Array)?formVal.redirectParameter.join(','):formVal.redirectParameter:'',
-      };
-
-      if (type == 'ADD') {
-        const resp = await addData({ ...result });
-        if (resp) {
-          getTableData(currentTab.key);
-        }
-      }
-      if (type == 'EDIT') {
-        const resp = await editData({ ...result, id: formVal.id });
-        if (resp) {
-          getTableData(currentTab.key);
-        }
-      }
-    } catch (e) {
-      console.log({ e });
-    }
-
-    return true;
-  };
-
-  const UpDataActBtn = ({ record, type}:{record:any, type:'ADD'|'EDIT'}) => {
-    const formRef = useRef<ProFormInstance<any>>();
-    return (
-      <ModalForm
-        title={`${type == 'EDIT' ? '编辑' :record?'添加':'新增'}报表`}
-        width={400}
-        initialValues={type == 'EDIT' ? { ...record,redirectParameter:record.redirectParameter?record.redirectParameter.split(','):[]} : {computeType:1,dataType:1 }}
-        trigger={type == 'EDIT' ? <a key="edit">编辑</a> : <a className="add" >{record?'添加':'新增'}</a>}
-        onFinish={(val) => {
-          set_currentEdit(undefined);
-          return updateTable(type == 'EDIT' ? { ...record, ...val,id:record.id } : { ...val,parentColumnCode:record?record.columnCode:'0' }, type);
-        }}
-        formRef={formRef}
-        modalProps={{ destroyOnClose: true }}
-      >
-        <ProFormText
-          name="columnName"
-          label="报表项目名称:"
-          placeholder="请输入"
-          rules={[{ required: true, message: '名称不能为空!' }]}
-        />
-        <ProFormSelect
-          name="computeType"
-          label="计算方式:"
-          options={[
-            { label: '对应成本项', value: 1 },
-            { label: '计算公式', value: 2 },
-            { label: '合计', value: 3 },
-          ]}
-          rules={[{ required: true, message: '计算方式不能为空!' }]}
-        />
-        <ProFormDependency name={['computeType']}>
-          {({ computeType }) => {
-            if (computeType == 1) {
-              return (
-                <ProFormSelect
-                  name="computeSource"
-                  label="报表项目类别:"
-                  request={async () => {
-                    const resp = await getTargetDic('REPORT_ITEM_TYPE');
-                    if (resp) {
-                      const { dataVoList } = resp;
-                      return dataVoList.map((a:any) => {
-                        if(a.defaultValue&&type == 'ADD'){
-                            formRef.current?.setFieldValue('computeSource',a.code);
-                          }
-                          return { label: a.name, value: a.code }
-                      });
-                    }
-                    return [];
-                  }}
-                  rules={[{ required: true, message: '报表项目类别不能为空!' }]}
-                />
-              );
-            }
-            if (computeType == 2) {
-              return (
-                <ProFormText
-                  name="computeSource"
-                  label="计算公式:"
-                  placeholder="请输入"
-                  rules={[{ required: true, message: '名称不能为空!' }]}
-                />
-              );
-            }
-          }}
-        </ProFormDependency>
-
-        <ProFormDigit
-          name="sort"
-          label="序号:"
-          placeholder="请输入"
-          rules={[{ required: true, message: '序号不能为空!' }]}
-        />
-        <ProFormRadio.Group
-          name="dataType"
-          label="数据格式:"
-          options={[
-            { label: '数值', value: 1 },
-            { label: '百分比', value: 2 },
-          ]}
-          rules={[{ required: true }]}
-        />
-        <ProFormSelect
-          name="redirect"
-          label="下钻界面:"
-          request={async () => {
-            const resp = await getTargetDic('REPORT_REDIRECT_PATH');
-            if (resp) {
-              const { dataVoList } = resp;
-              return dataVoList.map((a:any) => {
-                  if(a.defaultValue&&type == 'ADD'){
-                    formRef.current?.setFieldValue('redirect',a.code);
-                  }
-                  return { label: a.name, value: a.code }
-              });
-            }
-            return [];
-          }}
-          rules={[{ required: true, message: '下钻界面不能为空!' }]}
-        />
-        <ProFormDependency name={['redirect']}>
-              {
-                ({redirect})=>{
-                      return redirect != '0'?(
-                        <ProFormSelect
-                        name="redirectParameter"
-                        label="下钻参数:"
-                        fieldProps={{mode:'multiple'}}
-                        request={async () => {
-                            const resp = await getTargetDic('REPORT_REDIRECT_PARAM');
-                            if (resp) {
-                            const { dataVoList } = resp;
-                            return dataVoList.map((a:any) => {
-                                if(a.defaultValue&&type == 'ADD'){
-                                    formRef.current?.setFieldValue('redirectParameter',a.value?a.value.split(','):[]);
-                                }
-                                return { label: a.name, value: a.value }
-                            });
-                            }
-                            return [];
-                        }}
-                        rules={[{ required: true, message: '下钻参数不能为空!' }]}
-                        />
-                      ):null
-                }
-              }
-        </ProFormDependency>
-        
-      </ModalForm>
-    );
-  };
-
-
-  const getTabsReq = async () => {
-    const resp = await getTabs();
-    if (resp) {
-      set_tabs(resp.map((a: { code: any; name: any; }) => ({ key: a.code, label: a.name })));
-      set_currentTab({key:resp[0].code,label:resp[0].name});
-      getTableData(resp[0].code);
-    }
-  };
-
-  const onTabChanged = (key: any) => {
-    const needitem = tabs.filter((a: { key: any; }) => a.key == key);
-    set_currentTab(needitem[0]);
-    getTableData(key);
-  };
-
-
-
-  useEffect(() => {
-    getTabsReq();
-  }, []);
-
-  return (
-    <KCIMPagecontainer className="reportItemSet" title={false}>
-      <Tabs
-        defaultActiveKey={tabs.length > 0 ? tabs[0].key : undefined}
-        items={tabs}
-        key={'key'}
-        onChange={(key) => onTabChanged(key)}
-      />
-      <div className="toolBar">
-        <div className="filter"></div>
-        <div className="btnGroup">
-          {/* <a className='copy'>复制</a> */}
-          <UpDataActBtn record={undefined} type="ADD" />
-        </div>
-      </div>
-      <div>
-        <KCIMTable columns={columns} actionRef={tableRef} rowKey="id" dataSource={tableData} />
-      </div>
-    </KCIMPagecontainer>
-  );
-}

+ 0 - 69
src/pages/baseSetting/otherItemSet/reportProjectSetting/service.js

@@ -1,69 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-10-19 16:43:53
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-
-
-
-export const getData = (key) => {
-  return request('/costAccount/setting/getReportColumn', {
-    method: 'GET',
-    params:{reportCode:key}
-  });
-};
-
-
-//获取Tabs
-export const getTabs = () => {
-  return request('/costAccount/setting/getReport', {
-    method: 'GET',
-  });
-};
-
-
-//新增表格数据 
-
-export const addData = (data) => {
-  return request('/costAccount/setting/addReportColumn', {
-    method: 'POST',
-    data
-  });
-};
-
-
-//编辑权
-export const editData = (data) => {
-  return request('/costAccount/setting/editReportColumn', {
-    method: 'POST',
-    data
-  });
-};
-
-
-
-//删除表格操作
-
-export const delData = (id) => {
-  return request('/costAccount/setting/deleteReportColumn', {
-    method: 'POST',
-    params:{id}
-  });
-};
-
-
-
-
-
-
-
-

+ 0 - 92
src/pages/baseSetting/otherItemSet/reportProjectSetting/style.less

@@ -1,92 +0,0 @@
-
-
-
-.TableSelecter {
-
-  .pfm-ant-modal-footer {
-    display: none !important;
-  }
-  
-  .footer {
-       display: flex;
-       flex-direction:row;
-       justify-content: flex-end;
-       margin-top: 15px;
-       span {
-           display: inline-block;
-           width: 56px;
-           height: 24px;  
-           font-size: 14px;
-           line-height: 23px;
-           text-align: center;
-           border-radius: 4px;
-           cursor: pointer;
-
-           &.ok {
-               color: #FFFFFF;
-               background:#3377FF;
-               margin-left: 8px;
-           }
-           &.cancel {
-               border: 1px solid #DAE2F2;
-           }
-       }
-
-  }
-}
-
-.reportItemSet {
-  position: relative;
-  padding: 16px;
-  padding-top: 0;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    position:absolute;
-    right:16px;
-    top:16px;
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-      
-      .add ,.copy{
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-      .copy {
-          color: #17181A;
-          border: 1px solid #DAE2F2;
-          background: #FAFCFF;
-          margin-right: 8px;
-      }
-    }
-
-  }
-}

+ 0 - 76
src/pages/baseSetting/otherItemSet/visitsAndBedDayCostSetting/service.ts

@@ -1,76 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-21 19:20:27
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { Key } from 'react';
-import { request } from 'umi';
-
-//获取诊次/床日成本设置列表
-export const getVisitsAndBedDayCostSettingList = (params:any) => {
-  const {incomeFileName:name,current,pageSize} = params;
-  return request('/costAccount/costnumberbedset/list', {
-    method: 'GET',
-    params:{current,pageSize,name},
-  });
-}
-
-
-
-//新增
-export type AddTableDataType = {
-  leverSort:number,
-  shareName:string,
-  calcType:number,
-  targetLevel:any
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/costsharelevel/save', {
-    method: 'POST',
-    data:{...data}
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/costsharelevel/update', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (ids:Key[]) => {
-  return request('/costAccount/costsharelevel/delete', {
-    method: 'POST',
-    data:[...ids]
-  });
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 42
src/pages/baseSetting/otherItemSet/visitsAndBedDayCostSetting/style.less

@@ -1,42 +0,0 @@
-.VisitsAndBedDayCostSetting {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    margin-bottom: 16px;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-        .add {
-          cursor: pointer;
-          display: inline-block;
-          font-size: 14px;
-          font-weight: 400;
-          color: #FFFFFF;
-          line-height: 24px;
-          padding: 0 14px;
-          background: #3377FF;
-          border-radius: 4px;
-        }
-    }
-  }
-}

+ 0 - 208
src/pages/baseSetting/otherItemSet/wholeHospCostAndIncomeSet/index.tsx

@@ -1,208 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-08-23 10:22:11
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-
-import { ActionType, ProFormDependency, ProFormInstance, ProFormText, ProFormSelect, ProFormDigit } from '@ant-design/pro-components';
-import { ModalForm } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { message, Popconfirm, Form, Select } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, delData, editData, getWholeHospCostList } from './service';
-
-import './style.less';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-export default function WholeHospCostAndIncomeSet() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ accountType: 1 });
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [currentRow, setCurrentRow] = useState<any | undefined>(undefined);
-    const [selectableLevelList, setSelectableLevelList] = useState<any[]>([]);//可选的分摊层级列表
-
-    const columns: ProColumns[] = [
-
-        {
-            title: '收支类型',
-            dataIndex: 'paymentsType',
-            renderText(num) {
-                 return num == 1?'收入':'支出'
-            },
-        },
-        {
-            title: '收支名称',
-            dataIndex: 'paymentsName',
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 90,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getWholeHospCostList({ ...params });
-        if (resp) {
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData([record.id]);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-        const result = {
-            paymentsType:formVal.paymentsType,
-            paymentsName:formVal.paymentsName
-        }
-        if (type == 'ADD') {
-            const resp = await addData(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-            try {
-                const resp = await editData({...result,id:formVal.id});
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-            } catch (error) {
-                console.log({ error });
-            }
-
-        }
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
-        setCurrentRow(record);
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}分摊层级`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                    targetLevel: record.targetLevel ? record.targetLevel.split(',').map((a: string) => Number(a)) : []
-                } : { targetLevel: [] }}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormSelect
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择收支类型',
-                        },
-                    ]}
-                    options={[
-                        {
-                            value: 1,
-                            label: '收入',
-                        },
-                        {
-                            value: 2,
-                            label: '支出',
-                        },
-                    ]}
-                    name="paymentsType"
-                    label="选择收支类型"
-                />
-                <ProFormText
-                    rules={[
-                        {
-                            required: true,
-                            message: '请填写收支名称',
-                        },
-                    ]}
-                    name="paymentsName"
-                    label="收支名称"
-                />
-
-            </ModalForm>
-        )
-    }
-
-
-    return (
-        <KCIMPagecontainer className='WholeHospCostAndIncomeSet' title={false}>
-            <div className='toolBar'>
-                <div className='title'>全院其他收支设置</div>
-                <div className='btnGroup'>
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div>
-                <KCIMTable scroll={{ y: `calc(100vh - 191px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 73
src/pages/baseSetting/otherItemSet/wholeHospCostAndIncomeSet/service.ts

@@ -1,73 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-21 11:08:53
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { Key } from 'react';
-import { request } from 'umi';
-
-//获取  全院其他收支设置列表
-export const getWholeHospCostList = (params:any)=> {
-  return request('/costAccount/costotherpayments/list', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-
-
-//新增
-export type AddTableDataType = {
-  paymentsType:number,
-  paymentsName:string,
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/costotherpayments/save', {
-    method: 'POST',
-    data:{...data},
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/costotherpayments/update', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (ids:Key[]) => {
-  return request('/costAccount/costotherpayments/delete', {
-    method: 'POST',
-    data:[...ids]
-  });
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 34
src/pages/baseSetting/otherItemSet/wholeHospCostAndIncomeSet/style.less

@@ -1,34 +0,0 @@
-.WholeHospCostAndIncomeSet {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    margin-bottom: 16px;
-
-    .title {
-      font-size: 16px;
-      font-weight: 500;
-      color: #17181A;
-    }
-
-    .btnGroup {
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-    }
-  }
-}

+ 0 - 566
src/pages/baseSetting/responsibilityCenterSet/responsibilityCenter/index.tsx

@@ -1,566 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-14 11:32:17
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-import { ActionType, ProFormDependency, ProFormInstance, ProFormText, ProFormSelect } from '@ant-design/pro-components';
-import { ModalForm, ProFormDigit } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm,Popover,Switch,Tooltip } from 'antd';
-import { useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-
-
-import { addData, delData, editData, getApportionmentLevelListNoPage, getResponsibilityCenterList, getResponsibilityTypeReq, getStandardShareLevelReq } from './service';
-
-import './style.less';
-
-import {renameChildListToChildren } from '@/utils/tooljs';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-let selectableLevelList: any[] = [];
-let currentRow: any = undefined;
-
-export const searchTree = (tree: any[], searchTerm: string) => {
-    const searchTermLower = searchTerm.toLowerCase();
-
-    function searchNode(node: any) {
-        const matchedChildren: any[] = [];
-
-        if (node.children && node.children.length > 0) {
-            node.children.forEach((child: any) => {
-                const matchedChild = searchNode(child);
-                if (matchedChild) {
-                    matchedChildren.push(matchedChild);
-                }
-            });
-        }
-
-        if (node.responsibilityName.toLowerCase().includes(searchTermLower) || (node.responsibilityCode && node.responsibilityCode.toLowerCase().includes(searchTermLower))) {
-            return {
-                ...node,
-                children: matchedChildren.length > 0 ? matchedChildren : node.children
-            };
-        } else if (matchedChildren.length > 0) {
-            return {
-                ...node,
-                children: matchedChildren
-            };
-        }
-
-        return null;
-    }
-
-    return tree.map(rootNode => searchNode(rootNode)).filter(node => node !== null);
-}
-
-
-export default function ResponsibilityCenter() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const columns: ProColumns[] = [
-        {
-            title: '责任中心名称',
-            dataIndex: 'responsibilityName',
-            ellipsis: true,
-            width: 200,
-            fixed:'left',
-            renderText(_, record) {
-                const { isDefault, responsibilityName,isGatherCenter } = record;
-                // return isDefault == 1 ? <Tag>{`${responsibilityName}(是)`}</Tag> : responsibilityName
-                return (isDefault == 1||isGatherCenter == 1)?isGatherCenter == 1?<Popover content='汇总中心'>
-                      {responsibilityName} <img style={{width:14,height:14,position:'relative',left:6}} src={require('../../../../../static/huizong.png')} />
-                </Popover>:<>{responsibilityName}<img style={{width:14,height:14,position:'relative',top:-1,left:6}} src={require('../../../../../static/moren.png')} /></>:responsibilityName
-            },
-        },
-        {
-            title: '责任中心编码',
-            ellipsis: true,
-            dataIndex: 'responsibilityCode',
-        },
-        // {
-        //     title: '是否汇总中心',
-        //     dataIndex: 'isGatherCenter',
-        //     renderText(_, record) {
-        //         return <>{_ == 1 ? '是' : '否'}</>
-        //     },
-        // },
-        {
-            title: '责任类型',
-            ellipsis: true,
-            dataIndex: 'responsibilityType',
-            renderText(num, record) {
-                if (record.isGatherCenter != 1) {
-                    return num == 1 ? '收益中心' : num == 2 ? '成本(费用)中心' : '半收益中心'
-                } else {
-                    return '-'
-                }
-
-            },
-        },
-        {
-            title: '分摊级别',
-            ellipsis: true,
-            dataIndex: 'shareLevel',
-            renderText(num, record) {
-                if (record.isGatherCenter != 1) {
-                    return num
-                } else {
-                    return '-'
-                }
-
-            },
-        },
-        {
-            title: '分摊级别名称',
-            ellipsis: true,
-            dataIndex: 'shareName',
-            renderText(name, record) {
-                if (record.isGatherCenter != 1) {
-                    return name
-                } else {
-                    return '-'
-                }
-
-            },
-        },
-        {
-            title: '标准分级',
-            ellipsis: true,
-            dataIndex: 'standardShareLevelName',
-            renderText(name, record) {
-                if (record.isGatherCenter != 1) {
-                    return name
-                } else {
-                    return '-'
-                }
-
-            },
-        },
-        {
-            title: '责任中心类型',
-            ellipsis: true,
-            dataIndex: 'typeName',
-            renderText(name, record) {
-                if (record.isGatherCenter != 1) {
-                    return name
-                } else {
-                    return '-'
-                }
-
-            },
-        },
-        {
-            title: '序号',
-            ellipsis: true,
-            dataIndex: 'sort',
-        },
-        {
-            title:()=><>启用<Tooltip title="停用的责任中心在科室损益计算界面及科室损益报表里不显示"><IconFont style={{paddingLeft:6,fontSize:16,position:'relative',top:1}} type='iconshuoming' /></Tooltip></>,
-            dataIndex: 'status',
-            fixed:'right',
-            width: 90,
-            renderText(number, record) {
-                const {isGatherCenter} = record;
-                return isGatherCenter != 1?<Switch checked={number} size='small' onChange={(bool)=>{
-                    updateTable({...record,status:bool?1:0},'EDIT');
-                }} />:<></>
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 120,
-            fixed:'right',
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                const { isGatherCenter } = record;
-                return isGatherCenter == 1 ? [
-                    <UpDataActBtn key={'act'} record={record} type='ADDCHILD' />,
-                    <UpDataActBtn key={'act1'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                ] : [
-                    <UpDataActBtn key={'act2'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const { filter } = params;
-        const resp = await getResponsibilityCenterList({ ...params });
-        if (resp) {
-            let data = [];
-
-            if (filter) {
-                const result = searchTree(renameChildListToChildren(resp.list, 'child'), filter);
-                data = result
-            } else {
-                data = renameChildListToChildren(resp.list, 'child')
-            }
-
-            return {
-                data: data,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData(record.id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | "ADDCHILD") => {
-  
-
-        if (type == 'ADD' || type == 'ADDCHILD') {
-
-            let id = 0;
-            type == 'ADDCHILD' && (id = formVal.id);
-
-            const { isDefault = 0, selectedSharelevel } = formVal;
-
-            const result = {responsibilityType:1,...formVal, shareName: selectedSharelevel ? selectedSharelevel.shareName : '', shareId: selectedSharelevel ? selectedSharelevel.id : 0, shareLevel: selectedSharelevel ? selectedSharelevel.leverSort : 0, isDefault, id, selectedSharelevel: null };
-
-            const resp = await addData(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-            try {
-                const { responsibilityLevel = 0, selectedSharelevel, shareId } = formVal;
-                let body = {};
-                if (!selectedSharelevel) {
-                    //没有修改分摊层级
-                    body = {responsibilityType:1, ...formVal }
-                }
-
-                if (Object.prototype.toString.call(selectedSharelevel) == '[object Object]') {
-                    //修改了分摊层级
-                    //  console.log('修改了分摊层级');
-                    body = {responsibilityType:1, ...formVal, shareId: selectedSharelevel.id, shareName: selectedSharelevel.shareName, shareLevel: selectedSharelevel.leverSort, selectedSharelevel: null }
-                }
-
-                const resp = await editData({ ...body });
-                if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-            } catch (error) {
-                console.log({ error });
-            }
-
-        }
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADDCHILD' }) => {
-
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}责任中心`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                } : { selectedSharelevel: 0,sort:0 }}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : type == 'ADDCHILD' ? <a className='add'>添加</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : type == 'ADDCHILD' ? { ...val, id: record.id } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText name='selectedSharelevel' hidden />
-                <ProFormSelect
-                    disabled={type == 'EDIT'}
-                    rules={[
-                        {
-                            required: true,
-                            message: '请选择是否为汇总中心',
-                        },
-                    ]}
-                    options={[
-                        {
-                            value: 1,
-                            label: '是',
-                        },
-                        {
-                            value: 2,
-                            label: '否',
-                        },
-                    ]}
-                    name="isGatherCenter"
-                    label="是否汇总中心"
-                />
-
-                <ProFormText
-                    label="责任中心名"
-                    rules={[
-                        {
-                            required: true,
-                            message: '责任中心名是必填项',
-                        },
-                    ]}
-                    name="responsibilityName"
-                />
-                <ProFormText
-                    label="责任中心编码"
-                    rules={[
-                        {
-                            required: true,
-                            message: '责任中心编码是必填项',
-                        },
-                    ]}
-                    name="responsibilityCode"
-                />
-                
-                <ProFormDependency name={['isGatherCenter']}>
-                    {
-                        ({ isGatherCenter }) => {
-                            return isGatherCenter == 2 ? (
-                                <ProFormSelect
-                                    rules={[
-                                        {
-                                            required: true,
-                                            message: '请选择是否默认责任中心',
-                                        },
-                                    ]}
-                                    options={[
-                                        {
-                                            value: 1,
-                                            label: '是',
-                                        },
-                                        {
-                                            value: 0,
-                                            label: '否',
-                                        },
-                                    ]}
-                                    width="sm"
-                                    name="isDefault"
-                                    label="是否默认责任中心"
-                                />
-                            ) : (
-                                <></>
-                            )
-
-                        }
-                    }
-                </ProFormDependency>
-
-                <ProFormDependency name={['isGatherCenter']}>
-                    {
-                        ({ isGatherCenter }) => {
-                            return isGatherCenter != 1 && (
-                                <>
-                                    <ProFormSelect
-                                        rules={[
-                                            {
-                                                required: true,
-                                                message: '请选择责任类别',
-                                            },
-                                        ]}
-                                        options={[
-                                            {
-                                                value: 1,
-                                                label: '收益中心',
-                                            },
-                                            {
-                                                value: 2,
-                                                label: '成本(费用)中心',
-                                            },
-                                            {
-                                                value: 3,
-                                                label: '半收益中心',
-                                            },
-                                        ]}
-                                        name="responsibilityType"
-                                        label="选择责任类别"
-                                    />
-                                    <ProFormSelect
-                                        rules={[
-                                            {
-                                                required: true,
-                                                message: '请选择分摊级别',
-                                            },
-                                        ]}
-                                        fieldProps={{   
-                                            onChange: (val) => {
-                                                const needItem = selectableLevelList.filter((item: any) => item.leverSort == val);
-                                                console.log({needItem});
-                                                if (formRef.current) {
-                                                    formRef.current.setFieldsValue({ selectedSharelevel: needItem[0] })
-                                                }
-                                            },
-                                        }}
-                                        request={async () => {
-                                            const resp = await getApportionmentLevelListNoPage();
-                                            if (resp) {
-                                                selectableLevelList = resp.list;
-                                                return resp.list.map((item: any) => ({ label: `级别${item.leverSort}-${item.shareName}`, value: item.leverSort }))
-                                            } else {
-                                                return []
-                                            }
-                                        }}
-                                        name='shareLevel'
-                                        label="选择分摊级别"
-                                    />
-                                    <ProFormSelect
-                                        rules={[
-                                            {
-                                                required: true,
-                                                message: '请选择标准分级',
-                                            },
-                                        ]}
-                                        request={async () => {
-                                            const resp = await getStandardShareLevelReq();
-                                            if (resp) {
-                                                return resp.map((a: any) => ({ label: a.name, value: a.code }))
-                                            }
-                                            return []
-                                        }}
-                                        name="standardShareLevel"
-                                        label="标准分级"
-                                    />
-                                    <ProFormSelect
-                                        rules={[
-                                            {
-                                                required: true,
-                                                message: '请选择责任中心类型',
-                                            },
-                                        ]}
-                                        request={async () => {
-                                            const resp = await getResponsibilityTypeReq();
-                                            if (resp) {
-                                                return resp.map((a: any) => ({ label: a.name, value: a.code }))
-                                            }
-                                            return []
-                                        }}
-                                        name="type"
-                                        label="责任中心类型"
-                                    />
-                                </>
-
-                            )
-                        }
-                    }
-                </ProFormDependency>
-                <ProFormDigit
-                    label="顺序号"
-                    rules={[
-                        {
-                            required: true,
-                            message: '顺序号是必填项',
-                        },
-                    ]}
-                    name="sort"
-                />
-
-            </ModalForm>
-        )
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    useEffect(() => {
-
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='ResponsibilityCenter' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'责任中心编码/名称'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        filter: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    filter: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} scroll={{x:1500, y: 'calc(100vh - 232px)' }} actionRef={tableRef} rowKey='responsibilityCode' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 97
src/pages/baseSetting/responsibilityCenterSet/responsibilityCenter/service.ts

@@ -1,97 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-05-17 13:57:28
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-
-
-
-
-export const getResponsibilityCenterList = (params?:any) => {
-  return request('/costAccount/responsibility/list', {
-    method: 'GET',
-    params:{...params}
-  });
-};
-
-//获取分摊层级列表无分页
-export const getApportionmentLevelListNoPage = () => {
-  return request('/costAccount/costsharelevel/list', {
-    method: 'GET',
-  });
-}
-
-//获取标准分摊层级
-export const getStandardShareLevelReq = () => {
-  return request('/costAccount/responsibility/getStandardShareLevel', {
-    method: 'GET',
-  });
-}
-
-//获取责任中心类型
-export const getResponsibilityTypeReq = () => {
-  return request('/costAccount/responsibility/getResponsibilityType', {
-    method: 'GET',
-  });
-}
-
-
-//新增
-export type AddTableDataType = {
-  code:string,
-  name:string,
-  description:string
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/responsibility/save', {
-    method: 'POST',
-    data
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/responsibility/edit', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (id:string) => {
-  return request('/costAccount/responsibility/delete', {
-    method: 'POST',
-    params:{id}
-  });
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 56
src/pages/baseSetting/responsibilityCenterSet/responsibilityCenter/style.less

@@ -1,56 +0,0 @@
-.ResponsibilityCenter {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-      .import,.export {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #17181A;
-        line-height: 24px;
-        padding: 0 14px;
-        margin-right: 8px;
-        background: #FAFCFF;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-      }
-      
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-    }
-
-  }
-}

+ 0 - 235
src/pages/baseSetting/responsibilityCenterSet/responsibilityCenterConnect/index.tsx

@@ -1,235 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-09 10:52:35
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { createFromIconfontCN } from '@ant-design/icons';
-import FormItem from 'antd/es/form/FormItem';
-
-import { ActionType, ProFormInstance, ProFormText } from '@ant-design/pro-components';
-import { ModalForm, ProFormTextArea } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Modal, Tag } from 'antd';
-import { Key, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { getResponsibilityCenterConnectList, saveResponsibilityCenterConnected } from './service';
-
-import './style.less';
-import KCIMUpload from '@/components/KCIMUpload';
-import { downloadTemplateReq, renameChildListToChildren } from '@/utils/tooljs';
-import React from 'react';
-import TableTransfer from './transform';
-import { searchTree } from '../responsibilityCenter';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-const transferTableColumn:ProColumns[] = [
-    {
-        title: 'Id',
-        width:60,
-        dataIndex: 'id',
-    },
-    {
-        title: '科室名称',
-        ellipsis: true,
-        dataIndex: 'departmentName',
-        renderText(text, record) {
-            return record.departmentCode?`${text}(${record.departmentCode})`:text
-        },
-    },
-]
-
-
-let currentRow:any = undefined;
-
-export default function ResponsibilityCenterConnect() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const columns: ProColumns[] = [
-
-        {
-            title: '责任中心名称',
-            dataIndex: 'responsibilityName',
-            ellipsis: true,
-            width:200,
-            renderText(_,record) {
-                const { isDefault, responsibilityName } = record;
-                return isDefault == 1 ? <Tag>{`${responsibilityName}(是)`}</Tag> : responsibilityName
-            },
-        },
-        {
-            title: '责任中心Id',
-            ellipsis: true,
-            width:120,
-            dataIndex: 'responsibilityId',
-        },
-        {
-            title: '部门列表',
-            ellipsis: true,
-          
-            dataIndex: 'departments',
-            renderText(_,record) {
-                if (Array.isArray(_)) {
-                    return _.map((item, index) => { return <Tag key={index}>{item.departmentName}</Tag> })
-                  } else {
-                    return ''
-                  }
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 100,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                const {isGatherCenter } = record;
-                return isGatherCenter==2 ? [
-                    <a
-                    key="1"
-                    onClick={() => {
-                      addConnectDepartments(record);
-                      currentRow = record;
-                    }}
-                  >
-                    绑定科室
-                  </a>,
-                ]:[]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const {filter} = params;
-        const resp = await getResponsibilityCenterConnectList({...params});
-        if (resp) {
-            let data = [];
-            if(filter){
-                const result = searchTree(renameChildListToChildren(resp.list, 'child'),filter);
-                data = result
-            }else{
-                data = renameChildListToChildren(resp.list, 'child')
-            }
-            return {
-                data:data,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-
-    const onSaveHandle = async (keys:Key[],rows:any[]) => {
-        const {responsibilityId} = currentRow;
-        const resp = await saveResponsibilityCenterConnected({responsibilityId,departmentIds:keys});
-        if(resp){
-            currentRow = undefined;
-            tableRef.current?.reload();
-        }
-    }
-
-    const addConnectDepartments = (record: any) => {
-
-        const ref = React.createRef<{ save: any; }>();
-
-        Modal.confirm({
-            title: `选择科室`,
-            icon: <></>,
-            width: 750,
-            centered: true,
-            okText: '确定',
-            cancelText: '取消',
-            content: <TableTransfer
-                ref={ref}
-                record={record}
-                onSave={onSaveHandle}
-                leftColumns={transferTableColumn}
-                rightColumns={transferTableColumn} dataSource={[]}
-            ></TableTransfer>,
-            onOk: () => {
-                return ref.current && ref.current.save();
-            }
-        })
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-
-
-    useEffect(() => {
-
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='ResponsibilityCenterConnect' title={false}>
-            <div className='toolBar' style={{marginBottom:16}}>
-            <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'责任中心名称'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        filter: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    filter: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                </div>
-            </div>
-
-            <div style={{ }}>
-                <KCIMTable columns={columns as ProColumns[]} scroll={{y:'calc(100vh - 232px)'}} actionRef={tableRef} rowKey='responsibilityId' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 39
src/pages/baseSetting/responsibilityCenterSet/responsibilityCenterConnect/service.ts

@@ -1,39 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-12-07 14:50:05
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-
-export const getResponsibilityCenterConnectList = (params?:any) => {
-  return request('/costAccount/centerDepartment/list', {
-    method: 'GET',
-    params:{...params}
-  });
-};
-
-
-//获取责任中心对应可绑定科室列表
-export const  getResponsibilityCenterConnectableList = (params:any) => {
-  return request('/costAccount/costresponsibilitydepartment/getById', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-
-//保存绑定信息
-export const saveResponsibilityCenterConnected = (body:any) => {
-  return request('/costAccount/centerDepartment/save', {
-    method: 'POST',
-    data:{...body},
-  });
-}

+ 0 - 56
src/pages/baseSetting/responsibilityCenterSet/responsibilityCenterConnect/style.less

@@ -1,56 +0,0 @@
-.ResponsibilityCenterConnect {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-      .import,.export {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #17181A;
-        line-height: 24px;
-        padding: 0 14px;
-        margin-right: 8px;
-        background: #FAFCFF;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-      }
-      
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-    }
-
-  }
-}

+ 0 - 1069
src/pages/costAccounting/calcPageTemplate/columns.tsx

@@ -1,1069 +0,0 @@
-import { tableColumnsWidObj } from "@/constant";
-import { formatMoneyNumber, formatToPercentage } from "@/utils/format";
-import { createFromIconfontCN } from "@ant-design/icons";
-import { ProColumns } from "@ant-design/pro-components";
-import { Popover } from 'antd'
-import React from "react";
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-export const unitPersonnelCostCalc: ProColumns[] = [
-    {
-        title: '人事分类名称',
-        dataIndex: 'name',
-    },
-    {
-        title: '实际编制人数',
-        dataIndex: 'empNum',
-    },
-    {
-        title: '实际总工时',
-        dataIndex: 'actualHour',
-    },
-    {
-        title: '预计总工时',
-        dataIndex: 'expectHour',
-    },
-    {
-        title: '总成本',
-        dataIndex: 'totalCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '人均成本',
-        dataIndex: 'avgCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '每分钟成本',
-        dataIndex: 'minuteCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-];
-
-
-export const chargeItemCostCalc: ProColumns[] = [
-    {
-        title: '收费项目编码',
-        dataIndex: 'code',
-    },
-    {
-        title: '收费项目名称',
-        dataIndex: 'name',
-        width: '20%'
-    },
-    {
-        title: '项目类别',
-        dataIndex: 'itemType',
-    },
-    {
-        title: '药品收入',
-        dataIndex: 'drugIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料收入',
-        dataIndex: 'materialIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '项目收入',
-        dataIndex: 'itemIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品成本',
-        dataIndex: 'drugCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料成本',
-        dataIndex: 'materialCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '项目成本',
-        dataIndex: 'itemCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '人力成本',
-        dataIndex: 'empCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '设备成本',
-        dataIndex: 'equipmentCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '空间成本',
-        dataIndex: 'spaceCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-];
-
-
-export const patientCostCalc: ProColumns[] = [
-    {
-        title: '住院号/门诊号',
-        dataIndex: 'visitNo',
-    },
-    {
-        title: '病人ID',
-        dataIndex: 'patientNo',
-    },
-    {
-        title: '患者姓名',
-        dataIndex: 'name',
-    },
-    {
-        title: '科室代码',
-        dataIndex: 'departmentCode',
-    },
-    {
-        title: '科室名称',
-        dataIndex: 'departmentName',
-    },
-    {
-        title: '人力成本',
-        dataIndex: 'empCost',
-        align:'right',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '设备成本',
-        align:'right',
-        dataIndex: 'equipmentCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '空间成本',
-        align:'right',
-        dataIndex: 'spaceCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '项目成本',
-        align:'right',
-        dataIndex: 'itemCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品成本',
-        align:'right',
-        dataIndex: 'drugCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料成本',
-        align:'right',
-        dataIndex: 'materialCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '项目收入',
-        align:'right',
-        dataIndex: 'itemIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品收入',
-        align:'right',
-        dataIndex: 'drugIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料收入',
-        align:'right',
-        dataIndex: 'materialIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-
-    },
-];
-
-
-export const diseaseCostCalculation: ProColumns[] = [
-    {
-        title: '病种代码',
-        dataIndex: 'code',
-    },
-    {
-        title: '病种名称',
-        dataIndex: 'name',
-    },
-    {
-        title: '科室代码',
-        dataIndex: 'departmentCode',
-    },
-    {
-        title: '科室名称',
-        dataIndex: 'departmentName',
-    },
-    {
-        title: '人力成本',
-        dataIndex: 'empCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '设备成本',
-        dataIndex: 'equipmentCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '空间成本',
-        dataIndex: 'spaceCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '项目成本',
-        dataIndex: 'itemCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品成本',
-        dataIndex: 'drugCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料成本',
-        dataIndex: 'materialCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '项目收入',
-        dataIndex: 'itemIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品收入',
-        dataIndex: 'drugIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料收入',
-        dataIndex: 'materialIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    }
-];
-
-export const DRG_DIPCostCalc: ProColumns[] = [
-    {
-        title: '分组代码',
-        dataIndex: 'code',
-    },
-    {
-        title: '分组名称',
-        width: '18%',
-        dataIndex: 'name',
-    },
-    {
-        title: '科室代码',
-        dataIndex: 'departmentCode',
-    },
-    {
-        title: '科室名称',
-        dataIndex: 'departmentName',
-    },
-    {
-        title: '人力成本',
-        dataIndex: 'empCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '设备成本',
-        dataIndex: 'equipmentCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '空间成本',
-        dataIndex: 'spaceCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '项目成本',
-        dataIndex: 'itemCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品成本',
-        dataIndex: 'drugCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料成本',
-        dataIndex: 'materialCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '项目收入',
-        dataIndex: 'itemIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品收入',
-        dataIndex: 'drugIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料收入',
-        dataIndex: 'materialIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    }
-];
-export const clinicalPathway: ProColumns[] = [
-    {
-        title: '路径代码',
-        dataIndex: 'code',
-    },
-    {
-        title: '路径名称',
-        width: '20%',
-        dataIndex: 'name',
-    },
-    {
-        title: '科室代码',
-        dataIndex: 'departmentCode',
-    },
-    {
-        title: '科室名称',
-        dataIndex: 'departmentName',
-    },
-    {
-        title: '人力成本',
-        dataIndex: 'empCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '设备成本',
-        dataIndex: 'equipmentCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '空间成本',
-        dataIndex: 'spaceCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '项目成本',
-        dataIndex: 'itemCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品成本',
-        dataIndex: 'drugCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料成本',
-        dataIndex: 'materialCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '项目收入',
-        dataIndex: 'itemIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品收入',
-        dataIndex: 'drugIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料收入',
-        dataIndex: 'materialIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    }
-];
-
-export const medicalOrderItem: ProColumns[] = [
-    {
-        title: '医嘱项目编码',
-        dataIndex: 'code',
-    },
-    {
-        title: '医嘱项目名称',
-        dataIndex: 'name',
-        width: '18%'
-    },
-    {
-        title: '科室代码',
-        dataIndex: 'departmentCode',
-    },
-    {
-        title: '科室名称',
-        dataIndex: 'departmentName',
-    },
-
-    {
-        title: '项目成本',
-        dataIndex: 'itemCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品成本',
-        dataIndex: 'drugCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料成本',
-        dataIndex: 'materialCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '项目收入',
-        dataIndex: 'itemIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品收入',
-        dataIndex: 'drugIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料收入',
-        dataIndex: 'materialIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '人力成本',
-        dataIndex: 'empCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '设备成本',
-        dataIndex: 'equipmentCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '空间成本',
-        dataIndex: 'spaceCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-];
-
-export const medicalMaterialCostCalc: ProColumns[] = [
-    {
-        title: '责任中心代码',
-        dataIndex: 'responsibilityCode',
-    },
-    {
-        title: '责任中心名称',
-        dataIndex: 'responsibilityName',
-        width: '10%'
-    },
-    {
-        title: '收费项目编码',
-        dataIndex: 'code',
-    },
-    {
-        title: '收费项目名称',
-        dataIndex: 'name',
-        width: '30%'
-    },
-
-    {
-        title: '项目类别',
-        dataIndex: 'itemType',
-    },
-    {
-        title: '药品收入',
-        align:'right',
-        dataIndex: 'drugIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料收入',
-        align:'right',
-        dataIndex: 'materialIncome',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '药品成本',
-        dataIndex: 'drugCost',
-        align:'right',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '材料成本',
-        align:'right',
-        dataIndex: 'materialCost',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-
-];
-export const beforeCollectionSearch: ProColumns[] = [
-    {
-        title: '收入项目',
-        dataIndex: 'productCodeName',
-    },
-    {
-        title: '会计科目',
-        dataIndex: 'accountCodeName',
-    },
-    {
-        title: '金额(元)',
-        dataIndex: 'amount',
-        width: 130,
-        align:'center',
-        renderText(num, record, index, action) {
-            return <div style={{paddingRight:30,textAlign:'right'}}>{formatMoneyNumber(num)}</div>
-        }
-    },
-    {
-        title: '开单科室',
-        dataIndex: 'openDepartmentCodeName',
-
-    },
-    {
-        title: '开单责任中心',
-        dataIndex: 'openResponsibilityCodeName',
-    },
-
-    {
-        title: '执行科室',
-        dataIndex: 'startDepartmentCodeName',
-    },
-    {
-        title: '执行责任中心',
-        dataIndex: 'startResponsibilityCodeName',
-    },
-];
-
-export const incomeCollection: ProColumns[] = [
-    {
-        title: '年份',
-        dataIndex: 'year',
-    },
-    {
-        title: '月份',
-        dataIndex: 'month',
-    },
-    {
-        title: '金额',
-        dataIndex: 'amount',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-
-];
-export const afterCollectionSearch: ProColumns[] = [
-    {
-        title: '年份',
-        dataIndex: 'year',
-        width: tableColumnsWidObj.year
-    },
-    {
-        title: '月份',
-        dataIndex: 'month',
-        width: tableColumnsWidObj.month
-    },
-    {
-        title: '科室编码',
-        dataIndex: 'departmentCode',
-    },
-    {
-        title: '科室名称',
-        width: tableColumnsWidObj.departmentName,
-        dataIndex: 'departmentName',
-    },
-    {
-        title: '责任中心编码',
-        width: tableColumnsWidObj.responsibilityCenterCode,
-        dataIndex: 'responsibilityCode',
-    },
-    {
-        title: '责任中心名称',
-        width: tableColumnsWidObj.responsibilityCenter,
-        dataIndex: 'responsibilityName',
-    },
-    {
-        title: '会计科目编码',
-        dataIndex: 'accountingCode',
-    },
-    {
-        title: '会计科目名',
-        dataIndex: 'accountingName',
-    },
-    {
-        title: '成本项目编码',
-        dataIndex: 'productCode',
-    },
-    {
-        title: '成本项目名',
-        dataIndex: 'productName',
-    },
-    {
-        title: '金额',
-        dataIndex: 'amount',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-
-];
-
-export const beforeCostShareSearch: ProColumns[] = [
-    {
-        title: '成本项目',
-        width: '20%',
-        dataIndex: 'productName',
-        renderText(num, record, index, action) {
-            const { productCode, productName } = record;
-            return `[${productCode}]${productName}`
-        },
-    },
-    {
-        title: '会计科目',
-        width: '20%',
-        dataIndex: 'accountName',
-        renderText(num, record, index, action) {
-            const { accountCode, accountName } = record;
-            return `[${accountCode}]${accountName}`
-        },
-    },
-    {
-        title: '金额(元)',
-        width: '20%',
-        align:'center',
-        dataIndex: 'amount',
-        renderText(num, record, index, action) {
-            return <div style={{textAlign:'right',paddingRight:'30%'}}>{formatMoneyNumber(num)}</div>
-        },
-    },
-    {
-        title: '科室名称',
-        width: '20%',
-        dataIndex: 'departName',
-        renderText(num, record, index, action) {
-            const { departCode, departName } = record;
-            return `[${departCode}]${departName}`
-        },
-    },
-    {
-        title: '责任中心名',
-        dataIndex: 'responsibilityName',
-        width: '20%',
-        renderText(num, record, index, action) {
-            const { responsibilityCode, responsibilityName } = record;
-            return `[${responsibilityCode}]${responsibilityName}`
-        },
-    },
-];
-
-export const costShare: ProColumns[] = [
-    {
-        title: '年份',
-        align:'left',
-        dataIndex: 'year',
-    },
-    {
-        title: '月份',
-        align:'center',
-        dataIndex: 'month',
-    },
-    {
-        title: '金额',
-        align:'right',
-        dataIndex: 'amount',
-        renderText(num, record, index, action) {
-            return <div style={{textAlign:'right'}}>{formatMoneyNumber(num)}</div>
-        },
-    },
-    {
-        title: '是否分摊',
-        align:'right',
-        dataIndex: 'isAllocation',
-        render: bool => bool ? '已分摊' : '未分摊'
-    },
-
-];
-
-export const afterCostShareSearch: ProColumns[] = [
-    // {
-    //     title: '年份',
-    //     dataIndex: 'dateYear',
-    //     width: tableColumnsWidObj.year
-    // },
-    // {
-    //     title: '月份',
-    //     dataIndex: 'dateMonth',
-    //     width: tableColumnsWidObj.month
-    // },
-    {
-        width:90,
-        title: '分摊层级',
-        dataIndex: 'levelSort',
-    },
-    {
-        title: '分摊层级名',
-        dataIndex: 'levelName',
-    },
-    {
-        title: '责任中心编码',
-        width: tableColumnsWidObj.responsibilityCenterCode,
-        dataIndex: 'responsibilityCode',
-    },
-    {
-        title: '责任中心名',
-        width: tableColumnsWidObj.responsibilityCenter,
-        dataIndex: 'responsibilityName',
-    },
-    {
-        title: '会计科目编码',
-        dataIndex: 'accountingCode',
-    },
-    {
-        title: '会计科目名',
-        width:220,
-        dataIndex: 'accountingName',
-    },
-    {
-        title: '金额',
-        dataIndex: 'amount',
-        align:'right',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-
-];
-
-export const departmentCostCalculate: ProColumns[] = [
-    {
-        title: '责任中心',
-        dataIndex: 'responsibilityCode',
-
-    },
-    {
-        title: '年份',
-        dataIndex: 'year',
-
-    },
-    {
-        title: '月份',
-        dataIndex: 'month',
-
-    },
-    {
-        title: '报表项目编码',
-        width: '10%',
-        dataIndex: 'reportNum',
-    },
-    {
-        title: '报表项目名',
-        dataIndex: 'reportName',
-    },
-    {
-        title: '责任中心名',
-        dataIndex: 'responsibilityName',
-    },
-    {
-        title: '责任中心编码',
-        dataIndex: 'responsibilityCode',
-
-    },
-    {
-        title: '金额',
-        width: '10%',
-        dataIndex: 'amount',
-        renderText(num, record, index, action) {
-            return formatMoneyNumber(num);
-        },
-    },
-    {
-        title: '占比',
-        dataIndex: 'percentName',
-    },
-
-];
-export const wholeHospCostCalculate: ProColumns[] = [
-    {
-        title: '报表项目',
-        dataIndex: 'reportName',
-        renderText(text, record, index, action) {
-            const { description } = record;
-            return description ? <Popover content={()=><div dangerouslySetInnerHTML={{__html:description}} />}><span style={{ cursor: 'pointer' }}>{text}</span><IconFont className="hover-icon" style={{ fontSize: 16, color: '#17181a', paddingLeft: 4, position: 'relative', top: 1 }} type={'iconshuoming'} /></Popover> : text
-        },
-    },
-    {
-        title: '金额',
-        width:200,
-        align:'right',
-        dataIndex: 'amount',
-        renderText(num, record, index, action) {
-            const { children,calcType } = record;
-            // 有 children 时返回 null,否则格式化金额
-            return (children && children.length > 0 && calcType == '0' )? <React.Fragment></React.Fragment> : formatMoneyNumber(num);
-            
-        },
-    },
-    {
-        title: '占比',
-        width:100,
-        align:'right',
-        dataIndex: 'percent',
-        renderText(num, record) {
-            const { children,calcType } = record;
-            // 有 children 时返回 null,否则格式化百分比
-            return (children && children.length > 0 && calcType == '0') ? <React.Fragment></React.Fragment> : formatToPercentage(num);
-        },
-    },
-
-    // {
-    //     title: '说明',
-    //     dataIndex: 'description',
-    //     renderText(text,record) {
-    //         const {children} = record;
-    //         return (children&&children.length>0)?<React.Fragment></React.Fragment>:text;
-    //     },
-    // },
-
-];
-
-export const costShareReportTable: ProColumns[] = [
-    {
-        title: '年份',
-        dataIndex: 'year',
-    },
-    {
-        title: '月份',
-        dataIndex: 'month',
-    },
-    {
-        title: '分摊报表名称',
-        dataIndex: 'shareReportName',
-    },
-    {
-        title: '分摊层级',
-        dataIndex: 'shareLevel',
-    },
-    {
-        title: '分摊时间',
-        dataIndex: 'shareTime',
-    },
-];
-
-export const departmentOperatingReport: ProColumns[] = [
-    {
-        title: '年份',
-        width: 100,
-        dataIndex: 'dateYear',
-    },
-    {
-        title: '月份',
-        width: 100,
-        dataIndex: 'dateMonth',
-    },
-    {
-        title: '报表类型',
-        width: 100,
-        dataIndex: 'fileType',
-    },
-    {
-        title: '报表名称',
-        dataIndex: 'fileName',
-    },
-    {
-        title: '更新时间',
-        width: 180,
-        dataIndex: 'updateTime',
-    },
-];
-export const wholeHospOperatingReport: ProColumns[] = [
-    {
-        title: '年份',
-        width: 100,
-        dataIndex: 'dateYear',
-    },
-    {
-        title: '月份',
-        width: 100,
-        dataIndex: 'dateMonth',
-    },
-    {
-        title: '报表类型',
-        width: 120,
-        dataIndex: 'fileType',
-    },
-    {
-        title: '报表名称',
-        dataIndex: 'fileName',
-    }
-];
-
-export const projectShareParamsCalc: ProColumns[] = [];
-// export const projectCostCalc: ProColumns[] = [
-//     {
-//         title: '责任中心编码',
-//         dataIndex: 'responsibilityCode',
-//         width:tableColumnsWidObj.responsibilityCenterCode
-//     },
-//     {
-//         title: '责任中心名称',
-//         dataIndex: 'responsibilityName',
-//         width:tableColumnsWidObj.responsibilityCenter
-//     },
-//     {
-//         title: '收费项目编码',
-//         dataIndex: 'code',
-//     },
-//     {
-//         title: '收费项目名称',
-//         dataIndex: 'name',
-//     },
-//     {
-//         title: '项目分类',
-//         dataIndex: 'itemTypeName',
-//     },
-//     {
-//         title: '项目成本',
-//         dataIndex: 'itemCost',
-//     },
-//     {
-//         title: '人事成本',
-//         dataIndex: 'empCost',
-//     },
-//     {
-//         title: '设备成本',
-//         dataIndex: 'equipmentCost',
-//     },
-//     {
-//         title: '空间成本',
-//         dataIndex: 'spaceCost',
-//     },
-//     {
-//         title: '公共费用分摊',
-//         dataIndex: 'publicShareCost',
-//     },
-//     {
-//         title: '管理费用分摊',
-//         dataIndex: 'managerShareCost',
-//     }
-// ];

+ 0 - 408
src/pages/costAccounting/calcPageTemplate/config.ts

@@ -1,408 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-11-01 11:13:38
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-28 14:29:20
- * @FilePath: /CostAccountingSys/src/pages/costAccounting/calcPageTemplate/config.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-import { KcimCenterSysId } from "@/constant";
-import { getAccountingSubjectList } from "@/pages/baseSetting/accountingAccountSet/accountingSubMana/service";
-import { getResponsibilityCenterList } from "@/pages/baseSetting/responsibilityCenterSet/responsibilityCenter/service";
-import { getTargetDic } from "@/services/auth";
-import { getDicDataBySysId } from "@/services/getDic";
-import { getCostProjecttList } from "./service";
-
-
-
-export const unitPersonnelCostCalcFilterConf = [
-    {
-        type:'input',
-        label:'检索:',
-        placeholder:'人事分类',
-        key:'filter'
-    }
-]
-
-export const patientCostCalcFilterConf = [
-    {
-        type:'input',
-        label:'科室名称:',
-        placeholder:'请输入',
-        key:'departmentName'
-    },
-    {
-        type:'input',
-        label:'患者姓名:',
-        placeholder:'请输入',
-        key:'patientName'
-    }
-]
-
-export const chargeItemCostCalcFilterConf = [
-    {
-        type:'select',
-        label:'项目类别:',
-        placeholder:'请输入',
-        key:'itemType',
-        request:async ()=>{
-            const resp = await getTargetDic('CHARGE_ITEM_TYPE');
-            if (resp) {
-              const { dataVoList } = resp;
-              return dataVoList.map((a:any) => ({ label: a.name, value: a.code }));
-            }
-        }
-    },
-    {
-        type:'input',
-        label:'检索:',
-        placeholder:'请输入收费项目名称',
-        key:'itemName'
-    }
-]
-
-
-export const diseaseCostCalculationFilterConf = [
-    {
-        type:'input',
-        label:'科室名称:',
-        placeholder:'请输入',
-        key:'departmentName'
-    },
-    {
-        type:'input',
-        label:'病种名称:',
-        placeholder:'请输入',
-        key:'diseaseName'
-    }
-]
-
-export const DRG_DIPCostCalcFilterConf = [
-    {
-        type:'input',
-        label:'科室名称:',
-        placeholder:'请输入',
-        key:'departmentName'
-    },
-    {
-        type:'input',
-        label:'分组名称:',
-        placeholder:'请输入',
-        key:'groupName'
-    }
-]
-
-export const clinicalPathwayFilterConf = [
-    {
-        type:'input',
-        label:'路径名称:',
-        placeholder:'请输入',
-        key:'clinicalName'
-    }
-]
-
-export const medicalOrderItemFilterConf = [
-    {
-        type:'input',
-        label:'医嘱项目名称:',
-        placeholder:'请输入',
-        key:'orderName'
-    }
-]
-
-export const beforeCollectionSearchFilterConf = [
-    {
-        type:'cascader',
-        label:'执行责任中心:',
-        placeholder:'请选择',
-        key:'responsibilityCode',
-        request:async ()=>{
-            const resp = await await getResponsibilityCenterList({pageSize:500});
-            if (resp) {
-              return resp.list
-            }
-        }
-    },
-    {
-        type:'select',
-        label:'成本项目:',
-        placeholder:'请选择',
-        key:'productCode',
-        request:async ()=>{
-            const resp = await getCostProjecttList({pageSize:500});
-            if (resp) {
-              return resp.list.map((a:any) => ({ label: a.productName, value: a.productCode }));
-            }
-        }
-    },
-]
-
-export const afterCollectionSearchFilterConf = [
-    {
-        type:'cascader',
-        label:'责任中心:',
-        placeholder:'请选择',
-        key:'responsibilityCode',
-        request:async ()=>{
-            const resp = await await getResponsibilityCenterList({pageSize:500});
-            if (resp) {
-              return resp.list
-            }
-        }
-    },
-    {
-        type:'select',
-        label:'成本项目:',
-        placeholder:'请选择',
-        key:'productCode',
-        request:async ()=>{
-            const resp = await getCostProjecttList({pageSize:500});
-            if (resp) {
-              return resp.list.map((a:any) => ({ label: a.productName, value: a.productCode }));
-            }
-        }
-    },
-]
-
-export const beforeCostShareSearchFilterConf = [
-    {
-        type:'cascader',
-        label:'责任中心:',
-        placeholder:'请选择',
-        key:'responsibilityCode',
-        request:async ()=>{
-            const resp = await await getResponsibilityCenterList({pageSize:500});
-            if (resp) {
-              return resp.list
-            }
-        }
-    },
-    {
-        type:'select',
-        label:'会计科目(支出):',
-        placeholder:'请选择',
-        key:'accountCode',
-        request:async ()=>{
-            const resp =  await getAccountingSubjectList({pageSize:500,current:1,accountType:2});
-            if (resp) {
-              return resp.list.map((a:any) => ({ label: a.accountingName, value: a.accountingCode }));
-            }
-        }
-    },
-]
-
-export const afterCostShareSearchFilterConf = [
-    {
-        type:'cascader',
-        label:'责任中心:',
-        placeholder:'请选择',
-        key:'responsibilityCode',
-        request:async ()=>{
-            const resp = await await getResponsibilityCenterList({pageSize:500});
-            if (resp) {
-              return resp.list
-            }
-        }
-    }
-]
-
-export const departmentCostCalculateFilterConf = [
-    {
-        type:'cascader',
-        label:'执行责任中心:',
-        placeholder:'请选择',
-        key:'responsibilityCode',
-        request:async ()=>{
-            const resp = await await getResponsibilityCenterList({pageSize:500});
-            if (resp) {
-              return resp.list
-            }
-        }
-    }
-]
-
-export const medicalMaterialCostCalcFilterConf = [
-    {
-        type:'cascader',
-        label:'责任中心:',
-        placeholder:'请选择',
-        key:'responsibilityCode',
-        request:async ()=>{
-            const resp = await await getResponsibilityCenterList({pageSize:500});
-            if (resp) {
-              return resp.list
-            }
-        }
-    },
-    {
-        type:'input',
-        label:'检索:',
-        placeholder:'项目代码/名称',
-        key:'filter'
-    }
-];
-
-export const projectShareParamsCalcFilterConf = [
-    {
-        type:'select',
-        label:'项目分类:',
-        placeholder:'请选择',
-        key:'itemType',
-        request:async ()=>{
-            const resp = await getDicDataBySysId(KcimCenterSysId,'MED_SERVICE_ITEM_TYPE');
-            if (resp) {
-              return resp.dataVoList.map((a:any) => ({ label: a.name, value: a.code }));
-            }
-        }
-    },
-    {
-        type:'cascader',
-        label:'责任中心:',
-        placeholder:'请选择',
-        key:'responsibility',
-        request:async ()=>{
-            const resp = await await getResponsibilityCenterList({pageSize:500});
-            if (resp) {
-              return resp.list
-            }
-        }
-    },
-    {
-        type:'input',
-        label:'检索:',
-        placeholder:'项目代码/名称',
-        key:'itemFilter'
-    }
-]
-export const projectCostCalcFilterConf = [
-    {
-        type:'select',
-        label:'项目分类:',
-        placeholder:'请选择',
-        key:'itemType',
-        request:async ()=>{
-            const resp = await getDicDataBySysId(KcimCenterSysId,'MED_SERVICE_ITEM_TYPE');
-            if (resp) {
-              return resp.dataVoList.map((a:any) => ({ label: a.name, value: a.code }));
-            }
-        }
-    },
-    {
-        type:'cascader',
-        label:'责任中心:',
-        placeholder:'请选择',
-        key:'responsibility',
-        request:async ()=>{
-            const resp = await await getResponsibilityCenterList({pageSize:500});
-            if (resp) {
-              return resp.list
-            }
-        }
-    },
-    {
-        type:'input',
-        label:'检索:',
-        placeholder:'项目代码/名称',
-        key:'itemFilter'
-    }
-];
-
-export const PatientItemCalcFilterConf = [
-    {
-        type:'input',
-        label:'科室名称:',
-        placeholder:'请输入',
-        key:'departmentFilter'
-    },
-    {
-        type:'input',
-        label:'患者名称:',
-        placeholder:'请输入',
-        key:'patientFilter'
-    }
-];
-
-export const standardItemCostCalcFilterConf = [
-    {
-        type:'select',
-        label:'项目分类:',
-        placeholder:'请选择',
-        key:'itemType',
-        request:async ()=>{
-            const resp = await getDicDataBySysId(KcimCenterSysId,'MED_SERVICE_ITEM_TYPE');
-            if (resp) {
-              return resp.dataVoList.map((a:any) => ({ label: a.name, value: a.code }));
-            }
-        }
-    },
-    {
-        type:'cascader',
-        label:'责任中心:',
-        placeholder:'请选择',
-        key:'responsibility',
-        request:async ()=>{
-            const resp = await await getResponsibilityCenterList({pageSize:500});
-            if (resp) {
-              return resp.list
-            }
-        }
-    },
-    {
-        type:'input',
-        label:'收费项目:',
-        placeholder:'收费项目代码/名称',
-        key:'itemFilter'
-    }
-];
-
-export const patientStandItemCostCalcFilterConf = [
-    {
-        type:'input',
-        label:'科室名称:',
-        placeholder:'请输入',
-        key:'departmentFilter'
-    },
-    {
-        type:'input',
-        label:'患者名称:',
-        placeholder:'请输入',
-        key:'patientFilter'
-    }
-];
-
-export const standItemShareCostCalcFilterConf = [
-    {
-        type:'select',
-        label:'项目分类:',
-        placeholder:'请选择',
-        key:'itemType',
-        request:async ()=>{
-            const resp = await getDicDataBySysId(KcimCenterSysId,'MED_SERVICE_ITEM_TYPE');
-            if (resp) {
-              return resp.dataVoList.map((a:any) => ({ label: a.name, value: a.code }));
-            }
-        }
-    },
-    {
-        type:'cascader',
-        label:'责任中心:',
-        placeholder:'请选择',
-        key:'responsibility',
-        request:async ()=>{
-            const resp = await await getResponsibilityCenterList({pageSize:500});
-            if (resp) {
-              return resp.list
-            }
-        }
-    },
-    {
-        type:'input',
-        label:'收费项目:',
-        placeholder:'收费项目代码/名称',
-        key:'itemFilter'
-    }
-];
-
-
-

+ 0 - 942
src/pages/costAccounting/calcPageTemplate/index.tsx

@@ -1,942 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-10-29 14:29:21
- * @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
- */
-
-import { createFromIconfontCN } from '@ant-design/icons';
-
-import { DatePicker, Input, Modal, message, Table, Button, Popconfirm } from 'antd';
-import { useEffect, useRef, useState } from 'react';
-
-import { calculateReq, cancelAllocation, cancelIncomeCollection, downloadTemplateReq, generateReportHandle, getAfterCostShareSearchTableData, getAfterIncomeCollectionTableData, getCalcPageTableData, startAllocation, startIncomeCollection } from './service';
-
-import './style.less';
-import moment from 'moment';
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import { ActionType, ProColumns, ProFormCascader, ProFormSelect } from '@ant-design/pro-components';
-import { formatMoneyNumber, formatToPercentage } from '@/utils/format';
-
-
-import { afterCollectionSearch, afterCostShareSearch, beforeCollectionSearch, beforeCostShareSearch, chargeItemCostCalc, clinicalPathway, costShare, costShareReportTable, departmentCostCalculate, departmentOperatingReport, diseaseCostCalculation, DRG_DIPCostCalc, incomeCollection, medicalMaterialCostCalc, medicalOrderItem, patientCostCalc, projectShareParamsCalc, unitPersonnelCostCalc, wholeHospCostCalculate, wholeHospOperatingReport } from './columns';
-import { afterCollectionSearchFilterConf, afterCostShareSearchFilterConf, beforeCollectionSearchFilterConf, beforeCostShareSearchFilterConf, chargeItemCostCalcFilterConf, clinicalPathwayFilterConf, departmentCostCalculateFilterConf, diseaseCostCalculationFilterConf, DRG_DIPCostCalcFilterConf, medicalMaterialCostCalcFilterConf, medicalOrderItemFilterConf, patientCostCalcFilterConf, PatientItemCalcFilterConf, patientStandItemCostCalcFilterConf, projectCostCalcFilterConf, projectShareParamsCalcFilterConf, standardItemCostCalcFilterConf, standItemShareCostCalcFilterConf, unitPersonnelCostCalcFilterConf } from './config';
-
-import ProgressModal from '@/components/ProgressModal';
-
-import ExportProgressModal from '@/pages/reportExport/report/ExportProgressModal';
-import exportTableToExcel from '@/utils/tableToExcel';
-
-import { useAccess, useParams } from '@umijs/max'
-import { useModel } from '@umijs/max';
-import { getParamsDataBySysId } from '@/services/getDic';
-
-
-const IconFont = createFromIconfontCN({
-  scriptUrl: '',
-});
-
-const calTypeStr = `ITEM_COST_CALCULATE${(new Date()).getTime()}`;
-
-let currentPage = 0;
-let totalTableData: any[] = [];
-
-
-function transformChildToChildren(data: any[]) {
-  return data.map(item => {
-    let newItem = { ...item };
-
-    // 如果有子项,将 'child' 属性改为 'children'
-    if (newItem.child) {
-      newItem.children = transformChildToChildren(newItem.child);
-      delete newItem.child; // 删除原始的 'child' 属性
-    }
-
-    return newItem;
-  });
-}
-
-
-const getNextUnexpandedKeys = (data: any[], expandedKeys: any[] = []) => {
-  let keys: any[] = [];
-
-  const traverse = (nodes: any) => {
-    for (const node of nodes) {
-      // 如果当前节点还没有展开,就把它加入 keys
-      if (!expandedKeys.includes(node.id)) {
-        keys.push(node.id);
-      }
-
-      // 如果当前节点已经展开,继续遍历子节点
-      if (node.children && expandedKeys.includes(node.id)) {
-        traverse(node.children);
-      }
-    }
-  };
-
-  traverse(data);
-
-  return keys;
-};
-
-export default function calcPageTemplate() {
-  const { initialState, setInitialState } = useModel('@@initialState');
-  const [computeDate, set_computeDate] = useState<string>(initialState ? initialState.computeDate : '');
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any>({ computeDate });
-  const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState('');
-  const tableRef = useRef<ActionType>();
-  const [loading, set_loading] = useState(false);
-  const params = useParams();
-  const [columns, set_columns] = useState<ProColumns[]>([]);
-  const [filterConf, set_filterConf] = useState<any[]>([]);
-  const [scrollX, set_scrollX] = useState(500);
-  const [ifShowCalcBtn, set_ifShowCalcBtn] = useState(true);
-  const [totalCount, set_totalCount] = useState<undefined | number>(undefined);
-  const [inputValues, setInputValues] = useState<{ [key: string]: any }>({});
-  const [btnAccessStr, set_btnAccessStr] = useState<undefined | string>(undefined);
-
-  const access = useAccess();
-
-  const [isModalVisible, setIsModalVisible] = useState(false);
-  const [openProcessModal, set_openProcessModal] = useState(false);
-  const [allParentsKeys, set_allParentsKeys] = useState<any[]>([]);
-  const [dataSource, set_dataSource] = useState<any[]>([]);
-
-
-
-  const getTableData = async (params: any) => {
-
-    const resp = await getCalcPageTableData({ ...params, ...tableDataFilterParams });
-    if (resp) {
-      try {
-        if (params.calcPageKey == 'projectShareParamsCalc' || params.calcPageKey == 'projectCostCalc' || params.calcPageKey == 'patientItemCalc' || params.calcPageKey == 'standardItemCostCalc' || params.calcPageKey == 'patientStandItemCostCalc' || params.calcPageKey == 'standItemShareCostCalc') {
-          const { pageData: { list = [], pageSize, totalCount, totalPage }, title } = resp;
-          const columns: ProColumns[] = title.map((item: any, index: number) => {
-            return {
-              title: item.name,
-              dataIndex: `${item.code}`,
-              key: `${item.code}`,
-              // width: getStringWidth(item.name, '14px'),
-              ellipsis: true,
-              fixed: item.freeze ? true : false,
-              hideInTable: item.hide,
-              align: item.dataType == 3 ? 'right' : 'left',
-              sorter: item.sortStatus ? (a: any, b: any) => {
-                if (item.dataType == 3) {
-                  //数值
-                  return b[`${item.code}`] - (a[`${item.code}`]);
-                } else {
-                  return b[`${item.code}`]?.localeCompare(a[`${item.code}`]);
-                }
-              } : undefined,
-            }
-          });
-          set_columns([...columns]);
-
-          const data = list.map((item: any) => {
-
-            let rowData: { [key: string]: any } = {};
-
-            item.forEach((b: any) => {
-              const needTitle = title.filter((a: any) => a.code == b.code);
-              if (needTitle.length > 0) {
-                rowData[`${needTitle[0].code}`] = b.value
-              }
-            });
-
-
-            return { ...item, ...rowData, id: Math.random(), columns }
-          });
-
-          return {
-            data: data,
-            success: true,
-            total: totalCount,
-            pageSize: pageSize,
-            totalPage: totalPage,
-          }
-
-        }
-        let data = (resp.list && resp.list != null) ? resp.list : (Array.isArray(resp) ? resp : []);
-        if (params.calcPageKey == 'unitPersonnelCostCalc') {
-          data = data ? data.map((a: any) => ({ ...a, children: a.childList })) : []
-        }
-        if (params.calcPageKey == 'wholeHospCostCalculate') {
-          data = data ? transformChildToChildren(data) : [];
-          set_dataSource(data);
-        }
-        if (params.calcPageKey == 'beforeCollectionSearch' || params.calcPageKey == 'beforeCostShareSearch' || params.calcPageKey == 'afterCostShareSearch' || params.calcPageKey == 'afterCollectionSearch') {
-          const { totalAmount = 0 } = resp;
-          set_totalCount(totalAmount);
-        } else {
-          set_totalCount(undefined);
-        }
-
-        return {
-          data,
-          success: true,
-          total: resp.totalCount,
-          pageSize: resp.pageSize,
-          totalPage: resp.totalPage,
-
-        };
-
-      } catch (err) {
-        console.log({ err })
-      }
-    }
-    return [];
-  };
-
-  const tableDataSearchHandle = (paramName: string) => {
-
-    set_tableDataFilterParams({
-      ...tableDataFilterParams,
-      [`${paramName}`]: inputValues[`${paramName}`]
-    })
-
-  }
-
-  const calcFunc = () => {
-
-    Modal.confirm({
-      title: '注意',
-      content: '计算操作会覆盖当月已计算的数据,是否继续操作?',
-      okText: '确定',
-      cancelText: '取消',
-      onOk: async (...args) => {
-
-        if (params.calcPageKey != 'chargeItemCostCalc') {
-          set_loading(true);
-          const resp = await calculateReq(computeDate, params.calcPageKey);
-          if (resp) {
-            set_loading(false);
-            message.success('操作成功!');
-            tableRef.current?.reload();
-          } else {
-            set_loading(false);
-          }
-        }
-
-
-        if (params.calcPageKey == 'chargeItemCostCalc') {
-          a();
-          return false;
-        }
-
-      },
-    })
-  }
-
-  const a = async () => {
-    setIsModalVisible(true);
-    const resp = await calculateReq(computeDate, params.calcPageKey, calTypeStr);
-
-    if (resp) {
-      setIsModalVisible(false);
-    } else {
-      setIsModalVisible(false);
-    }
-    tableRef.current?.reload();
-  }
-
-  const generateFilterItems = (configs: any[]) => {
-    const nodes = configs.map((item: any) => {
-      const { type, key, label, placeholder, request } = item;
-      if (type == 'input') {
-        return (
-          <div className='filterItem' style={{ marginLeft: 16, width: 205 }}>
-            <span className='label' style={{ whiteSpace: 'nowrap' }}>{label}</span>
-            <Input placeholder={`${placeholder}`} allowClear autoComplete='off'
-              suffix={
-                <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle(`${key}`)} />
-              }
-              value={inputValues[`${key}`] || ''}
-              onChange={(e) => {
-                setInputValues(prevValues => ({
-                  ...prevValues,
-                  [key]: e.target.value
-                }));
-                if (e.target.value.length == 0) {
-                  set_tableDataFilterParams({
-                    ...tableDataFilterParams,
-                    [`${key}`]: ''
-                  });
-                }
-              }}
-
-              onPressEnter={(e) => {
-                set_tableDataFilterParams({
-                  ...tableDataFilterParams,
-                  [`${key}`]: ((e.target) as HTMLInputElement).value
-                });
-              }}
-
-            />
-          </div>
-        )
-      }
-      if (type == 'select') {
-
-        return (
-          <div className='filterItem' style={{ marginLeft: 16 }}>
-            <span className='label'>{label}</span>
-            <ProFormSelect
-              noStyle
-              allowClear
-              placeholder="请选择"
-              style={{ width: 160, marginRight: 16 }}
-              request={async () => {
-                const arr = await request();
-                if (arr) return arr
-                return [];
-              }}
-
-              fieldProps={{
-                onChange(value, option) {
-                  set_tableDataFilterParams({ ...tableDataFilterParams, [`${key}`]: value })
-                },
-
-              }}
-            />
-          </div>
-        )
-      }
-      if (type == 'cascader') {
-
-        return (
-          <div className='filterItem' style={{ marginLeft: 16 }}>
-            <span className='label'>{label}</span>
-            <ProFormCascader
-              noStyle
-              allowClear
-
-              placeholder="请选择"
-              request={async () => {
-                const resp = await request();
-                if (resp) {
-                  return resp
-                }
-                return [];
-              }}
-              fieldProps={{
-                showSearch: true,
-                fieldNames: { label: 'responsibilityName', value: 'responsibilityCode', children: 'child' },
-                onChange(value: any, option: any) {
-                  set_tableDataFilterParams({ ...tableDataFilterParams, [`${key}`]: value ? value[value.length - 1] : null })
-                },
-              }}
-            />
-          </div>
-        )
-      }
-      return <></>
-    });
-
-    return nodes;
-  }
-
-
-  const optionBtnGroupshandle = async (isCollection: boolean, record: any) => {
-
-    if (params.calcPageKey == 'incomeCollection') {
-      const { year, month } = record;
-      if (isCollection) {
-        const resp = await cancelIncomeCollection({ year, month });
-        if (resp) {
-          message.success('操作成功!');
-          tableRef.current?.reload();
-        }
-      } else {
-        Modal.confirm({
-          title: '注意',
-          content: '收入归集操作会覆盖已有的归集后数据,确定要继续操作?',
-          okText: '确定',
-          cancelText: '取消',
-          onOk: async (...args) => {
-            set_loading(true);
-            const resp = await startIncomeCollection({ year, month });
-            if (resp) {
-
-              set_loading(false);
-              message.success('操作成功!');
-              tableRef?.current?.reload();
-            } else {
-              set_loading(false);
-            }
-          },
-        })
-      }
-    }
-    if (params.calcPageKey == 'costShare') {
-      const { year, month } = record;
-      if (!isCollection) {
-        //开始分摊
-        Modal.confirm({
-          title: '注意',
-          content: '成本分摊操作会覆盖已有的分摊后数据,确定要继续操作?',
-          okText: '确定',
-          cancelText: '取消',
-          onOk: async (...args) => {
-            set_loading(true);
-            const resp = await startAllocation({ year, month });
-            if (resp) {
-
-              set_loading(false);
-              message.success('操作成功!');
-              tableRef?.current?.reload();
-            } else {
-              set_loading(false);
-            }
-          },
-        })
-
-      }
-      if (isCollection) {
-        //撤销分摊
-        const resp = await cancelAllocation({ year, month });
-        if (resp) message.success('操作成功!');
-        tableRef?.current?.reload();
-      }
-
-
-    }
-
-  }
-
-
-  const openDataTable = async () => {
-    set_loading(true);
-    try {
-      const { responsibilityCode = null } = tableDataFilterParams;
-      let resp: any = undefined;
-      if (params.calcPageKey == 'afterCostShareSearch') {
-        resp = await getAfterCostShareSearchTableData(
-          { year: `${computeDate}-01`, responsibilityCode }
-        );
-      }
-      if (params.calcPageKey == 'afterCollectionSearch') {
-        resp = await getAfterIncomeCollectionTableData(
-          { ...params, date: `${computeDate.replace(/-/g, '')}` }
-        );
-      }
-
-      if (resp) {
-        const { titleMap = {}, realData = [], totalMap = {} } = resp;
-        const titleMapToArr = Object.entries(titleMap);
-        const totalMapToArr = Object.entries(totalMap);
-        const columns = [...titleMapToArr].map((item, index) => {
-          if (index == 0 || index == [...titleMapToArr].length - 1) {
-            return {
-              title: item[1],
-              key: item[0],
-              dataIndex: item[0],
-              fixed: index == 0 ? 'left' : 'right',
-              width: 150,
-            }
-          }
-          return {
-            title: item[1],
-            dataIndex: item[0],
-            key: item[0],
-            width: 150,
-          }
-        });
-        set_loading(false);
-        Modal.info({
-          title: '报表数据',
-          icon: '',
-          okText: '确定',
-          width: 800,
-          content: (
-            <KCIMTable
-              rowKey='id'
-              scroll={{ x: (columns.length) * 150, y: 450 }}
-              columns={columns as ProColumns[]}
-              dataSource={[...realData]}
-              pagination={false}
-              summary={() => (
-                <Table.Summary fixed >
-                  <Table.Summary.Row className="rowCell">
-                    {/* <Table.Summary.Cell className="firstCell" index={0}>合计</Table.Summary.Cell> */}
-                    {
-                      totalMapToArr.map((item, index) => {
-                        return (
-                          <Table.Summary.Cell key={index} className={index == totalMapToArr.length - 1 ? 'ant-table-cell ant-table-cell-fix-right ant-table-cell-fix-right-last' : 'cell'} index={index}>{item[1] as any}</Table.Summary.Cell>
-                        )
-                      })
-                    }
-                  </Table.Summary.Row>
-                </Table.Summary>
-              )}
-            />
-          )
-        })
-
-      }
-    } catch (err) {
-      console.log({ err });
-    }
-
-
-  }
-
-  const generateReport = async () => {
-    // {date:computeDate,reportType:0}
-    if (params.calcPageKey == 'departmentOperatingReport') {
-      const resp = await generateReportHandle({ date: `${computeDate}-01`, reportType: 0 }, '/costAccount/costdepartmentprofit/getDepartProfitReport');
-      if (resp) {
-        tableRef.current?.reload();
-      }
-    }
-    if (params.calcPageKey == 'wholeHospOperatingReport') {
-      const resp = await generateReportHandle({ date: `${computeDate}-01`, reportType: 0 }, '/costAccount/hospProfitAndLoss/report');
-      if (resp) {
-        tableRef.current?.reload();
-      }
-    }
-    if (params.calcPageKey == 'costShareReportTable') {
-      const resp = await generateReportHandle({ date: `${computeDate}-01`, reportType: 0 }, '/costAccount/hospProfitAndLoss/report');
-      if (resp) {
-        tableRef.current?.reload();
-      }
-    }
-
-  }
-
-  const handleCompletion = () => {
-    setIsModalVisible(false);
-  };
-
-  const handleExportCompletion = () => {
-    currentPage = 0;
-    set_openProcessModal(false);
-    exportHandle(params.calcPageKey == 'wholeHospCostCalculate' ? 'reportName' : undefined);
-  }
-
-
-
-  const exportHandle = (indentColumn?: string) => {  // 将 indentColumn 设置为可选参数
-    let headers: { [key: string]: any } = {};
-    let data: any[] = [];
-
-    // 生成表头
-    columns.forEach(a => {
-      headers[`${a.dataIndex}`] = a.title;
-    });
-
-    // 递归处理数据,支持嵌套的 children,并为指定列添加缩进
-    const processData = (items: any[], level: number = 0) => {
-      items.forEach(item => {
-        let _temp: { [key: string]: any } = {};
-
-        Object.keys(headers).forEach(key => {
-          if (indentColumn && key === indentColumn) {  // 检查是否需要缩进
-            // 使用 Unicode 不可见空格来缩进
-            _temp[`${key}`] = `${'\u00A0'.repeat(level * 4)}${item[`${key}`]}`; // 使用4个不可见空格字符缩进
-          } else if (item.children && item.children.length > 0 && (params.calcPageKey != 'wholeHospCostCalculate')) {
-            // 如果有 children,返回空字符串来保持 Excel 也为空
-            _temp[`${key}`] = '';
-          } else {
-            if (params.calcPageKey == 'wholeHospCostCalculate') {
-              if (key == 'amount') {
-                _temp[`${key}`] = (item[`${key}`] != undefined||item[`${key}`] != null) ? formatMoneyNumber(item[`${key}`]) : item[`${key}`];
-              }
-              if (key == 'percent') {
-                _temp[`${key}`] = (item[`${key}`] != undefined||item[`${key}`] != null) ? formatToPercentage(item[`${key}`]) : item[`${key}`];
-              }
-            } else {
-              _temp[`${key}`] = item[`${key}`];
-            }
-
-          }
-        });
-
-        data.push(_temp);
-
-        // 递归处理子项,增加缩进层级
-        if (item.children && item.children.length > 0) {
-          processData(item.children, level + 1);
-        }
-      });
-    };
-
-    // 开始处理数据
-    processData(totalTableData);
-
-    // 导出数据到 Excel
-    exportTableToExcel(data, columns as any[], params.calcPageKey == 'wholeHospCostCalculate' ? '全院损益报表' : '项目成本计算');
-
-    // 清空当前页和总数据
-    currentPage = 0;
-    totalTableData = [];
-    // tableRef.current?.reload();
-  };
-
-
-
-
-  const fetchExportData = async () => {
-
-    currentPage = currentPage + 1;
-
-    const resp: any = await getTableData({ ...tableDataFilterParams, current: currentPage, pageSize: 100 });
-
-    if (resp) {
-      const { total = 0, data } = resp;
-      totalTableData = [...totalTableData, ...data];
-      return {
-        currentCount: totalTableData.length,
-        totalCount: total,
-      }
-
-    } else {
-      return { currentCount: 0, totalCount: 0 };
-    }
-  };
-
-  const handleExpandNext = () => {
-    // 当前所有未展开的节点,第一层优先展开
-    const keysToExpand = getNextUnexpandedKeys(dataSource, allParentsKeys);
-    set_allParentsKeys((prev) => Array.from(new Set([...prev, ...keysToExpand])));
-  };
-
-  const handleCollapseAll = () => {
-    set_allParentsKeys([]);
-  };
-
-
-  const getIfshowPercent = async ()=>{
-    const {systemId} = JSON.parse(localStorage.getItem('currentSelectedTab') as string)
-    const resp = await getParamsDataBySysId(systemId,'1851077044079824896');
-    if(resp){
-        return resp.value == '1'?true:false
-    }
-  }
-
-
-
-  useEffect(() => {
-    setInputValues({});
-    const { calcPageKey } = params;
-    if (calcPageKey == "chargeItemCostCalc") {
-      set_columns(chargeItemCostCalc);
-      set_filterConf(chargeItemCostCalcFilterConf);
-      set_ifShowCalcBtn(true);
-      set_scrollX(1500);
-    }
-    if (calcPageKey == "standardItemCostCalc") {
-
-      set_filterConf(standardItemCostCalcFilterConf);
-      set_ifShowCalcBtn(true);
-      set_scrollX(1500);
-    }
-    if (calcPageKey == "patientStandItemCostCalc") {
-
-      set_filterConf(patientStandItemCostCalcFilterConf);
-      set_ifShowCalcBtn(true);
-      set_scrollX(1500);
-    }
-    if (calcPageKey == "standItemShareCostCalc") {
-
-      set_filterConf(standItemShareCostCalcFilterConf);
-      set_ifShowCalcBtn(true);
-      set_scrollX(1500);
-    }
-    if (calcPageKey == "patientItemCalc") {
-      set_scrollX(1500);
-      set_filterConf(PatientItemCalcFilterConf);
-      set_ifShowCalcBtn(true);
-    }
-    if (calcPageKey == "patientCostCalc") {
-      set_columns(patientCostCalc);
-      set_scrollX(1500);
-      set_filterConf(patientCostCalcFilterConf);
-      set_ifShowCalcBtn(true);
-    }
-    if (calcPageKey == "unitPersonnelCostCalc") {
-      set_columns(unitPersonnelCostCalc);
-      set_scrollX(1000);
-      set_filterConf(unitPersonnelCostCalcFilterConf);
-      set_ifShowCalcBtn(true);
-    }
-    if (calcPageKey == "diseaseCostCalculation") {
-      set_columns(diseaseCostCalculation);
-      set_scrollX(1500);
-      set_filterConf(diseaseCostCalculationFilterConf);
-      set_ifShowCalcBtn(true);
-    }
-    if (calcPageKey == "DRG_DIPCostCalc") {
-      set_columns(DRG_DIPCostCalc);
-      set_scrollX(1500);
-      set_filterConf(DRG_DIPCostCalcFilterConf);
-      set_ifShowCalcBtn(true);
-    }
-    if (calcPageKey == "clinicalPathway") {
-      set_columns(clinicalPathway);
-      set_scrollX(1500);
-      set_filterConf(clinicalPathwayFilterConf);
-      set_ifShowCalcBtn(true);
-    }
-    if (calcPageKey == "medicalOrderItem") {
-      set_columns(medicalOrderItem);
-      set_scrollX(1500);
-      set_filterConf(medicalOrderItemFilterConf);
-      set_ifShowCalcBtn(true);
-    }
-    if (calcPageKey == "beforeCollectionSearch") {
-      set_columns(beforeCollectionSearch);
-      set_scrollX(1500);
-      set_filterConf(beforeCollectionSearchFilterConf);
-      set_ifShowCalcBtn(false);
-    }
-    if (calcPageKey == "incomeCollection") {
-      set_columns([...incomeCollection, {
-        title: '操作',
-        dataIndex: 'option',
-        width: 90,
-        renderText(text, record) {
-          const { isCollection } = record;
-          return <a style={{ fontSize: 14 }} onClick={() => {
-            optionBtnGroupshandle(isCollection, record);
-          }}>{isCollection ? '撤销归集' : '开始归集'}</a>
-        },
-      }]);
-      set_filterConf([]);
-      set_ifShowCalcBtn(false);
-      set_scrollX(600);
-    }
-    if (calcPageKey == "afterCollectionSearch") {
-      set_columns([...afterCollectionSearch]);
-      set_filterConf(afterCollectionSearchFilterConf);
-      set_ifShowCalcBtn(false);
-      set_scrollX(1300);
-    }
-    if (calcPageKey == "beforeCostShareSearch") {
-      set_columns([...beforeCostShareSearch]);
-      set_filterConf(beforeCostShareSearchFilterConf);
-      set_ifShowCalcBtn(false);
-      set_scrollX(1300);
-
-    }
-
-    if (calcPageKey == "costShare") {
-      set_columns([...costShare, {
-        title: '操作',
-        align: 'right',
-        dataIndex: 'option',
-        width: '15%',
-        render: (_, record) => {
-          const { isAllocation: isCollection } = record;
-          return !isCollection?
-          <a style={{ fontSize: 14 }}  onClick={() => optionBtnGroupshandle(isCollection, record)}>{isCollection ? '撤销' : '分摊'}</a>
-          :[
-            <Popconfirm
-              title={`是否确认撤销?`}
-              key="del"
-              onConfirm={() => optionBtnGroupshandle(isCollection, record)}
-            >
-              <a style={{ fontSize: 14 }}>{isCollection ? '撤销' : '分摊'}</a>
-            </Popconfirm>
-
-          ]
-        },
-      }]);
-      set_filterConf([]);
-      set_ifShowCalcBtn(false);
-      set_scrollX(600);
-    }
-    if (calcPageKey == "afterCostShareSearch") {
-      set_columns([...afterCostShareSearch]);
-      set_filterConf(afterCostShareSearchFilterConf);
-      set_ifShowCalcBtn(false);
-      set_scrollX(1000);
-    }
-
-    if (calcPageKey == "medicalMaterialCostCalc") {
-      set_columns([...medicalMaterialCostCalc]);
-      set_filterConf(medicalMaterialCostCalcFilterConf);
-      set_ifShowCalcBtn(true);
-      set_scrollX(1200);
-    }
-
-    if (calcPageKey == "departmentCostCalculate") {
-      set_columns([...departmentCostCalculate]);
-      set_filterConf(departmentCostCalculateFilterConf);
-      set_ifShowCalcBtn(true);
-    }
-    if (calcPageKey == "wholeHospCostCalculate") {
-      getIfshowPercent().then((resp)=>{
-        set_columns(resp?[...wholeHospCostCalculate]:[...(wholeHospCostCalculate.filter(a=>a.title != '占比'))]);
-      })
-      set_filterConf([]);
-      set_ifShowCalcBtn(true);
-      const tabs = access.whatCanIDoInThisPage(location.pathname.replace('/CostAccountingSys', ''));
-      const a = tabs.reduce((prev: any, cur: any) => `${prev},${cur.code}`, '');
-      set_btnAccessStr(a);
-    }
-    if (calcPageKey == "costShareReportTable") {
-      set_columns([...costShareReportTable, {
-        title: '操作',
-        dataIndex: 'option',
-        width: '15%',
-        render: (_, record) => {
-          const { year, month, shareLevel, shareLevelId } = record;
-          return [
-            <a style={{ fontSize: 14 }} onClick={async () => {
-              downloadTemplateReq('/costAccount/excel/getShareReportTemplate', { year, month, levelSort: shareLevel, shareLevelId });
-              //const resp = await downloadReportHandle({ year, month, levelSort:shareLevel, shareLevelId });
-            }}>下载</a>
-          ]
-        },
-      }]);
-      set_filterConf([]);
-      set_ifShowCalcBtn(false);
-    }
-    if (calcPageKey == "departmentOperatingReport") {
-      set_columns([...departmentOperatingReport, {
-        title: '操作',
-        dataIndex: 'option',
-        width: 100,
-        render: (_, record) => {
-          const { fileUrl = '' } = record;
-          return [
-            <a style={{ fontSize: 14 }} onClick={async () => window.open(fileUrl)}>下载</a>
-          ]
-        },
-      }]);
-      set_filterConf([]);
-      set_ifShowCalcBtn(false);
-    }
-    if (calcPageKey == "wholeHospOperatingReport") {
-      set_columns([...wholeHospOperatingReport, {
-        title: '操作',
-        dataIndex: 'option',
-        width: 100,
-        render: (_, record) => {
-          const { fileUrl } = record;
-          return [
-            <a style={{ fontSize: 14 }} onClick={async () => {
-              window.open(fileUrl);
-            }}>下载</a>
-          ]
-        },
-      }]);
-      set_filterConf([]);
-      set_ifShowCalcBtn(false);
-    }
-    if (calcPageKey == "projectShareParamsCalc") {
-      set_filterConf([...projectShareParamsCalcFilterConf]);
-      set_ifShowCalcBtn(true);
-      set_scrollX(1600);
-      set_totalCount(undefined);
-    }
-    if (calcPageKey == "projectCostCalc") {
-
-      set_filterConf([...projectCostCalcFilterConf]);
-
-      const tabs = access.whatCanIDoInThisPage(location.pathname.replace('/CostAccountingSys', ''));
-      const a = tabs.reduce((prev: any, cur: any) => `${prev},${cur.code}`, '');
-      set_btnAccessStr(a);
-      set_ifShowCalcBtn(a.indexOf('calculate') != -1);
-      set_scrollX(1200);
-    }
-
-
-    set_tableDataFilterParams({ ...tableDataFilterParams, computeDate, calcPageKey, reportType: calcPageKey == 'wholeHospCostCalculate' ? 3 : tableDataFilterParams.reportType });
-
-  }, [params]);
-
-
-
-  return (
-    <KCIMPagecontainer className="calcPageTemplate" title={false}>
-      <ProgressModal
-        title='计算进度'
-        type={calTypeStr}
-        onComplete={handleCompletion}
-        visible={isModalVisible}
-      />
-      <ExportProgressModal
-        visible={openProcessModal}
-        onCancel={() => set_openProcessModal(false)}
-        fetchData={fetchExportData}
-        onCompletion={handleExportCompletion}
-      />
-      <div className="toolBar">
-        <div className="filter">
-          <div className="filterItem">
-            {
-              <div className="search">
-                <span>核算年月:</span>
-                <DatePicker
-                  onChange={(data, dateString) => {
-                    set_computeDate(dateString);
-                    setInitialState((s: any) => ({ ...s, computeDate: dateString }));
-                    set_tableDataFilterParams({
-                      ...tableDataFilterParams,
-                      computeDate: dateString,
-                    });
-                  }}
-                  picker="month"
-                  locale={locale}
-                  defaultValue={moment(computeDate, 'YYYY-MM')}
-                  format="YYYY-MM"
-                  autoComplete='off'
-                  placeholder="选择年月"
-                />
-              </div>
-            }
-          </div>
-          {generateFilterItems(filterConf)}
-        </div>
-        <div className="btnGroup">
-          {params.calcPageKey == 'wholeHospCostCalculate' && (
-            <>
-              <span className='btn' onClick={() => handleCollapseAll()}>全部折叠</span>
-              <span className='btn' style={{ marginRight: 16 }} onClick={() => handleExpandNext()}>展开下一层</span>
-            </>
-          )}
-          {((params.calcPageKey == 'projectCostCalc' || params.calcPageKey == 'wholeHospCostCalculate') && btnAccessStr ? (btnAccessStr.indexOf('export') != -1) : false) && <a className='export' onClick={() => set_openProcessModal(true)}>导出</a>}
-          {ifShowCalcBtn && <a className='calc' onClick={() => calcFunc()}>计算</a>}
-          {(params.calcPageKey == 'afterCostShareSearch' || params.calcPageKey == 'afterCollectionSearch') && (<Button loading={loading} size='small' className='reportDataBtn' onClick={() => openDataTable()}>报表数据</Button>)}
-          {(params.calcPageKey == 'departmentOperatingReport' || params.calcPageKey == 'wholeHospOperatingReport') && (<span className='reportDataBtn' onClick={() => generateReport()}>生成报表</span>)}
-        </div>
-      </div>
-      <div style={{ marginTop: 16 }}>
-
-        <KCIMTable
-          columns={columns}
-          actionRef={tableRef}
-          rowKey="id"
-          expandable={params.calcPageKey == 'wholeHospCostCalculate' ? {
-            defaultExpandAllRows: true, expandedRowKeys: allParentsKeys,
-            onExpand(expanded, record) {
-              const { id } = record;
-              if (!expanded) {
-                const expandedKeys = allParentsKeys.filter(a => a != id);
-                set_allParentsKeys([...expandedKeys]);
-              } else {
-                set_allParentsKeys([...allParentsKeys, id]);
-              }
-            },
-          } : undefined}
-          rowClassName={params.calcPageKey == 'wholeHospCostCalculate' ? ((record) => (record.children ? 'has-children hover-row' : 'hover-row')) : ''}
-          scroll={{ x: scrollX, y: params.calcPageKey == 'afterCostShareSearch' ? `calc(100vh - 270px)` : `calc(100vh - 233px)` }}
-          params={tableDataFilterParams}
-          request={(params) => getTableData(params)}
-          pagination={params.calcPageKey == 'wholeHospCostCalculate' ? false : undefined}
-        />
-        {
-          totalCount != undefined && <a style={{ marginTop: 16, display: 'inline-block' }}>{`合计:${formatMoneyNumber(totalCount)}`}</a>
-        }
-      </div>
-    </KCIMPagecontainer>
-  );
-}

+ 0 - 401
src/pages/costAccounting/calcPageTemplate/service.ts

@@ -1,401 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-05 15:53:30
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import axios from 'axios';
-import { request } from 'umi';
-
-//获取table列表数据
-
-export const getCalcPageTableData = (params: any) => {
-
-  const {calcPageKey,...next} = params;
-  
-  if(calcPageKey == 'unitPersonnelCostCalc'){
-    return request('/costAccount/calculate/empCostCalculateList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'patientCostCalc'){
-    return request('/costAccount/calculate/patientCostCalculateList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'chargeItemCostCalc'){
-    return request('/costAccount/calculate/itemCostCalculateList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'diseaseCostCalculation'){
-    return request('/costAccount/calculate/diseaseCostCalculateList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'DRG_DIPCostCalc'){
-    return request('/costAccount/calculate/groupCostCalculateList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'clinicalPathway'){
-    return request('/costAccount/calculate/clinicalPathwayCostCalculateList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'medicalOrderItem'){
-    return request('/costAccount/calculate/orderCostCalculateList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'beforeCollectionSearch'){
-    return request('/costAccount/costincomegroup/list', {
-      method: 'GET',
-      params:{...next,dateTime:next.computeDate,computeDate:null}
-    });
-  }
-  if(calcPageKey == 'incomeCollection'){
-    return request('/costAccount/incomeCollection/getCollections', {
-      method: 'GET',
-      params:{...next,date:(next.computeDate).replace('-', ''),computeDate:null}
-    });
-  }
-  if(calcPageKey == 'afterCollectionSearch'){
-    return request('/costAccount/incomeCollection/collectList', {
-      method: 'GET',
-      params:{...next,date:(next.computeDate).replace('-', ''),computeDate:null}
-    });
-  }
-  if(calcPageKey == 'beforeCostShareSearch'){
-    return request('/costAccount/costcostinggroup/queryStartAllocation', {
-      method: 'GET',
-      params:{...next,date:next.computeDate,computeDate:null}
-    });
-  }
-  if(calcPageKey == 'costShare'){
-    return request('/costAccount/costcostinggroup/allocationList', {
-      method: 'GET',
-      params:{...next,date:`${next.computeDate}-01`,computeDate:null}
-    });
-  }
-  if(calcPageKey == 'afterCostShareSearch'){
-    return request('/costAccount/costcostinggroup/queryAfterAllocation', {
-      method: 'GET',
-      params:{...next,year:`${next.computeDate}-01`,computeDate:null}
-    });
-  }
-  if(calcPageKey == 'departmentCostCalculate'){
-    return request('/costAccount/costdepartmentprofit/list', {
-      method: 'GET',
-      params:{...next,date:`${next.computeDate}-01`,computeDate:null}
-    });
-  }
-  if(calcPageKey == 'wholeHospCostCalculate'){
-    return request('/costAccount/hospProfitAndLoss/getHospProfitList', {
-      method: 'GET',
-      params:{...next,computeDate:`${next.computeDate}-01`}
-    });
-  }
-  if(calcPageKey == 'costShareReportTable'){
-    return request('/costAccount/costcostinggroup/afterAllocationFormList', {
-      method: 'GET',
-      params:{...next,date:`${next.computeDate}-01`,computeDate:null}
-    });
-  }
-  if(calcPageKey == 'wholeHospOperatingReport'){
-    return request('/costAccount/hospProfitAndLoss/hospReports', {
-      method: 'GET',
-      params:{...next,date:`${next.computeDate}-01`,computeDate:null}
-    });
-  }
-  if(calcPageKey == 'departmentOperatingReport'){
-    return request('/costAccount/departmentprofitfile/list', {
-      method: 'GET',
-      params:{...next,date:`${next.computeDate}-01`,computeDate:null}
-    });
-  }
-  if(calcPageKey == 'medicalMaterialCostCalc'){
-    return request('/costAccount/calculate/drugMaterialCostCalculateList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'projectShareParamsCalc'){
-    return request('/costAccount/calculate/getShareParamCostList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'projectCostCalc'){
-    return request('/costAccount/calculate/getItemCostList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'patientItemCalc'){
-    return request('/costAccount/calculate/getPatientItemCostList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'standardItemCostCalc'){
-    return request('/costAccount/calculate/getStandItemCostList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'patientStandItemCostCalc'){
-    return request('/costAccount/calculate/getPatientStandItemCostList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-  if(calcPageKey == 'standItemShareCostCalc'){
-    return request('/costAccount/calculate/getStandShareParamCostList', {
-      method: 'GET',
-      params:{...next}
-    });
-  }
-};
-
-//计算
-export const calculateReq = (computeDate: string,calcPageKey: string | undefined,type?:string) => {
-  if(calcPageKey == 'unitPersonnelCostCalc'){
-    return request('/costAccount/calculate/empCostCalculate', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'patientCostCalc'){
-    return request('/costAccount/calculate/patientCostCalculate', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'patientItemCalc'){
-    return request('/costAccount/calculate/computePatientItemCost', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'chargeItemCostCalc'){
-    return request('/costAccount/calculate/itemCostCalculate', {
-      method: 'POST',
-      params:{computeDate,type}
-    });
-  }
-  if(calcPageKey == 'diseaseCostCalculation'){
-    return request('/costAccount/calculate/diseaseCostCalculate', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'DRG_DIPCostCalc'){
-    return request('/costAccount/calculate/groupCostCalculate', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'clinicalPathway'){
-    return request('/costAccount/calculate/clinicalPathwayCostCalculate', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'medicalOrderItem'){
-    return request('/costAccount/calculate/orderCostCalculate', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'departmentCostCalculate'){
-    return request('/costAccount/costdepartmentprofit/setDepartmentProfit', {
-      method: 'POST',
-      params:{date:`${computeDate}-01`}
-    });
-  }
-  if(calcPageKey == 'wholeHospCostCalculate'){
-    return request('/costAccount/hospProfitAndLoss/calc', {
-      method: 'POST',
-      params:{date:`${computeDate}-01`}
-    });
-  }
-  if(calcPageKey == 'medicalMaterialCostCalc'){
-    return request('/costAccount/calculate/drugMaterialCostCalculate', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'projectShareParamsCalc'){
-    return request('/costAccount/calculate/computeShareParamCost', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'projectCostCalc'){
-    return request('/costAccount/calculate/computeItemCost', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'standardItemCostCalc'){
-    return request('/costAccount/calculate/computeStandItemCost', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'patientStandItemCostCalc'){
-    return request('/costAccount/calculate/computeStandPatientItemCost', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  if(calcPageKey == 'standItemShareCostCalc'){
-    return request('/costAccount/calculate/computeStandShareParamCost', {
-      method: 'POST',
-      params:{computeDate}
-    });
-  }
-  
-};
-
-//获取科室列表
-export const getCostProjecttList = (params:any) => {
-  const {productName,current,pageSize} = params;
-  return request('/costAccount/product/list', {
-    method: 'GET',
-    params:{
-        name:productName,
-        current,
-        pageSize
-    },
-  });
-}
-
-
-//开始归集
-export const startIncomeCollection = (params:any) => {
-  const {year,month} = params;
-  return request('/costAccount/incomeCollection/collect', {
-    method: 'POST',
-    params:{year,month},
-  });
-}
-
-//撤销归集
-export const cancelIncomeCollection = (body:any) => {
-  const {year,month} = body;
-  return request('/costAccount/incomeCollection/cancelCollect', {
-    method: 'POST',
-    params:{year,month}
-  });
-}
-
-
-//开始分摊
-export const startAllocation = (body:any) => {
-  return request('/costAccount/costcostinggroup/startAllocation', {
-    method: 'POST',
-    data:body,
-  });
-}
-
-//撤销分摊
-export const cancelAllocation = (body:any) => {
-  return request('/costAccount/costcostinggroup/cancelAllocation', {
-    method: 'POST',
-    params:body,
-  });
-}
-
-//获取报表数据列表
-export const getAfterCostShareSearchTableData = (params:any) => {
-  return request('/costAccount/costcostinggroup/queryAfterAllocationForm', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-//获取收入归集后报表数据列表
-export const getAfterIncomeCollectionTableData = (params:any)=> {
-  return request('/costAccount/incomeCollection/collectDataForm', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-//下载报表
-export const downloadReportHandle = (params:any) => {
-  return request('/costAccount/excel/getShareReportTemplate', {
-    method: 'GET',
-    params:{...params},
-  });
-}
-
-//生成报表数据
-export const generateReportHandle = (params:any,path:string) => {
-  return request(path, {
-    method: 'POST',
-    params:{...params},
-  });
-}
-
-
-//下载excel
-export const downloadTemplateReq = (pathStr: string,data:any) => {
-
-
-  let path = `/gateway${pathStr}`;
-
-  const userData = localStorage.getItem('userData');
-  const { token = '' } = JSON.parse(userData as string);
-
-  axios({
-    method: 'get',
-    url: path,
-    responseType: 'blob',
-    headers: { token },
-    params:data
-  })
-    .then(function (response) {
-      //console.log({ 'chunk': response });
-      const filename = decodeURI(response.headers["content-disposition"]);
-      const objectUrl = URL.createObjectURL(
-        new Blob([response.data], {
-          type: 'application/vnd.ms-excel',
-        })
-      )
-      const link = document.createElement('a')
-      // 设置导出的文件名称
-      link.download = `${filename}` + '.xls'
-      link.style.display = 'none'
-      link.href = objectUrl
-      link.click()
-      document.body.appendChild(link)
-
-    });
-
-
-
-}
-
-
-
-
-
-
-
-
-

+ 0 - 93
src/pages/costAccounting/calcPageTemplate/style.less

@@ -1,93 +0,0 @@
-.calcPageTemplate {
-  position: relative;
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-
-      &>span {
-        cursor: pointer;
-        display: inline-block;
-        color: #17181A;
-        line-height: 24px;
-        padding: 0 14px;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-        background: #FAFCFF;
-        margin-right: 8px;
-        font-weight: 400;
-        font-size: 14px;
-        color: #17181A;
-      }
-
-      .calc,
-      .reportDataBtn,
-      .export {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        margin-left: 8px;
-        border-radius: 4px;
-      }
-    }
-
-  }
-
-  .KCIMTable {
-    .hover-row {
-      .hover-icon {
-        visibility: hidden;
-      }
-
-      &:hover {
-        .hover-icon {
-          visibility: visible;
-        }
-      }
-    }
-
-    .cost-ant-table-header {
-      .cost-ant-table-thead {
-        .cost-ant-table-cell {}
-      }
-    }
-
-    .cost-ant-table-body {
-      .cost-ant-table-row {
-        &.has-children {
-          .cost-ant-table-cell-with-append {
-            font-weight: bold;
-          }
-        }
-      }
-    }
-  }
-}

+ 0 - 369
src/pages/costLibraryManagement/basicCostManagement/drugCostManagement/index.tsx

@@ -1,369 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-10-15 15:29:44
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-import { formatMoneyNumber } from '@/utils/format';
-import { createFromIconfontCN } from '@ant-design/icons';
-import FormItem from 'antd/es/form/FormItem';
-
-import { ActionType, ProFormDatePicker, ProFormDateTimePicker, ProFormInstance, ProFormText } from '@ant-design/pro-components';
-import { ModalForm, ProFormDependency, ProFormDigit, ProFormRadio, ProFormSelect, ProFormSwitch } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Form } from 'antd';
-import { Fragment, useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, delData, editData, getDrugTableData, getDrugTypeReq, importDataPost } from './service';
-
-import './style.less';
-import KCIMUpload from '@/components/KCIMUpload';
-import { downloadTemplateReq } from '@/utils/tooljs';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-export default function DrugCostManagement() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [stopStat,set_stopStat] = useState(0);
-    const columns: ProColumns[] = [
-
-        {
-            title: '项目代码',
-            dataIndex: 'code',
-            width:100
-        },
-        {
-            title: '项目名称',
-            dataIndex: 'name',
-            width:350,
-        },
-        {
-            title: '项目类型',
-            dataIndex: 'typeName',
-            width:90
-        },
-        {
-            title: '单价',
-            dataIndex: 'price',
-            width:90,
-            align:'right',
-            renderText(num) {
-                return formatMoneyNumber(num)
-            },
-        },
-        {
-            title: '成本',
-            dataIndex: 'cost',
-            width:90,
-            align:'right',
-            renderText(num) {
-                return formatMoneyNumber(num)
-            },
-        },
-        {
-            title: '停用',
-            dataIndex: 'status',
-            width:90,
-            renderText(stat) {
-                return stat ? '是' : '否'
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 60,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getDrugTableData({...params,stop:stopStat});
-        if (resp) {
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData(record.id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-
-        const result = {
-            ...formVal
-        }
-
-        if (type == 'ADD') {
-            const resp = await addData(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-
-            const resp = await editData({...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={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                } : {status:0}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText
-                    name="code"
-                    label="项目代码:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '项目代码不能为空!' }]}
-                />
-                <ProFormText
-                    name="name"
-                    label="项目名称:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '项目名称不能为空!' }]}
-                />
-                <ProFormSelect
-                    name="type"
-                    label="项目类型:"
-                    placeholder="请选择"
-                    request={async () => {
-                        const resp = await getDrugTypeReq();
-                        if(resp){
-                              return resp.map((a:any)=>({label:a.name,value:a.code}))
-                        }
-                    }}
-                    rules={[{ required: true, message: '项目类型不能为空!' }]}
-                />
-                <ProFormDigit
-                    name="price"
-                    label="单价:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '单价不能为空!' }]}
-                />
-                <ProFormDigit
-                    name="cost"
-                    label="成本:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '成本不能为空!' }]}
-                />
-                <Form.Item style={{ width: 322 }} label={<span style={{}}><i style={{ fontSize: 14, color: '#FF4060', fontWeight: 400, position: 'relative', paddingRight: 4, paddingLeft: 4 }}>*</i>停用:</span>}>
-                    <div style={{ display: 'flex', flex: 1, flexDirection: 'row', justifyContent: 'space-between' }}>
-                        <ProFormRadio.Group
-                            name="status"
-                            noStyle
-                            colProps={{ span: 10 }}
-                            options={[
-                                {
-                                    label: '否',
-                                    value: 0
-                                },
-                                {
-                                    label: '是',
-                                    value: 1
-                                }
-                            ]}
-                        />
-                        {/* style={{position:'relative',left:-10}}  */}
-                        <ProFormDependency name={['status']}>
-                            {
-                                ({ status }) => {
-                                    // console.log({report});
-                                    return (
-
-                                        status ? <ProFormDateTimePicker fieldProps={{locale}} name="stopTime" placeholder="请选择停用时间" rules={[{ required: true, message: '时间不能为空!' }]} colProps={{ span: 14 }} noStyle  />:null
-                                    )
-                                }
-                            }
-                        </ProFormDependency>
-
-                    </div>
-                </Form.Item>
-
-
-            </ModalForm>
-        )
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    const downloadTemplate = async () => {
-        await downloadTemplateReq('/costAccount/setting/exportDrug');
-    };
-    
-      const importData = () => {
-        return (
-          <ModalForm
-            width={360}
-            title={`导入数据`}
-            trigger={
-              <a className="import" key="3">
-                导入
-              </a>
-            }
-            submitter={{
-              render: (props, defaultDoms) => {
-                const needBtn = defaultDoms.filter((b) => {
-                  return b.key != 'rest';
-                });
-                return [
-                  // <Button
-                  //     key="ok"
-                  //     onClick={auditType == '0' ? () => downloadTemplate(index) : () => { }}
-                  // >
-                  //     下载模板
-                  // </Button>,
-                  ...needBtn,
-                ];
-              },
-            }}
-            onFinish={async (values) => {
-              const {
-                importFile: { fileList },
-              } = values;
-    
-              let formData = new FormData();
-              formData.append('file', fileList[0].originFileObj);
-              const resp = await importDataPost(formData);
-    
-              if (resp) {
-                tableRef.current?.reload();
-                return true;
-              }
-            }}
-          >
-            <FormItem name={'importFile'}>
-              <KCIMUpload downloadTemplateFile={() => downloadTemplate()} />
-            </FormItem>
-          </ModalForm>
-        );
-      };
-
-
-    useEffect(() => {
-
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='DrugCostManagement' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 项目名称:</span>
-                        <Input placeholder={'请输入'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo"  style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('name')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        name: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    name: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    <span style={{paddingRight:16}}><ProFormSwitch noStyle fieldProps={{size:'small',onChange:(bool)=>{
-                        set_stopStat(bool ? 1 : 0);
-                        tableRef.current?.reload();
-                    }}} /> 显示停用项目</span>
-                    {importData()}
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} scroll={{y:`calc(100vh - 235px)`}} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 110
src/pages/costLibraryManagement/basicCostManagement/drugCostManagement/service.ts

@@ -1,110 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-08 16:17:15
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-
-export type DrugTableDataType = {
-  id:number,
-  hospId:number,
-  code:number,
-  name:string,
-  type:string,
-  price:number,
-  cost:number,
-  status:number,
-  stopTime:string
-}
-
-
-export const getDrugTableData = (params?:any) => {
-  return request<{
-       current:number;
-       list:DrugTableDataType[];
-       pageSize:number;
-       totalCount:number;
-       totalPage:number;
-  }>('/costAccount/setting/getDrugList', {
-    method: 'GET',
-    params:{...params}
-  });
-};
-
-//获取药品类型
-export const getDrugTypeReq = () => {
-  return request('/costAccount/setting/getDrugType', {
-    method: 'GET',
-  });
-};
-
-
-
-//新增
-export type AddTableDataType = {
-  code:string,
-  name:string,
-  type:string,
-  price:number,
-  cost:number,
-  status:number,
-  stopTime:string
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/setting/addDrug', {
-    method: 'POST',
-    data
-  });
-};
-
-
-//导入数据
-export const importDataPost = (data:any) => {
-  return request('/costAccount/setting/importDrug', {
-    method: 'POST',
-    data
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/setting/editDrug', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (id:string) => {
-  return request('/costAccount/setting/deleteDrug', {
-    method: 'POST',
-    params:{id}
-  });
-};
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 55
src/pages/costLibraryManagement/basicCostManagement/drugCostManagement/style.less

@@ -1,55 +0,0 @@
-.DrugCostManagement {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-      .import {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #17181A;
-        line-height: 24px;
-        padding: 0 14px;
-        margin-right: 8px;
-        background: #FAFCFF;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-      }
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-    }
-
-  }
-}

+ 0 - 366
src/pages/costLibraryManagement/basicCostManagement/equipmentCostManagement/index.tsx

@@ -1,366 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-10-15 15:31:31
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-import { formatMoneyNumber } from '@/utils/format';
-import { createFromIconfontCN } from '@ant-design/icons';
-import FormItem from 'antd/es/form/FormItem';
-
-import { ActionType, ProFormDateTimePicker, ProFormInstance, ProFormText } from '@ant-design/pro-components';
-import { ModalForm, ProFormDependency, ProFormDigit, ProFormRadio, ProFormSelect, ProFormSwitch } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Form } from 'antd';
-import { useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, delData, editData, getEquipTableData, importDataPost } from './service';
-
-import './style.less';
-import KCIMUpload from '@/components/KCIMUpload';
-import { downloadTemplateReq } from '@/utils/tooljs';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-export default function EquipmentCostManagement() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [stopStat,set_stopStat] = useState(0);
-    const columns: ProColumns[] = [
-
-        {
-            title: '设备编码',
-            dataIndex: 'code',
-            width:90
-        },
-        {
-            title: '项目名称',
-            dataIndex: 'name',
-        },
-        {
-            title: '设备型号',
-            dataIndex: 'type',
-        },
-        {
-            title: '折旧年限',
-            dataIndex: 'depreciationYear',
-        },
-        {
-            title: '采购价格(元)',
-            dataIndex: 'price',
-            align:'right',
-            renderText(num) {
-                return formatMoneyNumber(num)
-            },
-        },
-        {
-            title: '每年折旧',
-            align:'right',
-            dataIndex: 'costPerYear',
-            renderText(num) {
-                return formatMoneyNumber(num)
-            },
-        },
-        {
-            title: '每分钟成本',
-            align:'right',
-            dataIndex: 'costPerMinute',
-        },
-        {
-            title: '停用',
-            dataIndex: 'status',
-            renderText(num) {
-                return num?'是':'否'
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 90,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getEquipTableData({...params,stop:stopStat});
-        if (resp) {
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData(record.id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-
-        const result = {
-            ...formVal
-        }
-
-        if (type == 'ADD') {
-            const resp = await addData(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-
-            const resp = await editData({...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={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                } : {status:0}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText
-                    name="code"
-                    label="设备编号:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '设备编号不能为空!' }]}
-                />
-                <ProFormText
-                    name="name"
-                    label="设备名称:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '设备名称不能为空!' }]}
-                />
-               <ProFormText
-                    name="type"
-                    label="设备型号:"
-                    placeholder="请输入"
-                />
-                <ProFormDigit
-                    name="price"
-                    label="购入价格:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '购入价格不能为空!' }]}
-                />
-                <ProFormDigit
-                    name="depreciationYear"
-                    label="折旧年限:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '折旧年限不能为空!' }]}
-                />
-                <Form.Item style={{ width: 322 }} label={<span style={{}}><i style={{ fontSize: 14, color: '#FF4060', fontWeight: 400, position: 'relative', paddingRight: 4, paddingLeft: 4 }}>*</i>停用:</span>}>
-                    <div style={{ display: 'flex', flex: 1, flexDirection: 'row', justifyContent: 'space-between' }}>
-                        <ProFormRadio.Group
-                            name="status"
-                            noStyle
-                            colProps={{ span: 10 }}
-                            options={[
-                                {
-                                    label: '否',
-                                    value: 0
-                                },
-                                {
-                                    label: '是',
-                                    value: 1
-                                }
-                            ]}
-                        />
-                        {/* style={{position:'relative',left:-10}}  */}
-                        <ProFormDependency name={['status']}>
-                            {
-                                ({ status }) => {
-                                    // console.log({report});
-                                    return (
-
-                                        status ? <ProFormDateTimePicker fieldProps={{locale}} placeholder="请选择停用时间" name="stopTime" rules={[{ required: true, message: '时间不能为空!' }]} colProps={{ span: 14 }} noStyle  />:null
-                                    )
-                                }
-                            }
-                        </ProFormDependency>
-
-                    </div>
-                </Form.Item>
-
-
-            </ModalForm>
-        )
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    const downloadTemplate = async () => {
-        await downloadTemplateReq('/costAccount/setting/exportEquipment');
-    };
-    
-      const importData = () => {
-        return (
-          <ModalForm
-            width={360}
-            title={`导入数据`}
-            trigger={
-              <a className="import" key="3">
-                导入
-              </a>
-            }
-            submitter={{
-              render: (props, defaultDoms) => {
-                const needBtn = defaultDoms.filter((b) => {
-                  return b.key != 'rest';
-                });
-                return [
-                  // <Button
-                  //     key="ok"
-                  //     onClick={auditType == '0' ? () => downloadTemplate(index) : () => { }}
-                  // >
-                  //     下载模板
-                  // </Button>,
-                  ...needBtn,
-                ];
-              },
-            }}
-            onFinish={async (values) => {
-              const {
-                importFile: { fileList },
-              } = values;
-    
-              let formData = new FormData();
-              formData.append('file', fileList[0].originFileObj);
-              const resp = await importDataPost(formData);
-    
-              if (resp) {
-                tableRef.current?.reload();
-                return true;
-              }
-            }}
-          >
-            <FormItem name={'importFile'}>
-              <KCIMUpload downloadTemplateFile={() => downloadTemplate()} />
-            </FormItem>
-          </ModalForm>
-        );
-      };
-
-
-    useEffect(() => {
-
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='EquipmentCostManagement' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 设备名称:</span>
-                        <Input placeholder={'请输入'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('name')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        name: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    name: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    <span style={{paddingRight:16}}><ProFormSwitch noStyle fieldProps={{size:'small',onChange:(bool)=>{
-                         set_stopStat(bool ? 1 : 0);
-                         tableRef.current?.reload();
-                    }}} /> 显示停用项目</span>
-                    {importData()}
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div style={{ marginTop: 16 }}>
-                <KCIMTable scroll={{y:`calc(100vh - 233px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 102
src/pages/costLibraryManagement/basicCostManagement/equipmentCostManagement/service.ts

@@ -1,102 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-07 18:45:24
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-
-export type EquipTableDataType = {
-  id:number,
-  hospId:number,
-  code:number,
-  name:string,
-  type:string,
-  price:number,
-  cost:number,
-  status:number,
-  stopTime:string
-}
-
-
-export const getEquipTableData = (params?:any) => {
-  return request<{
-       current:number;
-       list:EquipTableDataType[];
-       pageSize:number;
-       totalCount:number;
-       totalPage:number;
-  }>('/costAccount/setting/getEquipmentList?', {
-    method: 'GET',
-    params:{...params}
-  });
-};
-
-
-//新增
-export type AddTableDataType = {
-  code:string,
-  name:string,
-  type:string,
-  price:number,
-  cost:number,
-  status:number,
-  stopTime:string
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/setting/addEquipment', {
-    method: 'POST',
-    data
-  });
-};
-
-
-//导入数据
-export const importDataPost = (data:any) => {
-  return request('/costAccount/setting/importEquipment', {
-    method: 'POST',
-    data
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/setting/editEquipment', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (id:string) => {
-  return request('/costAccount/setting/deleteEquipment', {
-    method: 'POST',
-    params:{id}
-  });
-};
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 55
src/pages/costLibraryManagement/basicCostManagement/equipmentCostManagement/style.less

@@ -1,55 +0,0 @@
-.EquipmentCostManagement {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-      .import {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #17181A;
-        line-height: 24px;
-        padding: 0 14px;
-        margin-right: 8px;
-        background: #FAFCFF;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-      }
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-    }
-
-  }
-}

+ 0 - 403
src/pages/costLibraryManagement/basicCostManagement/materialCostManagement/index.tsx

@@ -1,403 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-10-15 15:30:25
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-import { formatMoneyNumber } from '@/utils/format';
-import { createFromIconfontCN } from '@ant-design/icons';
-import FormItem from 'antd/es/form/FormItem';
-
-import { ActionType, ProFormDateTimePicker, ProFormInstance, ProFormText } from '@ant-design/pro-components';
-import { ModalForm, ProFormDependency, ProFormDigit, ProFormRadio, ProFormSelect, ProFormSwitch } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Form } from 'antd';
-import { useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, delData, editData, getDrugTableData, importDataPost } from './service';
-
-import './style.less';
-import KCIMUpload from '@/components/KCIMUpload';
-import { downloadTemplateReq } from '@/utils/tooljs';
-
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-export default function MaterialCostManagement() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [stopStat,set_stopStat] = useState(0);
-
-    const columns: ProColumns[] = [
-
-        {
-            title: '项目代码',
-            dataIndex: 'code',
-            width:90
-        },
-        {
-            title: '项目名称',
-            dataIndex: 'name',
-            width:360
-        },
-        {
-            title: '项目类型',
-            dataIndex: 'typeName',
-            width:90,
-        },
-        {
-            title: '单价',
-            dataIndex: 'price',
-            width:90,
-            align:'right',
-            renderText(num) {
-                return formatMoneyNumber(num)
-            },
-        },
-        {
-            title: '成本',
-            width:90,
-            align:'right',
-            dataIndex: 'cost',
-            renderText(num) {
-                return formatMoneyNumber(num)
-            },
-        },
-        {
-            title: '停用',
-            width:90,
-            dataIndex: 'status',
-            renderText(stat) {
-                return stat ? '是' : '否'
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 60,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getDrugTableData({...params,stop:stopStat});
-        if (resp) {
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData(record.id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-
-        const result = {
-            ...formVal
-        }
-
-        if (type == 'ADD') {
-            const resp = await addData(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-
-            const resp = await editData({ ...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={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                } : { status: 0 }}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText
-                    name="code"
-                    label="项目代码:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '项目代码不能为空!' }]}
-                />
-                <ProFormText
-                    name="name"
-                    label="项目名称:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '项目名称不能为空!' }]}
-                />
-                <ProFormSelect
-                    name="type"
-                    label="项目类型:"
-                    placeholder="请选择"
-                    options={[
-                        {
-                            label: '不计价材料',
-                            value: 1
-                        },
-                        {
-                            label: '高值材料',
-                            value: 2
-                        },
-                        {
-                            label: '低值材料',
-                            value: 3
-                        }
-                    ]}
-                    rules={[{ required: true, message: '项目类型不能为空!' }]}
-                />
-                <ProFormDigit
-                    name="price"
-                    label="单价:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '单价不能为空!' }]}
-                />
-                <ProFormDigit
-                    name="cost"
-                    label="成本:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '成本不能为空!' }]}
-                />
-                <Form.Item style={{ width: 322 }} label={<span style={{}}><i style={{ fontSize: 14, color: '#FF4060', fontWeight: 400, position: 'relative', paddingRight: 4, paddingLeft: 4 }}>*</i>停用:</span>}>
-                    <div style={{ display: 'flex', flex: 1, flexDirection: 'row', justifyContent: 'space-between' }}>
-                        <ProFormRadio.Group
-                            name="status"
-                            noStyle
-                            colProps={{ span: 10 }}
-                            options={[
-                                {
-                                    label: '否',
-                                    value: 0
-                                },
-                                {
-                                    label: '是',
-                                    value: 1
-                                }
-                            ]}
-                        />
-                        {/* style={{position:'relative',left:-10}}  */}
-                        <ProFormDependency name={['status']}>
-                            {
-                                ({ status }) => {
-                                    // console.log({report});
-                                    return (
-
-                                        status ? <ProFormDateTimePicker fieldProps={{ locale }} name="stopTime" colProps={{ span: 14 }} placeholder="请选择停用时间" rules={[{ required: true, message: '时间不能为空!' }]} noStyle /> : null
-                                    )
-                                }
-                            }
-                        </ProFormDependency>
-
-                    </div>
-                </Form.Item>
-
-
-            </ModalForm>
-        )
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    const downloadTemplate = async () => {
-        await downloadTemplateReq('/costAccount/setting/exportMaterial');
-    };
-
-    const importData = () => {
-        return (
-            <ModalForm
-                width={360}
-                title={`导入数据`}
-                trigger={
-                    <a className="import" key="3">
-                        导入
-                    </a>
-                }
-                submitter={{
-                    render: (props, defaultDoms) => {
-                        const needBtn = defaultDoms.filter((b) => {
-                            return b.key != 'rest';
-                        });
-                        return [
-                            // <Button
-                            //     key="ok"
-                            //     onClick={auditType == '0' ? () => downloadTemplate(index) : () => { }}
-                            // >
-                            //     下载模板
-                            // </Button>,
-                            ...needBtn,
-                        ];
-                    },
-                }}
-                onFinish={async (values) => {
-                    const {
-                        importFile: { fileList },
-                    } = values;
-
-                    let formData = new FormData();
-                    formData.append('file', fileList[0].originFileObj);
-                    const resp = await importDataPost(formData);
-
-                    if (resp) {
-                        tableRef.current?.reload();
-                        return true;
-                    }
-                }}
-            >
-                <FormItem name={'importFile'}>
-                    <KCIMUpload downloadTemplateFile={() => downloadTemplate()} />
-                </FormItem>
-            </ModalForm>
-        );
-    };
-    
-
-
-    useEffect(() => {
-        console.log({tableDataFilterParams});
-    }, [tableDataFilterParams])
-
-    return (
-        <KCIMPagecontainer className='MaterialCostManagement' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem' style={{marginRight:16}} >
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 项目类型:</span>
-                        <ProFormSelect noStyle placeholder={'请选择类型'}
-                            width={160}
-                            options={[
-                                {label:'不计价材料',value:1},
-                                {label:'高值材料',value:2},
-                                {label:'低值材料',value:3}
-                            ]}
-                            fieldProps={{
-                                onChange:(value, option)=>{
-                                    // set_tableDataFilterParams({
-                                    //     ...tableDataFilterParams,
-                                    //     itemType: value
-                                    // });
-                                    set_tableDataFilterParams((prevParams:any) => ({
-                                        ...prevParams,
-                                        itemType: value
-                                    }));
-                                },
-                            }}
-                        />
-                    </div>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 项目名称:</span>
-                        <Input placeholder={'请输入'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo" style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('name')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        name: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    name: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    <span style={{ paddingRight: 16 }}><ProFormSwitch noStyle fieldProps={{ size: 'small', onChange: (bool) => {
-                         set_stopStat(bool ? 1 : 0);
-                         tableRef.current?.reload();
-                     } }} /> 显示停用项目</span>
-                    {importData()}
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div style={{ marginTop: 16 }}>
-                <KCIMTable scroll={{y:`calc(100vh - 233px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 102
src/pages/costLibraryManagement/basicCostManagement/materialCostManagement/service.ts

@@ -1,102 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 16:31:27
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-07 18:32:03
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { request } from 'umi';
-
-//获取table列表数据
-
-export type MaterialTableDataType = {
-  id:number,
-  hospId:number,
-  code:number,
-  name:string,
-  type:string,
-  price:number,
-  cost:number,
-  status:number,
-  stopTime:string
-}
-
-
-export const getDrugTableData = (params?:any) => {
-  return request<{
-       current:number;
-       list:MaterialTableDataType[];
-       pageSize:number;
-       totalCount:number;
-       totalPage:number;
-  }>('/costAccount/setting/getMaterialList', {
-    method: 'GET',
-    params:{...params}
-  });
-};
-
-
-//新增
-export type AddTableDataType = {
-  code:string,
-  name:string,
-  type:string,
-  price:number,
-  cost:number,
-  status:number,
-  stopTime:string
-}
-
-export const addData = (data:AddTableDataType) => {
-  return request('/costAccount/setting/addMaterial', {
-    method: 'POST',
-    data
-  });
-};
-
-
-//导入数据
-export const importDataPost = (data:any) => {
-  return request('/costAccount/setting/importMaterial', {
-    method: 'POST',
-    data
-  });
-};
-
-
-
-//编辑表格数据
-
-export type TableRowEditType = {
-  id:number;
-}&AddTableDataType
-
-export const editData = (data:any) => {
-  return request('/costAccount/setting/editMaterial', {
-    method: 'POST',
-    data
-  });
-};
-
-//删除表格操作
-export const delData = (id:string) => {
-  return request('/costAccount/setting/deleteMaterial', {
-    method: 'POST',
-    params:{id}
-  });
-};
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 55
src/pages/costLibraryManagement/basicCostManagement/materialCostManagement/style.less

@@ -1,55 +0,0 @@
-.MaterialCostManagement {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-      .import {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #17181A;
-        line-height: 24px;
-        padding: 0 14px;
-        margin-right: 8px;
-        background: #FAFCFF;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-      }
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-    }
-
-  }
-}

+ 0 - 590
src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/index.tsx

@@ -1,590 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-08-16 10:29:24
- * @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
- */
-
-
-import { createFromIconfontCN } from '@ant-design/icons';
-import { ActionType, arrayMoveImmutable, ProFormInstance, useRefFunction } from '@ant-design/pro-components';
-import { ModalForm, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
-import { ProColumns } from '@ant-design/pro-table';
-import { Dropdown, Input, MenuProps, message, Modal, Switch, Tooltip, Popconfirm } from 'antd';
-import { ColumnsType } from 'antd/es/table/interface';
-import { TransferItem, TransferProps } from 'antd/es/transfer';
-import { Key } from 'react';
-import { useEffect, useRef, useState } from 'react';
-
-
-import { getLeftList, getClolumnTableData, addLeftList, editLeftList, editReportTbaleData, delLeftReportData, batchDelTableData, addReportTbaleData, delData, getEmpCostTypeDict, updateEmpInfo, importDataPost, generateTableData } from './service';
-import FormItem from 'antd/es/form/FormItem';
-
-import './style.less';
-
-
-import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';
-
-import '../../../../utils/zhongtaiB'
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-
-import TableSelecter from './tableSelector';
-import KCIMUpload from '@/components/KCIMUpload';
-import { downloadTemplateReq } from '@/utils/tooljs';
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-var temp_dataSource: any[] = [];
-let _currentSelectedType: any = undefined;
-
-const PersonnelClassificationMana = () => {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const [selectedRowKeys, set_selectedRowKeys] = useState<Key[]>([]);
-    const [typeList, set_typeList] = useState<any[]>([]);
-    const [showTypeListArr, set_showTypeListArr] = useState<any[]>([]);
-    const [currentSelectedType, set_currentSelectedType] = useState<any | undefined>(undefined);
-
-
-    const [tableSelecterVisible, set_tableSelecterVisible] = useState(false);
-    const [dataSource, setDataSource] = useState<any[]>([]);
-
-
-    const [currentEditLeftData, set_currentEditLeftData] = useState<any | undefined>(undefined);
-
-    const [ifEditTable, set_ifEditTable] = useState(true);
-
-    const tableRef = useRef<ActionType>();
-
-    const column: ProColumns[] = [
-
-        {
-            title: '工号',
-            ellipsis: true,
-            dataIndex: 'account',
-
-        },
-        {
-            title: '姓名',
-            dataIndex: 'name',
-
-        },
-        {
-            title: '科室代码',
-            dataIndex: 'departmentCode',
-        },
-        {
-            title: '科室名称',
-            dataIndex: 'departmentName',
-        },
-        {
-            title: '岗位',
-            dataIndex: 'positionName',
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 120,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-
-                return [
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record.id)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>
-                ]
-            },
-        },
-    ]
-
-    const [tableColumn, set_tableColumn] = useState<ProColumns[] | any[]>(column);
-
-
-
-
-    const getTableData = async (params: any) => {
-        const { costTypeCode } = params;
-        if (costTypeCode) {
-            const resp = await getClolumnTableData({ ...params });
-            if (resp) {
-                return {
-                    data: resp.list,
-                    success: true,
-                    total: resp.totalCount,
-                    pageSize: resp.pageSize,
-                    totalPage: resp.totalPage,
-                }
-            }
-
-        }
-        return []
-
-    }
-
-
-    //获取左侧单元
-    const getPageLeftReports = async () => {
-        const resp = await getLeftList();
-
-        if (resp) {
-
-            set_typeList(resp);
-            set_showTypeListArr(resp);
-        }
-    }
-
-    const delTableData = async (id: number) => {
-        const resp = await delData(id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-        }
-    }
-
-    const batchDelHandle = async () => {
-        const resp = await batchDelTableData(selectedRowKeys);
-        if (resp) {
-            message.success('操作成功!');
-            set_selectedRowKeys([]);
-            tableRef.current?.reload();
-        }
-    }
-
-    const tableSelecterCommit = async (keys: Key[], rows: any[]) => {
-        const result = rows.map((a, index) => ({
-            costTypeCode: _currentSelectedType.costTypeCode,
-            userId: a.id,
-            account: a.account,
-            name: a.name,
-            departmentCode: a.departmentCode,
-            departmentName: a.departmentName,
-            position: a.position,
-            positionName: a.positionName
-        }))
-        const resp = await addReportTbaleData(result);
-        if (resp) {
-            message.success('操作成功');
-            set_tableSelecterVisible(false);
-            tableRef.current?.reload();
-        }
-    }
-
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | 'ADD_LEFTDATA' | 'EDIT_LEFTDATA', data?: any[]) => {
-
-        // console.log({formVal,type});
-
-        if (type == 'ADD_LEFTDATA') {
-            const resp = await addLeftList({
-                //costTypeCode: formVal.costTypeCode,
-                costTypeName: formVal.costTypeName,
-                computeType: formVal.computeType.value,
-                computeTypeName: formVal.computeType.label,
-                description: formVal.description
-            });
-            if (resp) {
-                getPageLeftReports();
-            }
-        }
-
-
-
-        if (type == 'EDIT_LEFTDATA') {
-            const resp = await editLeftList({
-                id: formVal.id,
-                costTypeName: formVal.costTypeName,
-                computeType: formVal.computeType.value,
-                computeTypeName: formVal.computeType.label,
-                description: formVal.description
-            });
-            if (resp) {
-                getPageLeftReports();
-            }
-        }
-
-        if (type == 'EDIT') {
-
-            let newDataSource = data?.map((a: any, index: number) => {
-                //更新排序
-                return { ...a, sort: index + 1 }
-            })
-            const resp = await editReportTbaleData(newDataSource);
-            if (resp) {
-                tableRef.current?.reload();
-            }
-        }
-
-        return true;
-
-    }
-
-    const downloadTemplate = async () => {
-        await downloadTemplateReq('/costAccount/setting/exportEmpType');
-    };
-
-    const importData = () => {
-        return (
-            <ModalForm
-                width={360}
-                title={`导入数据`}
-                trigger={
-                    <a className="import" key="3">
-                        导入
-                    </a>
-                }
-                submitter={{
-                    render: (props, defaultDoms) => {
-                        const needBtn = defaultDoms.filter((b) => {
-                            return b.key != 'rest';
-                        });
-                        return [
-                            ...needBtn,
-                        ];
-                    },
-                }}
-                onFinish={async (values) => {
-                    const {
-                        importFile: { fileList },
-                    } = values;
-
-                    let formData = new FormData();
-                    formData.append('file', fileList[0].originFileObj);
-                    const resp = await importDataPost(formData);
-
-                    if (resp) {
-                        getPageLeftReports();
-                        return true;
-                    }
-                }}
-            >
-                <FormItem name={'importFile'}>
-                    <KCIMUpload downloadTemplateFile={() => downloadTemplate()} />
-                </FormItem>
-            </ModalForm>
-        );
-    };
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADD_LEFTDATA' | 'EDIT_LEFTDATA' }) => {
-        const formRef = useRef<ProFormInstance>();
-        const getTrriger = () => {
-            if (type == 'ADD') {
-                return <span className='add'>新增</span>
-            }
-            if (type == 'EDIT') {
-                return <a key="edit" >编辑</a>
-            }
-            if (type == 'ADD_LEFTDATA') {
-                return (
-                    <span className='add' >新增</span>
-                )
-            }
-            if (type == 'EDIT_LEFTDATA') {
-                return <a key="edit" >编辑</a>
-            }
-        }
-
-        return (
-            <ModalForm
-                formRef={formRef}
-                title={type == 'ADD_LEFTDATA' ? `新增人事分类` : `编辑人事分类`}
-                width={352}
-                initialValues={type == 'EDIT_LEFTDATA' ? { ...record } : { computeTypeName: '' }}
-                trigger={
-                    getTrriger()
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT_LEFTDATA' ? { ...record, ...val } : val, type);
-                }}
-            >
-
-                <ProFormText
-                    label='人事分类名称:'
-                    name='costTypeName'
-                    rules={[{ required: true, message: '人事分类名称不能为空!' }]}
-                />
-                {/* <ProFormText
-                    label='人事分类代码:'
-                    name='costTypeCode'
-                    rules={[{ required: true, message: '人事分类代码不能为空!' }]}
-                /> */}
-                <ProFormSelect
-                    name="computeType"
-                    label="子级类型:"
-                    placeholder="请选择"
-                    request={async () => {
-                        const resp = await getEmpCostTypeDict();
-                        if (resp) {
-                            return resp.map((a: any) => ({ label: a.name, value: a.code }));
-                        }
-                        return []
-                    }}
-                    fieldProps={{
-                        labelInValue: true,
-                        onChange(value, option: any) {
-                            // console.log({value,option})
-                            // const {label} = option;
-                            // console.log({label});
-                            // formRef.current?.setFieldValue('computeTypeName',label);
-                        },
-                    }}
-                    rules={[{ required: true, message: '子集类型不能为空!' }]}
-                />
-                <ProFormTextArea
-                    label='说明:'
-                    name='description'
-                />
-            </ModalForm>
-        )
-    }
-
-
-    const moreItems: MenuProps['items'] = [
-        {
-            key: '1',
-            label: <UpDataActBtn key={'act'} record={currentEditLeftData} type='EDIT_LEFTDATA' />,
-        },
-        {
-            key: '2',
-            label: (
-                <a onClick={async (e) => {
-                    e.preventDefault();
-                    const resp = await delLeftReportData(currentEditLeftData.id);
-                    if (resp) {
-                        getPageLeftReports();
-                    }
-                }}>
-                    删除
-                </a>
-            ),
-        },
-    ];
-
-
-
-    const onSortEnd = useRefFunction(
-        ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {
-            if (oldIndex !== newIndex) {
-                const newData = arrayMoveImmutable({
-                    array: [...dataSource],
-                    fromIndex: oldIndex,
-                    toIndex: newIndex,
-                }).filter((el) => !!el);
-
-                const updatedSortArr = newData.map((item: any, index: number) => ({ ...item, sort: index }))
-                // setDataSource([...updatedSortArr]);
-                updateTable(undefined, 'EDIT', updatedSortArr)
-            }
-        },
-    );
-
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-    }
-
-    const updateEmpInfoHandle = async () => {
-        const resp = await updateEmpInfo();
-        if (resp) {
-            message.success('更新成功!');
-            tableRef.current?.reload();
-        }
-    }
-
-    const generateEmpHandle = ()=>{
-        Modal.confirm({
-            title:'注意',
-            content:'生成操作会覆盖现有的人事分类及对应人员信息,确定要继续操作?',
-            onOk:async (...args) => {
-                const resp = await generateTableData(); 
-                if(resp){
-                    getPageLeftReports();
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
-                }
-            },
-        })
-    }
-
-
-    const items: MenuProps['items'] = [
-        {
-            key: '1',
-            label: (
-                <UpDataActBtn key={'act'} record={undefined} type='ADD_LEFTDATA' />
-            ),
-        },
-        {
-            key: '2',
-            label: importData()
-        },
-    ];
-
-
-
-    useEffect(() => {
-
-        if (currentSelectedType) {
-            set_tableDataFilterParams({ ...tableDataFilterParams, costTypeCode: currentSelectedType.costTypeCode });
-        }
-    }, [currentSelectedType])
-
-    useEffect(() => {
-        if (showTypeListArr.length > 0) {
-            set_currentSelectedType(showTypeListArr[0]);
-            _currentSelectedType = showTypeListArr[0];
-            set_tableDataFilterParams({ ...tableDataFilterParams, costTypeCode: showTypeListArr[0].costTypeCode });
-        }
-    }, [showTypeListArr]);
-
-    useEffect(() => {
-        if (ifEditTable) {
-            set_tableColumn([...column])
-        } else {
-            set_tableColumn(column);
-        }
-    }, [ifEditTable]);
-
-
-    useEffect(() => {
-        getPageLeftReports();
-    }, [])
-
-
-    return (
-        <KCIMPagecontainer title={false} className='PersonnelClassificationMana'>
-            <TableSelecter
-                onVisibleChange={(bool) => set_tableSelecterVisible(bool)}
-                title='添加单元人员信息'
-                rowKey={'id'}
-                defaultSelectedKeys={[]}
-                record={_currentSelectedType}
-                open={tableSelecterVisible}
-                onFinish={(keys, rows) => tableSelecterCommit(keys, rows)}
-            />
-            {selectedRowKeys.length > 0 && (
-                <div className='bottomBar'>
-                    <span>已选择<a>{selectedRowKeys.length}</a>项</span>
-                    <a onClick={() => batchDelHandle()}>批量删除</a>
-                </div>
-            )}
-            <div className='left'>
-                <div className='toolbar'>
-                    <Input placeholder={'人事分类'} allowClear autoComplete='off'
-                        suffix={
-                            <IconFont type="iconsousuo" />
-                        }
-                        style={{ width: 156 }}
-                        onChange={(e) => {
-                            const result = typeList.filter(item => item.costTypeName.indexOf(e.target.value) != -1);
-                            set_showTypeListArr(result);
-                        }}
-
-                    />
-                    <Dropdown menu={{ items }} placement="bottomLeft">
-                        <div className='add'>
-                            <img src={require('../../../../../static/addIcon_black.png')} alt="" />
-                        </div>
-                    </Dropdown>
-
-
-                </div>
-
-                <div className='wrap'>
-                    {
-                        showTypeListArr.map((item, index) => {
-                            return (
-                                <div className={currentSelectedType ? currentSelectedType.id == item.id ? 'type on' : 'type' : 'type'}
-                                    key={index}
-                                    onClick={() => {
-                                        set_currentSelectedType(item)
-                                        _currentSelectedType = item;
-                                    }}
-                                >
-                                    <img className='icon' src={require('../../../../../static/reportIcon.png')} alt="" />
-                                    <div className='content'>
-                                        <Tooltip title={item.costTypeName} >
-                                            <div className='name'>{item.costTypeName}</div>
-                                            <div className='sub'>{item.computeTypeName}</div>
-                                        </Tooltip>
-                                    </div>
-
-                                    <Dropdown menu={{ items: moreItems }} placement="bottom" onOpenChange={(bool) => { bool && set_currentEditLeftData(item) }}>
-                                        <div className='more'>
-                                            <img src={require('../../../../../static/more_point_gray.png')} alt="" />
-                                        </div>
-                                    </Dropdown>
-                                </div>
-                            )
-                        })
-                    }
-                </div>
-            </div>
-            <div className='right'>
-                <div className='toolBar'>
-                    <div className='filter'>
-                        <div className='filterItem' style={{ marginLeft: 16, width: 205 }}>
-                            <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                            <Input placeholder={'输入工号,姓名'} allowClear autoComplete='off'
-                                suffix={
-                                    <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('filter')} />
-                                }
-                                onChange={(e) => {
-                                    set_tableDataSearchKeywords(e.target.value);
-                                    if (e.target.value.length == 0) {
-                                        set_tableDataFilterParams({
-                                            ...tableDataFilterParams,
-                                            filter: ''
-                                        });
-                                    }
-                                }}
-                                onPressEnter={(e) => {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        filter: ((e.target) as HTMLInputElement).value
-                                    });
-                                }}
-
-                            />
-                        </div>
-                    </div>
-                    <div className='btnGroup'>
-                        <span className='update' onClick={() => generateEmpHandle()}>按人员类别生成</span>
-                        <span className='update' onClick={() => updateEmpInfoHandle()}>更新人员信息</span>
-                        <span className='add' onClick={() => set_tableSelecterVisible(true)}>添加</span>
-                    </div>
-                </div>
-                <div style={{ marginTop: 16 }}>
-                    {currentSelectedType && <KCIMTable actionRef={tableRef} columns={tableColumn}
-                        scroll={{y:`calc(100vh - 233px)`}}
-                        rowKey='id'
-                        request={(params) => getTableData(params)}
-                        tableAlertRender={false}
-                        params={tableDataFilterParams}
-                        rowSelection={{
-                            onChange(selectedRowKeys, selectedRows, info) {
-                                set_selectedRowKeys(selectedRowKeys);
-                            },
-                        }}
-                    />}
-                </div>
-            </div>
-        </KCIMPagecontainer>
-    )
-}
-
-
-export default PersonnelClassificationMana;

+ 0 - 148
src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/service.ts

@@ -1,148 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-07 11:12:10
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-03-21 11:16:06
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicMana/service.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
-
-
-
-import { Key } from 'react';
-import { request } from 'umi';
-
-
-//获取左侧报表数据
-
-export const getLeftList = () => {
-  return request('/costAccount/setting/getEmpCostType', {
-    method: 'GET',
-  });
-};
-
-//获取人事分类计算类型
-export const getEmpCostTypeDict = () => {
-  return request('/costAccount/setting/getEmpCostTypeDict', {
-    method: 'GET',
-  });
-};
-
-//获取表格数据
-
-export type  ClolumnTableDataType = {
-  id:number;
-  
-}
-
-export const getClolumnTableData = (params:{costTypeCode:string}) => {
-    return request('/costAccount/setting/getEmpCostMap', {
-      method: 'GET',
-      params:{...params}
-    });
-};
-
-//获取可添加列表
-export const getAddableTableData = (costType:string) => {
-  return request('/costAccount/setting/getEmpInfo', {
-    method: 'GET',
-    params:{costType}
-  });
-};
-
-
-//新增左侧列表
-
-
-export const addLeftList = (data:any) => {
-  return request('/costAccount/setting/addEmpCostType', {
-    method: 'POST',
-    data
-  });
-};
-
-
-//编辑左侧列表
-export const editLeftList= (data:any) => {
-  return request('/costAccount/setting/editEmpCostType', {
-    method: 'POST',
-    data
-  });
-};
-
-
-
-
-//新增表格数据
-
-export const addReportTbaleData = (data:any) => {
-  return request('/costAccount/setting/addEmpCostMap', {
-    method: 'POST',
-    data
-  });
-};
-
-//更新人员信息
-export const updateEmpInfo = () => {
-  return request('/costAccount/setting/updateEmpMap', {
-    method: 'POST',
-  });
-};
-
-
-
-
-//编辑表格数据
-
-export const editReportTbaleData = (data:any) => {
-    return request('/costAccount/report/editReportColumn', {
-      method: 'POST',
-      data
-    });
-};
-
-
-//删除表格操作
-export const delData = (id:number) => {
-    return request('/costAccount/setting/deleteEmpCostMap', {
-      method: 'POST',
-      params:{id}
-    });
-};
-
-//删除左侧报表
-export const delLeftReportData = (id:number) => {
-  return request('/costAccount/setting/deleteEmpCostType', {
-    method: 'POST',
-    params:{id}
-  });
-};
-
-
-//批量删除表格数据
-export const batchDelTableData = (ids:Key[]) => {
-  return request('/costAccount/setting/batchDeleteEmpCostMap', {
-    method: 'POST',
-    data:[...ids]
-  });
-};
-
-
-//导入数据
-export const importDataPost = (data:any) => {
-  return request('/costAccount//setting/importEmpType', {
-    method: 'POST',
-    data
-  });
-};
-
-//按人员分类生成数据
-export const generateTableData = () => {
-  return request('/costAccount//setting/generateEmpType', {
-    method: 'POST',
-  });
-};
-
-
-
-

+ 0 - 254
src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/style.less

@@ -1,254 +0,0 @@
-.row-dragging {
-
-  .cost-ant-table-cell {
-    width: 130px;
-  }
-}
-
-.TableSelecter {
-
-  .pfm-ant-modal-footer {
-    display: none !important;
-  }
-  
-  .footer {
-       display: flex;
-       flex-direction:row;
-       justify-content: flex-end;
-       margin-top: 15px;
-       span {
-           display: inline-block;
-           width: 56px;
-           height: 24px;  
-           font-size: 14px;
-           line-height: 23px;
-           text-align: center;
-           border-radius: 4px;
-           cursor: pointer;
-
-           &.ok {
-               color: #FFFFFF;
-               background:#3377FF;
-               margin-left: 8px;
-           }
-           &.cancel {
-               border: 1px solid #DAE2F2;
-           }
-       }
-
-  }
-}
-
-.PersonnelClassificationMana {
-  width: 100%;
-  height: calc(100vh - 48px);
-  position: relative;
-
-  .bottomBar {
-    position: absolute;
-    bottom: -16px;
-    left: -16px;
-    width:102.5%;
-    height: 48px;
-    display: flex;
-    padding: 0 16px;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    background: #FFFFFF;
-box-shadow: 0px -8px 16px 0px rgba(64,85,128,0.1);
-
-    &>span {
-      font-size: 14px;
-      font-weight: 400;
-      color: #17181A;
-    }
-
-    &>a {
-      width: 80px;
-      height: 24px;
-      line-height: 24px;
-      font-size: 14px;
-      font-weight: 400;
-      color: #FFFFFF;
-      text-align: center;
-      background: #3377FF;
-      border-radius: 4px;
-    }
-  }
-
-  .left {
-    float: left;
-    border-radius: 4px;
-    width: 220px;
-    height: calc(100vh - 80px);
-    overflow:hidden;
-    margin-right: 16px;
-    padding: 16px 8px;
-    background: #FFFFFF;
-
-    .toolbar {
-      display: flex;
-      flex-direction: row;
-      justify-content: space-between;
-      align-items: center;
-      padding: 0 8px;
-
-      .add {
-        cursor: pointer;
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        width: 24px;
-        height: 24px;
-        background: #FAFCFF;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-
-        &>img {
-          width: 16px;
-          height: 16px;
-        }
-      }
-    }
-
-    .wrap {
-      height: calc(100% - 30px);
-      overflow-y: scroll;
-      margin-top: 16px;
-
-      .type {
-        cursor: pointer;
-        height: 56px;
-        border-radius: 4px;
-        background: #FFFFFF;
-        display: flex;
-        padding-left: 8px;
-        padding-right: 8px;
-        flex-direction: row;
-        justify-content: space-between;
-        align-items: center;
-        margin-bottom: 4px;
-
-        .icon {
-          width: 25px;
-          height: 25px;
-        }
-
-        .content {
-          width: 80%;
-          padding-left: 7px;
-
-          .name {
-            height: 15px;
-            font-size: 14px;
-            font-family: SourceHanSansCN-Medium, SourceHanSansCN;
-            font-weight: 500;
-            color: #17181A;
-            line-height: 15px;
-            margin-bottom: 8px;
-            overflow: hidden;
-            white-space: nowrap;
-            text-overflow: ellipsis;
-          }
-
-          .sub {
-            height: 13px;
-            font-size: 12px;
-            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-            font-weight: 400;
-            color: #7A8599;
-            line-height: 13px;
-          }
-        }
-
-        .more {
-          display: flex;
-          justify-content: center;
-          align-items: center;
-          cursor: pointer;
-          width: 16px;
-          height: 16px;
-          border-radius: 4px;
-          background: #FFFFFF;
-
-          &>img {
-            width: 100%;
-            height: 100%;
-          }
-        }
-
-        &.on {
-          font-weight: 500;
-          color: #17181A;
-          background: #F0F2F5;
-        }
-
-        &:last-child {
-          margin-bottom: 0;
-        }
-      }
-    }
-  }
-
-  .right {
-    float: left;
-    width: calc(100% - 236px);
-    padding: 16px;
-    border-radius: 4px;
-    background: #FFFFFF;
-
-    .toolBar {
-      display: flex;
-      flex-direction: row;
-      justify-content: space-between;
-      align-items: center;
-
-      .filter {
-        display: flex;
-        flex-direction: row;
-        justify-content: flex-start;
-        align-items: center;
-
-        .filterItem {
-          display: flex;
-          flex-direction: row;
-          justify-content: center;
-          align-items: center;
-        }
-      }
-
-      .btnGroup {
-        .add {
-          cursor: pointer;
-          display: inline-block;
-          font-size: 14px;
-          font-weight: 400;
-          color: #FFFFFF;
-          line-height: 24px;
-          padding: 0 14px;
-          background: #3377FF;
-          border-radius: 4px;
-          margin-left: 8px;
-        }
-        .update {
-          cursor: pointer;
-          display: inline-block;
-          font-size: 14px;
-          font-weight: 400;
-          color: #17181A;
-          line-height: 24px;
-          padding: 0 14px;
-          background: #FAFCFF;
-          border-radius: 4px;
-          border: 1px solid #DAE2F2;
-          &:first-child {
-            margin-right: 8px;
-          }
-        }
-      }
-
-
-    }
-  }
-}

+ 0 - 183
src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/tableSelector.tsx

@@ -1,183 +0,0 @@
-import React, { Key, useEffect, useState } from "react";
-import { Input, Select } from 'antd'
-import { KCIMTable } from "@/components/KCIMTable";
-import { createFromIconfontCN } from "@ant-design/icons";
-
-
-import { ModalForm, ProColumns, ProFormSelect, ProFormText } from "@ant-design/pro-components";
-
-import { set } from "lodash";
-import { getAddableTableData } from "./service";
-
-// import './style.less';
-
-
-interface TableSelecterProps {
-    record: any
-}
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-
-const TableSelecter = ({ record, open, title, onVisibleChange, rowKey = 'id', request, onFinish, defaultSelectedKeys }: {
-    record: any, open: boolean, title: string, onVisibleChange: (bool: boolean) => void, defaultSelectedKeys: Key[],
-    rowKey?: string, request?: (params: any) => Promise<any>, onFinish?: (selectedKeys: React.Key[], selectedRows: any[]) => void
-}) => {
-
-
-    const Table = React.forwardRef(({ }: TableSelecterProps, ref) => {
-
-        const [datasource, set_datasource] = useState<any[]>([]);
-        const [selectedKeys, setSelectedKeys] = useState<React.Key[]>([]);
-        const [selectedRows, set_selectedRows] = useState<any[]>([]);
-        const [showList, set_showList] = useState<any[]>([]);
-        const [filter, set_filter] = useState<undefined | any>(undefined);
-        const [code, set_code] = useState<undefined | any>(undefined);
-        const [keyword, set_keyword] = useState<string | undefined>(undefined);
-
-
-        const columns: ProColumns[] = [
-            {
-                title: '工号',
-                dataIndex: 'account',
-            },
-            {
-                title: '姓名',
-                dataIndex: 'name',
-            },
-        ];
-
-
-        const onSelectChange = (newSelectedRowKeys: React.Key[], selectedRows: any) => {
-            setSelectedKeys([...newSelectedRowKeys]);
-            set_selectedRows([...selectedRows]);
-
-        };
-
-        const saveHandle = async () => {
-            const selectedRowkeys = selectedRows.map((a) => a[`${rowKey}`]);
-            const rows = datasource.filter((a) => selectedRowkeys.includes(a[`${rowKey}`]));
-            onFinish && onFinish(selectedKeys, rows);
-        }
-
-        const getTableData = async () => {
-
-            const resp = await getAddableTableData(record.costTypeCode);
-
-            let selectedCodes: string[] = [];
-            let selectedRows: any[] = [];
-            if (resp) {
-                const data = resp.map((a: any) => {
-                    if (defaultSelectedKeys.includes(a[`${rowKey}`])) {
-                        selectedCodes.push(a[`${rowKey}`]);
-                        selectedRows.push(a);
-                        const needItem = record.departList.filter((b: any) => a[`${rowKey}`] == b[`${rowKey}`]);
-
-                        return {
-                            ...a,
-                            flag: needItem[0].isManager ? true : false
-                        }
-                    } else {
-                        return a
-                    }
-                });
-
-                set_showList(data);
-                set_selectedRows([...selectedRows]);
-                setSelectedKeys([...selectedCodes]);
-                set_datasource([...datasource, ...data]);
-            }
-
-
-            return Promise.resolve([]);
-        }
-
-        useEffect(() => {
-            // console.log({code, keyword});
-            const result = datasource.filter((a) => {
-                 return a.name?a.name.indexOf(keyword) != -1:false
-            });
-
-            set_showList([...result]);
-        }, [keyword])
-
-        useEffect(() => {
-            getTableData()
-        }, [])
-
-
-        return (
-            <div >
-                <div className="filter" style={{ display: 'flex', flexDirection: 'row', marginBottom: 8 }}>
-                    <ProFormText noStyle placeholder={'请输入'}
-                        fieldProps={{
-                            suffix: <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />,
-                            onChange: (e) => {
-                                if (e.target.value.length != 0) {
-                                    set_keyword(e.target.value);
-                                } else {
-                                    set_keyword('');
-                                }
-                            }
-                        }}
-                    />
-                </div>
-
-                <KCIMTable columns={columns}
-                    options={{
-                        density: true,
-                        setting: {
-                            listsHeight: 100,
-                        },
-                    }}
-                    rowKey={rowKey}
-                    scroll={{ y: 400 }}
-                    tableAlertRender={false}
-                    rowSelection={{
-                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
-                        // 注释该行则默认不显示下拉选项
-                        // selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
-                        selectedRowKeys: selectedKeys,
-                        onChange: onSelectChange,
-                    }}
-                    pagination={{ showTitle: false, showSizeChanger: false,simple:true }}
-                    dataSource={showList}
-
-                />
-                <div className='footer'>
-                    <span className='cancel' onClick={() => close()}>取消</span>
-                    <span className='ok' onClick={() => saveHandle()}>{`确认(${selectedKeys.length > 0 && selectedKeys.length})`}</span>
-                </div>
-            </div>
-
-        )
-    });
-
-    const close = () => {
-        onVisibleChange && onVisibleChange(false);
-    }
-
-
-    return (
-        <ModalForm className="TableSelecter" title={title} width={400} submitter={{
-            render: false
-        }} open={open} modalProps={{
-            closable: false,
-        }}>
-            <Table
-                // ref={tableSelecterRef}
-                record={undefined}
-            ></Table>
-        </ModalForm>
-    )
-
-}
-
-
-
-
-export default TableSelecter

+ 0 - 395
src/pages/costLibraryManagement/basicCostManagement/spaceCostManagement/index.tsx

@@ -1,395 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-10-15 15:32:31
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-import { formatMoneyNumber } from '@/utils/format';
-import { createFromIconfontCN } from '@ant-design/icons';
-import FormItem from 'antd/es/form/FormItem';
-
-import { ActionType, ProFormDateTimePicker, ProFormInstance, ProFormText } from '@ant-design/pro-components';
-import { ModalForm, ProFormDependency, ProFormDigit, ProFormRadio, ProFormSelect, ProFormSwitch } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Form } from 'antd';
-import { useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, delData, editData, getSpaceCostTableData, importDataPost } from './service';
-
-import './style.less';
-import KCIMUpload from '@/components/KCIMUpload';
-import { downloadTemplateReq, renameChildListToChildren } from '@/utils/tooljs';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-export default function SpaceCostManagement() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [stopStat, set_stopStat] = useState(0);
-    const columns: ProColumns[] = [
-
-        {
-            title: '空间名称',
-            dataIndex: 'name',
-        },
-        {
-            title: '空间编码',
-            dataIndex: 'code',
-        },
-        {
-            title: '建置成本(元)',
-            dataIndex: 'cost',
-            align:'right',
-        },
-        {
-            title: '建置容积(㎡)',
-            dataIndex: 'volume',
-            align:'right',
-        },
-        {
-            title: '折旧年限',
-            dataIndex: 'depreciationYear',
-            renderText(num) {
-                return formatMoneyNumber(num)
-            },
-        },
-        {
-            title: '每年折旧',
-            align:'right',
-            dataIndex: 'costPerYear',
-            renderText(num) {
-                return formatMoneyNumber(num)
-            },
-        },
-        {
-            title: '每分钟成本',
-            align:'right',
-            dataIndex: 'costPerMinute',
-        },
-        {
-            title: '停用',
-            dataIndex: 'status',
-            renderText(num) {
-                return num ? '是' : '否'
-            },
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 120,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return record.type == 0 ?[
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                    <UpDataActBtn key={'act2'} record={record} type='ADDCHILD' />,
-                ]:[
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        let resp = await getSpaceCostTableData({ ...params,stop:stopStat });
-        if (resp) {
-            const data = renameChildListToChildren(resp, 'childList');
-            return {
-                data: data,
-                success: true,
-            }
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData(record.id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | "ADDCHILD") => {
-
-        const result = {
-            ...formVal
-        }
-
-        if (type == 'ADD'||type == 'ADDCHILD') {
-            const resp = await addData(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-
-            const resp = await editData({ ...result });
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-        }
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADDCHILD' }) => {
-
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}设备`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                } : { status: 0 }}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <a className='add'>{type == 'ADD' ? '新增' : '添加'}</a>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } :type == 'ADDCHILD'?{...val,parentCode:record.code}:{ ...val,parentCode:0 }, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText
-                    name="code"
-                    label="空间编码:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '空间编码不能为空!' }]}
-                />
-                <ProFormText
-                    name="name"
-                    label="空间名称:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '空间名称不能为空!' }]}
-                />
-                <ProFormRadio.Group
-                    name="type"
-                    label="分类:"
-                    options={[
-                        { label: '否', value: 1 }, 
-                        { label: '是', value: 0 }
-                    ]}
-                    rules={[{ required: true, message: '分类不能为空!' }]}
-                />
-
-                <ProFormDependency name={['type']}>
-                    {
-                        ({ type }) => {
-                            return type == 1 && (
-                                <>
-                                    <ProFormDigit
-                                        name="cost"
-                                        label="建置成本(元):"
-                                        placeholder="请输入"
-                                        rules={[{ required: true, message: '建置成本不能为空!' }]}
-                                    />
-                                    <ProFormDigit
-                                        name="volume"
-                                        label="建置容积(㎡)::"
-                                        placeholder="请输入"
-                                        rules={[{ required: true, message: '建置容积不能为空!' }]}
-                                    />
-                                    <ProFormDigit
-                                        name="depreciationYear"
-                                        label="折旧年限:"
-                                        placeholder="请输入"
-                                        rules={[{ required: true, message: '折旧年限不能为空!' }]}
-                                    />
-                                    <Form.Item style={{ width: 322 }} label={<span style={{}}><i style={{ fontSize: 14, color: '#FF4060', fontWeight: 400, position: 'relative', paddingRight: 4, paddingLeft: 4 }}>*</i>停用:</span>}>
-                                        <div style={{ display: 'flex', flex: 1, flexDirection: 'row', justifyContent: 'space-between' }}>
-                                            <ProFormRadio.Group
-                                                name="status"
-                                                noStyle
-                                                colProps={{ span: 10 }}
-                                                options={[
-                                                    {
-                                                        label: '否',
-                                                        value: 0
-                                                    },
-                                                    {
-                                                        label: '是',
-                                                        value: 1
-                                                    }
-                                                ]}
-                                            />
-                                            {/* style={{position:'relative',left:-10}}  */}
-                                            <ProFormDependency name={['status']}>
-                                                {
-                                                    ({ status }) => {
-                                                        // console.log({report});
-                                                        return (
-
-                                                            status ? <ProFormDateTimePicker fieldProps={{ locale }} name="stopTime" colProps={{ span: 14 }} noStyle /> : null
-                                                        )
-                                                    }
-                                                }
-                                            </ProFormDependency>
-
-                                        </div>
-                                    </Form.Item>
-                                </>
-                            )
-                        }
-                    }
-                </ProFormDependency>
-            </ModalForm>
-        )
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-    const downloadTemplate = async () => {
-        await downloadTemplateReq('/costAccount/setting/exportSpaceCost');
-    };
-
-    const importData = () => {
-        return (
-            <ModalForm
-                width={360}
-                title={`导入数据`}
-                trigger={
-                    <a className="import" key="3">
-                        导入
-                    </a>
-                }
-                submitter={{
-                    render: (props, defaultDoms) => {
-                        const needBtn = defaultDoms.filter((b) => {
-                            return b.key != 'rest';
-                        });
-                        return [
-                            // <Button
-                            //     key="ok"
-                            //     onClick={auditType == '0' ? () => downloadTemplate(index) : () => { }}
-                            // >
-                            //     下载模板
-                            // </Button>,
-                            ...needBtn,
-                        ];
-                    },
-                }}
-                onFinish={async (values) => {
-                    const {
-                        importFile: { fileList },
-                    } = values;
-
-                    let formData = new FormData();
-                    formData.append('file', fileList[0].originFileObj);
-                    const resp = await importDataPost(formData);
-
-                    if (resp) {
-                        tableRef.current?.reload();
-                        return true;
-                    }
-                }}
-            >
-                <FormItem name={'importFile'}>
-                    <KCIMUpload downloadTemplateFile={() => downloadTemplate()} />
-                </FormItem>
-            </ModalForm>
-        );
-    };
-
-
-    useEffect(() => {
-
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='SpaceCostManagement' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 空间名称:</span>
-                        <Input placeholder={'请输入'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo"  style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('name')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        name: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    name: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    <span style={{ paddingRight: 16 }}><ProFormSwitch noStyle fieldProps={{
-                        size: 'small', onChange: (bool) => {
-                            set_stopStat(bool ? 1 : 0);
-                            tableRef.current?.reload();
-                        }
-                    }} /> 显示停用项目</span>
-                    {importData()}
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div style={{ marginTop: 16 }}>
-                <KCIMTable pagination={false} scroll={{y:`calc(100vh - 233px)`}}  columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

+ 0 - 55
src/pages/costLibraryManagement/basicCostManagement/spaceCostManagement/style.less

@@ -1,55 +0,0 @@
-.SpaceCostManagement {
-  padding: 16px;
-  background: #FFFFFF;
-  border-radius: 4px;
-
-
-  .toolBar {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-
-    .filter {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .filterItem {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-      }
-    }
-
-    .btnGroup {
-      .import {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #17181A;
-        line-height: 24px;
-        padding: 0 14px;
-        margin-right: 8px;
-        background: #FAFCFF;
-        border-radius: 4px;
-        border: 1px solid #DAE2F2;
-      }
-      .add {
-        cursor: pointer;
-        display: inline-block;
-        font-size: 14px;
-        font-weight: 400;
-        color: #FFFFFF;
-        line-height: 24px;
-        padding: 0 14px;
-        background: #3377FF;
-        border-radius: 4px;
-      }
-    }
-
-  }
-}

+ 0 - 341
src/pages/costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison/index.tsx

@@ -1,341 +0,0 @@
-/*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2023-03-03 11:30:33
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-09-09 10:47:11
- * @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
- */
-
-
-
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
-import { KCIMTable } from '@/components/KCIMTable';
-import { formatMoneyNumber } from '@/utils/format';
-import { createFromIconfontCN } from '@ant-design/icons';
-import FormItem from 'antd/es/form/FormItem';
-
-import { ActionType, ProFormInstance, ProFormText } from '@ant-design/pro-components';
-import { ModalForm,ProFormSelect, ProFormSwitch } from '@ant-design/pro-form'
-import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Modal } from 'antd';
-import { useEffect, useRef, useState } from 'react';
-
-import 'moment/locale/zh-cn';
-import locale from 'antd/es/date-picker/locale/zh_CN';
-
-
-
-import { addData, delData, editData, getDiseaseComparisonTableData, importDataPost, matchDiseaseTypeMap } from './service';
-
-import './style.less';
-import KCIMUpload from '@/components/KCIMUpload';
-import { downloadTemplateReq } from '@/utils/tooljs';
-import { getDiseaseTableData } from '../diseaseMana/service';
-
-
-const IconFont = createFromIconfontCN({
-    scriptUrl: '',
-});
-
-
-
-export default function DiseaseDiagnosisComparison() {
-
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const tableRef = useRef<ActionType>();
-    const formRef = useRef<ProFormInstance>();
-    const [stopStat, set_stopStat] = useState(0);
-    const columns: ProColumns[] = [
-
-        {
-            title: '诊断代码',
-            dataIndex: 'diagCode',
-        },
-        {
-            title: '诊断名称',
-            dataIndex: 'diagName',
-        },
-        {
-            title: '国家编码',
-            dataIndex: 'icdCode',
-        },
-        {
-            title: '病种编码',
-            dataIndex: 'diseaseTypeCode',
-        },
-        {
-            title: '病种名称',
-            dataIndex: 'diseaseTypeCodeName',
-        },
-        {
-            title: '操作',
-            key: 'option',
-            width: 90,
-            valueType: 'option',
-            render: (_: any, record: any) => {
-                return [
-                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
-                    <Popconfirm
-                        title="是否确认删除?"
-                        key="del"
-                        onConfirm={() => delTableData(record)}
-                    >
-                        <a>删除</a>
-                    </Popconfirm>,
-                ]
-            },
-        },
-
-    ]
-
-
-    const getTableData = async (params: any) => {
-        const resp = await getDiseaseComparisonTableData({ ...params,type:stopStat });
-        if (resp) {
-            return {
-                data: resp.list,
-                success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
-        }
-        return []
-    }
-
-    const delTableData = async (record: any) => {
-        const resp = await delData(record.id);
-        if (resp) {
-            message.success('操作成功!');
-            tableRef.current?.reload();
-            // message.success('操作成功!');
-        }
-    }
-
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
-        const result = {
-            ...formVal,
-            diseaseTypeCode:formVal.diseaseTypeCode == -1?'':formVal.diseaseTypeCode
-        }
-
-        if (type == 'ADD') {
-            const resp = await addData(result);
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-
-        }
-        if (type == 'EDIT') {
-
-            const resp = await editData({ 
-                ...result,
-                diseaseTypeCodeName:formVal.diseaseTypeCode == -1?'':formVal.diseaseTypeCodeName
-             });
-            if (resp) {
-                tableRef.current?.reload();
-                message.success('操作成功!');
-            }
-        }
-        return true;
-
-    }
-
-
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD'}) => {
-
-        return (
-            <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}诊断`}
-                width={350}
-                formRef={formRef}
-                initialValues={type == 'EDIT' ? {
-                    ...record,
-                    diseaseTypeCode:record.diseaseTypeCode?record.diseaseTypeCode:-1
-                } : {diseaseTypeCode:-1}}
-                trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <a className='add'>新增</a>
-                }
-                onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } :{ ...val}, type);
-                }}
-                modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
-            >
-                <ProFormText
-                    name="diagCode"
-                    label="诊断编码:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '诊断编码不能为空!' }]}
-                />
-                <ProFormText
-                    name="diagName"
-                    label="诊断名称:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '诊断名称不能为空!' }]}
-                />
-                <ProFormText
-                    name="icdCode"
-                    label="国家编码:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '国家编码不能为空!' }]}
-                />
-                <ProFormSelect
-                    name="diseaseTypeCode"
-                    label="病种名称:"
-                    placeholder="请输入"
-                    showSearch
-                    request={async()=>{
-                          const resp = await getDiseaseTableData({pageSize:500,current:1});
-                          if(resp){
-                              const arr = resp.list.map((a:any)=>({label:`${a.name}(${a.code})`,value:a.code}));
-                              return [
-                                {label:'暂不选择',value:-1},
-                                ...arr
-                              ]
-                          }
-                          return []
-                    }}
-                    fieldProps={{
-                          onChange(value, option) {
-                                console.log({value});
-                                if(!value){
-                                     formRef.current?.setFieldValue('diseaseTypeCode',undefined);
-                                }
-                          },
-                    }}
-                />
-            </ModalForm>
-        )
-    }
-
-    const tableDataSearchHandle = (paramName: string) => {
-
-        set_tableDataFilterParams({
-            ...tableDataFilterParams,
-            [`${paramName}`]: tableDataSearchKeywords
-        })
-
-    }
-
-
-    const downloadTemplate = async () => {
-        await downloadTemplateReq('/costAccount/setting/exportDiseaseTypeMap');
-    };
-
-    const mapBtnHandle = () => {
-
-        Modal.confirm({
-          title: '注意',
-          content: '对照操作只会自动匹配未对照的项目,是否继续操作?',
-          okText:'确定',
-          cancelText:'取消',
-          onOk: async (...args) => {
-            const resp = await matchDiseaseTypeMap();
-            if (resp) {
-              message.success('操作成功!');
-              tableRef.current?.reload();
-            }
-          },
-        })
-    }
-
-    const importData = () => {
-        return (
-            <ModalForm
-                width={360}
-                title={`导入数据`}
-                trigger={
-                    <a className="import" key="3">
-                        导入  
-                    </a>
-                }
-                submitter={{
-                    render: (props, defaultDoms) => {
-                        const needBtn = defaultDoms.filter((b) => {
-                            return b.key != 'rest';
-                        });
-                        return [
-                            ...needBtn,
-                        ];
-                    },
-                }}
-                onFinish={async (values) => {
-                    const {
-                        importFile: { fileList },
-                    } = values;
-
-                    let formData = new FormData();
-                    formData.append('file', fileList[0].originFileObj);
-                    const resp = await importDataPost(formData);
-
-                    if (resp) {
-                        tableRef.current?.reload();
-                        return true;
-                    }
-                }}
-            >
-                <FormItem name={'importFile'}>
-                    <KCIMUpload downloadTemplateFile={() => downloadTemplate()} />
-                </FormItem>
-            </ModalForm>
-        );
-    };
-
-
-    useEffect(() => {
-
-    }, [])
-
-    return (
-        <KCIMPagecontainer className='DiseaseDiagnosisComparison' title={false}>
-            <div className='toolBar'>
-                <div className='filter'>
-                    <div className='filterItem'>
-                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
-                        <Input placeholder={'诊断名称/国家编码'} allowClear autoComplete='off'
-                            suffix={
-                                <IconFont type="iconsousuo"  style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('name')} />
-                            }
-                            onChange={(e) => {
-                                set_tableDataSearchKeywords(e.target.value);
-                                if (e.target.value.length == 0) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
-                                        name: ''
-                                    });
-                                }
-                            }}
-                            onPressEnter={(e) => {
-
-                                set_tableDataFilterParams({
-                                    ...tableDataFilterParams,
-                                    name: (e.target as HTMLInputElement).value
-                                });
-                            }}
-
-                        />
-                    </div>
-                </div>
-                <div className='btnGroup'>
-                    <span style={{ paddingRight: 16 }}><ProFormSwitch noStyle fieldProps={{
-                        size: 'small', onChange: (bool) => {
-                            set_stopStat(bool ? 1 : 0);
-                            tableRef.current?.reload();
-                        }
-                    }} /> 显示未对照项目</span>
-                    <span className='mapBtn' onClick={()=>mapBtnHandle()}>对照</span>
-                    {importData()}
-                    <UpDataActBtn record type='ADD' />
-                </div>
-            </div>
-
-            <div style={{ marginTop: 16 }}>
-                <KCIMTable  scroll={{y:`calc(100vh - 233px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
-            </div>
-        </KCIMPagecontainer>
-    )
-}

Некоторые файлы не были показаны из-за большого количества измененных файлов