Browse Source

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/YangHuCost

chenshilong 6 năm trước cách đây
mục cha
commit
6602380fdb
46 tập tin đã thay đổi với 340 bổ sung134 xóa
  1. 1 1
      modules/complementary_glj_lib/controllers/gljController.js
  2. 4 4
      modules/complementary_ration_lib/controllers/compleViewController.js
  3. 110 2
      modules/fee_rates/facade/fee_rates_facade.js
  4. 1 1
      modules/main/routes/main_route.js
  5. 1 1
      modules/pm/controllers/pm_controller.js
  6. 1 1
      modules/ration_glj/facade/ration_glj_facade.js
  7. 27 6
      modules/reports/rpt_component/helper/jpc_helper_cross_tab.js
  8. 38 8
      modules/reports/rpt_component/jpc_cross_tab.js
  9. 20 17
      modules/reports/rpt_component/jpc_ex.js
  10. 3 3
      modules/reports/rpt_component/jpc_flow_tab.js
  11. 1 1
      modules/users/controllers/boot_controller.js
  12. 4 4
      modules/users/controllers/user_controller.js
  13. 2 2
      modules/users/models/user_model.js
  14. 5 0
      public/gljUtil.js
  15. 4 0
      public/web/gljUtil.js
  16. 13 5
      public/web/id_tree.js
  17. 42 34
      test/demo/stringTest.js
  18. 1 1
      test/unit/reports/test_rpt_test_template.js
  19. 1 2
      web/building_saas/complementary_glj_lib/html/tools-gongliaoji.html
  20. 1 1
      web/building_saas/complementary_ration_lib/html/anzhuang.html
  21. 3 3
      web/building_saas/complementary_ration_lib/html/dinge.html
  22. 1 1
      web/building_saas/complementary_ration_lib/html/fuzhu.html
  23. 3 3
      web/building_saas/complementary_ration_lib/html/gongliao.html
  24. 1 1
      web/building_saas/complementary_ration_lib/html/main.html
  25. 2 2
      web/building_saas/complementary_ration_lib/js/ration_glj.js
  26. 0 0
      web/building_saas/css/login-bgp.jpg
  27. 1 1
      web/building_saas/css/main.css
  28. 1 1
      web/building_saas/glj/js/project_glj_spread.js
  29. 2 2
      web/building_saas/main/html/main.html
  30. 2 2
      web/building_saas/main/html/tender_price.html
  31. 2 2
      web/building_saas/main/js/models/calc_base.js
  32. 2 1
      web/building_saas/main/js/models/fee_rate.js
  33. 2 1
      web/building_saas/main/js/models/ration_glj.js
  34. 4 6
      web/building_saas/main/js/views/fee_rate_view.js
  35. 6 0
      web/building_saas/main/js/views/glj_view.js
  36. 1 1
      web/building_saas/main/js/views/main_tree_col.js
  37. 2 1
      web/building_saas/main/js/views/project_view.js
  38. 15 2
      web/building_saas/main/js/views/std_billsGuidance_lib.js
  39. 1 1
      web/building_saas/main/js/views/sub_fee_rate_views.js
  40. 2 2
      web/building_saas/pm/html/project-management.html
  41. 1 1
      web/users/html/login-infoinput.html
  42. 2 2
      web/users/html/login.html
  43. 1 1
      web/users/html/user-buy.html
  44. 1 1
      web/users/html/user-info.html
  45. 1 1
      web/users/html/user-safe.html
  46. 1 1
      web/users/html/user-set.html

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

@@ -40,7 +40,7 @@ class GljController extends BaseController{
             gljLibId: gljLibId,
             compilationId: sessionCompilation._id,
             compilationName: sessionCompilation.name,
-            versionName: `纵横公路养护云版(${req.session.compilationVersion})`,
+            versionName: req.session.compilationVersion,
             LicenseKey:config.getLicenseKey(process.env.NODE_ENV),
             overWriteUrl: overWriteUrl,
         });

+ 4 - 4
modules/complementary_ration_lib/controllers/compleViewController.js

@@ -48,7 +48,7 @@ class CompleViewController extends BaseController{
             redirectInstallation: redirectInstallation,
             gljLibId: gljLibId,
             compilationName: req.session.sessionCompilation.name,
-            versionName: `纵横公路养护云版(${req.session.compilationVersion})`,
+            versionName: req.session.compilationVersion,
             LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         });
     }
@@ -65,7 +65,7 @@ class CompleViewController extends BaseController{
             redirectInstallation: redirectInstallation,
             gljLibId: gljLibId,
             compilationName: req.session.sessionCompilation.name,
-            versionName: `纵横公路养护云版(${req.session.compilationVersion})`,
+            versionName: req.session.compilationVersion,
             LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         });
     }
@@ -82,7 +82,7 @@ class CompleViewController extends BaseController{
             redirectInstallation: redirectInstallation,
             gljLibId: gljLibId,
             compilationName: req.session.sessionCompilation.name,
-            versionName: `纵横公路养护云版(${req.session.compilationVersion})`,
+            versionName: req.session.compilationVersion,
             LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         });
     }
@@ -98,7 +98,7 @@ class CompleViewController extends BaseController{
             redirectGlj: redirectGlj,
             redirectCoe: redirectCoe,
             compilationName: req.session.sessionCompilation.name,
-            versionName: `纵横公路养护云版(${req.session.compilationVersion})`,
+            versionName: req.session.compilationVersion,
             LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         });
     }

+ 110 - 2
modules/fee_rates/facade/fee_rates_facade.js

@@ -15,6 +15,7 @@ let template = require('../controllers/feerate_template');
 let logger = require("../../../logs/log_helper").logger;
 const uuidV1 = require('uuid/v1');
 let EngineeringLibModel = require("../../users/models/engineering_lib_model");
