瀏覽代碼

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost

zhongzewei 7 年之前
父節點
當前提交
e05af7670f

+ 1 - 0
config/gulpConfig.js

@@ -17,6 +17,7 @@ module.exports = {
     common_css:[
         'lib/bootstrap/css/bootstrap.min.css',
         'web/building_saas/css/main.css',
+        'web/building_saas/css/custom.css',
         'lib/font-awesome/font-awesome.min.css'
     ],
     login_jspaths:[

+ 1 - 0
public/web/sheet/sheet_data_helper.js

@@ -52,6 +52,7 @@ var SheetDataHelper = {
         spread.options.cutCopyIndicatorVisible = false;
         spread.options.allowCopyPasteExcelStyle = false;
         spread.options.allowUserDragDrop = false;
+        spread.options.allowUndo = false;//that.mainSpread.commandManager().setShortcutKey(undefined, GC.Spread.Commands.Key.z, true, false, false, false); 屏蔽undo
         spread.getActiveSheet().setRowCount(3);
         return spread;
     },

+ 31 - 0
web/building_saas/css/custom.css

@@ -0,0 +1,31 @@
+
+.text-green{
+    color: #172a30
+}
+label.title{
+    display: inline-block;
+    width: 100px;
+}
+.modal-feeRate {max-width: 550px}
+
+
+div.resize{
+    height: 4px;
+    background: #f7f7f9;
+    width: 100%;
+    cursor: s-resize;
+}
+/*.zlfb-check{
+    margin-left: 20px;
+}*/
+legend.legend{
+    display:block;
+    width:auto;
+    font-size:0.9rem;
+    top:-15px;
+    background: white;
+}
+
+.toolsbar_feeRate {
+    border-bottom: 1px solid #ccc
+}

+ 0 - 6
web/building_saas/css/main.css

@@ -352,10 +352,4 @@ body {
 }
 .custom-file-input:lang(zh) ~ .custom-file-label::after {
     content: "浏览";
-}
-div.resize{
-    height: 4px;
-    background: #f7f7f9;
-    width: 100%;
-    cursor: s-resize;
 }

+ 1 - 0
web/building_saas/main/html/main.html

@@ -9,6 +9,7 @@
     <!-- inject:css -->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
+    <link rel="stylesheet" href="/web/building_saas/css/custom.css">
     <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
     <!--zTree-->
     <link rel="stylesheet" href="/lib/ztree/css/zTreeStyle.css" type="text/css">

+ 11 - 9
web/building_saas/main/js/models/calc_program.js

@@ -251,12 +251,12 @@ let calcTools = {
                     if (md.type == gljType.MACHINE_LABOUR) {
                         let q = md["consumption"] ? md["consumption"] : 0;
                         let p = md["basePrice"] ? md["basePrice"] : 0;
-                        mdSum = mdSum + (q * p).toDecimal(decimalObj.process);
-                        mdSum = (mdSum).toDecimal(decimalObj.process);
+                        mdSum = mdSum + (q * p).toDecimal(decimalObj.ration.unitFee);
+                        mdSum = (mdSum).toDecimal(decimalObj.ration.unitFee);
                     }
                 }
-                result = result + (glj["quantity"] * mdSum).toDecimal(decimalObj.process);
-                result = (result).toDecimal(decimalObj.process);
+                result = result + (glj["quantity"] * mdSum).toDecimal(decimalObj.ration.unitFee);
+                result = (result).toDecimal(decimalObj.ration.unitFee);
             }
         }
         return result;
@@ -345,8 +345,9 @@ let calcTools = {
                 };
 
                 for (let obj of GLJObjs){
-                    sumT = sumT + (me.uiGLJQty(obj.quantity) * me.uiGLJPrice(obj.marketPrice)).toDecimal(decimalObj.process);
-                    sumT = sumT.toDecimal(decimalObj.process);
+                    let t = (me.uiGLJQty(obj.quantity) * me.uiGLJPrice(obj.marketPrice)).toDecimal(decimalObj.bills.totalPrice);
+                    sumT = sumT + t;
+                    sumT = sumT.toDecimal(decimalObj.bills.totalPrice);
                 };
                 sumT = sumT.toDecimal(decimalObj.bills.totalPrice);
             }
