Ver Fonte

更新2023-08-11周功能

code4eat há 2 anos atrás
pai
commit
8d023ebe01

+ 3 - 1
src/access.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-07-24 10:15:17
+ * @LastEditTime: 2023-08-10 13:56:50
  * @FilePath: /BudgetManaSystem/src/access.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -32,6 +32,8 @@ function findMenuItem(menu: MenuItem[], path: string): MenuItem | undefined {
 
 
 
+
+
 export default (initialState: { name: string;memuData:any[] }) => {
   // 在这里按照初始化数据定义项目中的权限,统一管理
   // 参考文档 https://next.umijs.org/docs/max/access

+ 4 - 33
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-08-01 15:03:25
+ * @LastEditTime: 2023-08-10 14:01:11
  * @FilePath: /BudgetManaSystem/src/app.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -69,12 +69,12 @@ interface UserData {
 
 
 export async function getInitialState(): Promise<{
-  isCollapsed: boolean, spacicalPageParamsType?: any[], userData: UserData,
+  isCollapsed: boolean, spacicalPageParamsType?: any[], userData: UserData,memuData:any[]
 }> {
 
   new DevicePixelRatio().init();
 
-  return { isCollapsed: false, spacicalPageParamsType: [], userData: {} };
+  return { isCollapsed: false, spacicalPageParamsType: [], userData: {},memuData:[] };
 }
 
 export const request: RequestConfig = {
@@ -159,7 +159,6 @@ export const request: RequestConfig = {
       const { token = '' } = JSON.parse(userData as any);
       return { ...config, url: `/gateway${config.url}`, headers: { token } }
       // return { ...config }
-
     }
   ],
 
@@ -199,6 +198,7 @@ export const request: RequestConfig = {
               return false
             } else {
               if (code == 200) {
+                //console.log({code,'response.data':response.data});
                 return response.data
               } else {
 
@@ -230,19 +230,6 @@ export const request: RequestConfig = {
 
 export function patchClientRoutes({ routes }: { routes: any }) {
 
-  // const paths = [...new Array(10).keys()].map((a, index) => ({
-  //   path: `/setting/manaPerformanceSet/reports/${index}`,
-  //   exact: true,
-  //   element: <Report />,
-  // }));
-
-  // //蓝湖静态页面
-  // const lanhuPagePaths = [...new Array(10).keys()].map((a, index) => ({
-  //   path: `/setting/manaPerformanceSet/reports/${index}`,
-  //   exact: true,
-  //   element: <Report />,
-  // }));
-
   const treeLoop = (treeData: any) => {
     // console.log({treeData});
     if(treeData.routes){
@@ -277,22 +264,6 @@ export function patchClientRoutes({ routes }: { routes: any }) {
     }
   }
 
-  // const treeLoop = (treeData:any)=>{
-  //   console.log({treeData})
-  //   if(treeData.path == '/setting/manaPerformanceSet'){
-  //     paths.forEach((a:any)=>{
-  //       treeData.routes.push(a); 
-  //     });
-
-  //     return;  
-  //   }else{
-  //       if(treeData.routes&&treeData.routes.length>0){
-  //         treeData.routes.forEach((a:any)=>{
-  //             treeLoop(a);
-  //         })
-  //       }
-  //   }
-  // }
 
   treeLoop(routes[0]);
 }

+ 79 - 13
src/components/BMSPageContainer/index.tsx

@@ -2,32 +2,98 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-15 09:20:58
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2022-12-16 10:05:59
+ * @LastEditTime: 2023-08-11 10:26:27
  * @FilePath: /BudgetManaSystem/src/components/BMSPageContainer/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
 
+import { createFromIconfontCN } from '@ant-design/icons';
 import { PageContainer, PageContainerProps } from '@ant-design/pro-components';
+import { useModel } from '@umijs/max';
+import { useState } from 'react';
 import './style.less';
+import '../../utils/zhongtaiA'
 
+const IconFont = createFromIconfontCN({
+  scriptUrl: '',
+});
 
-export type BMSPagecontainerPropType = PageContainerProps&{
-    
+
+export type BMSPagecontainerPropType = PageContainerProps & {
+
+}
+
+interface MenuItem {
+  function: any;
+  path: string;
+  name: string;
+  description?: string;
+  children?: MenuItem[];
+}
+
+function findMenuItem(menu: MenuItem[], path: string): MenuItem | undefined {
+  for (let i = 0; i < menu.length; i++) {
+    if (`/budgetManaSystem${menu[i].path}` === path) {
+      return menu[i];
+    } else if (menu[i].children) {
+      let found = findMenuItem(menu[i].children as MenuItem[], path);
+      if (found) return found;
+    }
+  }
 }
 
-const BMSPagecontainer = (props:BMSPagecontainerPropType) => {
+const BMSPagecontainer = (props: BMSPagecontainerPropType) => {
+
+  const { children, header, ...rest } = props;
+
+  const { initialState } = useModel('@@initialState');
+
+  const [open,set_open] = useState(false);
+
+  let description: undefined | string = undefined;
+
+  if (initialState) {
+    const thisPageData = findMenuItem(initialState.memuData, location.pathname);
+    description = thisPageData?.description
+  }
 
-  const {children,header,...rest} = props;
 
   return (
-    <PageContainer {...rest} 
-        header={{
-             ...header,
-             breadcrumb:{},
-             style:{padding:0,},
-             childrenContentStyle:{padding:0}
-        }}
-    >{children}</PageContainer>
+    <PageContainer {...rest}
+      header={{
+        ...header,
+        breadcrumb: {},
+        style: { padding: 0, },
+        childrenContentStyle: { padding: 0 }
+      }}
+    >
+      {children}
+      {
+        description && (
+          <div className={open?'pageHelp active':'pageHelp'} style={{ position: 'fixed', bottom: 24, right: 24, zIndex: 999, width: 40, height: 40 }}
+             onClick={(e)=>{ 
+              e.stopPropagation();             
+               set_open(!open)
+            }}
+          >
+            <div className={open?'helpContent open':'helpContent'} onClick={(e)=>e.stopPropagation()}>
+              <div className='contentHeader'>
+                帮助中心
+                <div className='closeBtn' onClick={()=>set_open(false)}><IconFont type="iconquxiao" /></div>
+              </div>
+              <div className='content'>
+                <img src={require('../../../static/mingcijieshi.png')} alt="" />
+                <div className='container'>
+                  <div className='inner' dangerouslySetInnerHTML={{ __html: description ? description : '' }}></div>
+                </div>
+              </div>
+            </div>
+            <IconFont className='boolIcon' type="icon-bangzhuzhongxin-weixuanzhong" />
+          </div>
+        )
+      }
+
+    </PageContainer>
   )
 }
 

+ 97 - 0
src/components/BMSPageContainer/style.less

@@ -28,8 +28,105 @@
     line-height: 21px !important;
 }
 
+.pageHelp {
+    position: relative;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    background: #FFFFFF;
+    box-shadow: 0px 4px 6px 0px rgba(64, 85, 128, 0.1);
+    border-radius: 8px;
+    border: 1px solid #E6EAF2;
+    cursor: pointer;
 
+    .helpContent {
+        position: absolute;
+        top:0;
+        right: 0;
+        width: 0;
+        height: 0;
+        background: #FFFFFF;
+        box-shadow: 0px 8px 16px 0px rgba(64, 85, 128, 0.1);
+        border-radius: 8px;
+        border: 1px solid #E6EAF2;
+        overflow: hidden;
+        transition: all 0.2s ease-in;
 
+        .contentHeader {
+            position: relative;
+            height: 40px;
+            background: #F7F9FC;
+            font-size: 16px;
+            font-weight: 500;
+            color: #17181A;
+            line-height: 40px;
+            padding-left: 16px;
+            border-bottom: 1px solid #E6EAF2;
 
+            .closeBtn {
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                position: absolute;
+                width: 20px;
+                height: 20px;
+                right: 12px;
+                top:12px;
 
+                .anticon {
+                    font-size: 16px;
+                    color:#17181A
+                }
+            }
+        }
+        .content {
+            padding:16px;
+            img {
+                 width: 288px;
+                 height: 80px;
+                 margin-bottom: 16px;
+            }
+            .container {
+                 height: 430px;
+                 overflow-y: scroll;
+                 .inner {
+                    font-size: 12px;
+                    font-weight: 400;
+                    color: #525966;
+                    line-height: 16px;
+                    h1 {
+                        margin-bottom: 4px;
+                    }
+                    p {
+                        line-height: 16px;
+                    }
+                 }
+            }
+        }
 
+        &.open {
+         width: 320px;
+         height: 600px;
+         top: -616px;
+        }
+    }
+
+    .anticon {
+        font-size: 27px;
+        color: #6B7A99;
+    }
+
+    &.active {
+        .anticon {
+            font-size: 27px;
+            color: #17181A;
+        }
+    }
+
+    &:hover {
+        .anticon {
+            font-size: 27px;
+            color: #17181A;
+        }
+    }
+}

+ 55 - 21
src/pages/budgetMana/monthlyInfoCheck/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-08-03 17:38:34
+ * @LastEditTime: 2023-08-11 09:32:19
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -16,14 +16,14 @@ import BMSPagecontainer from '@/components/BMSPageContainer';
 import { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
 import './style.less';
 
-import { Table, TreeProps, Tabs, Input, Modal, Transfer, Popconfirm, message, Popover } from 'antd';
+import { Table, TreeProps, Tabs, Input, Modal, Transfer, Popconfirm, message, Popover,Spin,Button} from 'antd';
 import { DataNode } from 'antd/es/tree';
 
 import expandedIcon from '../../../../static/treenode_open.png';
 import closeIcon from '../../../../static/treenode_collapse.png';
 import { BMSTable } from '@/components/BMSTable';
 import { ActionType, ModalForm, ProColumns, ProColumnType, ProFormSelect } from '@ant-design/pro-components';
-import { createFromIconfontCN } from '@ant-design/icons';
+import { createFromIconfontCN, LoadingOutlined } from '@ant-design/icons';
 import { checkRequest, delPersonRequest, fastMapDepAndEmp, generateDataRequest, getAllCheckUnit, getDepInfoTableData, getParams, getPersonInfoTableData, getProjectInfoTableData, getTotalEmps, getTransactionInfo, getTreeData, getTreeDataRespType, jixiaoDataImport, PersonInfoTableDataType, saveEmpsRequest } from './service';
 import { TransferDirection, TransferItem, TransferProps } from 'antd/es/transfer';
 import { getComputeDate } from '@/pages/Home/service';
@@ -40,7 +40,8 @@ import { difference } from 'lodash';
 
 import '../../../../src/utils/zhongtaiA'
 import { getJiezhuanStatus } from '../monthlySet/service';
-import { useAccess } from 'umi';
+import { useAccess } from '@umijs/max';
+
 
 
 
@@ -52,6 +53,8 @@ const SearchIcon = createFromIconfontCN({
     scriptUrl: '',
 });
 
+const antIcon = <LoadingOutlined style={{ fontSize: 12 }} spin />;
+
 
 const depInfoTableColumn = [
     {
@@ -179,6 +182,7 @@ const MonthlyInfoCheck: React.FC = () => {
     const [currentDeal,set_currentDeal] = useState<undefined|any>(undefined); //当前处理的异动项
 
     const [reloadChangeTable,set_reloadChangeTable] = useState(false);
+    const [dataImportLoading,set_dataImportLoading] = useState(false);
 
 
 
@@ -197,18 +201,30 @@ const MonthlyInfoCheck: React.FC = () => {
             dataIndex: 'empName',
             key: 'empName',
 
-        },
-        {
-            title: '岗位层级',
-            dataIndex: 'positionLevelName',
-            key: 'positionLevelName',
-
         },
         {
             title: '职务',
             dataIndex: 'jobTitleName',
             key: 'jobTitleName',
 
+        },
+        {
+            title: '职称',
+            dataIndex: 'titleName',
+            key: 'titleName',
+
+        },
+        {
+            title: '职称系数',
+            dataIndex: 'titleRate',
+            key: 'titleRate',
+
+        },
+        {
+            title: '岗位',
+            dataIndex: 'positionName',
+            key: 'positionName',
+
         },
         {
             title: '岗位系数',
@@ -637,8 +653,12 @@ const MonthlyInfoCheck: React.FC = () => {
     }
 
     const importHandle = async () => {
+
+        if(auditType == '0')return;
+        set_dataImportLoading(true);
         const resp = await jixiaoDataImport(currentComputeDate as string);
         if (resp) {
+            set_dataImportLoading(false);
             message.success('操作成功!');
             tableRef.current?.reload();
         }
@@ -690,14 +710,14 @@ const MonthlyInfoCheck: React.FC = () => {
         }
 
         const onTypeChange = (type:string)=>{
-            const result = changeTableData.filter(a=>a.messageType == type);
-            set_changeTableDataSource(result);
+            if(type == undefined){
+                set_changeTableDataSource(changeTableData);
+            }else{
+                const result = changeTableData.filter(a=>a.messageType == type);
+                set_changeTableDataSource(result);
+            }
+            
         }
-
-        useEffect(()=>{
-              console.log({reload});
-        },[reload])
-
     
         useEffect(() => {
             getInfo();
@@ -793,6 +813,7 @@ const MonthlyInfoCheck: React.FC = () => {
 
         const save = async () => {
             const result = {
+                computeDate:currentComputeDate,
                 mapType:ifMulti?2:1,
                 messageCode:currentDeal.messageCode,
                 messageName:currentDeal.messageName,
@@ -815,7 +836,7 @@ const MonthlyInfoCheck: React.FC = () => {
 
         return (
             <div className='TableSelecter'>
-                {/* <Input placeholder={'请输入'} allowClear
+                <Input placeholder={'请输入单元名称'} allowClear
                     suffix={
                         <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />
                     }
@@ -830,7 +851,7 @@ const MonthlyInfoCheck: React.FC = () => {
 
                     }}
 
-                /> */}
+                />
                 <BMSTable columns={tableSelecterColumn}
                     options={{
                         density: true,
@@ -870,6 +891,8 @@ const MonthlyInfoCheck: React.FC = () => {
         }
     }, [currentComputeDate]);
 
+    useEffect(()=>{tableRef.current?.reload();},[openChangeTable])
+
     useEffect(() => {
         tableRef.current?.reload();
     }, [currentSelectedTreeNode]);
@@ -932,7 +955,16 @@ const MonthlyInfoCheck: React.FC = () => {
                 ></TableSelecter>
             </ModalForm>
 
-            <Modal title="异动详情" okText='知道了' open={openChangeTable} closable onCancel={()=>set_openChangeTable(false)}>
+            <Modal title="异动详情" okText='知道了' open={openChangeTable} closable 
+               onCancel={()=>set_openChangeTable(false)} 
+               footer={
+                  [
+                  <Button key="submit" type="primary" onClick={()=>set_openChangeTable(false)}>
+                     知道了
+                </Button>
+                ]
+               }
+            >
                 <ChangeTable reload={reloadChangeTable} />
             </Modal>
 
@@ -1009,7 +1041,9 @@ const MonthlyInfoCheck: React.FC = () => {
                     {
                         !ifBanAllAction && (
                             <>
-                                <div className={auditType == '0' ? 'importBtn disabled' : 'importBtn '} onClick={() => importHandle()} style={{ right: auditType == '0' ? '64px' : '93px' }}>绩效数据导入</div>
+                                <div className={auditType == '0' ? 'importBtn disabled' : 'importBtn '} onClick={() => importHandle()} style={{ right: auditType == '0' ? '64px' : '93px' }}>
+                                    绩效数据导入<Spin spinning={dataImportLoading} indicator={antIcon} />
+                                </div>
                                 <div className='checkBtn' onClick={() => checkHandle(`${auditType}`)}>{auditType == '0' ? '审核' : '取消审核'}</div>
                                 {!ifBanAllAction && (
                                     <div className='midLine'>

+ 3 - 1
src/pages/budgetMana/monthlyInfoCheck/style.less

@@ -71,8 +71,10 @@
         background: #FFF;
 
         .importBtn {
+            display: flex;
+            justify-content: center;
+            align-items: center;
             position: absolute;
-            text-align: center;
             z-index: 9;
             right:93px;
             top:0px;

+ 42 - 27
src/pages/budgetMana/personnelSalaryBudget/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-01-03 14:20:22
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-08-03 10:02:42
+ * @LastEditTime: 2023-08-11 09:37:42
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/personnelSalaryBudget/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -18,6 +18,7 @@ import React, { useEffect, useRef, useState } from 'react'
 import { caculate, checkRequest, editAssessmentBonus, generate, getCurrentCheckStatus, getData } from './service';
 
 import editIcon from '../../../../static/editIcon.png';
+import editIcon_gray from '../../../../static/editIcon_gray.png';
 import conformIcon from '../../../../static/confirmIcon.png';
 
 import './style.less';
@@ -73,13 +74,18 @@ const PersonnelSalaryBudget = () => {
             title: '合理人均薪酬系数',
             dataIndex: 'averageSalary',
             key: 'averageSalary',
-
+            ellipsis:true
         },
         {
-            title: '人事成本占比',
+            title: '奖金占比',
             dataIndex: 'percent',
             key: 'percent',
         },
+        {
+            title: '占有效收入比',
+            dataIndex: 'effectiveRate',
+            key: 'effectiveRate',
+        },
         {
             title: '人事成本',
             dataIndex: 'cost',
@@ -96,14 +102,14 @@ const PersonnelSalaryBudget = () => {
                 return formatMoneyNumber(num)
             },
         },
-        {
-            title: '固定工资',
-            dataIndex: 'salary',
-            key: 'salary',
-            renderText(num, record, index, action) {
-                return formatMoneyNumber(num)
-            },
-        },
+        // {
+        //     title: '固定工资',
+        //     dataIndex: 'salary',
+        //     key: 'salary',
+        //     renderText(num, record, index, action) {
+        //         return formatMoneyNumber(num)
+        //     },
+        // },
         {
             title: '专项补助',
             dataIndex: 'subsidies',
@@ -284,6 +290,15 @@ const PersonnelSalaryBudget = () => {
         }
     }
 
+    useEffect(()=>{
+        if(!ifEditIncome&&!ifEditCost&&!ifEditRate){
+            if(ifEditTable&&pageData.income>0){
+                const result = (pageData.income - pageData.cost)*pageData.rate;
+                set_pageData({...pageData,personalCost:result})
+           }
+        }
+    },[ifEditIncome,ifEditCost,ifEditRate]);
+
 
     useEffect(() => {
         currentComputeDate && getCheckStatus(currentComputeDate);
@@ -306,43 +321,43 @@ const PersonnelSalaryBudget = () => {
 
                 <div className='cardWrap'>
                     <div className='card'>
-                        <span>收入</span>
+                        <span>{ifEditTable?'总收入':'收入'}</span>
                         <div className='count'>
-                            {!ifEditIncome&&pageData.income}
-                            {(ifEditIncome&&ifEditTable)&&<Input style={{width:160}} autoFocus defaultValue={pageData.income} onBlur={()=>{
+                            <span onClick={()=>auditType == '0'?set_ifEditIncome(true):()=>{}}>{!ifEditIncome&&pageData.income}</span>
+                            {(ifEditIncome&&ifEditTable)&&<InputNumber precision={2} onChange={(num)=>{set_pageData({...pageData,income:num?num:0})}} style={{width:160}} autoFocus defaultValue={pageData.income} onBlur={()=>{
                                 set_ifEditIncome(false);
                             }} />}
-                            {(!ifEditIncome&&ifEditTable)&&<div className='editBtn' onClick={()=>set_ifEditIncome(true)}><img src={editIcon} alt="" /></div>}
+                            {(!ifEditIncome&&ifEditTable&&auditType == '0')&&<div className='editBtn' onClick={()=>auditType == '0'?set_ifEditIncome(true):()=>{}}><img src={editIcon_gray} alt="" /></div>}
                         </div>
                     </div>
                     <div className='card'>
-                        <span>成本</span>
+                        <span>{ifEditTable?'材料及药品收入':'成本'}</span>
                         <div className='count'>
-                            {!ifEditCost&&pageData.cost}
-                            {(ifEditCost&&ifEditTable)&&<Input style={{width:160}} autoFocus defaultValue={pageData.cost} onBlur={()=>{
+                            <span onClick={()=>auditType == '0'?set_ifEditCost(true):()=>{}}>{!ifEditCost&&pageData.cost}</span>
+                            {(ifEditCost&&ifEditTable)&&<InputNumber precision={2} onChange={(num)=>{set_pageData({...pageData,cost:num?num:0})}} style={{width:160}} autoFocus defaultValue={pageData.cost} onBlur={()=>{
                                 set_ifEditCost(false);
                             }} />}
-                            {(!ifEditCost&&ifEditTable)&&<div className='editBtn' onClick={()=>set_ifEditCost(true)}><img src={editIcon} alt="" /></div>}
+                            {(!ifEditCost&&ifEditTable&&auditType == '0')&&<div className='editBtn' onClick={()=>auditType == '0'?set_ifEditCost(true):()=>{}}><img src={editIcon_gray} alt="" /></div>}
                         </div>
                     </div>
                     <div className='card'>
-                        <span>合理人事成本比例系数</span>
+                        <span>{ifEditTable?'奖金占比':'合理人事成本比例系数'}</span>
                         <div className='count'>
-                            {!ifEditRate&&pageData.rate}
-                            {(ifEditRate&&ifEditTable)&&<Input style={{width:160}} autoFocus defaultValue={pageData.rate} onBlur={()=>{
+                            <span onClick={()=>auditType == '0'?set_ifEditRate(true):()=>{}}>{!ifEditRate&&pageData.rate}</span>
+                            {(ifEditRate&&ifEditTable)&&<InputNumber precision={4} onChange={(num)=>{set_pageData({...pageData,rate:num?num:0})}}  style={{width:160}} autoFocus defaultValue={pageData.rate} onBlur={()=>{
                                 set_ifEditRate(false);
                             }} />}
-                            {(!ifEditRate&&ifEditTable)&&<div className='editBtn' onClick={()=>set_ifEditRate(true)}><img src={editIcon} alt="" /></div>}
+                            {(!ifEditRate&&ifEditTable&&auditType == '0')&&<div className='editBtn' onClick={()=>auditType == '0'?set_ifEditRate(true):()=>{}}><img src={editIcon_gray} alt="" /></div>}
                         </div>
                     </div>
                 </div>
 
                 <div className='func'>
                     <div className='title'>
-                        <span className='a'>全院人事成本(D=(A-B)*C)</span>
-                        {!ifBanAllAction&&<span className='btn' onClick={() => generateFunc(1)}> <IconFont style={{ color: '#3376FE' }} type='iconzhongxin' /> 重新生成</span>}
+                        <span className='a'>{ifEditTable?'可分配奖金(D=(A-B)*C)':'全院人事成本(D=(A-B)*C)'}</span>
+                        {(!ifBanAllAction&&!ifEditTable)&&<span className='btn' onClick={() => generateFunc(1)}> <IconFont style={{ color: '#3376FE' }} type='iconzhongxin' /> 重新生成</span>}
                     </div>
-                    <InputNumber className={ifEditTable?'input borderUpper':'input'} size='large' min={-10000000} value={pageData.personalCost} placeholder='请输入'
+                    <InputNumber className={ifEditTable?'input borderUpper':'input'} size='large' precision={2} min={-10000000} value={pageData.personalCost} placeholder='请输入'
                         disabled={auditType == '1'}
                         onChange={(value) => set_pageData({ ...pageData, personalCost: value as number })} />
                 </div>
@@ -354,7 +369,7 @@ const PersonnelSalaryBudget = () => {
             </div>
             {!ifBanAllAction&&<div className='countBtn' onClick={() => generateFunc(2)}>计算</div>}
             <div className='b'>计算结果</div>
-            {currentComputeDate && <BMSTable actionRef={tableRef} pagination={false} rowKey='unitType'  scroll={{ x: 140 * 11 }} columns={[...tableColumn, {
+            {currentComputeDate && <BMSTable actionRef={tableRef} pagination={false} rowKey='unitType'  scroll={{ x: 160 * 11 }} columns={[...tableColumn, {
                 title: '可分配考核奖金',
                 dataIndex: 'assessmentBonus',
                 key: 'assessmentBonus',

+ 8 - 2
src/pages/budgetMana/personnelSalaryBudget/style.less

@@ -3,6 +3,12 @@
     padding: 16px;
     background: #fff;
 
+    .bms-ant-table-content {
+        &::-webkit-scrollbar {
+             height: 3px;
+        }
+    }
+
     .checkBtn {
         position: absolute;
         cursor: pointer;
@@ -65,9 +71,9 @@
                     color: #527ACC;
                     line-height: 30px;
 
-                    .bms-ant-input {
+                    .bms-ant-input-number {
                         border-radius: 4px;
-                        border: 2px solid #3377FF;
+                        border: 2px solid #3377FF !important;
                     }
 
                     .editBtn {

+ 11 - 7
src/pages/secondaryDistribute/employeeInfoCheck/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-07-21 17:57:58
+ * @LastEditTime: 2023-08-10 15:47:05
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -109,6 +109,10 @@ const EmployeeInfoCheck: React.FC = () => {
             title: '职称',
             dataIndex: 'titleName',
         },
+        {
+            title: '职称系数',
+            dataIndex: 'titleRate',
+        },
         {
             title: '岗位',
             dataIndex: 'jobTitleName',
@@ -636,23 +640,23 @@ const EmployeeInfoCheck: React.FC = () => {
                             <div className='btnGroupWrap'>
                                 {
                                     !ifBanAllAction && (
-                                        <Popover open={ifShowTip} content={auditType == '1' ? '当前处于审核中,无法操作!' : '当前处于提交中,无法操作!'} >
-                                            <div className={commitStatus != '0' || auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
+                                        <Popover open={ifShowTip} content={'当前处于提交中,无法操作!'} >
+                                            <div className={commitStatus != '0'? 'btnGroup disabled' : 'btnGroup'}
                                                 /**
                                                  * 当审核中,三个操作按钮都不可点击
                                                  * 当非审核中,生成和添加不可操作
                                                  */
-                                                onMouseEnter={() => auditType == '0' ? commitStatus == '1' ? set_ifShowTip(true) : set_ifShowTip(false) : set_ifShowTip(true)}
+                                                onMouseEnter={() => commitStatus == '1' ? set_ifShowTip(true) : set_ifShowTip(false)}
                                                 onMouseLeave={() => set_ifShowTip(false)}
                                             >
-                                                <span key="2" onClick={commitStatus == '0' && auditType != '1' ? () => generateFunc() : () => { }}>生成</span>
-                                                <span key="3" onClick={commitStatus == '0' && auditType != '1' ? () => addPersonFunc() : () => { }}>添加</span>
+                                                <span key="2" onClick={commitStatus == '0'? () => generateFunc() : () => { }}>生成</span>
+                                                <span key="3" onClick={commitStatus == '0'? () => addPersonFunc() : () => { }}>添加</span>
                                             </div>
                                         </Popover>
                                     )
                                 }
 
-                                {!ifBanAllAction&&<div key="4" className={auditType == '1' ? 'commit disabled' : 'commit'} onClick={() => auditType == '0' ? commitBtnhandle() : () => { }}>{commitStatus == '1' ? '取消提交' : '提交'}</div>}
+                                {!ifBanAllAction&&<div key="4" className={'commit'} onClick={() => commitBtnhandle() }>{commitStatus == '1' ? '取消提交' : '提交'}</div>}
                             </div>
 
                         </div>

+ 3 - 3
src/pages/secondaryDistribute/employeeInfoCheck/service.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-21 11:13:51
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-11 17:08:26
+ * @LastEditTime: 2023-08-10 17:06:06
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlyInfoCheck/service.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -68,7 +68,7 @@ export type PersonInfoTableDataType = {
 
 export const getPersonInfoTableData = (params: getPersonInfoTableDataParamsType) => {
 
-    return request<PersonInfoTableDataType>('/performance/check/empList', {
+    return request<PersonInfoTableDataType>('/performance/secondSetting/empList', {
         method: 'GET',
         params: { ...params }
     })
@@ -96,7 +96,7 @@ export const getTotalEmps = (params:{
     unitCode:string
 }) => {
 
-    return request('/performance/check/getComputeEmployee', {
+    return request('/performance/secondSetting/getComputeEmployee', {
         method: 'GET',
         params: params
     })

+ 17 - 5
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-07-24 10:02:32
+ * @LastEditTime: 2023-08-08 09:41:09
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -24,7 +24,7 @@ import closeIcon from '../../../../static/treenode_collapse.png';
 import { BMSTable } from '@/components/BMSTable';
 import { ActionType, ProColumns, ProFormDatePicker, ProFormDigit, ProFormInstance, ProFormSelect } from '@ant-design/pro-components';
 import { createFromIconfontCN } from '@ant-design/icons';
-import { checkCurrentRequest, checkRequest, commitRequest, getCurrentCheckStatusReq, getCurrentCommitStatusReq, getCurrentUnitCheckStatusReq, getSecondaryDistriComputeTableData, getTreeData, getTreeDataRespType, save } from './service';
+import { autoComputedReq, checkCurrentRequest, checkRequest, commitRequest, getCurrentCheckStatusReq, getCurrentCommitStatusReq, getCurrentUnitCheckStatusReq, getSecondaryDistriComputeTableData, getTreeData, getTreeDataRespType, save } from './service';
 
 
 import { getComputeDate } from '@/pages/Home/service';
@@ -583,10 +583,22 @@ const SecondaryDitriComputed: React.FC = () => {
         }, 0)
     }
 
+    const autoComputed =async () => {
+        const resp = await autoComputedReq({computeDate:currentComputeDate as string,unitCode:currentSelectedTreeNode.code});
+        if(resp){
+            message.success('操作成功!');
+            getTableData({});
+        }
+
+    }
+
     const computeHandle = () => {
         Modal.confirm({
             title: '注意',
-            content: '重新计算会覆盖原有数据,确定要继续计算操作?'
+            content: '重新计算会覆盖原有数据,确定要继续计算操作?',
+            onOk(...args) {
+                autoComputed(); 
+            },
         })
     }
 
@@ -614,8 +626,8 @@ const SecondaryDitriComputed: React.FC = () => {
             getTreeReqFunc(currentComputeDate, ifCheckPage ? '1' : '0');
             getCheckStatus(currentComputeDate);
             getJiezhuanStatusHandle();
-
         }
+
     }, [currentComputeDate]);
 
     useEffect(() => {
@@ -852,7 +864,7 @@ const SecondaryDitriComputed: React.FC = () => {
                                                     onMouseEnter={() => auditType == '0' ? commitStatus == '1' ? set_ifShowTip(true) : set_ifShowTip(false) : set_ifShowTip(true)}
                                                     onMouseLeave={() => set_ifShowTip(false)}
                                                 >
-                                                    {!ifEditMode && <span className='compute cancel' onClick={commitStatus == '0' && auditType != '1' ? () => computeHandle() : () => { }}>计算</span>}
+                                                    {(!ifEditMode&&userFunctionInThispage && (userFunctionInThispage.findIndex((a: { code: string, name: string }) => a.code == 'calculate') != -1)) && <span className='compute cancel' onClick={commitStatus == '0' && auditType != '1' ? () => computeHandle() : () => { }}>计算</span>}
                                                     {!ifEditMode && <span className='cancel' onClick={commitStatus == '0' && auditType != '1' ? () => set_ifEditMode(true) : () => { }}>编辑</span>}
                                                     {ifEditMode && <span className='cancel' onClick={commitStatus == '0' ? () => set_ifEditMode(false) : () => { }}>取消</span>}
                                                     {ifEditMode && <span className='editBtn' onClick={commitStatus == '0' && auditType != '1' ? () => saveHandle() : () => { }}>保存</span>}

+ 12 - 1
src/pages/secondaryDistribute/secondaryDitriComputed/service.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-21 11:13:51
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-06-08 15:53:48
+ * @LastEditTime: 2023-08-07 15:38:50
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlyInfoCheck/service.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -164,3 +164,14 @@ export const checkCurrentRequest = (data:CheckCurrentRequestParamsType) => {
 }
 
 
+//自动计算
+export const autoComputedReq = (data:{computeDate:string,unitCode:string}) => {
+ 
+    return request('/performance/second/autoCompute', {
+        method: 'POST',
+        data:data
+    })
+
+}
+
+

+ 279 - 209
src/pages/secondaryDistribute/unitCheckProjectScore/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-08-03 15:36:29
+ * @LastEditTime: 2023-08-11 11:30:07
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -19,12 +19,14 @@ import './style.less';
 import { TreeProps, Input, Modal, message, Popover, Table, Switch, Tooltip } from 'antd';
 import { DataNode } from 'antd/es/tree';
 
+import { TransferItem, TransferProps } from 'antd/es/transfer';
+
 import expandedIcon from '../../../../static/treenode_open.png';
 import closeIcon from '../../../../static/treenode_collapse.png';
 import { BMSTable } from '@/components/BMSTable';
-import { ActionType, ModalForm, ProColumns, ProFormDatePicker, ProFormDigit, ProFormInstance, ProFormSelect, ProFormText } from '@ant-design/pro-components';
+import { ActionType, ModalForm, ProColumns, ProFormDigit, ProFormSelect } from '@ant-design/pro-components';
 import { createFromIconfontCN } from '@ant-design/icons';
-import { checkCurrentRequest, checkRequest, commitRequest, downloadTemplateReq, getCurrentCheckStatusReq, getCurrentCommitStatusReq, getCurrentUnitCheckStatusReq, getData, getSecondaryDistriComputeTableData, getTreeData, getTreeDataRespType, importExcelData, save } from './service';
+import { commitRequest, downloadTemplateReq, getCurrentCommitStatusReq, getDataByBtn, getPingjiListByCode, getSecondaryDistriComputeTableData, getTreeData, getTreeDataRespType, importExcelData, save, saveWorkLang } from './service';
 import FormItem from 'antd/es/form/FormItem';
 
 import { getComputeDate } from '@/pages/Home/service';
@@ -46,6 +48,7 @@ import moment from 'moment';
 import { getJiezhuanStatus } from '@/pages/budgetMana/monthlySet/service';
 import '../../../utils/zhongtaiA';
 import BMSUpload from '@/components/BMSUpload';
+import { getWorkData } from '@/pages/setting/checkUnitSet/medicalGroupSet/service';
 
 
 const SearchIcon = createFromIconfontCN({
@@ -62,13 +65,13 @@ export type TableListItem = {
     name: string;
 };
 
-let inputsRefKeys:string[] = [];
+let inputsRefKeys: string[] = [];
+
+let currentComputeEmp: undefined | any = undefined; //当前工作量计算人员
 
 
 const UnitCheckProjectScore: React.FC = () => {
     const location = useLocation();
-    const access = useAccess();
-    const userFunctionInThispage = access.whatCanIDoInThisPage(location.pathname);
     const [ifCheckPage, set_ifCheckPage] = useState(false); //是否为二次分配审核页面
     const [treeData, set_treeData] = useState<getTreeDataRespType[]>([]);
     const [treeDataDefault, set_treeDataDefault] = useState<getTreeDataRespType[]>([]);
@@ -80,9 +83,6 @@ const UnitCheckProjectScore: React.FC = () => {
     const [ifShowTip, set_ifShowTip] = useState(false);
 
     const [commitStatus, set_commitStatus] = useState('0'); //提交状态
-
-    const [empFilterParams, set_empFilterParams] = useState<any | undefined>(undefined);
-
     const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([]);
     const [searchValue, setSearchValue] = useState('');
     const [autoExpandParent, setAutoExpandParent] = useState(true);
@@ -91,8 +91,6 @@ const UnitCheckProjectScore: React.FC = () => {
 
     const [auditType, set_auditType] = useState('0');  //审核状态
 
-    const [currentUnitAuditType, set_currentUnitAuditType] = useState('0'); //当前单元审核状态
-
     const tableRef = useRef<ActionType>();
 
     const [needSaveData, set_needSaveData] = useState<any | undefined>(undefined);
@@ -105,12 +103,19 @@ const UnitCheckProjectScore: React.FC = () => {
 
     const [dataSource, set_dataSource] = useState([]);
 
+    const [tableData, set_tableData] = useState([]);
+
     const [currentInputRefKeys, set_currentInputRefKeys] = useState<string | undefined>(undefined);
     const [tableH, set_tableH] = useState(0);
     const [currentTreeDataFilter, set_currentTreeDataFilter] = useState({ name: '全部单元', code: 0 });
     const [treeFilterVisible, set_treeFilterVisible] = useState(false);
 
     const [ifBanAllAction, set_ifBanAllAction] = useState(true);  //是否掩藏所有操作
+    const [pingjiOptions, set_pingjiOptions] = useState<undefined | any>(undefined);
+
+    const tableSelecterRef = React.createRef<{ saveHandle: any; getSelectedKeys: any }>();
+
+    const [ifShowModal, set_ifShowModal] = useState(false);
 
 
     const column: ProColumns[] = [
@@ -122,6 +127,131 @@ const UnitCheckProjectScore: React.FC = () => {
         },
     ];
 
+    const tableSelecterColumn: any[] = [
+        {
+            title: '核算日期',
+            dataIndex: 'calculateDate',
+        },
+        {
+            title: '项目数值',
+            dataIndex: 'indicatorValue',
+        },
+        {
+            title: '项目名称',
+            dataIndex: 'indicatorName',
+        },
+        {
+            title: '参考核算单元',
+            dataIndex: 'unitName',
+        },
+        {
+            title: '人员',
+            dataIndex: 'userName',
+        },
+    ];
+
+    interface TableSelecterProps extends TransferProps<TransferItem> {
+        tableSelecterColumn: any[];
+        record: any
+    }
+
+    const TableSelecter = React.forwardRef(({ tableSelecterColumn, record }: TableSelecterProps, ref) => {
+
+        const [datasource, set_datasource] = useState<any[]>([]);
+        const [selectedKeys, setSelectedKeys] = useState<React.Key[]>([]);
+        const [showList, set_showList] = useState<any[]>([]);
+
+        //获取表格数据
+        const getFuncList = async () => {
+            const resp = await getWorkData({
+                computeDate: currentComputeDate as string,
+                unitCode: currentSelectedTreeNode.code,
+                empNo: currentComputeEmp.empNo
+            });
+            if (resp) {
+                set_datasource(resp);
+                set_showList(resp);
+            }
+        }
+
+
+        const onSelectChange = (newSelectedRowKeys: React.Key[]) => {
+            setSelectedKeys([...newSelectedRowKeys]);
+
+        };
+
+        const saveHandle = async () => {
+
+            const needData = datasource.filter(item => selectedKeys.includes(item.id));
+            const total = needData.reduce((prev: number, cur: any) => prev + cur.indicatorValue, 0);
+
+            const value = total.toFixed(4);
+           
+            const resp = await saveWorkLang({
+                computeDate: currentComputeDate as string,
+                unitCode: currentSelectedTreeNode.code,
+                empNo:currentComputeEmp.empNo,
+                code:currentComputeEmp.colCode,
+                value:value
+            });
+
+            if (resp) {
+                message.success('操作成功!');
+                set_ifShowModal(false);
+                getTableData({});
+            }
+        }
+
+        useEffect(() => {
+            getFuncList();
+        }, [])
+
+        return (
+            <div className='TableSelecter'>
+                <Input placeholder={'请输入项目名称'} allowClear
+                    suffix={
+                        <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />
+                    }
+                    style={{ marginBottom: 8 }}
+                    onChange={(e) => {
+                        if (e.target.value.length != 0) {
+                            const result = datasource.filter(item => item.indicatorName.indexOf(e.target.value) != -1);
+                            set_showList(result);
+                        } else {
+                            set_showList(datasource);
+                        }
+
+                    }}
+
+                />
+                <BMSTable columns={tableSelecterColumn}
+                    options={{
+                        density: true,
+                        setting: {
+                            listsHeight: 100,
+                        },
+                    }}
+                    rowKey='id'
+                    scroll={{y:400}}
+                    tableAlertRender={false}
+                    rowSelection={{
+                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
+                        // 注释该行则默认不显示下拉选项
+                        // selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+                        onChange: onSelectChange,
+                    }}
+                    pagination={{  showTitle: false,showSizeChanger:true }}
+                    dataSource={showList}
+                />
+                <div className='footer'>
+                    <span className='cancel' onClick={() => set_ifShowModal(false)}>取消</span>
+                    <span className='ok' onClick={() => saveHandle()}>{`确认(${selectedKeys.length > 0 && selectedKeys.length})`}</span>
+                </div>
+            </div>
+
+        )
+    });
+
 
     const onSelect: TreeProps['onSelect'] = (selectedKeys, info: any) => {
         // console.log('selected', selectedKeys, info);
@@ -177,7 +307,7 @@ const UnitCheckProjectScore: React.FC = () => {
                     const resp = await importExcelData(formData);
 
                     if (resp) {
-                        tableRef.current?.reload();
+                        getTableData({});
                         return true;
                     }
 
@@ -197,19 +327,6 @@ const UnitCheckProjectScore: React.FC = () => {
         set_currentComputeDate(resp);
     }
 
-    const getCheckStatus = async (computeDate: string) => {
-
-        const resp = await getCurrentCheckStatusReq(computeDate);
-        set_auditType(`${resp}`);  //0 未审核 1 已审核
-
-    }
-
-    const getCurrentUnitCheckStatus = async () => {
-        if (currentSelectedTreeNode) {
-            const resp = await getCurrentUnitCheckStatusReq(currentComputeDate as string, currentSelectedTreeNode.code);
-            set_currentUnitAuditType(`${resp}`);  //0 未审核 1 已审核
-        }
-    }
 
     const getCurrentCommitStatus = async () => {
         if (currentSelectedTreeNode) {
@@ -221,25 +338,66 @@ const UnitCheckProjectScore: React.FC = () => {
         }
     }
 
+
+    //工作量计算
+    const calcuHanle = (rowData: any) => {
+        currentComputeEmp = rowData;
+        set_ifShowModal(true);
+    }
+
     const gennerateColumns = (data: { title: any; userList: any; }, inputsRefKeys?: string[]) => {
         const { title } = data;
-        const _title = title.filter((a:any)=>a.code != 'Employee');
+        const _title = title.filter((a: any) => a.code != 'Employee');
         _title.sort((prev: any, next: any) => prev.sort - next.sort);
+
         const _columns = _title.map((item: any, index: number) => {
             return {
-                title: item.name,
+                title: <div>{item.name}{item.source == 2 && <span style={{ display: 'inline-flex', marginLeft: 5, justifyContent: 'center', alignItems: 'center', width: 14, height: 14, borderRadius: 4, background: '#80BFFF', color: '#fff' }}>A</span>}</div>,
                 dataIndex: `${item.code}`,
                 width: 120,
                 renderText: (_: any, record: any) => {
                     if (ifEditMode) {
 
                         let _val = _;
-
                         if (item.evaluation == 2) {
 
                             return <ProFormSelect
                                 noStyle
-                                options={item.level}
+                                fieldProps={{
+                                    defaultValue: _,
+                                    onFocus: () => { currentComputeEmp = { ...record, colCode: item.code } },
+                                    onChange(value, option) {
+
+                                        const updatedList = needSaveData.secondValueVos.map((a: any) => {
+                                            if (a.empNo == record.empNo) {
+                                                //value里是否存在对应的code
+                                                const ifhasColCode = (a.value.filter((c: any) => c.code == currentComputeEmp.colCode)).length == 0 ? false : true;
+
+                                                if (!ifhasColCode) {
+                                                    //当不存在对应的code时
+                                                    let list = [...a.value];
+                                                    list.push({ code: currentComputeEmp.colCode, value: value });
+                                                    return { ...a, value: list }
+                                                }
+
+
+                                                const arr = a.value.map((b: any) => {
+                                                    if (b.code == item.code) {
+                                                        return { ...b, value: value ? value : 0 } //value有为undefined的可能
+                                                    } else {
+                                                        return b
+                                                    }
+                                                });
+                                                return { ...a, value: arr }
+                                            } else {
+                                                return a
+                                            }
+                                        });
+
+                                        set_needSaveData({ ...needSaveData, secondValueVos: updatedList });
+                                    },
+                                }}
+                                options={pingjiOptions[`${item.code}`]}
                             />
                         }
 
@@ -249,9 +407,20 @@ const UnitCheckProjectScore: React.FC = () => {
                                 inputsRefKeys?.push(`${record.empNo}-${item.code}`);
                                 //console.log({ref});
                             },
+                            
                             onBlur: () => {
                                 const updatedList = needSaveData.secondValueVos.map((a: any) => {
                                     if (a.empNo == record.empNo) {
+
+                                        const ifhasColCode = (a.value.filter((c: any) => c.code == currentComputeEmp.colCode)).length == 0 ? false : true;
+
+                                        if (!ifhasColCode) {
+                                            //当不存在对应的code时
+                                            let list = [...a.value];
+                                            list.push({ code: currentComputeEmp.colCode, value: _val ? _val : 0 });
+                                            return { ...a, value: list }
+                                        }
+
                                         const arr = a.value.map((b: any) => {
                                             if (b.code == item.code) {
                                                 return { ...b, value: _val ? _val : 0 } //value有为undefined的可能
@@ -277,6 +446,17 @@ const UnitCheckProjectScore: React.FC = () => {
                                     const value = event.target.value ? Number(event.target.value) : 0;
                                     const updatedList = needSaveData.secondValueVos.map((a: any) => {
                                         if (a.empNo == record.empNo) {
+
+                                            const ifhasColCode = (a.value.filter((c: any) => c.code == currentComputeEmp.colCode)).length == 0 ? false : true;
+
+                                            if (!ifhasColCode) {
+                                                //当不存在对应的code时
+                                                let list = [...a.value];
+                                                list.push({ code: currentComputeEmp.colCode, value: value ? value : 0 });
+                                                return { ...a, value: list }
+                                            }
+
+
                                             const arr = a.value.map((b: any) => {
                                                 if (b.code == item.code) {
                                                     return { ...b, value: value ? value : 0 } //value有为undefined的可能
@@ -301,18 +481,18 @@ const UnitCheckProjectScore: React.FC = () => {
                                     }
                                 }
                             },
-                            onFocus: () => set_currentInputRefKeys(`${record.empNo}-${item.code}`),
+                            onFocus: () => {set_currentInputRefKeys(`${record.empNo}-${item.code}`);currentComputeEmp = { ...record, colCode: item.code };},
                             defaultValue: _,
 
                         }} width={80} />
                     } else {
-                        return <span style={{ display: 'inline-block', width: 80 }}>{_}</span>
+                        return <span style={{ display: 'block' }}>{_}{item.source == 3 && <img onClick={() => calcuHanle({ ...record, colCode: item.code })} style={{ width: 16, height: 16, cursor: 'pointer', marginLeft: 8 }} src={require('../../../../static/calcu.png')} />}</span>
                     }
                 },
             }
         });
 
-        set_tableColumn([...column,..._columns]);
+        set_tableColumn([...column, ..._columns]);
     }
 
     const getTableData = async (params: any) => {
@@ -324,6 +504,13 @@ const UnitCheckProjectScore: React.FC = () => {
                 ...params,
             });
             if (resp) {
+                const { title } = resp;
+                title.forEach((a: any) => {
+                    if (a.evaluation == 2) {
+                        getPingjiData(a.code);
+                    }
+                })
+
                 set_needSaveData(resp);
                 //buildTableData(resp);
             }
@@ -333,6 +520,15 @@ const UnitCheckProjectScore: React.FC = () => {
     }
 
 
+    const getPingjiData = async (code: string) => {
+        const resp = await getPingjiListByCode(code);
+        if (resp) {
+            const needData = resp.map((a: any) => ({ label: a.levelName, value: a.levelName }));
+            set_pingjiOptions({ ...pingjiOptions, [`${code}`]: needData })
+        }
+    }
+
+
 
     const buildTableData = (resp: any, inputsRefKeys?: string[]) => {
         const { title, secondValueVos } = resp;
@@ -349,164 +545,39 @@ const UnitCheckProjectScore: React.FC = () => {
                 total = total + b.value;
             });
 
-            return { ...item, ...rowData, id: Math.random(), _columns,Employee:item.empName}
+            return { ...item, ...rowData, id: Math.random(), _columns, Employee: item.empName }
         });
 
         const compeltedTotal = data.reduce((prev: any, cur: any) => prev + cur.totalScore, 0);
         const leftTotal = resp.totalBonus - compeltedTotal;
         set_pageData({ ...pageData, total: resp.totalBonus ? resp.totalBonus.toFixed(2) : 0, completedTotal: compeltedTotal.toFixed(2), leftTotal: Number(leftTotal.toFixed(2)) });
 
-        set_dataSource(data)
+        set_dataSource(data);
+        set_tableData(data);
     }
 
-    const checkIfCommit = (type: number) => {
-        // type 1 当前 2 全部
-        //检查当前单元是否提交
-        if (type == 1) {
-            //currentUnitAuditType == 1 时是取消操作无需校验
-            return currentUnitAuditType == '1' ? true : currentSelectedTreeNode.map
-        }
-        if (type == 2 && auditType == '0') {
-            //auditType == 1 时是取消操作无需校验
-            interface Node {
-                map: boolean;
-                child?: Node[];
-            }
-
-            function filterNodes(node: Node): Node | null {
-                if (node.map === false && (!node.child || node.child.length === 0)) {
-                    return node; // 如果节点map为false并且是叶子节点,返回该节点
-                }
-
-                if (Array.isArray(node.child)) {
-                    // 对每个子节点递归执行此过程
-                    let child = node.child.map(filterNodes).filter((n): n is Node => n !== null);
-                    if (child.length > 0) {
-                        // 如果有任何子节点的map属性为false,返回包含这些子节点的新节点
-                        return { ...node, child: child };
-                    }
-                }
-
-                // 如果节点map为true,或者所有子节点的map都为true,返回null
-                return null;
-            }
-
-            const result = treeData.map(a => {
-                return filterNodes(a);
-            });
-
-            return result.length == 0
 
-        } else {
-            return true
-        }
-    }
+    const commitBtnhandle = async () => {
 
-    const commitBtnhandle = async (type?: number) => {
-        //console.log({type});
-        /**
-         * type 1 单个 2 全部
-         * 提交界面不需要type
-         */
-
-        const handle = async (ifCheckCommit: string) => {
-            if (type == 1) {
-                //审核单个
-                const resp = await checkCurrentRequest({
+        Modal.confirm({
+            title: '注意',
+            okText: '确定',
+            cancelText: '取消',
+            content: `${commitStatus == '1' ? '取消提交' : '提交'}当前选择的核算单元的数据?`,
+            onOk: async () => {
+                const resp = await commitRequest({
                     computeDate: currentComputeDate as string,
-                    auditType: currentUnitAuditType == '1' ? '0' : '1',  //1 审核 0 取消审核
                     unitCode: currentSelectedTreeNode.code,
-                    type: ifCheckCommit
-                });
-                if (resp) {
-                    message.success('操作成功!');
-                    getTreeReqFunc(currentComputeDate as string, ifCheckPage ? '1' : '0');
-                    getCurrentUnitCheckStatus();
-                }
-            }
-
-            if (type == 2) {
-                const resp = await checkRequest({
-                    computeDate: currentComputeDate as string,
-                    auditType: auditType == '1' ? '0' : '1',  //1 审核 0 取消审核
-                    type: ifCheckCommit
+                    submit: commitStatus == '1' ? '0' : '1',  //1 提交 0 取消
                 });
                 if (resp) {
-                    message.success('操作成功!');
+                    message.success('提交成功!');
                     getTreeReqFunc(currentComputeDate as string, ifCheckPage ? '1' : '0');
-                    getCheckStatus(currentComputeDate as string);
-                }
-            }
-        }
-
-        if (ifCheckPage && type) {
-            const checkCondition = await getParamsData({ pageSize: 500 });
-            if (checkCondition) {
-                const needParamsVal = checkCondition.list.filter(a => a.code == '1664510428258115584'); //判断未提交是否可以审核
-                if (needParamsVal.length > 0) {
-                    if (needParamsVal[0].value == '0') {
-                        handle(needParamsVal[0].value);
-                    } else {
-                        handle(needParamsVal[0].value);
-                    }
-                }
-            }
-
-        } else {
-
-            if (commitStatus == '1') {
-                Modal.confirm({
-                    title: '注意',
-                    okText: '确定',
-                    cancelText: '取消',
-                    content: `${commitStatus == '1' ? '取消提交' : '提交'}当前选择的核算单元的数据?`,
-                    onOk: async () => {
-                        const resp = await commitRequest({
-                            computeDate: currentComputeDate as string,
-                            unitCode: currentSelectedTreeNode.code,
-                            type: commitStatus == '1' ? '0' : '1',  //1 提交 0 取消
-                        });
-                        if (resp) {
-                            message.success('提交成功!');
-                            getTreeReqFunc(currentComputeDate as string, ifCheckPage ? '1' : '0');
-                            getCurrentCommitStatus();
-                        }
-                    }
-
-                })
-            } else {
-
-                if (pageData.leftTotal != 0) {
-                    Modal.confirm({
-                        title: '提交时需有单元的剩余分配金额必须是0',
-                        okText: '确定',
-                        cancelText: '取消',
-                    })
-                } else {
-                    Modal.confirm({
-                        title: '注意',
-                        okText: '确定',
-                        cancelText: '取消',
-                        content: `${commitStatus == '1' ? '取消提交' : '提交'}当前选择的核算单元的数据?`,
-                        onOk: async () => {
-                            const resp = await commitRequest({
-                                computeDate: currentComputeDate as string,
-                                unitCode: currentSelectedTreeNode.code,
-                                type: commitStatus == '1' ? '0' : '1',  //1 提交 0 取消
-                            });
-                            if (resp) {
-                                message.success('提交成功!');
-                                getTreeReqFunc(currentComputeDate as string, ifCheckPage ? '1' : '0');
-                                getCurrentCommitStatus();
-                            }
-                        }
-
-                    })
+                    getCurrentCommitStatus();
                 }
             }
 
-        }
-
+        })
     }
 
 
@@ -604,8 +675,8 @@ const UnitCheckProjectScore: React.FC = () => {
             }
         }
     };
-    generateList(treeData as any);
 
+    generateList(treeData as any);
 
     const getTreeReqFunc = async (computeDate: string, type: string) => {
         const resp = await getTreeData(computeDate, type);
@@ -629,22 +700,20 @@ const UnitCheckProjectScore: React.FC = () => {
         }, 0)
     }
 
-    const getDataByBtn = async () => {  //获取按钮获取数据
-        const resp = await getData(currentComputeDate as string, currentSelectedTreeNode.code);
-        if (resp) {
-            message.success('数据获取成功!');
-            tableRef.current?.reload();
-        }
+    const getData = async () => {  //获取按钮获取数据
+        const resp = await getDataByBtn(currentComputeDate as string, currentSelectedTreeNode.code);
+        message.success('数据获取成功!');
+        getTableData({});
 
     }
 
     const saveHandle = async () => {
-   
+
         const resp = await save({
-            computeDate:currentComputeDate,
-            unitCode:currentSelectedTreeNode.code,
-            unitName:currentSelectedTreeNode.name,
-            itemData:needSaveData.secondValueVos
+            computeDate: currentComputeDate,
+            unitCode: currentSelectedTreeNode.code,
+            unitName: currentSelectedTreeNode.name,
+            itemData: needSaveData.secondValueVos
         });
         if (resp) {
             message.success('操作成功!');
@@ -665,7 +734,6 @@ const UnitCheckProjectScore: React.FC = () => {
 
         if (currentComputeDate) {
             getTreeReqFunc(currentComputeDate, ifCheckPage ? '1' : '0');
-            getCheckStatus(currentComputeDate);
             getJiezhuanStatusHandle();
 
         }
@@ -675,14 +743,7 @@ const UnitCheckProjectScore: React.FC = () => {
         //tableRef.current?.reload();
 
         if (currentComputeDate && currentSelectedTreeNode) {
-
-            if (!ifCheckPage) {
-                getCurrentCommitStatus();
-            }
-            if (ifCheckPage) {
-                getCurrentUnitCheckStatus();
-            }
-
+            getCurrentCommitStatus();
             getTableData({});
         }
 
@@ -748,8 +809,6 @@ const UnitCheckProjectScore: React.FC = () => {
             // });
             // set_inputsRefKeys(keys);
 
-            console.log({inputsRefKeys});
-
         }
 
         if (needSaveData) {
@@ -769,7 +828,7 @@ const UnitCheckProjectScore: React.FC = () => {
     }, [ifEditMode]);
 
     useEffect(() => {
-        console.log({inputsRefKeys,inputsRef})
+        console.log({ inputsRefKeys, inputsRef })
         // if (ifEditMode && Object.keys(inputsRef.current).length > 0 && inputsRefKeys.length > 0) {
 
         //     inputsRef.current[`${inputsRefKeys[0]}`].focus();
@@ -792,6 +851,20 @@ const UnitCheckProjectScore: React.FC = () => {
     return (
 
         <div className='UnitCheckProjectScore'>
+
+            <ModalForm title={`选择属于本单元的记录(${currentSelectedTreeNode?.name})`} width={600} submitter={{
+                render: (props, defaultDoms) => []
+            }} open={ifShowModal} modalProps={{
+                closable: false,
+            }}>
+                <TableSelecter
+                    ref={tableSelecterRef}
+                    record={undefined}
+                    tableSelecterColumn={tableSelecterColumn}
+                ></TableSelecter>
+            </ModalForm>
+
+
             {
                 treeFilterVisible && (
                     <div className='selecterList'>
@@ -883,11 +956,17 @@ const UnitCheckProjectScore: React.FC = () => {
                         <div className='tableToolbar'>
                             <div className='search'>
                                 <span className='label'>检索:</span>
-                                <Input placeholder={'请输入项目名称'} allowClear
+                                <Input placeholder={'请输入姓名'} allowClear
                                     suffix={
                                         <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" />
                                     }
                                     onChange={(e) => {
+                                        if (e.target.value.length > 0) {
+                                            const result = tableData.filter((a: any) => a.Employee.indexOf(e.target.value) != -1);
+                                            set_dataSource(result);
+                                        } else {
+                                            set_dataSource(tableData);
+                                        }
 
                                     }}
 
@@ -908,11 +987,11 @@ const UnitCheckProjectScore: React.FC = () => {
                                                     onMouseEnter={() => auditType == '0' ? commitStatus == '1' ? set_ifShowTip(true) : set_ifShowTip(false) : set_ifShowTip(true)}
                                                     onMouseLeave={() => set_ifShowTip(false)}
                                                 >
-                                                    {!ifEditMode && <span className='compute cancel' onClick={commitStatus == '0' && auditType != '1' ? () => getDataByBtn() : () => { }}>获取</span>}
+                                                    {!ifEditMode && <span className='compute cancel' onClick={commitStatus == '0' ? () => getData() : () => { }}>获取</span>}
                                                     {!ifEditMode && importData()}
-                                                    {!ifEditMode && <span className='cancel' onClick={commitStatus == '0' && auditType != '1' ? () => set_ifEditMode(true) : () => { }}>编辑</span>}
+                                                    {!ifEditMode && <span className='cancel' onClick={commitStatus == '0' ? () => set_ifEditMode(true) : () => { }}>编辑</span>}
                                                     {ifEditMode && <span className='cancel' onClick={commitStatus == '0' ? () => set_ifEditMode(false) : () => { }}>取消</span>}
-                                                    {ifEditMode && <span className='editBtn' onClick={commitStatus == '0' && auditType != '1' ? () => saveHandle() : () => { }}>保存</span>}
+                                                    {ifEditMode && <span className='editBtn' onClick={commitStatus == '0' ? () => saveHandle() : () => { }}>保存</span>}
 
                                                 </div>
                                             </Popover>
@@ -920,15 +999,6 @@ const UnitCheckProjectScore: React.FC = () => {
                                         </>
                                     )
                                 }
-                                {
-                                    !ifBanAllAction && ifCheckPage && userFunctionInThispage && (userFunctionInThispage.findIndex((a: { code: string, name: string }) => a.code == 'audit') != -1) && (
-                                        <>
-                                            <div className={'commit gray'} onClick={() => commitBtnhandle(1)}>{currentUnitAuditType == '1' ? '取消审核单个' : '审核单个'}</div>
-                                            <div className={'commit'} onClick={() => commitBtnhandle(2)}>{auditType == '1' ? '取消审核全部' : '审核全部'}</div>
-                                        </>
-                                    )
-                                }
-
                             </div>
 
                         </div>

+ 42 - 89
src/pages/secondaryDistribute/unitCheckProjectScore/service.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-21 11:13:51
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-08-03 15:33:31
+ * @LastEditTime: 2023-08-11 11:03:45
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlyInfoCheck/service.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -21,17 +21,17 @@ import axios from 'axios';
 export type getTreeDataRespType = {
     code: number,
     name: string,
-    map:boolean,
-    parentCode:string,
-    unitType?:string,
+    map: boolean,
+    parentCode: string,
+    unitType?: string,
     child: getTreeDataRespType[]
 }
 
-export const getTreeData = (computeDate: string,type:string) => {
+export const getTreeData = (computeDate: string, type: string) => {
 
     return request<getTreeDataRespType[]>('/performance/secondSetting/getSecondDataUnitList', {
         method: 'GET',
-        params: { computeDate,type }
+        params: { computeDate, type }
     })
 }
 
@@ -57,7 +57,7 @@ export const getSecondaryDistriComputeTableData = (params: GetSecondaryDistriCom
 
 //保存编辑后结果
 
-export const save = (data:any) => {
+export const save = (data: any) => {
     return request('/performance/secondSetting/saveSecondData', {
         method: 'POST',
         data
@@ -67,116 +67,51 @@ export const save = (data:any) => {
 
 
 //获取当前提交状态
-export const getCurrentCommitStatusReq = (params:{
-    computeDate:string,
-    unitCode:string
+export const getCurrentCommitStatusReq = (params: {
+    computeDate: string,
+    unitCode: string
 }) => {
 
-    return request('/performance/second/getSubmitStatus', {
+    return request('/performance/secondSetting/getSubmitStatus', {
         method: 'GET',
         params: params
     })
 
 }
 
-//获取当前审核状态
-export const getCurrentCheckStatusReq = (computeDate:string) => {
-    return request('/performance/second/getAuditStatus', {
-        method: 'GET',
-        params: {computeDate}
-    })
-
-}
-
-//获取当前核算单元审核状态
-export const getCurrentUnitCheckStatusReq = (computeDate:string,unitCode:string) => {
-    return request('/performance/second/getUnitAuditStatus', {
-        method: 'GET',
-        params: {computeDate,unitCode}
-    })
-
-}
-
-
-
-// //生成数据
-
-// export type GenerateDataRequestParamsType = {
-//     computeDate: string,
-//     unitCode: string,
-// }
-
-// export const generateDataRequest = (data: GenerateDataRequestParamsType) => {
- 
-//     return request('/performance/secondSetting/generateEmployee', {
-//         method: 'POST',
-//         params:data
-//     })
-
-// }
 
 
 //提交请求
 
 export type CommitRequestParamsType = {
-    computeDate:string,
-    unitCode:string,
-    type:string
-}
-export const commitRequest = (data:CommitRequestParamsType) => {
- 
-    return request('/performance/second/submit', {
-        method: 'POST',
-        params:data
-    })
-
+    computeDate: string,
+    unitCode: string,
+    submit: string
 }
+export const commitRequest = (data: CommitRequestParamsType) => {
 
-//审核请求
-
-export type CheckRequestParamsType = {
-    computeDate:string,
-    auditType:string,
-    type:string //是否跳过提交状态验证 1跳过提交状态 不验证是否已提交 0或不传 验证是否已提交
-}
-export const checkRequest = (data:CheckRequestParamsType) => {
- 
-    return request('/performance/second/audit', {
+    return request('/performance/secondSetting/secondSubmit', {
         method: 'POST',
-        params:data
+        params: data
     })
 
 }
 
-//只审核当前
-export type CheckCurrentRequestParamsType = {
-    computeDate:string,
-    auditType:string,
-    unitCode:string,
-    type:string //是否跳过提交状态验证 1跳过提交状态 不验证是否已提交 0或不传 验证是否已提交
-}
-export const checkCurrentRequest = (data:CheckCurrentRequestParamsType) => {
- 
-    return request('/performance/second/auditUnit', {
-        method: 'POST',
-        params:data
-    })
 
-}
 
 //获取数据
 
-export const getData = (computeDate:string,unitCode:string) => {
- 
+export const getDataByBtn = (computeDate: string, unitCode: string) => {
+
     return request('/performance/secondSetting/getAutoSecondData', {
         method: 'GET',
-        params:{computeDate,unitCode}
+        params: { computeDate, unitCode }
     })
 
 }
 
 //导出excel模板
-export const downloadTemplateReq = (computeDate:string,unitCode:string) => {
+export const downloadTemplateReq = (computeDate: string, unitCode: string) => {
 
     let path = '/gateway/performance/secondSetting/exportSecondData';
     const userData = localStorage.getItem('userData');
@@ -187,7 +122,7 @@ export const downloadTemplateReq = (computeDate:string,unitCode:string) => {
         url: path,
         responseType: 'blob',
         headers: { token },
-        params:{computeDate,unitCode}
+        params: { computeDate, unitCode }
     })
         .then(function (response) {
             //console.log({ 'chunk': response });
@@ -214,11 +149,29 @@ export const downloadTemplateReq = (computeDate:string,unitCode:string) => {
 
 //导入数据
 
-export const importExcelData = (data:any) => {
+export const importExcelData = (data: any) => {
     return request('/performance/secondSetting/importSecondData', {
         method: 'POST',
-        data:data
+        data: data
     })
 }
 
+//根据项目code获取评级列表
+
+export const getPingjiListByCode = (secondItemCode:string) => {
+    return request<any[]>('/performance/secondSetting/getItemLevel', {
+        method: 'GET',
+        params: { secondItemCode }
+    });
+}
+
+//保存工作量
+export const saveWorkLang = (data:{computeDate:string,unitCode:string,empNo:string,code:string,value:number}) => {
+    return request('/performance/secondSetting/saveEmpWorkload', {
+        method: 'POST',
+        params:{...data}
+    });
+}
+
+
 

+ 29 - 0
src/pages/secondaryDistribute/unitCheckProjectScore/style.less

@@ -1,3 +1,32 @@
+.TableSelecter {
+    .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;
+             }
+         }
+
+    }
+}
+
 .UnitCheckProjectScore {
     position: relative;
     display: flex;

+ 9 - 28
src/pages/setting/baseSetting/jobCateBaseSet/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-07-14 14:13:58
+ * @LastEditTime: 2023-08-11 09:36:20
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -31,36 +31,12 @@ import './style.less';
 
 export default function JobCateBaseSet() {
 
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
-
-    const [dataSource,set_dataSource] = useState<JobCateTableDataType[]>([]);
-
     const [currentEditRow, set_currentEditRow] = useState<undefined | any>(undefined);
 
     const [ifEdit,set_ifEdit] = useState(false);
 
-    const [updateResult,set_updateResult] = useState<any|undefined>(undefined);
     const tableRef = useRef<ActionType>();
 
-
-    // const EditableCell = ({_,record,keyStr}:{_:any,record:any,keyStr:string})=>{
-
-    //     const [num,set_num] = useState(0);
-
-    //     console.log({record});
-
-    //     if (currentEditRow && currentEditRow.code == record.code) {
-    //         return (
-    //             <InputNumber defaultValue={num} onChange={val=>{
-    //                  set_num(val as number);
-    //                  set_updateResult({...currentEditRow,[`${keyStr}`]:val});
-    //             }}  />
-    //         )
-    //     } else {
-    //         return _
-    //     }
-    // }
-
     const columns: ProColumns[] = [
 
         {
@@ -82,19 +58,24 @@ export default function JobCateBaseSet() {
             // render:(_:any)=>_ == 1?'指标':'自定义SQL'
         },
         {
-            title: '系数考核占比',
+            title: '奖金占比',
+            dataIndex: 'percent',
+            editable:false
+        },
+        {
+            title: '岗位绩效占比',
             dataIndex: 'ratePercent',
             valueType:'digit'
             //render: (_: any, record: any) => <EditableCell _={_} record={record} keyStr='ratePercent' />
         },
         {
-            title: '工作量考核占比',
+            title: '奖励性绩效占比',
             dataIndex: 'workPercent',
             valueType:'digit'
             //render: (_: any, record: any) => <EditableCell _={_} record={record} keyStr='workPercent' />
         },
         {
-            title: '职类基金系数',
+            title: '基金提拨',
             dataIndex: 'unitTypeFund',
             valueType:'digit'
             //render: (_: any, record: any) => <EditableCell _={_} record={record} keyStr='workPercent' />

+ 9 - 1
src/pages/setting/checkUnitSet/checkUnitEmpSet/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-07-27 16:05:56
+ * @LastEditTime: 2023-08-11 10:51:44
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -97,10 +97,18 @@ const CheckUnitDepMap: React.FC = () => {
             title: '职称',
             dataIndex: 'titleName',
         },
+        {
+            title: '职称系数',
+            dataIndex: 'titleRate',
+        },
         {
             title: '岗位',
             dataIndex: 'positionName',
         },
+        {
+            title: '岗位系数',
+            dataIndex: 'positionRate',
+        },
         {
             title: '学历',
             dataIndex: 'degreeName',

+ 10 - 1
src/pages/setting/checkUnitSet/medicalGroupSet/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-04-26 16:05:25
+ * @LastEditTime: 2023-08-10 17:31:00
  * @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
  */
@@ -106,4 +106,13 @@ export const getMedicalAllEmp = (params:{medicalGroupCode:string}) => {
 };
 
 
+//获取工作量
+export const getWorkData = (params:{computeDate:string,unitCode:string,empNo:string}) => {
+  return request('/performance/secondSetting/getEmpWorkload', {
+    method: 'GET',
+    params
+  });
+};
+
+
 

+ 27 - 8
src/pages/setting/projectSetting/secondaryDistriGroupSet/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-07-28 11:33:30
+ * @LastEditTime: 2023-08-11 15:49:51
  * @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 BMSPagecontainer from '@/components/BMSPageContainer';
 import { BMSTable } from '@/components/BMSTable';
 
 import { createFromIconfontCN, MenuOutlined } from '@ant-design/icons';
-import { ActionType, arrayMoveImmutable, ProFormSelect, useRefFunction } from '@ant-design/pro-components';
+import { ActionType, arrayMoveImmutable, ProFormInstance, ProFormSelect, useRefFunction } from '@ant-design/pro-components';
 import { ModalForm, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
 import { ProColumns } from '@ant-design/pro-table';
 import { InputNumber, Dropdown, Input, MenuProps, message, Modal, Popconfirm, Space, Form, Table, Tabs } from 'antd';
@@ -102,7 +102,6 @@ const SecondaryDistriGroupSet = () => {
             key: 'option',
             valueType: 'option',
             render: (_: any, record: any) => {
-                console.log({currentSelectedType});
                 return [
                     <Popconfirm
                         title="是否确认删除?"
@@ -448,6 +447,8 @@ const SecondaryDistriGroupSet = () => {
    
         const [scoreList, set_scoreList] = useState<any[]>([]);
         const [scoreInitList, set_scoreInitList] = useState({});
+        const [evaluationIs3Codes,set_evaluationIs3Codes] = useState<string[]>([]); 
+        const formRef = useRef<ProFormInstance>();
 
         const addIndicator = () => {
 
@@ -468,6 +469,7 @@ const SecondaryDistriGroupSet = () => {
             result.forEach((a: any) => {
                 defaultFormData[`secondItemCode${a.id}`] = a.secondItemCode;
                 defaultFormData[`weight${a.id}`] = a.weight;
+                defaultFormData[`evaluation${a.id}`] = a.evaluation;
             });
 
             set_scoreInitList({ ...defaultFormData });
@@ -481,9 +483,13 @@ const SecondaryDistriGroupSet = () => {
                     const defaultVal = dataSource.map((a: any) => {
                         defaultFormData[`secondItemCode${a.id}`] = a.itemCode;
                         defaultFormData[`weight${a.id}`] = a.weight;
+                        defaultFormData[`evaluation${a.id}`] = a.evaluation;
+
                         return { ...a, tempId: Math.random() }
                     });
 
+                    console.log({defaultFormData});
+
                     set_scoreInitList({ ...defaultFormData });
             
                     set_scoreList([...defaultVal]);
@@ -495,6 +501,7 @@ const SecondaryDistriGroupSet = () => {
                 title={`二次分配项目设置(${currentSelectedType.groupName})`}
                 className='SecondaryDistriGroupSet-ModalForm'
                 width={355}
+                formRef={formRef}
                 initialValues={{...scoreInitList}}
                 trigger={
                     <a className='score'>添加</a>
@@ -519,7 +526,8 @@ const SecondaryDistriGroupSet = () => {
                                                     if (resp) {
                                                         return resp.list.map((a: any) => ({
                                                             label: a.name,
-                                                            value: a.code
+                                                            value: a.code,
+                                                            evaluation:a.evaluation
                                                         }))
                                                     }
                                                     return []
@@ -528,21 +536,32 @@ const SecondaryDistriGroupSet = () => {
                                                 fieldProps={{
                                                     //   labelInValue:true,
                                                     onChange(value, option: any) {
-                                                        // console.log({value,option});
                                                         const temp = [...scoreList];
                                                         const newArr = temp.map((a: any) => {
                                                             if (a.id == item.id) {
-                                                                return { ...a, secondItemCode: value, secondItemName: option.label }
+
+                                                                return { 
+                                                                    ...a, secondItemCode: value, secondItemName: option.label,
+                                                                    weight:option.evaluation == 3?0:a.weight
+                                                                }
                                                             }
                                                             return a
                                                         });
 
+                                                        if(option.evaluation == 3){
+                                                            formRef?.current?.setFieldValue([`weight${item.id}`],0);
+                                                            formRef?.current?.setFieldValue([`evaluation${item.id}`],3);
+                                                        }else{
+                                                            formRef?.current?.setFieldValue([`evaluation${item.id}`],option.evaluation);
+                                                        }
+
                                                         set_scoreList([...newArr]);
                                                     },
                                                 }}
                                             />
                                             <Form.Item name={`weight${item.id}`} label='占比:'>
                                                 <InputNumber
+                                                    disabled={(formRef?.current?.getFieldValue(`evaluation${item.id}`) != item.evaluation&&formRef?.current?.getFieldValue(`evaluation${item.id}`)!=undefined)?formRef?.current?.getFieldValue(`evaluation${item.id}`) == 3:item.evaluation == 3}
                                                     style={{ width: 120, height: 24, position: 'relative', top: 0 }}
                                                     onChange={(value) => {
                                                         //console.log({value,index,indicatorData});
@@ -591,7 +610,7 @@ const SecondaryDistriGroupSet = () => {
                     fromIndex: oldIndex,
                     toIndex: newIndex,
                 }).filter((el) => !!el);
-                const updatedSortArr = newData.map((item: any, index: number) => ({ ...item, sort: index }))
+                const updatedSortArr = newData.map((item: any, index: number) => ({ ...item, sort: index+1 }))
                 set_dataSource([...updatedSortArr]);
                 updateSecondaryDistriItemSet(updatedSortArr,'EDIT');
             }
@@ -635,7 +654,7 @@ const SecondaryDistriGroupSet = () => {
     }, [showTypeListArr]);
 
     useEffect(()=>{
-        getPageLeftData();
+        getTableData();
     },[currentTabKey]);
 
     useEffect(()=>{

+ 8 - 5
src/pages/setting/projectSetting/secondaryProjectDistribute/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-08-03 17:58:30
+ * @LastEditTime: 2023-08-10 16:44:19
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -66,13 +66,16 @@ export default function BilingProjectMana() {
             width: 160,
             ellipsis: true,
             renderText(text, record, index, action) {
-                console.log({ record });
-                if (record.level) {
+                if (record.level&&record.evaluation == 2) {
+                    //评级
                     return record.level.reduce((prev: string, cur: any) => {
-                        console.log({ prev, cur });
-                        return `${prev + cur.levelName}`
+                        return `${prev.length>0?prev+'|':prev}${cur.levelName}`
                     }, '')
                 }
+                if (record.evaluation == 1) {
+                    //评分
+                    return (record.floor != undefined&&record.ceiling != undefined)?`${record.floor}~${record.ceiling}`:'-'
+                }
                 return '-'
             },
         },

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
src/utils/zhongtaiA.js


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
src/utils/zhongtaiC.js


BIN
static/calcu.png


BIN
static/editIcon_gray.png


BIN
static/mingcijieshi.png


Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff