Prechádzať zdrojové kódy

清除清单基数,单价应该重算

zhongzewei 6 rokov pred
rodič
commit
ae9fe3d9cd

+ 4 - 0
web/building_saas/main/js/views/project_view.js

@@ -496,6 +496,10 @@ var projectObj = {
                     }
                     node.data.userCalcBase = value;
                     project.calcBase.calculate(node);
+                    //删除清单基数,单价要清空
+                    if (value === '') {
+                        calcTools.setFieldValue(node, 'feesIndex.common.unitFee', 0);
+                    }
                     if(!project.calcBase.success){
                         let activeCell = projectObj.mainSpread.getActiveSheet().getSelections()[0];
                         projectObj.mainController.refreshTreeNode([node]);

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

@@ -49,8 +49,6 @@ let subObj = {
 
         if(projectReadOnly){
             disableSpread(subSpread);
-            disableSpread(contentOprObj.workBook);
-            disableSpread(characterOprObj.workBook);
         }
     },
     initNavItem:function (node) {

+ 13 - 18
web/building_saas/pm/js/pm_newMain.js

@@ -747,11 +747,11 @@ const projTreeObj = {
             }
         }
     },
-    openTender: function (node, timeoutTime) {
+    openTender: function (ID, parent, timeoutTime) {
         setTimeout(function () {
             let newTab = window.open('about:blank');
-            BeforeOpenProject(node.data.ID, {'fullFolder': GetFullFolder(node.parent)}, function () {
-                let mainUrl = `/main?project=${node.data.ID}`;
+            BeforeOpenProject(ID, {'fullFolder': GetFullFolder(parent)}, function () {
+                let mainUrl = `/main?project=${ID}`;
                 CommonAjax.get(mainUrl, [], function () {
                     newTab.location.replace(mainUrl); //不能后退
                 });
@@ -907,14 +907,7 @@ const projTreeObj = {
         TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
             let info = {x: x, y: y, row: context.row, col: context.col, cellStyle: cellStyle, cellRect: cellRect, sheetArea: context.sheetArea};
             let node = tree.items[info.row];
-            let offset = -1;
-            let centerX = info.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
-            let text = context.sheet.getText(info.row, info.col);
-            let value = context.sheet.getValue(info.row, info.col);
-            let acStyle = context.sheet.getActualStyle(info.row, info.col),
-                zoom = context.sheet.zoom();
-            let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: context.sheet, row: info.row, col: info.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
-            if(info.x > centerX + halfBoxLength && info.x < centerX + halfBoxLength + imgWidth + indent/2+3 + textLength){
+            if (node && node.data.projType === projectType.tender) {
                 info.isReservedLocation = true;
             }
             return info;
@@ -935,21 +928,23 @@ const projTreeObj = {
             }
             if(hitinfo.sheet.name() === "projectSheet"){//只有项目管理界面才执行
                 //单项文件,进入造价书界面
-                if(node.data.projType === projectType.tender && withingClickArea()){
-                    /*let thisClick = Date.now(),
+                if(node.data.projType === projectType.tender){
+                    let thisClick = Date.now(),
                         open = false;
                     if (this.preNode === node && this.preClick && thisClick - this.preClick <= 300) {
-                        open = true;*/
+                        open = true;
                         let timeoutTime = 200;
                         if($('.slide-sidebar').hasClass('open')){
                             timeoutTime = 500;
                         }
-                        projTreeObj.openTender(node, timeoutTime);
-                    /*}
+                        projTreeObj.openTender(node.data.ID, node.parent, timeoutTime);
+                    }
                     this.preClick = open ? null : thisClick;
-                    this.preNode = open ? null : node;*/
+                    this.preNode = open ? null : node;
+                }
+                if (!node || node.children.length === 0) {
+                    return;
                 }
-                if (!node || node.children.length === 0) { return; }
             }
             //统一改成方框外1像素内都有效
             if (hitinfo.x >= centerX - halfBoxLength - 2 && hitinfo.x <= centerX + halfBoxLength + 2 &&

+ 15 - 12
web/building_saas/pm/js/pm_share.js

@@ -334,14 +334,7 @@ const pmShare = (function () {
         TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
             let info = {x: x, y: y, row: context.row, col: context.col, cellStyle: cellStyle, cellRect: cellRect, sheetArea: context.sheetArea};
             let node = tree.items[info.row];
-            let offset = -1;
-            let centerX = info.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
-            let text = context.sheet.getText(info.row, info.col);
-            let value = context.sheet.getValue(info.row, info.col);
-            let acStyle = context.sheet.getActualStyle(info.row, info.col),
-                zoom = context.sheet.zoom();
-            let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: context.sheet, row: info.row, col: info.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
-            if(info.x > centerX + halfBoxLength && info.x < centerX + halfBoxLength + imgWidth + indent/2+3 + textLength){
+            if (node && node.data.projType === projectType.tender) {
                 info.isReservedLocation = true;
             }
             return info;
@@ -361,17 +354,27 @@ const pmShare = (function () {
                 return hitinfo.x > centerX + halfBoxLength && hitinfo.x < centerX + halfBoxLength + imgWidth + indent/2+3 + textLength;
             }
             //点击单位工程
-            if(node.data.projType === projectType.tender && withingClickArea()){
-                let newTab = window.open('about:blank');
+            if(node.data.projType === projectType.tender){
+                /*let newTab = window.open('about:blank');
                 //打开项目的实际ID
                 BeforeOpenProject(node.data.actualTreeInfo.ID, {'fullFolder': GetFullFolder(node.parent)}, function () {
                     let mainUrl = `/main?project=${node.data.actualTreeInfo.ID}`;
                     CommonAjax.get(mainUrl, [], function () {
                         newTab.location.href = mainUrl;
                     });
-                });
+                });*/
+                let thisClick = Date.now(),
+                    open = false;
+                if (this.preNode === node && this.preClick && thisClick - this.preClick <= 300) {
+                    open = true;
+                    projTreeObj.openTender(node.data.actualTreeInfo.ID, node.parent, 200);
+                }
+                this.preClick = open ? null : thisClick;
+                this.preNode = open ? null : node;
+            }
+            if (!node || node.children.length === 0) {
+                return;
             }
-            if (!node || node.children.length === 0) { return; }
             if (hitinfo.x >= centerX - halfBoxLength - 2 && hitinfo.x <= centerX + halfBoxLength + 2 &&
                 hitinfo.y >= centerY - halfBoxLength - 2 && hitinfo.y <= centerY + halfBoxLength + 2) {
                 node.setExpanded(!node.expanded);