zhangweicheng 6 år sedan
förälder
incheckning
c4cc48952b

+ 10 - 8
modules/complementary_ration_lib/models/compleRationModel.js

@@ -166,14 +166,15 @@ class CompleRatoinDao {
             }
             if(!gUtil) gUtil = gljUtil;
             let gljDatas = gUtil.sortRationGLJ(stdGljs.concat(comGljs));
-            for(let glj of gljDatas){
-                hintsArr.push(` ${glj.code} ${glj.name}${glj.specs ? '   ' + glj.specs : ''} &nbsp ${glj.unit}   ${gljAmtMapping[glj.ID]}`)
-            }
-            hintsArr.push(`基价 元 ${ration.basePrice}`);
             if(ration.jobContent && ration.jobContent.toString().trim() !== ''){
                 hintsArr.push(`工作内容:`);
                 hintsArr = hintsArr.concat(ration.jobContent.split('\n'));
+                hintsArr.push("");
             }
+            for(let glj of gljDatas){
+                hintsArr.push(` ${glj.code} ${glj.name}${glj.specs ? '   ' + glj.specs : ''} &nbsp ${glj.unit}   ${gljAmtMapping[glj.ID]}`)
+            }
+            hintsArr.push(`基价 元 ${ration.basePrice}`);
             if(ration.annotation && ration.annotation.toString().trim() !== ''){
                 hintsArr.push(`附注:`);
                 hintsArr = hintsArr.concat(ration.annotation.split('\n'));
@@ -243,14 +244,15 @@ class CompleRatoinDao {
             }
             if(!gUtil) gUtil = gljUtil;
             let gljDatas =  gUtil.sortRationGLJ(stdGljs);
-            for(let glj of gljDatas){
-                hintsArr.push(` ${glj.code} ${glj.name}${glj.specs ? '   ' + glj.specs : ''} &nbsp ${glj.unit}   ${gljAmtMapping[glj.ID]}`)
-            }
-            hintsArr.push(`基价 元 ${ration.basePrice}`);
             if(ration.jobContent && ration.jobContent.toString().trim() !== ''){
                 hintsArr.push(`工作内容:`);
                 hintsArr = hintsArr.concat(ration.jobContent.split('\n'));
+                hintsArr.push("");
             }
+            for(let glj of gljDatas){
+                hintsArr.push(` ${glj.code} ${glj.name}${glj.specs ? '   ' + glj.specs : ''} &nbsp ${glj.unit}   ${gljAmtMapping[glj.ID]}`)
+            }
+            hintsArr.push(`基价 元 ${ration.basePrice}`);
             if(ration.annotation && ration.annotation.toString().trim() !== ''){
                 hintsArr.push(`附注:`);
                 hintsArr = hintsArr.concat(ration.annotation.split('\n'));

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

@@ -808,7 +808,7 @@
                                 <div class="tab-pane fade" id="poj-settings-decimal" role="tabpanel">
                                     <div class="modal-auto-height">
                                         <fieldset class="form-group">
-                                            <h5>清单</h5>
+                                            <h5 id="bills_decimal_header">清单</h5>
                                             <div class="row m-0">
                                                 <div class="col-sm-3">
                                                     <div class="input-group input-group-sm mb-2">

+ 14 - 0
web/building_saas/main/js/models/bills.js

@@ -342,11 +342,25 @@ var Bills = {
         };
         bills.prototype.downLevelBills = function (node) {
             var downLevelData = node.getDownLevelData();
+            this.setQuantityAfterDownLevel(node,downLevelData);
             project.pushNow('downLevelBills', [this.getSourceType()], [tools.coverseTreeUpdateData(downLevelData, this.project.ID())]);
 
             return node.downLevel();
         };
+        bills.prototype.setQuantityAfterDownLevel = function (node,downLevelData) {
+            if(projectObj.project.projectInfo.property && projectObj.project.projectInfo.property.valuationType == "ration"){//工程量清单项目中,将B降级为A的子项后应清空A的工程量
+                let preNode = node.preSibling;
+                for(let d of downLevelData){
+                    if(preNode && preNode.getID()==d.data.ID){
+                        d.data.quantity = "0";
+                        d.data.quantityEXP = "";
+                        preNode.data.quantity = "0";
+                        preNode.data.quantityEXP = "";
+                    }
+                }
+            }
 
+        };
         bills.prototype.updateField = function (node, field, newValue,toBX) {//当toBX为true时类型改为补项
             calcFees.setFee(node.data, field, newValue);
             let updateData = [];

+ 5 - 4
web/building_saas/main/js/views/main_tree_col.js

@@ -468,13 +468,14 @@ let MainTreeCol = {
         let ration_glj = projectObj.project.ration_glj;
         let gljList = gljOprObj.filterGljByRation(node.data, ration_glj.datas);
         gljList = gljUtil.sortRationGLJ(gljList);
-        for(let glj of gljList){
-            tips += `${glj.code} ${glj.name}${glj.specs ? '&nbsp;&nbsp;&nbsp;' + glj.specs : ''}&nbsp;&nbsp&nbsp;${glj.unit}&nbsp;&nbsp;&nbsp;${glj.quantity}<br>`;
-        }
         if(node.data.content && node.data.content.toString().trim() !== ''){
             tips += `工作内容:<br>`;
-            tips += `${node.data.content.replace(/\n/g,"<br>")}<br>`;
+            tips += `${node.data.content.replace(/\n/g,"<br>")}<br><br>`;
         }
+        for(let glj of gljList){
+            tips += `${glj.code} ${glj.name}${glj.specs ? '&nbsp;&nbsp;&nbsp;' + glj.specs : ''}&nbsp;&nbsp&nbsp;${glj.unit}&nbsp;&nbsp;&nbsp;${glj.quantity}<br>`;
+        }
+
         if(node.data.annotation && node.data.annotation.toString().trim() !== ''){
             tips += `附注:<br>`;
             tips += `${node.data.annotation.replace(/\n/g,"<br>")}<br>`;

+ 3 - 0
web/building_saas/main/js/views/project_property_decimal_view.js

@@ -286,7 +286,10 @@ $(document).ready(function () {
     $('#poj-set').on('shown.bs.modal', function (e) {
         let v_data = m_getInitData(decimalObj);
         v_initPanel(v_data);
+        let headerText =  projectObj.project.projectInfo.property && projectObj.project.projectInfo.property.valuationType == "bill"?"项目节":"清单";//项目属性-小数位数,“清单”改文字为“项目节”,工程量清单中保持不变。
+        $("#bills_decimal_header").text(headerText);
     });
+
     //绑定确定按钮
     //e_bindCof($('#property_ok'));
     //绑定小数位数输入控制

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

@@ -1151,7 +1151,8 @@ var projectObj = {
     },
     loadMainSpreadContextMenu: function () {
         var project = this.project, spread = this.mainSpread, controller = this.mainController;
-        $.contextMenu({
+        let insertBillsName = project.projectInfo.property && project.projectInfo.property.valuationType == "bill"?"插入项目节":"插入清单";//右键“插入清单”改文字为“插入项目节”,工程量清单中保持不变。
+            $.contextMenu({
             selector: '#billsSpread',
             selectableSubMenu: true,
             build: function ($trigger, e) {
@@ -1251,7 +1252,7 @@ var projectObj = {
                     }
                 },
                 "insertBills": {
-                    name: "插入清单",
+                    name: insertBillsName,
                     icon: 'fa-sign-in',
                     disabled: function () {
                         if (projectReadOnly) {