浏览代码

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/YangHuCost

TonyKang 5 年之前
父节点
当前提交
e42e51b554

+ 1 - 0
modules/complementary_glj_lib/controllers/gljController.js

@@ -43,6 +43,7 @@ class GljController extends BaseController{
             versionName: req.session.compilationVersion,
             versionName: req.session.compilationVersion,
             LicenseKey:config.getLicenseKey(process.env.NODE_ENV),
             LicenseKey:config.getLicenseKey(process.env.NODE_ENV),
             overWriteUrl: overWriteUrl,
             overWriteUrl: overWriteUrl,
+            title:config[process.env.NODE_ENV].title?config[process.env.NODE_ENV].title:"?????????"
         });
         });
     }
     }
     getGljDistType (req, res) {
     getGljDistType (req, res) {

+ 14 - 4
modules/fee_rates/facade/fee_rates_facade.js

@@ -320,10 +320,20 @@ function setRatesByMap(newFeeRate,subMap,decimal){
                 let t_p = subMap[p.name];
                 let t_p = subMap[p.name];
                 if(t_p){//找到同名的子项
                 if(t_p){//找到同名的子项
                     //获取选中的节点
                     //获取选中的节点
-                    let selected = _.find(t_p.optionList,{"selected":true});
-                    for(let s of p.optionList){
-                        s.selected = selected && selected.name == s.name?true:false;//设置新费率的选中项
-                    }
+                    let selected = _.find(t_p.optionList, { "selected": true });
+                    let match = false;
+                    for (let s of p.optionList) {
+                      s.selected = false;
+                      if (selected && selected.name == s.name) { 
+                        s.selected = true;//设置新费率的选中项
+                        match = true;
+                      }     
+                     }
+                    if (selected && match == false) { 
+                      //如果原来旧的有选中项,但是新的却没匹配上,说明没有对应的下拉框,选择默认第一个
+                      p.optionList[0].selected = true;
+                      selected = p.optionList[0];
+                    }  
                     if(selected){//如果有选中项,则从valueMap中找出值并设置到rate上// ;
                     if(selected){//如果有选中项,则从valueMap中找出值并设置到rate上// ;
                         let map = _.find(r.subFeeRate.valueMaps,{ID:selected.name});
                         let map = _.find(r.subFeeRate.valueMaps,{ID:selected.name});
                         if(map){
                         if(map){

+ 13 - 1
modules/main/facade/common_facade.js

@@ -129,4 +129,16 @@ async function getUnitPriceFileId(projectId) {
     projectData = projectData[0];
     projectData = projectData[0];
     result = projectData.property.unitPriceFile !== undefined ? projectData.property.unitPriceFile.id : 0;
     result = projectData.property.unitPriceFile !== undefined ? projectData.property.unitPriceFile.id : 0;
     return result;
     return result;
-};
+};
+
+function getIndex(obj,tpops){
+  let pops = tpops?tpops:['code','name','specs','unit','type'];
+  let t_index = '';
+  let k_arr=[];
+  for(let p of pops){
+      let tmpK = (obj[p]==undefined||obj[p]==null||obj[p]=='')?'null':obj[p];
+      k_arr.push(tmpK);
+  }
+  t_index=k_arr.join("|-|");
+  return t_index;
+}

+ 1 - 1
modules/pm/controllers/pm_controller.js

@@ -932,7 +932,7 @@ module.exports = {
     getImportTemplateData: async function (req, res) {
     getImportTemplateData: async function (req, res) {
         try {
         try {
             const data = JSON.parse(req.body.data);
             const data = JSON.parse(req.body.data);
-            const templateData = await pm_facade.getImportTemplateData(req.session.sessionCompilation._id, data.valuationID, data.projectCount);
+            const templateData = await pm_facade.getImportTemplateData(req.session.sessionCompilation._id, data.feeName, data.valuationID, data.projectCount);
             callback(req, res, 0, 'success', templateData);
             callback(req, res, 0, 'success', templateData);
         } catch (err) {
         } catch (err) {
             callback(req, res, 1, err, null);
             callback(req, res, 1, err, null);

+ 2 - 2
modules/pm/facade/pm_facade.js

@@ -2524,8 +2524,8 @@ async function getBasicInfo(compilationID, fileKind = null) {
 }
 }
 
 
 // 获取导入接口功能的模板数据,用于将导入数据与模板数据进行合并生成新的项目
 // 获取导入接口功能的模板数据,用于将导入数据与模板数据进行合并生成新的项目
-async function getImportTemplateData(compilationID, valuationID, projectCount) {
-    const engineeringLib = await engineeringModel.findOne({ feeName: '公路工程', valuationID }).lean();
+async function getImportTemplateData(compilationID, feeName, valuationID, projectCount) {
+    const engineeringLib = await engineeringModel.findOne({ feeName, valuationID }).lean();
     if (!engineeringLib) {
     if (!engineeringLib) {
         return null;
         return null;
     }
     }

+ 5 - 1
modules/pm/models/project_model.js

@@ -192,7 +192,11 @@ ProjectsDAO.prototype.updateUserProjects = async function (userId, compilationId
                         let assign = {
                         let assign = {
                             valuationType: data.updateData.property.valuationType === ValuationType.BUDGET ? '预算' : '工程量清单',
                             valuationType: data.updateData.property.valuationType === ValuationType.BUDGET ? '预算' : '工程量清单',
                             engineering: data.updateData.property.engineeringName,
                             engineering: data.updateData.property.engineeringName,
-                            feeStandard: data.updateData.property.feeStandardName
+                            feeStandard: data.updateData.property.feeStandardName,
+                            // 新建分段文件时,默认将“工程特征”-“单项工程名称”、“编制范围”填写分段文件的名称
+                            // 为了防止用户漏填,导出电子招标文件时,有数据
+                            compilationScope: data.updateData.name,
+                            singleProjName: data.updateData.name,
                         };
                         };
                         data.updateData.property.projectFeature = await pmFacade.getProjectFeature(data.updateData.property.featureLibID, assign);
                         data.updateData.property.projectFeature = await pmFacade.getProjectFeature(data.updateData.property.featureLibID, assign);
                     }
                     }

+ 5 - 1
public/scHintBox.html

@@ -178,7 +178,11 @@
             const btnType = hintBox.btnType.yesNo;
             const btnType = hintBox.btnType.yesNo;
             const doYes = () => {
             const doYes = () => {
                 $("#hintBox_form").modal('hide');
                 $("#hintBox_form").modal('hide');
-                CommonHeader.getCategoryList();
+                if (COMPILATION_NAME === '公路造价(2018)') {
+                    window.open('https://smartcost.com.cn/contact2');                    
+                } else {
+                    CommonHeader.getCategoryList();
+                }
             };
             };
             const doNo = () => $("#hintBox_form").modal('hide');
             const doNo = () => $("#hintBox_form").modal('hide');
             const btnTextArr = ['联系客服', '关闭'];
             const btnTextArr = ['联系客服', '关闭'];

+ 1 - 1
public/web/tree_sheet/tree_sheet_helper.js

@@ -703,7 +703,7 @@ var TREE_SHEET_HELPER = {
         },600)
         },600)
     },
     },
     delayShowTips:function(hitinfo,setting,tips){//延时显示
     delayShowTips:function(hitinfo,setting,tips){//延时显示
-        let delayTimes = 500; //延时时间
+        let delayTimes = 200; //延时时间
         let now_timeStamp = +new Date();
         let now_timeStamp = +new Date();
         TREE_SHEET_HELPER.tipTimeStamp = now_timeStamp;
         TREE_SHEET_HELPER.tipTimeStamp = now_timeStamp;
         setTimeout(function () {
         setTimeout(function () {

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

@@ -99,7 +99,7 @@
                       <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="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>
                       <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>
                       <div class="btn-group ml-2">
                       <div class="btn-group ml-2">
-                          <a class="dropdown-toggle" data-toggle="dropdown" href="#" id="moreMenuA" role="button" aria-haspopup="true" aria-expanded="false">更多</a>
+                          <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">
                           <div class="dropdown-menu dropright" id="moreMenu">
                               <a id="displayA" href="javascript:void(0);" data-toggle="dropdown" class="dropdown-item dropdown-toggle"><i class="fa fa-list-ol"></i> 显示至...</a>
                               <a id="displayA" href="javascript:void(0);" data-toggle="dropdown" class="dropdown-item dropdown-toggle"><i class="fa fa-list-ol"></i> 显示至...</a>
                               <div id="subDisplay" class="dropdown-menu dropdown-menu-left" style="min-width: 6.5rem; position: absolute; transform: translate3d(158px, 3px, 0px); top: 0px; left: 0px; will-change: transform;" x-placement="right-start">
                               <div id="subDisplay" class="dropdown-menu dropdown-menu-left" style="min-width: 6.5rem; position: absolute; transform: translate3d(158px, 3px, 0px); top: 0px; left: 0px; will-change: transform;" x-placement="right-start">
@@ -112,7 +112,7 @@
                               </div>
                               </div>
                               <!--<a href="javascript:void(0);" id="ZLFB_btn" class="dropdown-item" data-placement="bottom"><i class="fa fa-retweet" aria-hidden="true"></i> 整理分部</a>
                               <!--<a href="javascript:void(0);" id="ZLFB_btn" class="dropdown-item" data-placement="bottom"><i class="fa fa-retweet" aria-hidden="true"></i> 整理分部</a>
                                 <a id="switchTznr" href="javascript:void(0);"  class="dropdown-item"><i class="fa fa-eye" aria-hidden="true"></i> 显示特征</a>-->
                                 <a id="switchTznr" href="javascript:void(0);"  class="dropdown-item"><i class="fa fa-eye" aria-hidden="true"></i> 显示特征</a>-->
-                            <% if(overWriteUrl === '/web/over_write/js/quanguo_2018.js' && boqType) { %>
+                            <% if((compilationName === '公路造价(2018)' || compilationName === '安徽养护(2018)') && boqType) { %>
                                 <a class="dropdown-item" id="open-export-modal" href="javascript:void(0);" data-toggle="modal" data-target="#interface-export-modal"><i class="fa fa-code-fork"></i> 数据接口</a>
                                 <a class="dropdown-item" id="open-export-modal" href="javascript:void(0);" data-toggle="modal" data-target="#interface-export-modal"><i class="fa fa-code-fork"></i> 数据接口</a>
                             <% }%>
                             <% }%>
                             <% if (projectData.property.lockBills == true) { %>
                             <% if (projectData.property.lockBills == true) { %>

+ 3 - 2
web/building_saas/main/js/models/calc_program.js

@@ -1887,10 +1887,11 @@
 
 
        ftObj.totalFee = btf.toDecimal(decimalObj.bills.totalPrice);
        ftObj.totalFee = btf.toDecimal(decimalObj.bills.totalPrice);
        ftObj.tenderTotalFee = bttf.toDecimal(decimalObj.bills.totalPrice);
        ftObj.tenderTotalFee = bttf.toDecimal(decimalObj.bills.totalPrice);
-       if (treeNode.parent) { // 非大项费用才需要计算、显示单价
+       // 需求变更:BUG #2980 预算项目类型,造价书大项费用的经济指标,在有数量有金额的情况下要反算求值(等于金额/数量),工程量清单项目类型不处理。
+       // if (treeNode.parent) { // 非大项费用才需要计算、显示单价
          ftObj.unitFee = buf.toDecimal(decimalObj.bills.unitPrice);
          ftObj.unitFee = buf.toDecimal(decimalObj.bills.unitPrice);
          ftObj.tenderUnitFee = btuf.toDecimal(decimalObj.bills.unitPrice);
          ftObj.tenderUnitFee = btuf.toDecimal(decimalObj.bills.unitPrice);
-       }
+       // }
 
 
        calcTools.checkFeeField(treeNode, ftObj);
        calcTools.checkFeeField(treeNode, ftObj);
 
 

+ 6 - 1
web/building_saas/main/js/views/importBills.js

@@ -100,6 +100,12 @@ const importBills = (function () {
             if (!code && !name || /合计/.test(code)) {   //过滤掉同时没有编号和名称的、过滤合计行
             if (!code && !name || /合计/.test(code)) {   //过滤掉同时没有编号和名称的、过滤合计行
                 continue;
                 continue;
             }
             }
+            // “子目号”、“单位”、“数量”都为空,“子目名称”不为空时,应将此行清单名称合并到上一行
+            let lastData = rst[rst.length - 1];
+            if (!code && !unit && !quantity && name) {
+                lastData.name += name;
+                continue;
+            }
             //表格内的数据
             //表格内的数据
             code = String(code);
             code = String(code);
             let depth = getDepth(code);
             let depth = getDepth(code);
@@ -114,7 +120,6 @@ const importBills = (function () {
                 depth: depth,
                 depth: depth,
                 unitPriceAnalysis: 1,
                 unitPriceAnalysis: 1,
             };
             };
-            let lastData = rst[rst.length - 1];
             //获取data的父节点链,成为兄弟节点,只能在父链里找前兄弟(不能跨父链)
             //获取data的父节点链,成为兄弟节点,只能在父链里找前兄弟(不能跨父链)
             let parents = getParents(lastData);
             let parents = getParents(lastData);
             let preData = findLast(parents, x => x.depth === depth);
             let preData = findLast(parents, x => x.depth === depth);

+ 3 - 1
web/building_saas/main/js/views/main_tree_col.js

@@ -33,7 +33,9 @@ let MainTreeCol = {
         // CSL, 2017-11-28
         // CSL, 2017-11-28
         calcProgramName: function (node) {
         calcProgramName: function (node) {
             let programID = node.data.programID;
             let programID = node.data.programID;
-            if (!programID) return
+            if (!programID){
+              return node.sourceType === projectObj.project.Bills.getSourceType()?"":"请选择…";
+            } 
             else return projectObj.project.calcProgram.compiledTemplateMaps[programID];
             else return projectObj.project.calcProgram.compiledTemplateMaps[programID];
         },
         },
         calcBase: function (node) {
         calcBase: function (node) {

+ 3 - 1
web/building_saas/pm/html/project-management-share.html

@@ -53,7 +53,9 @@
                     <span style="display: none" id="copyShareEng-info" class="form-text text-danger">单项工程不可为空</span>
                     <span style="display: none" id="copyShareEng-info" class="form-text text-danger">单项工程不可为空</span>
                 </div>-->
                 </div>-->
                 <div class="form-group">
                 <div class="form-group">
-                    <p id="copyShare_name">拷贝后,工程将重命名为 "<b>建筑工程2(张三共享)</b>"</p>
+                    <label>分 段</label>
+                    <input id="copyShare_name" class="form-control"></input>
+                    <span style="display: none" id="copyShareTender-info" class="form-text text-danger">已存在同名分段</span>
                 </div>
                 </div>
             </div>
             </div>
             <div class="modal-footer">
             <div class="modal-footer">

+ 1 - 1
web/building_saas/pm/js/pm_newMain.js

@@ -337,7 +337,7 @@ const projTreeObj = {
             name: '导入接口文件',
             name: '导入接口文件',
             icon: 'fa-cloud-upload',
             icon: 'fa-cloud-upload',
             visible: function () {
             visible: function () {
-                const names = ['公路造价(2018)'];
+                const names = ['公路造价(2018)', '安徽养护(2018)'];
                 return compilationData && names.includes(compilationData.name);
                 return compilationData && names.includes(compilationData.name);
             },
             },
             callback: function () {
             callback: function () {

+ 24 - 30
web/building_saas/pm/js/pm_share.js

@@ -791,19 +791,19 @@ const pmShare = (function () {
                     }
                     }
                 },
                 },
                 "copyProject": {
                 "copyProject": {
-                  name: "拷贝建设项目",
-                  icon: 'fa-copy',
-                  disabled: function () {
-                      let selected = tree.selected;
-                      return !(selected && selected.data.allowCopy && selected.data.projType === projectType.project);
-                  },
-                  callback: function (key, opt) {
-                      /* if($(".p-title").text().includes('学习')){
-                        hintBox.versionBox('此功能仅在专业版中提供,学习版可选择单个分段进行拷贝。');
-                        return;
-                      } */
-                      copyContructionProject(tree.selected);
-                  }
+                    name: "拷贝建设项目",
+                    icon: 'fa-copy',
+                    disabled: function () {
+                        let selected = tree.selected;
+                        return !(selected && selected.data.allowCopy && selected.data.projType === projectType.project);
+                    },
+                    callback: function (key, opt) {
+                        if ($(".p-title").text().includes('学习')) {
+                            hintBox.versionBox('此功能仅在专业版中提供,学习版可选择单个分段进行拷贝。');
+                            return;
+                        }
+                        copyContructionProject(tree.selected);
+                    }
                 },
                 },
                 "cancel": {
                 "cancel": {
                     name: "清除",
                     name: "清除",
@@ -899,15 +899,20 @@ const pmShare = (function () {
                 return alert('当前分段与目标建设项目的项目类型不同,请选择其他建设项目进行复制。');
                 return alert('当前分段与目标建设项目的项目类型不同,请选择其他建设项目进行复制。');
             }
             }
             let copyMap = { copy: null, update: null };
             let copyMap = { copy: null, update: null };
-            let newName = getCopyName(selected);
+            let newName = $('#copyShare_name').val();
+            if (!newName) {
+                $('#copyShareTender-info').text('分段名称不可为空');
+                $('#copyShareTender-info').show();
+                return;
+            }
             //获取建设项目的分段
             //获取建设项目的分段
             let tenderQuery = { $or: [{ deleteInfo: null }, { 'deleteInfo.deleted': false }], userID: userID, ParentID: projID };
             let tenderQuery = { $or: [{ deleteInfo: null }, { 'deleteInfo.deleted': false }], userID: userID, ParentID: projID };
             const rstData = await ajaxPost('/pm/api/getProjectsByQuery', { user_id: userID, query: tenderQuery, options: '-_id -property' }, 10000);
             const rstData = await ajaxPost('/pm/api/getProjectsByQuery', { user_id: userID, query: tenderQuery, options: '-_id -property' }, 10000);
             let updateTender = null;
             let updateTender = null;
             for (let tender of rstData) {
             for (let tender of rstData) {
                 if (tender.name === newName) {
                 if (tender.name === newName) {
-                    $('#copyShare_name').text('已存在此单位工程。');
-                    $('#copyShare_name').addClass('text-danger');
+                    $('#copyShareTender-info').text('已存在同名分段');
+                    $('#copyShareTender-info').show();
                     return;
                     return;
                 }
                 }
                 if (tender.NextSiblingID == -1) {
                 if (tender.NextSiblingID == -1) {
@@ -1062,33 +1067,22 @@ const pmShare = (function () {
         $('#copyShare').on('hidden.bs.modal', function () {
         $('#copyShare').on('hidden.bs.modal', function () {
             $('#copyShareProj-info').hide();
             $('#copyShareProj-info').hide();
             $('#copyShareEng-info').hide();
             $('#copyShareEng-info').hide();
+            $('#copyShareTender-info').hide();
         });
         });
         //打开拷贝工程
         //打开拷贝工程
         $('#copyShare').on('shown.bs.modal', function () {
         $('#copyShare').on('shown.bs.modal', function () {
             setCopyModal();
             setCopyModal();
             //更改显示名称
             //更改显示名称
-            let newName = getCopyName(shareSeleted);
-            $('#copyShare_name').html(`拷贝后,工程将重命名为 "<b>${newName}</b>"`);
-            $('#copyShare_name').removeClass('text-danger');
+            $('#copyShare_name').val(shareSeleted.data.name);
         });
         });
         //拷贝工程改变选择建设项目
         //拷贝工程改变选择建设项目
         $('#copyShare_selectProj').change(function () {
         $('#copyShare_selectProj').change(function () {
-            //更改显示名称
-            let newName = getCopyName(shareSeleted);
-            $('#copyShare_name').html(`拷贝后,工程将重命名为 "<b>${newName}</b>"`);
-            $('#copyShare_name').removeClass('text-danger');
             $('#copyShareProj-info').hide();
             $('#copyShareProj-info').hide();
             $('#copyShareEng-info').hide();
             $('#copyShareEng-info').hide();
+            $('#copyShareTender-info').hide();
             let curSelID = $(this).select().val();
             let curSelID = $(this).select().val();
             setEng(parseInt(curSelID));
             setEng(parseInt(curSelID));
         });
         });
-        //拷贝工程改变选择单项工程
-        $('#copyShare_selectEng').change(function () {
-            //更改显示名称
-            let newName = getCopyName(shareSeleted);
-            $('#copyShare_name').html(`拷贝后,工程将重命名为 "<b>${newName}</b>"`);
-            $('#copyShare_name').removeClass('text-danger');
-        });
         //确认拷贝
         //确认拷贝
         $('#copyShare_confirm').click(function () {
         $('#copyShare_confirm').click(function () {
             let selProj = $('#copyShare_selectProj').select().val();
             let selProj = $('#copyShare_selectProj').select().val();

+ 31 - 3
web/building_saas/standard_interface/export/anhui_maanshan.js

@@ -314,12 +314,32 @@ INTERFACE_EXPORT = (() => {
       [fixedFlag.PROVISIONAL]: '5',
       [fixedFlag.PROVISIONAL]: '5',
       [fixedFlag.TOTAL_COST]: '6',
       [fixedFlag.TOTAL_COST]: '6',
     };
     };
+    // 标题映射
+    /*     写死:
+    “第100章至700章清单”输出=1、
+    “已包含在清单合计中的材料、工程设备、专业工程暂估价合计”输出=9、
+    “清单合计减去材料、工程设备、专业工程暂估价合计”输出=10、
+    “计日工合计”输出=11、
+    “暂列金额(不含计日工总额)”输出=12、
+    “投标报价”输出=13;
+    如果有新增的同级的大项费用,则以14开始编号 */
+    const BillsTitleValue = {
+      [fixedFlag.ONE_SEVEN_BILLS]: '1',
+      [fixedFlag.PROVISIONAL_TOTAL]: '9',
+      [fixedFlag.BILLS_TOTAL_WT_PROV]: '10',
+      [fixedFlag.DAYWORK_LABOR]: '11',
+      [fixedFlag.PROVISIONAL]: '12',
+      [fixedFlag.TOTAL_COST]: '13',
+    };
+    let curTitleValue;
     // 清单标题 造价书的第一层数据。
     // 清单标题 造价书的第一层数据。
     function QdBt(node, allNodes) {
     function QdBt(node, allNodes) {
       const row = node.row();
       const row = node.row();
       const orgFee = getFee(node.data.fees, 'common.tenderTotalFee');
       const orgFee = getFee(node.data.fees, 'common.tenderTotalFee');
       const fee = isBidInvitation ? '0' : orgFee;
       const fee = isBidInvitation ? '0' : orgFee;
-      const titleType = BillsTitleType[node.getFlag()];
+      const flag = node.getFlag();
+      const bm = BillsTitleValue[flag] || curTitleValue++;
+      const titleType = BillsTitleType[flag];
       const calcBase = titleType === '5'
       const calcBase = titleType === '5'
         ? orgFee
         ? orgFee
         : node.data.calcBase
         : node.data.calcBase
@@ -327,7 +347,7 @@ INTERFACE_EXPORT = (() => {
           : '';
           : '';
       const attrs = [
       const attrs = [
         { name: 'Xh', value: row, type: TYPE.INT }, // 序号
         { name: 'Xh', value: row, type: TYPE.INT }, // 序号
-        { name: 'Bm', value: node.data.code }, // 编码
+        { name: 'Bm', value: bm }, // 编码
         { name: 'Name', value: node.data.name }, // 名称
         { name: 'Name', value: node.data.name }, // 名称
         { name: 'Je', value: fee, type: TYPE.DECIMAL }, // 金额
         { name: 'Je', value: fee, type: TYPE.DECIMAL }, // 金额
         { name: 'Code', value: `F${row}` }, // 行引用
         { name: 'Code', value: `F${row}` }, // 行引用
@@ -341,6 +361,13 @@ INTERFACE_EXPORT = (() => {
     // 清单明细 (只有100-700章清单标题输出)
     // 清单明细 (只有100-700章清单标题输出)
     function QdMx(node, allNodes) {
     function QdMx(node, allNodes) {
       const row = node.row();
       const row = node.row();
+      // 编码: 清单非章级的,读取清单编码列。章级的清单,写死:“清单第100章总则”输出=100,“清单第200章”输出=200,依次类推。可以判断章级的,取清单名称中的数字。
+      let code = node.data.code || '';
+      const name = node.data.name || '';
+      const codeMatched = name.match(/第\s*(\d+)\s*章/);
+      if (codeMatched && codeMatched[1]) {
+        code = codeMatched[1];
+      }
       const iszg = node.data.specialProvisional === '专业工程';
       const iszg = node.data.specialProvisional === '专业工程';
       const calcBaseBeFee = iszg || node.getFlag() === fixedFlag.PROVISIONAL;
       const calcBaseBeFee = iszg || node.getFlag() === fixedFlag.PROVISIONAL;
       const orgFee = getFee(node.data.fees, 'common.tenderTotalFee');
       const orgFee = getFee(node.data.fees, 'common.tenderTotalFee');
@@ -351,7 +378,7 @@ INTERFACE_EXPORT = (() => {
           : '';
           : '';
       const attrs = [
       const attrs = [
         { name: 'Xh', value: row, type: TYPE.INT }, // 序号
         { name: 'Xh', value: row, type: TYPE.INT }, // 序号
-        { name: 'Qdbm', value: node.data.code, minLen: 1 }, // 编码
+        { name: 'Qdbm', value: code, minLen: 1 }, // 编码
         { name: 'Name', value: node.data.name }, // 名称
         { name: 'Name', value: node.data.name }, // 名称
         { name: 'Dw', value: node.data.unit }, // 单位
         { name: 'Dw', value: node.data.unit }, // 单位
         { name: 'Sl', value: node.data.quantity, type: TYPE.DECIMAL }, // 工程量
         { name: 'Sl', value: node.data.quantity, type: TYPE.DECIMAL }, // 工程量
@@ -617,6 +644,7 @@ INTERFACE_EXPORT = (() => {
         projectGLJIDToRcjID[glj.id] = index + 1;
         projectGLJIDToRcjID[glj.id] = index + 1;
         projectGLJMap[glj.id] = glj;
         projectGLJMap[glj.id] = glj;
       });
       });
+      curTitleValue = 14;
       const dwgcxx = new Dwgcxx(tenderData.name, feature);
       const dwgcxx = new Dwgcxx(tenderData.name, feature);
       dwgcxx.children.push(
       dwgcxx.children.push(
         setupFeeRate(curDetail.FeeRate, info),
         setupFeeRate(curDetail.FeeRate, info),

+ 2 - 1
web/building_saas/standard_interface/import/base.js

@@ -402,7 +402,8 @@ const INTERFACE_EXPORT_BASE = (() => {
       throw '导入的文件中不存在有效的标段数据。';
       throw '导入的文件中不存在有效的标段数据。';
     }
     }
     const projectCount = 1 + importData.tenders.length;
     const projectCount = 1 + importData.tenders.length;
-    const templateData = await ajaxPost('/pm/api/getImportTemplateData', { user_id: userID, valuationID, projectCount });
+    const feeName = compilationData.name === '安徽养护(2018)' ? '安徽养护' : '公路工程';
+    const templateData = await ajaxPost('/pm/api/getImportTemplateData', { user_id: userID, valuationID, feeName, projectCount });
     if (!templateData) {
     if (!templateData) {
       throw '无法获取有效模板数据。';
       throw '无法获取有效模板数据。';
     }
     }

+ 3 - 0
web/building_saas/standard_interface/index.js

@@ -41,6 +41,9 @@ const STD_INTERFACE = (() => {
     const parentMap = {};
     const parentMap = {};
     connectedAreas.forEach(connectedArea => {
     connectedAreas.forEach(connectedArea => {
       const areas = connectedArea.split('@');
       const areas = connectedArea.split('@');
+      if (COMPILATION_NAME === '安徽养护(2018)' && areas[0] !== '安徽') {
+        return;
+      }
       (parentMap[areas[0]] || (parentMap[areas[0]] = [])).push(areas[1]);
       (parentMap[areas[0]] || (parentMap[areas[0]] = [])).push(areas[1]);
     });
     });
     const parentAreasHtml = Object
     const parentAreasHtml = Object

+ 3 - 0
web/common/html/header.html

@@ -1,3 +1,6 @@
+<script>
+    const COMPILATION_NAME = '<%= compilationName %>';
+</script>
 <img id="f_btn" src="/web/dest/css/img/feeRate_btn.jpg" alt="" style="display: none" />
 <img id="f_btn" src="/web/dest/css/img/feeRate_btn.jpg" alt="" style="display: none" />
 <% if(typeof socketPort != 'undefined'){ %>
 <% if(typeof socketPort != 'undefined'){ %>
 <input id="socketPort" value="<%= socketPort %>" type="hidden">
 <input id="socketPort" value="<%= socketPort %>" type="hidden">

+ 90 - 0
web/over_write/js/hunan_2014.js

@@ -1,3 +1,52 @@
+
+let isHN2014 = true;
+
+function overwriteRationCalcBases(taxType) {
+  if (typeof rationCalcBases == 'undefined') return;
+  for (let key in rationCalcBases) delete rationCalcBases[key];
+  // let isJY = taxType == '2';
+  rationCalcBases['人工费'] = function (node, isTender) {
+    return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptMarketPrice, isTender);
+  };
+  rationCalcBases['材料费'] = function (node, isTender) {
+    return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptMarketPrice, isTender);
+  };
+  rationCalcBases['施工机械使用费'] = function (node, isTender) {
+    return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptMarketPrice, isTender);
+  };
+  rationCalcBases['商品砼费'] = function (node, isTender) {
+    return calcTools.rationBaseFee(node, [gljType.COMMERCIAL_CONCRETE, gljType.COMMERCIAL_MORTAR], priceTypes.ptMarketPrice, isTender);
+  };
+  rationCalcBases['外购砼构件费'] = function (node, isTender) {
+    return calcTools.rationBaseFee(node, [gljType.PURCHASE_COMPONENT], priceTypes.ptMarketPrice, isTender);
+  };
+  rationCalcBases['设备购置费'] = function (node, isTender) {
+    return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice, isTender);
+  }
+};
+
+(function overwriteFeeTypes() {
+  if (typeof cpFeeTypes == 'undefined') return;
+  cpFeeTypes = [
+    { type: 'marketDirect', name: '直接费' },
+    { type: 'marketDirectWork', name: '直接工程费' },
+    { type: 'marketLabour', name: '人工费' },
+    { type: 'marketMaterial', name: '材料费' },
+    { type: 'marketMachine', name: '施工机械使用费' },
+    { type: 'otherFee', name: '其他工程费' },
+    { type: 'otherFee1', name: '其他工程费I' },
+    { type: 'otherFee2', name: '其他工程费II' },
+    { type: "indirect", name: '间接费' },
+    { type: 'manage', name: '企业管理费' },
+    { type: 'force', name: '规费' },
+    { type: 'profit', name: '利润' },
+    { type: 'tax', name: '税金' },
+    { type: 'common', name: '建安费' }
+  ];
+})();
+
+
+
 // 清单基数
 // 清单基数
 const progression = ['养护工程管理经费(大修工程)', '养护工程管理经费(中修工程)', '养护工程监理费(路线工程)', '养护工程监理费(桥梁及隧道工程)', '养护工程设计文件审查费', '工程设计费(路线工程)', '工程设计费(桥梁、隧道工程)'];
 const progression = ['养护工程管理经费(大修工程)', '养护工程管理经费(中修工程)', '养护工程监理费(路线工程)', '养护工程监理费(桥梁及隧道工程)', '养护工程设计文件审查费', '工程设计费(路线工程)', '工程设计费(桥梁、隧道工程)'];
 const deficiency = { '养护工程设计文件审查费': 4500 };
 const deficiency = { '养护工程设计文件审查费': 4500 };
@@ -254,10 +303,51 @@ if (typeof baseFigureTemplate !== 'undefined') {
   };
   };
 }
 }
 
 
+//湖南2014工地转移费率值修改特殊处理
+if (typeof feeRateObject !== "undefined") {
+  feeRateObject.feeRateSpecialHandle = function (subRate, value) {
+    let result = {};
+    if (subRate.name == "工地转移(km)" && value && value < 50) {
+      //工地转移50km以内按0km算
+      result.valueKey = "0";
+      result.value = scMathUtil.roundForObj(value, getDecimal("feeRate")); //设置显示的节点值
+    }
+    return result;
+  };
+}
+
+if (typeof electrovalenceObj !== 'undefined') {
+  electrovalenceObj.options = [
+      { code: "870", name: "电网电", specs: "", unit: "kW·h", type: "201" },
+      { code: "1791", name: "5kw以内柴油发电机组", specs: "5GF1", unit: "台班", type: "301" },
+      { code: "1792", name: "15kw以内柴油发电机组", specs: "12GF1", unit: "台班", type: "301" },
+      { code: "1793", name: "30kw以内柴油发电机组", specs: "30GFY-2", unit: "台班", type: "301" },
+      { code: "1794", name: "50kw以内柴油发电机组", specs: "50GFY-2", unit: "台班", type: "301" },
+      { code: "1795", name: "75kw以内柴油发电机组", specs: "75GFY-4", unit: "台班", type: "301" },
+      { code: "1796", name: "100kw以内柴油发电机组", specs: "90GFZ", unit: "台班", type: "301" },
+      { code: "1797", name: "120kw以内柴油发电机组", specs: "120GFY-4", unit: "台班", type: "301" },
+      { code: "1798", name: "160kw以内柴油发电机组", specs: "160GF", unit: "台班", type: "301" },
+      { code: "1799", name: "200kw以内柴油发电机组", specs: "200GF", unit: "台班", type: "301" },
+      { code: "1800", name: "250kw以内柴油发电机组", specs: "250GF4-4", unit: "台班", type: "301" },
+      { code: "1801", name: "320kw以内柴油发电机组", specs: "320GF-2", unit: "台班", type: "301" }
+  ]
+}
+
+if (typeof gljUtil !== 'undefined') {
+  gljUtil.getCodeSortMath = getCodeSortMath;
+  gljUtil.getElecCoe = function () {
+      return 0.24;
+  }
+}
+
 if (typeof module !== 'undefined') {
 if (typeof module !== 'undefined') {
   module.exports = {
   module.exports = {
       progression,
       progression,
       deficiency,
       deficiency,
       beyond,
       beyond,
+      getDefalutAssistProductionFeeRate: function () {
+        return 5
+      }
   };
   };
+ 
 }
 }