TonyKang 6 سال پیش
والد
کامیت
6545c09fa2
1فایلهای تغییر یافته به همراه80 افزوده شده و 15 حذف شده
  1. 80 15
      web/building_saas/report/js/rpt_main.js

+ 80 - 15
web/building_saas/report/js/rpt_main.js

@@ -587,9 +587,10 @@ let zTreeOprObj = {
         params.sum_rpt_names = bill_rpt_names.concat(glj_rpt_names);
         params.rpt_names = rpt_names;
         params.isOneSheet = true;
-
+        $.bootstrapLoading.start();
         CommonAjax.postEx("report_api/createExcelFiles", params, WAIT_TIME_EXPORT, true, function(result){
                 if (result) {
+                    $.bootstrapLoading.end();
                     let uuIdUrls = [];
                     for (let uuIdObj of result) {
                         let uuIdUrl =  "/report_api/getFileByUUID/" + uuIdObj.uuid + "/" + stringUtil.replaceAll(uuIdObj.reportName, "#", "_") + "/xlsx";
@@ -597,9 +598,17 @@ let zTreeOprObj = {
                     }
                     downloadReport(uuIdUrls);
                 } else {
-                    //
+                    $.bootstrapLoading.end();
                 }
-            }, null, null
+            },
+            function(failRst){
+                $.bootstrapLoading.end();
+                console.log(failRst);
+            },
+            function(exceptionRst){
+                $.bootstrapLoading.end();
+                console.log(exceptionRst);
+            }
         );
     },
     requestSumAndNormalRptForAllInOneExcel: function () {
@@ -608,17 +617,26 @@ let zTreeOprObj = {
         rptControlObj.getTplIdsCommon(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds, null, null, null);
         let params = rptControlObj.creatCommonExportParam(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds);
         params.rptName = orgRptName;
-
+        $.bootstrapLoading.start();
         CommonAjax.postEx("report_api/createExcelFilesInOneBook", params, WAIT_TIME_EXPORT, true, function(result){
                 if (result) {
+                    $.bootstrapLoading.end();
                     let uuIdUrls = [];
                     let uuIdUrl =  "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
                     uuIdUrls.push(uuIdUrl);
                     downloadReport(uuIdUrls);
                 } else {
-                    //
+                    $.bootstrapLoading.end();
                 }
-            }, null, null
+            },
+            function(failRst){
+                $.bootstrapLoading.end();
+                console.log(failRst);
+            },
+            function(exceptionRst){
+                $.bootstrapLoading.end();
+                console.log(exceptionRst);
+            }
         );
     },
     showPage: function (pageNum, canvas) {
@@ -759,17 +777,26 @@ let rptControlObj = {
             if (zTreeOprObj.selectedPrjIDs.length > 0 && (refBillSumPrjsIds.length > 0 || refGljSumPrjsIds.length > 0)) {
                 let params = rptControlObj.creatCommonExportParam(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds);
                 params.rptName = orgRptName;
-
+                $.bootstrapLoading.start();
                 CommonAjax.postEx("report_api/createExcelFilesInOneBook", params, WAIT_TIME_EXPORT, true, function(result){
                         if (result) {
+                            $.bootstrapLoading.end();
                             let uuIdUrls = [];
                             let uuIdUrl =  "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
                             uuIdUrls.push(uuIdUrl);
                             downloadReport(uuIdUrls);
                         } else {
-                            //
+                            $.bootstrapLoading.end();
                         }
-                    }, null, null
+                    },
+                    function(failRst){
+                        $.bootstrapLoading.end();
+                        console.log(failRst);
+                    },
+                    function(exceptionRst){
+                        $.bootstrapLoading.end();
+                        console.log(exceptionRst);
+                    }
                 );
             } else {
                 if (refBillSumPrjsIds.length > 0 || refGljSumPrjsIds.length > 0) {
@@ -788,16 +815,26 @@ let rptControlObj = {
                     params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
                     params.custCfg = zTreeOprObj.reportPageCfg;
                     params.option = "normal";
+                    $.bootstrapLoading.start();
                     CommonAjax.postEx("report_api/createExcelFilesInOneBook", params, WAIT_TIME_EXPORT, true, function(result){
                             if (result) {
+                                $.bootstrapLoading.end();
                                 let uuIdUrls = [];
                                 let uuIdUrl =  "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
                                 uuIdUrls.push(uuIdUrl);
                                 downloadReport(uuIdUrls);
                             } else {
-                                //
+                                $.bootstrapLoading.end();
                             }
-                        }, null, null
+                        },
+                        function(failRst){
+                            $.bootstrapLoading.end();
+                            console.log(failRst);
+                        },
+                        function(exceptionRst){
+                            $.bootstrapLoading.end();
+                            console.log(exceptionRst);
+                        }
                     );
                 }
             }
@@ -816,8 +853,10 @@ let rptControlObj = {
                 params.rpt_names = rpt_names;
                 params.isOneSheet = true;
                 params.rptName = projectObj.project.projectInfo.name;
+                $.bootstrapLoading.start();
                 CommonAjax.postEx("report_api/createExcelFiles", params, WAIT_TIME_EXPORT, true, function(result){
                         if (result) {
+                            $.bootstrapLoading.end();
                             let uuIdUrls = [];
                             for (let uuIdObj of result) {
                                 let uuIdUrl =  "/report_api/getFileByUUID/" + uuIdObj.uuid + "/" + stringUtil.replaceAll(uuIdObj.reportName, "#", "_") + "/xlsx";
@@ -825,9 +864,17 @@ let rptControlObj = {
                             }
                             downloadReport(uuIdUrls);
                         } else {
-                            //
+                            $.bootstrapLoading.end();
                         }
-                    }, null, null
+                    },
+                    function(failRst){
+                        $.bootstrapLoading.end();
+                        console.log(failRst);
+                    },
+                    function(exceptionRst){
+                        $.bootstrapLoading.end();
+                        console.log(exceptionRst);
+                    }
                 );
             } else {
                 if (refBillSumPrjsIds.length > 0 || refGljSumPrjsIds.length > 0) {
@@ -847,8 +894,10 @@ let rptControlObj = {
                     params.isOneSheet = true;
                     params.custCfg = zTreeOprObj.reportPageCfg;
                     params.option = "normal";
+                    $.bootstrapLoading.start();
                     CommonAjax.postEx("report_api/createExcelFiles", params, WAIT_TIME_EXPORT, true, function(result){
                             if (result) {
+                                $.bootstrapLoading.end();
                                 let uuIdUrls = [];
                                 for (let uuIdObj of result) {
                                     let uuIdUrl =  "/report_api/getFileByUUID/" + uuIdObj.uuid + "/" + stringUtil.replaceAll(uuIdObj.reportName, "#", "_") + "/xlsx";
@@ -856,9 +905,17 @@ let rptControlObj = {
                                 }
                                 downloadReport(uuIdUrls);
                             } else {
-                                //
+                                $.bootstrapLoading.end();
                             }
-                        }, null, null
+                        },
+                        function(failRst){
+                            $.bootstrapLoading.end();
+                            console.log(failRst);
+                        },
+                        function(exceptionRst){
+                            $.bootstrapLoading.end();
+                            console.log(exceptionRst);
+                        }
                     );
                 }
             }
@@ -954,6 +1011,7 @@ let rptControlObj = {
     },
     getPDFPre: function () {
         let me = rptControlObj;
+        $.bootstrapLoading.start();
         if (rptTplObj.pdfFont['SmartSimsun'].length === 2) {
             me.getPDFEx();
         } else {
@@ -981,6 +1039,7 @@ let rptControlObj = {
                 params.rptName = projectObj.project.projectInfo.name;
                 CommonAjax.postEx("report_api/getMultiReports", params, 30000, true,
                     function(result){
+                        $.bootstrapLoading.end();
                         let pageSize = rptControlObj.getCurrentPageSize();
                         for (let idx = 0; idx < result.length; idx++) {
                             let pageData = result[idx];
@@ -988,9 +1047,11 @@ let rptControlObj = {
                         }
                     },
                     function(failRst){
+                        $.bootstrapLoading.end();
                         console.log(failRst);
                     },
                     function(exceptionRst){
+                        $.bootstrapLoading.end();
                         console.log(exceptionRst);
                     }
                 );
@@ -1014,6 +1075,7 @@ let rptControlObj = {
                         params.option = "normal";
                         CommonAjax.postEx("report_api/getMultiReports", params, 30000, true,
                             function(result){
+                                $.bootstrapLoading.end();
                                 let pageSize = rptControlObj.getCurrentPageSize();
                                 for (let idx = 0; idx < result.length; idx++) {
                                     let pageData = result[idx];
@@ -1021,9 +1083,11 @@ let rptControlObj = {
                                 }
                             },
                             function(failRst){
+                                $.bootstrapLoading.end();
                                 console.log(failRst);
                             },
                             function(exceptionRst){
+                                $.bootstrapLoading.end();
                                 console.log(exceptionRst);
                             }
                         );
@@ -1031,6 +1095,7 @@ let rptControlObj = {
                         //这个分支是为了减少请求,用户已经点过的表,又没有勾选,那么就直接导出成PDF
                         let pageSize = rptControlObj.getCurrentPageSize();
                         let pageData = zTreeOprObj.currentRptPageRst;
+                        $.bootstrapLoading.end();
                         JpcJsPDFHelper.outputAsPdf(pageData, pageSize, rpt_names[0]);
                     }
                 }