+const scMathUtil = require('../../../public/scMathUtil').getUtil();
 
 module.exports={
     save:save,
@@ -256,19 +257,126 @@ async function changeFeeRateStandard(jdata){
     let newFeeRate = {};
     newFeeRate.ID =uuidV1();
     newFeeRate.rates=template.rates;
+    //2019-02-25新需求,养护切换标准后还要设置旧的值到新的费率文件里
+    let subMap = await getAllSubRatesMap(data.feeRateID);
+    let [IDMap,childrenMap] = setRatesByMap(newFeeRate,subMap,data.decimal);
+    sumParentRate(IDMap,childrenMap,data.decimal);
     await feeRateModel.create(newFeeRate);
     let doc={
         libID:data.newLibID,
         libName:template.libName,
         feeRateID: newFeeRate.ID
     };
-    let deleteInfo = {deleted: true, deleteDateTime: new Date(), deleteBy: data.user_id};
     await feeRateFileModel.findOneAndUpdate({ID:data.feeRateFileID,deleteInfo:null},doc);
-    await feeRateModel.findOneAndUpdate({ID:data.feeRateID},{deleteInfo:deleteInfo});
+    await feeRateModel.deleteOne({ID:data.feeRateID});
     doc.rates=newFeeRate.rates;
     return doc;
 }
 
+async function getAllSubRatesMap(feeRateID){
+    let subMap = {};
+    let feeRate = await feeRateModel.findOne({ID:feeRateID});
+    if(feeRate){
+        let rates = feeRate.rates;
+        for(let r of rates){
+           if(r.subFeeRate){
+               for(let p of r.subFeeRate.recodes){
+                   if(subMap[p.name]) continue;
+                   subMap[p.name] = p;
+               }
+           }
+        }
+    }
+    return subMap;
+}
+
+function sumParentRate(IDMap,childrenMap,decimal){
+    for(let ParentID in  childrenMap){
+        if(IDMap[ParentID] && IDMap[ParentID].sum !== true) continue;
+        let childrenList = childrenMap[ParentID];
+        let total = 0;
+        for(let c of childrenList){
+            let tem = c.rate?c.rate:0;
+            tem = scMathUtil.roundForObj(tem,decimal);
+            total = scMathUtil.roundForObj(tem + total,6);
+        }
+        total = scMathUtil.roundForObj(total,decimal);
+        if(IDMap[ParentID])IDMap[ParentID].rate = total;
+    }
+}
+
+function setRatesByMap(newFeeRate,subMap,decimal){
+    let IDMap ={},childrenMap={};
+    for(let r of newFeeRate.rates){
+        IDMap[r.ID] = r;
+        if(r.subFeeRate){
+            for(let p of r.subFeeRate.recodes){
+                let t_p = subMap[p.name];
+                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;//设置新费率的选中项
+                    }
+                    if(selected){//如果有选中项,则从valueMap中找出值并设置到rate上// ;
+                        let map = _.find(r.subFeeRate.valueMaps,{ID:selected.name});
+                        if(map){
+                            r.rate = map.value;
+                            setSubValue(p,selected.name);
+                        }
+                    }else if(t_p.editable==true){//在原来的选项中没有选中节点则说明是自已输入的,同时要是可编辑的类型,用内插法算值
+                        let ltRate = null;//
+                        let gtRate = null;
+                        for(let v of r.subFeeRate.valueMaps){
+                            if(parseFloat(v.ID)<parseFloat(t_p.value)){
+                                ltRate = v;
+                            }else if( gtRate==null && parseFloat(v.ID)>parseFloat(t_p.value)){
+                                gtRate = v;
+                            }
+                        }
+                        if(ltRate!=null&&gtRate!=null){//已经找到前后的值了
+                            let step = scMathUtil.roundForObj(gtRate.value - ltRate.value,getDecimal("process"))
+                            let total =  parseFloat(gtRate.ID) - parseFloat(ltRate.ID);
+                            r.rate  =getRateByStep(ltRate.value,total,parseFloat(t_p.value) - parseFloat(ltRate.ID),step,decimal);
+                        }else if(ltRate!=null&&gtRate == null){//说明是超出了选项的最大值
+                            let share = parseFloat(t_p.value) - parseFloat(ltRate.ID);//超出了多少
+                            r.rate  = getRateByStep(ltRate.value,p.step,share,p.amount,decimal)
+                        }else if(gtRate!=null&&ltRate==null){//说明是只有一个选项,且这个选项比输入的值大
+                            let step =  parseFloat(gtRate.value)- 0;
+                            r.rate = getRateByStep(0,gtRate.value,parseFloat(t_p.value),step,decimal)
+                        }
+                        if(r.rate!=undefined && r.rate != null){
+                            p.value = t_p.value;
+                            setSubValue(p,t_p.value);
+                        }
+                    }
+                }
+            }
+        }
+        if(r.ParentID&&r.ParentID!=""){
+            childrenMap[r.ParentID]?childrenMap[r.ParentID].push(r):childrenMap[r.ParentID]=[r];
+        }
+    }
+    return [IDMap,childrenMap]
+}
+
+function getRateByStep(ltValue,total,share,step,decimal) { //min值 ,计算值的总区间, 区间中占比,步长--前端也要用到
+    let p = scMathUtil.roundForObj(share/total,6);
+    let a = scMathUtil.roundForObj(step * p,6) ;
+    return scMathUtil.roundForObj(ltValue + a,decimal)
+}
+
+
+function setSubValue(p,name) {//设置综合理程的树节点的子节点的值
+    if(p.subList && p.subList.length > 0){
+        for(let s of p.subList){
+            s.value = Number(name);
+        }
+    }
+}
+
+
+
 async function newFeeRateFile(userId, updateData){
     if(updateData.property !== null){
         let property = updateData.property;

+ 1 - 1
modules/main/routes/main_route.js

@@ -28,7 +28,7 @@ module.exports =function (app) {
                         userID: req.session.sessionUser.id,
                         projectData: projectData,
                         compilationName: req.session.sessionCompilation.name,
-                        versionName: `纵横公路养护云版(${req.session.compilationVersion})`,
+                        versionName: req.session.compilationVersion,
                         projectReadOnly: projectReadOnly,
                         projectCooperate: projectCooperate,
                         LicenseKey:config.getLicenseKey(process.env.NODE_ENV),

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

@@ -274,7 +274,7 @@ module.exports = {
             rationValuation: JSON.stringify(rationValuation),
             engineeringList: JSON.stringify(engineering.List),
             compilationName: sessionCompilation.name,
-            versionName: `纵横公路养护云版(${request.session.compilationVersion})`,
+            versionName: request.session.compilationVersion,
             LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
 

+ 1 - 1
modules/ration_glj/facade/ration_glj_facade.js

@@ -773,7 +773,7 @@ async  function replaceGLJByData(data,compilation) {
 
 async function replaceMixRatio(g,result,unitFileId){
     let newRecodes=[],deleteList = [];
-    if(gljUtil.isConcreteType(g.type)){//相同类型的才能替换,所以判断一个就好了
+    if(gljUtil.isConcreteType(g.type)||gljUtil.isCommercialConcreteType(g.type)){//混凝土大类,商品混凝土属于相同大类,替换前和替换后只判断一个就好了
         let IDMap = {}, projectGLJMap = {},referenceMap={},concreteList=[],newMap={};
         let projectGljModel = new GLJListModel();
         let rationGLJList = await ration_glj.find({'rationID':g.rationID});

+ 27 - 6
modules/reports/rpt_component/helper/jpc_helper_cross_tab.js

@@ -28,7 +28,7 @@ let JpcCrossTabHelper = {
     },
     sortFieldValue: function(sIDX, eIDX, sortOrder, dataField, dataValSeq) {
         let tmpSeq = [];
-        if ((sortOrder) && (sortOrder != JV.TAB_FIELD_PROP_SORT_VAL_NOSORT)) {
+        if ((sortOrder) && (sortOrder !== JV.TAB_FIELD_PROP_SORT_VAL_NOSORT)) {
             if (sIDX >= 0 && eIDX >= sIDX && dataValSeq.length > eIDX) {
                 let reversed = 1;
                 if (sortOrder === JV.TAB_FIELD_PROP_SORT_VAL_DESC) {
@@ -39,7 +39,8 @@ let JpcCrossTabHelper = {
                 }
                 tmpSeq.sort(function(idx1, idx2) {
                     let rst = 0;
-                    if (isNaN(parseFloat(dataField[idx1])) || isNaN(parseFloat(dataField[idx1]))) {
+                    // if (isNaN(parseFloat(dataField[idx1])) || isNaN(parseFloat(dataField[idx1]))) {
+                    if (typeof (dataField[idx1]) === 'string' || typeof (dataField[idx1]) === 'string' ) {
                         if (dataField[idx1] > dataField[idx2]) {
                             rst = reversed;
                         } else if (dataField[idx1] < dataField[idx2]) {
@@ -78,7 +79,7 @@ let JpcCrossTabHelper = {
         let sIDX = 0, eIDX = -1, isFirstSort = true;
         for (let i = 0; i < tabFields.length; i++) {
             let tabField = tabFields[i];
-            if (tabField[JV.TAB_FIELD_PROP_SORT] != JV.TAB_FIELD_PROP_SORT_VAL_NOSORT) {
+            if (tabField[JV.TAB_FIELD_PROP_SORT] !== JV.TAB_FIELD_PROP_SORT_VAL_NOSORT) {
                 if (isFirstSort) {
                     isFirstSort = false;
                     //first field, should sort all data items
@@ -86,7 +87,17 @@ let JpcCrossTabHelper = {
                         sIDX = 0;
                         eIDX = dataSeq[j].length - 1;
                         //sort the field value here
-                        me.sortFieldValue(sIDX, eIDX, tabField[JV.TAB_FIELD_PROP_SORT],data_details[fieldSeqs[i]], dataSeq[j]);
+                        if (typeof(fieldSeqs[i]) === "object") {
+                            let exFirstField = JE.F(fieldSeqs[i][JV.PROP_ID], $CURRENT_RPT);
+                            if (exFirstField) {
+                                me.sortFieldValue(sIDX, eIDX, tabField[JV.TAB_FIELD_PROP_SORT], exFirstField[JV.PROP_AD_HOC_DATA], dataSeq[j]);
+                            } else {
+                                //不排序(健壮性)
+                            }
+                        } else {
+                            me.sortFieldValue(sIDX, eIDX, tabField[JV.TAB_FIELD_PROP_SORT],data_details[fieldSeqs[i]], dataSeq[j]);
+                        }
+                        // me.sortFieldValue(sIDX, eIDX, tabField[JV.TAB_FIELD_PROP_SORT],data_details[fieldSeqs[i]], dataSeq[j]);
                     }
                 } else {
                     //then sort the rest fields one by one
@@ -96,7 +107,7 @@ let JpcCrossTabHelper = {
                             if (typeof(fieldSeqs[k]) === "object") {
                                 let exField = JE.F(fieldSeqs[k][JV.PROP_ID], $CURRENT_RPT);
                                 if (exField) {
-                                    chkFields.push(exField["data_field"]);
+                                    chkFields.push(exField[JV.PROP_AD_HOC_DATA]);
                                 } else {
                                     chkFields.push(null);
                                 }
@@ -114,7 +125,17 @@ let JpcCrossTabHelper = {
                             };
                             if (eIDX >= sIDX) {
                                 if (eIDX != sIDX) {
-                                    me.sortFieldValue(sIDX, eIDX, tabField[JV.TAB_FIELD_PROP_SORT],data_details[fieldSeqs[i]], dataSeq[j]);
+                                    if (typeof(fieldSeqs[i]) === "object") {
+                                        let exOtherField = JE.F(fieldSeqs[i][JV.PROP_ID], $CURRENT_RPT);
+                                        if (exOtherField) {
+                                            me.sortFieldValue(sIDX, eIDX, tabField[JV.TAB_FIELD_PROP_SORT], exOtherField[JV.PROP_AD_HOC_DATA], dataSeq[j]);
+                                        } else {
+                                            //不排序(健壮性)
+                                        }
+                                    } else {
+                                        me.sortFieldValue(sIDX, eIDX, tabField[JV.TAB_FIELD_PROP_SORT],data_details[fieldSeqs[i]], dataSeq[j]);
+                                    }
+                                    // me.sortFieldValue(sIDX, eIDX, tabField[JV.TAB_FIELD_PROP_SORT],data_details[fieldSeqs[i]], dataSeq[j]);
                                 }
                                 sIDX = m;
                                 eIDX = m - 1; //for protection purpose

+ 38 - 8
modules/reports/rpt_component/jpc_cross_tab.js

@@ -123,9 +123,17 @@ JpcCrossTabSrv.prototype.createNew = function(){
                     for (let j = 1; j < dataSeq[i].length; j++) {
                         b1 = false;
                         for (let k = 0; k < rstFieldsIdx.length; k++) {
-                            if (data_details[rstFieldsIdx[k]][dataSeq[i][j - 1]] !== data_details[rstFieldsIdx[k]][dataSeq[i][j]]) {
-                                b1 = true;
-                                break;
+                            if (typeof(rstFieldsIdx[k]) === 'object') {
+                                let map_data_field = JE.F(rstFieldsIdx[k][JV.PROP_ID], $CURRENT_RPT);
+                                if (map_data_field[JV.PROP_AD_HOC_DATA][dataSeq[i][j - 1]] !== map_data_field[JV.PROP_AD_HOC_DATA][dataSeq[i][j]]) {
+                                    b1 = true;
+                                    break;
+                                }
+                            } else {
+                                if (data_details[rstFieldsIdx[k]][dataSeq[i][j - 1]] !== data_details[rstFieldsIdx[k]][dataSeq[i][j]]) {
+                                    b1 = true;
+                                    break;
+                                }
                             }
                         }
                         if (b1) {
@@ -206,7 +214,15 @@ JpcCrossTabSrv.prototype.createNew = function(){
         let data_details = dataObj[JV.DATA_DETAIL_DATA],
             data_fields = [];
         for (let i = 0; i < me.col_sum_fields_idx.length; i++) {
-            let data_field = data_details[me.col_sum_fields_idx[i]];
+            let data_field = null;
+            if (typeof me.col_sum_fields_idx[i] === 'object') {
+                let exField = JE.F(me.col_sum_fields_idx[i][JV.PROP_ID], $CURRENT_RPT);
+                if (exField) {
+                    data_field = exField[JV.PROP_AD_HOC_DATA];
+                }
+            } else {
+                data_field = data_details[me.col_sum_fields_idx[i]];
+            }
             data_fields.push(data_field);
         }
         for (let i = 0; i < me.sortedRowSequence.length; i++) { //seg level
@@ -467,9 +483,16 @@ JpcCrossTabSrv.prototype.createNew = function(){
                 let flexiblePrecisionRefObj = null, flexibleRefField = null, precision_ref_data = null;
                 for (let i = 0; i < me.row_fields_idx.length; i++) {
                     let tab_field = tab_fields[i];
-                    let data_field = data_details[me.row_fields_idx[i]];
-                    let map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
                     if (!(tab_field[JV.PROP_HIDDEN])) {
+                        let data_field = null;
+                        let map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
+                        if (typeof me.row_fields_idx[i] !== 'object') {
+                            data_field = data_details[me.row_fields_idx[i]];
+                        } else {
+                            if (map_data_field) {
+                                data_field = map_data_field[JV.PROP_AD_HOC_DATA];
+                            }
+                        }
                         let rows = valuesIdx.length;
                         for (let rowIdx = 0; rowIdx < rows; rowIdx++) {
                             if (map_data_field && map_data_field[JV.PROP_PRECISION] && map_data_field.flexiblePrecisionRefObj) {
@@ -506,9 +529,16 @@ JpcCrossTabSrv.prototype.createNew = function(){
                 let flexiblePrecisionRefObj = null, flexibleRefField = null, precision_ref_data = null;
                 for (let i = 0; i < me.col_fields_idx.length; i++) {
                     let tab_field = tab_fields[i];
-                    let data_field = data_details[me.col_fields_idx[i]];
-                    let map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
                     if (!(tab_field[JV.PROP_HIDDEN])) {
+                        let data_field = null;
+                        let map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
+                        if (typeof me.col_fields_idx[i] !== 'object') {
+                            data_field = data_details[me.col_fields_idx[i]];
+                        } else {
+                            if (map_data_field) {
+                                data_field = map_data_field[JV.PROP_AD_HOC_DATA];
+                            }
+                        }
                         let cols = valuesIdx.length;
                         for (let colIdx = 0; colIdx < cols; colIdx++) {
                             if (map_data_field && map_data_field[JV.PROP_PRECISION] && map_data_field.flexiblePrecisionRefObj) {

+ 20 - 17
modules/reports/rpt_component/jpc_ex.js

@@ -168,25 +168,28 @@ JpcExSrv.prototype.createNew = function(){
         let me = this, dftPagingOption = option||JV.PAGING_OPTION_NORMAL;
         //1. data object
         let dataHelper = JpcData.createNew();
-        dataHelper.analyzeData(rptTpl, dataObj);
-        //2. tab object
-        //pre-condition: the data should be sorted in SQL/NoSQL level!
-        //let dt1 = new Date();
-        if (me.flowTab) {
-            me.flowTab.sorting(rptTpl, dataObj, dataHelper.dataSeq.slice(0), me);
-            if (me.flowTabEx) {
-                me.flowTabEx.sorting(rptTpl, dataObj, dataHelper.exDataSeq.slice(0), me);
-            }
-        }
-        if (me.billTab) {
-            me.billTab.sorting(rptTpl, dataObj, dataHelper.dataSeq.slice(0), me);
-        }
-        //let dt2 = new Date();
-        //alert(dt2 - dt1);
-        //3. formulas
-        me.executeFormulas(JV.RUN_TYPE_BEFORE_PAGING, rptTpl, dataObj, me);
         if (me.crossTab) {
+            me.executeFormulas(JV.RUN_TYPE_BEFORE_PAGING, rptTpl, dataObj, me);
+            dataHelper.analyzeData(rptTpl, dataObj);
             me.crossTab.sorting(rptTpl, dataObj, dataHelper.dataSeq.slice(0), me);
+        } else {
+            dataHelper.analyzeData(rptTpl, dataObj);
+            //2. tab object
+            //pre-condition: the data should be sorted in SQL/NoSQL level!
+            //let dt1 = new Date();
+            if (me.flowTab) {
+                me.flowTab.sorting(rptTpl, dataObj, dataHelper.dataSeq.slice(0), me);
+                if (me.flowTabEx) {
+                    me.flowTabEx.sorting(rptTpl, dataObj, dataHelper.exDataSeq.slice(0), me);
+                }
+            }
+            if (me.billTab) {
+                me.billTab.sorting(rptTpl, dataObj, dataHelper.dataSeq.slice(0), me);
+            }
+            //let dt2 = new Date();
+            //alert(dt2 - dt1);
+            //3. formulas
+            me.executeFormulas(JV.RUN_TYPE_BEFORE_PAGING, rptTpl, dataObj, me);
         }
         //4. paging
         me.paging(rptTpl, dataObj, defProperties, dftPagingOption, outputType);

+ 3 - 3
modules/reports/rpt_component/jpc_flow_tab.js

@@ -199,7 +199,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
             if (typeof(me.seg_sum_fields_idx[i]) === "object") {
                 let exField = JE.F(me.seg_sum_fields_idx[i][JV.PROP_ID], $CURRENT_RPT);
                 if (exField) {
-                    data_fields.push(exField["data_field"]);
+                    data_fields.push(exField[JV.PROP_AD_HOC_DATA]);
                 } else {
                     data_fields.push(null);
                 }
@@ -854,10 +854,10 @@ JpcFlowTabSrv.prototype.createNew = function(){
                 let contentValuesIdx = me.dispValueIdxLst[page - 1];
                 let page_sum_data_fields = [];
                 for (let i = 0; i < me.page_sum_fields_idx.length; i++) {
-                    if (typeof(me.page_sum_fields_idx[i])=="object") {
+                    if (typeof(me.page_sum_fields_idx[i]) === "object") {
                         let exField = JE.F(me.page_sum_fields_idx[i][JV.PROP_ID], $CURRENT_RPT);
                         if (exField) {
-                            page_sum_data_fields.push(exField["data_field"]);
+                            page_sum_data_fields.push(exField[JV.PROP_AD_HOC_DATA]);
                         } else {
                             page_sum_data_fields.push(null);
                         }

+ 1 - 1
modules/users/controllers/boot_controller.js

@@ -49,7 +49,7 @@ class BootController extends BaseController {
             companyScaleList: userModel.companyScale,
             compilation: request.params.compilation,
             compilationName: request.session.sessionCompilation.name,
-            versionName: `纵横公路养护云版(${request.session.compilationVersion})`,
+            versionName: request.session.compilationVersion,
         };
         response.render('users/html/login-infoinput', renderData);
     }

+ 4 - 4
modules/users/controllers/user_controller.js

@@ -39,7 +39,7 @@ class UserController extends BaseController {
             companyTypeList: userModel.companyType,
             companyScaleList: userModel.companyScale,
             compilationName: request.session.sessionCompilation.name,
-            versionName: `纵横公路养护云版(${request.session.compilationVersion})`,
+            versionName: request.session.compilationVersion,
         };
         response.render('users/html/user-info', renderData);
     }
@@ -119,7 +119,7 @@ class UserController extends BaseController {
             logList: logList,
             pages: pageData,
             compilationName: request.session.sessionCompilation.name,
-            versionName: `纵横公路养护云版(${request.session.compilationVersion})`,
+            versionName: request.session.compilationVersion,
         };
         response.render('users/html/user-safe', renderData);
     }
@@ -162,7 +162,7 @@ class UserController extends BaseController {
             userData: userData,
             compilationList: compilationList,
             compilationName: request.session.sessionCompilation.name,
-            versionName: `纵横公路养护云版(${request.session.compilationVersion})`,
+            versionName: request.session.compilationVersion,
         };
         response.render('users/html/user-buy', renderData);
     }
@@ -195,7 +195,7 @@ class UserController extends BaseController {
             preferenceSetting: preferenceSetting,
             compilationList: compilationList,
             compilationName: request.session.sessionCompilation.name,
-            versionName: `纵横公路养护云版(${request.session.compilationVersion})`,
+            versionName: request.session.compilationVersion,
         };
         response.render('users/html/user-set', renderData);
     }

+ 2 - 2
modules/users/models/user_model.js

@@ -237,14 +237,14 @@ class UserModel extends BaseModel {
      * @return {version}
      */
     async getVersionFromUpgrade(ssoId, compilationId){
-        let version = '免费版';
+        let version = '纵横公路养护造价(免费)';
         let userData = await this.findDataBySsoId(ssoId);
         if (userData.upgrade_list !== undefined) {
             let compilationInfo = userData.upgrade_list.find(function (item) {
                 return item.compilationID === compilationId;
             });
             if (compilationInfo !== undefined && compilationInfo.isUpgrade === true) {
-                version = '专业版';
+                version = '纵横公路养护造价(专业)';
             }
         }
         return version;

+ 5 - 0
public/gljUtil.js

@@ -18,6 +18,7 @@ module.exports = {
     getAdjustPrice:getAdjustPrice,
     getMainType:getMainType,
     isConcreteType:isConcreteType,
+    isCommercialConcreteType:isCommercialConcreteType,
     getIndex:getIndex,
     sortRationGLJ:sortRationGLJ
 };
@@ -57,6 +58,10 @@ function isConcreteType(type) {
     return gljNodeUtil.isConcreteType(type);
 }
 
+function isCommercialConcreteType(type){
+    return gljNodeUtil.isCommercialConcreteType(type);
+}
+
 function sortRationGLJ(type) {
     return gljNodeUtil.sortRationGLJ(type);
 }

+ 4 - 0
public/web/gljUtil.js

@@ -322,6 +322,10 @@ let gljUtil = {
         let concreteType = [gljUtil.gljType.CONCRETE,gljUtil.gljType.MORTAR,gljUtil.gljType.MIX_RATIO];//混凝土大类:混凝土、砂浆,配合比
         return concreteType.indexOf(type)!=-1
     },
+    isCommercialConcreteType:function (type) {
+        let commercialType = [gljUtil.gljType.COMMERCIAL_CONCRETE,gljUtil.gljType.COMMERCIAL_MORTAR];//商品混凝土、商品砂浆
+        return commercialType.indexOf(type)!=-1
+    },
     hasComposition:function (ration_glj,isRationType) {//判断是否有组成物,有则返回true   现在主材类型的工料机也有可能有组成物。
         let type = isRationType==true? ration_glj.subType:ration_glj.type;
         if(gljUtil.notEditType.indexOf(type)!=-1||type==gljType.MAIN_MATERIAL){

+ 13 - 5
public/web/id_tree.js

@@ -278,11 +278,13 @@ var idTree = {
                 }
                 tools.addUpdateDataForNextSibling(data, this.parent, this.getID());
                 let updateData = this.tree.getDataTemplate(this.getID(), this.parent.getParentID(), this.parent.getNextSiblingID());
-                //如果设置了专项暂定,则需要清空
-                if (this.data.specialProvisional) {
-                    this.data.specialProvisional = '';
+                if (!this.isLast()) {
+                    //如果设置了专项暂定,则需要清空
+                    if (this.data.specialProvisional) {
+                        this.data.specialProvisional = '';
+                        updateData.specialProvisional = '';
+                    }
                 }
-                updateData.specialProvisional = '';
                 data.push({type: 'update', data: updateData});
             }
             return data;
@@ -314,7 +316,13 @@ var idTree = {
                 if (this.preSibling.children.length !== 0) {
                     tools.addUpdateDataForNextSibling(data, this.preSibling.lastChild(), this.getID());
                 }
-                tools.addUpdateDataForNextSibling(data, this.preSibling, this.getNextSiblingID());
+                let updateData = this.tree.getDataTemplate(this.preSibling.getID(), this.preSibling.getParentID(), this.getNextSiblingID());
+                if (this.preSibling.data.specialProvisional) {
+                    //如果设置了专项暂定,则需要清空
+                    this.preSibling.data.specialProvisional = '';
+                    updateData.specialProvisional = '';
+                }
+                data.push({type: 'update', data: updateData});
                 data.push({type: 'update', data: this.tree.getDataTemplate(this.getID(), this.preSibling.getID(), this.tree.setting.rootId)});
             }
             return data;

+ 42 - 34
test/demo/stringTest.js

@@ -62,40 +62,48 @@ var strUtil = require('../../public/stringUtil');
 //     t.end();
 // })
 
-test('test 千分位', function(t){
-    let num = 123.01;
-    t.equal( strUtil.comdify(num.toString()), "123.01");
-    num = 123456.01;
-    t.equal( strUtil.comdify(num.toString()), "123,456.01");
-    num = 1234567.01;
-    t.equal( strUtil.comdify(num.toString()), "1,234,567.01");
-    num = 1234567;
-    t.equal( strUtil.comdify(String(num)), "1,234,567");
-    t.end();
-})
-
-
-test('test number to Chinese', function(t){
-    t.equal(strUtil.convertToCaptionNum(0, false, false), '零');
-    t.equal(strUtil.convertToCaptionNum(0, true, false), '零元整');
-    t.equal(strUtil.convertToCaptionNum(0.68, true, false), '零元六角八分');
-    t.equal(strUtil.convertToCaptionNum(0.68, true, true), '零元陆角捌分');
-    t.equal(strUtil.convertToCaptionNum(10, false, false), '一十');
-    t.equal(strUtil.convertToCaptionNum(10, false, true), '壹拾');
-    t.equal(strUtil.convertToCaptionNum(11, false, false), '一十一');
-    t.equal(strUtil.convertToCaptionNum(11, false, true), '壹拾壹');
-    t.equal(strUtil.convertToCaptionNum(12, false, false), '一十二');
-    t.equal(strUtil.convertToCaptionNum(12, false, true), '壹拾贰');
-    t.equal(strUtil.convertToCaptionNum(21, false, false), '二十一');
-    t.equal(strUtil.convertToCaptionNum(21, false, true), '贰拾壹');
-
-    t.equal(strUtil.convertToCaptionNum(0.123456789, false, false), '零点一二三四五六七八九');
-    t.equal(strUtil.convertToCaptionNum(10.123456789, false, false), '一十点一二三四五六七八九');
-
-    t.equal(strUtil.convertToCaptionNum(123456789.15, false, false), '一亿二千三百四十五万六千七百八十九点一五');
-    t.equal(strUtil.convertToCaptionNum(123456789.15, false, true), '壹億贰仟叁佰肆拾伍萬陆仟柒佰捌拾玖点壹伍');
-    t.equal(strUtil.convertToCaptionNum(123456789.15, true, false), '一亿二千三百四十五万六千七百八十九元一角五分');
-    t.equal(strUtil.convertToCaptionNum(123456789.15, true, true), '壹億贰仟叁佰肆拾伍萬陆仟柒佰捌拾玖元壹角伍分');
+// test('test 千分位', function(t){
+//     let num = 123.01;
+//     t.equal( strUtil.comdify(num.toString()), "123.01");
+//     num = 123456.01;
+//     t.equal( strUtil.comdify(num.toString()), "123,456.01");
+//     num = 1234567.01;
+//     t.equal( strUtil.comdify(num.toString()), "1,234,567.01");
+//     num = 1234567;
+//     t.equal( strUtil.comdify(String(num)), "1,234,567");
+//     t.end();
+// })
+//
+//
+// test('test number to Chinese', function(t){
+//     t.equal(strUtil.convertToCaptionNum(0, false, false), '零');
+//     t.equal(strUtil.convertToCaptionNum(0, true, false), '零元整');
+//     t.equal(strUtil.convertToCaptionNum(0.68, true, false), '零元六角八分');
+//     t.equal(strUtil.convertToCaptionNum(0.68, true, true), '零元陆角捌分');
+//     t.equal(strUtil.convertToCaptionNum(10, false, false), '一十');
+//     t.equal(strUtil.convertToCaptionNum(10, false, true), '壹拾');
+//     t.equal(strUtil.convertToCaptionNum(11, false, false), '一十一');
+//     t.equal(strUtil.convertToCaptionNum(11, false, true), '壹拾壹');
+//     t.equal(strUtil.convertToCaptionNum(12, false, false), '一十二');
+//     t.equal(strUtil.convertToCaptionNum(12, false, true), '壹拾贰');
+//     t.equal(strUtil.convertToCaptionNum(21, false, false), '二十一');
+//     t.equal(strUtil.convertToCaptionNum(21, false, true), '贰拾壹');
+//
+//     t.equal(strUtil.convertToCaptionNum(0.123456789, false, false), '零点一二三四五六七八九');
+//     t.equal(strUtil.convertToCaptionNum(10.123456789, false, false), '一十点一二三四五六七八九');
+//
+//     t.equal(strUtil.convertToCaptionNum(123456789.15, false, false), '一亿二千三百四十五万六千七百八十九点一五');
+//     t.equal(strUtil.convertToCaptionNum(123456789.15, false, true), '壹億贰仟叁佰肆拾伍萬陆仟柒佰捌拾玖点壹伍');
+//     t.equal(strUtil.convertToCaptionNum(123456789.15, true, false), '一亿二千三百四十五万六千七百八十九元一角五分');
+//     t.equal(strUtil.convertToCaptionNum(123456789.15, true, true), '壹億贰仟叁佰肆拾伍萬陆仟柒佰捌拾玖元壹角伍分');
+//
+//     t.end();
+// })
 
+test('test String 大小比较', function(t){
+    let Str1 = '02JXF', Str2 = '03WHF';
+    Str2 = '0050001';
+    console.log((Str1 < Str2));
+    // t.equal( (Str1 > Str2), true);
     t.end();
 })

+ 1 - 1
test/unit/reports/test_rpt_test_template.js

@@ -101,7 +101,7 @@ test('测试 - 测试模板啦: ', function (t) {
                     let customizeCfg = {"fillZero": true};
                     let pageRst = printCom.outputAsSimpleJSONPageArray(rptTpl, tplData, 1, maxPages, defProperties, customizeCfg);
                     if (pageRst) {
-                        // fsUtil.writeObjToFile(pageRst, "D:/GitHome/YangHuCost/tmp/testBuiltPageResult_测试模板.jsp");
+                        fsUtil.writeObjToFile(pageRst, "D:/GitHome/YangHuCost/tmp/testBuiltPageResult_测试模板.jsp");
                         // rpt_xl_util.exportExcel(pageRst, pagesize, "local_test_rpt_excel", true, null, null, function(uuidName){
                         //     console.log("excel uuid: " + uuidName);
                         // });

+ 1 - 2
web/building_saas/complementary_glj_lib/html/tools-gongliaoji.html

@@ -5,8 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>人材机库编辑-纵横公路养护云版</title>
-    <!--inject:css-->
+    <title>工料机库编辑-纵横公路养护造价</title>    <!--inject:css-->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css" type="text/css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css" type="text/css">
     <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css" type="text/css">

+ 1 - 1
web/building_saas/complementary_ration_lib/html/anzhuang.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器-纵横公路养护云版</title>
+    <title>定额库编辑器-纵横公路养护造价</title>
     <!--inject:css-->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.sc.css" type="text/css">

+ 3 - 3
web/building_saas/complementary_ration_lib/html/dinge.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器-纵横公路养护云版</title>
+    <title>定额库编辑器-纵横公路养护造价</title>
     <!--inject:css-->
     <link rel="stylesheet" href="/lib/jquery-ui/jquery-ui.css" type="text/css">
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
@@ -133,7 +133,7 @@
                                 <!-- 标签 -->
                                 <ul class="nav nav-tabs" role="tablist">
                                     <li class="nav-item">
-                                        <a class="nav-link active" id="linkGLJ" data-toggle="tab" href="#rDetail" role="tab">人材机</a>
+                                        <a class="nav-link active" id="linkGLJ" data-toggle="tab" href="#rDetail" role="tab">工料机</a>
                                     </li>
                                     <li class="nav-item">
                                         <a class="nav-link" id="linkFZDE" data-toggle="tab" href="#rDetail" role="tab">辅助定额调整</a>
@@ -511,7 +511,7 @@
     <div class="modal-dialog modal-lg" role="document" id="modalCon">
         <div class="modal-content" >
             <div class="modal-header">
-                <h5 class="modal-title">选择人材机</h5>
+                <h5 class="modal-title">选择工料机</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                     <span aria-hidden="true">&times;</span>
                 </button>

+ 1 - 1
web/building_saas/complementary_ration_lib/html/fuzhu.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器-纵横公路养护云版</title>
+    <title>定额库编辑器-纵横公路养护造价</title>
     <!--inject:css-->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">

+ 3 - 3
web/building_saas/complementary_ration_lib/html/gongliao.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器-纵横公路养护云版</title>
+    <title>定额库编辑器-纵横公路养护造价</title>
     <!--inject:css-->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
@@ -74,7 +74,7 @@
         <div class="modal-dialog" role="document">
             <div class="modal-content">
                 <div class="modal-header">
-                  <h5 class="modal-title">添加人材机</h5>
+                  <h5 class="modal-title">添加工料机</h5>
                   <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                     <span aria-hidden="true">×</span>
                   </button>
@@ -120,7 +120,7 @@
         <div class="modal-dialog" role="document">
             <div class="modal-content">
                 <div class="modal-header">
-                  <h5 class="modal-title">编辑人材机</h5>
+                  <h5 class="modal-title">编辑工料机</h5>
                   <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                     <span aria-hidden="true">×</span>
                   </button>

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

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器-纵横公路养护云版</title>
+    <title>定额库编辑器-纵横公路养护造价</title>
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
    <!-- <link rel="stylesheet" href="css/bootstrap/themes.css">-->
     <link rel="stylesheet" href="/web/building_saas/css/main.css">

+ 2 - 2
web/building_saas/complementary_ration_lib/js/ration_glj.js

@@ -132,7 +132,7 @@ var rationGLJOprObj = {
                     return {
                         callback: function(){},
                         items: {
-                            "add": {name: "添加人材机", disabled: addDis, icon: "fa-plus", callback: function (key, opt) {
+                            "add": {name: "添加工料机", disabled: addDis, icon: "fa-plus", callback: function (key, opt) {
                                 //默认radio所有工料机
                                 gljSelOprObj.initRadio();
                                 gljSelOprObj.gljCurTypeId = null;
@@ -140,7 +140,7 @@ var rationGLJOprObj = {
                                 //弹出窗口
                                 $('#selGlj').modal('show');
                             }},
-                            "delete": {name: "删除人材机", disabled: delDis, icon: "fa-remove", callback: function (key, opt) {
+                            "delete": {name: "删除工料机", disabled: delDis, icon: "fa-remove", callback: function (key, opt) {
                                 rationGlj.splice(target.row, 1);
                                 me.updateRationItem(function(){
                                     me.sheet.getParent().focus();

web/building_saas/css/login-bg.jpg → web/building_saas/css/login-bgp.jpg


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

@@ -32,7 +32,7 @@ a{
 .login-bg{
     width: 100%;
     height: 100%;
-    background: #f2f6f5 url("login-bg.jpg") bottom center no-repeat;
+    background: #f2f6f5 url("login-bgp.jpg") bottom center no-repeat;
     background-size: 100% auto;
     display: inline-block;
     position: absolute;

+ 1 - 1
web/building_saas/glj/js/project_glj_spread.js

@@ -154,7 +154,7 @@ ProjectGLJSpread.prototype.init = function () {
         // 如果类型为混凝土、砂浆、配合比、机械,则提示
         if (field === 'unit_price.market_price' && canNotChangeTypeId.indexOf(type) >= 0) {
             if(ratioData&&ratioData.length>0){
-                alert('当前人材机的市场单价由组成物计算得出,不可直接修改');
+                alert('当前工料机的市场单价由组成物计算得出,不可直接修改');
             }
         }
     });

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

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title><%= projectData.name !== undefined ? projectData.name : '造价书' %>-纵横公路养护云版</title>
+    <title><%= projectData.name !== undefined ? projectData.name : '造价书' %>-纵横公路养护造价</title>
 
 
     <link rel="stylesheet" href="/lib/jquery-ui/jquery-ui.css" type="text/css">
@@ -993,7 +993,7 @@
         <div class="modal-dialog modal-lg" role="document" id="modalCon">
             <div class="modal-content" style="width: 1020px; left:50%; transform: translate(-50%,0%);">
                 <div class="modal-header">
-                    <h5 class="modal-title">请选择人材机</h5>
+                    <h5 class="modal-title">请选择工料机</h5>
                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                         <span aria-hidden="true">&times;</span>
                     </button>

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

@@ -9,12 +9,12 @@
         </div>
         <div class="input-group input-group-sm mr-2" style="width:240px">
             <div class="input-group-prepend">
-                <span class="input-group-text" id="inputGroup-sizing-sm">人材机单价调整系数</span>
+                <span class="input-group-text" id="inputGroup-sizing-sm">工料机单价调整系数</span>
             </div>
             <input id = 'gljPriceTenderCoe' type="number" step="0.1" class="form-control" placeholder="请输入系数" value="1">
         </div>
         <div class="btn-group mr-2">
-            <button type="button" class="btn btn-outline-primary btn-sm" id = "tenderGLJQuantity">调整人材机消耗</button>
+            <button type="button" class="btn btn-outline-primary btn-sm" id = "tenderGLJQuantity">调整工料机消耗</button>
             <button type="button" class="btn btn-outline-primary btn-sm" id = "tenderRationQuantity">调整子目工程量</button>
            <!-- <button type="button" class="btn btn-outline-primary btn-sm">反调单价</button>-->
             <button type="button" class="btn btn-outline-primary btn-sm" id = "tenderPrice">调价计算</button>

+ 2 - 2
web/building_saas/main/js/models/calc_base.js

@@ -1118,7 +1118,7 @@ let cbParser = {
             }
         }
         for(let i = 0, len = exps.length; i < len; i++){
-            exp = exp.replace(new RegExp(exps[i].orgExp, 'g'), exps[i].newExp);
+            exp = exp.replace(new RegExp(`${exps[i].orgExp}\\b`, 'g'), exps[i].newExp);
         }
         return exp;
     },
@@ -1138,7 +1138,7 @@ let cbParser = {
             }
         }
         for(let i = 0, len = exps.length; i < len; i++){
-            exp = exp.replace(new RegExp(exps[i].orgExp, 'g'), exps[i].newExp);
+            exp = exp.replace(new RegExp(`${exps[i].orgExp}\\b`, 'g'), exps[i].newExp);
         }
         return exp;
     },

+ 2 - 1
web/building_saas/main/js/models/fee_rate.js

@@ -337,7 +337,8 @@ var FeeRate = {
                 "newLibID": newVal,
                 "feeRateFileID":feeRate.ID,
                 "feeRateID":feeRate.feeRateID,
-                "user_id":userID
+                "user_id":userID,
+                "decimal":getDecimal("feeRate")
             };
             CommonAjax.post('/feeRates/changeFeeRateStandard', data, function (data) {
                 if (data) {

+ 2 - 1
web/building_saas/main/js/models/ration_glj.js

@@ -823,6 +823,7 @@ let ration_glj = {
             }
             oldData.GLJID = glj.ID;
             oldData.name = glj.name;
+            oldData.type = glj.gljType;
             oldData.code = glj.code;
             oldData.original_code = glj.code;
             oldData.unit = glj.unit;
@@ -832,7 +833,7 @@ let ration_glj = {
             oldData.marketPrice = glj.basePrice;
             oldData.repositoryId = glj.repositoryId;
             oldData.materialType = glj.materialType;
-            oldData. materialCoe =  glj.materialCoe;
+            oldData.materialCoe =  glj.materialCoe;
             oldData.grossWeightCoe= glj.grossWeightCoe;
             oldData.purchaseStorageRate = glj.purchaseStorageRate;
             oldData.offSiteTransportLossRate = glj.offSiteTransportLossRate;

+ 4 - 6
web/building_saas/main/js/views/fee_rate_view.js

@@ -554,7 +554,7 @@ var feeRateObject={
             subRateObject.initSubRateSpread(me.mainFeeRateData[row]);
         }
     },
-    setRateFromSub:function (subRate,value,subList) {
+    setRateFromSub:function (subRate,value,subList,editText) {//editText  下拉框选择的值,对于如“19.00”这样下拉选择项,value会变成19,所以在valueMap里找的时候要用editText去查找
          let me = feeRateObject,feeRate =  projectObj.project.FeeRate;
          let rates = feeRate.getActivateFeeRate().rates;
          let updateDatas = [];
@@ -575,12 +575,12 @@ var feeRateObject={
                          if(match == true) {//匹配上了,改对应的selected 为 true
                              if(o.name == value){
                                  o.selected = true;
-                                 valueArray.push(value);
+                                 valueArray.push(editText);//这里要用字符串去匹配而不是转换成数值的value
                                  setValue = true;
                              }else {
                                  o.selected = false;
                              }
-                         }else {//没有匹配上的,直接取值就可以
+                         }else {//没有匹配上的,直接取值就可以(这个是为多参数时用的,但是目前来看,不支持多参数,比较麻烦)
                              if(o.selected == true)  valueArray.push(o.name);
                          }
                      }
@@ -599,7 +599,6 @@ var feeRateObject={
                      }else {//没找到,用内插法或步长算值
                          let ltRate = null;//
                          let gtRate = null;
-                         let lastRate = null;
                          temP.value = scMathUtil.roundForObj(value,getDecimal("feeRate")) ;
                          for(let v of valueMaps){
                             if(parseFloat(v.ID)<parseFloat(value)){
@@ -607,7 +606,6 @@ var feeRateObject={
                             }else if( gtRate==null && parseFloat(v.ID)>parseFloat(value)){
                                 gtRate = v;
                             }
-                            lastRate = v;
                          }
                          if(gljUtil.isDef(ltRate)&&gljUtil.isDef(gtRate)){//已经找到前后的值了
                              let step = scMathUtil.roundForObj(gtRate.value - ltRate.value,getDecimal("process"))
@@ -642,7 +640,7 @@ var feeRateObject={
                 $.bootstrapLoading.end();
             })
         }
-        function getRateByStep(ltValue,total,share,step) { //min值 ,计算值的总区间, 区间中占比,步长
+        function getRateByStep(ltValue,total,share,step) { //min值 ,计算值的总区间, 区间中占比,步长--后端重选标准也要用到
             let p = scMathUtil.roundForObj(share/total,getDecimal("process"));
             let a = scMathUtil.roundForObj(step * p,getDecimal("process")) ;
             return scMathUtil.roundForObj(ltValue + a,getDecimal("feeRate"))

+ 6 - 0
web/building_saas/main/js/views/glj_view.js

@@ -723,6 +723,7 @@ var gljOprObj = {
                     ration_gljs[i].shortName =projectObj.project.projectGLJ.getShortNameByID(ration_gljs[i].type);
                     ration_gljs[i].isAdd = glj.unit_price.is_add;
                     ration_gljs[i]=this.setGLJPrice(ration_gljs[i],glj);//设置工料机价格
+                    delete ration_gljs[i].subList; //置空,再设置
                     let connect_index = this.getIndex(glj, gljKeyArray);
                     if (needRatio==true&&mixRatioMap.hasOwnProperty(connect_index)) {
                         let mixRatios = this.getMixRationShowDatas(mixRatioMap[connect_index], projectGljs);
@@ -1485,6 +1486,11 @@ $(function () {
                 gljOprObj.gljLibSheet.setActiveCell(0, 0);
                 gljOprObj.initSelection({row: 0});
             }
+        } else if ($('#actionType').val() === 'add') {
+            gljOprObj.locateZTree(null);
+            gljOprObj.gljLibSheet.showRow(0, GC.Spread.Sheets.VerticalPosition.top);
+            gljOprObj.gljLibSheet.setActiveCell(0, 0);
+            gljOprObj.initSelection({row: 0});
         } else {
             gljOprObj.showLibGLJSheetData();
         }

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

@@ -222,7 +222,7 @@ let MainTreeCol = {
             if(node.sourceType === projectObj.project.Bills.getSourceType()){
                 //如果是预算项目的,所有清单的数量1、数量2不做输入限制。
                 if(projectInfoObj.projectInfo.property && projectInfoObj.projectInfo.property.valuationType == "bill")  return false;
-                if(node.data.type==billType.FB||(node.data.type==billType.BILL&&MainTreeCol.readOnly.billsParent(node))){//大项费用、分部、清单父项行,工程量只读。
+                if(node.data.type==billType.DXFY||(node.data.type==billType.BILL&&MainTreeCol.readOnly.billsParent(node))){//大项费用、清单父项行,工程量只读。
                     return true;
                 }
             }else if(MainTreeCol.readOnly.glj(node)){

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

@@ -1355,7 +1355,7 @@ var projectObj = {
                     callback: function (key, opt) {
                         let selected = project.mainTree.selected;
                         if(selected.data.calcBase&&selected.data.calcBase!=""){
-                            alert("当前有基数计算,不能插入定额/量价/人材机。");
+                            alert("当前有基数计算,不能插入定额/量价/工料机。");
                             return;
                         }
                         getGLJData('insertEquipment');// ProjectController.addRation(project, controller, rationType.volumePrice);
@@ -3154,6 +3154,7 @@ function disableTools(){
     $('a[data-target="#copy-lv"]').remove();
     $('#standardSelect').prop('disabled', 'disabled');
     $('#cascadeSet').prop('disabled', 'disabled');
+    $('#changeConfirm').prop('disabled', 'disabled');
     //计算程序标准
     $('#calcProgramFileSelect').prop('disabled', 'disabled');
     //调价

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

@@ -286,9 +286,22 @@ const billsGuidance = (function () {
                 return -1;
             }
             let insertCode = orgNode.data.code ? orgNode.data.code : '';
-            //插入最顶层节点或者无编码,则直接插入到清单主树最后面
+            //插入最顶层节点或者无编码,对比选中节点后兄弟节点和同层主树节点的名称,插在的匹配的节点前面
+            function mathNext(selNode, compareNodes) {
+                let selNext = selNode.nextSibling;
+                while (selNext) {
+                    for (let i = 0; i < compareNodes.length; i++) {
+                        if (compareNodes[i].data.name === selNext.data.name) {
+                            return i;
+                        }
+                    }
+                    selNext = selNext.nextSibling;
+                }
+                return compareNodes.length;
+            }
             if (orgNode.depth() === 0 || insertCode === '') {
-                return peerNodes.length;
+                return mathNext(orgNode, peerNodes);
+                //return peerNodes.length;
             }
             for (let i = 0; i < peerNodes.length; i++) {
                 let thisNode = peerNodes[i];

+ 1 - 1
web/building_saas/main/js/views/sub_fee_rate_views.js

@@ -152,7 +152,7 @@ var subRateObject={
                 t.value = value
             }
         }
-        feeRateObject.setRateFromSub(subRate,value,subList);
+        feeRateObject.setRateFromSub(subRate,value,subList,info.newValue);
     },
 
     destorySpreadView:function () {

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

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>项目管理-纵横公路养护云版</title>
+    <title>项目管理-纵横公路养护造价</title>
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
     <link rel="stylesheet" href="/web/building_saas/css/custom.css">
@@ -634,7 +634,7 @@
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title">欢迎使用纵横公路养护云版</h5>
+                <h5 class="modal-title">欢迎使用纵横公路养护造价</h5>
             </div>
             <div class="modal-body">
                 <h5 class="my-3">首次加载例题,请稍候……</h5>

+ 1 - 1
web/users/html/login-infoinput.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>用户信息填写-纵横公路养护云版</title>
+    <title>用户信息填写-纵横公路养护造价</title>
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
     <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">

+ 2 - 2
web/users/html/login.html

@@ -4,7 +4,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>用户登录-纵横公路养护云版</title>
+    <title>用户登录-纵横公路养护造价</title>
     <!-- inject:css -->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
@@ -19,7 +19,7 @@
         <form class="form-signin" method="post" onsubmit="return false">
             <h1 class="d-flex justify-content-center mb-5">
                 <img src="/web/building_saas/img/building.png" width="40" height="40" class="mt-2 mr-3">
-                纵横云计价
+                纵横公路养护云版
             </h1>
             <div class="form-group">
                 <input id="inputEmail" class="form-control " name="inputEmail" placeholder="通行账号 邮箱/手机" autofocus="" />

+ 1 - 1
web/users/html/user-buy.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>产品激活-纵横公路养护云版</title>
+    <title>产品激活-纵横公路养护造价</title>
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
     <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">

+ 1 - 1
web/users/html/user-info.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>账号资料-纵横公路养护云版</title>
+    <title>账号资料-纵横公路养护造价</title>
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
     <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">

+ 1 - 1
web/users/html/user-safe.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>账号安全-纵横公路养护云版</title>
+    <title>账号安全-纵横公路养护造价</title>
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
     <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">

+ 1 - 1
web/users/html/user-set.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>登录设置-纵横公路养护云版</title>
+    <title>登录设置-纵横公路养护造价</title>
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
     <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">