Преглед на файлове

添加2023-11-25周功能

code4eat преди 1 година
родител
ревизия
efffc87217
променени са 91 файла, в които са добавени 11226 реда и са изтрити 352 реда
  1. BIN
      .DS_Store
  2. 119 8
      .umirc.ts
  3. 3 5
      src/app.tsx
  4. 3 2
      src/components/KCIMTable/index.tsx
  5. 1 0
      src/components/KCIMTable/style.less
  6. 193 0
      src/components/KCIMTableSelector/index.tsx
  7. 33 0
      src/components/KCIMTableSelector/style.less
  8. 8 0
      src/global.less
  9. 250 0
      src/pages/baseSetting/accountingAccountSet/accountingSubMana/index.tsx
  10. 73 0
      src/pages/baseSetting/accountingAccountSet/accountingSubMana/service.ts
  11. 42 0
      src/pages/baseSetting/accountingAccountSet/accountingSubMana/style.less
  12. 185 0
      src/pages/baseSetting/accountingAccountSet/accountingSubMap/index.tsx
  13. 82 0
      src/pages/baseSetting/accountingAccountSet/accountingSubMap/service.ts
  14. 42 0
      src/pages/baseSetting/accountingAccountSet/accountingSubMap/style.less
  15. 293 0
      src/pages/baseSetting/accountingAccountSet/costIncomeProjectMana/index.tsx
  16. 80 0
      src/pages/baseSetting/accountingAccountSet/costIncomeProjectMana/service.ts
  17. 56 0
      src/pages/baseSetting/accountingAccountSet/costIncomeProjectMana/style.less
  18. 309 0
      src/pages/baseSetting/costAllocationSet/allocationLevelSet/index.tsx
  19. 75 0
      src/pages/baseSetting/costAllocationSet/allocationLevelSet/service.ts
  20. 42 0
      src/pages/baseSetting/costAllocationSet/allocationLevelSet/style.less
  21. 183 0
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/editTableModal.tsx
  22. 458 0
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/index.tsx
  23. 133 0
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/service.ts
  24. 90 0
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/style.less
  25. 186 0
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/tableSelector.tsx
  26. 301 0
      src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/index.tsx
  27. 87 0
      src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/service.ts
  28. 42 0
      src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/style.less
  29. 170 0
      src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/transform.tsx
  30. 369 0
      src/pages/baseSetting/costAllocationSet/revenueImputationSet/index.tsx
  31. 92 0
      src/pages/baseSetting/costAllocationSet/revenueImputationSet/service.ts
  32. 35 0
      src/pages/baseSetting/costAllocationSet/revenueImputationSet/style.less
  33. 155 0
      src/pages/baseSetting/costAllocationSet/revenueImputationSet/transform.tsx
  34. 316 0
      src/pages/baseSetting/otherItemSet/reportProjectSetting/index.tsx
  35. 69 0
      src/pages/baseSetting/otherItemSet/reportProjectSetting/service.js
  36. 92 0
      src/pages/baseSetting/otherItemSet/reportProjectSetting/style.less
  37. 300 0
      src/pages/baseSetting/otherItemSet/visitsAndBedDayCostSetting/index.tsx
  38. 76 0
      src/pages/baseSetting/otherItemSet/visitsAndBedDayCostSetting/service.ts
  39. 42 0
      src/pages/baseSetting/otherItemSet/visitsAndBedDayCostSetting/style.less
  40. 205 0
      src/pages/baseSetting/otherItemSet/wholeHospCostAndIncomeSet/index.tsx
  41. 73 0
      src/pages/baseSetting/otherItemSet/wholeHospCostAndIncomeSet/service.ts
  42. 34 0
      src/pages/baseSetting/otherItemSet/wholeHospCostAndIncomeSet/style.less
  43. 364 0
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenter/index.tsx
  44. 83 0
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenter/service.ts
  45. 56 0
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenter/style.less
  46. 187 0
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenterConnect/index.tsx
  47. 39 0
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenterConnect/service.ts
  48. 56 0
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenterConnect/style.less
  49. 136 0
      src/pages/baseSetting/responsibilityCenterSet/responsibilityCenterConnect/transform.tsx
  50. 83 0
      src/pages/costAccounting/calcPageTemplate/columns.tsx
  51. 12 2
      src/pages/costAccounting/calcPageTemplate/config.ts
  52. 9 3
      src/pages/costAccounting/calcPageTemplate/index.tsx
  53. 13 1
      src/pages/costAccounting/calcPageTemplate/service.ts
  54. 10 7
      src/pages/costLibraryManagement/basicCostManagement/drugCostManagement/index.tsx
  55. 22 30
      src/pages/costLibraryManagement/basicCostManagement/equipmentCostManagement/index.tsx
  56. 14 9
      src/pages/costLibraryManagement/basicCostManagement/materialCostManagement/index.tsx
  57. 2 30
      src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/index.tsx
  58. 391 0
      src/pages/costLibraryManagement/basicCostManagement/spaceCostManagement/index.tsx
  59. 96 0
      src/pages/costLibraryManagement/basicCostManagement/spaceCostManagement/service.ts
  60. 55 0
      src/pages/costLibraryManagement/basicCostManagement/spaceCostManagement/style.less
  61. 347 0
      src/pages/costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison/index.tsx
  62. 101 0
      src/pages/costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison/service.ts
  63. 56 0
      src/pages/costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison/style.less
  64. 285 0
      src/pages/costLibraryManagement/diseaseCostManagement/diseaseMana/index.tsx
  65. 98 0
      src/pages/costLibraryManagement/diseaseCostManagement/diseaseMana/service.ts
  66. 56 0
      src/pages/costLibraryManagement/diseaseCostManagement/diseaseMana/style.less
  67. 583 0
      src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/index.tsx
  68. 142 0
      src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/service.ts
  69. 238 0
      src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/style.less
  70. 201 0
      src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/tableSelector.tsx
  71. 348 0
      src/pages/costLibraryManagement/projectCostManagement/chargeItemsMana/index.tsx
  72. 112 0
      src/pages/costLibraryManagement/projectCostManagement/chargeItemsMana/service.ts
  73. 55 0
      src/pages/costLibraryManagement/projectCostManagement/chargeItemsMana/style.less
  74. 449 0
      src/pages/costLibraryManagement/projectCostManagement/standardProjectMana/drawer.tsx
  75. 391 0
      src/pages/costLibraryManagement/projectCostManagement/standardProjectMana/index.tsx
  76. 181 0
      src/pages/costLibraryManagement/projectCostManagement/standardProjectMana/service.ts
  77. 237 0
      src/pages/costLibraryManagement/projectCostManagement/standardProjectMana/style.less
  78. 57 51
      src/pages/costLibraryManagement/reportMana/reportColumnMana/index.tsx
  79. 3 4
      src/pages/costLibraryManagement/reportMana/reportListMana/index.tsx
  80. 2 2
      src/pages/costLibraryManagement/reportMana/reportListMana/service.ts
  81. 4 4
      src/pages/costLibraryManagement/reportMana/reportNavSet/index.tsx
  82. 125 116
      src/pages/monthlyInfoSearch/patientChargeItemsImport/index.tsx
  83. BIN
      src/pages/reportExport/.DS_Store
  84. 14 4
      src/pages/reportExport/report/index.tsx
  85. 0 0
      src/pages/reportExport/report/service.ts
  86. 0 0
      src/pages/reportExport/report/style.less
  87. 116 74
      src/utils/tooljs.ts
  88. BIN
      static/cancel.png
  89. BIN
      成本核算系统_2023_11_10.zip
  90. BIN
      成本核算系统_2023_11_17.zip
  91. BIN
      成本核算系统_2023_11_24.zip

BIN
.DS_Store


