Переглянути джерело

修复发版前发现的问题

code4eat 2 роки тому
батько
коміт
b27ead56c5

+ 15 - 18
src/pages/secondaryDistribute/nonCheckProjectApprove/index.tsx

@@ -4,7 +4,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-16 09:42:52
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-23 13:30:17
+ * @LastEditTime: 2023-05-25 17:30:55
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -24,8 +24,8 @@ import closeIcon from '../../../../static/treenode_collapse.png';
 import { BMSTable } from '@/components/BMSTable';
 import { ActionType, ModalForm, ProColumns, ProFormDependency, ProFormDigit, ProFormInstance, ProFormRadio, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-components';
 import { createFromIconfontCN } from '@ant-design/icons';
-import { commitRequest,delRequest, generateDataRequest, getCurrentCommitStatusReq, getNonCheckProjectTableData, getTreeData, getTreeDataRespType, addNonCheckProjectTableData, editNonCheckProjectTableData } from './service';
-import { TransferItem, TransferProps } from 'antd/es/transfer';
+import { commitRequest,delRequest, generateDataRequest, getCurrentCommitStatusReq, getNonCheckProjectTableData, getTreeData, getTreeDataRespType, addNonCheckProjectTableData, editNonCheckProjectTableData, getNonCheckProjectByUnitCode, getCurrentCheckStatus } from './service';
+
 import { getComputeDate } from '@/pages/Home/service';
 
 
@@ -33,14 +33,11 @@ import 'dayjs/locale/zh-cn';
 import React from 'react';
 import DirectoryTree from 'antd/es/tree/DirectoryTree';
 import { getDeepestTreeData } from '@/utils/tooljs';
-import { ColumnsType } from 'antd/es/table';
-import { TableRowSelection } from 'antd/es/table/interface';
-import { difference } from 'lodash';
-import { getCurrentCheckStatus } from '@/services/auth';
-import { getDataByKeyFromDic, getPubDicData } from '@/services/getDic';
+
+
 import { getCheckUnitDepMapTableDataByUnitClass } from '@/pages/setting/checkUnitSet/checkUnitDepMap/service';
-import { getNonCheckTableData } from '@/pages/setting/projectSetting/checkUnitProjectSet/service';
-import { getEmps, getProjects } from '@/pages/budgetMana/monthlyDataCheck/service';
+
+import { getEmps } from '@/pages/budgetMana/monthlyDataCheck/service';
 
 
 
@@ -108,10 +105,10 @@ const NonCheckProjectApprove: React.FC = () => {
             title: '姓名',
             dataIndex: 'targetValueName',
         },
-        {
-            title: '来源',
-            dataIndex: 'source',
-        },
+        // {
+        //     title: '来源',
+        //     dataIndex: 'source',
+        // },
         {
             title: '说明',
             dataIndex: 'description',
@@ -159,7 +156,7 @@ const NonCheckProjectApprove: React.FC = () => {
     }
 
     const getCheckStatus = async (computeDate: string) => {
-        const resp = await getCurrentCheckStatus(computeDate);
+        const resp = await getCurrentCheckStatus({computeDate:currentComputeDate as string});
         if (resp) {
             set_auditType(`${resp}`);  //0 未审核 1 已审核
         }
@@ -273,10 +270,10 @@ const NonCheckProjectApprove: React.FC = () => {
                     placeholder="请选择"
                     rules={[{ required: true }]}
                     request={async () => {
-                        const resp = await getProjects();
+                        const resp = await getNonCheckProjectByUnitCode({unitCode:currentSelectedTreeNode.code});
                         if (resp) {
-                            return resp.map((a: any) => ({
-                                label: a.name, value: a.code, d: a
+                            return resp.list.map((a: any) => ({
+                                label: a.nonAssessmentName, value: a.nonAssessmentCode, d: a
                             }))
                         }
                         return []

+ 26 - 1
src/pages/secondaryDistribute/nonCheckProjectApprove/service.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-21 11:13:51
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-22 17:06:04
+ * @LastEditTime: 2023-05-25 17:28:52
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlyInfoCheck/service.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -56,6 +56,18 @@ export const getNonCheckProjectTableData = (params: GetNonCheckProjectParams) =>
 }
 
 
+//获取单元对应的可选非考核项目
+
+export const getNonCheckProjectByUnitCode = (params:{unitCode:string}) => {
+
+    return request('/performance/item/getUnitNonAssessmentList', {
+        method: 'GET',
+        params: { ...params }
+    })
+
+}
+
+
 
 //添加非考核项目
 export const addNonCheckProjectTableData = (data:{
@@ -110,6 +122,19 @@ export const getCurrentCommitStatusReq = (params:{
 }
 
 
+//获取当前审核状态
+export const getCurrentCheckStatus = (params:{
+    computeDate:string,
+}) => {
+
+    return request('/performance/kpi/getStatus', {
+        method: 'GET',
+        params: params
+    })
+
+}
+
+
 
 
 //删除

+ 52 - 54
src/pages/secondaryDistribute/secondaryDitriComputed/index.tsx

@@ -4,7 +4,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-16 09:42:52
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-05-25 15:54:48
+ * @LastEditTime: 2023-05-26 10:11:27
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -58,7 +58,7 @@ const SecondaryDitriComputed: React.FC = () => {
     const location = useLocation();
     const access = useAccess();
     const userFunctionInThispage = access.whatCanIDoInThisPage(location.pathname);
-    const [ifCheckPage,set_ifCheckPage] = useState(false); //是否为二次分配审核页面
+    const [ifCheckPage, set_ifCheckPage] = useState(false); //是否为二次分配审核页面
     const [treeData, set_treeData] = useState<getTreeDataRespType[]>([]);
     const [tableColumn, set_tableColumn] = useState<ProColumns[]>([]);
     const [currentSelectedTreeNode, set_currentSelectedTreeNode] = useState<any | undefined>();
@@ -114,10 +114,14 @@ const SecondaryDitriComputed: React.FC = () => {
     ];
 
 
-    const onSelect: TreeProps['onSelect'] = (selectedKeys, info) => {
+    const onSelect: TreeProps['onSelect'] = (selectedKeys, info:any) => {
         // console.log('selected', selectedKeys, info);
+
         const { node } = info;
-        set_currentSelectedTreeNode(node);
+        if(!node.child){
+            set_currentSelectedTreeNode(node);
+        }
+
     };
 
 
@@ -127,16 +131,9 @@ const SecondaryDitriComputed: React.FC = () => {
     }
 
     const getCheckStatus = async (computeDate: string) => {
-    
-        if (!ifCheckPage) {
-            //计算界面
-            const resp = await getCurrentCheckStatus(computeDate);
-            set_auditType(`${resp}`);  //0 未审核 1 已审核
-        } else {
-            //审核界面
-            const resp = await getCurrentCheckStatusReq(computeDate);
-            set_auditType(`${resp}`);  //0 未审核 1 已审核
-        }
+
+        const resp = await getCurrentCheckStatusReq(computeDate);
+        set_auditType(`${resp}`);  //0 未审核 1 已审核
 
     }
 
@@ -297,7 +294,7 @@ const SecondaryDitriComputed: React.FC = () => {
 
     const commitBtnhandle = async () => {
 
-        if(ifCheckPage){
+        if (ifCheckPage) {
             const resp = await checkRequest({
                 computeDate: currentComputeDate as string,
                 auditType: auditType == '1' ? '0' : '1',  //1 审核 0 取消审核
@@ -307,28 +304,35 @@ const SecondaryDitriComputed: React.FC = () => {
                 getTreeReqFunc(currentComputeDate as string);
                 getCheckStatus(currentComputeDate as string);
             }
-        }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);
-                        getCurrentCommitStatus();
+        } else {
+            if (pageData.leftTotal == 0) {
+                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);
+                            getCurrentCommitStatus();
+                        }
                     }
-                }
     
-            })
+                })
+            } else {
+                Modal.confirm({
+                    title: '提交时需有单元的剩余分配金额必须是0'
+                })
+            }
+            
         }
-        
+
     }
 
 
@@ -408,16 +412,10 @@ const SecondaryDitriComputed: React.FC = () => {
 
     const saveHandle = async () => {
 
-        if (pageData.leftTotal == 0) {
-            const resp = await save(needSaveData);
-            if (resp) {
-                message.success('操作成功!');
-                set_ifEditMode(false);
-            }
-        } else {
-            Modal.confirm({
-                title: '提交时需有单元的剩余分配金额必须是0'
-            })
+        const resp = await save(needSaveData);
+        if (resp) {
+            message.success('操作成功!');
+            set_ifEditMode(false);
         }
     }
 
@@ -433,11 +431,11 @@ const SecondaryDitriComputed: React.FC = () => {
         //tableRef.current?.reload();
 
         if (currentComputeDate && currentSelectedTreeNode) {
-            
-            if(!ifCheckPage){
+
+            if (!ifCheckPage) {
                 getCurrentCommitStatus();
             }
-            
+
             getTableData({});
         }
     }, [currentSelectedTreeNode, currentComputeDate]);
@@ -460,11 +458,11 @@ const SecondaryDitriComputed: React.FC = () => {
         }
     }, [treeData]);
 
-    useEffect(()=>{
-         if(location.pathname == "/secondaryDistribute/secondaryDitriCheck"){
+    useEffect(() => {
+        if (location.pathname == "/secondaryDistribute/secondaryDitriCheck") {
             set_ifCheckPage(true);
-         }else{set_ifCheckPage(false);}
-    },[location])
+        } else { set_ifCheckPage(false); }
+    }, [location])
 
     let timer: string | number | NodeJS.Timeout | undefined;
 
@@ -630,7 +628,7 @@ const SecondaryDitriComputed: React.FC = () => {
 
                             <div className='btnGroupWrap'>
                                 {
-                                !ifCheckPage && (
+                                    !ifCheckPage && (
                                         //计算界面
                                         <>
                                             <Popover open={ifShowTip} content={auditType == '1' ? '当前处于审核中,无法操作!' : '当前处于提交中,无法操作!'} >
@@ -652,8 +650,8 @@ const SecondaryDitriComputed: React.FC = () => {
                                     )
                                 }
                                 {
-                                    ifCheckPage&&(userFunctionInThispage.findIndex((a:{code:string,name:string})=>a.code == 'audit') != -1) && (
-                                        <div key="4" className={'commit'} onClick={() => commitBtnhandle() }>{auditType == '1' ? '取消审核' : '审核'}</div>
+                                    ifCheckPage && (userFunctionInThispage.findIndex((a: { code: string, name: string }) => a.code == 'audit') != -1) && (
+                                        <div key="4" className={'commit'} onClick={() => commitBtnhandle()}>{auditType == '1' ? '取消审核' : '审核'}</div>
                                     )
                                 }
 

+ 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-05-22 14:59:07
+ * @LastEditTime: 2023-05-26 10:13:15
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -907,7 +907,7 @@ const CheckUnitProjectSet: React.FC = () => {
     return (
         <div className='CheckUnitProjectSet'>
 
-            <ModalForm title={'复制'} width={400} submitter={{
+            <ModalForm title={`复制(${currentSelectedTreeNode?currentSelectedTreeNode.name:''})`} width={400} submitter={{
                 render: (props, defaultDoms) => []
             }} open={ifShowModal} modalProps={{
                 closable: false,

+ 36 - 32
src/pages/setting/projectSetting/costIncomeProjectSet/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-05-19 14:17:26
+ * @LastEditTime: 2023-05-26 10:21:13
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -60,7 +60,7 @@ export default function CostIncomeProjectSet() {
             title: '适应范围',
             dataIndex: 'scope',
             renderText(num, record, index, action) {
-                return `${record.opdFlag == 1 ? record.opdFlagName : ''}${(record.opdFlag ==1&&record.inpFlag==1)?' | ':''}${record.inpFlag == 1?record.inpFlagName : ''}`
+                return `${record.opdFlag == 1 ? record.opdFlagName : ''}${(record.opdFlag == 1 && record.inpFlag == 1) ? ' | ' : ''}${record.inpFlag == 1 ? record.inpFlagName : ''}`
             },
         },
         {
@@ -135,7 +135,6 @@ export default function CostIncomeProjectSet() {
             valueType: 'option',
             render: (_: any, record: any) => {
                 return record.summaryFlag ? [
-                    <UpDataActBtn key={'add'} type='ADD' text='添加' record={record} />,
                     <UpDataActBtn key={'act'} record={record} type='EDIT' />,
                     <Popconfirm
                         title="是否确认删除?"
@@ -143,7 +142,8 @@ export default function CostIncomeProjectSet() {
                         onConfirm={() => delTableData(record)}
                     >
                         <a>删除</a>
-                    </Popconfirm>
+                    </Popconfirm>,
+                    <UpDataActBtn key={'add'} type='ADD' text='添加' record={record} />
                 ] : [
                     <UpDataActBtn key={'act'} record={record} type='EDIT' />,
                     <Popconfirm
@@ -187,7 +187,7 @@ export default function CostIncomeProjectSet() {
     }
 
     const delTableData = async (record: any) => {
-        const resp = await delData(record.id,currentSelectedTabKey);
+        const resp = await delData(record.id, currentSelectedTabKey);
         if (resp) {
             message.success('操作成功!');
             tableRef.current?.reload();
@@ -199,7 +199,7 @@ export default function CostIncomeProjectSet() {
 
         console.log({ formVal });
 
-        if(currentSelectedTabKey == '1'){
+        if (currentSelectedTabKey == '1') {
             const result = {
                 name: formVal.name,
                 opdFlag: formVal.scope.includes('门诊') ? 1 : 0,
@@ -207,7 +207,7 @@ export default function CostIncomeProjectSet() {
                 statFlag: formVal.statFlag,
                 seqNo: formVal.seqNo
             }
-    
+
             if (type == 'ADD') {
                 const resp = await addIncomeData({ ...result });
                 if (resp) {
@@ -223,7 +223,7 @@ export default function CostIncomeProjectSet() {
                 }
             }
         }
-        if(currentSelectedTabKey == '2'){
+        if (currentSelectedTabKey == '2') {
             const result = {
                 name: formVal.name,
                 parentCode: formVal.parentCode,
@@ -233,7 +233,7 @@ export default function CostIncomeProjectSet() {
                 statFlag: formVal.statFlag,
                 seqNo: formVal.seqNo
             }
-    
+
             if (type == 'ADD') {
                 const resp = await addCostData({ ...result });
                 if (resp) {
@@ -251,7 +251,7 @@ export default function CostIncomeProjectSet() {
         }
 
 
-        
+
 
         return true;
     }
@@ -281,7 +281,7 @@ export default function CostIncomeProjectSet() {
                     type == 'EDIT' ? <a key="edit" >编辑</a> : <a className='add'>{text ? text : '新增'}</a>
                 }
                 onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val,parentCode:record.parentCode} : { ...val,parentCode:record.code?record.code:0 }, type);
+                    return updateTable(type == 'EDIT' ? { ...record, ...val, parentCode: record.parentCode } : { ...val, parentCode: record.code ? record.code : 0 }, type);
                 }}
                 modalProps={{ destroyOnClose: true }}
                 colProps={{ span: 24 }}
@@ -329,7 +329,7 @@ export default function CostIncomeProjectSet() {
                 }
 
                 {
-                    currentSelectedTabKey == '2'&&(
+                    currentSelectedTabKey == '2' && (
                         <>
                             <ProFormText
                                 name="name"
@@ -343,32 +343,36 @@ export default function CostIncomeProjectSet() {
                                 placeholder="请选择"
                                 options={[
                                     {
-                                        label:'人事成本',value:1
+                                        label: '人事成本', value: 1
                                     },
                                     {
-                                        label:'变动成本',value:2
+                                        label: '变动成本', value: 2
                                     },
                                     {
-                                        label:'固定成本',value:3
+                                        label: '固定成本', value: 3
                                     }
                                 ]}
                                 rules={[{ required: true, message: '类型不能为空!' }]}
                             />
-                            <ProFormRadio.Group
-                                name="summaryFlag"
-                                label="汇总:"
-                                options={[
-                                    {
-                                        label: '是',
-                                        value: 1,
-                                    },
-                                    {
-                                        label: '否',
-                                        value: 0,
-                                    }
-                                ]}
-                                placeholder="请选择"
-                            />
+                            {
+                                !record.children&&type == 'EDIT' && (
+                                    <ProFormRadio.Group
+                                        name="summaryFlag"
+                                        label="汇总:"
+                                        options={[
+                                            {
+                                                label: '是',
+                                                value: 1,
+                                            },
+                                            {
+                                                label: '否',
+                                                value: 0,
+                                            }
+                                        ]}
+                                        placeholder="请选择"
+                                    />
+                                )
+                            }
                             <ProFormRadio.Group
                                 name="ctrlFlag"
                                 label="可控:"
@@ -494,8 +498,8 @@ export default function CostIncomeProjectSet() {
                 </div>
             </div>
             <div style={{ marginTop: 16 }}>
-                {currentSelectedTabKey == '2'?(<BMSTable columns={columns as ProColumns[]} pagination={false}  actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />):(
-                    <BMSTable columns={columns as ProColumns[]}  actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                {currentSelectedTabKey == '2' ? (<BMSTable columns={columns as ProColumns[]} pagination={false} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />) : (
+                    <BMSTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
                 )}
             </div>
         </BMSPagecontainer>