浏览代码

bug fixed

zhangweicheng 7 年之前
父节点
当前提交
c209ae7bbc

+ 9 - 8
web/building_saas/js/global.js

@@ -1,17 +1,18 @@
 /*全局自适应高度*/
 function autoFlashHeight(){
-    var headerHeight = $(".header").height();
-    var toolsbarHeight = $(".toolsbar").height();
-    var ftoolsbarHeight = $(".toolsbar-f").height();
+    let headerHeight = $(".header").height();
+    let toolsbarHeight = $(".toolsbar").height();
+    let ftoolsbarHeight = $(".toolsbar-f").height();
    // var feeRateToolsbarHeight = $(".toolsbar_feeRate").height();
-    var bottomContentHeight = $(".bottom-content").height();
-    var toolsBarHeightQ = $(".tools-bar-height-q").height();
-    var toolsBarHeightD = $(".tools-bar-height-d").height();
+    let mainBottomContentHeight = $("#main .bottom-content").height();
+    let gljBottomContentHeight = $("#project-glj-main .bottom-content").height();
+    let toolsBarHeightQ = $(".tools-bar-height-q").height();
+    let toolsBarHeightD = $(".tools-bar-height-d").height();
     $(".main-data-side-q").height($(window).height()-headerHeight-toolsbarHeight-toolsBarHeightQ-302);
     $(".main-data-side-d").height($(window).height()-headerHeight-toolsbarHeight-toolsBarHeightD-302);
     //$("#main .main-data-top").height($(window).height()-headerHeight-toolsbarHeight-bottomContentHeight-1);
-    $("#billsSpread").height($(window).height()-headerHeight-toolsbarHeight-bottomContentHeight-1);
-    $("#project_glj_sheet").height($(window).height()-headerHeight-toolsbarHeight-bottomContentHeight-1);
+    $("#billsSpread").height($(window).height()-headerHeight-toolsbarHeight-mainBottomContentHeight-1);
+    $("#project_glj_sheet").height($(window).height()-headerHeight-toolsbarHeight-gljBottomContentHeight-25);
     $(".main-data-full").height($(window).height()-headerHeight-toolsbarHeight-1);
     $(".main-data-full-fl").height($(window).height()-headerHeight-toolsbarHeight-37);
     $(".main-data-full-feeRate").height($(window).height()-headerHeight-78);

+ 4 - 4
web/building_saas/main/js/main.js

@@ -21,10 +21,12 @@ $(function () {
         $(e.relatedTarget.hash).removeClass('active');
         $("#subItems").addClass('active');
         $(gljOprObj.activeTab).addClass('active');
-        loadSize("main", function() {
+        autoFlashHeight();
+        projectObj.refreshMainSpread();
+        /*loadSize("main", function() {
             projectObj.refreshMainSpread();
             refreshSubSpread();
-        });
+        });*/
     });
 
     slideResize($("#main"), function() {
@@ -129,8 +131,6 @@ function loadSize(tag, callback) {
         const navHeight = $("#"+ tag +" .bottom-content").children('ul.nav').height() + 4;
         topHeight = parseFloat(topHeight);
         bottomHeight = parseFloat(bottomHeight);
-        console.log(topHeight);
-        console.log(bottomHeight);
         $("#"+ tag +" .main-data-top").height(topHeight);
         $("#"+ tag +" .main-data-bottom").height(bottomHeight - navHeight);
     }

+ 15 - 6
web/building_saas/main/js/models/installation_fee.js

@@ -179,7 +179,7 @@ var installation_fee = {
             };
             return updateData;
         };
-        installation_fee.prototype.submitInstallationUpdate = function (updateData,rationInstallations,callback) {
+       installation_fee.prototype.submitInstallationUpdate = function (updateData,rationInstallations,callback) {
             if(updateData){
                 let data = {'projectID':projectInfoObj.projectInfo.ID,'updateData':updateData};
                 if(rationInstallations){//是否附带更新定额安装费
@@ -201,7 +201,7 @@ var installation_fee = {
                 })
             }
         };
-        installation_fee.prototype.calcInstallationFee=function(callback){
+       installation_fee.prototype.calcInstallationFee=function(callback){
             let project = projectObj.project,me = this;
             let engineering = projectInfoObj.projectInfo.property.engineering;
             let installSetting = projectInfoObj.projectInfo.property.installSetting;
@@ -302,12 +302,13 @@ var installation_fee = {
                         glj.quantity = ur.quantity;
                         glj.rationItemQuantity = ur.rationItemQuantity;
                     }
-
+                    let selectedNode = projectObj.project.mainTree.selected;
                     //对树节点的操作并删除、添加清单、删除添加定额、删除对应的定额工料机缓存
                     TREE_SHEET_HELPER.massOperationSheet(projectObj.mainController.sheet, function () {
                         deleteOldNodes(deleteRationNodes,deleteBillsNodes);
                         addNewNodes(updateData);
                     });
+                    setTreeSelection(selectedNode);
                     projectObj.project.projectGLJ.loadData(function () {
                         cbTools.refreshFormulaNodes();
                         if(callback){
@@ -363,11 +364,19 @@ var installation_fee = {
                     Bill.tree.delete(bd.source);
                     Bill.removeByID(bd.getID());
                 }
-                let sels = controller.sheet.getSelections();
-                controller.setTreeSelected(controller.tree.items[sels[0].row]);
             }
 
-            
+            function setTreeSelection(oldSelect) {
+                let controller = projectObj.mainController;
+                let sel = controller.sheet.getSelections()[0];
+                if(controller.tree.getNodeByID(oldSelect.getID())){//如果旧选中节点还存在
+                    controller.sheet.setSelection(oldSelect.serialNo(),sel.col,sel.rowCount,sel.colCount);
+                    controller.setTreeSelected(oldSelect)
+                }else {//选中节点已被删除,自动选中新的节点
+                    controller.setTreeSelected(controller.tree.items[sel.row]);
+                }
+            }
+
             function checkRation(oldRation,newRation) {//检查定额是否需要更新
                 let gljs = project.ration_glj.getGljByRationID(oldRation.ID);
                 let modify = false;

+ 1 - 20
web/building_saas/main/js/views/glj_view.js

@@ -138,8 +138,6 @@ var gljOprObj = {
     },
     gljTreeSetting: {
         view: {
-            //addHoverDom: gljTypeTreeOprObj.addHoverDom,
-            //removeHoverDom: gljTypeTreeOprObj.removeHoverDom,
             expandSpeed: "",
             selectedMulti: false
         },
@@ -1103,23 +1101,6 @@ var gljOprObj = {
         installationFeeObj.rationInstallData = [];
         //this.detailData=[];
     },
-    /*   lockRationGLJCell:function(){
-     sheetCommonObj.lockCells(this.sheet,this.setting);
-     },
-     lockRationCoeCell:function () {
-     sheetCommonObj.lockCells(this.coeSheet,this.coeSetting);
-     /!*    if(this.coeSheetData){
-     for(var i =0;i<this.coeSheetData.length;i++){
-     if(this.coeSheetData[i].coeID==-1){
-     this.coeSheet.getCell(i, 1, GC.Spread.Sheets.SheetArea.viewport).locked(false);
-     }
-     }
-     }*!/
-
-     },
-     lockRationGLJCell:function(){
-     sheetCommonObj.lockCells(this.sheet,this.setting);
-     },*/
     updateRationGLJ: function (args) {
         var me = this;
         var updateField = me.setting.header[args.col].dataCode;
@@ -1649,7 +1630,7 @@ var gljOprObj = {
                 cellRect: cellRect,
                 sheetArea: context.sheetArea
             };
-        }
+        };
         TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
             var recode = data[hitinfo.row];
             if (recode && recode.hasOwnProperty('subList')) {

+ 3 - 3
web/building_saas/main/js/views/installation_fee_view.js

@@ -1212,8 +1212,8 @@ let installationFeeObj={
                                          return
                                     }
                                     if (autoCreate == false){//不自动生成的时候才做检查
-                                        if(feeRule.billID&&feeRule.billID!=""){//先检查清单ID
-                                            let node = projectObj.project.mainTree.getNodeByID(item.billID);
+                                        if(feeRule.billID && feeRule.billID != ""){//先检查清单ID
+                                            let node = projectObj.project.mainTree.getNodeByID(feeRule.billID);
                                             if(!node){
                                                 let c = confirm("所选清单没有找到,需要自动生成吗?");
                                                 if(c){
@@ -1222,7 +1222,7 @@ let installationFeeObj={
                                                     return;
                                                 }
                                             }
-                                        }else if(feeRule.position && feeRule.position!=""){//再检查code
+                                        }else if(feeRule.position && feeRule.position != ""){//再检查code
                                             let bill = projectObj.project.Bills.getBillByCode(feeRule.position);
                                             if(!bill){
                                                 let c = confirm("所选清单没有找到,需要自动生成吗?");

+ 2 - 0
web/building_saas/main/js/views/project_glj_view.js

@@ -470,6 +470,7 @@ $(function () {
         me.showProjectGljData();
         loadSize("project-glj-main", function () {
             me.projectGljSpread.refresh();
+            me.mixRatioSpread?me.mixRatioSpread.refresh():'';
         });
     });
     $('#ration_link').on('shown.bs.tab', function (e) {
@@ -491,6 +492,7 @@ $(function () {
     });
     slideResize($("#project-glj-main"), function () {
         projectGljObject.projectGljSpread.refresh();
+        projectGljObject.mixRatioSpread?projectGljObject.mixRatioSpread.refresh():'';
     });
     $('#pop-used-list').popover({
             placement: "bottom",