Ver código fonte

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

zhongzewei 6 anos atrás
pai
commit
d59bdf7a25

+ 1 - 8
modules/ration_glj/facade/glj_calculate_facade.js

@@ -68,8 +68,7 @@ async function calculateQuantity(query,noNeedCal=null,refreshRationName = false)
          for(let glj of gljList){//先把混凝土,砂浆,配合比有自定义消耗的挑出来
              if(gljUtil.isConcreteType(glj.type)&& !noCustomQuantiyt(glj)) await getMixRatioMap(glj,gljList,coeList,assList,mixRatioMap);
          }
-
-        gljList = sortRationGLJ(gljList);
+        gljList = gljUtil.sortRationGLJ(gljList);
         for(let i =0;i<gljList.length;i++ ){
             let r = await calculateQuantityPerGLJ(gljList[i],gljList,coeList,assList,adjustState,mixRatioMap,noNeedCal);
             result.glj_result.push(r);
@@ -133,12 +132,6 @@ function generateUpdateTasks(result) {
     return tasks;
 }
 
-function sortRationGLJ(list) {
-    list = _.sortByAll(list, [function (item) {
-        return gljUtil.getMainType(item.type);
-    }, "code"])
-    return list;
-}
 
 async function calcWhenNoCustomQuantiyt(decimal,glj,gljList,coeList,assList) {
     let quantity = glj.rationItemQuantity ? scMathUtil.roundTo(parseFloat(glj.rationItemQuantity),-decimal):0;

+ 6 - 1
public/gljUtil.js

@@ -18,7 +18,8 @@ module.exports = {
     getAdjustPrice:getAdjustPrice,
     getMainType:getMainType,
     isConcreteType:isConcreteType,
-    getIndex:getIndex
+    getIndex:getIndex,
+    sortRationGLJ:sortRationGLJ
 };
 
 function calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal) {
@@ -54,4 +55,8 @@ function getIndex(obj, pops) {
 
 function isConcreteType(type) {
     return gljNodeUtil.isConcreteType(type);
+}
+
+function sortRationGLJ(type) {
+    return gljNodeUtil.sortRationGLJ(type);
 }

+ 5 - 5
public/web/tree_sheet/tree_sheet_helper.js

@@ -727,11 +727,11 @@ var TREE_SHEET_HELPER = {
                 ctx.clearRect(x, y, w, h);
             }
             GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
-            if(this.editingCell && hasData(options.row)){
+          /*  if(this.editingCell && hasData(options.row)){ 2019-02-22 图片显示隐藏
                 let centerX = Math.floor(x) + w - 20;
                 let centerY = Math.floor((y + (y + h)) / 2);
                 ctx.drawImage(img, centerX + 3, centerY - 7, imgWidth,imgHeight);
-            }
+            }*/
         };
         QuestionCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
             return {
@@ -745,8 +745,8 @@ var TREE_SHEET_HELPER = {
             };
         };
         QuestionCellType.prototype.processMouseDown = function (hitinfo) {
-            //弹出说明等窗口
-            if(this.editingCell && this.editingCell.row === hitinfo.row){
+            //弹出说明等窗口  2019-02-22 图片显示隐藏,去掉弹出提示
+        /*    if(this.editingCell && this.editingCell.row === hitinfo.row){
                 let offSet = hitinfo.cellRect.x + hitinfo.cellRect.width;
                 if(hitinfo.x < offSet && hitinfo.x > offSet - imgWidth){
                     if(mouseDownCallback && hasData(hitinfo.row)) {
@@ -754,7 +754,7 @@ var TREE_SHEET_HELPER = {
                     }
                     //$('#rationQuestionModal').modal('show');
                 }
-            }
+            }*/
         };
         QuestionCellType.prototype.processMouseEnter = function (hitinfo){
             if(this.editingCell==null){

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

@@ -270,6 +270,7 @@ legend.legend{
 #esInput{
     font-size:13px;
     color: black;
+    height: 100%;
 }
 .ration_glj_spread{
     width: 83%;

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

@@ -161,7 +161,7 @@
                           </li>
 
                           <li class="nav-item dropdown">
-                              <a class="nav-link dropdown-toggle more" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">更多</a>
+                              <a class="nav-link dropdown-toggle more" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" style="display:none">更多</a>
                               <div class="dropdown-menu" id="div_more_dropdown_right">
                                   <!--<a class="dropdown-item  right-nav-link"  href="javascript:void(0)" id = 'locateTab' relaPanel="#locate">查找定位</a>-->
                                   <!--<a class="dropdown-item" data-toggle="tab" href="#sqpz" role="tab">书签批注</a>-->
@@ -255,8 +255,8 @@
                                           <div class=" main-data-bottom ovf-hidden col-auto p-0" id="gljItemTab" style="width: 30px">
                                               <div class="rn-nav d-flex align-items-start flex-column gljSubTab">
                                                   <div id="zmhs_toogle">
-                                                      <div class="d-flex align-items-start flex-column" data-toggle="tooltip" data-placement="left" title="" data-original-title="打开子目换算">
-                                                          <span class="mt-3 ml-2 text-primary">子目换算</span>
+                                                      <div class="d-flex align-items-start flex-column" data-toggle="tooltip" data-placement="left" title="" data-original-title="打开定额调整">
+                                                          <span class="mt-3 ml-2 text-primary">定额调整</span>
                                                           <i class="fa fa-arrow-left mt-auto mb-3 text-primary ml-2"></i>
                                                       </div>
                                                   </div>
@@ -634,7 +634,7 @@
                                 <!--<li class="nav-item"><a class="nav-link active" data-toggle="pill" href="#poj-settings-basicInfo" role="tab" id="tab_poj-settings-basicInfo">建设项目基本信息</a></li>-->
                                 <li class="nav-item"><a class="nav-link active" data-toggle="pill" href="#poj-settings-projFeature" id="tab_poj-settings-projFeature" role="tab">工程特征</a></li>
                                 <li class="nav-item"><a class="nav-link" data-toggle="pill" href="#poj-settings-indicativeInfo" id="tab_poj-settings-indicativeInfo" role="tab">指标信息</a></li>
-                                <li class="nav-item"><a class="nav-link" data-toggle="pill" href="#poj-settings-4" id="about-calc" role="tab">关于计算</a></li>
+                               <!-- <li class="nav-item"><a class="nav-link" data-toggle="pill" href="#poj-settings-4" id="about-calc" role="tab">关于计算</a></li>-->
                                 <li class="nav-item"><a class="nav-link" data-toggle="pill" href="#poj-settings-billsQuanDecimal" id="tab_poj-settings-bqDecimal" role="tab">清单工程量精度</a></li>
                                 <li class="nav-item"><a class="nav-link" data-toggle="pill" href="#poj-settings-decimal" role="tab" id="tab_poj-settings-decimal">小数位数</a></li>
                                 <li class="nav-item"><a class="nav-link" data-toggle="pill" href="#poj-settings-6" role="tab" id="tab_poj-settings-6">人工单价调整</a></li>

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

@@ -1603,10 +1603,6 @@ class CalcProgram {
         let nQ = calcTools.uiNodeQty(treeNode);
         let nTQ = calcTools.uiNodeTenderQty(treeNode);
 
-        function isBaseFeeType(type){
-            return ['labour', 'material', 'machine', 'mainMaterial', 'equipment'].indexOf(type) > -1;
-        };
-
         /*删掉多余的费用。例如:从其它计算方式(有很多费)切换到公式计算方式(只需要common费),多出来的费要删除。
         fieldNameArr 值取自:遍历treeNode的计算规则,取有绑定的字段名。这些字段名以外的fee是因旧计算多出来的,需要删除。 */
         function deleteUselessFees(treeNode, fieldNameArr){
@@ -1748,13 +1744,23 @@ class CalcProgram {
                     uf = nQ ? (tf / nQ) : tf;        // 如果工程量为0或空,综合合单直接填到综合单价
                     uf = uf.toDecimal(decimalObj.bills.unitPrice);
                     if (projectObj.project.property.valuationType != 'bill') {  // 招投标项目, 还要反算
-                        tf = (uf * nQ).toDecimal(decimalObj.bills.totalPrice);
+                        let nQ2 = nQ ? nQ : 1;
+                        tf = (uf * nQ2).toDecimal(decimalObj.bills.totalPrice);
                     };
                 };
 
                 ftObj.unitFee = uf;
                 ftObj.totalFee = tf;
                 calcTools.checkFeeField(treeNode, ftObj);
+
+                if (treeNode.modifyFlag == 2 || treeNode.modifyFlag == 3){
+                    let ftObj2 = {
+                        fieldName: 'rationCommon',
+                        unitFee: uf,
+                        totalFee: tf
+                    };
+                    calcTools.checkFeeField(treeNode, ftObj2);
+                }
             }
 
             treeNode.data.calcTemplate = {"calcItems": []};

+ 2 - 2
web/building_saas/main/js/views/project_property_indicativeInfo.js

@@ -9,8 +9,8 @@ let indicativeInfoObj = {
         header: [
             {name: '名称', dataCode: 'name', width: 200, vAlign: 'center', hAlign: 'left'},
             {name: '金额', dataCode: 'price', width: 120, vAlign: 'center', hAlign: 'right'},
-            {name: '占造价比例(%)', dataCode: 'rate', width: 100, vAlign: 'center', hAlign: 'right'},
-            {name: '单方造价', dataCode: 'perCentiare', width: 80, vAlign: 'center', hAlign: 'right'}
+            {name: '占造价比例(%)', dataCode: 'rate', width: 100, vAlign: 'center', hAlign: 'right'}//,
+            //{name: '单方造价', dataCode: 'perCentiare', width: 80, vAlign: 'center', hAlign: 'right'}
         ],
         options: {
             allowContextMenu: false,