Browse Source

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

chenshilong 7 years atrás
parent
commit
6f6d9b247f

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

@@ -55,3 +55,8 @@ legend.legend{
 #gljPriceTenderCoe {
     -moz-appearance: textfield;
 }
+
+.modal-quantity-edit-height {
+    height: 200px;
+    overflow-y: auto;
+}

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

@@ -1292,7 +1292,7 @@
                         </p>
                     </div>
                     <div class="row" >
-                        <div class=" col-12" style="overflow: hidden" id="quantityEditSpread">
+                        <div class="modal-quantity-edit-height col-12" style="overflow: hidden" id="quantityEditSpread">
                         </div>
                     </div>
 

+ 6 - 6
web/building_saas/main/js/models/calc_base.js

@@ -135,16 +135,16 @@ let cbTools = {
         mapObj['TAX'] = Object.create(null);
         mapObj['OTHERS'] = Object.create(null);
         mapObj['ENGINEERINGCOST'] = Object.create(null);
-        let filter = ['CSXMF', 'ZZCSXMF', 'ZZCSXMDEJJZJGCF', 'ZZCSXMDEJJRGF', 'ZZCSXMDEJJCLF', 'ZZCSXMDEJJJXF', 'QTXMF', 'GF', 'SJ', 'SQGCZJ', 'AQWMSGZXFY'];
+        let filter = ['CSXMF', 'ZZCSXMF', 'ZZCSXMDEJJZJGCF', 'ZZCSXMDEJJRGF', 'ZZCSXMDEJJCLF', 'ZZCSXMDEJJJXF', 'QTXMF', 'GF', 'SJ', 'SQGCZJ', 'AQWMSGZXF'];
         //安全文明施工专项费用只有税金和工程造价能用
         for(let figure in baseFigures){
             if(filter.indexOf(baseFigures[figure]['base']) === -1){
                 mapObj['CONSTRUCTION_ORGANIZATION'][figure] = baseFigures[figure];
             }
-            if(baseFigures[figure]['base'] !== 'QTXMF' && baseFigures[figure]['base'] !== 'SQGCZJ' && baseFigures[figure]['base'] !== 'AQWMSGZXFY'){
+            if(baseFigures[figure]['base'] !== 'QTXMF' && baseFigures[figure]['base'] !== 'SQGCZJ' && baseFigures[figure]['base'] !== 'AQWMSGZXF'){
                 mapObj['OTHER'][figure] = baseFigures[figure];
             }
-            if(baseFigures[figure]['base'] !== 'GF' && baseFigures[figure]['base'] !== 'SQGCZJ' && baseFigures[figure]['base'] !== 'AQWMSGZXFY'){
+            if(baseFigures[figure]['base'] !== 'GF' && baseFigures[figure]['base'] !== 'SQGCZJ' && baseFigures[figure]['base'] !== 'AQWMSGZXF'){
                 mapObj['CHARGE'][figure] = baseFigures[figure];
             }
             if(baseFigures[figure]['base'] !== 'SJ' && baseFigures[figure]['base'] !== 'SQGCZJ'){
@@ -153,7 +153,7 @@ let cbTools = {
             if(baseFigures[figure]['base'] !== 'SQGCZJ'){
                 mapObj['ENGINEERINGCOST'][figure] = baseFigures[figure];
             }
-            if(baseFigures[figure]['base'] !== 'SQGCZJ' && baseFigures[figure]['base'] !== 'AQWMSGZXFY'){
+            if(baseFigures[figure]['base'] !== 'SQGCZJ' && baseFigures[figure]['base'] !== 'AQWMSGZXF'){
                 mapObj['OTHERS'][figure] = baseFigures[figure];
             }
             if(baseFigures[figure]['base'] === 'SQGCZJ'){
@@ -553,7 +553,7 @@ let baseFigureTemplate = {
         if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
         return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
     },
-    'AQWMSGZXFY': function (tender) {
+    'AQWMSGZXF': function (tender) {
         const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
         let bill = calcBase.fixedBills[calcBase.fixedFlag.SAFETY_CONSTRUCTION]['bill'];
         if(cbTools.isUnDef(bill) || cbTools.isUnDef(bill.ID)) return 0;
@@ -1041,7 +1041,7 @@ let baseFigureMap = {
     '其他项目费': {base: 'QTXMF',  fixedFlag: fixedFlag.OTHER, class: 'QTXM'},
     '规费': {base: 'GF', fixedFlag: fixedFlag.CHARGE, class: 'GF'},
     '税金': {base: 'SJ', fixedFlag: fixedFlag.TAX, class: 'SJ'},
-    '安全文明施工专项费': {base: 'AQWMSGZXFY', fixedFlag: fixedFlag.SAFETY_CONSTRUCTION, class: 'CSXM'},
+    '安全文明施工专项费': {base: 'AQWMSGZXF', fixedFlag: fixedFlag.SAFETY_CONSTRUCTION, class: 'CSXM'},
     //不于清单直接关联==========
     '建筑面积': {base: 'JZMJ', class: 'FBFX'},
     '税前工程造价': {base: 'SQGCZJ', class: 'SQGCZJ'},//安全文明施工专项费用使用

+ 1 - 0
web/building_saas/main/js/models/quantity_detail.js

@@ -742,6 +742,7 @@ var quantity_detail = {
                             }
                             rationNode.data.quantity = scMathUtil.roundForObj(ration_value / times,getDecimal("quantity",rationNode));
                             rationNode.data.contain = scMathUtil.roundForObj(rationNode.data.quantity/value,getDecimal("process"));
+                            rationNode.changed = true;
                             needUpdateChildren.push(rationNode);
                             if (rationNode.children.length>0){//如果有子工料机
                                 gljNodes = gljNodes.concat(rationNode.children);

+ 22 - 8
web/building_saas/main/js/views/quantity_edit_view.js

@@ -17,6 +17,8 @@ let quantityEditObj = {
         if(!this.spread){
             this.spread = SheetDataHelper.createNewSpread($("#quantityEditSpread")[0]);
             this.initSheet();
+        }else {
+            this.spread.refresh();
         }
         this.showData();
     },
@@ -172,14 +174,24 @@ let quantityEditObj = {
         if(project.isBillsLocked() && project.withinBillsLocked(project.mainTree.selected)){
             return;
         }
+        this.initModalContent();
         $("#quantityEXPEdit").modal({show:true});
     },
+    initModalContent:function () {
+        let selected = projectObj.project.mainTree.selected;
+        if(selected.sourceType == ModuleNames.ration){//暂时只有定额才有基数选择,所以其它的先隐藏表格
+            $("#quantityEditSpread").show();//quantityEditSpread
+        }else {
+            $("#quantityEditSpread").hide();
+        }
+        $("#quantityEXPValue").val(selected.data.quantityEXP);
+    },
     checkingAndUpdate(quantityEXP,node){
         let me = this;
-        quantityEXP = quantityEXP.toUpperCase();
+        quantityEXP = quantityEXP?quantityEXP.toUpperCase():'';//非空判断
         if(quantityEXP === node.data.quantityEXP){ //没有变化,不做任何操作
             projectObj.mainController.refreshTreeNode([node]);
-            return;
+            return true;
         }
         let value = me.evalQuantityExp(quantityEXP,node);
         if(value!=='evalError'){
@@ -190,12 +202,14 @@ let quantityEditObj = {
                 }, function () {
                     projectObj.mainController.refreshTreeNode([node]);
                 },['确定','取消'],false);
-                return;
+                return true;
             }
             me.updateQuantityEXP(value,quantityEXP,node);
+            return true;
         }else {
             projectObj.mainController.refreshTreeNode([node]);
         }
+        return false;
     },
     evalQuantityExp(quantityEXP,node){
         let evalString = quantityEXP;
@@ -209,7 +223,7 @@ let quantityEditObj = {
             return value;
         }catch (error){
             alert("输入的表达式有误,请重新输入!");
-            return "evalError"
+            return "evalError";
         }
     },
     updateQuantityEXP:function (value,quantityEXP,node) {
@@ -225,8 +239,6 @@ let quantityEditObj = {
 };
 $(function(){
     $('#quantityEXPEdit').on('shown.bs.modal', function (e) {
-        let selected = projectObj.project.mainTree.selected;
-        $("#quantityEXPValue").val(selected.data.quantityEXP);
         quantityEditObj.initSpread();
     });
 
@@ -238,8 +250,10 @@ $(function(){
 
     $("#quantityEditConf").bind('click',function () {
         let selected = projectObj.project.mainTree.selected;
-        quantityEditObj.checkingAndUpdate($("#quantityEXPValue").val(),selected);
-        $("#quantityEXPEdit").modal('hide');
+        let result = quantityEditObj.checkingAndUpdate($("#quantityEXPValue").val(),selected);
+        if(result == true){
+            $("#quantityEXPEdit").modal('hide');
+        }
     })