Kaynağa Gözat

更新2023-07-21周功能

code4eat 2 yıl önce
ebeveyn
işleme
773b4ad2eb

+ 7 - 2
.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-07-11 15:45:01
+ * @LastEditTime: 2023-07-19 13:32:35
  * @FilePath: /BudgetManaSystem/.umirc.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -106,7 +106,7 @@ export default defineConfig({
               name: '岗位等级系数设定',
               path: '/setting/baseSetting/positionLevelRateSet',
               component: './setting/baseSetting/positionLevelRateSet',
-            }
+            },
           ]
         },
         {
@@ -274,6 +274,11 @@ export default defineConfig({
           name: '一次分配',
           path: '/budgetMana/oneBatch',
           component: './budgetMana/oneBatch'
+        },
+        {
+          name: '特殊数据导入',
+          path: '/budgetMana/specialDataImport',
+          component: './budgetMana/specialDataImport'
         }
       ]
     },

+ 13 - 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-06-08 16:26:11
+ * @LastEditTime: 2023-07-24 10:15:17
  * @FilePath: /BudgetManaSystem/src/access.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -56,10 +56,22 @@ export default (initialState: { name: string;memuData:any[] }) => {
         }
 
   }
+
+  const canIReadThisPage = (pagePath:string)=>{
+    if(memuData){
+      const thisPageData = findMenuItem(memuData,pagePath);
+      // console.log({pagePath,thisPageData});
+      if(thisPageData){
+        return true;
+      }
+      return false;
+    }
+  }
  
 
   return {
     canSeeAdmin,
     whatCanIDoInThisPage,
+    canIReadThisPage
   };
 };

