Procházet zdrojové kódy

更新报告和静态切换渲染逻辑

code4eat před 2 roky
rodič
revize
34ada80aa8

+ 43 - 1
.umirc.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-25 15:21:26
+ * @LastEditTime: 2023-05-29 14:00:20
  * @FilePath: /BudgetManaSystem/.umirc.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -311,6 +311,48 @@ export default defineConfig({
         },
       ]
     },
+    {
+      name: '交叉分析',
+      path: '/crosstabReport',
+      routes: [
+        {
+          name: '国考指标',
+          path: '/crosstabReport/nationalIndicator',
+          routes:[{}]
+        },
+        {
+          name: '经营分析',
+          path: '/crosstabReport/businessAnalysis',
+          routes:[
+            {
+              name: '大屏-全院分析',
+              path: '/crosstabReport/businessAnalysis/hospitalAnalysis',
+              routes:[{}]
+            },
+            {
+              name: '大屏-住院分析',
+              path: '/crosstabReport/businessAnalysis/inpAnalysis',
+              routes:[{}]
+            },
+            {
+              name: '大屏-门诊分析',
+              path: '/crosstabReport/businessAnalysis/opdAnalysis',
+              routes:[{}]
+            },
+          ]
+        },
+        {
+          name: '成本分析',
+          path: '/crosstabReport/costAnalysis',
+          routes:[{}]
+        },
+        {
+          name: '财务报表分析',
+          path: '/crosstabReport/financialReportAnalysis',
+          routes:[{}]
+        },
+      ]
+    },
   ],
   npmClient: 'yarn',
 });

+ 3 - 3
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-05-25 13:38:55
+ * @LastEditTime: 2023-05-29 13:46:13
  * @FilePath: /BudgetManaSystem/src/app.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -249,13 +249,13 @@ export function patchClientRoutes({ routes }: { routes: any }) {
   const treeLoop = (treeData: any) => {
     // console.log({treeData});
     if(treeData.routes){
-      const paths = [...new Array(10).keys()].map((a, index) => ({
+      const paths = [...new Array(20).keys()].map((a, index) => ({
         path: `${treeData.path == '/'?'':treeData.path}/reports/${index}`,
         exact: true,
         element: <Report />,
       }));
   
-      const lanhuPagePaths = [...new Array(10).keys()].map((a, index) => ({
+      const lanhuPagePaths = [...new Array(20).keys()].map((a, index) => ({
         path: `${treeData.path == '/'?'':treeData.path}/static/${index}`,
         exact: true,
         element: <Static />,

+ 28 - 7
src/pages/Home/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-03-02 10:51:20
+ * @LastEditTime: 2023-05-29 09:41:37
  * @FilePath: /BudgetManaSystem/src/pages/Home/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 
@@ -130,6 +130,27 @@ const HomePage: React.FC = () => {
     if (num == 5) {
       history.push('/budgetMana/oneBatch');
     }
+    if (num == 6) {
+      history.push('/secondaryDistribute/employeeInfoCheck');
+    }
+    if (num == 7) {
+      history.push('/secondaryDistribute/secondaryDitriComputed');
+    }
+    if (num == 8) {
+      history.push('/secondaryDistribute/secondaryDitriCheck');
+    }
+    if (num == 9) {
+      history.push('/secondaryDistribute/secondaryDitriCheck');
+    }
+    if (num == 10) {
+      //history.push('/secondaryDistribute/secondaryDitriCheck');
+    }
+    if (num == 11) {
+      //history.push('/secondaryDistribute/secondaryDitriCheck');
+    }
+    if (num == 12) {
+      //history.push('/secondaryDistribute/secondaryDitriCheck');
+    }
   }
 
   useEffect(() => {
@@ -232,21 +253,21 @@ const HomePage: React.FC = () => {
         {
           currentActivedTabIndex == 5 && (
             <div className={'multiStep active'}>
-              <div className='block'>
+              <div className='block' onClick={() => { goPageHandle(6) }}>
                 <div className='title'>
                   二次分配数据核定
                   <IconFont type='icon-jinru' />
                 </div>
                 <div className='detail'>各核算单元的绩效专员添加及提交各自负责核算单元二次分配所需的数据</div>
               </div>
-              <div className='block'>
+              <div className='block' onClick={() => { goPageHandle(7) }}>
                 <div className='title'>
                   二次分配计算
                   <IconFont type='icon-jinru' />
                 </div>
                 <div className='detail'>计算得到各负责单元的二次分配奖金数据,确认所有人员分配无误后提交至绩效组人员审核</div>
               </div>
-              <div className='block'>
+              <div className='block' onClick={() => { goPageHandle(8) }}>
                 <div className='title'>
                   二次分配审核
                   <IconFont type='icon-jinru' />
@@ -260,21 +281,21 @@ const HomePage: React.FC = () => {
         {
           currentActivedTabIndex == 6 && (
             <div className={'multiStep active'}>
-              <div className='block'>
+              <div className='block' onClick={() => { goPageHandle(9) }}>
                 <div className='title'>
                   一次分配报表
                   <IconFont type='icon-jinru' />
                 </div>
                 <div className='detail'>可查询历史一次分配报表记录及各职系一次分配的详细报表信息</div>
               </div>
-              <div className='block'>
+              <div className='block' onClick={() => { goPageHandle(10) }}>
                 <div className='title'>
                   二次分配报表
                   <IconFont type='icon-jinru' />
                 </div>
                 <div className='detail'>可查询历史二次分配报表记录及各核算单元二次分配的详细报表信息</div>
               </div>
-              <div className='block'>
+              <div className='block' onClick={() => { goPageHandle(11) }}>
                 <div className='title'>
                   个人奖金报表
                   <IconFont type='icon-jinru' />

+ 3 - 1
src/pages/reportCheck/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-05-25 14:59:18
+ * @LastEditTime: 2023-05-29 14:16:04
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/oneBatch/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -34,6 +34,8 @@ const ReportTemplate = () => {
 
   const { reportCode: urlReportCode } = useParams();
 
+  console.log({urlReportCode});
+
   // const location = useLocation();
   // console.log({location});
   // const menuName = location.pathname.replace('/', '');

+ 13 - 5
src/pages/reports/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-03-03 18:04:40
- * @LastEditTime: 2023-05-10 13:22:16
+ * @LastEditTime: 2023-05-29 14:19:54
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/reports/index.tsx
@@ -12,9 +12,12 @@ import { useEffect, useState } from 'react';
 import { Skeleton } from 'antd';
 import BMSPagecontainer from '@/components/BMSPageContainer';
 import { useModel } from '@umijs/max';
+import { useParams } from '@umijs/max';
 
 
 export default () => {
+
+  const { pathname } = location;
   const { initialState, setInitialState } = useModel('@@initialState');
   const [specialPageUrl, setspecialPageUrl] = useState<string | undefined>(undefined);
   const [loading, setloading] = useState(false);
@@ -26,14 +29,12 @@ export default () => {
     setloading(false);
   };
 
-  useEffect(() => {
-    setloading(true);
+  const loadPage = ()=>{
     if (initialState && initialState.spacicalPageParamsType && initialState.userData) {
       const {
         spacicalPageParamsType,
         userData: { youshuToken },
       } = initialState;
-      const { pathname } = location;
       const spacialPage = spacicalPageParamsType.filter((t) => `/budgetManaSystem${t.path}` == pathname);
 
       //console.log({pathname,spacialPage,spacicalPageParamsType,initialState});
@@ -46,9 +47,16 @@ export default () => {
         setspecialPageUrl(url);
       }
     }
-    
+  }
+
+  useEffect(() => {
+    setloading(true);
   }, [initialState]);
 
+  useEffect(()=>{
+    loadPage();
+  },[pathname])
+
   return (
     <BMSPagecontainer title={false}>
       <Skeleton loading={loading} paragraph={{ rows: 50 }} active />

+ 3 - 3
src/pages/secondaryDistribute/nonCheckProjectApprove/index.tsx

@@ -4,7 +4,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-16 09:42:52
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-26 13:30:29
+ * @LastEditTime: 2023-05-26 14:07:11
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -611,8 +611,8 @@ const NonCheckProjectApprove: React.FC = () => {
                                         onMouseEnter={() => auditType == '0' ? commitStatus == '1' ? set_ifShowTip(true) : set_ifShowTip(false) : set_ifShowTip(true)}
                                         onMouseLeave={() => set_ifShowTip(false)}
                                     >
-                                        {auditType == '1'&&commitStatus == '1'&&<span key="2" >添加</span>}
-                                        {commitStatus != '1'||auditType != '1'&&<UpDataActBtn record type='ADD' />}
+                                        {(commitStatus == '1'||auditType == '1')&&<span key="2" >添加</span>}
+                                        {(commitStatus == '0'&&auditType != '1')&&<UpDataActBtn record type='ADD' />}
                                     </div>
                                 </Popover>
                                 <div key="4" className={auditType == '1' ? 'commit disabled' : 'commit'} onClick={() => auditType == '0' ? commitBtnhandle() : () => { }}>{commitStatus == '1' ? '取消提交' : '提交'}</div>

+ 41 - 34
src/pages/secondaryDistribute/secondaryDitriComputed/index.tsx

@@ -4,7 +4,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-16 09:42:52
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-26 13:28:53
+ * @LastEditTime: 2023-05-26 14:46:52
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -163,26 +163,7 @@ const SecondaryDitriComputed: React.FC = () => {
                 renderText: (_: any, record: any) => {
                     if (ifEditMode) {
 
-                        let _val = 0;
-
-                        const calcuFunc = (value:number)=>{
-                            const updatedUserList = needSaveData.userList.map((a: any) => {
-                                if (a.account == record.account) {
-                                    const arr = a.itemValue.map((b: any) => {
-                                        if (b.code == item.code) {
-                                            return { ...b, value: value ? value : 0 } //value有为undefined的可能
-                                        } else {
-                                            return b
-                                        }
-                                    });
-                                    return { ...a, itemValue: arr }
-                                } else {
-                                    return a
-                                }
-                            });
-
-                            set_needSaveData({ ...needSaveData, userList: updatedUserList })
-                        }
+                        let _val = _;
 
                         return <ProFormDigit noStyle min={-1000000000} fieldProps={{
                             ref: ref => {
@@ -190,7 +171,22 @@ const SecondaryDitriComputed: React.FC = () => {
                                 //console.log({ref});
                             },
                             onBlur: () => {
-                                calcuFunc(_val);
+                                const updatedUserList = needSaveData.userList.map((a: any) => {
+                                    if (a.account == record.account) {
+                                        const arr = a.itemValue.map((b: any) => {
+                                            if (b.code == item.code) {
+                                                return { ...b, value: _val ? _val : 0 } //value有为undefined的可能
+                                            } else {
+                                                return b
+                                            }
+                                        });
+                                        return { ...a, itemValue: arr }
+                                    } else {
+                                        return a
+                                    }
+                                });
+    
+                                set_needSaveData({ ...needSaveData, userList: updatedUserList })
                             },
                             onChange(value) {
                                 _val = value ? value : 0;
@@ -200,7 +196,22 @@ const SecondaryDitriComputed: React.FC = () => {
                                     event.preventDefault();
 
                                     const value = event.target.value ? Number(event.target.value) : 0;
-                                    calcuFunc(value);
+                                    const updatedUserList = needSaveData.userList.map((a: any) => {
+                                        if (a.account == record.account) {
+                                            const arr = a.itemValue.map((b: any) => {
+                                                if (b.code == item.code) {
+                                                    return { ...b, value: value ? value : 0 } //value有为undefined的可能
+                                                } else {
+                                                    return b
+                                                }
+                                            });
+                                            return { ...a, itemValue: arr }
+                                        } else {
+                                            return a
+                                        }
+                                    });
+        
+                                    set_needSaveData({ ...needSaveData, userList: updatedUserList })
                                     const index = inputsRefKeys ? inputsRefKeys.findIndex(a => a == `${record.account}-${item.code}`) : -1;
                                     //console.log({index,input:inputsRef.current,inputsRefKeys});
                                     const nextInput = inputsRefKeys ? inputsRef.current[inputsRefKeys[index + 1]] : null;
@@ -486,17 +497,12 @@ const SecondaryDitriComputed: React.FC = () => {
         } else { set_ifCheckPage(false); }
     }, [location])
 
-    let timer: string | number | NodeJS.Timeout | undefined;
+  
 
     useEffect(() => {
-        //根据输入行的值重新计算
-        clearTimeout(timer);
-        timer = setTimeout(function () {
-            if (needSaveData) {
-                buildTableData(needSaveData, inputsRefKeys);
-            }
-        }, 300); // 这里的 500 是防抖的时间,单位是毫秒
-
+        if (needSaveData) {
+            buildTableData(needSaveData, inputsRefKeys);
+        }
     }, [needSaveData]);
 
     useEffect(() => {
@@ -662,9 +668,10 @@ const SecondaryDitriComputed: React.FC = () => {
                                                     onMouseEnter={() => auditType == '0' ? commitStatus == '1' ? set_ifShowTip(true) : set_ifShowTip(false) : set_ifShowTip(true)}
                                                     onMouseLeave={() => set_ifShowTip(false)}
                                                 >
-                                                    {!ifEditMode && <span key="1" className='editBtn' onClick={commitStatus == '0' && auditType != '1' ? () => set_ifEditMode(true) : () => { }}>编辑</span>}
-                                                    {ifEditMode && <span key="2" className='editBtn' onClick={commitStatus == '0' && auditType != '1' ? () => saveHandle() : () => { }}>保存</span>}
+                                                    {!ifEditMode && <span key="1" className='cancel' onClick={commitStatus == '0' && auditType != '1' ? () => set_ifEditMode(true) : () => { }}>编辑</span>}
                                                     {ifEditMode && <span key="3" className='cancel' onClick={commitStatus == '0' ? () => set_ifEditMode(false) : () => { }}>取消</span>}
+                                                    {ifEditMode && <span key="2" className='editBtn' onClick={commitStatus == '0' && auditType != '1' ? () => saveHandle() : () => { }}>保存</span>}
+                                                    
                                                 </div>
                                             </Popover>
                                             {!ifEditMode && <div key="4" className={auditType == '1' ? 'commit disabled' : 'commit'} onClick={() => auditType == '0' ? commitBtnhandle() : () => { }}>{commitStatus == '1' ? '取消提交' : '提交'}</div>}

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

@@ -224,6 +224,10 @@
                                     color: rgb(0 0 0 / 50%);
                                     background-color: #f0f2f5;
                                 }
+                                &.cancel {
+                                    color: rgb(0 0 0 / 50%);
+                                    background-color: #f0f2f5;
+                                }
                             }
                         }
                     }

+ 11 - 5
src/pages/static/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-03-03 18:04:40
- * @LastEditTime: 2023-05-10 15:18:21
+ * @LastEditTime: 2023-05-29 14:21:27
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/reports/index.tsx
@@ -18,6 +18,7 @@ export default () => {
   const { initialState, setInitialState } = useModel('@@initialState');
   const [specialPageUrl, setspecialPageUrl] = useState<string | undefined>(undefined);
   const [loading, setloading] = useState(false);
+  const { pathname } = location;
 
   
   
@@ -26,8 +27,7 @@ export default () => {
     setloading(false);
   };
 
-  useEffect(() => {
-    setloading(true);
+  const loadPage = ()=>{
     if (initialState && initialState.spacicalPageParamsType && initialState.userData) {
       const {
         spacicalPageParamsType,
@@ -36,7 +36,6 @@ export default () => {
 
       console.log({spacicalPageParamsType});
       
-      const { pathname } = location;
       const spacialPage = spacicalPageParamsType.filter((t) => `/budgetManaSystem${t.path}` == pathname);
 
       //console.log({pathname,spacialPage,spacicalPageParamsType,initialState});
@@ -49,9 +48,16 @@ export default () => {
         setspecialPageUrl(url);
       }
     }
-    
+  }
+
+  useEffect(() => {
+    setloading(true); 
   }, [initialState]);
 
+  useEffect(() => {
+    loadPage();
+  }, [pathname]);
+
   return (
     <BMSPagecontainer title={false}>
       <Skeleton loading={loading} paragraph={{ rows: 50 }} active />