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

+ 6 - 0
modules/pm/controllers/pm_controller.js

@@ -347,6 +347,11 @@ module.exports = {
             sessionCompilation.feasibility_valuation : [];
         feasibilityValuation = await engineeringLibModel.getLib(feasibilityValuation);
 
+        // 估算
+        let estimationValuation = sessionCompilation.estimationValuation !== undefined ?
+            sessionCompilation.estimationValuation : [];
+            estimationValuation = await engineeringLibModel.getLib(estimationValuation);
+
         // 概算
         let roughValuation = sessionCompilation.rough_valuation !== undefined ?
             sessionCompilation.rough_valuation : [];
@@ -379,6 +384,7 @@ module.exports = {
             overWriteUrl: overWriteUrl,
             suggestionValuation: JSON.stringify(suggestionValuation),
             feasibilityValuation: JSON.stringify(feasibilityValuation),
+            estimationValuation: JSON.stringify(estimationValuation),
             roughValuation: JSON.stringify(roughValuation),
             billValuation: JSON.stringify(billValuation),
             rationValuation: JSON.stringify(rationValuation),

+ 4 - 1
public/common_constants.js

@@ -113,7 +113,9 @@
         FEASIBILITY: 'feasibility', // 可行性估算
         ROUGH: 'rough', // 概算
         BUDGET: 'bill', // 预算
-        BOQ: 'ration' // 工程量清单
+        BOQ: 'ration', // 工程量清单
+        ESTIMATION: 'estimation', // 估算
+        
     };
     const ValuationText = {
         [ValuationType.SUGGESTION]: '建议估算',
@@ -121,6 +123,7 @@
         [ValuationType.ROUGH]: '概算',
         [ValuationType.BUDGET]: '预算',
         [ValuationType.BOQ]: '工程量清单',
+        [ValuationType.ESTIMATION]: '估算',
     }
 
     // 工程量清单类型

+ 19 - 11
web/building_saas/pm/html/project-management.html

@@ -354,14 +354,21 @@
                                 <label class="custom-control-label" for="radioRough">概算</label>
                             </div>
                             <% } %>
-                            <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('公路造价') ? '' : 'checked' %> for="radioBill">预算</label>
-                            </div>
-                            <div class="custom-control custom-radio custom-control-inline">
-                                <input type="radio" value="ration" id="radioRation" name="valuation_type" class="custom-control-input">
-                                <label class="custom-control-label" for="radioRation">工程量清单</label>
-                            </div>
+                            <% if (compilationName.includes('内蒙古高速公路日常养护估算(2021)')) { %>
+                                <div class="custom-control custom-radio custom-control-inline">
+                                    <input type="radio" value="estimation" id="radioEstimation" name="valuation_type" class="custom-control-input">
+                                    <label class="custom-control-label" checked for="radioEstimation">估算</label>
+                                </div>
+                            <% } 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('公路造价') ? '' : 'checked' %> for="radioBill">预算</label>
+                                </div>
+                                <div class="custom-control custom-radio custom-control-inline">
+                                    <input type="radio" value="ration" id="radioRation" name="valuation_type" class="custom-control-input">
+                                    <label class="custom-control-label" for="radioRation">工程量清单</label>
+                                </div>
+                            <% } %>
                         </div>
                     </div>
                     <div class="form-group row" style="display: none">
@@ -379,7 +386,7 @@
                             </select>
                         </div>
                     </div>
-                    <div class="form-group row" id="tender-engineering-group">
+                    <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">
@@ -387,8 +394,8 @@
                         </div>
                     </div>
                     <span class="form-text text-danger" id="engineering-info" style="display: none;">请选择养护类别</span>
-                    <div class="form-group row" id="tender-feeStandard-group">
-                        <label for="staticEmail" class="col-auto col-form-label col-form-label-sm">费用标准</label>
+                    <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>
                         </div>
