Selaa lähdekoodia

内蒙古养估_01

TonyKang 4 vuotta sitten
vanhempi
commit
5c5a4b2c63

+ 39 - 0
modules/all_models/bills_unitprice_feature_lib.js

@@ -0,0 +1,39 @@
+/**
+ * Created by Tony on 2021/9/10.
+ */
+
+//工程特征库
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const oprSchema = require('../all_schemas/opr_schema');
+const bills_unit_price_feature_lib = new Schema({
+        ID:{type:String,index:true},
+        creator: String,
+        createDate: Number,
+        recentOpr: [oprSchema],
+        name: String,
+        compilationId: String,
+        compilationName: String,
+        // feature: {
+        //     type: [Schema.Types.Mixed],
+        //     default: {}
+        // },
+        feature: {
+            basicKeyOptions: {
+                type: [Schema.Types.Mixed],
+                default: []
+            },
+            basicMappings:{
+                type: [Schema.Types.Mixed],
+                default: []
+            },
+            factorMappings: {
+                type: [Schema.Types.Mixed],
+                default: []
+            }
+        }
+    },
+    {versionKey: false}
+);
+
+mongoose.model("std_bills_unitprice_feature_lib", bills_unit_price_feature_lib,"std_bills_unitprice_feature_lib");

+ 11 - 0
modules/main/routes/main_route.js

@@ -9,7 +9,9 @@ const pmFacade = require('../../pm/facade/pm_facade');
 const systemSettingModel = require('../../system_setting/model/index');
 const OptionsDao = require('../../options/models/optionsModel');
 const optionSetting = require('../../options/models/optionTypes');
+const billsUnitPriceFeatureFacade = require("../../std_bills_unitprice_feature_lib/facade/bills_unitprice_feature_facade");
 let config = require("../../../config/config.js");