+ 16 - 7
src/components/BMSUpload/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-02-15 16:48:56
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-03-24 16:07:25
+ * @LastEditTime: 2023-07-19 15:16:43
  * @FilePath: /BudgetManaSystem/src/components/BMSUpload/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -20,12 +20,14 @@ const { Dragger } = Upload;
 
 type BMSUploadPropsType = {
     onChange?: () => void;
+    ifShowTip?: boolean;  //是否展示黄底提示
+    ifShowTemplateDownload?: boolean;//是否展示模板下载
     downloadTemplateFile?: () => void; //模板下载回调
 } & UploadProps
 
 const BMSUpload = (props: BMSUploadPropsType) => {
     const [fileList, setFileList] = useState<UploadFile[]>([]);
-    const { onChange, downloadTemplateFile } = props;
+    const { onChange, downloadTemplateFile, ifShowTip = true, ifShowTemplateDownload = true } = props;
 
     const config: UploadProps = {
         action: () => Promise.resolve(''),
@@ -50,11 +52,18 @@ const BMSUpload = (props: BMSUploadPropsType) => {
 
     return (
         <div className='BMSUpload' style={{ paddingBottom: 16 }}>
-            <div className='toolBar'>
-                <span>文件下载</span>
-                <span onClick={() => download()}>模板下载</span>
-            </div>
-            <Alert message="注意,导入的数据将会覆盖当前数据" type="warning" style={{ height: 24, fontSize: 12, marginBottom: 16,marginTop:16 }} showIcon closable banner />
+            {
+                ifShowTemplateDownload && (
+                    <div className='toolBar'>
+                        <span>文件下载</span>
+                        <span onClick={() => download()}>模板下载</span>
+                    </div>
+                )
+            }
+            {
+               ifShowTip&&(<Alert message="注意,导入的数据将会覆盖当前数据" type="warning" style={{ height: 24, fontSize: 12, marginBottom: 16, marginTop: 16 }} showIcon closable banner />) 
+            }
+            
             <Dragger {...config} height={140}>
                 <p className="ant-upload-drag-icon" style={{ marginBottom: 5 }}>
                     <InboxOutlined style={{ fontSize: 50, color: '#3376FE' }} />

+ 13 - 3
src/global.less

@@ -698,8 +698,8 @@ textarea {
     border-radius: 4px;
     box-shadow: none !important;
     .bms-ant-input-number-input {
-        height: 24px !important;
-        line-height: 24px !important;
+        height: 22px !important;
+        line-height: 22px !important;
     }
 }
 
@@ -719,7 +719,17 @@ textarea {
 .bms-ant-picker {
     border-radius: 4px !important;
     border: 1px solid #CFD7E6 !important;
-    height: 26px;
+    height: 24px;
+    .bms-ant-picker-input {
+        &>input {
+             &::placeholder {
+                color:#99A6BF !important;
+             }
+        }
+        .bms-ant-picker-suffix {
+            color:#99A6BF !important;
+        }
+    }
 }
 
 .bms-ant-picker-panel-container {

+ 68 - 12
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-05-29 09:41:37
+ * @LastEditTime: 2023-07-24 10:27:31
  * @FilePath: /BudgetManaSystem/src/pages/Home/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 
@@ -12,7 +12,7 @@ import BMSPagecontainer from '@/components/BMSPageContainer';
 import { useModel } from '@umijs/max';
 import React, { useEffect, useState } from 'react';
 import { history } from 'umi';
-import { Image } from 'antd';
+import { Image,Modal } from 'antd';
 
 import img1 from '../../../static/wenzichatu1.png';
 import img2 from '../../../static/wenzichatu2.png';
@@ -25,6 +25,7 @@ import img7 from '../../../static/wenzichatu7.png';
 import './style.less';
 import { getComputeDate, getIndexData } from './service';
 import { createFromIconfontCN } from '@ant-design/icons';
+import { useAccess } from '@umijs/max';
 
 
 const IconFont = createFromIconfontCN({
@@ -70,7 +71,9 @@ const HomePage: React.FC = () => {
 
   const imgList = [
     img1, img2, img3, img4, img5, img6, img7
-  ]
+  ];
+
+  const access = useAccess();
 
 
 
@@ -115,32 +118,78 @@ const HomePage: React.FC = () => {
   }
 
   const goPageHandle = (num: number) => {
+    let flag = true;
     if (num == 1) {
-      history.push('/budgetMana/monthlySet');
+      let path = '/budgetMana/monthlySet';
+      if(access.canIReadThisPage(path)){
+           history.push(path);
+      }else{
+        flag = false
+      }
     }
     if (num == 2) {
-      history.push('/budgetMana/monthlyInfoCheck');
+      let path = '/budgetMana/monthlyInfoCheck';
+      if(access.canIReadThisPage(path)){
+           history.push(path);
+      }else{
+        flag = false
+      }
     }
     if (num == 3) {
-      history.push('/budgetMana/monthlyDataCheck');
+      let path = '/budgetMana/monthlyDataCheck';
+      if(access.canIReadThisPage(path)){
+           history.push(path);
+      }else{
+        flag = false
+      }
     }
     if (num == 4) {
-      history.push('/budgetMana/personnelSalaryBudget');
+      let path = '/budgetMana/personnelSalaryBudget';
+      if(access.canIReadThisPage(path)){
+           history.push(path);
+      }else{
+        flag = false
+      }
     }
     if (num == 5) {
-      history.push('/budgetMana/oneBatch');
+      let path = '/budgetMana/oneBatch';
+      if(access.canIReadThisPage(path)){
+           history.push(path);
+      }else{
+        flag = false
+      }
     }
     if (num == 6) {
-      history.push('/secondaryDistribute/employeeInfoCheck');
+      let path = '/secondaryDistribute/employeeInfoCheck';
+      if(access.canIReadThisPage(path)){
+           history.push(path);
+      }else{
+        flag = false
+      }
     }
     if (num == 7) {
-      history.push('/secondaryDistribute/secondaryDitriComputed');
+      let path = '/secondaryDistribute/secondaryDitriComputed';
+      if(access.canIReadThisPage(path)){
+           history.push(path);
+      }else{
+        flag = false
+      }
     }
     if (num == 8) {
-      history.push('/secondaryDistribute/secondaryDitriCheck');
+      let path = '/secondaryDistribute/secondaryDitriCheck';
+      if(access.canIReadThisPage(path)){
+           history.push(path);
+      }else{
+        flag = false
+      }
     }
     if (num == 9) {
-      history.push('/secondaryDistribute/secondaryDitriCheck');
+      let path = '/secondaryDistribute/secondaryDitriCheck';
+      if(access.canIReadThisPage(path)){
+           history.push(path);
+      }else{
+        flag = false
+      }
     }
     if (num == 10) {
       //history.push('/secondaryDistribute/secondaryDitriCheck');
@@ -151,6 +200,13 @@ const HomePage: React.FC = () => {
     if (num == 12) {
       //history.push('/secondaryDistribute/secondaryDitriCheck');
     }
+
+    if(!flag){
+      Modal.error({
+        title:'抱歉,暂无访问权限!'
+      })
+      
+    }
   }
 
   useEffect(() => {

+ 59 - 31
src/pages/budgetMana/monthlyDataCheck/index.tsx

@@ -4,7 +4,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-16 09:42:52
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-07-10 10:10:50
+ * @LastEditTime: 2023-07-24 09:33:39
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -41,6 +41,7 @@ import { getDeepestTreeData } from '@/utils/tooljs';
 
 import '../../../utils/zhongtaiA'
 import { formatMoneyNumber } from '@/utils/format';
+import { getJiezhuanStatus } from '../monthlySet/service';
 
 const IconFont = createFromIconfontCN({
     scriptUrl: '',
@@ -93,6 +94,8 @@ const MonthlyDataCheck: React.FC = () => {
 
     const [tableH, set_tableH] = useState(0);
 
+    const [ifBanAllAction, set_ifBanAllAction] = useState(true);  //是否掩藏所有操作
+
     const [computeMethod, set_computeMethod] = useState('1'); //1按考核分级 2按总分
 
     const [unitCostComputeData, set_unitCostComputeData] = useState({ unitCostTotal: 0, unitCostCtrlTotal: 0 })
@@ -290,12 +293,14 @@ const MonthlyDataCheck: React.FC = () => {
             width: 200,
             render: (text: any, record: any) => {
 
+                if(ifBanAllAction)return text;
+
                 return (
                     <div style={{ display: 'flex', flexDirection: 'row', width: '100%', justifyContent: 'flex-start', alignItems: 'center' }}>
 
                         <div style={{ width: '80px', height: 16, display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center' }}>
                             {
-                                (currentEditRecord ? currentEditRecord.id : -1) == record.id ? <InputNumber size='small' defaultValue={record.amount} placeholder='请输入' onChange={(value) => {set_currentEditRecord({ ...currentEditRecord, amount: value }) }} style={{ width: '80px' }} /> : <span>{formatMoneyNumber(text)}</span>
+                                (currentEditRecord ? currentEditRecord.id : -1) == record.id ? <InputNumber size='small' defaultValue={record.amount} placeholder='请输入' onChange={(value) => { set_currentEditRecord({ ...currentEditRecord, amount: value }) }} style={{ width: '80px' }} /> : <span>{formatMoneyNumber(text)}</span>
                             }
                         </div>
                         {(auditType == '0' && record.summaryFlag == 0) && <img onClick={() => editHandleTwo(record)} style={{ width: 16, height: 16, cursor: 'pointer', marginLeft: 8 }} src={(currentEditRecord ? currentEditRecord.id : -1) == record.id ? conformIcon : editIcon} alt="" />}
@@ -350,7 +355,7 @@ const MonthlyDataCheck: React.FC = () => {
     //编辑单元成本金额
     const editHandleTwo = async (record: any) => {
         const { id, deptCode, salaryType, unitCode, userId } = record;
-        if (currentEditRecord&&id == currentEditRecord.id) {
+        if (currentEditRecord && id == currentEditRecord.id) {
             const resp = await editUnitCostTableData({
                 amount: currentEditRecord.amount,
                 id
@@ -360,7 +365,7 @@ const MonthlyDataCheck: React.FC = () => {
                 tableRef.current?.reload();
             }
             set_currentEditRecord(undefined);
-        }else{
+        } else {
             set_currentEditRecord(record);
         }
     }
@@ -450,6 +455,15 @@ const MonthlyDataCheck: React.FC = () => {
         set_editModalVisible(true);
     }
 
+    const getJiezhuanStatusHandle =async () => {
+        const resp = await getJiezhuanStatus(currentComputeDate as string);
+        if(resp == 2){
+              set_ifBanAllAction(true);
+        }else{
+              set_ifBanAllAction(false);
+        }
+    }
+
 
     //管理指标row编辑
     const EditManaIndexTableRow = ({ record }: { record: any }) => {
@@ -1036,7 +1050,7 @@ const MonthlyDataCheck: React.FC = () => {
     }
 
     const importData = (index: number, name: string) => {
-
+        if (ifBanAllAction) return;
         return (
             <ModalForm
                 width={360}
@@ -1248,6 +1262,7 @@ const MonthlyDataCheck: React.FC = () => {
         if (currentComputeDate) {
             pageCheckStatusFunc(currentComputeDate);  //获取页面查核状态
             getCalcStatus();
+            getJiezhuanStatusHandle();
         }
 
     }, [currentComputeDate]);
@@ -1448,7 +1463,10 @@ const MonthlyDataCheck: React.FC = () => {
                     (
                         <div className='rightContent'>
                             <BMSPagecontainer title={`核算年月:${currentComputeDate}`} ghost>
-                                <div className='checkBtn' onClick={() => checkHandle(`${auditType}`)}>{auditType == '0' ? '审核' : '取消审核'}</div>
+                                {
+                                    !ifBanAllAction && <div className='checkBtn' onClick={() => checkHandle(`${auditType}`)}>{auditType == '0' ? '审核' : '取消审核'}</div>
+                                }
+
                                 {/* <div className='midLine'>
                             <span>点击检查</span>
                             是否有未对照的人员信息、未对照的科室信息及未设置的收费项目信息
@@ -1519,14 +1537,14 @@ const MonthlyDataCheck: React.FC = () => {
                                                 </Popover>
                                             </div>
                                             {currentComputeDate && <BMSTable actionRef={tableRef} params={tableDataFilterParams} rowKey='id'
-                                                columns={auditType == '0' ? [...tableColumn, {
+                                                columns={(auditType == '0' && !ifBanAllAction) ? [...tableColumn, {
                                                     title: '金额',
                                                     dataIndex: 'salary',
                                                     key: 'salary',
                                                     align: 'center',
                                                     width: '10%',
                                                     render: (text: any, record: any) => {
-
+                                                        if (ifBanAllAction) return text;
                                                         return (
                                                             <div style={{ display: 'flex', flexDirection: 'row', width: '100%', justifyContent: 'center', alignItems: 'center' }}>
 
@@ -1567,7 +1585,7 @@ const MonthlyDataCheck: React.FC = () => {
                                                         width: '10%',
                                                         // shouldCellUpdate:(record:any, prevRecord:any) => true,
                                                         render: (text: any, record: any) => {
-
+                                                            if (ifBanAllAction) return text;
                                                             return (
                                                                 <div style={{ display: 'flex', flexDirection: 'row', width: '100%', justifyContent: 'center', alignItems: 'center' }}>
 
@@ -1614,12 +1632,12 @@ const MonthlyDataCheck: React.FC = () => {
                                                         {/* <span key="1" onClick={() => generateFunc(2)} >获取</span>
                                             <span key="2" >导入</span> */}
                                                         {importData(2, '非考核项目')}
-                                                        <span key="3" onClick={auditType == '0' ? () => tableDataAddHandle() : () => { }}>添加</span>
+                                                        {!ifBanAllAction && <span key="3" onClick={auditType == '0' ? () => tableDataAddHandle() : () => { }}>添加</span>}
                                                     </div>
                                                 </Popover>
                                             </div>
                                             {currentComputeDate && <BMSTable scroll={{ x: 120 * 10, y: 500 }} actionRef={tableRef} rowKey='id' params={tableDataFilterParams}
-                                                columns={auditType == '0' ? [...tableColumn, {
+                                                columns={(auditType == '0' && !ifBanAllAction) ? [...tableColumn, {
                                                     title: '操作',
                                                     fixed: 'right',
                                                     key: 'option',
@@ -1740,17 +1758,22 @@ const MonthlyDataCheck: React.FC = () => {
                                                                 } />
                                                             </div>
                                                         </div>
-                                                        <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
-                                                            <div className={auditType == '1' || loading ? 'btnGroup disabled' : 'btnGroup'}
-                                                                onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
-                                                                onMouseLeave={() => set_ifShowTip(false)}
-                                                            >
-                                                                <span key="1" onClick={auditType == '0' ? () => generateFunc(3, true) : () => { }}>获取单个</span>
-                                                                <span key="2" onClick={auditType == '0' ? () => generateFunc(3) : () => { }}>获取所有</span>
-                                                            </div>
-                                                        </Popover>
+                                                        {
+                                                            !ifBanAllAction && (
+                                                                <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
+                                                                    <div className={auditType == '1' || loading ? 'btnGroup disabled' : 'btnGroup'}
+                                                                        onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
+                                                                        onMouseLeave={() => set_ifShowTip(false)}
+                                                                    >
+                                                                        <span key="1" onClick={auditType == '0' ? () => generateFunc(3, true) : () => { }}>获取单个</span>
+                                                                        <span key="2" onClick={auditType == '0' ? () => generateFunc(3) : () => { }}>获取所有</span>
+                                                                    </div>
+                                                                </Popover>
+                                                            )
+                                                        }
+
                                                     </div>
-                                                    {currentComputeDate && <BMSTable actionRef={tableRef} loading={{ spinning: loading, tip: '正在计算数据...' }} rowKey='id' params={tableDataFilterParams} columns={auditType == '0' ? [...tableColumn, {
+                                                    {currentComputeDate && <BMSTable actionRef={tableRef} loading={{ spinning: loading, tip: '正在计算数据...' }} rowKey='id' params={tableDataFilterParams} columns={(auditType == '0' && !ifBanAllAction) ? [...tableColumn, {
                                                         title: '数值',
                                                         dataIndex: 'value',
                                                         key: 'value',
@@ -1842,7 +1865,7 @@ const MonthlyDataCheck: React.FC = () => {
                                                     </div>
                                                 </Popover>
                                             </div>
-                                            {currentComputeDate && tableColumn && <BMSTable className='BMS-ManaIndextable' rowClassName={() => 'BMS-ManaIndextable-row'} bordered actionRef={tableRef} scroll={{ x: (100 * (tableColumn.length - 2)) + 120 + 300, y: tableH }} rowKey='unitCode' columns={auditType == '0' ? [...tableColumn,
+                                            {currentComputeDate && tableColumn && <BMSTable className='BMS-ManaIndextable' rowClassName={() => 'BMS-ManaIndextable-row'} bordered actionRef={tableRef} scroll={{ x: (100 * (tableColumn.length - 2)) + 120 + 300, y: tableH }} rowKey='unitCode' columns={(auditType == '0' && !ifBanAllAction) ? [...tableColumn,
                                             {
                                                 title: '操作',
                                                 key: 'option',
@@ -2024,15 +2047,20 @@ const MonthlyDataCheck: React.FC = () => {
                                                             {/* <span className='compelted'>已分配总额: <i>{pageData.completedTotal}</i></span>
                                 <span className='left'>剩余分配总额: <i>{pageData.leftTotal}</i></span> */}
                                                             <div className='count'><span className='compelted' style={{ display: 'inline-block', marginRight: 20 }}>总成本:<i>{formatMoneyNumber(Number(unitCostComputeData.unitCostTotal.toFixed(2)))}</i></span><span className='left'>可控成本:<i>{formatMoneyNumber(Number(unitCostComputeData.unitCostCtrlTotal.toFixed(2)))}</i></span></div>
-                                                            <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
-                                                                <div className={auditType == '1' || loading ? 'btnGroup disabled' : 'btnGroup'}
-                                                                    onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
-                                                                    onMouseLeave={() => set_ifShowTip(false)}
-                                                                >
-                                                                    <span key="1" onClick={auditType == '0' ? () => generateFunc(7, false) : () => { }}>获取</span>
-                                                                    <>{importData(7, '成本')}</>
-                                                                </div>
-                                                            </Popover>
+                                                            {
+                                                                !ifBanAllAction && (
+                                                                    <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
+                                                                        <div className={auditType == '1' || loading ? 'btnGroup disabled' : 'btnGroup'}
+                                                                            onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
+                                                                            onMouseLeave={() => set_ifShowTip(false)}
+                                                                        >
+                                                                            <span key="1" onClick={auditType == '0' ? () => generateFunc(7, false) : () => { }}>获取</span>
+                                                                            <>{importData(7, '成本')}</>
+                                                                        </div>
+                                                                    </Popover>
+                                                                )
+                                                            }
+
                                                         </>
 
                                                     </div>

+ 147 - 67
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-06-16 13:36:05
+ * @LastEditTime: 2023-07-24 09:30:42
  * @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, ProColumnType } from '@ant-design/pro-components';
 import { createFromIconfontCN } from '@ant-design/icons';
-import { checkRequest, delPersonRequest, generateDataRequest, getDepInfoTableData, getPersonInfoTableData, getProjectInfoTableData, getTotalEmps, getTreeData, getTreeDataRespType, jixiaoDataImport, PersonInfoTableDataType, saveEmpsRequest } from './service';
+import { checkRequest, delPersonRequest, generateDataRequest, getDepInfoTableData, 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';
 
@@ -39,6 +39,7 @@ import { ColumnsType, TableRowSelection } from 'antd/es/table/interface';
 import { difference } from 'lodash';
 
 import '../../../../src/utils/zhongtaiA'
+import { getJiezhuanStatus } from '../monthlySet/service';
 
 
 const IconFont = createFromIconfontCN({
@@ -55,19 +56,19 @@ const depInfoTableColumn = [
         title: '科室代码',
         dataIndex: 'deptCode',
         key: 'deptCode',
-   
+
     },
     {
         title: '科室名称',
         dataIndex: 'deptName',
         key: 'deptName',
-    
+
     },
     {
         title: '类型',
         dataIndex: 'deptTypeName',
         key: 'deptTypeName',
-  
+
     },
 ]
 
@@ -76,31 +77,31 @@ const chargeInfoTableColumn = [
         title: '项目代码',
         dataIndex: 'itemCode',
         key: 'itemCode',
-    
+
     },
     {
         title: '项目名称',
         dataIndex: 'itemName',
         key: 'itemName',
-     
+
     },
     {
         title: '类型',
         dataIndex: 'itemType',
         key: 'itemType',
-      
+
     },
     {
         title: '点值',
         dataIndex: 'itemPoint',
         key: 'itemPoint',
-    
+
     },
     {
         title: '核心',
         dataIndex: 'coreFlag',
         key: 'coreFlag',
-   
+
         render: (_: any) => {
             return _ == 1 ? '是' : '否'
         }
@@ -144,6 +145,8 @@ const MonthlyInfoCheck: React.FC = () => {
     const [searchValue, setSearchValue] = useState('');
     const [autoExpandParent, setAutoExpandParent] = useState(true);
 
+    const [ifBanAllAction, set_ifBanAllAction] = useState(true);  //是否掩藏所有操作
+
 
 
     const tableRef = useRef<ActionType>();
@@ -154,37 +157,37 @@ const MonthlyInfoCheck: React.FC = () => {
             title: '工号',
             dataIndex: 'empNo',
             key: 'empNo',
-          
+
         },
         {
             title: '姓名',
             dataIndex: 'empName',
             key: 'empName',
-        
+
         },
         {
             title: '岗位层级',
             dataIndex: 'positionLevelName',
             key: 'positionLevelName',
-            
+
         },
         {
             title: '职务',
             dataIndex: 'jobTitleName',
             key: 'jobTitleName',
-         
+
         },
         {
             title: '岗位系数',
             dataIndex: 'positionRate',
             key: 'positionRate',
-         
+
         },
         {
             title: '年资',
             dataIndex: 'seniority',
             key: 'seniority',
-           
+
         },
     ];
 
@@ -224,7 +227,14 @@ const MonthlyInfoCheck: React.FC = () => {
         set_currentSelectedTabKey(activeKey);
     }
 
-
+    const getJiezhuanStatusHandle =async () => {
+        const resp = await getJiezhuanStatus(currentComputeDate as string);
+        if(resp == 2){
+              set_ifBanAllAction(true);
+        }else{
+              set_ifBanAllAction(false);
+        }
+    }
 
 
     const getTableData = async (type: 'PERSON' | 'DEP' | 'CHARGE', params: any, sort: any, filter: any) => {
@@ -324,13 +334,13 @@ const MonthlyInfoCheck: React.FC = () => {
             icon: <></>,
             width: 640,
             okText: '确定',
-            centered:true,
+            centered: true,
             cancelText: '取消',
-            content:<TableTransfer
-            ref={ref}
-            leftColumns={transferTableColumn}
-            rightColumns={transferTableColumn} 
-        ></TableTransfer>,
+            content: <TableTransfer
+                ref={ref}
+                leftColumns={transferTableColumn}
+                rightColumns={transferTableColumn}
+            ></TableTransfer>,
             onOk: () => {
                 return ref.current && ref.current.save();
             }
@@ -438,7 +448,7 @@ const MonthlyInfoCheck: React.FC = () => {
                             size="small"
                             bordered={false}
                             rowKey={'empNo'}
-                            pagination={{showTitle:false,pageSize:9,showLessItems:false,simple:true,showTotal:()=>false}}
+                            pagination={{ showTitle: false, pageSize: 9, showLessItems: false, simple: true, showTotal: () => false }}
                             tableAlertRender={false}
                             style={{ pointerEvents: listDisabled ? 'none' : undefined }}
                             onRow={({ empNo, disabled: itemDisabled }) => ({
@@ -454,7 +464,7 @@ const MonthlyInfoCheck: React.FC = () => {
         )
     })
 
-    
+
 
     const confirmGenerateHandle = async (type: number) => {
         const resp = await generateDataRequest({
@@ -473,9 +483,9 @@ const MonthlyInfoCheck: React.FC = () => {
 
         let msg = '';
 
-        if(type == 1)msg = '生成操作会根据基础设定的单元人员对照信息重新生成数据,手动调整的人员信息将会丢失,确定继续生成操作?';
-        if(type == 2)msg = '生成操作会覆盖现有的科室数据,确定继续生成操作?';
-        if(type == 3)msg = '生成操作会覆盖现有的收费项目数据,确定继续生成操作?';
+        if (type == 1) msg = '生成操作会根据基础设定的单元人员对照信息重新生成数据,手动调整的人员信息将会丢失,确定继续生成操作?';
+        if (type == 2) msg = '生成操作会覆盖现有的科室数据,确定继续生成操作?';
+        if (type == 3) msg = '生成操作会覆盖现有的收费项目数据,确定继续生成操作?';
 
 
         Modal.confirm({
@@ -593,12 +603,55 @@ const MonthlyInfoCheck: React.FC = () => {
         set_treeData(resp);
     }
 
-    const importHandle = async ()=>{
-           const resp = await jixiaoDataImport(currentComputeDate as string );
-           if(resp){
+    const importHandle = async () => {
+        const resp = await jixiaoDataImport(currentComputeDate as string);
+        if (resp) {
             message.success('操作成功!');
             tableRef.current?.reload();
-           }
+        }
+    }
+
+    const checkBtnHandle = () => {
+        //点击检查按钮事件
+        const _tableColumns: ProColumns[] = [
+            {
+                title: '异动类型',
+                width: 120,
+                dataIndex: 'messageType'
+            },
+            {
+                title: '异动信息',
+                dataIndex: 'message',
+                ellipsis: true
+            }
+        ];
+
+        const getInfo = async () => {
+            const resp = await getTransactionInfo(currentComputeDate as string);
+            if (resp) {
+                return {
+                    data: resp,
+                    success: true,
+                }
+            }
+            return []
+        }
+
+        Modal.info({
+            title: '异动详情',
+            icon: <></>,
+            width: 640,
+            okText: '知道了',
+            centered: true,
+            cancelText: '',
+            content: (
+                <BMSTable columns={[..._tableColumns]} request={async () => getInfo()} />
+            ),
+            onOk: () => {
+                // return ref.current && ref.current.save();
+            }
+        })
+
     }
 
     useEffect(() => {
@@ -606,6 +659,7 @@ const MonthlyInfoCheck: React.FC = () => {
         if (currentComputeDate) {
             getTreeReqFunc(currentComputeDate);
             getCheckStatus(currentComputeDate);
+            getJiezhuanStatusHandle();
         }
     }, [currentComputeDate]);
 
@@ -722,12 +776,21 @@ const MonthlyInfoCheck: React.FC = () => {
             {/* <div style={{width:16,height:'92vh',background:'#F5F7FA'}}></div> */}
             <div className='rightContent'>
                 <BMSPagecontainer title={`核算年月:${currentComputeDate}`} ghost>
-                    <div className={auditType == '0' ? 'importBtn disabled' : 'importBtn '} onClick={()=>importHandle()} style={{right:auditType == '0'?'64px':'93px'}}>绩效数据导入</div>
-                    <div className='checkBtn' onClick={() => checkHandle(`${auditType}`)}>{auditType == '0' ? '审核' : '取消审核'}</div>
-                    {/* <div className='midLine'>
-                        <span>点击检查</span>
-                        是否有未对照的人员信息、未对照的科室信息及未设置的收费项目信息
-                    </div> */}
+                    {
+                        !ifBanAllAction && (
+                            <>
+                                <div className={auditType == '0' ? 'importBtn disabled' : 'importBtn '} onClick={() => importHandle()} style={{ right: auditType == '0' ? '64px' : '93px' }}>绩效数据导入</div>
+                                <div className='checkBtn' onClick={() => checkHandle(`${auditType}`)}>{auditType == '0' ? '审核' : '取消审核'}</div>
+                                {!ifBanAllAction&&(
+                                    <div className='midLine'>
+                                    <span onClick={() => checkBtnHandle()}>点击检查</span>
+                                    是否有未对照的人员信息、未对照的科室信息及未设置的收费项目信息
+                                </div>
+                                )}
+                            </>
+                        )
+                    }
+
                     <Tabs
                         defaultActiveKey="1"
                         onChange={onTabChange}
@@ -765,19 +828,24 @@ const MonthlyInfoCheck: React.FC = () => {
                                             <IconFont type="iconsousuo" onClick={() => searchEmpHandle()} />
                                         } />
                                     </div>
-                                    <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
-                                        <div className={auditType != '0' ? 'btnGroup disabled' : 'btnGroup'}
-                                            onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
-                                            onMouseLeave={() => set_ifShowTip(false)}
-                                        >
-                                            {/* <span key="1">调整</span> */}
-                                            <span key="2" onClick={auditType == '0' ? () => generateFunc(1) : () => { }}>生成</span>
-                                            <span key="3" onClick={auditType == '0' ? () => addPersonFunc() : () => { }}>添加</span>
-                                        </div>
-                                    </Popover>
+                                    {
+                                        !ifBanAllAction && (
+                                            <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
+                                                <div className={auditType != '0' ? 'btnGroup disabled' : 'btnGroup'}
+                                                    onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
+                                                    onMouseLeave={() => set_ifShowTip(false)}
+                                                >
+                                                    {/* <span key="1">调整</span> */}
+                                                    <span key="2" onClick={auditType == '0' ? () => generateFunc(1) : () => { }}>生成</span>
+                                                    <span key="3" onClick={auditType == '0' ? () => addPersonFunc() : () => { }}>添加</span>
+                                                </div>
+                                            </Popover>
+                                        )
+                                    }
+
 
                                 </div>
-                                {currentSelectedTreeNode && <BMSTable params={empFilterParams} actionRef={tableRef} rowKey='empNo' columns={auditType == '0' ? [...tableColumn, {
+                                {currentSelectedTreeNode && <BMSTable params={empFilterParams} actionRef={tableRef} rowKey='empNo' columns={(auditType == '0' && !ifBanAllAction) ? [...tableColumn, {
                                     title: '操作',
                                     key: 'option',
                                     valueType: 'option',
@@ -810,15 +878,22 @@ const MonthlyInfoCheck: React.FC = () => {
                                             <IconFont type="iconsousuo" onClick={() => searchDepHandle()} />
                                         } />
                                     </div>
-                                    <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
-                                        <div className={auditType != '0' ? 'btnGroup disabled' : 'btnGroup'}
-                                            onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
-                                            onMouseLeave={() => set_ifShowTip(false)}
-                                        >
-                                            {/* <span key="1">调整</span> */}
-                                            <span key="2" onClick={auditType == '0' ? () => generateFunc(2) : () => { }}>生成</span>
-                                        </div>
-                                    </Popover>
+                                    {
+                                        !ifBanAllAction && (
+                                            <>
+                                                <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
+                                                    <div className={auditType != '0' ? 'btnGroup disabled' : 'btnGroup'}
+                                                        onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
+                                                        onMouseLeave={() => set_ifShowTip(false)}
+                                                    >
+                                                        {/* <span key="1">调整</span> */}
+                                                        <span key="2" onClick={auditType == '0' ? () => generateFunc(2) : () => { }}>生成</span>
+                                                    </div>
+                                                </Popover>
+                                            </>
+                                        )
+                                    }
+
                                 </div>
                                 {currentSelectedTreeNode && <BMSTable actionRef={tableRef} params={depFilterParams} rowKey='deptCode' columns={tableColumn} request={(params, sort, filter) => getTableData('DEP', params, sort, filter)} />}
                             </div>
@@ -842,15 +917,20 @@ const MonthlyInfoCheck: React.FC = () => {
                                             <IconFont type="iconsousuo" onClick={() => searchItemHandle()} />
                                         } />
                                     </div>
-                                    <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
-                                        <div className={auditType != '0' ? 'btnGroup disabled' : 'btnGroup'}
-                                            onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
-                                            onMouseLeave={() => set_ifShowTip(false)}
-                                        >
-                                            {/* <span key="1">调整</span> */}
-                                            <span key="2" onClick={auditType == '0' ? () => generateFunc(3) : () => { }}>生成</span>
-                                        </div>
-                                    </Popover>
+                                    {
+                                        !ifBanAllAction && (
+                                            <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
+                                                <div className={auditType != '0' ? 'btnGroup disabled' : 'btnGroup'}
+                                                    onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
+                                                    onMouseLeave={() => set_ifShowTip(false)}
+                                                >
+                                                    {/* <span key="1">调整</span> */}
+                                                    <span key="2" onClick={auditType == '0' ? () => generateFunc(3) : () => { }}>生成</span>
+                                                </div>
+                                            </Popover>
+                                        )
+                                    }
+
                                 </div>
                                 {currentSelectedTreeNode && <BMSTable actionRef={tableRef} params={itemFilterParams} rowKey='id' columns={tableColumn} request={(params, sort, filter) => getTableData('CHARGE', params, sort, filter)} />}
                             </div>

+ 14 - 1
src/pages/budgetMana/monthlyInfoCheck/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-06 14:57:39
+ * @LastEditTime: 2023-07-21 09:47:44
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlyInfoCheck/service.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -251,3 +251,16 @@ export const jixiaoDataImport = (compute_date:string) => {
     })
 
 }
+
+//异动信息获取
+export const  getTransactionInfo = (compute_date:string) => {
+ 
+    return request('/performance/check', {
+        method: 'POST',
+        params:{
+            computeDate:compute_date
+        }
+    })
+
+}
+

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

@@ -95,7 +95,7 @@
             font-family: SourceHanSansCN-Normal, SourceHanSansCN;
             font-weight: 400;
             margin-top: 12px;
-            margin-bottom: 15px;
+            margin-bottom:4px;
 
             &>span {
                 cursor: pointer;

+ 15 - 10
src/pages/budgetMana/monthlySet/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-16 09:42:52
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-07-14 10:59:06
+ * @LastEditTime: 2023-07-24 10:30:44
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -142,11 +142,16 @@ const MonthlySet: React.FC = () => {
 
     }
 
-    const kaizhangHandle = async () => {
-        const resp = await kaizhnagRequest(currentComputeDate);
-        if (resp) {
-            getMonthlyDataFunc(currentComputeDate);
-        }
+    const kaizhangHandle = () => {
+        Modal.confirm({
+            title: '是否确定开帐?',
+            onOk:async (...args)=>{
+                const resp = await kaizhnagRequest(currentComputeDate);
+                if (resp) {
+                    getMonthlyDataFunc(currentComputeDate);
+                }
+            },
+        })
     }
 
     useEffect(() => {
@@ -157,7 +162,7 @@ const MonthlySet: React.FC = () => {
     }, [ifEdit]);
 
     useEffect(() => {
-        if(data){
+        if (data) {
             topform.setFieldsValue({
                 personalRate: data.lastCarry.personalRate,
                 seniority: data.lastCarry.seniority,
@@ -218,7 +223,7 @@ const MonthlySet: React.FC = () => {
                                     colProps={{ span: 8 }}
                                     width='lg'
                                     placeholder='请输入'
-                                    fieldProps={{ precision: 2 }}
+                                    fieldProps={{ precision: 4 }}
                                 />
 
                                 <ProFormDigit
@@ -282,7 +287,7 @@ const MonthlySet: React.FC = () => {
                                         colProps={{ span: 8 }}
                                         width='lg'
                                         placeholder='请输入'
-                                        fieldProps={{ precision: 2 }}
+                                        fieldProps={{ precision: 4 }}
                                     />
 
                                     <ProFormDigit
@@ -330,7 +335,7 @@ const MonthlySet: React.FC = () => {
                                         colProps={{ span: 8 }}
                                         width='lg'
                                         placeholder='请输入'
-                                        fieldProps={{ precision: 2 }}
+                                        fieldProps={{ precision: 4 }}
                                     />
 
                                     <ProFormDigit

+ 11 - 1
src/pages/budgetMana/monthlySet/service.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-15 15:14:12
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-07-06 20:06:08
+ * @LastEditTime: 2023-07-21 17:45:14
  * @FilePath: /BudgetManaSystem/src/pages/Home/service.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -99,5 +99,15 @@ export const jiezhuanGoBack = (params:string)=>{
     })
 }
 
+//获取核算年月结转状态
+export const getJiezhuanStatus = (computeDate:string)=>{
+
+    return request('/performance/carry/getBillStatus', {
+         method:'GET',
+         params:{computeDate},
+    })
+}
+
+
 
 

+ 76 - 35
src/pages/budgetMana/oneBatch/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-07-14 18:17:36
+ * @LastEditTime: 2023-07-24 09:31:58
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/oneBatch/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -26,6 +26,7 @@ import { convertToColumns } from '@/utils/tooljs';
 
 import * as XLSX from 'xlsx';
 import exportTableToMultiExcel from '@/utils/tableToMultiHeaderExcel';
+import { getJiezhuanStatus } from '../monthlySet/service';
 
 
 const config = {
@@ -199,7 +200,7 @@ const mockColumns = [
   }
 ]
 
-let checkStatusArr:number[] = []
+let checkStatusArr: number[] = []
 
 const OneBatch = () => {
 
@@ -230,9 +231,10 @@ const OneBatch = () => {
   const [reportTitle, set_reportTitle] = useState('');
   const [checkType, set_checkType] = useState<string | undefined>(undefined); // 一次分配审核模式,1职类一起审核 2职类分开审核
 
-  const [disAccount,set_disAccount] = useState(false);
+  const [disAccount, set_disAccount] = useState(false);
+
+  const [ifBanAllAction, set_ifBanAllAction] = useState(true);  //是否掩藏所有操作
 
-  //const [checkStatusArr,set_checkStatusArr] = useState<number[]>([]);
 
 
   const onTabChange = (activeKey: string) => {
@@ -307,15 +309,28 @@ const OneBatch = () => {
       const columnsForExcel = convertToColumnsFunc(title, false);
 
 
-
       set_tableColumn([{
         title: '核算单元',
         dataIndex: 'unitName',
         key: 'unitName',
         width: 140,
         fixed: 'left',
-        ellipsis: true
+        ellipsis: true,
+        sorter: (a, b) => {
+          return b.unitName.localeCompare(a.unitName)
+        },
 
+      },
+      {
+        title: '核算单元代码',
+        dataIndex: 'unitCode',
+        key: 'unitCode',
+        width: 140,
+        fixed: 'left',
+        ellipsis: true,
+        sorter: (a, b) => {
+          return b.unitCode.localeCompare(a.unitCode)
+        },
       }, ...columns, {
         title: '总奖金',
         dataIndex: 'totalScore',
@@ -333,7 +348,21 @@ const OneBatch = () => {
         key: 'unitName',
         width: 140,
         fixed: 'left',
-        ellipsis: true
+        ellipsis: true,
+        sorter: (a, b) => {
+          return b.unitName.localeCompare(a.unitName)
+        },
+      },
+      {
+        title: '核算单元代码',
+        dataIndex: 'unitCode',
+        key: 'unitCode',
+        width: 140,
+        fixed: 'left',
+        ellipsis: true,
+        sorter: (a, b) => {
+          return b.unitCode.localeCompare(a.unitCode)
+        },
 
       }, ...columnsForExcel, {
         title: '总奖金',
@@ -378,7 +407,6 @@ const OneBatch = () => {
   }
 
 
-
   const checkHandle = async (type: string) => {
 
     if (!checkType) return;
@@ -423,7 +451,7 @@ const OneBatch = () => {
   }
 
 
-  const getCheckStatus = async (computeDate: string,code?:string) => {
+  const getCheckStatus = async (computeDate: string, code?: string) => {
 
     if (checkType == '1') {
       const resp = await getCurrentCheckStatus(computeDate);
@@ -434,7 +462,7 @@ const OneBatch = () => {
       }
     }
     if (checkType == '2') {
-      const resp = await getCurrentZhileiCheckStatus(computeDate,code?code:currentTabKey);
+      const resp = await getCurrentZhileiCheckStatus(computeDate, code ? code : currentTabKey);
       if (resp) {
         set_auditType('1');  //0 未审核 1 已审核
       } else {
@@ -495,30 +523,38 @@ const OneBatch = () => {
   }, [currentTabKey]);
 
 
-  useEffect(()=>{
-    if(checkType == '2'){
+  useEffect(() => {
+    if (checkType == '2') {
       checkStatusArr = [];
-      tabs.forEach(async (item)=>{
-             const resp = await getCurrentZhileiCheckStatus(currentComputeDate as string,item.value);
+      tabs.forEach(async (item) => {
+        const resp = await getCurrentZhileiCheckStatus(currentComputeDate as string, item.value);
 
-            checkStatusArr.push(resp);
+        checkStatusArr.push(resp);
+
+        if (checkStatusArr.length == tabs.length) {
+          const total = [...checkStatusArr].reduce((prev, cur) => prev + cur, 0);
+          total > 0 ? set_disAccount(true) : set_disAccount(false)
+        }
 
-            if(checkStatusArr.length == tabs.length){
-              const total = [...checkStatusArr].reduce((prev,cur)=>prev+cur,0);
-              total>0?set_disAccount(true):set_disAccount(false)
-            }
-             
       })
     }
-  },[auditType]);
-
+  }, [auditType]);
 
 
+  const getJiezhuanStatusHandle = async () => {
+    const resp = await getJiezhuanStatus(currentComputeDate as string);
+    if (resp == 2) {
+      set_ifBanAllAction(true);
+    } else {
+      set_ifBanAllAction(false);
+    }
+  }
 
 
   useEffect(() => {
     if (currentComputeDate && checkType) {
       getCheckStatus(currentComputeDate);
+      getJiezhuanStatusHandle();
     }
   }, [currentComputeDate, checkType]);
 
@@ -539,19 +575,24 @@ const OneBatch = () => {
   return (
     <BMSPagecontainer className='OneBatch' title={`核算年月:${currentComputeDate}`}>
       <div className='btnGroup'>
-        <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
-          <div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
-            <div className={(auditType == '0'&&!disAccount) ? 'caculateBtn' : 'caculateBtn disabled'}
-              onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
-              onMouseLeave={() => set_ifShowTip(false)}
-              onClick={() => (auditType == '0'&&!disAccount) ? generateFunc() : () => { }}>计算</div>
-            <div className={auditType == '0' ? 'caculateBtn' : 'caculateBtn disabled'}
-              onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
-              onMouseLeave={() => set_ifShowTip(false)}
-              onClick={() => auditType == '0' ? exportHandle() : () => { }}>导出</div>
-          </div>
-        </Popover>
-        <div className='checkBtn' onClick={() => checkHandle(`${auditType}`)}>{auditType == '0' ? '审核' : '取消审核'}</div>
+        {
+          !ifBanAllAction && (
+            <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
+              <div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
+                <div className={(auditType == '0' && !disAccount) ? 'caculateBtn' : 'caculateBtn disabled'}
+                  onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
+                  onMouseLeave={() => set_ifShowTip(false)}
+                  onClick={() => (auditType == '0' && !disAccount) ? generateFunc() : () => { }}>计算</div>
+                <div className={auditType == '0' ? 'caculateBtn' : 'caculateBtn disabled'}
+                  onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
+                  onMouseLeave={() => set_ifShowTip(false)}
+                  onClick={() => auditType == '0' ? exportHandle() : () => { }}>导出</div>
+              </div>
+            </Popover>
+          )
+        }
+
+        {!ifBanAllAction&&<div className='checkBtn' onClick={() => checkHandle(`${auditType}`)}>{auditType == '0' ? '审核' : '取消审核'}</div>}
       </div>
       <div className='content'>
         <Tabs

+ 18 - 5
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-07-06 17:45:44
+ * @LastEditTime: 2023-07-21 17:53:26
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/personnelSalaryBudget/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -23,6 +23,7 @@ import conformIcon from '../../../../static/confirmIcon.png';
 import './style.less';
 import '../../../utils/zhongtaiB'
 import { formatMoneyNumber } from '@/utils/format';
+import { getJiezhuanStatus } from '../monthlySet/service';
 
 const IconFont = createFromIconfontCN({
     scriptUrl: '',
@@ -45,6 +46,8 @@ const PersonnelSalaryBudget = () => {
 
     const [loading, set_loading] = useState(false);
 
+    const [ifBanAllAction, set_ifBanAllAction] = useState(true);  //是否掩藏所有操作
+
     const tableColumn: ProColumns[] = [
         {
             title: '职类',
@@ -249,9 +252,19 @@ const PersonnelSalaryBudget = () => {
 
     }
 
+    const getJiezhuanStatusHandle =async () => {
+        const resp = await getJiezhuanStatus(currentComputeDate as string);
+        if(resp == 2){
+              set_ifBanAllAction(true);
+        }else{
+              set_ifBanAllAction(false);
+        }
+    }
+
 
     useEffect(() => {
         currentComputeDate && getCheckStatus(currentComputeDate);
+        currentComputeDate && getJiezhuanStatusHandle();
     }, [currentComputeDate]);
 
 
@@ -264,7 +277,7 @@ const PersonnelSalaryBudget = () => {
 
     return (
         <BMSPagecontainer className='PersonnelSalaryBudget' title={`核算年月:${currentComputeDate}`} ghost>
-            <div className='checkBtn' onClick={() => checkHandle(`${auditType}`)}>{auditType == '0' ? '审核' : '取消审核'}</div>
+            {!ifBanAllAction&&<div className='checkBtn' onClick={() => checkHandle(`${auditType}`)}>{auditType == '0' ? '审核' : '取消审核'}</div>}
             <div className='paramsWrap'>
 
                 <div className='cardWrap'>
@@ -285,7 +298,7 @@ const PersonnelSalaryBudget = () => {
                 <div className='func'>
                     <div className='title'>
                         <span className='a'>全院人事成本(D=(A-B)*C)</span>
-                        <span className='btn' onClick={() => generateFunc(1)}> <IconFont style={{ color: '#3376FE' }} type='iconzhongxin' /> 重新生成</span>
+                        {!ifBanAllAction&&<span className='btn' onClick={() => generateFunc(1)}> <IconFont style={{ color: '#3376FE' }} type='iconzhongxin' /> 重新生成</span>}
                     </div>
                     <InputNumber className='input' size='large' min={-10000000} value={pageData.personalCost} placeholder='请输入'
                         disabled={auditType == '1'}
@@ -297,7 +310,7 @@ const PersonnelSalaryBudget = () => {
                 </div> */}
 
             </div>
-            <div className='countBtn' onClick={() => generateFunc(2)}>计算</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, {
                 title: '可分配考核奖金',
@@ -305,7 +318,7 @@ const PersonnelSalaryBudget = () => {
                 key: 'assessmentBonus',
                 fixed: 'right',
                 render: (text: any, record: any) => {
-
+                    if(ifBanAllAction)return text
                     return (
                         <div style={{ display: 'flex', flexDirection: 'row', width: '100%', justifyContent:'flex-start', alignItems: 'center' }}>
 

+ 280 - 0
src/pages/budgetMana/specialDataImport/index.tsx

@@ -0,0 +1,280 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-07-21 17:25:37
+ * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+
+
+import BMSPagecontainer from '@/components/BMSPageContainer';
+import { BMSTable } from '@/components/BMSTable';
+import { createFromIconfontCN } from '@ant-design/icons';
+
+import { ActionType } from '@ant-design/pro-components';
+import { ModalForm, ProFormDatePicker, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form'
+import { ProColumns } from '@ant-design/pro-table';
+import { Input, message, Popconfirm, DatePicker } from 'antd';
+import { useEffect, useRef, useState } from 'react'
+
+import { addData, afterImport, delData, editData, getData, getSpecialImportTable, tableDataImport } from './service';
+import FormItem from 'antd/es/form/FormItem';
+
+import './style.less';
+import '../../../utils/zhongtaiA'
+import moment from 'moment';
+import 'moment/locale/zh-cn';
+import locale from 'antd/es/date-picker/locale/zh_CN';
+import { getComputeDate } from '@/pages/Home/service';
+import BMSUpload from '@/components/BMSUpload';
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
+
+
+export default function DicClassfication() {
+
+    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
+    const [currentComputeDate, set_currentComputeDate] = useState<string | undefined>(undefined);
+    const tableRef = useRef<ActionType>();
+
+
+
+
+    const columns: ProColumns[] = [
+
+        {
+            title: '所属年月',
+            dataIndex: 'computeDate',
+            ellipsis: true
+        },
+        {
+            title: '数据库表名称',
+            dataIndex: 'tableNameDisplay',
+            ellipsis: true
+        },
+        {
+            title: '文件名称',
+            dataIndex: 'fileName',
+            ellipsis: true,
+            renderText(text, record, index, action) {
+                return <a href={record.url} target='_blank'>{record.fileName}</a>
+            },
+        },
+        {
+            title: '导入时间',
+            dataIndex: 'createTime',
+            ellipsis: true
+        },
+        {
+            title: '导入人员',
+            dataIndex: 'createUserName',
+            ellipsis: true
+        },
+        {
+            title: '操作',
+            key: 'option',
+            width: 120,
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                return [
+                    <Popconfirm
+                        title={`是否${record.importStatus == 1?'复原导入':'撤销导入'}?`}
+                        key="del"
+                        onConfirm={() => afterImportHandle(record)}
+                    >
+                        <a>{record.importStatus == 1?'复原导入':'撤销导入'}</a>
+                    </Popconfirm>
+                ]
+            },
+        },
+
+    ];
+
+    const getCurrentComputeDate = async () => {
+        const resp = await getComputeDate();
+        set_currentComputeDate(resp);
+        //set_tableDataFilterParams({...tableDataFilterParams,computeDate:resp})
+    }
+
+    const afterImportHandle =async (record:any) => {
+         const {importStatus} = record;
+         const resp = await afterImport(record.id,importStatus?'RECOVERY':'CANCEL');
+         if(resp){
+            message.success('操作成功!');
+            tableRef.current?.reload();
+         }
+    }
+
+
+    const getTableData = async (params: any) => {
+        const { computeDate } = params;
+        const resp = await getData({ ...params, computeDate: computeDate ? computeDate : currentComputeDate });
+        if (resp) {
+            return {
+                data: resp.list,
+                success: true,
+                total: resp.totalCount,
+                pageSize: resp.pageSize,
+                totalPage: resp.totalPage,
+            }
+        }
+        return []
+    }
+
+
+    const importData = () => {
+
+        function downloadTemplate(): void {
+           
+        }
+
+        return (
+            <ModalForm
+                className='SpecialDataImport-Modal'
+                width={360}
+                title={`导入数据`}
+                trigger={
+                    <span key="3" className='importBtn'>导入</span>
+                }
+                submitter={{
+                    render: (props, defaultDoms) => {
+                        const needBtn = defaultDoms.filter((b) => {
+                            return b.key != 'rest'
+                        })
+                        return [
+                            ...needBtn,
+                        ];
+                    },
+                }}
+                onFinish={async (values) => {
+                    // console.log({values});
+                    const { importFile: { fileList } } = values;
+
+                    let formData = new FormData();
+                    formData.append('file', fileList[0].originFileObj);
+                    formData.append('computeDate', values.computeDate);
+                    formData.append('tableName', values.tableName);
+
+                    const resp = await tableDataImport(formData);
+
+                    if (resp) {
+                        tableRef.current?.reload();
+                        return true;
+                    }
+
+                }}
+            >
+                <div className='tip'>本操作为追加导入,会保留已有的数据并将文件的所有记录追加到数据表</div>
+                <ProFormDatePicker.Month label='所属年月' name='computeDate' width={326} rules={[{ required: true, message: '所属年月不能为空!' }]} />
+                <ProFormSelect label='数据库表名称' name='tableName' width={326}
+                    request={async () => {
+                        const resp = await getSpecialImportTable();
+                        if (resp) {
+                            return resp.list.map((a: any) => ({
+                                label: a.name,
+                                value: a.code
+                            }))
+                        }
+                        return []
+                    }}
+                    rules={[{ required: true, message: '数据库表名称不能为空!' }]} />
+                <FormItem name={'importFile'}>
+                    {currentComputeDate && <BMSUpload downloadTemplateFile={() => downloadTemplate()} ifShowTip={false} ifShowTemplateDownload={false} />}
+                </FormItem>
+
+            </ModalForm>
+        )
+    }
+
+    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
+
+        if (type == 'ADD') {
+            const resp = await addData({ ...formVal });
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+        }
+        if (type == 'EDIT') {
+            const resp = await editData({ ...formVal });
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+        }
+
+        return true;
+    }
+
+    const tableDataSearchHandle = (paramName: string) => {
+
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            [`${paramName}`]: tableDataSearchKeywords
+        })
+    }
+
+
+    useEffect(() => {
+        getCurrentComputeDate();
+    }, [])
+
+    return (
+        <BMSPagecontainer className='SpecialDataImport' title={`核算年月:${currentComputeDate}`}>
+            <div className='toolBar'>
+                <div className='filter'>
+                    <div className='filterItem'>
+                        {(<div className='search'>
+                            <span>所属年月:</span>
+                            <DatePicker
+                                onChange={(data, dateString) => {
+                                    set_tableDataFilterParams({ ...tableDataFilterParams, computeDate: dateString })
+                                }}
+                                picker='month'
+                                locale={locale}
+                                //defaultValue={moment(currentComputeDate, 'YYYY-MM')}
+                                format='YYYY-MM' placeholder="选择年月" />
+                        </div>)}
+                    </div>
+                    <div className='filterItem' style={{ marginLeft: 16 }}>
+                        <span className='label'>表名称:</span>
+                        <ProFormSelect
+                            noStyle
+                            allowClear
+                            placeholder="请选择"
+                            style={{ width: 160, marginRight: 16 }}
+                            request={async () => {
+                                const resp = await getSpecialImportTable();
+                                if (resp) {
+                                    return resp.list.map((a: any) => ({
+                                        label: a.name,
+                                        value: a.code
+                                    }))
+                                }
+                                return []
+                            }}
+                            fieldProps={{
+                                onChange(value, option) {
+                                    set_tableDataFilterParams({ ...tableDataFilterParams,tableName: value })
+                                },
+                            }}
+                        />
+                    </div>
+                </div>
+                <div className='btnGroup'>
+                    {importData()}
+                </div>
+            </div>
+            <div style={{ marginTop: 16 }}>
+                {currentComputeDate && <BMSTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params, sort, filter) => getTableData(params)} />}
+            </div>
+        </BMSPagecontainer>
+    )
+}

+ 103 - 0
src/pages/budgetMana/specialDataImport/service.ts

@@ -0,0 +1,103 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-07-21 17:21:40
+ * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+
+import { request } from 'umi';
+
+//获取table列表数据
+
+export type PubDicClassType = any
+
+
+export const getData = (params?:any) => {
+  return request('/performance/import/list', {
+    method: 'GET',
+    params:{...params}
+  });
+};
+
+
+//新增表格数据
+export type AddTableDataType = {
+  //hospId:number;
+  code:string;
+  name:string;
+  remark:string;
+}
+export const addData = (data:AddTableDataType) => {
+  return request('/performance/dict/addDictType', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+//编辑表格数据
+
+export const editData = (data:PubDicClassType) => {
+  return request('/performance/dict/editDictType', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (id:string) => {
+  return request('/performance/dict/deleteDictType', {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+//获取特殊导入数据表
+
+export const getSpecialImportTable = () => {
+  return request('/performance/dict/getDictDataList?current=1&pageSize=500&typeCode=SPECIAL_SHEET_MAP', {
+    method: 'GET',
+  });
+};
+
+
+//数据导入
+
+export const tableDataImport = (data:any) => {
+  return request('/performance/import', {
+    method: 'POST',
+    data
+  });
+};
+
+//导入后的撤销/复原操作
+
+export const afterImport = (id:number,type:'CANCEL'|'RECOVERY') => {
+  if(type == 'CANCEL'){
+    return request('/performance/import/removeImport', {
+      method: 'POST',
+      params:{id}
+    });
+  }
+  if(type == 'RECOVERY'){
+    return request('/performance/import/recoverImport', {
+      method: 'POST',
+      params:{id}
+    });
+  }
+  
+};
+
+
+
+
+
+
+
+
+

+ 56 - 0
src/pages/budgetMana/specialDataImport/style.less

@@ -0,0 +1,56 @@
+.SpecialDataImport-Modal {
+  .tip {
+    font-size: 12px;
+    color: #FF9933;
+    line-height: 16px;
+    background: #FFF9F2;
+    padding: 8px 8px;
+    border-radius: 4px;
+    margin-bottom: 16px;
+  }
+}
+
+.SpecialDataImport {
+  padding: 16px;
+  background: #FFFFFF;
+  border-radius: 4px;
+
+
+  .toolBar {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: 16px;
+
+    .filter {
+      display: flex;
+      flex-direction: row;
+      justify-content: flex-start;
+      align-items: center;
+
+      .filterItem {
+        display: flex;
+        flex-direction: row;
+        justify-content: center;
+        align-items: center;
+      }
+    }
+
+    .btnGroup {
+      .importBtn {
+        cursor: pointer;
+        display: inline-block;
+        font-size: 14px;
+        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+        font-weight: 400;
+        color: #FFFFFF;
+        line-height: 24px;
+        padding: 0 14px;
+        background: #3377FF;
+        border-radius: 4px;
+      }
+    }
+
+  }
+}

+ 47 - 29
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-06-16 13:39:07
+ * @LastEditTime: 2023-07-21 17:57:58
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -37,6 +37,7 @@ import { ColumnsType } from 'antd/es/table';
 import { TableRowSelection } from 'antd/es/table/interface';
 import { difference } from 'lodash';
 import { getCurrentCheckStatus } from '@/services/auth';
+import { getJiezhuanStatus } from '@/pages/budgetMana/monthlySet/service';
 
 
 
@@ -76,7 +77,9 @@ const EmployeeInfoCheck: React.FC = () => {
     const [searchValue, setSearchValue] = useState('');
     const [autoExpandParent, setAutoExpandParent] = useState(true);
 
-    const [auditType,set_auditType] = useState('0');  //审核状态
+    const [auditType, set_auditType] = useState('0');  //审核状态
+
+    const [ifBanAllAction, set_ifBanAllAction] = useState(true);  //是否掩藏所有操作
 
 
 
@@ -230,7 +233,7 @@ const EmployeeInfoCheck: React.FC = () => {
         Modal.confirm({
             title: '添加人员',
             icon: <></>,
-            width:640,
+            width: 640,
             okText: '确定',
             cancelText: '取消',
             content: <TableTransfer
@@ -345,7 +348,7 @@ const EmployeeInfoCheck: React.FC = () => {
                             size="small"
                             bordered={false}
                             rowKey={'empNo'}
-                            pagination={{ showTitle: false, pageSize:9, showLessItems: false, simple: true,showTotal:()=>false}}
+                            pagination={{ showTitle: false, pageSize: 9, showLessItems: false, simple: true, showTotal: () => false }}
                             tableAlertRender={false}
                             style={{ pointerEvents: listDisabled ? 'none' : undefined }}
                             onRow={({ empNo, disabled: itemDisabled }) => ({
@@ -392,7 +395,7 @@ const EmployeeInfoCheck: React.FC = () => {
             title: '注意',
             okText: '确定',
             cancelText: '取消',
-            content: `${commitStatus == '1'?'取消提交':'提交'}当前选择的核算单元的数据?`,
+            content: `${commitStatus == '1' ? '取消提交' : '提交'}当前选择的核算单元的数据?`,
             onOk: async () => {
                 const resp = await commitRequest({
                     computeDate: currentComputeDate as string,
@@ -477,11 +480,21 @@ const EmployeeInfoCheck: React.FC = () => {
         set_treeData(resp);
     }
 
+    const getJiezhuanStatusHandle = async () => {
+        const resp = await getJiezhuanStatus(currentComputeDate as string);
+        if (resp == 2) {
+            set_ifBanAllAction(true);
+        } else {
+            set_ifBanAllAction(false);
+        }
+    }
+
     useEffect(() => {
 
         if (currentComputeDate) {
             getTreeReqFunc(currentComputeDate);
             getCheckStatus(currentComputeDate);
+            getJiezhuanStatusHandle();
         }
     }, [currentComputeDate]);
 
@@ -500,10 +513,10 @@ const EmployeeInfoCheck: React.FC = () => {
         //初始化左侧树结构数据后
 
         if (treeData?.length > 0) {
-            if(!currentSelectedTreeNode){
+            if (!currentSelectedTreeNode) {
                 if (treeData[0].child && treeData[0].child.length > 0) {
                     const [node, nodeParent] = getDeepestTreeData(treeData[0], 'child');
-    
+
                     set_currentSelectedTreeNode(node);
                     setExpandedKeys([nodeParent.code]);
                     getCurrentCommitStatus();
@@ -513,13 +526,13 @@ const EmployeeInfoCheck: React.FC = () => {
     }, [treeData]);
 
 
-    useEffect(()=>{
-          console.log({auditType});
-          if(auditType == '1'){
-                //当审核中时,禁掉所有操作
-                set_commitStatus('1');
-          }
-    },[auditType])
+    useEffect(() => {
+        console.log({ auditType });
+        if (auditType == '1') {
+            //当审核中时,禁掉所有操作
+            set_commitStatus('1');
+        }
+    }, [auditType])
 
     useEffect(() => {
         set_tableColumn(column as ProColumns[]);
@@ -585,7 +598,7 @@ const EmployeeInfoCheck: React.FC = () => {
 
                                     }}>
                                         {title}
-                                        {!nodeData.map&&<span className={nodeData.unitType?'point lastChild':'point'}></span>}
+                                        {!nodeData.map && <span className={nodeData.unitType ? 'point lastChild' : 'point'}></span>}
                                     </div>
                                 }
                             }
@@ -621,20 +634,25 @@ const EmployeeInfoCheck: React.FC = () => {
                             </div>
 
                             <div className='btnGroupWrap'>
-                                <Popover open={ifShowTip} content={auditType == '1'?'当前处于审核中,无法操作!':'当前处于提交中,无法操作!'} >
-                                    <div className={commitStatus != '0' || auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
-                                        /**
-                                         * 当审核中,三个操作按钮都不可点击
-                                         * 当非审核中,生成和添加不可操作
-                                         */
-                                        onMouseEnter={() => auditType == '0' ? commitStatus == '1'?set_ifShowTip(true):set_ifShowTip(false)  : set_ifShowTip(true)}
-                                        onMouseLeave={() => set_ifShowTip(false)}
-                                    >
-                                        <span key="2" onClick={commitStatus == '0'&&auditType != '1' ? () => generateFunc() : () => { }}>生成</span>
-                                        <span key="3" onClick={commitStatus == '0'&&auditType != '1' ? () => addPersonFunc() : () => { }}>添加</span>
-                                    </div>
-                                </Popover>
-                                <div key="4" className={auditType == '1'?'commit disabled':'commit'} onClick={() => auditType == '0'?commitBtnhandle():()=>{}}>{commitStatus == '1' ? '取消提交' : '提交'}</div>
+                                {
+                                    !ifBanAllAction && (
+                                        <Popover open={ifShowTip} content={auditType == '1' ? '当前处于审核中,无法操作!' : '当前处于提交中,无法操作!'} >
+                                            <div className={commitStatus != '0' || auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
+                                                /**
+                                                 * 当审核中,三个操作按钮都不可点击
+                                                 * 当非审核中,生成和添加不可操作
+                                                 */
+                                                onMouseEnter={() => auditType == '0' ? commitStatus == '1' ? set_ifShowTip(true) : set_ifShowTip(false) : set_ifShowTip(true)}
+                                                onMouseLeave={() => set_ifShowTip(false)}
+                                            >
+                                                <span key="2" onClick={commitStatus == '0' && auditType != '1' ? () => generateFunc() : () => { }}>生成</span>
+                                                <span key="3" onClick={commitStatus == '0' && auditType != '1' ? () => addPersonFunc() : () => { }}>添加</span>
+                                            </div>
+                                        </Popover>
+                                    )
+                                }
+
+                                {!ifBanAllAction&&<div key="4" className={auditType == '1' ? 'commit disabled' : 'commit'} onClick={() => auditType == '0' ? commitBtnhandle() : () => { }}>{commitStatus == '1' ? '取消提交' : '提交'}</div>}
                             </div>
 
                         </div>

+ 37 - 17
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-06-09 09:56:32
+ * @LastEditTime: 2023-07-21 17:59:16
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -37,6 +37,7 @@ import { getDeepestTreeData } from '@/utils/tooljs';
 
 import { getCheckUnitDepMapTableDataByUnitClass } from '@/pages/setting/checkUnitSet/checkUnitDepMap/service';
 import { getPersonInfoTableData } from '../employeeInfoCheck/service';
+import { getJiezhuanStatus } from '@/pages/budgetMana/monthlySet/service';
 
 
 
@@ -84,6 +85,8 @@ const NonCheckProjectApprove: React.FC = () => {
 
     const tableRef = useRef<ActionType>();
 
+    const [ifBanAllAction, set_ifBanAllAction] = useState(true);  //是否掩藏所有操作
+
 
     const column: ProColumns[] = [
         {
@@ -319,8 +322,8 @@ const NonCheckProjectApprove: React.FC = () => {
                                         const resp = await getPersonInfoTableData({
                                             computeDate: currentComputeDate as string,
                                             unitCode: currentSelectedTreeNode.code,
-                                            pageSize:500,
-                                            current:1
+                                            pageSize: 500,
+                                            current: 1
                                         });
 
                                         if (resp) {
@@ -465,11 +468,21 @@ const NonCheckProjectApprove: React.FC = () => {
         set_treeData(resp);
     }
 
+    const getJiezhuanStatusHandle = async () => {
+        const resp = await getJiezhuanStatus(currentComputeDate as string);
+        if (resp == 2) {
+            set_ifBanAllAction(true);
+        } else {
+            set_ifBanAllAction(false);
+        }
+    }
+
     useEffect(() => {
 
         if (currentComputeDate) {
             getTreeReqFunc(currentComputeDate);
             getCheckStatus(currentComputeDate);
+            getJiezhuanStatusHandle();
         }
     }, [currentComputeDate]);
 
@@ -608,20 +621,27 @@ const NonCheckProjectApprove: React.FC = () => {
                             </div>
 
                             <div className='btnGroupWrap'>
-                                <Popover open={ifShowTip} content={auditType == '1' ? '当前处于审核中,无法操作!' : '当前处于提交中,无法操作!'} >
-                                    <div className={commitStatus != '0' || auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
-                                        /**
-                                         * 当审核中,三个操作按钮都不可点击
-                                         * 当非审核中,生成和添加不可操作
-                                         */
-                                        onMouseEnter={() => auditType == '0' ? commitStatus == '1' ? set_ifShowTip(true) : set_ifShowTip(false) : set_ifShowTip(true)}
-                                        onMouseLeave={() => set_ifShowTip(false)}
-                                    >
-                                        {(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>
+                                {
+                                    !ifBanAllAction && (
+                                        <>
+                                            <Popover open={ifShowTip} content={auditType == '1' ? '当前处于审核中,无法操作!' : '当前处于提交中,无法操作!'} >
+                                                <div className={commitStatus != '0' || auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
+                                                    /**
+                                                     * 当审核中,三个操作按钮都不可点击
+                                                     * 当非审核中,生成和添加不可操作
+                                                     */
+                                                    onMouseEnter={() => auditType == '0' ? commitStatus == '1' ? set_ifShowTip(true) : set_ifShowTip(false) : set_ifShowTip(true)}
+                                                    onMouseLeave={() => set_ifShowTip(false)}
+                                                >
+                                                    {(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>
+                                        </>
+                                    )
+                                }
+
                             </div>
 
                         </div>

+ 46 - 64
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-10 16:47:40
+ * @LastEditTime: 2023-07-24 10:02:32
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -43,40 +43,9 @@ import { getParamsData } from '@/pages/setting/baseSetting/paramsMana/service';
 import 'moment/locale/zh-cn';
 import locale from 'antd/es/date-picker/locale/zh_CN';
 import moment from 'moment';
+import { getJiezhuanStatus } from '@/pages/budgetMana/monthlySet/service';
 
 
-const DatePickerLocale = {
-    lang: {
-      placeholder: '请选择日期',
-      rangePlaceholder: ['开始日期', '结束日期'],
-      today: '今天',
-      now: '此刻',
-      backToToday: '回到今天',
-      ok: '确定',
-      clear: '清除',
-      month: '月',
-      year: '年',
-      timeSelect: '选择时间',
-      dateSelect: '选择日期',
-      weekSelect: '选择周',
-      monthSelect: '选择月份',
-      yearSelect: '选择年份',
-      decadeSelect: '选择十年',
-      yearFormat: 'YYYY',
-      dateFormat: 'M/D/YYYY',
-      dayFormat: 'D',
-      dateTimeFormat: 'M/D/YYYY HH:mm:ss',
-      monthFormat: 'MMMM',
-      weekFormat: 'wo',
-      quarterFormat: '[Q]Q-YYYY',
-      // 其他翻译...
-    },
-    timePickerLocale: {
-      placeholder: '请选择时间',
-      // 其他翻译...
-    },
-  };
-
 
 const SearchIcon = createFromIconfontCN({
     scriptUrl: '',
@@ -134,6 +103,8 @@ const SecondaryDitriComputed: React.FC = () => {
     const [currentTreeDataFilter, set_currentTreeDataFilter] = useState({ name: '全部单元', code: 0 });
     const [treeFilterVisible, set_treeFilterVisible] = useState(false);
 
+    const [ifBanAllAction, set_ifBanAllAction] = useState(true);  //是否掩藏所有操作
+
 
     const column: ProColumns[] = [
         // {
@@ -430,38 +401,16 @@ const SecondaryDitriComputed: React.FC = () => {
                 const needParamsVal = checkCondition.list.filter(a => a.code == '1664510428258115584'); //判断未提交是否可以审核
                 if (needParamsVal.length > 0) {
                     if (needParamsVal[0].value == '0') {
-                        //需要提交后才可以审核
-                        // console.log(checkIfCommit(type));
-                        // if (checkIfCommit(type)) {
-                        //     handle(needParamsVal[0].value);
-                        // }else{
-                        //     Modal.confirm({
-                        //         title: '注意',
-                        //         okText: '确定',
-                        //         cancelText: '取消',
-                        //         content:type == 1 ? '当前核算单元未提交,请提交后再审核!':'当前存在核算单元未提交,请提交后再审核!'
-                        //     })
-                        // }
                         handle(needParamsVal[0].value);
                     } else {
                         handle(needParamsVal[0].value);
-                        // if (checkIfCommit(type)) {
-                        //     handle(needParamsVal[0].value);
-                        // }else{
-                        //     Modal.confirm({
-                        //         title: '注意',
-                        //         okText: '确定',
-                        //         cancelText: '取消',
-                        //         content:type == 1 ? '当前核算单元未提交,是否继续审核?':'当前存在核算单元未提交,是否继续审核?',
-                        //         onOk:()=>handle(needParamsVal[0].value)
-                        //     })
-                        // }
                     }
                 }
             }
 
         } else {
-            if (pageData.leftTotal == 0) {
+          
+            if (commitStatus == '1') {
                 Modal.confirm({
                     title: '注意',
                     okText: '确定',
@@ -482,11 +431,34 @@ const SecondaryDitriComputed: React.FC = () => {
 
                 })
             } else {
-                Modal.confirm({
-                    title: '提交时需有单元的剩余分配金额必须是0',
-                    okText: '确定',
-                    cancelText: '取消',
-                })
+
+                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();
+                            }
+                        }
+    
+                    })
+                }
             }
 
         }
@@ -627,11 +599,21 @@ const SecondaryDitriComputed: React.FC = () => {
         }
     }
 
+    const getJiezhuanStatusHandle = async () => {
+        const resp = await getJiezhuanStatus(currentComputeDate as string);
+        if (resp == 2) {
+            set_ifBanAllAction(true);
+        } else {
+            set_ifBanAllAction(false);
+        }
+    }
+
     useEffect(() => {
 
         if (currentComputeDate) {
             getTreeReqFunc(currentComputeDate, ifCheckPage ? '1' : '0');
             getCheckStatus(currentComputeDate);
+            getJiezhuanStatusHandle();
 
         }
     }, [currentComputeDate]);
@@ -858,7 +840,7 @@ const SecondaryDitriComputed: React.FC = () => {
 
                             <div className='btnGroupWrap'>
                                 {
-                                    !ifCheckPage && (
+                                    (!ifCheckPage&&!ifBanAllAction) && (
                                         //计算界面
                                         <>
                                             <Popover open={ifShowTip} content={auditType == '1' ? '当前处于审核中,无法操作!' : '当前处于提交中,无法操作!'} >
@@ -882,7 +864,7 @@ const SecondaryDitriComputed: React.FC = () => {
                                     )
                                 }
                                 {
-                                    ifCheckPage && userFunctionInThispage && (userFunctionInThispage.findIndex((a: { code: string, name: string }) => a.code == 'audit') != -1) && (
+                                    !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>

+ 17 - 12
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-19 10:30:59
+ * @LastEditTime: 2023-07-19 14:44:17
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -233,17 +233,22 @@ const CheckUnitDepMap: React.FC = () => {
                 
                 let defaultSelctedkeys:string[] = [];
 
-                const resp2:any = await getTableData('CHARGE',{pageSize:500,current:1},{},{});
-
-                if(resp2){
-                    defaultSelctedkeys = resp2.data.map((item: any) => item.userId);
-                    console.log({defaultSelctedkeys,resp2});
-                }
+                if (currentSelectedTreeNode) {
+                    const resp2 = await getCheckUnitEmpMapTableDataByUnitClass({
+                        pageSize:500,
+                        current:1,
+                        empName:'',
+                        unitCode: currentSelectedTreeNode.code,
         
-                set_datasource([...resp,...tableData]);
-
-                setTargetKeys(defaultSelctedkeys);
-
+                    });
+                    if(resp2){
+                        defaultSelctedkeys = resp2.list.map((item: any) => item.userId);
+                        // console.log({defaultSelctedkeys,resp2});
+                        setTargetKeys([...defaultSelctedkeys]);
+                        set_datasource([...resp,...resp2.list]);
+                        
+                    }
+                }
             }
         }
 
@@ -297,7 +302,7 @@ const CheckUnitDepMap: React.FC = () => {
                 targetKeys={targetKeys}
                 selectedKeys={selectedKeys}
                 filterOption={(inputValue, item) => {
-                    return item.deptName!.indexOf(inputValue) !== -1
+                    return item.name!.indexOf(inputValue) !== -1
 
                 }}
             >

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

@@ -4,7 +4,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-16 09:42:52
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-07-06 15:22:46
+ * @LastEditTime: 2023-07-24 10:32:48
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -205,7 +205,7 @@ const CheckUnitProjectSet: React.FC = () => {
             dataIndex: 'orderPointValue',
             renderText(text, record, index, action) {
                 if (ifEdit && currentEditRow?.id == record.id) {
-                    return <ProFormDigit noStyle fieldProps={{
+                    return <ProFormDigit min={-99999} noStyle fieldProps={{
                         defaultValue: text, onChange(value) {
                             console.log({ value, currentEditRow });
                             if (value && currentEditRow) {

+ 259 - 109
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-07-19 10:52:42
+ * @LastEditTime: 2023-07-21 17:09:36
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -19,10 +19,10 @@ import { createFromIconfontCN } from '@ant-design/icons';
 import { ActionType, ProForm, ProFormRadio } from '@ant-design/pro-components';
 import { ModalForm, ProFormCascader, ProFormDependency, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form'
 import { ProColumns } from '@ant-design/pro-table';
-import { Input, message, Popconfirm } from 'antd';
+import { Input, message, Popconfirm,InputNumber,Form } from 'antd';
 import { useEffect, useRef, useState } from 'react'
 
-import { addData, delData, editData, gainData, getSecondaryProjectDistriData } from './service';
+import { addData, addLevelSets, delData, editData, gainData, getDefaultIndicator, getSecondaryProjectDistriData } from './service';
 
 import './style.less';
 import '../../../../utils/zhongtaiB';
@@ -31,6 +31,10 @@ const IconFont = createFromIconfontCN({
     scriptUrl: '',
 });
 
+const AddIconFont = createFromIconfontCN({
+    scriptUrl: '',
+});
+
 
 
 export default function BilingProjectMana() {
@@ -42,7 +46,7 @@ export default function BilingProjectMana() {
 
 
 
-    const columns:ProColumns[] = [
+    const columns: ProColumns[] = [
 
         {
             title: '项目代码',
@@ -67,17 +71,27 @@ export default function BilingProjectMana() {
         {
             title: 'SQL',
             dataIndex: 'sql',
-            width:400,
-            ellipsis:true
-            
+            width: 400,
+            ellipsis: true
+
         },
         {
             title: '操作',
             key: 'option',
-            width: 120,
+            width: 160,
             valueType: 'option',
             render: (_: any, record: any) => {
-                return [
+                return record.evaluation == 2 ? [
+                    <UpDataActBtn key={'SCORE'} record={record} type='SCORE' />,
+                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
+                    <Popconfirm
+                        title="是否确认删除?"
+                        key="del"
+                        onConfirm={() => delTableData(record)}
+                    >
+                        <a>删除</a>
+                    </Popconfirm>
+                ]:[
                     <UpDataActBtn key={'act'} record={record} type='EDIT' />,
                     <Popconfirm
                         title="是否确认删除?"
@@ -116,9 +130,19 @@ export default function BilingProjectMana() {
         }
     }
 
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
+    const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | 'SCORE') => {
 
-        const result = {
+        console.log({formVal});
+
+        const result = formVal.evaluation == 1? {
+            name: formVal.name,
+            evaluation: formVal.evaluation,
+            dataType: formVal.dataType,
+            source: formVal.source,
+            sql: formVal.sql,
+            ceiling:formVal.ceiling,
+            floor:formVal.floor
+        }:{
             name: formVal.name,
             evaluation: formVal.evaluation,
             dataType: formVal.dataType,
@@ -127,14 +151,24 @@ export default function BilingProjectMana() {
         }
 
         if (type == 'ADD') {
-            const resp = await addData({...result});
+            const resp = await addData({ ...result });
             if (resp) {
                 tableRef.current?.reload();
                 message.success('操作成功!');
             }
         }
         if (type == 'EDIT') {
-            const resp = await editData({id:formVal.id,...result});
+            const resp = await editData({ id: formVal.id, ...result });
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+        }
+
+        if (type == 'SCORE') {
+            const needData = formVal.secondItem.map((a:any)=>({levelName:a.levelName,levelRate:a.levelRate}))
+
+            const resp = await addLevelSets(formVal.secondItemCode,needData);
             if (resp) {
                 tableRef.current?.reload();
                 message.success('操作成功!');
@@ -154,113 +188,229 @@ export default function BilingProjectMana() {
         }
     }
 
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
+    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'SCORE' }) => {
+
+        const [scoreList, set_scoreList] = useState<any[]>([]);
+        const [scoreInitList, set_scoreInitList] = useState({});
+
+        const addIndicator = () => {
+
+            const key = Math.random();
+
+            const temp = [...scoreList, { tempId: key, id: key, [`levelName${key}`]: '', [`levelRate${key}`]: '' }];
+
+            set_scoreInitList({ ...scoreInitList, [`levelName${key}`]: '', [`levelRate${key}`]: '' });
+
+            set_scoreList([...temp]);
+
+        }
+
+        const delGroupIndic = (data: any, index: number) => {
+            let temp = [...scoreList];
+            let defaultFormData: { [key: string]: any } = {};
+            const result = temp.filter((a: any) => a.id != data.id);
+            result.forEach((a: any) => {
+                defaultFormData[`levelName${a.id}`] = a.levelName;
+                defaultFormData[`levelRate${a.id}`] = a.levelRate;
+            });
+
+            set_scoreInitList({ ...defaultFormData });
+            set_scoreList([...result]);
+        }
+
+        const getDefaultIndicatorHandle = async () => {
+            const resp = await getDefaultIndicator(record.code);
+            if(resp){
+                if (resp.length > 0) {
+                    let defaultFormData: { [key: string]: any } = {};
+                    const defaultVal = resp.map((a: any) => {
+                        defaultFormData[`levelName${a.id}`] = a.levelName;
+                        defaultFormData[`levelRate${a.id}`] = a.levelRate;
+                        return { ...a, tempId: Math.random() }
+                    });
+
+                    set_scoreInitList({ ...defaultFormData });
+            
+                    set_scoreList([...defaultVal]);
+                } else {
+                    set_scoreList([{}]);
+                }
+            }
+        }
+
+        
+        useEffect(() => {
+        
+            if (type == 'SCORE') {
+                getDefaultIndicatorHandle();
+                
+            }
+        },[record]);
 
         return (
             <ModalForm
-                title={`${type == 'EDIT' ? '编辑' : '新增'}二次分配项目`}
+                className='SecondaryProjectDistriSet-ModalForm'
+                title={`${type == 'EDIT' ? '编辑' : '新增'}${type == 'SCORE'?'级别':'二次分配项目'}`}
                 width={352}
-                initialValues={type == 'EDIT' ? { ...record } : {}}
+                initialValues={type == 'EDIT' ? { ...record } : type == 'SCORE'?{...scoreInitList}:{}}
                 trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
+                    type == 'EDIT' ? <a key="edit" >编辑</a> :type != 'SCORE'?<span className='add'>新增</span>:<a className='score'>评级设定</a>
                 }
                 onFinish={(val) => {
-                    console.log({val});
-                    return updateTable(type == 'EDIT' ? { ...record, ...val,sql:val.source == 2?val.sql:'-' } : { ...val }, type);
+                    return updateTable(type == 'EDIT' ? { ...record, ...val, sql: val.source == 2 ? val.sql : '-' } :type == 'SCORE'?{secondItem:scoreList,secondItemCode:record.code}:{ ...val }, type);
                 }}
                 modalProps={{ destroyOnClose: true }}
-                colProps={{ span: 24 }}
-                grid
+                // colProps={{ span: 24 }}
+                // grid
             >
 
-                <ProFormText
-                    name="name"
-                    label="项目名称:"
-                    placeholder="请输入"
-                    rules={[{ required: true, message: '名称不能为空!' }]}
-                />
-                <ProFormRadio.Group
-                    name="evaluation"
-                    label="评价方式:"
-                    fieldProps={{
-                        buttonStyle: 'solid'
-                    }}
-                    options={[
-                        {
-                            label: '评分',
-                            value: 1,
-                        },
-                        {
-                            label: '评级',
-                            value: 2,
-                        },
-                        {
-                            label: '直接给付',
-                            value: 3,
-                        }
-                    ]}
-                    rules={[{ required: true, message: '评价方式不能为空!' }]}
-                />
-                <ProFormDependency name={['evaluation']}>
-                     {
-                        ({evaluation})=> evaluation == 1&&(
-                            <div style={{display:'flex',flexDirection:'row',justifyContent:'space-between'}}>
-                                  <ProFormDigit name="count" label="评分下限:" colProps={{span:12}} rules={[{ required: true, message: '评价下限不能为空!' }]} />
-                                  <ProFormDigit name="count" label="评分上限:" colProps={{span:12}} rules={[{ required: true, message: '评价上限不能为空!' }]}/>
+{
+                    type == 'SCORE' && (
+                        <div>
+                            {
+                                scoreList.map((item: any, index: number) => {
+
+                                    return (
+                                        <div className='item' key={index}>
+                                            <ProFormText label='等级名称:'
+                                            name={`levelName${item.id}`}
+                                            fieldProps={{
+                                                
+                                                //   labelInValue:true,
+                                                onChange:(e)=>{
+                            
+                                                    const temp = [...scoreList];
+                                                    const newArr = temp.map((a: any) => {
+                                                        if (a.id == item.id) {
+                                                            return { ...a, levelName: e.target.value, }
+                                                        }
+                                                        return a
+                                                    });
+
+                                                    set_scoreList([...newArr]);
+                                                },
+                                            }}
+                                            width={160} />
+                                            <Form.Item name={`levelRate${item.id}`} label='占比(请输入小数):'>
+                                                <InputNumber
+                                                    style={{ width: 120, height: 24, position: 'relative', top: 0 }}
+                                                    onChange={(value) => {
+                                                        //console.log({value,index,indicatorData});
+                                                        const temp = [...scoreList];
+                                                        const newArr = temp.map((a: any) => {
+                                                            if (a.id == item.id) {
+                                                                return { ...a, levelRate: value }
+                                                            }
+                                                            return a
+                                                        });
+
+                                                        set_scoreList([...newArr]);
+                                                    }}
+                                                />
+                                            </Form.Item>
+                                            <span className='delIcon' onClick={() => delGroupIndic(item, index)}><IconFont   type="iconshanchu" /></span>
+                                        </div>
+                                    )
+                                })
+                            }
+                            <div className='addBtn' onClick={() => addIndicator()}>
+                                <AddIconFont type="icon-zengjia" style={{ color: '#3376FE' }} /><span>增加一行</span>
                             </div>
-                        )
-                     }
-                </ProFormDependency>
-                <ProFormRadio.Group
-                    name="dataType"
-                    label="数据格式:"
-                    fieldProps={{
-                        buttonStyle: 'solid'
-                    }}
-                    options={[
-                        {
-                            label: '数值',
-                            value: 1,
-                        },
-                        {
-                            label: '百分比',
-                            value: 2,
-                        }
-                    ]}
-                    rules={[{ required: true, message: '数据格式不能为空!' }]}
-                />
-                <ProFormRadio.Group
-                    name="source"
-                    label="数据来源:"
-                    fieldProps={{
-                        buttonStyle: 'solid'
-                    }}
-                    options={[
-                        {
-                            label: '填报',
-                            value: 1,
-                        },
-                        {
-                            label: '自动获取',
-                            value: 2,
-                        }
-                    ]}
-                    rules={[{ required: true, message: '数据来源不能为空!' }]}
-                />
-                <ProFormDependency name={['source']}>
-                     {
-                        ({source})=> source == 2&&(
-                            <ProFormTextArea
-                            name="sql"
-                            label="SQL:"
-                            placeholder="请输入"
-                            rules={[{ required:true, message: 'SQL不能为空!' }]}
-                        />
-                        )
-                     }
-                </ProFormDependency>
-                
-
+                        </div>
+                    )
+                }
+                {
+                    type != 'SCORE' && (
+                        <>
+                            <ProFormText
+                                name="name"
+                                label="项目名称:"
+                                placeholder="请输入"
+                                rules={[{ required: true, message: '名称不能为空!' }]}
+                            />
+                            <ProFormRadio.Group
+                                name="evaluation"
+                                label="评价方式:"
+                                fieldProps={{
+                                    buttonStyle: 'solid'
+                                }}
+                                options={[
+                                    {
+                                        label: '评分',
+                                        value: 1,
+                                    },
+                                    {
+                                        label: '评级',
+                                        value: 2,
+                                    },
+                                    {
+                                        label: '直接给付',
+                                        value: 3,
+                                    }
+                                ]}
+                                rules={[{ required: true, message: '评价方式不能为空!' }]}
+                            />
+                            <ProFormDependency name={['evaluation']}>
+                                {
+                                    ({ evaluation }) => evaluation == 1 && (
+                                        <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
+                                            <ProFormDigit name="floor" label="评分下限:" width={155} rules={[{ required: true, message: '评价下限不能为空!' }]} />
+                                            <ProFormDigit name="ceiling" label="评分上限:" width={155} rules={[{ required: true, message: '评价上限不能为空!' }]} />
+                                        </div>
+                                    )
+                                }
+                            </ProFormDependency>
+                            <ProFormRadio.Group
+                                name="dataType"
+                                label="数据格式:"
+                                fieldProps={{
+                                    buttonStyle: 'solid'
+                                }}
+                                options={[
+                                    {
+                                        label: '数值',
+                                        value: 1,
+                                    },
+                                    {
+                                        label: '百分比',
+                                        value: 2,
+                                    }
+                                ]}
+                                rules={[{ required: true, message: '数据格式不能为空!' }]}
+                            />
+                            <ProFormRadio.Group
+                                name="source"
+                                label="数据来源:"
+                                fieldProps={{
+                                    buttonStyle: 'solid'
+                                }}
+                                options={[
+                                    {
+                                        label: '填报',
+                                        value: 1,
+                                    },
+                                    {
+                                        label: '自动获取',
+                                        value: 2,
+                                    }
+                                ]}
+                                rules={[{ required: true, message: '数据来源不能为空!' }]}
+                            />
+                            <ProFormDependency name={['source']}>
+                                {
+                                    ({ source }) => source == 2 && (
+                                        <ProFormTextArea
+                                            name="sql"
+                                            label="SQL:"
+                                            placeholder="请输入"
+                                            rules={[{ required: true, message: 'SQL不能为空!' }]}
+                                        />
+                                    )
+                                }
+                            </ProFormDependency>
+                        </>
+                    )
+                }
             </ModalForm>
         )
     }
@@ -298,7 +448,7 @@ export default function BilingProjectMana() {
                         <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
                         <Input placeholder={'请输入项目名称'} allowClear
                             suffix={
-                                <IconFont style={{color:'#99A6BF'}} type="iconsousuo" onClick={() => tableDataSearchHandle('name')} />
+                                <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" onClick={() => tableDataSearchHandle('name')} />
                             }
                             onChange={(e) => {
                                 set_tableDataSearchKeywords(e.target.value);

+ 20 - 1
src/pages/setting/projectSetting/secondaryProjectDistribute/service.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 16:31:27
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-08 14:18:12
+ * @LastEditTime: 2023-07-21 17:04:23
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -86,6 +86,25 @@ export const delData = (id: string) => {
 };
 
 
+//根据项目code获取评级列表
+export const getDefaultIndicator = (secondItemCode:string) => {
+  return request<any[]>('/performance/secondSetting/getItemLevel', {
+    method: 'GET',
+    params:{secondItemCode}
+  });
+};
+
+//添加评级设定  addLevelSets
+export const addLevelSets = (secondItemCode:string,itemLevels:any[]) => {
+  return request<any[]>('/performance/secondSetting/saveItemLevel', {
+    method: 'POST',
+    data:{secondItemCode,itemLevels}
+  });
+};
+
+
+
+
 
 
 

+ 46 - 0
src/pages/setting/projectSetting/secondaryProjectDistribute/style.less

@@ -1,3 +1,49 @@
+.SecondaryProjectDistriSet-ModalForm {
+  .item {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+
+    .delIcon {
+      position: relative;
+      top:3px;
+      cursor: pointer;
+      display:flex;
+      justify-content: center;
+      align-items: center;
+      width: 24px;
+      height: 24px;
+      background: #FAFCFF;
+      border-radius: 4px;
+      border: 1px solid #DAE2F2;
+      .iconshanchu {
+        color: #17181A !important;
+        svg {
+          color: #17181A !important;
+        }
+      }
+    }
+  }
+  .addBtn {
+    cursor: pointer;
+    display: flex;
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+    width: 320px;
+    height: 40px;
+    background: #FFFFFF;
+    border-radius: 4px;
+    color: #3376FE;
+    border: 1px dashed #CFD6E6;
+
+    &>span {
+       margin-left: 8px;
+    }
+  }
+}
+
 .BilingProjectMana {
   padding: 16px;
   background: #FFFFFF;

+ 14 - 9
src/utils/tableToMultiHeaderExcel.ts

@@ -37,33 +37,36 @@ function getMaxDepth(columns: Column[]): number {
 
 
 
-function processColumns(columns: Column[], startRow = 0, startCol = 0, maxDepth = 0): { headers: any[][], merges: Merge[] } {
+function processColumns(columns: Column[], startRow = 0, startCol = 0, maxDepth = 0,colLength=0): { headers: any[][], merges: Merge[] } {
 
-    console.log({ columns });
+    let headers: any[][] = Array.from({ length: maxDepth }, () => Array(colLength).fill(''));
 
-    let headers: any[][] = Array.from({ length: maxDepth }, () => Array(columns.length).fill(''));
     let merges: Merge[] = [];
     let colIndex = startCol;
 
+    // console.log({columns});
+
     for (const column of columns) {
         let endRow = startRow;
         let endCol = colIndex;
 
         if (column.children) {
-            const result = processColumns(column.children, startRow + 1, colIndex, maxDepth);
 
-            console.log({colIndex,result});
-            console.log({headers,column});
+            const result = processColumns(column.children, startRow + 1, colIndex, maxDepth,colLength);
+
             headers = headers.map((row, i) => {
+                
                 if (i === startRow) {
                     return [...row.slice(0, colIndex), ...result.headers[i], ...row.slice(colIndex + result.headers[i].length)];
                 } else {
                     return [...row.slice(0, colIndex), ...result.headers[i].slice(colIndex, result.headers[i].length), ...row.slice(colIndex + result.headers[i].length)];
                 }
             });
+
             merges = [...merges, ...result.merges];
             endCol += getAllColumns(column.children).length - 1;  // 根据所有子列的总数来更新 endCol
             endRow = startRow;  // 父列的标题应该在子列标题的上一行
+
         } else {
             endRow = maxDepth - 1;
         }
@@ -71,11 +74,12 @@ function processColumns(columns: Column[], startRow = 0, startCol = 0, maxDepth
         for (let i = startRow; i <= endRow; i++) {
             headers[i][colIndex] = i === startRow ? column.title : '';
         }
-
+        
         merges.push({ s: { r: startRow, c: colIndex }, e: { r: endRow, c: endCol } });
         colIndex = endCol + 1;
     }
-   
+     
+    console.log({headers, merges,colIndex});
     return { headers, merges };
 }
 
@@ -106,7 +110,8 @@ function exportTableToMultiExcel(tableData: DataType[], columns: Column[], fileN
     }), needSummary ? Object.values(summary) : []];  // 如果需要汇总,那么在数据数组的末尾添加总结信息
 
     const maxDepth = getMaxDepth(columns);
-    const { headers, merges } = processColumns(columns, 0, 0, maxDepth);
+    const { headers, merges } = processColumns(columns, 0, 0, maxDepth,columns.length);
+
     const wb = XLSX.utils.book_new();
     const ws = XLSX.utils.aoa_to_sheet([...headers, ...dataValues]);