TonyKang 4 лет назад
Родитель
Сommit
a0352da4b9

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

@@ -174,7 +174,7 @@ const billsGuidance = (function () {
             }
         }
     };
-    if (compilationName === '内蒙古高速公路日常养护估算(2021)') {
+    if (compilationName === '内蒙古高速公路日常养护估算(2021)' || compilationName === '广东农村养护(2021)') {
         bills.treeSetting.cols.push(
             {
                 width: 100,
@@ -1141,7 +1141,7 @@ const billsGuidance = (function () {
             }
             initViews();
             let callback = function () {
-                if (compilationName === '内蒙古高速公路日常养护估算(2021)') {
+                if (compilationName === '内蒙古高速公路日常养护估算(2021)' || compilationName === '广东农村养护(2021)') {
                     //给清单加点料 baseEstUnitPrice
                     chkAndAddEstUnitPrice(rstData.bills);
                 }

+ 21 - 16
web/building_saas/main/js/views/std_bills_unit_price_feature.js

@@ -128,7 +128,7 @@ function _commonChkAndSetPrice(curItem, isNeedFactor) {
         if (isMatch) {
             //再根据相关项目属性指定基数
             for (const bms of bm.subs) {
-                if (_chkUnitPriceFeatureKeys(bms.keys)) {
+                if (_chkUnitPriceFeatureKeys(bms.keys, curItem)) {
                     basicValue = bms.basicValue;
                     break;
                 }
@@ -155,7 +155,7 @@ function _commonChkAndSetPrice(curItem, isNeedFactor) {
             }
             if (isMatch) {
                 for (const fms of fm.subs) {
-                    if (_chkUnitPriceFeatureKeys(fms.keys)) {
+                    if (_chkUnitPriceFeatureKeys(fms.keys, curItem)) {
                         factors.push(fms.basicValue);
                     }
                 }
@@ -172,24 +172,29 @@ function _commonChkAndSetPrice(curItem, isNeedFactor) {
     return rst;
 }
 
-function _chkUnitPriceFeatureKeys(keys) {
-    let rst = false;
+function _chkUnitPriceFeatureKeys(keys, curItem) {
+    let rst = (keys.length > 0);
     for (const subKey of keys) {
-        let isPrjFeatureMatch = false;
-        for (let prjF of projectObj.project.projectInfo.property.projectFeature) {
-            if (prjF.key === subKey.key) {
-                if (prjF.value === subKey.value) {
-                    isPrjFeatureMatch = true;
-                    // isKeyMatch = true;
-                    break;
-                } else {
-                    //key相同而value不同,则无需再循环,直接退出
-                    break;
+        let isKeyMatch = false;
+        if (subKey.type === 'prjFeature') {
+            for (let prjF of projectObj.project.projectInfo.property.projectFeature) {
+                if (prjF.key === subKey.key) {
+                    if (prjF.value === subKey.value) {
+                        isKeyMatch = true;
+                        break;
+                    } else {
+                        //key相同而value不同,则说明不是这个设置值,无需再循环,直接退出
+                        break;
+                    }
                 }
             }
+        } else if (subKey.type === 'bills') {
+            //判断当前清单curItem
+            isKeyMatch = (curItem[subKey.key] === subKey.value);
         }
-        if (isPrjFeatureMatch) {
-            rst = true;
+        if (!isKeyMatch) {
+            //要所有的keys都匹配才行,否则false;
+            rst = false;
             break;
         }
     }

+ 4 - 4
web/building_saas/pm/html/project-management.html

@@ -362,9 +362,9 @@
                             <% } else { %>
                                 <div class="custom-control custom-radio custom-control-inline">
                                     <input type="radio" value="bill" id="radioBill" name="valuation_type" class="custom-control-input">
-                                    <label class="custom-control-label" <%= (compilationName.includes('公路造价') || compilationName.includes('广东农村养护(2021)')) ? '' : 'checked' %> for="radioBill">预算</label>
+                                    <label class="custom-control-label" <%= (compilationName.includes('公路造价')) ? '' : 'checked' %> for="radioBill">预算</label>
                                 </div>
-                                <div class="custom-control custom-radio custom-control-inline" <% if (compilationName.includes("广东农村养护(2021)")) { %> style="display:none" <% } %>>
+                                <div class="custom-control custom-radio custom-control-inline" <% if (!compilationName.includes("广东农村养护(2021)")) { %> style="display:none" <% } %>>
                                     <input type="radio" value="ration" id="radioRation" name="valuation_type" class="custom-control-input">
                                     <label class="custom-control-label" for="radioRation">工程量清单</label>
                                 </div>
@@ -386,7 +386,7 @@
                             </select>
                         </div>
                     </div>
-                    <div class="form-group row" id="tender-engineering-group" <% if (compilationName.includes("内蒙古高速公路日常养护估算(2021)") ) { %> style="display:none" <% } %>>
+                    <div class="form-group row" id="tender-engineering-group" <% if (compilationName.includes('内蒙古高速公路日常养护估算(2021)') ) { %> style="display:none" <% } %>>
                         <label for="staticEmail" class="col-auto col-form-label col-form-label-sm">养护类别</label>
                         <div class="col">
                             <select class="form-control  form-control-sm" id="tender-engineering">
@@ -394,7 +394,7 @@
                         </div>
                     </div>
                     <span class="form-text text-danger" id="engineering-info" style="display: none;">请选择养护类别</span>
-                    <div class="form-group row" id="tender-feeStandard-group" <% if (compilationName.includes("内蒙古高速公路日常养护估算(2021)") || compilationName.includes("广东农村养护(2021)") ) { %> style="display:none" <% } %>>
+                    <div class="form-group row" id="tender-feeStandard-group" <% if (compilationName.includes("内蒙古高速公路日常养护估算(2021)") ) { %> style="display:none" <% } %>>
                         <label for="staticEmail" class="col-auto col-form-label col-form-label-sm" >费用标准</label>
                         <div class="col">
                             <select class="form-control  form-control-sm" id="tender-feeStandard"></select>

+ 2 - 6
web/building_saas/pm/js/pm_newMain.js

@@ -2592,15 +2592,11 @@ function initProjectOptSet($target) {
                                 ${_getOptionDivDomStr(FEASIBILITY, "valuation-type", "可行性估算", "type-feasibility", false)}
                                 ${_getOptionDivDomStr(ROUGH, "valuation-type", "概算", "type-rough", false)}
                             ` : ''}
-                            ${COMPILATION_NAME.includes('内蒙古高速公路日常养护估算(2021)') ? `
+                            ${ (COMPILATION_NAME.includes('内蒙古高速公路日常养护估算(2021)')) ? `
                                 ${_getOptionDivDomStr(ESTIMATION, "valuation-type", "估算", "type-suggestion", true)}
                                 ` : ``
                             }
-                            ${COMPILATION_NAME.includes('广东农村养护(2021)') ? `
-                                    ${_getOptionDivDomStr(BUDGET, "valuation-type", "预算", "type-budget", true)}
-                                ` : ``
-                            }
-                            ${(COMPILATION_NAME !== '内蒙古高速公路日常养护估算(2021)' && COMPILATION_NAME !== '广东农村养护(2021)') ? `
+                            ${(COMPILATION_NAME !== '内蒙古高速公路日常养护估算(2021)') ? `
                                 ${_getOptionDivDomStr(BUDGET, "valuation-type", "预算", "type-budget", !COMPILATION_NAME.includes('公路造价'))}
                                 ${_getOptionDivDomStr(BOQ, "valuation-type", "工程量清单", "type-boq", false)}
                                 ` : ``