+
 module.exports =function (app) {
     const baseController = new BaseController();
     app.get('/main', baseController.init, function(req, res) {
@@ -38,6 +40,14 @@ module.exports =function (app) {
                 if (constructProject && constructProject.property && constructProject.property.boqType) {
                     boqType = constructProject.property.boqType;
                 }
+
+                let filter = {compilationId: req.session.sessionCompilation._id};
+                // let featureLibs = await billsUnitPriceFeatureFacade.findByCondition(filter,{feature:1},false);
+                let featureLibs = await billsUnitPriceFeatureFacade.findByCondition(filter,{_id:0},false);
+
+                console.log(featureLibs);
+                let billsUnitPriceFeature = (featureLibs && featureLibs.length > 0)?featureLibs[featureLibs.length - 1]:null;
+        
                 res.render('building_saas/main/html/main.html',
                     {
                         userAccount: req.session.userAccount,
@@ -56,6 +66,7 @@ module.exports =function (app) {
                         markReadProjectIDs: JSON.stringify(markReadProjectIDs),
                         boqType,
                         title:config[process.env.NODE_ENV].title?config[process.env.NODE_ENV].title:"纵横公路养护云造价",
+                        billsUnitPriceFeature : JSON.stringify(billsUnitPriceFeature),
                         version
                     });
             } else {

+ 4 - 3
modules/pm/controllers/pm_controller.js

@@ -34,7 +34,7 @@ let sectionTreeDao = new SectionTreeDao();
 let consts = require('../../main/models/project_consts');
 let rp = require('request-promise');
 const commonUtil = require('../../../public/common_util');
-const { ValuationText } = require('../../../public/common_constants');
+const { ValuationText, AdminLevelType } = require('../../../public/common_constants');
 //统一回调函数
 let callback = function (req, res, err, message, data) {
     res.json({ error: err, message: message, data: data });
@@ -348,8 +348,8 @@ module.exports = {
         feasibilityValuation = await engineeringLibModel.getLib(feasibilityValuation);
 
         // 估算
-        let estimationValuation = sessionCompilation.estimationValuation !== undefined ?
-            sessionCompilation.estimationValuation : [];
+        let estimationValuation = sessionCompilation.estimation_valuation !== undefined ?
+            sessionCompilation.estimation_valuation : [];
             estimationValuation = await engineeringLibModel.getLib(estimationValuation);
 
         // 概算
@@ -389,6 +389,7 @@ module.exports = {
             billValuation: JSON.stringify(billValuation),
             rationValuation: JSON.stringify(rationValuation),
             engineeringList: JSON.stringify(engineering.List),
+            adminLevelType: JSON.stringify(AdminLevelType),
             compilationName: sessionCompilation.name,
             versionName: request.session.compilationVersion,
             socketPort:config[process.env.NODE_ENV].socketPort?config[process.env.NODE_ENV].socketPort:5500,

+ 2 - 2
modules/reports/controllers/rpt_controller.js

@@ -244,7 +244,7 @@ function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, custo
                 if (!err) {
                     let buildPageData = function() {
                         try {
-                            // fsUtil.writeObjToFile(rawDataObj, "D:/GitHome/ConstructionCost/tmp/rawDataObj.jsp");
+                            // fsUtil.writeObjToFile(rawDataObj, `D:/GitHome/ConstructionCost/tmp/rawDataObj_${(new Date).getTime()}.jsp`);
                             let tplData = rptDataUtil.assembleData(rawDataObj);
                             let printCom = JpcEx.createNew();
                             if (pageSize) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = pageSize;
@@ -262,7 +262,7 @@ function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, custo
                                 pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
                             }
                             if (pageRst) {
-                                // fsUtil.writeObjToFile(pageRst, "D:/GitHome/ConstructionCost/tmp/testBuiltPageResult.jsp");
+                                // fsUtil.writeObjToFile(pageRst, `D:/GitHome/ConstructionCost/tmp/testBuiltPageResult_${(new Date).getTime()}.jsp`);
                                 cb(null, pageRst);
                             } else {
                                 cb('Have errors while on going...', null);

+ 27 - 0
modules/std_bills_unitprice_feature_lib/controllers/bills_unitprice_feature_controller.js

@@ -0,0 +1,27 @@
+/**
+ * Created by Tony on 2021/9/10.
+ */
+
+BaseController = require("../../common/base/base_controller");
+featureFacade  = require("../facade/bills_unitprice_feature_facade");
+
+class BillsUnitPriceFeatureController extends BaseController{
+    async findLib(request, response){
+        let result={
+            error:0
+        };
+        try {
+            let data = request.body.data;
+            data = JSON.parse(data);
+            let conditions={'ID' : data.ID};
+            let resultData = await featureFacade.findByCondition(conditions);
+            result.data=resultData;
+        }catch (err){
+            console.log(err);
+            result.error=1;
+            result.message = err.message;
+        }
+        response.json(result);
+    }
+}
+export default BillsUnitPriceFeatureController;

+ 16 - 0
modules/std_bills_unitprice_feature_lib/facade/bills_unitprice_feature_facade.js

@@ -0,0 +1,16 @@
+/**
+ * Created by Tony on 2021/9/10.
+ */
+
+mongoose = require('mongoose');
+let billsUnitPriceFeatureModel = mongoose.model('std_bills_unitprice_feature_lib');
+
+module.exports = {
+    findByCondition:async function(conditions,options,single=true){
+        if(single == true){
+            return await billsUnitPriceFeatureModel.findOne(conditions,options).lean();
+        }else {
+            return await  billsUnitPriceFeatureModel.find(conditions,options).lean();
+        }
+    },
+};

+ 2 - 1
modules/users/models/compilation_model.js

@@ -57,10 +57,11 @@ class CompilationModel extends BaseModel {
     async getCompilationById(id) {
         let condition = {_id: id, is_release: true};
         let compilationData = await this.findDataByCondition(condition);
+        compilationData = compilationData._doc ? compilationData._doc : compilationData;
         if (!compilationData  || compilationData.bill_valuation === undefined) {
             return compilationData;
         }
-        const fields = ['suggestion', 'feasibility', 'rough', 'bill', 'ration'];
+        const fields = ['suggestion', 'feasibility', 'rough', 'bill', 'ration', 'estimation'];
         fields.forEach(field => {
             const valField = `${field}_valuation`;
             if (compilationData[valField] && compilationData[valField].length > 0) {

+ 8 - 0
public/common_constants.js

@@ -137,6 +137,13 @@
         RATION: 'ration',
     };
 
+    // 广东农村公路养护 道路行政等级
+    const AdminLevelType = {
+        CITY_LEVEL: '县道',
+        COUNTRY_SIDE_LEVEL: '乡道',
+        VLLAGE_LEVEL: '村道',
+    };
+
     // 缓存key
     const StorageKey = {
         // 主界面一旦出现这个缓存,马上提示
@@ -211,5 +218,6 @@
         RationType,
         BillType,
         ShareLibType,
+        AdminLevelType,
     };
 })

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

@@ -49,6 +49,7 @@
         const markReadProjectIDs = JSON.parse('<%- markReadProjectIDs %>');
         const VERSION = '<%- version %>';
         const CUR_BOQ_TYPE = '<%- boqType %>';
+        const billsUnitPriceFeature = JSON.parse('<%- billsUnitPriceFeature %>');
     </script>
 </head>
 
@@ -66,8 +67,10 @@
         <div class="main-nav">
             <ul class="nav nav-tabs flex-column" role="tablist" id="mainNav">
                 <li class="nav-item"><a class="active" data-toggle="tab" href="#zaojiashu" id="tab_zaojiashu" role="tab">造价书</a></li>
+                <% if (compilationName !== '内蒙古高速公路日常养护估算(2021)') { %>
                 <li class="nav-item"><a data-toggle="tab" href="#project_glj" id="tab_project_glj" data-name="tab_project_glj" role="tab">工料机汇总</a></li>
                 <li class="nav-item"><a data-toggle="tab" href="#fee_rates" id="tab_fee_rate" role="tab" >费率</a></li>
+                <% } %>
                 <li class="nav-item"><a data-toggle="tab" href="#divide" id="tab_divide" role="tab" style="display: none;">分摊</a></li>
                 <li class="nav-item"><a data-toggle="tab" href="#calc_program_manage" id="tab_calc_program_manage" role="tab" style="display:none">总计算程序</a></li>
                 <li class="nav-item"><a data-toggle="tab" href="#tender_price" id="tab_tender_price" role="tab">调价</a></li>
@@ -99,6 +102,7 @@
                     <a href="javascript:void(0)"  class="btn btn-light btn-sm" id="downLevel" data-toggle="tooltip" data-placement="bottom" data-original-title="降级"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
                       <a href="javascript:void(0)" class="btn btn-light btn-sm" id="upMove" data-toggle="tooltip" data-placement="bottom" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
                       <a href="javascript:void(0)" class="btn btn-light btn-sm" id="downMove" data-toggle="tooltip" data-placement="bottom" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
+                      <% if (compilationName !== '内蒙古高速公路日常养护估算(2021)') { %>
                       <div class="btn-group ml-2">
                           <a class="dropdown-toggle btn btn-light btn-sm" data-toggle="dropdown" href="#" id="moreMenuA" role="button" aria-haspopup="true" aria-expanded="false">更多</a>
                           <div class="dropdown-menu dropright" id="moreMenu">
@@ -125,6 +129,7 @@
                               <a id = "menu_calc_program_manage"  href="javascript:void(0);" class="dropdown-item"><i class="fa fa-calculator" aria-hidden="true"></i> 总计算程序</a>
                           </div>
                       </div>
+                      <% } %>
                  <!--   <span class="btn btn-light btn-sm">
                       <a href="" data-toggle="dropdown"><span data-placement="bottom"><i class="fa fa-list-ol"></i></span> 显示至...</a>
                       <div class="dropdown-menu dropdown-menu-left" style="min-width: 6.5rem">
@@ -162,7 +167,7 @@
                               <a class="nav-link px-1 right-nav-link" href="javascript:void(0)" id="stdRationTab"
                                  relaPanel="#de">定额库</a>
                           </li>
-
+                          <% if (compilationName !== '内蒙古高速公路日常养护估算(2021)') { %>
                           <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>
                               <div class="dropdown-menu" id="div_more_dropdown_right">
@@ -177,6 +182,7 @@
                                   </script>
                               </div>
                           </li>
+                          <% } %>
                       </ul>
                   </div>
               </div>
@@ -214,9 +220,11 @@
                                   <li class="nav-item">
                                       <a class="nav-link sub-item" id="linkGCLMX" data-toggle="tab" href="#subSpread" role="tab">工程量明细</a>
                                   </li>
+                                  <% if (compilationName !== '内蒙古高速公路日常养护估算(2021)') { %>
                                   <li class="nav-item">
                                       <a class="nav-link sub-item" id="linkJSCX" data-toggle="tab" href="#subSpread" role="tab">计算程序</a>
                                   </li>
+                                  <% } %>
                                  <!-- <li class="nav-item">   2018-11-08  新需求,隐藏说明信息
                                       <a class="nav-link" data-toggle="tab" href="#comments" role="tab" id="linkComments">说明信息</a>
                                   </li>-->

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

@@ -220,6 +220,7 @@ const billsGuidance = (function () {
                 return;
             }
             let compareData = compareTree(parent, mainTreeFragment, selTree.roots);
+            _chkBillsUnitPrice(compareData.postData); //设置指标基价(默认单价)
             let sheet = projectObj.mainSpread.getActiveSheet(),
                 row = sheet.getActiveColumnIndex(),
                 col = sheet.getActiveColumnIndex();
@@ -572,8 +573,98 @@ const billsGuidance = (function () {
         }
     }
 
-
-
+    function _chkBillsUnitPrice(billsNodes) {
+        if (billsUnitPriceFeature !== null) {
+            for (const node of billsNodes) {
+                if (node.updateType === 'create') {
+                    //只有创建的才设置初始化单价
+                    const _chkKeys = function(keys) {
+                        let rst = false;
+                        for (const subKey of keys) {
+                            let isPrjFeatureMatch = false;
+                            for (let prjF of projectObj.project.projectInfo.property.projectFeature) {
+                                if (prjF.key === bmsK.key) {
+                                    if (prjF.value === bmsK.value) {
+                                        isPrjFeatureMatch = true;
+                                        // isKeyMatch = true;
+                                        break;
+                                    } else {
+                                        //key相同而value不同,则无需再循环,直接退出
+                                        break;
+                                    }
+                                }
+                            }
+                            if (isPrjFeatureMatch) {
+                                rst = true;
+                                break;
+                            }
+                    }
+                        return rst;
+                    };
+                    let isMatch = true;
+                    // 1. 基本数量
+                    // 先判断此bills是否有配置
+                    for (const bm of billsUnitPriceFeature.feature.basicMappings) {
+                        if (bm.parentBasicKeys.length === billsUnitPriceFeature.feature.basicKeyOptions.length) {
+                            for (let kIdx = 0; kIdx < bm.parentBasicKeys.length; kIdx++) {
+                                if (bm.parentBasicKeys[kIdx] !== 'ALL' && node[billsUnitPriceFeature.feature.basicKeyOptions[kIdx]] !== bm.parentBasicKeys[kIdx]) {
+                                    isMatch = false;
+                                    break;
+                                }
+                            }
+                        } else {
+                            isMatch = false;
+                            break;
+                        }
+                    }
+                    let basicValue = 0;
+                    if (isMatch) {
+                        //再根据相关项目属性指定基数
+                        for (const bms of billsUnitPriceFeature.feature.basicMappings.subs) {
+                            if (_chkKeys(bms.keys)) {
+                                basicValue = bms.basicValue;
+                                break;
+                            }
+                        }
+                    }
+                    // 2. 相关系数(允许多个)
+                    let factors = [];
+                    isMatch = true;
+                    for (const fm of billsUnitPriceFeature.feature.factorMappings) {
+                        if (fm.basicFactorKeys.length === billsUnitPriceFeature.feature.basicKeyOptions.length) {
+                            for (let kIdx = 0; kIdx < fm.basicFactorKeys.length; kIdx++) {
+                                if (fm.basicFactorKeys[kIdx] !== 'ALL' && node[billsUnitPriceFeature.feature.basicKeyOptions[kIdx]] !== fm.basicFactorKeys[kIdx]) {
+                                    isMatch = false;
+                                    break;
+                                }
+                            }
+                        } else {
+                            isMatch = false;
+                            break;
+                        }
+                    }
+                    if (isMatch) {
+                        for (const fms of billsUnitPriceFeature.feature.factorMappings.subs) {
+                            if (_chkKeys(fms.keys)) {
+                                factors.push(fms.basicValue); // 允许多个
+                            }
+                        }
+                    }
+                    //3. 装配(指标基价 即 默认的清单单价)
+                    let unitFeeVal = basicValue;
+                    for (const factor of factors) {
+                        unitFeeVal = unitFeeVal * parseFloat(factor);
+                    }
+                    // 暂时未设小数位数 scMathUtil.roundTo(unitFeeVal,2);
+                    node.calcFlag = 2; //当用户输入单价
+                    if (!node.hasOwnProperty('fees')) {
+                        node.fees = [];
+                    }
+                    node.fees.push({fieldName: 'common', unitFee: unitFeeVal, totalFee: 0, tenderUnitFee: unitFeeVal, tenderTotalFee: 0});
+                }
+            }
+        }
+    }
 
     //项目指引类型
     const itemType = {

+ 13 - 5
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('公路造价') ? '' : 'checked' %> for="radioBill">预算</label>
+                                    <label class="custom-control-label" <%= (compilationName.includes('公路造价') || compilationName.includes('广东农村养护(2021)')) ? '' : 'checked' %> for="radioBill">预算</label>
                                 </div>
-                                <div class="custom-control custom-radio custom-control-inline">
+                                <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" >
                         <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,12 +394,18 @@
                         </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)")) { %> style="display:none" <% } %>>
+                    <div class="form-group row" id="tender-feeStandard-group" <% if (compilationName.includes("内蒙古高速公路日常养护估算(2021)") || 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>
                     </div>
+                    <div class="form-group row" id="tender-adminLevel-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-adminLevel"></select>
+                        </div>
+                    </div>
                     <span class="form-text text-danger" id="feeStandard-info" style="display: none;">请选择费用标准</span>
                     <div class="form-group row" id="taxType_div">
                         <label for="staticEmail" class="col-auto col-form-label col-form-label-sm">计税方式</label>
@@ -822,7 +828,9 @@
     let rationValuation = '<%- rationValuation %>';
     let engineeringList = '<%- engineeringList %>';
     let compilationData = '<%- compilationData %>';
-    let estimationData = '<%- estimationValuation %>'
+    let estimationData = '<%- estimationValuation %>';
+    let adminLevelType = JSON.parse('<%- adminLevelType %>');
     compilationData = JSON.parse(compilationData.replace(/[\s\r\n]/g, ""));//去掉空格字符
+    _iniAdminLevel();
 </script>
 </html>

+ 42 - 34
web/building_saas/pm/js/pm_newMain.js

@@ -1805,6 +1805,23 @@ function initFeeStandardSel() {
     getStdCalcProgramFiles();
 }
 
+function _iniAdminLevel() {
+    //初始化行政等级(广东农村公路用)
+    $('#tender-adminLevel').empty();
+    let adminLevels = [];
+    adminLevels.push(adminLevelType.CITY_LEVEL);
+    adminLevels.push(adminLevelType.COUNTRY_SIDE_LEVEL);
+    adminLevels.push(adminLevelType.VLLAGE_LEVEL);
+    for (let feeName of adminLevels) {
+        let $opt = $(`<option value="${feeName}">${feeName}</option>`);
+        $('#tender-adminLevel').append($opt);
+    }
+    $('#tender-adminLevel')[0].selectedIndex = 0;
+    // changeFeeRate(currentEngLib);
+    // setTaxGroupHtml();
+    // getStdCalcProgramFiles();
+}
+
 function changeFeeStandard() {
     let currentEngLib = getEngineeringLib($('#tender-engineering').val() + $('#tender-feeStandard').val(), getEngineeringList());
     changeFeeRate(currentEngLib);
@@ -2551,39 +2568,35 @@ function AddProject() {
     }
 }
 
+function _getOptionDivDomStr(value, rdName, labelName, id, isChecked) {
+    return `
+        <div class="custom-control custom-radio custom-control-inline">
+            <input type="radio" value="${value}" name="${rdName}" ${isChecked ? "checked" : ""} id="${id}" class="custom-control-input">
+            <label class="custom-control-label" for="${id}">${labelName}</label>
+        </div>
+    `;
+}
+
 // 创建建设项目可选项
 function initProjectOptSet($target) {
     const html = `<div class="form-group row">
                         <label for="staticEmail" class="col-auto col-form-label col-form-label-sm">项目类型</label>
                         <div class="col">
-                            ${COMPILATION_NAME.includes('公路造价') ? `
-                            <div class="custom-control custom-radio custom-control-inline">
-                                <input type="radio" value="${SUGGESTION}" name="valuation-type" checked id="type-suggestion" class="custom-control-input">
-                                <label class="custom-control-label" for="type-suggestion">建议估算</label>
-                            </div>
-                            <div class="custom-control custom-radio custom-control-inline">
-                                <input type="radio" value="${FEASIBILITY}" name="valuation-type" id="type-feasibility" class="custom-control-input">
-                                <label class="custom-control-label" for="type-feasibility">可行性估算</label>
-                            </div>
-                            <div class="custom-control custom-radio custom-control-inline">
-                                <input type="radio" value="${ROUGH}" name="valuation-type" id="type-rough" class="custom-control-input">
-                                <label class="custom-control-label" for="type-rough">概算</label>
-                            </div>
+                            ${COMPILATION_NAME.includes('公路造价') ? ` 
+                                ${_getOptionDivDomStr(SUGGESTION, "valuation-type", "建议估算", "type-suggestion", true)}
+                                ${_getOptionDivDomStr(FEASIBILITY, "valuation-type", "可行性估算", "type-feasibility", false)}
+                                ${_getOptionDivDomStr(ROUGH, "valuation-type", "概算", "type-rough", false)}
                             ` : ''}
                             ${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>
+                                ${_getOptionDivDomStr(ESTIMATION, "valuation-type", "估算", "type-suggestion", true)}
+                                ` : `
+                                `
+                            }
+                            ${COMPILATION_NAME.includes('广东农村养护(2021)') ? `
+                                    ${_getOptionDivDomStr(BUDGET, "valuation-type", "预算", "type-budget", true)}
                                 ` : `
-                                <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>
+                                ${_getOptionDivDomStr(BUDGET, "valuation-type", "预算", "type-budget", !COMPILATION_NAME.includes('公路造价'))}
+                                ${_getOptionDivDomStr(BOQ, "valuation-type", "工程量清单", "type-boq", false)}
                                 `
                             }
                         </div>
@@ -2591,14 +2604,8 @@ function initProjectOptSet($target) {
                     <div class="form-group row hide-area" id="boq-type">
                         <label for="staticEmail" class="col-auto col-form-label col-form-label-sm">清单类型</label>
                         <div class="col">
-                            <div class="custom-control custom-radio custom-control-inline">
-                                <input type="radio" value="${BID_INVITATION}" name="boq-type-input" id="boq-type-tender" class="custom-control-input">
-                                <label class="custom-control-label" for="boq-type-tender">招标</label>
-                            </div>
-                            <div class="custom-control custom-radio custom-control-inline">
-                                <input type="radio" value="${BID_SUBMISSION}" name="boq-type-input" id="boq-type-bidder" class="custom-control-input" checked>
-                                <label class="custom-control-label" for="boq-type-bidder">投标</label>
-                            </div>
+                            ${_getOptionDivDomStr(BID_INVITATION, "boq-type-input", "招标", "boq-type-tender", false)}
+                            ${_getOptionDivDomStr(BID_SUBMISSION, "boq-type-input", "投标", "boq-type-bidder", true)}
                         </div>
                     </div>`;
     //const $children = $(html);
@@ -3154,7 +3161,8 @@ function AddTender() {
         }*/
 
         let IDGroup = $("#tender-calcProgram").val();
-        if (!IDGroup || IDGroup === '') {
+        // 如果compilationData有估算(estimation_valuation)的话,可以不要计算程序吧
+        if ((!IDGroup || IDGroup === '') && (compilationData.estimation_valuation.length === 0)) {
             setDangerInfo($('#calcProgram-info'), '请选择计算程序');
             return false;
         }

+ 1 - 1
web/building_saas/report/js/rpt_print.js

@@ -265,7 +265,7 @@ function buildText(destRst, cell, font, control, offsetX, offsetY, adjustY, canv
             let innerDftFontHeight = (dftFontHeight * 3 / 4); //SVG的字体与canvas的字体大小的切换, 不用考虑取整
             if (control) {
                 if (control[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]] === "top") {
-                    y = innerArea[JV.IDX_TOP] + JV.OUTPUT_OFFSET[JV.IDX_TOP] + orgFontHeight;
+                    y = innerArea[JV.IDX_TOP] + JV.OUTPUT_OFFSET[JV.IDX_TOP];
                 } else if (control[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]] === "bottom") {
                     y = innerArea[JV.IDX_BOTTOM] - JV.OUTPUT_OFFSET[JV.IDX_BOTTOM];
                 } else if (control[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]] === "center") {

+ 1 - 0
web/over_write/guangdongnongcun.js

@@ -0,0 +1 @@
+const is_GD_NONGCUN = true;

+ 2 - 0
web/over_write/js/neimeng_gusuan.js

@@ -0,0 +1,2 @@
+
+const isNM_ESTIMATION = true;