@@ -815,6 +822,7 @@
     let rationValuation = '<%- rationValuation %>';
     let engineeringList = '<%- engineeringList %>';
     let compilationData = '<%- compilationData %>';
+    let estimationData = '<%- estimationValuation %>'
     compilationData = JSON.parse(compilationData.replace(/[\s\r\n]/g, ""));//去掉空格字符
 </script>
 </html>

+ 19 - 9
web/building_saas/pm/js/pm_newMain.js

@@ -36,7 +36,7 @@ let taxTypeMap = {
 let regions = [];
 
 const { 
-    ValuationType: { SUGGESTION, FEASIBILITY, ROUGH, BUDGET, BOQ },
+    ValuationType: { SUGGESTION, FEASIBILITY, ROUGH, BUDGET, BOQ, ESTIMATION },
     ValuationText,
     BOQType: { BID_INVITATION, BID_SUBMISSION },
 } = window.commonConstants;
@@ -2570,14 +2570,22 @@ function initProjectOptSet($target) {
                                 <label class="custom-control-label" for="type-rough">概算</label>
                             </div>
                             ` : ''}
-                            <div class="custom-control custom-radio custom-control-inline">
-                                <input type="radio" value="${BUDGET}" name="valuation-type" ${COMPILATION_NAME.includes('公路造价') ? '' : 'checked'} id="type-budget" class="custom-control-input">
-                                <label class="custom-control-label" for="type-budget">预算</label>
-                            </div>
-                            <div class="custom-control custom-radio custom-control-inline">
-                                <input type="radio" value="${BOQ}" name="valuation-type" id="type-boq" class="custom-control-input">
-                                <label class="custom-control-label" for="type-boq">工程量清单</label>
-                            </div>
+                            ${COMPILATION_NAME.includes('内蒙古高速公路日常养护估算(2021)') ? `
+                                <div class="custom-control custom-radio custom-control-inline">
+                                    <input type="radio" value="${ESTIMATION}" name="valuation-type" checked id="type-estimation" class="custom-control-input">
+                                    <label class="custom-control-label" for="type-estimation">估算</label>
+                                </div>
+                                ` : `
+                                <div class="custom-control custom-radio custom-control-inline">
+                                    <input type="radio" value="${BUDGET}" name="valuation-type" ${COMPILATION_NAME.includes('公路造价') ? '' : 'checked'} id="type-budget" class="custom-control-input">
+                                    <label class="custom-control-label" for="type-budget">预算</label>
+                                </div>
+                                <div class="custom-control custom-radio custom-control-inline">
+                                    <input type="radio" value="${BOQ}" name="valuation-type" id="type-boq" class="custom-control-input">
+                                    <label class="custom-control-label" for="type-boq">工程量清单</label>
+                                </div>
+                                `
+                            }
                         </div>
                     </div>
                     <div class="form-group row hide-area" id="boq-type">
@@ -2878,6 +2886,8 @@ function getValuationData(type) {
         valuationData = JSON.parse(roughValuation);
     } else if (type === BUDGET) {
         valuationData = JSON.parse(billValuation);
+    } else if (type === ESTIMATION) {
+        valuationData = JSON.parse(estimationData);
     } else {
         valuationData = JSON.parse(rationValuation);
     }

+ 3 - 1
web/building_saas/report/js/rpt_main.js

@@ -429,7 +429,9 @@ let zTreeOprObj = {
                     //console.log(result.data);
                     let currPrjParentID = projectObj.project.projectInfo.ParentID;
                     let selectedProjects = [];
-                    for (let prj of result.data) {
+                    let targetData = [];
+                    tree_Data_Helper.getFlatArray(tree_Data_Helper.buildTreeNodeDirectly(result.data, false), targetData);
+                    for (let prj of targetData) {
                         if (currPrjParentID === prj.ParentID) {
                             selectedProjects.push({name: prj.name, ID: prj.ID});
                         }