@@ -1623,17 +1624,18 @@ class CalcProgram {
         this.saveNodes(changedNodes, callback);
     };
 
-    // 排除指定项的综合合价计算(用于带循环计算的情况)
+    // 排除指定项的综合合价计算(用于带循环计算的情况)。
+    // 这里的汇总只到清单级别即可(清单单价取费时,汇总到清单和汇总到定额两个值不一样)
     getTotalFee(baseNodes, excludeNodes){
         let rst = 0;
         function calcNodes(nodes) {
             for (let node of nodes) {
                 if (!excludeNodes.includes(node)){
-                    if (node.children.length > 0) {
+                    if (node.source && node.source.children && node.source.children.length > 0) {
                         calcNodes(node.children);
                     }
                     else{
-                        if (node.sourceType != ModuleNames.ration_glj) {
+                        if (node.sourceType == ModuleNames.bills) {
                             rst = (rst + calcTools.getFee(node, 'common.totalFee')).toDecimal(decimalObj.decimal("totalPrice", node));
                         };
                     }

+ 12 - 7
web/building_saas/main/js/views/glj_view.js

@@ -357,7 +357,7 @@ var gljOprObj = {
 
     onClipboardPasting: function (sender, args) {
         var me = gljOprObj;
-        if (!me.ration) {
+        if(args.cellRange.rowCount!=1||args.cellRange.colCount!=1){
             args.cancel = true;
         }
     },
@@ -725,13 +725,18 @@ var gljOprObj = {
         var me = gljOprObj;
         if (args.action == GC.Spread.Sheets.RangeChangedAction.clear) {
             args.editingText = null;
-            if (args.sheetName == 'ration_glj') {
-                me.onEditGLJSheet(args);
-            }
-            if (args.sheetName == 'ration_ass') {
-                me.updateRationAss(args);
-            }
+        }else if(args.action == GC.Spread.Sheets.RangeChangedAction.paste){
+            args.editingText = args.sheet.getCell(args.row,args.col).value();
+        }else {
+            return;
+        }
+        if (args.sheetName == 'ration_glj') {
+            me.onEditGLJSheet(args);
         }
+        if (args.sheetName == 'ration_ass') {
+            me.updateRationAss(args);
+        }
+
     },
     generateHtmlString: function () {
 //        return "<div id='edit'><div>";

+ 24 - 2
web/building_saas/main/js/views/project_view.js

@@ -656,7 +656,6 @@ var projectObj = {
                 that.mainSpread.bind(GC.Spread.Sheets.Events.ClipboardChanged, that.msClipboardChanged);
                 that.mainSpread.bind(GC.Spread.Sheets.Events.ButtonClicked, that.onButtonClick);
                 that.mainSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, that.onCellDoubleClick);
-                that.mainSpread.commandManager().setShortcutKey(undefined, GC.Spread.Commands.Key.z, true, false, false, false);
                 //let loadOtherStartTime = +new Date();
                 that.loadMainSpreadContextMenu();
                 that.loadFocusLocation();
@@ -1232,6 +1231,7 @@ var projectObj = {
     }
 
 };
+
 // 点击合计框中的复制
 $("body").on("click", "#total-tips a", function() {
     const totalElement = $(this).parent().siblings("p").find("#total");
@@ -1810,4 +1810,26 @@ function doAfterImport(resData){
             });
         });
     }
-}
+}
+
+
+$(function () {
+
+    $("#billsSpread").mouseover(function(){
+        spreadAutoFocus(projectObj.mainSpread,subSpread);
+    });
+
+    $("#subSpread").mouseover(function(){
+        spreadAutoFocus(subSpread,projectObj.mainSpread);
+    });
+
+    function spreadAutoFocus(spread,relateSpread) {
+        if(relateSpread&&relateSpread.getActiveSheet().isEditing()){//关联的spread不在编辑状态的情况下,才自动获得焦点;
+            return;
+        }else {
+            spread?spread.focus():'';
+        }
+    }
+
+
+});