+ 119 - 8
.umirc.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-07 17:34:18
+ * @LastEditTime: 2023-11-21 10:50:25
  * @FilePath: /BudgetManaSystem/.umirc.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -50,7 +50,6 @@ export default defineConfig({
   },
   publicPath: REACT_APP_ENV == 'dev' ? '/' : '/costAccount/',
   proxy: {
-
     '/gateway': {
       target: 'http://120.27.235.181:5000/gateway',//开发
       //target:'http://47.96.149.190:5000/gateway', //演示
@@ -71,8 +70,70 @@ export default defineConfig({
     {
       path: '/baseSetting',
       name: '基础设置',
-      icon: 'tool',
       routes: [
+        {
+          path: '/baseSetting/responsibilityCenterSet',
+          name: '责任中心设置',
+          routes: [
+            {
+              path: '/baseSetting/responsibilityCenterSet/responsibilityCenter',
+              name: '责任中心管理',
+              component: './baseSetting/responsibilityCenterSet/responsibilityCenter/index',
+            },
+            {
+              path: '/baseSetting/responsibilityCenterSet/responsibilityCenterConnect',
+              name: '责任中心对应',
+              component: './baseSetting/responsibilityCenterSet/responsibilityCenterConnect/index',
+            },
+          ],
+        },
+        {
+          path: '/baseSetting/accountingAccountSet',
+          name: '会计科目设置',
+          routes: [
+            {
+              path: '/baseSetting/accountingAccountSet/costIncomeProjectMana',
+              name: '会计收入项目管理',
+              component: './baseSetting/accountingAccountSet/costIncomeProjectMana/index',
+            },
+            {
+              path: '/baseSetting/accountingAccountSet/accountingSubMana',
+              name: '会计科目管理',
+              component: './baseSetting/accountingAccountSet/accountingSubMana/index',
+            },
+            {
+              path: '/baseSetting/accountingAccountSet/accountingSubMap',
+              name: '会计科目对应',
+              component: './baseSetting/accountingAccountSet/accountingSubMap/index',
+            },
+          ],
+        },
+        {
+          path: '/baseSetting/costAllocationSet',
+          name: '成本分摊设置',
+          routes: [
+            {
+              path: '/baseSetting/costAllocationSet/allocationLevelSet',
+              name: '分摊层级设置',
+              component: './baseSetting/costAllocationSet/allocationLevelSet/index',
+            },
+            {
+              path: '/baseSetting/costAllocationSet/costAllocationParamsSet',
+              name: '成本分摊参数设置',
+              component: './baseSetting/costAllocationSet/costAllocationParamsSet/index',
+            },
+            {
+              path: '/baseSetting/costAllocationSet/allocationParamsMap',
+              name: '分摊参数对应',
+              component: './baseSetting/costAllocationSet/allocationParamsMap/index',
+            },
+            {
+              path: '/baseSetting/costAllocationSet/revenueImputationSet',
+              name: '收入归集设置',
+              component: './baseSetting/costAllocationSet/revenueImputationSet/index',
+            },
+          ],
+        },
         {
           path: '/baseSetting/otherItemSet',
           name: '其它设置',
@@ -83,6 +144,16 @@ export default defineConfig({
               name: '报表项目设置',
               component: './baseSetting/otherItemSet/reportItemSet/index',
             },
+            {
+              path: '/baseSetting/otherItemSet/visitsAndBedDayCostSetting',
+              name: '诊次/床日成本设置',
+              component: './baseSetting/otherItemSet/visitsAndBedDayCostSetting/index',
+            },
+            {
+              path: '/baseSetting/otherItemSet/wholeHospCostAndIncomeSet',
+              name: '全院其他收支设置',
+              component: './baseSetting/otherItemSet/wholeHospCostAndIncomeSet/index',
+            },
           ],
         },
       ],
@@ -123,9 +194,15 @@ export default defineConfig({
       name: '报表输出',
       routes: [
         {
-          path: '/reportExport/report/:reportCode',
-          component: './reportCheck/report',
-        },
+          path: '/reportExport/:reportType',
+          routes: [
+            {
+              path: '/reportExport/:reportType/:reportCode',
+              component: './reportExport/report',
+            },
+          ]
+        }
+        
       ],
     },
     {
@@ -163,20 +240,54 @@ export default defineConfig({
               name: '设备成本管理',
               component: './costLibraryManagement/basicCostManagement/equipmentCostManagement/index',
             },
+            {
+              path: '/costLibraryManagement/basicCostManagement/spaceCostManagement',
+              name: '空间成本管理',
+              component: './costLibraryManagement/basicCostManagement/spaceCostManagement/index',
+            },
           ],
         },
         {
           path: '/costLibraryManagement/projectCostManagement',
           name: '项目成本管理',
           routes: [
-            {}
+            {
+              path: '/costLibraryManagement/projectCostManagement/chargeItemsMana',
+              name: '收费项目管理',
+              component: './costLibraryManagement/projectCostManagement/chargeItemsMana/index',
+            },
+            {
+              path: '/costLibraryManagement/projectCostManagement/standardProjectMana',
+              name: '标准项目管理',
+              component: './costLibraryManagement/projectCostManagement/standardProjectMana/index',
+            },
+          ],
+        },
+        {
+          path: '/costLibraryManagement/medicalOrderProject',
+          name: '医嘱项目',
+          routes: [
+            {
+              path: '/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana',
+              name: '收费项目管理',
+              component: './costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/index',
+            },
           ],
         },
         {
           path: '/costLibraryManagement/diseaseCostManagement',
           name: '病种成本管理',
           routes: [
-            {}
+            {
+              path: '/costLibraryManagement/diseaseCostManagement/diseaseMana',
+              name: '病种管理',
+              component: './costLibraryManagement/diseaseCostManagement/diseaseMana/index',
+            },
+            {
+              path: '/costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison',
+              name: '病种诊断对照',
+              component: './costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison/index',
+            },
           ],
         },
         {

+ 3 - 5
src/app.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-07 10:50:49
+ * @LastEditTime: 2023-11-09 20:53:19
  * @FilePath: /BudgetManaSystem/src/app.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -416,9 +416,7 @@ export const layout = ({ initialState, setInitialState }: { initialState: any, s
             }
 
             const _menu = processMenu(data);
-
-            console.log({ _menu });
-
+            
             setInitialState((t: any) => ({ ...t, spacicalPageParamsType: _menu, memuData: data, userData: JSON.parse(userData as string) }));
 
 
@@ -428,6 +426,7 @@ export const layout = ({ initialState, setInitialState }: { initialState: any, s
                   node.icon = <Icon component={imgNode} />;
                 }
                 if (node.path == '/baseSetting') {
+                  
                   node.icon = <Icon component={setting} />;
                 }
                 if (node.path == '/monthlyInfoSearch') {
@@ -445,7 +444,6 @@ export const layout = ({ initialState, setInitialState }: { initialState: any, s
                 if (node.path == '/static') {
                   node.icon = <Icon component={()=><IconFont type='icon-baobiaochaxun' />} />;
                 }
-
               }
               if (node.children) {
                 node.children.forEach((child: any) => addIconToPath(child, paths));

+ 3 - 2
src/components/KCIMTable/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-20 15:24:11
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-10-09 13:53:34
+ * @LastEditTime: 2023-11-22 16:36:30
  * @FilePath: /BudgetManaSystem/src/components/BMSTable/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -22,7 +22,7 @@ export const KCIMTablePageDefaultConfig = {
 
 export const KCIMTable = (props: KCIMTablePropsType<any, any, any>) => {
 
-    const { params,options = false,request,...rest } = props;
+    const { params,options = false,request,columns,...rest } = props;
     const [prevParams,set_prevParams] = useState<any>(undefined);
 
     useEffect(()=>{
@@ -45,6 +45,7 @@ export const KCIMTable = (props: KCIMTablePropsType<any, any, any>) => {
             tableClassName="KCIMTable"
             toolBarRender={false}
             options={options}
+            columns={columns?.map(a=>({...a,ellipsis:true}))}
             pagination={{
                    showSizeChanger:true,
                    ...KCIMTablePageDefaultConfig

+ 1 - 0
src/components/KCIMTable/style.less

@@ -62,6 +62,7 @@
                     color: #3376FE;
                 }
 
+
                 .cost-ant-table-selection {
                     .cost-ant-table-selection-extra {
                         top: 5px;

+ 193 - 0
src/components/KCIMTableSelector/index.tsx

@@ -0,0 +1,193 @@
+import React, { Key, useEffect, useState } from "react";
+
+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 './style.less'
+
+interface TableSelecterProps {
+    record: any
+}
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
+
+
+
+const TableSelecter = (
+    { 
+        record, 
+        open, 
+        title, 
+        columns,
+        onVisibleChange,
+        rowKey = 'id',
+        request, 
+        tableData,
+        onFinish,
+        defaultSelectedKeys,
+    }: 
+    {
+        record: any,
+        columns:ProColumns[],
+        open: boolean,
+        title: string,
+        tableData?:any[],
+        onVisibleChange: (bool: boolean) => void,
+        defaultSelectedKeys: Key[],
+        rowKey?: string,
+        request?: () => 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 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 = !tableData&&request?await request():tableData;
+
+            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(()=>{
+        //     (record)&&getTableData(record)
+        // },[record])
+
+        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

+ 33 - 0
src/components/KCIMTableSelector/style.less

@@ -0,0 +1,33 @@
+.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;
+             }
+         }
+  
+    }
+  }

+ 8 - 0
src/global.less

@@ -386,6 +386,14 @@ textarea {
     z-index: 0 !important;
 }
 
+.cost-ant-pro .cost-ant-pro-layout .cost-ant-pro-sider-menu {
+    height: calc(100vh - 200px) !important;
+    overflow-y: scroll !important;
+}
+
+.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{
+     height: calc(100vh - 90px) !important;
+}
 
 .cost-ant-pro-base-menu .cost-ant-pro-base-menu-submenu-has-icon >.cost-ant-menu-sub {
     padding-inline-start:0 !important;

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

@@ -0,0 +1,250 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-13 17:31:15
+ * @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 { addData, delData, editData, getAccountingSubjectList } from './service';
+
+import './style.less';
+
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
+
+
+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 [currentRow, setCurrentRow] = useState<any | undefined>(undefined);
+    const [selectableLevelList, setSelectableLevelList] = useState([]);//可选的分摊层级列表
+    const [tabs, set_tabs] = useState<any[]>([]);
+    const [accountType, set_accountType] = useState<Key>(1);
+    const columns: ProColumns[] = [
+
+        {
+            title: '会计科目名称',
+            dataIndex: 'accountingName',
+        },
+        {
+            title: '会计科目编码',
+            dataIndex: 'accountingCode',
+        },
+        {
+            title: '操作',
+            key: 'option',
+            width: 120,
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                return [
+                    <UpDataActBtn 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 resp = await getAccountingSubjectList({ ...params,accountType });
+        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" | "ADDCHILD") => {
+
+        if (type == 'ADD' || type == 'ADDCHILD') {
+
+            let id = 0;
+            (currentRow && type == 'ADDCHILD') && (id = currentRow.id);
+    
+            const result = { ...formVal,accountingType:accountType, id: id};
+
+            const resp = await addData(result);
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+
+        }
+        if (type == 'EDIT') {
+            console.log({formVal});
+            try {
+                const resp = await editData({ ...formVal,isBaseCost:formVal.isBaseCost,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' }) => {
+        setCurrentRow(record);
+        return (
+            <ModalForm
+                title={`${type == 'EDIT' ? '编辑' : '新增'}会计科目`}
+                width={350}
+                formRef={formRef}
+                initialValues={type == 'EDIT' ? {
+                    ...record,
+                } : {}}
+                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 } : { ...val }, type);
+                }}
+                modalProps={{ destroyOnClose: true }}
+                colProps={{ span: 24 }}
+                grid
+            >
+                <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="是否固定成本"
+                                />
+                            ) : <></>
+                        }
+                    }
+                </ProFormDependency>
+            </ModalForm>
+        )
+    }
+
+    const onTabChanged = (key: Key) => {
+        set_accountType(key);
+        tableRef.current?.reload();
+    }
+
+    useEffect(() => {
+        set_tabs([
+            {
+                label: '收入',
+                key: 1,
+            },
+            {
+                label: '支出',
+                key: 2,
+            },
+        ])
+    }, [])
+
+    return (
+        <KCIMPagecontainer className='AccountingSubMana' title={false}>
+            <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 className='btnGroup'>
+                    <UpDataActBtn record type='ADD' />
+                </div>
+            </div>
+
+            <div>
+                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

+ 73 - 0
src/pages/baseSetting/accountingAccountSet/accountingSubMana/service.ts

@@ -0,0 +1,73 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-13 17:20: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 getAccountingSubjectList = (params:any) => {
+  return request('/costAccount/accounting/list', {
+    method: 'GET',
+    params:{...params},
+  });
+}
+
+
+
+//新增
+export type AddTableDataType = {
+  code:string,
+  name:string,
+  description:string
+}
+
+export const addData = (data:AddTableDataType) => {
+  return request('/costAccount/accounting/save', {
+    method: 'POST',
+    data:{...data}
+  });
+};
+
+
+
+//编辑表格数据
+
+export type TableRowEditType = {
+  id:number;
+}&AddTableDataType
+
+export const editData = (data:any) => {
+  return request('/costAccount/accounting/edit', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (id:string) => {
+  return request('/costAccount/accounting/delete', {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+

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

@@ -0,0 +1,42 @@
+.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;
+        }
+    }
+  }
+}

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

@@ -0,0 +1,185 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-14 11:31:58
+ * @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 { addData, delData, editData, getAccountProductConnectableList, getAccountProductConnectList } from './service';
+
+import './style.less';
+import TableSelecter from '@/components/KCIMTableSelector';
+
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
+
+const tableSelectorColumns = [
+    {
+        title: 'Id',
+        dataIndex: 'id',
+    },
+    {
+        title: '成本收入项目',
+        dataIndex: 'name',
+    },
+]
+
+
+
+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 [currentRow, setCurrentRow] = useState<any | undefined>(undefined);
+    const [tabs, set_tabs] = useState<any[]>([]);
+    const [accountType, set_accountType] = useState<Key>(1);
+    const [tableSelecterVisible,set_tableSelecterVisible] = useState(false);
+    const columns: ProColumns[] = [
+
+        {
+            title: '会计科目名称',
+            dataIndex: 'accountingName',
+        },
+        {
+            title: '会计科目编码',
+            dataIndex: 'accountingCode',
+        },
+        {
+            title: '成本列表',
+            dataIndex: 'productVOs',
+            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: 120,
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                const { isParent } = record;
+                return !isParent ? [
+                  <a
+                    key="config"
+                    onClick={() => {
+                      setCurrentRow(record);
+                      set_tableSelecterVisible(true);
+                    }}
+                  >
+                    设置对应
+                  </a>,
+                ] : []
+            },
+        },
+
+    ]
+
+
+    const getTableData = async (params: any) => {
+        const resp = await getAccountProductConnectList({ ...params, accountType });
+        if (resp) {
+            return {
+                data: resp.list,
+                success: true,
+                total: resp.totalCount,
+                pageSize: resp.pageSize,
+                totalPage: resp.totalPage,
+            }
+        }
+        return []
+    }
+
+
+    
+
+    const onTabChanged = (key: Key) => {
+        set_accountType(key);
+        tableRef.current?.reload();
+    }
+
+    const getTableSelectorData = async () => {
+        const {responsibilityId} = currentRow;
+        const resp = await getAccountProductConnectableList({responsibilityId,pageSize:500,current:1});
+        return resp
+        
+    }
+
+
+    const tableSelecterCommit = async (keys:Key[],rows:any[]) => {
+        
+    }
+
+    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={[]}
+                record={currentRow}
+                open={tableSelecterVisible}
+                onFinish={(keys, rows) => tableSelecterCommit(keys, rows)}
+            />
+            <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 className='btnGroup'>
+                    <UpDataActBtn record type='ADD' />
+                </div> */}
+            </div>
+
+            <div>
+                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

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

@@ -0,0 +1,82 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-14 11:13:37
+ * @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 type AddTableDataType = {
+  code:string,
+  name:string,
+  description:string
+}
+
+export const addData = (data:AddTableDataType) => {
+  return request('/costAccount/accounting/save', {
+    method: 'POST',
+    data:{...data}
+  });
+};
+
+
+
+//编辑表格数据
+
+export type TableRowEditType = {
+  id:number;
+}&AddTableDataType
+
+export const editData = (data:any) => {
+  return request('/costAccount/accounting/edit', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (id:string) => {
+  return request('/costAccount/accounting/delete', {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+

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

@@ -0,0 +1,42 @@
+.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;
+        }
+    }
+  }
+}

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

@@ -0,0 +1,293 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-13 16:12:56
+ * @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
+                            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 columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

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

@@ -0,0 +1,80 @@
+/*
+ * @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]
+  });
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 56 - 0
src/pages/baseSetting/accountingAccountSet/costIncomeProjectMana/style.less

@@ -0,0 +1,56 @@
+.CostIncomeProjectMana {
+  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;
+      }
+    }
+
+  }
+}

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

@@ -0,0 +1,309 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-16 17:39:01
+ * @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: 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 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") => {
+
+        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)).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='请选择'
+                                            
+                                        >
+                                            {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
+                            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 columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

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

@@ -0,0 +1,75 @@
+/*
+ * @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]
+  });
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+

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

@@ -0,0 +1,42 @@
+.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;
+        }
+    }
+  }
+}

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

@@ -0,0 +1,183 @@
+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:{
+                    onSelect:(a: any,b: any,c:any)=>{
+                        currentSelectedRow = b;
+                    }
+                }
+            },
+            {
+                title: '分摊比例',
+                dataIndex: 'shareParamPopout',
+                ellipsis:true,
+                valueType:'digit'
+            }, 
+            {
+                title: '操作',
+                valueType: 'option',
+                render: (text, record, _, action) => [
+                  <a
+                    key="editable"
+                    onClick={() => {
+                      action?.startEditable?.(record.id);
+                    }}
+                  >
+                    编辑
+                  </a>,
+                  <a
+                    key="delete"
+                    onClick={() => {
+                    //   setDataSource(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

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

@@ -0,0 +1,458 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-20 15:29:57
+ * @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: '分摊级别',
+            ellipsis:true,
+            dataIndex: 'shareLevel',
+        },
+        {
+            title: '责任中心编码',
+            ellipsis:true,
+            dataIndex: 'responsibilityCode',
+        },
+        {
+            title: '责任中心名',
+            ellipsis:true,
+            dataIndex: 'responsibilityName',
+        },
+        {
+            title: '会计科目名称',
+            ellipsis:true,
+            dataIndex: 'accountingNames',
+        },
+        {
+            title: '会计科目编码',
+            ellipsis:true,
+            dataIndex: 'accountingCodes',
+        },
+        {
+            title: '别名',
+            ellipsis:true,
+            dataIndex: 'alias',
+        },
+        {
+            title: '备注',
+            ellipsis:true,
+            dataIndex: 'costNode',
+        },
+        {
+            title: '操作',
+            key: 'option',
+            width:200,
+            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") => {
+
+        const result = {
+            responsibilityId: formVal.responsibilityId,
+            accountingIds: formVal.accountingIds.join(','),
+            isShareCost: formVal.isShareCost,
+            alias: formVal.alias,
+            costNode: formVal.costNode,
+            responsibilityName: formVal.responsibility.responsibilityName,
+            shareLevel: formVal.responsibility.shareLevel,
+            responsibilityCode: formVal.responsibility.responsibilityCode
+        };
+
+        if (type == 'ADD') {
+            const resp = await addData(result);
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+
+        }
+        if (type == 'EDIT') {
+
+            try {
+                const resp = await editData({ ...formVal, isBaseCost: formVal.isBaseCost, 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' }) => {
+
+        const [ifDisable, setIfDisable] = useState(false);
+        let needDisableIds: any[] = [];
+        let accountingIds:Key[] = [];
+
+        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,accountingIds } : { ...val,accountingIds }, type);
+                }}
+                modalProps={{ destroyOnClose: true }}
+                colProps={{ span: 24 }}
+                grid
+            >
+                <ProFormText name="responsibility" hidden />
+                <ProFormSelect
+                    rules={[
+                        {
+                            required: true,
+                            message: '请选择责任中心',
+                        },
+                    ]}
+                    fieldProps={{
+                        onChange: async (val, option: any) => {
+                            const { } = option;
+                            const resp = await getResponsibilityCenterSelecterList();
+                            // const resp = [
+                            //     {
+                            //         calcType: 1,
+                            //         id: 401,
+                            //         responsibilityCode: "B0100",
+                            //         responsibilityId: 401,
+                            //         responsibilityName: "公共费用",
+                            //         shareId: 59,
+                            //         shareLevel: 1,
+                            //         shareName: "公共费用",
+                            //     }
+                            // ]
+                            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, pageSize: 500, current: 1 });
+
+                        // const resp = {
+                        //     list: [
+                        //         {
+                        //             accountingCode: "C0160",
+                        //             accountingName: "其他支出",
+                        //             id: 259,
+                        //             isBaseCost: 0,
+                        //             isIncomeGroutSetSelect: false,
+                        //             isShareParamSelect: false,
+                        //             children: [
+                        //                 {
+                        //                     accountingCode: "C0164",
+                        //                     accountingName: "社会服务辅助",
+                        //                     id: 263,
+                        //                     isBaseCost: 0,
+                        //                     isIncomeGroutSetSelect: false,
+                        //                     isShareParamSelect: false,
+                        //                 }
+                        //             ]
+                        //         }
+                        //     ]
+                        // };
+                        if (resp) {
+                            return resp.list
+                        }
+                        return []
+                    }}
+                    fieldProps={{
+                        showSearch: true,
+                        multiple: true,
+                        treeCheckable:true,
+                        treeNodeFilterProp: 'accountingName',
+                        showCheckedStrategy:'SHOW_CHILD',
+                        fieldNames: {
+                            label: 'accountingName',
+                            value: 'id'
+                        },
+                        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 = accountingIds.concat(ids);
+                            }else{
+                                accountingIds.push(value);
+                            }
+                        }
+                    }}
+                    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
+                            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 columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

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

@@ -0,0 +1,133 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-20 15:28:55
+ * @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 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/accounting/save', {
+    method: 'POST',
+    data:{...data}
+  });
+};
+
+
+
+//编辑表格数据
+
+export type TableRowEditType = {
+  id:number;
+}&AddTableDataType
+
+export const editData = (data:any) => {
+  return request('/costAccount/accounting/edit', {
+    method: 'POST',
+    data
+  });
+};
+
+
+//保存成本分摊参数
+export const saveParamsList = (data:any) => {
+  return request(`/costAccount/costaccountshare/updateShareParam`, {
+    method: 'POST',
+    data
+  });
+}
+
+
+
+//删除表格操作
+export const delData = (id:string) => {
+  return request('/costAccount/accounting/delete', {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+
+
+
+
+//获取责任中心选择列表
+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,
+  });
+
+}
+
+
+
+
+
+
+
+
+
+
+

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

@@ -0,0 +1,90 @@
+
+.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;
+        }
+    }
+  }
+}

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

@@ -0,0 +1,186 @@
+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

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

@@ -0,0 +1,301 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-16 17:39: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 } 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: '成本分摊参数编号',
+            dataIndex: 'shareParamCode',
+        },
+        {
+            title: '计算方式',
+            dataIndex: 'calcType',
+            renderText(text, record) {
+                return text.calcType == 1 ? '手动填写' : '按对应会计科目计算'
+            },
+        },
+        {
+            title: '操作',
+            key: 'option',
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                return [
+                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
+                    <Popconfirm
+                        title="是否确认删除?"
+                        key="del"
+                        onConfirm={() => delTableData(record)}
+                    >
+                        <a>删除</a>
+                    </Popconfirm>,
+                    <a key={'bind'} onClick={() => {oprnTableTransform(record)}}>会计科目</a>
+                ]
+            },
+        },
+
+    ]
+
+
+    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
+                            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 columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

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

@@ -0,0 +1,87 @@
+/*
+ * @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}
+  });
+}
+
+
+
+
+
+
+
+
+
+
+
+
+

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

@@ -0,0 +1,42 @@
+.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;
+        }
+    }
+  }
+}

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

@@ -0,0 +1,170 @@
+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";
+
+
+
+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 [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);
+            // setTargetKeys(accountingIds);
+        }
+
+    }
+
+    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);
+        }
+    }));
+
+
+    const onTabChanged = (key:string) => {
+        set_accountType(Number(key));
+    }
+
+    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}
+                key={'key'}
+                onChange={(key) => onTabChanged(key)}
+            />
+            <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}
+                            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
+
+

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

@@ -0,0 +1,369 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-20 17:35: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, 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: '开单科室分配比例',
+            dataIndex: 'openDepartmentProportion',
+        },
+        {
+            title: '执行科室',
+            dataIndex: 'startDepartmentStatus',
+            renderText(num) {
+                return num == 1 ? '收益中心' : '成本中心'
+            },
+        },
+        {
+            title: '执行科室比例',
+            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 columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

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

@@ -0,0 +1,92 @@
+/*
+ * @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',
+  });
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+

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

@@ -0,0 +1,35 @@
+.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;
+      }
+    }
+  }
+}

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

@@ -0,0 +1,155 @@
+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
+
+

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

@@ -0,0 +1,316 @@
+/*
+ * @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>
+  );
+}

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

@@ -0,0 +1,69 @@
+/*
+ * @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}
+  });
+};
+
+
+
+
+
+
+
+

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

@@ -0,0 +1,92 @@
+
+
+
+.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;
+      }
+    }
+
+  }
+}

+ 300 - 0
src/pages/baseSetting/otherItemSet/visitsAndBedDayCostSetting/index.tsx

@@ -0,0 +1,300 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-21 19:36:50
+ * @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, getVisitsAndBedDayCostSettingList } from './service';
+
+import './style.less';
+
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
+
+
+export default function VisitsAndBedDayCostSetting() {
+
+    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: 'allocation',
+            render: num => <>{num == 1 ? '按照收入比例分配' : '按照固定比例分配'}</>
+        },
+        {
+            title: '收入类型',
+            dataIndex: 'incomeType',
+            render: num => <>{num == 1 ? '门诊收入' : '住院收入'}</>
+        },
+        {
+            title: '对应值',
+            dataIndex: 'incomeFileName',
+        },
+        {
+            title: '分摊参数编码',
+            dataIndex: 'shareParamCode',
+        },
+        {
+            title: '分摊参数名称',
+            dataIndex: 'shareParamName',
+        },
+        {
+            title: '成本对应',
+            dataIndex: 'costCorrespondingName',
+        },
+        {
+            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 getVisitsAndBedDayCostSettingList({ ...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 { 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)).join(',') });
+                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
+            >
+
+                <ProFormSelect
+                    rules={[
+                        {
+                            required: true,
+                            message: '请选择分配方式',
+                        },
+                    ]}
+                    options={[
+                        {
+                            value: 1,
+                            label: '按收入比例分配',
+                        },
+                        // {
+                        //   value: 2,
+                        //   label: '按照固定比例分配',
+                        // },
+                    ]}
+                    name="allocation"
+                    label="分配方式"
+                />
+                <ProFormSelect
+                    rules={[
+                        {
+                            required: true,
+                            message: '请选择收入类型',
+                        },
+                    ]}
+                    options={[
+                        {
+                            value: 1,
+                            label: '住院收入',
+                        },
+                        {
+                            value: 2,
+                            label: '门诊收入',
+                        },
+                    ]}
+                    name="incomeType"
+                    label="收入类型"
+                />
+                <ProFormText
+                    rules={[
+                        {
+                            required: true,
+                            message: '请选择分摊参数',
+                        },
+                    ]}
+                    name="shareParamName"
+                    label="选择分摊参数"
+                />
+                <ProFormText
+                    rules={[
+                        {
+                            required: true,
+                            message: '请选择对应收入字段',
+                        },
+                    ]}
+                    name="incomeFileName"
+                    label="对应收入字段"
+                />
+                <ProFormText
+                    rules={[
+                        {
+                            required: true,
+                            message: '请选择对应成本字段',
+                        },
+                    ]}
+                    name="costCorrespondingName"
+                    label="对应成本字段"
+                />
+
+            </ModalForm>
+        )
+    }
+
+
+    return (
+        <KCIMPagecontainer className='VisitsAndBedDayCostSetting' title={false}>
+            <div className='toolBar'>
+                <div className='filter'>
+                    <div className='filterItem'>
+                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
+                        <Input placeholder={'对应值'} allowClear
+                            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 columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

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

@@ -0,0 +1,76 @@
+/*
+ * @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]
+  });
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+

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

@@ -0,0 +1,42 @@
+.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;
+        }
+    }
+  }
+}

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

@@ -0,0 +1,205 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-21 11:10: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 { 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, 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',
+        },
+        {
+            title: '收支名称',
+            dataIndex: 'paymentsName',
+        },
+        {
+            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 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 columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

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

@@ -0,0 +1,73 @@
+/*
+ * @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]
+  });
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+

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

@@ -0,0 +1,34 @@
+.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;
+      }
+    }
+  }
+}

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

@@ -0,0 +1,364 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-09 19:17:52
+ * @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, ProFormDependency, ProFormInstance, ProFormText, ProFormSelect } from '@ant-design/pro-components';
+import { ModalForm, ProFormTextArea } 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 { addData, delData, editData, getApportionmentLevelListNoPage, getResponsibilityCenterList } from './service';
+
+import './style.less';
+import KCIMUpload from '@/components/KCIMUpload';
+import { downloadTemplateReq } from '@/utils/tooljs';
+
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
+
+
+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 [currentRow, setCurrentRow] = useState<any | undefined>(undefined);
+    const [selectableLevelList, setSelectableLevelList] = useState([]);//可选的分摊层级列表
+    const columns: ProColumns[] = [
+
+        {
+            title: '责任中心名称',
+            dataIndex: 'responsibilityName',
+            ellipsis: true,
+            renderText(_, record) {
+                const { isDefault, responsibilityName } = record;
+                return isDefault == 1 ? <Tag>{`${responsibilityName}(是)`}</Tag> : responsibilityName
+            },
+        },
+        {
+            title: '责任中心编码',
+            ellipsis: true,
+            dataIndex: 'responsibilityCode',
+        },
+        {
+            title: '是否汇总中心',
+            dataIndex: 'isGatherCenter',
+            renderText(_, record) {
+                return <>{_ == 1 ? '是' : '否'}</>
+            },
+        },
+        {
+            title: '责任类型',
+            ellipsis: true,
+            dataIndex: 'responsibilityType',
+        },
+        {
+            title: '分摊级别',
+            ellipsis: true,
+            dataIndex: 'shareLevel',
+        },
+        {
+            title: '分摊级别名称',
+            ellipsis: true,
+            dataIndex: 'shareName',
+        },
+        {
+            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 getResponsibilityCenterList({ ...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" | "ADDCHILD") => {
+
+        if (type == 'ADD' || type == 'ADDCHILD') {
+
+            let id = 0;
+            (currentRow && type == 'ADDCHILD') && (id = currentRow.id);
+            const { isDefault = 0, selectedSharelevel } = formVal;
+
+            const result = { ...formVal, shareName: selectedSharelevel ? selectedSharelevel.shareName : '', shareId: selectedSharelevel ? selectedSharelevel.id : 0, shareLevel: selectedSharelevel ? selectedSharelevel.leverSort : 0, isDefault, id };
+
+            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.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' | 'ADDCHILD' }) => {
+
+        return (
+            <ModalForm
+                title={`${type == 'EDIT' ? '编辑' : '新增'}责任中心`}
+                width={350}
+                formRef={formRef}
+                initialValues={type == 'EDIT' ? {
+                    ...record,
+                } : { selectedSharelevel: 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
+            >
+                <ProFormSelect
+                    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>
+                <ProFormSelect
+                    rules={[
+                        {
+                            required: true,
+                            message: '请选择责任类型',
+                        },
+                    ]}
+                    options={[
+                        {
+                            value: 1,
+                            label: '收益中心',
+                        },
+                        {
+                            value: 2,
+                            label: '成本(费用)中心',
+                        },
+                    ]}
+                    name="responsibilityType"
+                    label="选择责任类型"
+                />
+                <ProFormDependency name={['isGatherCenter']}>
+                    {
+                        ({ isGatherCenter }) => {
+                            return isGatherCenter != 1 && (
+                                <ProFormSelect
+                                    rules={[
+                                        {
+                                            required: true,
+                                            message: '请选择分摊级别',
+                                        },
+                                    ]}
+                                    fieldProps={{
+                                        onChange: (val) => {
+                                            // console.log({val});
+                                            const needItem = selectableLevelList.filter((item: any) => item.id == val);
+                                            if (formRef.current) {
+                                                formRef.current.setFieldsValue({ selectedSharelevel: needItem[0] })
+                                            }
+                                        },
+                                    }}
+                                    request={async () => {
+                                        const resp = await getApportionmentLevelListNoPage();
+                                        const { status, data: { list = [] } } = resp;
+                                        if (status == 200) {
+                                            setSelectableLevelList(list);
+                                            return list.map((item: any) => ({ label: `级别${item.leverSort}-${item.shareName}`, value: item.id }))
+                                        } else {
+                                            return []
+                                        }
+                                    }}
+                                    name='shareLevel'
+                                    label="选择分摊级别"
+                                />
+                            )
+                        }
+                    }
+                </ProFormDependency>
+
+            </ModalForm>
+        )
+    }
+
+    const tableDataSearchHandle = (paramName: string) => {
+
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            [`${paramName}`]: tableDataSearchKeywords
+        })
+
+    }
+
+    useEffect(() => {
+
+    }, [])
+
+    return (
+        <KCIMPagecontainer className='ResponsibilityCenter' title={false}>
+            <div className='toolBar'>
+                <div className='filter'>
+                   
+                </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>
+    )
+}

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

@@ -0,0 +1,83 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-09 18:59:56
+ * @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 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}
+  });
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+

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

@@ -0,0 +1,56 @@
+.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;
+      }
+    }
+
+  }
+}

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

@@ -0,0 +1,187 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-13 15:06:47
+ * @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 } from '@/utils/tooljs';
+import React from 'react';
+import TableTransfer from './transform';
+
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
+
+
+const transferTableColumn:ProColumns[] = [
+    {
+        title: 'Id',
+        ellipsis: true,
+        dataIndex: 'departmentId',
+    },
+    {
+        title: '科室名称',
+        ellipsis: true,
+        dataIndex: 'departmentName',
+        renderText(text, record) {
+            return `${text}(${record.departmentCode})`
+        },
+    },
+]
+
+
+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 [currentRow, setCurrentRow] = useState<any|undefined>(undefined);
+    const columns: ProColumns[] = [
+
+        {
+            title: '责任中心名称',
+            dataIndex: 'responsibilityName',
+            ellipsis: true,
+            renderText(_,record) {
+                const { isDefault, responsibilityName } = record;
+                return isDefault == 1 ? <Tag>{`${responsibilityName}(是)`}</Tag> : responsibilityName
+            },
+        },
+        {
+            title: '责任中心Id',
+            ellipsis: true,
+            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: 120,
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                const {isGatherCenter } = record;
+                return isGatherCenter==2 ? [
+                    <a
+                    key="1"
+                    onClick={() => {
+                      addConnectDepartments(record)
+                      setCurrentRow(record);
+                    }}
+                  >
+                    绑定科室
+                  </a>,
+                ]:[]
+            },
+        },
+
+    ]
+
+
+    const getTableData = async (params: any) => {
+        const resp = await getResponsibilityCenterConnectList({...params});
+        if (resp) {
+            return {
+                data: resp.list,
+                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){
+            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();
+            }
+        })
+    }
+
+
+
+    useEffect(() => {
+
+    }, [])
+
+    return (
+        <KCIMPagecontainer className='ResponsibilityCenterConnect' title={false}>
+            <div className='toolBar'>
+                <div className='filter'>
+                </div>
+                <div className='btnGroup'>
+                </div>
+            </div>
+
+            <div style={{ }}>
+                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

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

@@ -0,0 +1,39 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-13 15:05:43
+ * @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('/api/costAccount/centerDepartment/save', {
+    method: 'POST',
+    data:{...body},
+  });
+}

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

@@ -0,0 +1,56 @@
+.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;
+      }
+    }
+
+  }
+}

+ 136 - 0
src/pages/baseSetting/responsibilityCenterSet/responsibilityCenterConnect/transform.tsx

@@ -0,0 +1,136 @@
+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 { getResponsibilityCenterConnectableList } from "./service";
+import { log } from "mathjs";
+
+
+
+interface TableTransferProps extends TransferProps<TransferItem> {
+    leftColumns: ProColumns[];
+    rightColumns: ProColumns[];
+    record: any,
+    onSave: (selectedKeys: Key[], selectedRowKeys: any[]) => void;
+}
+
+const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, 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 () => {
+        let resp = await getResponsibilityCenterConnectableList({responsibilityId:record.responsibilityId});
+        if (resp) {
+           
+            //const allData = resp.allEmployees.concat(resp.checkEmployees);
+            resp = resp.map((a:any)=>({...a,code:a.departmentId}))
+            set_datasource(resp);
+            _set_data(resp);
+            const defaultSelctedkeys = record.departments?record.departments.map((a:any)=>a.departmentId):[]
+            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.code));
+            onSave(targetKeys, items);
+        }
+    }));
+
+    useEffect(() => {
+        getFuncList();
+    }, [])
+
+    return (
+        <Transfer className='TableTransfer' showSearch
+            titles={['待选项', '已选项']}
+            locale={{
+                itemUnit: '项',
+                itemsUnit: '项',
+                searchPlaceholder: '请输入',
+            }}
+            oneWay={false}
+            onChange={onChange}
+            onSelectChange={onSelectChange}
+            dataSource={datasource}
+            rowKey={record => record.code}
+            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(({ code }) => code);
+                        const diffKeys = selected
+                            ? difference(treeSelectedKeys, listSelectedKeys)
+                            : difference(listSelectedKeys, treeSelectedKeys);
+                        onItemSelectAll(diffKeys as string[], selected);
+                    },
+                    onSelect({ code }, selected) {
+                        onItemSelect(code as string, selected);
+                    },
+                    selectedRowKeys: listSelectedKeys,
+                };
+
+                return (
+                    <KCIMTable
+                        rowSelection={rowSelection}
+                        columns={columns as TransferItem[]}
+                        dataSource={filteredItems}
+                        size="small"
+                        bordered={false}
+                        rowKey={'code'}
+                        pagination={{ showTitle: false, pageSize: 9, showLessItems: false, simple: true, showTotal: () => false }}
+                        tableAlertRender={false}
+                        style={{ pointerEvents: listDisabled ? 'none' : undefined }}
+                        onRow={({ code, disabled: itemDisabled }) => ({
+                            onClick: () => {
+                                if (itemDisabled || listDisabled) return;
+                                onItemSelect(code as string, !listSelectedKeys.includes(code as string));
+                            },
+                        })}
+                    />
+                );
+            }}
+        </Transfer>
+    )
+});
+
+export default TableTransfer
+
+

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

@@ -455,4 +455,87 @@ export const clinicalPathway: ProColumns[] = [
             return formatMoneyNumber(num);
         },
     }
+];
+
+export const medicalOrderItem: ProColumns[] = [
+    {
+        title: '医嘱项目编码',
+        dataIndex: 'code',
+    },
+    {
+        title: '医嘱项目名称',
+        dataIndex: 'name',
+    },
+    {
+        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);
+        },
+    },
 ];

+ 12 - 2
src/pages/costAccounting/calcPageTemplate/config.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-11-01 11:13:38
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-03 10:34:01
+ * @LastEditTime: 2023-11-23 19:25:46
  * @FilePath: /CostAccountingSys/src/pages/costAccounting/calcPageTemplate/config.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -95,4 +95,14 @@ export const clinicalPathwayFilterConf = [
         placeholder:'请输入',
         key:'clinicalName'
     }
-]
+]
+
+export const medicalOrderItemFilterConf = [
+    {
+        type:'input',
+        label:'医嘱项目名称:',
+        placeholder:'请输入',
+        key:'orderName'
+    }
+]
+

+ 9 - 3
src/pages/costAccounting/calcPageTemplate/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-03 17:39:42
+ * @LastEditTime: 2023-11-23 19:21: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
  */
@@ -25,8 +25,8 @@ import { ActionType, ProColumns, ProFormSelect } from '@ant-design/pro-component
 import { formatMoneyNumber } from '@/utils/format';
 import { getTargetDic } from '@/services/auth';
 import { useParams } from '@umijs/max';
-import { chargeItemCostCalc, diseaseCostCalculation, DRG_DIPCostCalc, patientCostCalc, unitPersonnelCostCalc } from './columns';
-import { chargeItemCostCalcFilterConf, clinicalPathwayFilterConf, diseaseCostCalculationFilterConf, DRG_DIPCostCalcFilterConf, patientCostCalcFilterConf, unitPersonnelCostCalcFilterConf } from './config';
+import { chargeItemCostCalc, diseaseCostCalculation, DRG_DIPCostCalc, medicalOrderItem, patientCostCalc, unitPersonnelCostCalc } from './columns';
+import { chargeItemCostCalcFilterConf, clinicalPathwayFilterConf, diseaseCostCalculationFilterConf, DRG_DIPCostCalcFilterConf, medicalOrderItemFilterConf, patientCostCalcFilterConf, unitPersonnelCostCalcFilterConf } from './config';
 
 
 const IconFont = createFromIconfontCN({
@@ -108,6 +108,7 @@ export default function calcPageTemplate() {
               suffix={
                 <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle(`${key}`)} />
               }
+            
               onChange={(e) => {
                 set_tableDataSearchKeywords(e.target.value);
                 if (e.target.value.length == 0) {
@@ -191,6 +192,11 @@ export default function calcPageTemplate() {
       set_scrollX(1500);
       set_filterConf(clinicalPathwayFilterConf);
     }
+    if (calcPageKey == "medicalOrderItem") {
+      set_columns(medicalOrderItem);
+      set_scrollX(1500);
+      set_filterConf(medicalOrderItemFilterConf);
+    }
 
 
     set_tableDataFilterParams({ computeDate, calcPageKey });

+ 13 - 1
src/pages/costAccounting/calcPageTemplate/service.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 16:31:27
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-01 14:21:47
+ * @LastEditTime: 2023-11-23 19:22:06
  * @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
  */
@@ -53,6 +53,12 @@ export const getData = (params: any) => {
       params:{...next}
     });
   }
+  if(calcPageKey == 'medicalOrderItem'){
+    return request('/costAccount/calculate/orderCostCalculateList', {
+      method: 'GET',
+      params:{...next}
+    });
+  }
 };
 
 //计算
@@ -93,6 +99,12 @@ export const calculateReq = (computeDate: string,calcPageKey: string | undefined
       params:{computeDate}
     });
   }
+  if(calcPageKey == 'medicalOrderItem'){
+    return request('/costAccount/calculate/orderCostCalculate', {
+      method: 'POST',
+      params:{computeDate}
+    });
+  }
   
 };
 

+ 10 - 7
src/pages/costLibraryManagement/basicCostManagement/drugCostManagement/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-08 16:22:08
+ * @LastEditTime: 2023-11-09 13:49: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
  */
@@ -45,7 +45,7 @@ export default function DrugCostManagement() {
     const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
     const tableRef = useRef<ActionType>();
     const formRef = useRef<ProFormInstance>();
-
+    const [stopStat,set_stopStat] = useState(0);
     const columns: ProColumns[] = [
 
         {
@@ -58,7 +58,7 @@ export default function DrugCostManagement() {
         },
         {
             title: '项目类型',
-            dataIndex: 'type',
+            dataIndex: 'typeName',
         },
         {
             title: '单价',
@@ -104,7 +104,7 @@ export default function DrugCostManagement() {
 
 
     const getTableData = async (params: any) => {
-        const resp = await getDrugTableData(params);
+        const resp = await getDrugTableData({...params,stop:stopStat});
         if (resp) {
             return {
                 data: resp.list,
@@ -233,7 +233,7 @@ export default function DrugCostManagement() {
                                     // console.log({report});
                                     return (
 
-                                        status ? <ProFormDateTimePicker fieldProps={{locale}} name="stopTime" colProps={{ span: 14 }} noStyle  />:null
+                                        status ? <ProFormDateTimePicker fieldProps={{locale}} name="stopTime" placeholder="请选择停用时间" rules={[{ required: true, message: '时间不能为空!' }]} colProps={{ span: 14 }} noStyle  />:null
                                     )
                                 }
                             }
@@ -321,7 +321,7 @@ export default function DrugCostManagement() {
                         <span className='label' style={{ whiteSpace: 'nowrap' }}> 项目名称:</span>
                         <Input placeholder={'请输入'} allowClear
                             suffix={
-                                <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('name')} />
+                                <IconFont type="iconsousuo"  style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('name')} />
                             }
                             onChange={(e) => {
                                 set_tableDataSearchKeywords(e.target.value);
@@ -344,7 +344,10 @@ export default function DrugCostManagement() {
                     </div>
                 </div>
                 <div className='btnGroup'>
-                    <span style={{paddingRight:16}}><ProFormSwitch noStyle fieldProps={{size:'small',onChange:(bool)=>{set_tableDataFilterParams({...tableDataFilterParams,stop:bool?1:0})}}} /> 显示停用项目</span>
+                    <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>

+ 22 - 30
src/pages/costLibraryManagement/basicCostManagement/equipmentCostManagement/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-08 16:00:35
+ * @LastEditTime: 2023-11-09 13:44:18
  * @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
  */
@@ -45,7 +45,7 @@ export default function EquipmentCostManagement() {
     const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
     const tableRef = useRef<ActionType>();
     const formRef = useRef<ProFormInstance>();
-
+    const [stopStat,set_stopStat] = useState(0);
     const columns: ProColumns[] = [
 
         {
@@ -112,7 +112,7 @@ export default function EquipmentCostManagement() {
 
 
     const getTableData = async (params: any) => {
-        const resp = await getEquipTableData(params);
+        const resp = await getEquipTableData({...params,stop:stopStat});
         if (resp) {
             return {
                 data: resp.list,
@@ -165,7 +165,7 @@ export default function EquipmentCostManagement() {
 
         return (
             <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}药品`}
+                title={`${type == 'EDIT' ? '编辑' : '新增'}设备`}
                 width={350}
                 formRef={formRef}
                 initialValues={type == 'EDIT' ? {
@@ -183,43 +183,32 @@ export default function EquipmentCostManagement() {
             >
                 <ProFormText
                     name="code"
-                    label="项目代码:"
+                    label="设备编号:"
                     placeholder="请输入"
-                    rules={[{ required: true, message: '项目代码不能为空!' }]}
+                    rules={[{ required: true, message: '设备编号不能为空!' }]}
                 />
                 <ProFormText
                     name="name"
-                    label="项目名称:"
+                    label="设备名称:"
                     placeholder="请输入"
-                    rules={[{ required: true, message: '项目名称不能为空!' }]}
+                    rules={[{ required: true, message: '设备名称不能为空!' }]}
                 />
-                <ProFormSelect
+               <ProFormText
                     name="type"
-                    label="项目类型:"
-                    placeholder="请选择"
-                    options={[
-                        {
-                            label:'不计价材料',
-                            value:'不计价材料'
-                        },
-                        {
-                            label:'高值材料',
-                            value:'不计价材料'
-                        }
-                    ]}
-                    rules={[{ required: true, message: '项目类型不能为空!' }]}
+                    label="设备型号:"
+                    placeholder="请输入"
                 />
                 <ProFormDigit
                     name="price"
-                    label="单价:"
+                    label="购入价格:"
                     placeholder="请输入"
-                    rules={[{ required: true, message: '单价不能为空!' }]}
+                    rules={[{ required: true, message: '购入价格不能为空!' }]}
                 />
                 <ProFormDigit
-                    name="cost"
-                    label="成本:"
+                    name="depreciationYear"
+                    label="折旧年限:"
                     placeholder="请输入"
-                    rules={[{ required: true, message: '成本不能为空!' }]}
+                    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' }}>
@@ -245,7 +234,7 @@ export default function EquipmentCostManagement() {
                                     // console.log({report});
                                     return (
 
-                                        status ? <ProFormDateTimePicker fieldProps={{locale}} name="stopTime" colProps={{ span: 14 }} noStyle  />:null
+                                        status ? <ProFormDateTimePicker fieldProps={{locale}} placeholder="请选择停用时间" name="stopTime" rules={[{ required: true, message: '时间不能为空!' }]} colProps={{ span: 14 }} noStyle  />:null
                                     )
                                 }
                             }
@@ -333,7 +322,7 @@ export default function EquipmentCostManagement() {
                         <span className='label' style={{ whiteSpace: 'nowrap' }}> 设备名称:</span>
                         <Input placeholder={'请输入'} allowClear
                             suffix={
-                                <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('name')} />
+                                <IconFont type="iconsousuo" style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('name')} />
                             }
                             onChange={(e) => {
                                 set_tableDataSearchKeywords(e.target.value);
@@ -356,7 +345,10 @@ export default function EquipmentCostManagement() {
                     </div>
                 </div>
                 <div className='btnGroup'>
-                    <span style={{paddingRight:16}}><ProFormSwitch noStyle fieldProps={{size:'small',onChange:(bool)=>{set_tableDataFilterParams({...tableDataFilterParams,stop:bool?1:0})}}} /> 显示停用项目</span>
+                    <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>

+ 14 - 9
src/pages/costLibraryManagement/basicCostManagement/materialCostManagement/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-08 16:42:54
+ * @LastEditTime: 2023-11-16 17:39:52
  * @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
  */
@@ -242,7 +242,7 @@ export default function MaterialCostManagement() {
                                     // console.log({report});
                                     return (
 
-                                        status ? <ProFormDateTimePicker fieldProps={{ locale }} name="stopTime" colProps={{ span: 14 }} rules={[{ required: true, message: '时间不能为空!' }]} noStyle /> : null
+                                        status ? <ProFormDateTimePicker fieldProps={{ locale }} name="stopTime" colProps={{ span: 14 }} placeholder="请选择停用时间" rules={[{ required: true, message: '时间不能为空!' }]} noStyle /> : null
                                     )
                                 }
                             }
@@ -316,11 +316,12 @@ export default function MaterialCostManagement() {
             </ModalForm>
         );
     };
+    
 
 
     useEffect(() => {
-
-    }, [])
+        console.log({tableDataFilterParams});
+    }, [tableDataFilterParams])
 
     return (
         <KCIMPagecontainer className='MaterialCostManagement' title={false}>
@@ -335,11 +336,15 @@ export default function MaterialCostManagement() {
                                 {label:'高值材料',value:2}
                             ]}
                             fieldProps={{
-                                onChange(value, option) {
-                                    set_tableDataFilterParams({
-                                        ...tableDataFilterParams,
+                                onChange:(value, option)=>{
+                                    // set_tableDataFilterParams({
+                                    //     ...tableDataFilterParams,
+                                    //     itemType: value
+                                    // });
+                                    set_tableDataFilterParams((prevParams:any) => ({
+                                        ...prevParams,
                                         itemType: value
-                                    });
+                                    }));
                                 },
                             }}
                         />
@@ -348,7 +353,7 @@ export default function MaterialCostManagement() {
                         <span className='label' style={{ whiteSpace: 'nowrap' }}> 项目名称:</span>
                         <Input placeholder={'请输入'} allowClear
                             suffix={
-                                <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('name')} />
+                                <IconFont type="iconsousuo" style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('name')} />
                             }
                             onChange={(e) => {
                                 set_tableDataSearchKeywords(e.target.value);

+ 2 - 30
src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-08 16:14:36
+ * @LastEditTime: 2023-11-20 10:02: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
  */
@@ -51,8 +51,7 @@ const PersonnelClassificationMana = () => {
 
     const [tableSelecterVisible, set_tableSelecterVisible] = useState(false);
     const [dataSource, setDataSource] = useState<any[]>([]);
-    const SortableItem = SortableElement((props: any) => <tr {...props} />);
-    const SortContainer = SortableContainer((props: any) => <tbody {...props} />);
+
 
     const [currentEditLeftData, set_currentEditLeftData] = useState<any | undefined>(undefined);
 
@@ -60,8 +59,6 @@ const PersonnelClassificationMana = () => {
 
     const tableRef = useRef<ActionType>();
 
-    const DragHandle = SortableHandle(() => <img width={16} style={{ cursor: 'pointer' }} src={require('../../../../../static/tuozhuai_icon.png')} alt="" />);
-
     const column: ProColumns[] = [
 
         {
@@ -109,7 +106,6 @@ const PersonnelClassificationMana = () => {
 
 
     const getTableData = async (params: any) => {
-        console.log({ params });
         const { costTypeCode } = params;
         if (costTypeCode) {
             const resp = await getClolumnTableData({ ...params });
@@ -320,30 +316,6 @@ const PersonnelClassificationMana = () => {
                 </a>
             ),
         },
-        {
-            key: '3',
-            label: (<a onClick={async (e) => {
-                e.preventDefault();
-                // 选取要复制的文本
-                const textToCopy = currentEditLeftData.code;
-
-                // 创建一个临时的textarea元素
-                const tempTextArea = document.createElement("textarea");
-                tempTextArea.value = textToCopy;
-                document.body.appendChild(tempTextArea);
-
-                // 选中并复制文本
-                tempTextArea.select();
-                document.execCommand("copy");
-
-                // 移除临时元素
-                document.body.removeChild(tempTextArea);
-                message.success('复制成功!');
-
-            }}>
-                复制报表code
-            </a>),
-        },
     ];
 
 

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

@@ -0,0 +1,391 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-17 10:10:32
+ * @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',
+        },
+        {
+            title: '建置容积(㎡)',
+            dataIndex: 'volume',
+        },
+        {
+            title: '折旧年限',
+            dataIndex: 'depreciationYear',
+            renderText(num) {
+                return formatMoneyNumber(num)
+            },
+        },
+        {
+            title: '每年折旧',
+            dataIndex: 'costPerYear',
+            renderText(num) {
+                return formatMoneyNumber(num)
+            },
+        },
+        {
+            title: '每分钟成本',
+            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
+                            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}  columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

+ 96 - 0
src/pages/costLibraryManagement/basicCostManagement/spaceCostManagement/service.ts

@@ -0,0 +1,96 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-09 15:56:12
+ * @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 getSpaceCostTableData = (params?:any) => {
+  return request('/costAccount/setting/getSpaceCostList', {
+    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/addSpaceCost', {
+    method: 'POST',
+    data
+  });
+};
+
+
+//导入数据
+export const importDataPost = (data:any) => {
+  return request('/costAccount/setting/importSpaceCost', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+//编辑表格数据
+
+export type TableRowEditType = {
+  id:number;
+}&AddTableDataType
+
+export const editData = (data:any) => {
+  return request('/costAccount/setting/editSpaceCost', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (id:string) => {
+  return request('/costAccount/setting/deleteSpaceCost', {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+
+
+
+
+
+
+
+
+
+

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

@@ -0,0 +1,55 @@
+.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;
+      }
+    }
+
+  }
+}

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

@@ -0,0 +1,347 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-24 14:52:46
+ * @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: 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 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 [
+                            // <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='DiseaseDiagnosisComparison' title={false}>
+            <div className='toolBar'>
+                <div className='filter'>
+                    <div className='filterItem'>
+                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
+                        <Input placeholder={'诊断名称/国家编码'} allowClear
+                            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 columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

+ 101 - 0
src/pages/costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison/service.ts

@@ -0,0 +1,101 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-09 16:47:45
+ * @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 getDiseaseComparisonTableData = (params?:any) => {
+  return request('/costAccount/setting/getDiseaseTypeMapList', {
+    method: 'GET',
+    params:{...params}
+  });
+};
+
+
+//对照诊断与病种
+export const matchDiseaseTypeMap = () => {
+  return request('/costAccount/setting/matchDiseaseTypeMap', {
+    method: 'POST',
+  });
+};
+
+
+//新增
+export type AddTableDataType = {
+  diagCode:string,
+  diagName:string,
+  icdCode:string,
+  diseaseTypeCode:number,
+}
+
+export const addData = (data:AddTableDataType) => {
+  return request('/costAccount/setting/addDiseaseTypeMap', {
+    method: 'POST',
+    data
+  });
+};
+
+
+//导入数据
+export const importDataPost = (data:any) => {
+  return request('/costAccount/setting/importDiseaseTypeMap', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+//编辑表格数据
+
+export type TableRowEditType = {
+  id:number;
+}&AddTableDataType
+
+export const editData = (data:any) => {
+  return request('/costAccount/setting/editDiseaseTypeMap', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (id:string) => {
+  return request('/costAccount/setting/deleteDiseaseTypeMap', {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+
+
+
+
+
+
+
+
+
+

+ 56 - 0
src/pages/costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison/style.less

@@ -0,0 +1,56 @@
+.DiseaseDiagnosisComparison {
+  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,.mapBtn {
+        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;
+      }
+    }
+
+  }
+}

+ 285 - 0
src/pages/costLibraryManagement/diseaseCostManagement/diseaseMana/index.tsx

@@ -0,0 +1,285 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-24 14:52: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, ProFormDateTimePicker, ProFormInstance, ProFormText } from '@ant-design/pro-components';
+import { ModalForm, ProFormDependency, ProFormDigit, ProFormRadio, ProFormSelect, ProFormSwitch, ProFormTextArea } 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, getDiseaseTableData, importDataPost } from './service';
+
+import './style.less';
+import KCIMUpload from '@/components/KCIMUpload';
+import { downloadTemplateReq } from '@/utils/tooljs';
+
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
+
+
+export default function DiseaseMana() {
+
+    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',
+        },
+        {
+            title: '病种名称',
+            dataIndex: 'name',
+        },
+        {
+            title: '说明',
+            dataIndex: 'description',
+        },
+        {
+            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 getDiseaseTableData({...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"|"ADDCHILD") => {
+
+        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'|'ADDCHILD' }) => {
+
+        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: '病种名称不能为空!' }]}
+                />
+                <ProFormTextArea
+                    name="description"
+                    label="说明:"
+                    placeholder="请输入"
+                />
+
+            </ModalForm>
+        )
+    }
+
+    const tableDataSearchHandle = (paramName: string) => {
+
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            [`${paramName}`]: tableDataSearchKeywords
+        })
+
+    }
+
+    const downloadTemplate = async () => {
+        await downloadTemplateReq('/costAccount/setting/exportDiseaseType');
+    };
+    
+      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='DiseaseMana' title={false}>
+            <div className='toolBar'>
+                <div className='filter'>
+                    <div className='filterItem'>
+                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
+                        <Input placeholder={'病种名称/病种编码'} allowClear
+                            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'>
+                    {importData()}
+                    {/* <span className='export'>导出</span> */}
+                    <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>
+    )
+}

+ 98 - 0
src/pages/costLibraryManagement/diseaseCostManagement/diseaseMana/service.ts

@@ -0,0 +1,98 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-09 11:09:12
+ * @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 getDiseaseTableData = (params?:any) => {
+  return request<{
+       current:number;
+       list:EquipTableDataType[];
+       pageSize:number;
+       totalCount:number;
+       totalPage:number;
+  }>('/costAccount/setting/getDiseaseTypeList', {
+    method: 'GET',
+    params:{...params}
+  });
+};
+
+
+//新增
+export type AddTableDataType = {
+  code:string,
+  name:string,
+  description:string
+}
+
+export const addData = (data:AddTableDataType) => {
+  return request('/costAccount/setting/addDiseaseType', {
+    method: 'POST',
+    data
+  });
+};
+
+
+//导入数据
+export const importDataPost = (data:any) => {
+  return request('/costAccount/setting/importDiseaseType', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+//编辑表格数据
+
+export type TableRowEditType = {
+  id:number;
+}&AddTableDataType
+
+export const editData = (data:any) => {
+  return request('/costAccount/setting/editDiseaseType', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (id:string) => {
+  return request('/costAccount/setting/deleteDiseaseType', {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+
+
+
+
+
+
+
+
+
+

+ 56 - 0
src/pages/costLibraryManagement/diseaseCostManagement/diseaseMana/style.less

@@ -0,0 +1,56 @@
+.DiseaseMana {
+  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;
+      }
+    }
+
+  }
+}

+ 583 - 0
src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/index.tsx

@@ -0,0 +1,583 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-24 14:47: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 { createFromIconfontCN } from '@ant-design/icons';
+import { ActionType } from '@ant-design/pro-components';
+import { ModalForm, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
+import { ProColumns } from '@ant-design/pro-table';
+import { Dropdown, Input, MenuProps, message, Form, Tooltip, Popconfirm } from 'antd';
+
+import { Key } from 'react';
+import { useEffect, useRef, useState } from 'react';
+
+
+import { getOrderList, getOrderItemList, addLeftList, editLeftList, delLeftList, batchDelTableData, addTableData, delData, getOrderType, importLeftListData, editTableData } from './service';
+
+
+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 { getTargetDic } from '@/services/auth';
+import TableSelecter from './tableSelector';
+import { downloadTemplateReq } from '@/utils/tooljs';
+import KCIMUpload from '@/components/KCIMUpload';
+const IconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
+let _currentSelectedType: any = undefined;
+
+const MedicalOrderProjectMana = () => {
+
+    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 [currentEditLeftData, set_currentEditLeftData] = useState<any | undefined>(undefined);
+
+    const [currentEditRow, set_currentEditRow] = useState<undefined | any>(undefined);
+
+    const [leftDataSearchKeyVal, set_leftDataSearchKeyVal] = useState<undefined | string>(undefined);
+
+    const tableRef = useRef<ActionType>();
+
+    const [orderType, set_orderType] = useState<undefined | string>(undefined);
+
+    const column: ProColumns[] = [
+
+        {
+            title: '收费项目代码',
+            ellipsis: true,
+            dataIndex: 'itemCode',
+
+        },
+        {
+            title: '收费项目名称',
+            dataIndex: 'itemName',
+
+        },
+        {
+            title: '收费项目类别',
+            dataIndex: 'itemTypeName',
+        },
+        {
+            title: '数量',
+            dataIndex: 'num',
+            width: 160,
+            renderText(num, record, index, action) {
+                return (
+                    <div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
+                        {
+                            (currentEditRow && currentEditRow.id == record.id) && (
+                                <>
+                                    <ProFormDigit
+                                        width={80}
+                                        noStyle
+                                        fieldProps={{
+                                            value: num,
+                                            onChange(value) {
+                                                set_currentEditRow({ ...record, num: value ? value : 0 });
+                                            },
+                                        }}
+                                    />
+                                    <img onClick={() => updateTable({ ...record }, '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}</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: '操作',
+            key: 'option',
+            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 getOrderItemList({ ...params });
+        if (resp) {
+            return {
+                data: resp.list,
+                success: true,
+                total: resp.totalCount,
+                pageSize: resp.pageSize,
+                totalPage: resp.totalPage,
+            }
+        } else {
+            return []
+        }
+    }
+
+
+    //获取左侧列表
+    const getPageLeftReports = async (orderType?: string) => {
+        const resp = await getOrderList(orderType);
+
+        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 arr = rows.map((a, index) => ({
+            itemCode: a.itemCode,
+            itemName: a.itemName,
+            itemType: a.itemType,
+        }));
+        const result = {
+            orderCode: currentSelectedType.code,
+            items: arr
+        }
+        const resp = await addTableData(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({
+                name: formVal.name,
+                type: formVal.type,
+                code: formVal.code,
+                description: formVal.description
+            });
+            if (resp) {
+                getPageLeftReports();
+            }
+        }
+
+
+
+        if (type == 'EDIT_LEFTDATA') {
+            const resp = await editLeftList({
+                id: formVal.id,
+                name: formVal.name,
+                code: formVal.code,
+                type: formVal.type,
+                description: formVal.description
+            });
+            if (resp) {
+                getPageLeftReports();
+            }
+        }
+
+        if (type == 'EDIT') {
+            console.log({ formVal })
+            const resp = await editTableData({
+                id: formVal.id,
+                orderCode: currentSelectedType.code,
+                itemCode: formVal.itemCode,
+                num: currentEditRow.num
+            });
+            if (resp) {
+                tableRef.current?.reload();
+            }
+        }
+
+        set_currentEditRow(undefined);
+
+        return true;
+
+    }
+
+    const downloadTemplate = async () => {
+        await downloadTemplateReq('/costAccount/setting/exportOrder');
+    };
+
+    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 importLeftListData(formData);
+
+                    if (resp) {
+                        getPageLeftReports();
+                        return true;
+                    }
+                }}
+            >
+                <Form.Item name={'importFile'}>
+                    <KCIMUpload downloadTemplateFile={() => downloadTemplate()} />
+                </Form.Item>
+            </ModalForm>
+        );
+    };
+
+    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADD_LEFTDATA' | 'EDIT_LEFTDATA' }) => {
+
+        const getTrriger = () => {
+            if (type == 'ADD') {
+                return <span className='add'>新增</span>
+            }
+            if (type == 'EDIT') {
+                return <a key="edit" >编辑</a>
+            }
+            if (type == 'ADD_LEFTDATA') {
+                return (<a key="edit" >新增</a>)
+            }
+            if (type == 'EDIT_LEFTDATA') {
+                return <a key="edit" >编辑</a>
+            }
+        }
+
+        return (
+            <ModalForm
+                title={type == 'ADD_LEFTDATA' ? `新增医嘱项目` : `编辑医嘱项目`}
+                width={352}
+                initialValues={type == 'EDIT_LEFTDATA' ? { ...record } : {}}
+                trigger={
+                    getTrriger()
+                }
+                onFinish={(val) => {
+                    return updateTable(type == 'EDIT_LEFTDATA' ? { ...record, ...val } : val, type);
+                }}
+            >
+
+                <ProFormText
+                    label='医嘱项目代码:'
+                    name='code'
+                    rules={[{ required: true, message: '医嘱项目代码不能为空!' }]}
+                />
+                <ProFormText
+                    label='医嘱项目名称:'
+                    name='name'
+                    rules={[{ required: true, message: '医嘱项目名称不能为空!' }]}
+                />
+                <ProFormSelect
+                    name="type"
+                    label="医嘱项目类别:"
+                    placeholder="请选择"
+                    request={async () => {
+                        const resp = await getOrderType();
+                        if (resp) {
+                            return resp.map((a: any) => ({ label: a.name, value: a.code }));
+                        }
+                        return []
+                    }}
+                    rules={[{ required: true, message: '医嘱项目类别不能为空!' }]}
+                />
+                <ProFormTextArea
+                    label='说明:'
+                    name='description'
+                />
+            </ModalForm>
+        )
+    }
+
+    const optItems: MenuProps['items'] = [
+        {
+            key: '1',
+            label: <UpDataActBtn key={'act'} record={undefined} type='ADD_LEFTDATA' />,
+        },
+        {
+            key: '2',
+            label: importData()
+        },
+    ];
+    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 delLeftList(currentEditLeftData.id);
+                    if (resp) {
+                        getPageLeftReports();
+                    }
+                }}>
+                    删除
+                </a>
+            ),
+        },
+    ];
+
+
+    const tableDataSearchHandle = (paramName: string) => {
+
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            [`${paramName}`]: tableDataSearchKeywords
+        })
+
+    }
+
+
+    useEffect(() => {
+
+        if (currentSelectedType) {
+            set_tableDataFilterParams({ ...tableDataFilterParams, orderCode: currentSelectedType.code });
+        }
+    }, [currentSelectedType])
+
+    useEffect(() => {
+        if (showTypeListArr.length > 0) {
+            set_currentSelectedType(showTypeListArr[0]);
+            _currentSelectedType = showTypeListArr[0];
+            // set_tableDataFilterParams({ ...tableDataFilterParams, orderCode: showTypeListArr[0].code });
+        }
+    }, [showTypeListArr]);
+
+    useEffect(() => {
+        const result = typeList.filter(item => item.name.indexOf(leftDataSearchKeyVal) != -1);
+        set_showTypeListArr(result);
+    }, [leftDataSearchKeyVal]);
+
+    useEffect(() => {
+        if (orderType != '-1') {
+            getPageLeftReports(orderType);
+        } else {
+            getPageLeftReports();
+        }
+    }, [orderType])
+
+    useEffect(() => {
+        getPageLeftReports();
+    }, [])
+
+
+
+    return (
+        <KCIMPagecontainer title={false} className='MedicalOrderProjectMana'>
+            <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>
+            )}
+            <div className='left'>
+                <div style={{ padding: '0 8px' }}>
+                    <ProFormSelect
+                        noStyle
+                        style={{ width: '100%', marginBottom: 8, }}
+                        placeholder='选择医嘱类型'
+                        fieldProps={{
+                            defaultValue: -1, onChange(value, option) {
+                                set_leftDataSearchKeyVal(undefined);
+                                set_orderType(`${value}`);
+                            },
+                        }}
+                        request={async () => {
+                            const resp = await getOrderType();
+                            if (resp) {
+                                const arr = resp.map((a: any) => ({ label: a.name, value: a.code }));
+                                return [
+                                    { label: '全部医嘱类型', value:-1 },
+                                    ...arr
+                                ]
+                            }
+                            return [
+                                { label: '全部医嘱类型', value:-1 }
+                            ]
+                        }}
+                    />
+                </div>
+                <div className='toolbar'>
+                    <Input placeholder={'报表名称'} allowClear
+                        suffix={
+                            <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} />
+                        }
+                        value={leftDataSearchKeyVal}
+                        style={{ width: 156 }}
+                        onChange={(e) => {
+                            set_leftDataSearchKeyVal(e.target.value);
+                        }}
+
+                    />
+                    <Dropdown menu={{ items: optItems }} placement="bottom" >
+                        <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.name} >
+                                            <div className='name'>{item.name}</div>
+                                            <div className='sub'>{item.typeName}</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'>
+                            <span className='label' style={{ whiteSpace: 'nowrap' }}> 项目名称:</span>
+                            <Input placeholder={'请输入'} allowClear
+                                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 }}>
+                    {currentSelectedType && <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 MedicalOrderProjectMana;

+ 142 - 0
src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/service.ts

@@ -0,0 +1,142 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-07 11:12:10
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-23 19:32:34
+ * @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 getOrderList = (orderType?:string) => {
+  return request('/costAccount/setting/getOrderList', {
+    method: 'GET',
+    params:{orderType}
+  });
+};
+
+//获取左侧医嘱类型
+
+export const getOrderType = () => {
+  return request('/costAccount/setting/getOrderType', {
+    method: 'GET',
+  });
+};
+
+//获取表格数据
+
+export type  ClolumnTableDataType = {
+  id:number;
+  
+}
+
+export const getOrderItemList = (params:{orderCode:string,pageSize:number,current:number}) => {
+    return request('/costAccount/setting/getOrderItemList', {
+      method: 'GET',
+      params:{...params}
+    });
+};
+
+//获取可添加列表
+export const getAddableTableData = (type:number,orderCode:string) => {
+  return request('/costAccount/setting/getItemDict', {
+    method: 'GET',
+    params:{type,orderCode}
+  });
+};
+
+
+//新增左侧列表
+
+type AddLeftDataType = {
+  code:string,
+  name:string,
+  type:string,
+  description:string
+}
+export const addLeftList = (data:AddLeftDataType) => {
+  return request('/costAccount/setting/addOrder', {
+    method: 'POST',
+    data
+  });
+};
+
+
+//编辑左侧列表
+export const editLeftList = (data:AddLeftDataType&{id:number}) => {
+  return request('/costAccount/setting/editOrder', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+
+//新增表格数据
+
+export const addTableData = (data:any) => {
+  return request('/costAccount/setting/addOrderItem', {
+    method: 'POST',
+    data
+  });
+};
+
+//编辑表格数据
+
+export const editTableData = (data:any) => {
+  return request('/costAccount/setting/editOrderItem', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+
+//删除表格操作
+export const delData = (id:number) => {
+    return request('/costAccount/setting/deleteOrderItem', {
+      method: 'POST',
+      params:{id}
+    });
+};
+
+//删除左侧报表
+export const delLeftList = (id:number) => {
+  return request('/costAccount/setting/deleteOrder', {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+
+//批量删除表格数据
+export const batchDelTableData = (ids:Key[]) => {
+  return request('/costAccount/setting/batchDeleteOrderItem', {
+    method: 'POST',
+    data:[...ids]
+  });
+};
+
+
+//导入左侧列表数据
+
+export const importLeftListData = (data:any) => {
+  return request('/costAccount/setting/importOrder', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+

+ 238 - 0
src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/style.less

@@ -0,0 +1,238 @@
+.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;
+           }
+       }
+
+  }
+}
+
+.MedicalOrderProjectMana {
+  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: scroll;
+    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 {
+      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-family: SourceHanSansCN-Normal, SourceHanSansCN;
+          font-weight: 400;
+          color: #FFFFFF;
+          line-height: 24px;
+          padding: 0 14px;
+          background: #3377FF;
+          border-radius: 4px;
+          margin-left: 8px;
+        }
+      }
+
+
+    }
+  }
+}

+ 201 - 0
src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/tableSelector.tsx

@@ -0,0 +1,201 @@
+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,record.code);
+
+            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

+ 348 - 0
src/pages/costLibraryManagement/projectCostManagement/chargeItemsMana/index.tsx

@@ -0,0 +1,348 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-24 14:51:15
+ * @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, ProFormDigit, 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, getTableDataReq, importDataPost, mapItemAndStandItem } from './service';
+
+import './style.less';
+import KCIMUpload from '@/components/KCIMUpload';
+import { downloadTemplateReq } from '@/utils/tooljs';
+import { getStandItemList } from '../standardProjectMana/service';
+
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
+
+
+export default function ChargeItemsMana() {
+
+    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',
+        },
+        {
+            title: '收费项目名称',
+            dataIndex: 'name',
+        },
+        {
+            title: '国家编码',
+            dataIndex: 'nationalCode',
+        },
+        {
+            title: '项目类别',
+            dataIndex: 'type',
+        },
+        {
+            title: '康程分类',
+            dataIndex: 'kcCodeName',
+        },
+        {
+            title: '标准项目编码',
+            dataIndex: 'standItemCode',
+        },
+        {
+            title: '标准项目名称',
+            dataIndex: 'standItemName',
+        },
+        {
+            title: '单价',
+            dataIndex: 'price',
+        },
+        {
+            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 getTableDataReq({...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,
+            standItemCode:formVal.standItem?formVal.standItem.value:undefined,
+            standItemName:formVal.standItem?formVal.standItem.label:undefined,
+        }
+
+        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,standItem:record.standItemCode
+                } : {}}
+                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="请输入"
+                    // rules={[{ required: true, message: '收费项目类别不能为空!' }]}
+                />
+               <ProFormText
+                    name="nationalCode"
+                    label="国家编码:"
+                    placeholder="请输入"
+                />
+                <ProFormSelect
+                    name="standItem"
+                    label="标准项目名称:"
+                    placeholder="请选择"
+                    fieldProps={{labelInValue:true}}
+                    request={async ({ keyWords }) => {
+                        const resp = await getStandItemList({ name: keyWords, pageSize: 100, current: 1 });
+                        if (resp) {
+                            return resp.list.map((a: any) => ({ label: a.name, value: a.code }))
+                        } else {
+                            return []
+                        }
+                    }}
+               
+                />
+                <ProFormDigit
+                    name="price"
+                    label="单价:"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '单价不能为空!' }]}
+                />
+    
+            </ModalForm>
+        )
+    }
+
+    const tableDataSearchHandle = (paramName: string) => {
+
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            [`${paramName}`]: tableDataSearchKeywords
+        })
+
+    }
+
+    const downloadTemplate = async () => {
+        await downloadTemplateReq('/costAccount/setting/exportItem');
+    };
+    
+    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>
+        );
+    };
+
+    const mapBtnHandle = async () => {
+
+        Modal.confirm({
+            title: '注意',
+            content: '对照操作只会自动匹配未对照的项目,是否继续操作?',
+            okText:'确定',
+            cancelText:'取消',
+            onOk: async (...args) => {
+              const resp  = await mapItemAndStandItem();
+              if (resp) {
+                message.success('操作成功!');
+                tableRef.current?.reload();
+              } 
+            },
+          })
+    }
+
+
+    useEffect(() => {
+
+    }, [])
+
+    return (
+        <KCIMPagecontainer className='ChargeItemsMana' title={false}>
+            <div className='toolBar'>
+                <div className='filter'>
+                    <div className='filterItem'>
+                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
+                        <Input placeholder={'项目名称/国家编码'} allowClear
+                            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 columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </KCIMPagecontainer>
+    )
+}

+ 112 - 0
src/pages/costLibraryManagement/projectCostManagement/chargeItemsMana/service.ts

@@ -0,0 +1,112 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-23 13:46:35
+ * @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 TableDataType = {
+  id:number,
+  hospId:number,
+  code:number,
+  name:string,
+  type:string,
+  price:number,
+  kcCodeName:string,
+  kcCode:string,
+  nationalCode:string,
+  standItemCode:string,
+  standItemName:string,
+}
+
+
+export const getTableDataReq = (params?:any) => {
+  return request<{
+       current:number;
+       list:TableDataType[];
+       pageSize:number;
+       totalCount:number;
+       totalPage:number;
+  }>('/costAccount/setting/getItemList', {
+    method: 'GET',
+    params:{...params}
+  });
+};
+
+
+//新增
+export type AddTableDataType = {
+  code:string,
+  name:string,
+  type:string,
+  price:number,
+  nationalCode:string,
+  standItemCode:string,
+  standItemName:string
+}
+
+export const addData = (data:AddTableDataType) => {
+  return request('/costAccount/setting/addItem', {
+    method: 'POST',
+    data
+  });
+};
+
+
+//导入数据
+export const importDataPost = (data:any) => {
+  return request('/costAccount/setting/importItem', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+//编辑表格数据
+
+export type TableRowEditType = {
+  id:number;
+}&AddTableDataType
+
+export const editData = (data:any) => {
+  return request('/costAccount/setting/editItem', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (id:string) => {
+  return request('/costAccount/setting/deleteItem', {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+
+//对照
+export const mapItemAndStandItem = () => {
+  return request('/costAccount/setting/matchItemAndStandItem', {
+    method: 'POST',
+  });
+};
+
+
+
+
+
+
+
+
+
+
+

+ 55 - 0
src/pages/costLibraryManagement/projectCostManagement/chargeItemsMana/style.less

@@ -0,0 +1,55 @@
+.ChargeItemsMana {
+  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,.mapBtn {
+        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;
+      }
+    }
+
+  }
+}

+ 449 - 0
src/pages/costLibraryManagement/projectCostManagement/standardProjectMana/drawer.tsx

@@ -0,0 +1,449 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-11-15 15:34:36
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-17 13:44:23
+ * @FilePath: /CostAccountingSys/src/pages/costLibraryManagement/projectCostManagement/standardProjectMana/drawer.tsx
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+import { KCIMTable } from "@/components/KCIMTable";
+import { ActionType, DrawerForm, ModalForm, ProColumns, ProFormCascader, ProFormDigit, ProFormInstance, ProFormSelect, ProFormText } from "@ant-design/pro-components";
+import { useEffect, useRef, useState } from "react";
+import { Tabs, Popconfirm, message } from 'antd'
+import './style.less'
+import { addDrawerTableData, delDrawerTableData, editData, editDrawerTableData, getStandItemEmpMap, getStandItemEquipmentMap, getStandItemSpaceMap } from "./service";
+import { getTargetDic } from "@/services/auth";
+import { getLeftList } from "../../basicCostManagement/personnelClassificationMana/service";
+import { getEquipTableData } from "../../basicCostManagement/equipmentCostManagement/service";
+import { getSpaceCostTableData } from "../../basicCostManagement/spaceCostManagement/service";
+import { findAllParents } from "@/utils/tooljs";
+
+
+const columns_emp: ProColumns[] = [
+    {
+        title: '人员类别',
+        dataIndex: 'empTypeCodeName',
+    },
+    {
+        title: '数量',
+        dataIndex: 'num',
+    },
+    {
+        title: '执行时间(min)',
+        dataIndex: 'executeTime',
+    },
+];
+
+const columns_equip: ProColumns[] = [
+    {
+        title: '设备编码',
+        dataIndex: 'equipmentCode',
+    },
+    {
+        title: '设备名称',
+        dataIndex: 'equipmentCodeName',
+    },
+    {
+        title: '数量',
+        dataIndex: 'num',
+    },
+    {
+        title: '执行时间(min)',
+        dataIndex: 'executeTime',
+    }
+];
+const columns_space: ProColumns[] = [
+    {
+        title: '空间编码',
+        dataIndex: 'spaceCode',
+    },
+    {
+        title: '空间名称',
+        dataIndex: 'spaceCodeName',
+    },
+    {
+        title: '数量',
+        dataIndex: 'num',
+    },
+    {
+        title: '执行时间(min)',
+        dataIndex: 'executeTime',
+    }
+];
+
+
+let _currentTabKey = 1;
+
+
+const DrawerActBtn = ({ record,onVisibleChange }: { record: any,onVisibleChange?:(bool:boolean)=>void}) => {
+
+    const tableRef = useRef<ActionType>();
+    const formRef = useRef<ProFormInstance>();
+    const [drawerTablereload, set_drawerTablereload] = useState(false);
+    const [drawerVisible, set_drawerVisible] = useState(false);
+    const [tabs, set_tabs] = useState<any[]>([]);
+    const [currentTabKey, set_currentTabKey] = useState<number>(1);
+    const [columns, set_columns] = useState<any[]>([]);
+
+
+    const columnsData = (key: number) => [
+        {
+            title: '操作',
+            key: 'option',
+            width: 160,
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                return [
+                    <UpDataActBtn key={'act'} record={record} type='EDIT' currentTabKey={key} />,
+                    <Popconfirm
+                        title="是否确认删除?"
+                        key="del"
+                        onConfirm={() => delTableData(record)}
+                    >
+                        <a>删除</a>
+                    </Popconfirm>,
+                ]
+            },
+        },
+
+    ];
+
+
+    const getTableData = async (params: any, sort: any, filter: any) => {
+        if (currentTabKey == 1) {
+            const resp = await getStandItemEmpMap(record.code);
+            if (resp) {
+                return {
+                    data: resp,
+                    success: true
+                }
+            }
+        }
+        if (currentTabKey == 2) {
+            const resp = await getStandItemEquipmentMap(record.code);
+            if (resp) {
+                return {
+                    data: resp,
+                    success: true
+                }
+            }
+        }
+        if (currentTabKey == 3) {
+            const resp = await getStandItemSpaceMap(record.code);
+            if (resp) {
+                return {
+                    data: resp,
+                    success: true
+                }
+            }
+        }
+        return []
+    }
+
+    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
+       
+        let result = undefined;
+
+        if (type == 'ADD') {
+            if (_currentTabKey == 1) {
+                result = {
+                    standItemCode: record.code,
+                    empTypeCode: formVal.empType.value,
+                    empTypeCodeName: formVal.empType.label,
+                    num: formVal.num,
+                    executeTime: formVal.executeTime
+                }
+            }
+            if (_currentTabKey == 2) {
+                result = {
+                    standItemCode: record.code,
+                    equipmentCode: formVal.equipmentCode,
+                    num: formVal.num,
+                    executeTime: formVal.executeTime
+                }
+            }
+            if (_currentTabKey == 3) {
+                result = {
+                    standItemCode: record.code,
+                    spaceCode: formVal.space[formVal.space.length -1],
+                    num: formVal.num,
+                    spaceCodePath:formVal.spaceCodePath,
+                    executeTime: formVal.executeTime
+                }
+            }
+            const resp = await addDrawerTableData(result, _currentTabKey as number);
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+
+        }
+        if (type == 'EDIT') {
+
+            try {
+
+                if (_currentTabKey == 1) {
+                    result = {
+                        standItemCode: record.code,
+                        empTypeCode: formVal.empType.value,
+                        empTypeCodeName: formVal.empType.label,
+                        num: formVal.num,
+                        executeTime: formVal.executeTime
+                    }
+                }
+                if (_currentTabKey == 2) {
+                    result = {
+                        standItemCode: record.code,
+                        equipmentCode: formVal.equipmentCode,
+                        num: formVal.num,
+                        executeTime: formVal.executeTime
+                    }
+                }
+                if (_currentTabKey == 3) {
+                    result = {
+                        standItemCode: record.code,
+                        spaceCode: formVal.spaceCode,
+                        num: formVal.num,
+                        spaceCodePath:formVal.spaceCodePath,
+                        executeTime: formVal.executeTime
+                    }
+                }
+
+                const resp = await editDrawerTableData({ ...result, id: formVal.id }, _currentTabKey);
+                if (resp) {
+                    tableRef.current?.reload();
+                    message.success('操作成功!');
+                }
+
+            } catch (error) {
+                console.log('编辑保存:', error)
+            }
+
+
+
+
+        }
+        return true;
+
+    }
+
+    const delTableData = async (record: any) => {
+        const resp = await delDrawerTableData(record.id, _currentTabKey);
+        if (resp) {
+            message.success('操作成功!');
+            tableRef.current?.reload();
+            // message.success('操作成功!');
+        }
+    }
+
+    const UpDataActBtn = ({ record, type, currentTabKey }: { record: any, type: 'EDIT' | 'ADD', currentTabKey: number }) => {
+
+        const [cascaderData, set_cascaderData] = useState<any[]>([]);
+        return (
+            <ModalForm
+                title={`${type == 'EDIT' ? '编辑' : '新增'}${currentTabKey == 1 ? '参与人员' : currentTabKey == 2 ? '使用设备' : '使用空间'}`}
+                width={350}
+                formRef={formRef}
+                initialValues={type == 'EDIT' ? {
+                    ...record, empType: record.empTypeCode,space:record.spaceCodePath?record.spaceCodePath.split(','):[]
+                } : { kcClassCode: '', kcClassName: '', kcClassPath: '',executeTime:record.executeTime }}
+                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
+            >
+                {
+                    currentTabKey == 1 && (
+                        <ProFormSelect
+                            name="empType"
+                            label="人员类别:"
+                            placeholder="请选择"
+                            showSearch
+                            fieldProps={{ labelInValue: true }}
+                            request={async () => {
+                                const resp = await getLeftList();
+                                if (resp) {
+                                    return resp.map((a: any) => ({ label: a.costTypeName, value: a.costTypeCode }))
+                                } else {
+                                    return []
+                                }
+                            }}
+                            rules={[{ required: true, message: '人员类别不能为空!' }]}
+                        />
+                    )
+                }
+                {
+                    currentTabKey == 2 && (
+                        <ProFormSelect
+                            name="equipmentCode"
+                            label="设备名称:"
+                            placeholder="请选择"
+                            showSearch
+                            request={async ({ keyWords }) => {
+                                const resp = await getEquipTableData({ name: keyWords, pageSize: 500, current: 1 });
+                                if (resp) {
+                                    return resp.list.map((a: any) => ({ label: a.name, value: a.code }))
+                                } else {
+                                    return []
+                                }
+                            }}
+                            rules={[{ required: true, message: '设备名称不能为空!' }]}
+                        />
+                    )
+                }
+                {
+                    currentTabKey == 3 && (
+                        <>
+                            <ProFormText name='spaceCodePath' hidden />
+                            <ProFormText name='spaceCode' hidden />
+                            <ProFormCascader
+                                name="space"
+                                label="空间名称:"
+                                rules={[{ required: true, message: '空间名称不能为空!' }]}
+                                request={async () => {
+                                    const resp = await getSpaceCostTableData();
+                                    if (resp) {
+                                        set_cascaderData(resp);
+                                        return resp
+                                    }
+                                }}
+                                fieldProps={{
+                                    fieldNames: { label: 'name', value: 'code', children: 'childList' },
+                                    onChange: async (value: any) => {
+                                        // const a = findAllParents(cascaderData, value[value.length - 1]);
+                                        // console.log({a});
+                                        if (value.length > 0) {
+                                            formRef.current?.setFieldsValue({
+                                                spaceCodePath:value.join(','),
+                                                spaceCode:value[value.length - 1]
+                                            })
+                                        }
+                                    }
+                                }}
+                            />
+                        </>
+
+
+                    )
+                }
+
+                <ProFormDigit
+                    name="num"
+                    label="数量:"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '数量不能为空!' }]}
+                />
+                <ProFormDigit
+                    name="executeTime"
+                    label="执行时间(min):"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '执行时间不能为空!' }]}
+                />
+            </ModalForm>
+        )
+    }
+
+    const saveResult = async () => {
+
+
+    }
+
+    const onCancel = () => {
+        set_drawerVisible(false)
+    }
+
+    const onTabChanged = (key: string) => {
+        // console.log({key})
+        if (Number(key) == 1) {
+            set_columns([...columns_emp, ...columnsData(Number(key))])
+        }
+        if (Number(key) == 2) {
+            set_columns([...columns_equip, ...columnsData(Number(key))])
+        }
+        if (Number(key) == 3) {
+            set_columns([...columns_space, ...columnsData(Number(key))])
+        }
+        set_currentTabKey(Number(key));
+        tableRef.current?.reload();
+    }
+
+    useEffect(() => {
+        _currentTabKey = currentTabKey
+    }, [currentTabKey])
+
+    useEffect(()=>{
+        onVisibleChange&&onVisibleChange(drawerVisible); 
+    },[drawerVisible]);
+
+
+    useEffect(() => {
+        set_tabs([
+            {
+                label: '参与人员',
+                key: 1,
+            },
+            {
+                label: '使用设备',
+                key: 2,
+            },
+            {
+                label: '使用空间',
+                key: 3,
+            },
+        ]);
+        set_currentTabKey(1);
+        set_columns([...columns_emp, ...columnsData(Number(currentTabKey))])
+
+    }, [])
+
+    return (
+        <DrawerForm
+            open={drawerVisible}
+            trigger={
+                <a key="set" onClick={(e) => { e.stopPropagation(); set_drawerVisible(true) }}>成本设置</a>
+            }
+            drawerProps={{
+                closable: false,
+                extra: null
+            }}
+
+            width={908}
+            submitter={false}
+        >
+            <div className='standardProjectMana_drawer'>
+                <div className='topbar'>
+                    <div className='title'>{`成本设置`}</div>
+                    <div className='btnGroup'>
+                        <span className='cancel' onClick={() => onCancel()}>返回</span>
+                        <UpDataActBtn key={'act'} record={record} type='ADD' currentTabKey={currentTabKey} />
+                    </div>
+                </div>
+                <Tabs
+                    defaultActiveKey={`${currentTabKey}`}
+                    items={tabs}
+                    key={'key'}
+                    onChange={(key) => onTabChanged(key)}
+                />
+                <div className='content'>
+                    <div className='rightContent'>
+                        <KCIMTable
+                            tableAlertRender={false}
+                            actionRef={tableRef}
+
+                            rowKey='id' columns={columns} request={(params: any, sort: any, filter: any) => getTableData(params, sort, filter)} />
+
+                    </div>
+                </div>
+            </div>
+
+        </DrawerForm>
+    )
+}
+
+
+export default DrawerActBtn;

+ 391 - 0
src/pages/costLibraryManagement/projectCostManagement/standardProjectMana/index.tsx

@@ -0,0 +1,391 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-24 14:49:59
+ * @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, ProFormCascader, ProFormInstance, ProFormText } from '@ant-design/pro-components';
+import { ModalForm, ProFormDigit, ProFormSelect } 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, getCostAccountingDict, getStandItemList, getKcClassDicData, importDataPost } from './service';
+
+import './style.less';
+import KCIMUpload from '@/components/KCIMUpload';
+import { downloadTemplateReq, findAllParents } from '@/utils/tooljs';
+import React from 'react';
+import DrawerActBtn from './drawer';
+
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
+
+
+export default function StandardProjectMana() {
+
+    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',
+            ellipsis:true
+        },
+        {
+            title: '项目名称',
+            dataIndex: 'name',
+            ellipsis:true
+        },
+        {
+            title: '国家编码',
+            dataIndex: 'nationalCode',
+            ellipsis:true
+        },
+        {
+            title: '康程分类',
+            dataIndex: 'kcClassLevelName',
+            ellipsis:true
+        },
+        {
+            title: '执行时间(min)',
+            width:150,
+            dataIndex: 'executeTime',
+        },
+        {
+            title: '参与人员',
+            dataIndex: 'empMaps',
+            ellipsis:true,
+            renderText(arr, record) {
+                return arr?arr.reduce((prev:string,cur:any)=>`${prev.length>0?prev+'|':prev}${cur.empTypeCodeName}*${cur.num}*${cur.executeTime}`,''):'-'
+            },
+        },
+        {
+            title: '使用设备',
+            ellipsis:true,
+            dataIndex: 'equipmentMaps',
+            renderText(arr, record) {
+                return arr?arr.reduce((prev:string,cur:any)=>`${prev.length>0?prev+'|':prev}${cur.equipmentCodeName}*${cur.num}*${cur.executeTime}`,''):'-'
+            },
+        },
+        {
+            title: '使用空间',
+            dataIndex: 'spaceMaps',
+            ellipsis:true,
+            renderText(arr, record) {
+                return arr?arr.reduce((prev:string,cur:any)=>`${prev.length>0?prev+'|':prev}${cur.spaceCodeName}*${cur.num}*${cur.executeTime}`,''):'-'
+            },
+        },
+        {
+            title: '操作',
+            key: 'option',
+            width: 160,
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                return [
+                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
+                    <Popconfirm
+                        title="是否确认删除?"
+                        key="del"
+                        onConfirm={() => delTableData(record)}
+                    >
+                        <a>删除</a>
+                    </Popconfirm>,
+                    <DrawerActBtn key="link7" record={record} onVisibleChange={bool=>{!bool&&tableRef.current?.reload()}}  />,
+                ]
+            },
+        },
+
+    ]
+
+
+    const getTableData = async (params: any) => {
+        const resp = await getStandItemList({ ...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" | "ADDCHILD") => {
+
+        const result = {
+            code:formVal.code,
+            name:formVal.name,
+            nationalCode:formVal.nationalCode,
+            kcClassCode:formVal.kcClassCode,
+            kcClassName:formVal.kcClassName,
+            kcClassPath:formVal.kcClassPath,
+            kcClassLevelName:formVal.kcClassLevelName,
+            executeTime:formVal.executeTime,
+            accounts:formVal.accounts
+        }
+
+        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('操作成功!');
+            }
+        }
+        return true;
+
+    }
+
+
+    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADDCHILD' }) => {
+
+        const [cascaderData,set_cascaderData] = useState<any[]>([]);
+
+
+        return (
+            <ModalForm
+                title={`${type == 'EDIT' ? '编辑' : '新增'}项目`}
+                width={350}
+                formRef={formRef}
+                initialValues={type == 'EDIT' ? {
+                    ...record,kcClass:record.kcClassPath?record.kcClassPath.split(','):[]
+                } : { kcClassCode:'',kcClassName:'',kcClassPath:'', }}
+                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="nationalCode"
+                    label="国家编码:"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '国家编码不能为空!' }]}
+                />
+                <ProFormText name='kcClassCode' hidden />
+                <ProFormText name='kcClassName'hidden />
+                <ProFormText name='kcClassPath' hidden/>
+                <ProFormText name='kcClassLevelName' hidden/>
+                <ProFormCascader
+                    name="kcClass"
+                    label="康程分类:"
+                    rules={[{ required: true, message: '康程分类不能为空!' }]}
+                    request={ async ()=>{
+                        const resp = await getKcClassDicData();
+                        if(resp){
+                            set_cascaderData(resp);
+                            return resp
+                        }
+                    }}
+                    fieldProps={{
+                         fieldNames:{label:'name',value:'code',children:'childList'},
+                         onChange:async (value:any)=>{
+                              const a = findAllParents(cascaderData,value[value.length - 1],'childList');
+                              if(a.length>0){
+                                   formRef.current?.setFieldsValue({
+                                    kcClassCode:(a[a.length - 1]).code,
+                                    kcClassName:(a[a.length - 1]).name,
+                                    kcClassPath:value.join(','),
+                                    kcClassLevelName:(a.map((b:any)=>b.name)).join('/')
+                                   })
+                              }
+                         }
+                    }}
+                />
+                <ProFormSelect
+                    name="accounts"
+                    label="会计科目:"
+                    placeholder="请选择"
+                    showSearch
+                    request={ async ()=>{
+                           const resp = await getCostAccountingDict();
+                           if(resp){
+                               return resp.map((a:any)=>({label:a.accountingName,value:a.accountingCode}))
+                           }else{
+                               return []
+                           }
+                    }}
+                    // rules={[{ required: true, message: '会计科目不能为空!' }]}
+                />
+                <ProFormDigit
+                    name="executeTime"
+                    label="执行时间:"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '执行时间不能为空!' }]}
+                />
+
+
+
+            </ModalForm>
+        )
+    }
+
+    const tableDataSearchHandle = (paramName: string) => {
+
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            [`${paramName}`]: tableDataSearchKeywords
+        })
+
+    }
+
+    const downloadTemplate = async () => {
+        await downloadTemplateReq('/costAccount/setting/exportStandItem');
+    };
+
+    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='StandardProjectMana' title={false}>
+            <div className='toolBar'>
+                <div className='filter'>
+                    <div className='filterItem'>
+                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
+                        <Input placeholder={'项目名称/国家编码'} allowClear
+                            suffix={
+                                <IconFont type="iconsousuo" 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'>
+                    {importData()}
+                    {/* <span className='import'>导出</span> */}
+                    <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>
+    )
+}

+ 181 - 0
src/pages/costLibraryManagement/projectCostManagement/standardProjectMana/service.ts

@@ -0,0 +1,181 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-11-16 10:12:12
+ * @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 type EquipTableDataType = {
+
+}
+
+
+export const getStandItemList = (params?: any) => {
+  return request<{
+    current: number;
+    list: EquipTableDataType[];
+    pageSize: number;
+    totalCount: number;
+    totalPage: number;
+  }>('/costAccount/setting/getStandItemList', {
+    method: 'GET',
+    params: { ...params }
+  });
+};
+//获取康程分类
+export const getKcClassDicData = () => {
+  return request('/costAccount/setting/getKcClassDict', {
+    method: 'GET',
+  });
+};
+
+//获取会计科目
+export const getCostAccountingDict = (params?: any) => {
+  return request('/costAccount/setting/getCostAccountingDict', {
+    method: 'GET',
+    params:{...params}
+  });
+};
+
+
+//新增
+export type AddTableDataType = {
+  code: string,
+  name: string,
+  nationalCode: string,
+  kcClassCode:string, //康程分类代码(小类)
+  kcClassName:string, //康程分类名称
+  kcClassPath:string, //康程分类路径
+  executeTime:number, //执行时间(m)
+  accounts:string //会计科目代码
+}
+
+export const addData = (data: AddTableDataType) => {
+  return request('/costAccount/setting/addStandItem', {
+    method: 'POST',
+    data
+  });
+};
+
+
+//导入数据
+export const importDataPost = (data: any) => {
+  return request('/costAccount/setting/importStandItem', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+//编辑表格数据
+
+export type TableRowEditType = {
+  id: number;
+} & AddTableDataType
+
+export const editData = (data: any) => {
+  return request('/costAccount/setting/editStandItem', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (id: string) => {
+  return request('/costAccount/setting/deleteStandItem', {
+    method: 'POST',
+    params: { id }
+  });
+};
+
+
+
+//获取对照人员列表
+export const getStandItemEmpMap = (standCode:string) => {
+  return request('/costAccount/setting/getStandItemEmpMap', {
+    method: 'GET',
+    params: { standCode }
+  });
+};
+
+//获取对照设备列表
+export const getStandItemEquipmentMap = (standCode:string) => {
+  return request('/costAccount/setting/getStandItemEquipmentMap', {
+    method: 'GET',
+    params: { standCode }
+  });
+};
+
+//获取对照空间列表
+export const getStandItemSpaceMap = (standCode:string) => {
+  return request('/costAccount/setting/getStandItemSpaceMap', {
+    method: 'GET',
+    params: { standCode }
+  });
+};
+
+//添加抽屉表格数据
+
+export const addDrawerTableData = (data:any,tabKey:number) => {
+
+  let url:string = '';
+  if(tabKey == 1){url = '/costAccount/setting/addStandItemEmpMap';}
+  if(tabKey == 2){url = '/costAccount/setting/addStandItemEquipmentMap';}
+  if(tabKey == 3){url = '/costAccount/setting/addStandItemSpaceMap';}
+
+  return request(url, {
+    method: 'POST',
+    data
+  });
+};
+
+//编辑抽屉表格数据
+
+export const editDrawerTableData = (data:any,tabKey:number) => {
+
+  let url:string = '';
+  if(tabKey == 1){url = '/costAccount/setting/editStandItemEmpMap';}
+  if(tabKey == 2){url = '/costAccount/setting/editStandItemEquipmentMap';}
+  if(tabKey == 3){url = '/costAccount/setting/editStandItemSpaceMap';}
+
+  return request(url, {
+    method: 'POST',
+    data
+  });
+};
+
+
+//shanchu抽屉表格数据
+
+export const delDrawerTableData = (id:Key,tabKey:number) => {
+
+  let url:string = '';
+  if(tabKey == 1){url = '/costAccount/setting/deleteStandItemEmpMap';}
+  if(tabKey == 2){url = '/costAccount/setting/deleteStandItemEquipmentMap';}
+  if(tabKey == 3){url = '/costAccount/setting/deleteStandItemSpaceMap';}
+
+  return request(url, {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+
+
+
+
+
+
+
+
+

+ 237 - 0
src/pages/costLibraryManagement/projectCostManagement/standardProjectMana/style.less

@@ -0,0 +1,237 @@
+
+.standardProjectMana_drawer {
+  .topbar {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+
+    .title {
+      height: 16px;
+      font-size: 16px;
+      font-weight: 500;
+      color: #17181A;
+      line-height:16px;
+    }
+
+    .btnGroup {
+
+      .clearBtn {
+        cursor: pointer;
+        display: inline-block;
+        text-align: center;
+        width: 112px;
+        height: 24px;
+        line-height: 23px;
+        background: #FAFCFF;
+        border-radius: 4px;
+        border: 1px solid #DAE2F2;
+        font-size: 14px;
+        font-weight: 400;
+        color: #17181A;
+        margin-right: 8px;
+
+        &.disabled {
+          cursor: not-allowed;
+          color: #65676a;
+          background-color: #f5f5f5;
+        }
+      }
+      .cancel {
+        cursor: pointer;
+        display: inline-block;
+        text-align: center;
+        width: 56px;
+        height: 24px;
+        line-height: 23px;
+        background: #FAFCFF;
+        border-radius: 4px;
+        border: 1px solid #DAE2F2;
+        font-size: 14px;
+        font-weight: 400;
+        color: #17181A;
+        margin-right: 8px;
+      }
+
+      .add {
+        cursor: pointer;
+        display: inline-block;
+        width: 56px;
+        text-align: center;
+        height: 24px;
+        line-height: 23px;
+        background: #3377FF;
+        border-radius: 4px;
+        border: 1px solid #DAE2F2;
+        font-size: 14px;
+        font-weight: 400;
+        color: #fff;
+      }
+    }
+  }
+
+  .content {
+    overflow: hidden;
+
+    .rightContent {
+      position: relative;
+      border-radius: 4px;
+      // padding: 16px;
+      background: #FFF;
+
+      .checkBtn {
+        position: absolute;
+        cursor: pointer;
+        top: 0;
+        right: 0;
+        padding: 0 14px;
+        height: 24px;
+        line-height: 24px;
+        background: #3376FE;
+        border-radius: 4px;
+        text-align: center;
+        font-size: 14px;
+        font-weight: 400;
+        color: #FFF;
+      }
+
+      .midLine {
+        display: flex;
+        flex-direction: row;
+        justify-content: center;
+        align-items: center;
+        height: 24px;
+        line-height: 24px;
+        background: #F0FCFC;
+        font-size: 12px;
+        color: #515866;
+        font-weight: 400;
+        margin-top: 12px;
+        margin-bottom: 15px;
+
+        &>span {
+          cursor: pointer;
+          font-size: 12px;
+          font-weight: 500;
+          color: #00B3B3;
+          padding-right: 4px;
+        }
+
+      }
+
+      .kcmp-ant-tabs-nav {
+        &::before {
+          border-bottom: none !important;
+        }
+      }
+
+      .tableToolbar {
+        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 {
+          &>span {
+            display: inline-block;
+            text-align: center;
+            width: 56px;
+            height: 24px;
+            line-height: 24px;
+            background: #3377FF;
+            color: #FFF;
+            border-radius: 4px;
+            cursor: pointer;
+          }
+        }
+      }
+      .tixiMenuSet {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        flex-direction: column;
+        width: 100%;
+        height:calc(100vh - 72px);
+        .despcrip {
+          height: 14px;
+          line-height: 14px;
+          font-size: 14px;
+          color: #7A8599;
+          margin-top: 16px;
+          margin-bottom: 15px;
+        }
+      }
+    }
+  }
+}
+
+.StandardProjectMana {
+  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;
+      }
+    }
+
+  }
+}

+ 57 - 51
src/pages/costLibraryManagement/reportMana/reportColumnMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-03 17:35:39
+ * @LastEditTime: 2023-11-16 17:40:55
  * @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
  */
@@ -14,7 +14,7 @@ import { createFromIconfontCN } from '@ant-design/icons';
 import { ActionType, ProFormInstance, ProFormRadio } from '@ant-design/pro-components';
 import { ModalForm, ProFormDependency, ProFormDigit, ProFormSelect, ProFormSwitch, ProFormText, ProFormTextArea } from '@ant-design/pro-form'
 import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm, Modal, Switch,Form } from 'antd';
+import { Input, message, Popconfirm, Modal, Switch, Form } from 'antd';
 import { Key, useEffect, useRef, useState } from 'react';
 
 import { addChildReportList, addData, delData, editData, getReportListTableData, getReportListType } from './service';
@@ -31,9 +31,9 @@ const IconFont = createFromIconfontCN({
     scriptUrl: '',
 });
 
-let currentEditRow:any = undefined;
+let currentEditRow: any = undefined;
 
-const reportColumnMana = ()=> {
+const reportColumnMana = () => {
 
     const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
     const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
@@ -105,9 +105,9 @@ const reportColumnMana = ()=> {
             width: 120,
             valueType: 'option',
             render: (_: any, record: any) => {
-                
+
                 return [
-                    <a key='edit_child' onClick={() => {currentEditRow = record;  addReportColumnChild(record) }}>子列</a>,
+                    <a key='edit_child' onClick={() => { currentEditRow = record; addReportColumnChild(record) }}>子列</a>,
                     <UpDataActBtn key={'act'} record={record} type='EDIT' />,
                     <Popconfirm
                         title="是否确认删除?"
@@ -166,13 +166,13 @@ const reportColumnMana = ()=> {
         let result = {
             name: formVal.name,
             headerText: formVal.headerText,
-            type:formVal.type,
+            type: formVal.type,
             dataType: formVal.dataType,
             dataSource: formVal.dataSource,
-            formula:formVal.dataSource == 1 ? formVal.formula:'',
-            sql:formVal.dataSource == 2?formVal.sql:'',
-            decimalPlace:formVal.dataType == 3 ?formVal.decimalPlace:undefined,
-            permil:formVal.dataType == 3?(formVal.permil?'1':'0'):undefined
+            formula: formVal.dataSource == 1 ? formVal.formula : '',
+            sql: formVal.dataSource == 2 ? formVal.sql : '',
+            decimalPlace: (formVal.dataType == 3||formVal.dataType == 2) ? formVal.decimalPlace : undefined,
+            permil: formVal.dataType == 3 ? (formVal.permil ? '1' : '0') : undefined
         }
 
         if (type == 'ADD') {
@@ -183,10 +183,10 @@ const reportColumnMana = ()=> {
             }
         }
         if (type == 'EDIT') {
-            const resp = await editData({ ...result,id:formVal.id });
+            const resp = await editData({ ...result, id: formVal.id });
             if (resp) {
-                    tableRef.current?.reload();
-                    message.success('操作成功!');
+                tableRef.current?.reload();
+                message.success('操作成功!');
             }
         }
         return true;
@@ -202,7 +202,7 @@ const reportColumnMana = ()=> {
                 title={`${type == 'EDIT' ? '编辑' : '新增'}报表列`}
                 width={352}
                 formRef={formRef}
-                initialValues={type == 'EDIT' ? { ...record,permil:record.permil == '1'?true:false } : {decimalPlace:2}}
+                initialValues={type == 'EDIT' ? { ...record, permil: record.permil == '1' ? true : false } : { decimalPlace: 2 }}
                 trigger={
                     type == 'EDIT_CHILD' ? <a key="edit_child" >子列</a> : type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
                 }
@@ -266,7 +266,7 @@ const reportColumnMana = ()=> {
                             />
                             <ProFormDependency name={['dataType']}>
                                 {
-                                    ({ dataType }) => dataType == 3 && (
+                                    ({ dataType }) => (dataType == 3 || dataType == 2) && (
                                         <>
                                             <ProFormDigit
                                                 name="decimalPlace"
@@ -275,11 +275,16 @@ const reportColumnMana = ()=> {
                                                 placeholder="例:([1]+[2])/[3]"
                                                 rules={[{ required: true, message: '小数位不能为空!' }]}
                                             />
-                                            <Form.Item name='permil'>
-                                                <Switch  size='small' style={{ marginTop: 26, marginLeft: 8 }} />
-                                            </Form.Item>
-                                            
-                                            <span style={{ marginTop: 23, marginLeft: 4 }}>千分号</span>
+                                            {
+                                                dataType == 3 && (
+                                                    <>
+                                                    <Form.Item name='permil'>
+                                                        <Switch size='small' style={{ marginTop: 26, marginLeft: 8 }} />
+                                                    </Form.Item>
+                                                    <span style={{ marginTop: 23, marginLeft: 4 }}>千分号</span>
+                                                    </>
+                                                )
+                                            }
                                         </>
 
                                     )
@@ -297,29 +302,30 @@ const reportColumnMana = ()=> {
                                 ]}
                                 rules={[{ required: true, message: '取数类型不能为空!' }]}
                             />
-                            
+
                             <ProFormDependency name={['dataSource']}>
                                 {
                                     ({ dataSource }) => dataSource == 1 && (
                                         <>
-                                             <ProFormSelect
-                                                label={<><span style={{color:'#ff4d4f',fontSize:17,fontWeight:300,paddingRight:5}}>*</span>计算公式:</>}
+                                            <ProFormSelect
+                                                label={<><span style={{ color: '#ff4d4f', fontSize: 17, fontWeight: 300, paddingRight: 5 }}>*</span>计算公式:</>}
                                                 name='line'
                                                 placeholder="插入列"
-                                                request={async ()=>{
-                                                       const resp = await getReportListTableData({pageSize:500,current:1});
-                                                       if(resp){
-                                                            return resp.list.map((a)=>({label:a.name,value:a.code}))
-                                                       }
-                                                       return []
+                                                showSearch
+                                                request={async () => {
+                                                    const resp = await getReportListTableData({ pageSize: 500, current: 1 });
+                                                    if (resp) {
+                                                        return resp.list.map((a) => ({ label: a.name, value: a.code }))
+                                                    }
+                                                    return []
                                                 }}
                                                 fieldProps={{
-                                                      onChange(value, option) {
+                                                    onChange(value, option) {
                                                         const _formula = formRef.current?.getFieldValue('formula');
-                                                        formRef.current?.setFieldValue('formula',`${_formula?_formula:''}[${value}]`)
-                                                      },
+                                                        formRef.current?.setFieldValue('formula', `${_formula ? _formula : ''}[${value}]`)
+                                                    },
                                                 }}
-                                                // rules={[{ required: , message: '计算公式不能为空!' }]}
+                                            // rules={[{ required: , message: '计算公式不能为空!' }]}
                                             />
                                             <ProFormTextArea
                                                 name="formula"
@@ -327,7 +333,7 @@ const reportColumnMana = ()=> {
                                                 placeholder="例:([1]+[2])/[3]"
                                                 rules={[{ required: true, message: '计算公式不能为空!' }]}
                                             />
-                                           
+
                                         </>
                                     )
                                 }
@@ -356,24 +362,24 @@ const reportColumnMana = ()=> {
 
     }
 
-    const onSaveHandle = async (keys:Key[],rows:any[]) => {
-           const result = {
-            parentCode:currentEditRow.code,
-            childColumnList:rows
-           }
-           const resp = await addChildReportList(result);
-           if(resp){
-               currentEditRow = undefined
-               message.success('操作成功!');
-               tableRef.current?.reload();
-           }
-           
+    const onSaveHandle = async (keys: Key[], rows: any[]) => {
+        const result = {
+            parentCode: currentEditRow.code,
+            childColumnList: rows
+        }
+        const resp = await addChildReportList(result);
+        if (resp) {
+            currentEditRow = undefined
+            message.success('操作成功!');
+            tableRef.current?.reload();
+        }
+
     }
 
-    const addReportColumnChild = (record:any) => {
+    const addReportColumnChild = (record: any) => {
 
         const ref = React.createRef<{ save: any; }>();
-    
+
 
         Modal.confirm({
             title: `选择报表列`,
@@ -405,7 +411,7 @@ const reportColumnMana = ()=> {
 
             <div className='toolBar'>
                 <div className='filter'>
-                <div className='filterItem' >
+                    <div className='filterItem' >
                         <span className='label' style={{ whiteSpace: 'nowrap' }}> 列类型:</span>
                         <ProFormSelect noStyle placeholder={'请选择类型'}
                             width={160}
@@ -430,7 +436,7 @@ const reportColumnMana = ()=> {
                         <span className='label' style={{ whiteSpace: 'nowrap' }}> 列标题:</span>
                         <Input placeholder={'请输入'} allowClear width={160}
                             suffix={
-                                <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('columnName')} />
+                                <IconFont type="iconsousuo" style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('columnName')} />
                             }
                             onChange={(e) => {
                                 set_tableDataSearchKeywords(e.target.value);

+ 3 - 4
src/pages/costLibraryManagement/reportMana/reportListMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-03 15:39:51
+ * @LastEditTime: 2023-11-16 17:41:08
  * @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
  */
@@ -391,7 +391,7 @@ const reportListMana = () => {
             }
         },
     );
-
+    
     const DraggableContainer = (props: any) => (
         <SortContainer
             useDragHandle
@@ -434,7 +434,6 @@ const reportListMana = () => {
     useEffect(() => {
         if (ifEditTable) {
             set_tableColumn([{
-                title: '排序',
                 dataIndex: 'sort',
                 width: 60,
                 className: 'drag-visible',
@@ -477,7 +476,7 @@ const reportListMana = () => {
                 <div className='toolbar'>
                     <Input placeholder={'报表名称'} allowClear
                         suffix={
-                            <IconFont type="iconsousuo" />
+                            <IconFont type="iconsousuo"  style={{color:'#99A6BF'}}/>
                         }
                         style={{ width: 156 }}
                         onChange={(e) => {

+ 2 - 2
src/pages/costLibraryManagement/reportMana/reportListMana/service.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-07 11:12:10
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-02 17:58:13
+ * @LastEditTime: 2023-11-11 16:13:45
  * @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
  */
@@ -28,7 +28,7 @@ export type  ClolumnTableDataType = {
   
 }
 
-export const getClolumnTableData = (params:{reportCode:string}) => {
+export const getClolumnTableData = (params:{reportCode:string,pageSize:number,current:number}) => {
     return request('/costAccount/report/getReportColumn', {
       method: 'GET',
       params:{...params}

+ 4 - 4
src/pages/costLibraryManagement/reportMana/reportNavSet/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-03 09:45:45
+ * @LastEditTime: 2023-11-16 17:41: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
  */
@@ -223,7 +223,7 @@ export default function ReportNavSet() {
                                     request={async () => {
                                         if (report) {
                                             const { value: reportCode } = report;
-                                            const resp = await getClolumnTableData({ reportCode });
+                                            const resp = await getClolumnTableData({ reportCode,pageSize:500,current:1});
                                             if (resp) {
                                                 return resp.list.map((a: any) => ({ label: a.columnHeaderText, value: a.columnCode }))
                                             }
@@ -275,7 +275,7 @@ export default function ReportNavSet() {
                                     request={async () => {
                                         if (report) {
                                             const { value: reportCode } = report;
-                                            const resp = await getClolumnTableData({ reportCode });
+                                            const resp = await getClolumnTableData({ reportCode,pageSize:500,current:1 });
                                             if (resp) {
                                                 return resp.list.map((a: any) => ({ label: a.columnHeaderText, value: a.columnName }))
                                             }
@@ -324,7 +324,7 @@ export default function ReportNavSet() {
                         <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
                         <Input placeholder={'请输入源报表名称'} allowClear
                             suffix={
-                                <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('reportName')} />
+                                <IconFont type="iconsousuo" style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('reportName')} />
                             }
                             onChange={(e) => {
                                 set_tableDataSearchKeywords(e.target.value);

+ 125 - 116
src/pages/monthlyInfoSearch/patientChargeItemsImport/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-03 13:43:37
+ * @LastEditTime: 2023-11-22 16:50:29
  * @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
  */
@@ -22,7 +22,7 @@ import FormItem from 'antd/es/form/FormItem';
 import { DatePicker, Input } from 'antd';
 import { useEffect, useRef, useState } from 'react';
 
-import { getData, downloadTemplateReq, importDataPost,getTotalNumReq } from './service';
+import { getData, downloadTemplateReq, importDataPost, getTotalNumReq } from './service';
 
 import './style.less';
 import moment from 'moment';
@@ -43,96 +43,105 @@ const currentData = `${new Date().getFullYear()}-${(new Date().getMonth() + 1)
   .toString()
   .padStart(2, '0')}`;
 
+
+const columns: ProColumns[] = [
+  {
+    title: '住院号/门诊号',
+    dataIndex: 'visitNo',
+  },
+  {
+    title: '病人ID',
+    dataIndex: 'patientNo',
+  },
+  {
+    title: '患者姓名',
+    dataIndex: 'orderUserName',
+  },
+  {
+    title: '项目代码',
+    dataIndex: 'itemCode',
+  },
+  {
+    title: '项目名称',
+    dataIndex: 'itemName',
+  },
+  {
+    title: '医嘱项目代码',
+    dataIndex: 'orderCode',
+  },
+  {
+    title: '医嘱项目名称',
+    dataIndex: 'orderName',
+  },
+  {
+    title: '项目类别',
+    dataIndex: 'itemType',
+  },
+  {
+    title: '开单科室代码',
+    dataIndex: 'orderDepartmentCode',
+  },
+  {
+    title: '开单科室名称',
+    dataIndex: 'orderDepartmentName',
+  },
+  {
+    title: '开单人工号',
+    dataIndex: 'orderUserCode',
+  },
+  {
+    title: '开单人姓名',
+    dataIndex: 'orderUserName',
+  },
+  {
+    title: '执行科室代码',
+    dataIndex: 'executeDepartmentCode',
+  },
+  {
+    title: '执行科室名称',
+    dataIndex: 'executeDepartmentName',
+  },
+  {
+    title: '执行人工号',
+    dataIndex: 'executeUserCode',
+  },
+  {
+    title: '执行人姓名',
+    dataIndex: 'executeUserName',
+  },
+  {
+    title: '数量',
+    dataIndex: 'num',
+  },
+  {
+    title: '单价',
+    dataIndex: 'price',
+  },
+  {
+    title: '金额',
+    dataIndex: 'amount',
+    renderText(num) {
+      return formatMoneyNumber(num);
+    },
+  },
+  {
+    title: '费用发生时间',
+    width: 200,
+    dataIndex: 'executeTime',
+  },
+];
+
 export default function patientChargeItemsImport() {
-  const [computeDate,set_computeDate] = useState(currentData);
+  const [computeDate, set_computeDate] = useState(currentData);
   const [tableDataFilterParams, set_tableDataFilterParams] = useState<any>({ computeDate: currentData });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState('');
   const tableRef = useRef<ActionType>();
-  const [totalNum,set_totalNum] = useState(0);
-
-  const columns:ProColumns[] = [
-    {
-      title: '住院号/门诊号',
-      dataIndex: 'visitNo',
-    },
-    {
-      title: '病人ID',
-      dataIndex: 'patientNo',
-    },
-    {
-      title: '患者姓名',
-      dataIndex: 'orderUserName',
-    },
-    {
-      title: '项目代码',
-      dataIndex: 'itemCode',
-    },
-    {
-      title: '项目名称',
-      dataIndex: 'itemName',
-    },
-    {
-      title: '项目类别',
-      dataIndex: 'itemType',
-    },
-    {
-      title: '开单科室代码',
-      dataIndex: 'orderDepartmentCode',
-    },
-    {
-      title: '开单科室名称',
-      dataIndex: 'orderDepartmentName',
-    },
-    {
-      title: '开单人工号',
-      dataIndex: 'orderUserCode',
-    },
-    {
-      title: '开单人姓名',
-      dataIndex: 'orderUserName',
-    },
-    {
-      title: '执行科室代码',
-      dataIndex: 'executeDepartmentCode',
-    },
-    {
-      title: '执行科室名称',
-      dataIndex: 'executeDepartmentName',
-    },
-    {
-      title: '执行人工号',
-      dataIndex: 'executeUserCode',
-    },
-    {
-      title: '执行人姓名',
-      dataIndex: 'executeUserName',
-    },
-    {
-      title: '数量',
-      dataIndex: 'num',
-    },
-    {
-      title: '单价',
-      dataIndex: 'price',
-    },
-    {
-      title: '金额',
-      dataIndex: 'amount',
-      renderText(num) {
-          return formatMoneyNumber(num);
-      },
-    },
-    {
-      title: '费用发生时间',
-      dataIndex: 'executeTime',
-    },
-  ];
+  const [totalNum, set_totalNum] = useState(0);
 
-  const getTableData = async (params:any) => {
+  const getTableData = async (params: any) => {
     const resp = await getData({ ...params, ...tableDataFilterParams });
-    console.log({resp})
     if (resp) {
-      const {list,totalCount,pageSize,totalPage} = resp;
+      const { list, totalCount, pageSize, totalPage } = resp;
       return {
         data: list,
         success: true,
@@ -144,18 +153,18 @@ export default function patientChargeItemsImport() {
     return [];
   };
 
-  const tableDataSearchHandle = (paramName:string) => {
+  const tableDataSearchHandle = (paramName: string) => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       [`${paramName}`]: tableDataSearchKeywords,
     });
   };
 
-  const getTotalNum = async ()=>{
-      const resp = await getTotalNumReq({computeDate,itemType:tableDataFilterParams.itemType,departmentName:tableDataFilterParams.departmentName});
-      if(resp||resp == 0){
-        set_totalNum(resp);
-      }
+  const getTotalNum = async () => {
+    const resp = await getTotalNumReq({ computeDate, itemType: tableDataFilterParams.itemType, departmentName: tableDataFilterParams.departmentName });
+    if (resp || resp == 0) {
+      set_totalNum(resp);
+    }
   }
 
   const downloadTemplate = async () => {
@@ -214,9 +223,9 @@ export default function patientChargeItemsImport() {
     );
   };
 
-  useEffect(()=>{
+  useEffect(() => {
     getTotalNum();
-  },[tableDataFilterParams])
+  }, [tableDataFilterParams])
 
   useEffect(() => {
 
@@ -252,28 +261,28 @@ export default function patientChargeItemsImport() {
               </div>
             }
           </div>
-    
+
           <div className='filterItem' style={{ marginLeft: 16 }}>
-              <span className='label'>项目类别:</span>
-              <ProFormSelect
-                  noStyle
-                  allowClear
-                  placeholder="请选择"
-                  style={{ width: 160, marginRight: 16 }}
-                  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 }));
-                    }
-                    return [];
-                  }}
-                  fieldProps={{
-                      onChange(value, option) {
-                          set_tableDataFilterParams({ ...tableDataFilterParams,itemType: value })
-                      },
-                  }}
-              />
+            <span className='label'>项目类别:</span>
+            <ProFormSelect
+              noStyle
+              allowClear
+              placeholder="请选择"
+              style={{ width: 160, marginRight: 16 }}
+              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 }));
+                }
+                return [];
+              }}
+              fieldProps={{
+                onChange(value, option) {
+                  set_tableDataFilterParams({ ...tableDataFilterParams, itemType: value })
+                },
+              }}
+            />
           </div>
           <div className="filterItem" style={{ marginLeft: 16, width: 205 }}>
             <span className="label" style={{ whiteSpace: 'nowrap' }}>
@@ -302,7 +311,7 @@ export default function patientChargeItemsImport() {
               onPressEnter={(e) => {
                 set_tableDataFilterParams({
                   ...tableDataFilterParams,
-                  departmentName: ((e.target) as HTMLInputElement).value 
+                  departmentName: ((e.target) as HTMLInputElement).value
                 });
               }}
             />
@@ -316,7 +325,7 @@ export default function patientChargeItemsImport() {
           columns={columns}
           actionRef={tableRef}
           rowKey="id"
-          scroll={{x:2000}}
+          scroll={{ x: 2200 }}
           params={tableDataFilterParams}
           request={(params) => getTableData(params)}
         />

BIN
src/pages/reportExport/.DS_Store


+ 14 - 4
src/pages/reportCheck/report/index.tsx → src/pages/reportExport/report/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-01-04 14:12:31
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-08 15:51:40
+ * @LastEditTime: 2023-11-09 15:10:21
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/oneBatch/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -161,17 +161,27 @@ const ReportExport = () => {
                 return <Dropdown menu={{ items }}>
                   <a onClick={(e) => e.preventDefault()}>
                     <Space>
-                      {(item.dataType && item.dataType == 2 && _) ? formatMoneyNumber(Number(Number(_).toFixed(2))) : _}
+                      {(item.dataType && item.dataType == 3 && _)&&formatMoneyNumber(Number(Number(_).toFixed(item.decimalPlace?item.decimalPlace:2)))}
+                      {(item.dataType && item.dataType == 2 && _&& typeof _ == 'number')&&`${(_ *100).toFixed(item.decimalPlace?item.decimalPlace:2)}%`}
+                      {(item.dataType != 2 && item.dataType != 3) && _}
                       <DownOutlined />
                     </Space>
                   </a>
                 </Dropdown>
               } else {
-                return <a className='active' onClick={() => reportJumphandle({ ...item.redirectData[0], ...record })}>{(item.dataType && item.dataType == 2 && _) ? Number(Number(_).toFixed(2)) : _}</a>
+                return <a className='active' onClick={() => reportJumphandle({ ...item.redirectData[0], ...record })}>
+                  {(item.dataType && item.dataType == 3 && _)&&formatMoneyNumber(Number(Number(_).toFixed(item.decimalPlace?item.decimalPlace:2)))}
+                  {(item.dataType && item.dataType == 2 && _&& typeof _ == 'number')&&`${(_ *100).toFixed(item.decimalPlace?item.decimalPlace:2)}%`}
+                  {(item.dataType != 2 && item.dataType != 3) && _}
+                </a>
               }
             }
 
-            return <span >{(item.dataType && item.dataType == 2 && _) ? formatMoneyNumber(Number(Number(_).toFixed(2))) : _}</span>
+            return <span >
+              {(item.dataType && item.dataType == 3 && _)&&formatMoneyNumber(Number(Number(_).toFixed(item.decimalPlace?item.decimalPlace:2)))}
+              {(item.dataType && item.dataType == 2 && _&& typeof _ == 'number')&&`${(_ *100).toFixed(item.decimalPlace?item.decimalPlace:2)}%`}
+              {(item.dataType != 2 && item.dataType != 3) && _}
+              </span>
           }
 
         }

+ 0 - 0
src/pages/reportCheck/report/service.ts → src/pages/reportExport/report/service.ts


+ 0 - 0
src/pages/reportCheck/report/style.less → src/pages/reportExport/report/style.less


+ 116 - 74
src/utils/tooljs.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-02-20 14:31:06
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-08 15:49:40
+ * @LastEditTime: 2023-11-16 20:50:25
  * @FilePath: /BudgetManaSystem/src/utils/tooljs.js
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -12,46 +12,66 @@ import axios from 'axios';
 
 
 
-let parent:any = undefined;
+let parent: any = undefined;
 
-export const getDeepestTreeData:any= (tree:any,childrenName:string)=>{
-     
-      if(tree[`${childrenName}`]&&tree[`${childrenName}`].length>0){
-           parent = tree;
-           return getDeepestTreeData(tree[`${childrenName}`][0],childrenName)    
-      }
+export const getDeepestTreeData: any = (tree: any, childrenName: string) => {
+
+  if (tree[`${childrenName}`] && tree[`${childrenName}`].length > 0) {
+    parent = tree;
+    return getDeepestTreeData(tree[`${childrenName}`][0], childrenName)
+  }
+
+  return [tree, parent]
+}
 
-      return  [tree,parent] 
+
+//找出所有的子节点(不包含有child的节点)
+export const getChilds = (treeData: any, childKeyName: string) => {
+  let result: any[] = [];
+  const looper = (node: any) => {
+    if (node[`${childKeyName}`] && treeData[`${childKeyName}`].length > 0) {
+      for (const child of node[`${childKeyName}`]) {
+         if(child[`${childKeyName}`]&&child[`${childKeyName}`].length>0){
+              looper(child[`${childKeyName}`]);
+         }else{
+              result.push(child);
+         }
+      }
+    }
+  }
+  looper(treeData);
+  return result
 }
 
 
 
 
 
+
 /*
  * @param x {Object} 对象1
  * @param y {Object} 对象2
  * @return  {Boolean} true 为相等,false 为不等
  */
-export  const deepEqual = (x: { [x: string]: any; } | null, y: { [x: string]: any; hasOwnProperty?: any; } | null) => {
-      // 指向同一内存时
-      if (x === y) {
-        return true;
-      } else if ((typeof x == "object" && x != null) && (typeof y == "object" && y != null)) {
-        if (Object.keys(x).length !== Object.keys(y).length) {
-          return false;
-        }
-        for (var prop in x) {
-          if (y.hasOwnProperty(prop)) {  
-            if (!deepEqual(x[prop], y[prop])) return false;
-          } else {
-            return false;
-          }
-        }
-        return true;
+export const deepEqual = (x: { [x: string]: any; } | null, y: { [x: string]: any; hasOwnProperty?: any; } | null) => {
+  // 指向同一内存时
+  if (x === y) {
+    return true;
+  } else if ((typeof x == "object" && x != null) && (typeof y == "object" && y != null)) {
+    if (Object.keys(x).length !== Object.keys(y).length) {
+      return false;
+    }
+    for (var prop in x) {
+      if (y.hasOwnProperty(prop)) {
+        if (!deepEqual(x[prop], y[prop])) return false;
       } else {
         return false;
       }
+    }
+    return true;
+  } else {
+    return false;
+  }
 }
 
 
@@ -60,33 +80,34 @@ export  const deepEqual = (x: { [x: string]: any; } | null, y: { [x: string]: an
 interface Node {
   code: string;
   parentCode: number;
+  [key: string]: any;
   children?: Node[];
 }
 
-export const findAllParents = (data: Node[], parentCode:string): Node[] => {
+export const findAllParents = (data: Node[], parentCode: string,childKeyName:string): Node[] => {
   let result: Node[] = [];
 
   function findNodeRecursively(node: Node, path: Node[]): boolean {
-      if (node.code === `${parentCode}`) {
-          result = [...path, node];
-          return true;
-      }
+    if (node.code === `${parentCode}`) {
+      result = [...path, node];
+      return true;
+    }
 
-      if (node.children) {
-          for (const child of node.children) {
-              if (findNodeRecursively(child, [...path, node])) {
-                  return true;
-              }
-          }
+    if (node[`${childKeyName}`]&&node[`${childKeyName}`].length>0) {
+      for (const child of node[`${childKeyName}`]) {
+        if (findNodeRecursively(child, [...path, node])) {
+          return true;
+        }
       }
+    }
 
-      return false;
+    return false;
   }
 
   for (const node of data) {
-      if (parentCode != '0' && findNodeRecursively(node, [])) {
-          break;
-      }
+    if (parentCode != '0' && findNodeRecursively(node, [])) {
+      break;
+    }
   }
 
   return result;
@@ -97,7 +118,7 @@ export const findAllParents = (data: Node[], parentCode:string): Node[] => {
 
 interface TreeNode {
   code: string;
-  [key:string]:any,
+  [key: string]: any,
   children?: TreeNode[];
 }
 
@@ -125,11 +146,13 @@ export const getNodesWithChildren = (tree: TreeNode[]): TreeNode[] => {
 }
 
 
+
+
 //找出所有父节点的code
 
 
 
-export const  findParentCodes = (node: TreeNode, parentCodes: string[] = []): string[] => {
+export const findParentCodes = (node: TreeNode, parentCodes: string[] = []): string[] => {
   if (node.children && node.children.length > 0) {
     parentCodes.push(node.code);
 
@@ -142,6 +165,23 @@ export const  findParentCodes = (node: TreeNode, parentCodes: string[] = []): st
 }
 
 
+//更改树结构集合的子集属性名
+
+export const renameChildListToChildren = (nodes: any[],key:string) => {
+  return nodes.map(node => {
+      // 创建当前节点的副本
+      const newNode = { ...node };
+
+      // 如果当前节点有 childList,则重命名为 children,并递归处理子节点
+      if (newNode[`${key}`]&&newNode[`${key}`].length>0) {
+          newNode.children = renameChildListToChildren(newNode[`${key}`],key);
+      }
+
+      return newNode;
+  });
+}
+
+
 
 //将动态表头转换
 
@@ -158,8 +198,8 @@ type Column = {
   key: string;
   children?: Column[];
 };
- 
-export const  convertToColumns = (json: JsonStructure[]): Column[] => {
+
+export const convertToColumns = (json: JsonStructure[]): Column[] => {
   return json.map((item) => {
     let column: Column = {
       title: item.name,
@@ -178,15 +218,15 @@ export const  convertToColumns = (json: JsonStructure[]): Column[] => {
 
 //搜索树结构中叶子节点的某一个属性,并返回所有匹配的集合
 
-export const searchLeaves = (nodes:any[], keywords:string|undefined, keyName: string, childrenKey: string, results: any[] = []): any[] => {
+export const searchLeaves = (nodes: any[], keywords: string | undefined, keyName: string, childrenKey: string, results: any[] = []): any[] => {
   for (const node of nodes) {
-      if (!Array.isArray(node[childrenKey])) {
-          if (node[keyName].indexOf(keywords) != -1) {
-              results.push(node);
-          }
-      } else if (Array.isArray(node[childrenKey])) {
-          searchLeaves(node[childrenKey], keywords, keyName, childrenKey, results);
+    if (!Array.isArray(node[childrenKey])) {
+      if (node[keyName].indexOf(keywords) != -1) {
+        results.push(node);
       }
+    } else if (Array.isArray(node[childrenKey])) {
+      searchLeaves(node[childrenKey], keywords, keyName, childrenKey, results);
+    }
   }
   return results;
 }
@@ -194,7 +234,7 @@ export const searchLeaves = (nodes:any[], keywords:string|undefined, keyName: st
 
 //导入按钮的下载模板
 
-export const downloadTemplateReq = (pathStr:string) => {
+export const downloadTemplateReq = (pathStr: string) => {
 
 
   let path = `/gateway${pathStr}`;
@@ -203,28 +243,28 @@ export const downloadTemplateReq = (pathStr:string) => {
   const { token = '' } = JSON.parse(userData as string);
 
   axios({
-      method: 'get',
-      url: path,
-      responseType: 'blob',
-      headers: { token },
+    method: 'get',
+    url: path,
+    responseType: 'blob',
+    headers: { token },
   })
-      .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)
-
-      });
+    .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)
+
+    });
 
 
 
@@ -232,9 +272,11 @@ export const downloadTemplateReq = (pathStr:string) => {
 
 
 
+
+
 //计算字符串长度px
 
-export const getStringWidth = (str:string, font:string) => {
+export const getStringWidth = (str: string, font: string) => {
   // 创建一个临时元素
   var tempDiv = document.createElement('div');
   tempDiv.style.position = 'absolute';

BIN
static/cancel.png


BIN
成本核算系统_2023_11_10.zip


BIN
成本核算系统_2023_11_17.zip


BIN
成本核算系统_2023_11_24.zip