code4eat 2 rokov pred
rodič
commit
41b186eb3c

+ 19 - 8
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-03-07 17:28:56
+ * @LastEditTime: 2023-03-07 19:16:36
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -494,11 +494,9 @@ const MonthlyDataCheck: React.FC = () => {
             }
             if (type == '3') {
 
-                const ifCalcCompleted = await getCalcStatus(); // 检查计算状态
+                
 
-                console.log({ifCalcCompleted});
-
-                if(ifCalcCompleted){
+                if(!loading){
                     //计算完和未计算
 
                     const resp = await getCheckProjectTableData({
@@ -515,7 +513,7 @@ const MonthlyDataCheck: React.FC = () => {
                             totalPage: resp.totalPage,
                         }
                     }
-                }  
+                }
             }
             if (type == '4') {
                 if (currentSelectedManaGroup) {
@@ -765,6 +763,7 @@ const MonthlyDataCheck: React.FC = () => {
     //获取数据
     const confirmGenerateHandle: any = async (index: number, others?: any) => {
 
+
         if (index == 3) {
             const resp = await generateCheckProjectTableData({
                 computeDate: currentComputeDate as string,
@@ -777,6 +776,7 @@ const MonthlyDataCheck: React.FC = () => {
                 tableRef.current?.reload();
             }
             return Promise.resolve(true);
+            
         }
     }
 
@@ -791,7 +791,7 @@ const MonthlyDataCheck: React.FC = () => {
                 cancelText: '',
                 closable: true,
                 content: others ? '获取单个操作会覆盖上次获取的该核算单元的数据,确定要继续操作?' : '获取所有操作会覆盖所有已获取的数据,确定要继续操作?',
-                onOk: () => { set_loading(true); confirmGenerateHandle(index, others ? others : false) }
+                onOk: () => { set_loading(true);confirmGenerateHandle(index,others) }
             })
         }
 
@@ -1026,6 +1026,15 @@ const MonthlyDataCheck: React.FC = () => {
     }
 
 
+    useEffect(()=>{
+         if(loading){
+               setInterval(()=>{
+                   getCalcStatus();
+               },60000)
+         }
+    },[loading])
+
+
 
     useEffect(() => {
         set_tableDataFilterParams({
@@ -1089,6 +1098,7 @@ const MonthlyDataCheck: React.FC = () => {
 
         if (currentComputeDate) {
             pageCheckStatusFunc(currentComputeDate);  //获取页面查核状态
+            getCalcStatus();
         }
 
     }, [currentComputeDate]);
@@ -1102,6 +1112,7 @@ const MonthlyDataCheck: React.FC = () => {
         window.addEventListener('resize',(e)=>handleResize(e)) //监听窗口大小改变
         doResize();
 
+
         return ()=>{
             window.removeEventListener('resize',(e)=>handleResize(e));
         }
@@ -1590,7 +1601,7 @@ const MonthlyDataCheck: React.FC = () => {
                                                             </div>
                                                         </Popover>
                                                     </div>
-                                                    {currentComputeDate && <BMSTable actionRef={tableRef} loading={{ spinning: loading, tip: '正在计算数据...' }} polling={loading?120000:undefined}  rowKey='id' params={tableDataFilterParams} columns={auditType == '0' ? [...tableColumn, {
+                                                    {currentComputeDate && <BMSTable actionRef={tableRef} loading={{ spinning: loading, tip: '正在计算数据...' }}   rowKey='id' params={tableDataFilterParams} columns={auditType == '0' ? [...tableColumn, {
                                                         title: '数值',
                                                         dataIndex: 'value',
                                                         key: 'value',