فهرست منبع

江西清单基数

zhongzewei 6 سال پیش
والد
کامیت
8c51f09a82

+ 2 - 2
modules/main/controllers/bills_controller.js

@@ -234,11 +234,10 @@ module.exports = {
                 }
                 let importData = JSON.parse(LZString.decompressFromUTF16(compressData));
                 //匹配的清单库
-                let stdDateA = +new Date();
                 const billsLibId = fields.billsLibId !== undefined && fields.billsLibId.length > 0 && fields.billsLibId[0]? parseInt(fields.billsLibId[0]) : null;
                 let stdBills = [], stdJobs = [], stdCharacters = [];
                 if(billsLibId){
-                    stdBills = await stdBillsModel.find({billsLibId: billsLibId, deleted: false}, '-_id code jobs items engineering billsLibId');
+                    stdBills = await stdBillsModel.find({billsLibId: billsLibId, deleted: false}, '-_id code jobs items engineering billsLibId ruleText');
                     stdJobs = await stdBillJobsModel.find({billsLibId: billsLibId, deleted: false});
                     stdCharacters = await stdBillCharacterModel.find({billsLibId: billsLibId, deleted: false});
                 }
@@ -350,6 +349,7 @@ function parseToCompleteBills(excelBills, fixedBills, stdData){
                     isMatch = true;
                     excelBill.programID = stdBill.engineering ? stdBill.engineering : null;
                     excelBill.billsLibId = stdBill.billsLibId ? stdBill.billsLibId : null;
+                    excelBill.ruleText = stdBill.ruleText ? stdBill.ruleText : '';
                     //set jobContent and itemCharacter
                     let tempJob = [], tempCharacter = [];
                     for(let billJob of stdBill.jobs){

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

@@ -253,10 +253,13 @@ module.exports = {
             let usedCompilation = _.find(userData.used_list, function (o) {
                 return o.compilationId === compilationData._id.toString();
             });
+            //第一次使用该费用定额
             if (!usedCompilation) {
                 await userModel.update({_id: mongoose.Types.ObjectId(request.session.sessionUser.id)}, {$push: {used_list: {compilationId: compilationData._id}}});
-                //拷贝模板数据
+                //拷贝补充定额模板数据
                 await sectionTreeDao.copyDataFromTemplate(request.session.sessionUser.id, compilationData._id);
+                //拷贝例题数据
+
             }
         }
         // 清单计价

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

@@ -51,10 +51,17 @@ module.exports={
     isShare: isShare,
 };
 
-async function copyProject(userID, compilationID,data) {
+//拷贝父级项目
+async function copyParent(){
+
+}
+
+async function copyProject(userID, compilationID,data,newProjectID = null) {
     let projectMap = data.projectMap;
     let originalID = projectMap['copy'].document.ID;
-    let newProjectID = await getCounterID("projects");
+    if (!newProjectID) {
+        newProjectID = await getCounterID("projects");
+    }
     let newFeeName = null,newUnitName = null;
     let calcProgramFileID = uuidV1();//新的计算程序文件ID
     let labourCoeFileID = uuidV1();//新的人工调整系数文件ID

+ 94 - 80
public/web/sheet/sheet_data_helper.js

@@ -30,6 +30,7 @@ var __settingTemp = {
 };
 
 var SheetDataHelper = {
+    enterTime: 0,
     getObjPos: function (obj) {
         let target = obj;
         let pos = {x: obj.offsetLeft, y: obj.offsetTop};
@@ -144,89 +145,18 @@ var SheetDataHelper = {
             };
         };
         TipCellType.prototype.processMouseEnter = function (hitinfo) {
-            let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
-            let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
-            if(tag !== undefined && tag){
-                text = tag;
-            }
-            if(sheet && sheet.getParent().qo){
-                setting.pos = SheetDataHelper.getObjPos(sheet.getParent().qo);
-            }
-            if (setting.pos && text && text !== '') {
-                //固定不显示的div,存储文本获取固定div宽度,toolTipElement由于显示和隐藏,获取宽度不正确
-                if(!this._fixedTipElement){
-                    let div = $('#fixedTip')[0];
-                    if (!div) {
-                        div = document.createElement("div");
-                        $(div).css("padding", 5)
-                            .attr("id", 'fixedTip');
-                        $(div).hide();
-                        document.body.insertBefore(div, null);
-                    }
-                    this._fixedTipElement = div;
+            let nowTime = Date.now();
+            SheetDataHelper.enterTime = nowTime;
+            const delayTime = 500;
+            let me = this;
+            setTimeout(function(){
+                if (nowTime - SheetDataHelper.enterTime == 0) {
+                    SheetDataHelper.showTipsDIv.call(me, setting, hitinfo);
                 }
-                $(this._fixedTipElement).width('');
-                $(this._fixedTipElement).html(text);
-                if (!this._toolTipElement) {
-                    let div = $('#autoTip')[0];
-                    if (!div) {
-                        div = document.createElement("div");
-                        $(div).css("position", "absolute")
-                            .css("border", "1px #C0C0C0 solid")
-                            .css("box-shadow", "1px 2px 5px rgba(0,0,0,0.4)")
-                            .css("font", "0.9rem Calibri")
-                            .css("background", "Black")
-                            .css("color", "White")
-                            .css("padding", 5)
-                            .attr("id", 'autoTip');
-                        $(div).hide();
-                        document.body.insertBefore(div, null);
-                    }
-                    this._toolTipElement = div;
-                    $(this._toolTipElement).width('');
-                    //实时读取位置信息
-                    if(hitinfo.sheet && hitinfo.sheet.getParent().qo){
-                        setting.pos = SheetDataHelper.getObjPos(hitinfo.sheet.getParent().qo);
-                    }
-                    $(this._toolTipElement).html(text);
-                    //定额库定额特殊处理
-                    if($(hitinfo.sheet.getParent().qo).attr('id') === 'stdSectionRations' ||
-                        $(hitinfo.sheet.getParent().qo).hasClass('main-data-side-search')){
-                        let divWidth = $(this._fixedTipElement).width(),
-                            divHeight = $(this._fixedTipElement).height();
-                        if(divWidth > 600){
-                            divWidth = 590;
-                           $(this._toolTipElement).width(divWidth);
-                        }
-                        let top = setting.pos.y  + hitinfo.y - divHeight < 0 ? 0 :  setting.pos.y + hitinfo.cellRect.y - divHeight;
-                        if(hitinfo.col === 0){
-                            $(this._toolTipElement).css("top", top).css("left", setting.pos.x + hitinfo.cellRect.x - divWidth - 10);
-                        } else{
-                            $(this._toolTipElement).css("top", setting.pos.y + hitinfo.cellRect.y - divHeight - 10).css("left", setting.pos.x + hitinfo.cellRect.x - divWidth);
-                        }
-                    }
-                    else{
-                        $(this._toolTipElement).css("top", setting.pos.y + hitinfo.y +15).css("left", setting.pos.x + hitinfo.x + 15);
-                    }
-                    if($(hitinfo.sheet.getParent().qo).attr('id') === 'stdSectionRations' &&
-                        hitinfo.col === 1){
-                        let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
-                        let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
-                            zoom = hitinfo.sheet.zoom();
-                        let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
-                        let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
-                        if(textLength > cellWidth){
-                            $(this._toolTipElement).show("fast");
-                            TREE_SHEET_HELPER.tipDiv = 'show';//做个标记
-                        }
-                    } else {
-                        $(this._toolTipElement).show("fast");
-                        TREE_SHEET_HELPER.tipDiv = 'show';//做个标记
-                    }
-                }
-            }
+            }, delayTime);
         };
         TipCellType.prototype.processMouseLeave = function (hininfo) {
+            SheetDataHelper.enterTime = Date.now();
             TREE_SHEET_HELPER.tipDiv = 'hide';
             if (this._toolTipElement) {
                 $(this._toolTipElement).hide();
@@ -363,5 +293,89 @@ var SheetDataHelper = {
             let selections = sheet.getSelections();
             
         });
+    },
+    showTipsDIv: function(setting, hitinfo){
+        let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
+        let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
+        let sheet = hitinfo.sheet;
+        if(tag !== undefined && tag){
+            text = tag;
+        }
+        if(sheet && sheet.getParent().qo){
+            setting.pos = SheetDataHelper.getObjPos(sheet.getParent().qo);
+        }
+        if (setting.pos && text && text !== '') {
+            //固定不显示的div,存储文本获取固定div宽度,toolTipElement由于显示和隐藏,获取宽度不正确
+            if(!this._fixedTipElement){
+                let div = $('#fixedTip')[0];
+                if (!div) {
+                    div = document.createElement("div");
+                    $(div).css("padding", 5)
+                        .attr("id", 'fixedTip');
+                    $(div).hide();
+                    document.body.insertBefore(div, null);
+                }
+                this._fixedTipElement = div;
+            }
+            $(this._fixedTipElement).width('');
+            $(this._fixedTipElement).html(text);
+            if (!this._toolTipElement) {
+                let div = $('#autoTip')[0];
+                if (!div) {
+                    div = document.createElement("div");
+                    $(div).css("position", "absolute")
+                        .css("border", "1px #C0C0C0 solid")
+                        .css("box-shadow", "1px 2px 5px rgba(0,0,0,0.4)")
+                        .css("font", "0.9rem Calibri")
+                        .css("background", "Black")
+                        .css("color", "White")
+                        .css("padding", 5)
+                        .attr("id", 'autoTip');
+                    $(div).hide();
+                    document.body.insertBefore(div, null);
+                }
+                this._toolTipElement = div;
+                $(this._toolTipElement).width('');
+                //实时读取位置信息
+                if(hitinfo.sheet && hitinfo.sheet.getParent().qo){
+                    setting.pos = SheetDataHelper.getObjPos(hitinfo.sheet.getParent().qo);
+                }
+                $(this._toolTipElement).html(text);
+                //定额库定额特殊处理
+                if($(hitinfo.sheet.getParent().qo).attr('id') === 'stdSectionRations' ||
+                    $(hitinfo.sheet.getParent().qo).hasClass('main-data-side-search')){
+                    let divWidth = $(this._fixedTipElement).width(),
+                        divHeight = $(this._fixedTipElement).height();
+                    if(divWidth > 600){
+                        divWidth = 590;
+                        $(this._toolTipElement).width(divWidth);
+                    }
+                    let top = setting.pos.y  + hitinfo.y - divHeight < 0 ? 0 :  setting.pos.y + hitinfo.cellRect.y - divHeight;
+                    if(hitinfo.col === 0){
+                        $(this._toolTipElement).css("top", top).css("left", setting.pos.x + hitinfo.cellRect.x - divWidth - 10);
+                    } else{
+                        $(this._toolTipElement).css("top", setting.pos.y + hitinfo.cellRect.y - divHeight - 10).css("left", setting.pos.x + hitinfo.cellRect.x - divWidth);
+                    }
+                }
+                else{
+                    $(this._toolTipElement).css("top", setting.pos.y + hitinfo.y +15).css("left", setting.pos.x + hitinfo.x + 15);
+                }
+                if($(hitinfo.sheet.getParent().qo).attr('id') === 'stdSectionRations' &&
+                    hitinfo.col === 1){
+                    let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
+                    let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
+                        zoom = hitinfo.sheet.zoom();
+                    let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
+                    let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
+                    if(textLength > cellWidth){
+                        $(this._toolTipElement).show("fast");
+                        TREE_SHEET_HELPER.tipDiv = 'show';//做个标记
+                    }
+                } else {
+                    $(this._toolTipElement).show("fast");
+                    TREE_SHEET_HELPER.tipDiv = 'show';//做个标记
+                }
+            }
+        }
     }
 };

+ 0 - 3
public/web/tree_sheet/tree_sheet_helper.js

@@ -425,9 +425,6 @@ var TREE_SHEET_HELPER = {
             if (isRationNode&& options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex()) {
                 sheetCommonObj.drowTriangle(ctx,x+w-12,y+h/2+2);
             }
-            if (sheet.name() === 'stdRationLib_chapter') {
-                console.log(rationLibObj.hasExplanationRuleText(options.row));
-            }
             //定额库章节树问号
             if(sheet.name() === 'stdRationLib_chapter' && this.enterCell && options.row === this.enterCell.row
                 && typeof rationLibObj !== 'undefined' && rationLibObj.hasExplanationRuleText(options.row)){

BIN
web/building_saas/css/animated_favicon1.gif


BIN
web/building_saas/css/favicon.ico


BIN
web/building_saas/css/logo.png


+ 1 - 15
web/building_saas/main/js/views/project_info.js

@@ -6,21 +6,7 @@ var projectInfoObj = {
     projectInfo: null,
     getFullPathHtml: function (proj) {
         let fullPath = [], i, pm = '<span class="text-truncate"><a href="/pm">项目管理</a></span>', angleRight = '<span class="text-truncate"><i class="fa fa-angle-right fa-fw"></i></span>';
-        // fullPath.push(pm);
         if (proj) {
-            /*
-            for (i = 0; i < proj.fullFolder.length; i++) {
-                if (i <= proj.fullFolder.length - 3) {
-                    fullPath.push(angleRight, '<span class="text-truncate" data-toggle="tooltip" data-placement="bottom" title="', proj.fullFolder[i], '"><i class="fa fa-folder-open-o"></i></span>');
-                } else if (i === proj.fullFolder.length - 2) {
-                    // 屏蔽原有代码 不显示中间内容
-                    // fullPath.push(angleRight, '<span class="text-truncate" data-toggle="tooltip" data-placement="bottom" title="' + proj.fullFolder[i] + '"><i class="fa fa-cubes"></i>' + proj.fullFolder[i] + '</span>');
-                } else if (i === proj.fullFolder.length - 1) {
-                    // 屏蔽原有代码 不显示中间内容
-                    // fullPath.push(angleRight, '<span class="text-truncate" data-toggle="tooltip" data-placement="bottom" title="' + proj.fullFolder[i] + '"><i class="fa fa-cube"></i>' + proj.fullFolder[i] + '</span>');
-                }
-            }
-             */
             let pathArr = proj.fullPath;
             let engName = pathArr[pathArr.length -2] || '',
                 projectName = pathArr[pathArr.length -3] || '',
@@ -32,7 +18,7 @@ var projectInfoObj = {
                 <span data-toggle="tooltip" data-placement="bottom" data-original-title="${engName}"><i class="fa fa-cube"></i>...</span>
                 <span class="text-muted px-1">\</span>
                  <span><i class="fa fa-sticky-note-o"></i></span>
-                <span class="text-truncate float-right"  data-toggle="tooltip" data-placement="bottom" data-original-title="${proj.name}">&nbsp;${proj.name}</span>`;
+                <span class="text-truncate"  data-toggle="tooltip" data-placement="bottom" data-original-title="${proj.name}">&nbsp;${proj.name}</span>`;
             fullPath.push(newHtml);
 
         }

BIN
web/dest/css/logo.png


+ 301 - 0
web/over_write/js/jiangxi_2017.js

@@ -146,6 +146,307 @@ function overwriteRationCalcBases (taxType){
 })();
 
 
+//清单计算基数相关
+if(typeof baseFigureMap !== 'undefined'){
+    baseFigureMap = {
+        //与清单直接关联=======
+        '分部分项工程费': {base: 'FBFXGCF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
+        '分部分项直接费': {base: 'FBFXZJF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
+        '分部分项定额人工费': {base: 'FBFXDEJJRGF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
+        '分部分项人工费': {base: 'FBFXRGF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
+        '分部分项材料费': {base: 'FBFXCLF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
+        '分部分项定额机械费': {base: 'FBFXDEJJJXF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
+        '分部分项机械费': {base: 'FBFXJXF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
+        '分部分项主材费': {base: 'FBFXZCF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
+        '分部分项设备费': {base: 'FBFXSBF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
+        '分部分项人工工日': {base: 'FBFXRGGR', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
+        '措施项目费': {base: 'CSXMF', fixedFlag: fixedFlag.MEASURE, class: 'CSXM'},
+        '组织措施项目费': {base: 'ZZCSXMF', fixedFlag: fixedFlag.CONSTRUCTION_ORGANIZATION, class: 'CSXM'},
+        '组织措施项目人工费': {base: 'ZZCSXMRGF', fixedFlag: fixedFlag.CONSTRUCTION_ORGANIZATION, class: 'CSXM'},
+        '组织措施项目材料费': {base: 'ZZCSXMCLF', fixedFlag: fixedFlag.CONSTRUCTION_ORGANIZATION, class: 'CSXM'},
+        '组织措施项目机械费': {base: 'ZZCSXMJXF', fixedFlag: fixedFlag.CONSTRUCTION_ORGANIZATION, class: 'CSXM'},
+        '技术措施项目费': {base: 'JSCSXMF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
+        '技术措施项目定额人工费': {base: 'JSCSXMDEJJRGF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
+        '技术措施项目人工费': {base: 'JSCSXMRGF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
+        '技术措施项目材料费': {base: 'JSCSXMCLF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
+        '技术措施项目定额机械费': {base: 'JSCSXMDEJJJXF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
+        '技术措施项目机械费': {base: 'JSCSXMJXF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
+        '技术措施项目主材费': {base: 'JSCSXMZCF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
+        '技术措施项目设备费': {base: 'JSCSXMSBF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
+        '技术措施项目人工工日': {base: 'JSCSXMRGGR', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
+        '其他项目费': {base: 'QTXMF',  fixedFlag: fixedFlag.OTHER, class: 'QTXM'},
+        '规费': {base: 'GF', fixedFlag: fixedFlag.CHARGE, class: 'GF'},
+        '税金': {base: 'SJ', fixedFlag: fixedFlag.TAX, class: 'SJ'},
+        //不于清单直接关联==========
+        '建筑面积': {base: 'JZMJ', class: 'FBFX'},
+        '人材机价差': {base: 'RCJJC', class: 'RCJ'},
+        '人工价差': {base: 'RGJC', class: 'RCJ'},
+        '材料价差': {base: 'CLJC', class: 'RCJ'},
+        '机械价差': {base: 'JXJC', class: 'RCJ'},
+        '甲供人工费': {base: 'JGRGF', class: 'RCJ'},
+        '甲供材料费': {base: 'JGCLF', class: 'RCJ'},
+        '甲供机械费': {base: 'JGJXF', class: 'RCJ'},
+        '甲供主材费': {base: 'JGZCF', class: 'RCJ'},
+        '甲供设备费': {base: 'JGSBF', class: 'RCJ'},
+        '甲定人工费': {base: 'JDRGF', class: 'RCJ'},
+        '甲定材料费': {base: 'JDCLF', class: 'RCJ'},
+        '甲定机械费': {base: 'JDJXF', class: 'RCJ'},
+        '甲定主材费': {base: 'JDZCF', class: 'RCJ'},
+        '甲定设备费': {base: 'JDSBF', class: 'RCJ'},
+        '暂估材料费(从子目汇总)': {base: 'ZGCLFFZM', class: 'RCJ'},
+        '分包费': {base: 'FBF', class: 'FBF'},
+        '分包人工费': {base: 'FBRGF', class: 'FBF'},
+        '分包材料费': {base: 'FBCLF', class: 'FBF'},
+        '分包机械费': {base: 'FBJXF', class: 'FBF'},
+        '分包主材费': {base: 'FBZCF', class: 'FBF'},
+        '分包设备费': {base: 'FBSBF', class: 'FBF'},
+        '分包人工工日': {base: 'FBRGGR', class: 'FBF'},
+        '估价项目定额人工费': {base: 'GJXMDERGF', class: 'GJXM'},
+        '估价项目定额机械费': {base: 'GJXMDEJXF', class: 'GJXM'},
+        '估价项目直接费': {base: 'GJXMZJF', class: 'GJXM'},
+        '估价项目人工费': {base: 'GJXMRGF', class: 'GJXM'},
+        '估价项目材料费': {base: 'GJXMCLF', class: 'GJXM'},
+        '估价项目机械费': {base: 'GJXMJXF', class: 'GJXM'},
+        '估价项目主材费': {base: 'GJXMZCF', class: 'GJXM'},
+        '估价项目工日': {base: 'GJXMGR', class: 'GJXM'},
+    };
+}
+if(typeof baseFigureTemplate !== 'undefined'){
+    baseFigureTemplate['FBFXZJF'] =  function (tender) {//分部分项直接费
+        if(cbTools.isUnDef(calcBase.fixedBills[fixedFlag.SUB_ENGINERRING])){
+            return 0;
+        }
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let bill = calcBase.fixedBills[fixedFlag.SUB_ENGINERRING]['bill'];
+        if(cbTools.isUnDef(bill)) return 0;
+        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
+        return cbTools.isDef(bill.feesIndex.direct) && cbTools.isDef(bill.feesIndex.direct[totalFeeType]) ? bill.feesIndex.direct[totalFeeType] : 0;
+    };
+    baseFigureTemplate['FBFXRGF'] =  function (tender) {//分部分项人工费(市场人工费)
+        if(cbTools.isUnDef(calcBase.fixedBills[fixedFlag.SUB_ENGINERRING])){
+            return 0;
+        }
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let bill = calcBase.fixedBills[fixedFlag.SUB_ENGINERRING]['bill'];
+        if(cbTools.isUnDef(bill)) return 0;
+        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
+        return cbTools.isDef(bill.feesIndex.marketLabour) && cbTools.isDef(bill.feesIndex.marketLabour[totalFeeType]) ? bill.feesIndex.marketLabour[totalFeeType] : 0;
+    };
+    baseFigureTemplate['FBFXCLF'] =  function (tender) {//分部分项材料费(市场材料费)
+        if(cbTools.isUnDef(calcBase.fixedBills[fixedFlag.SUB_ENGINERRING])){
+            return 0;
+        }
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let bill = calcBase.fixedBills[fixedFlag.SUB_ENGINERRING]['bill'];
+        if(cbTools.isUnDef(bill)) return 0;
+        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
+        return cbTools.isDef(bill.feesIndex.marketMaterial) && cbTools.isDef(bill.feesIndex.marketMaterial[totalFeeType]) ? bill.feesIndex.marketMaterial[totalFeeType] : 0;
+    };
+    baseFigureTemplate['FBFXJXF'] =  function (tender) {//分部分项机械费(市场机械费)
+        if(cbTools.isUnDef(calcBase.fixedBills[fixedFlag.SUB_ENGINERRING])){
+            return 0;
+        }
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let bill = calcBase.fixedBills[fixedFlag.SUB_ENGINERRING]['bill'];
+        if(cbTools.isUnDef(bill)) return 0;
+        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
+        return cbTools.isDef(bill.feesIndex.marketMachine) && cbTools.isDef(bill.feesIndex.marketMachine[totalFeeType]) ? bill.feesIndex.marketMachine[totalFeeType] : 0;
+    };
+    baseFigureTemplate['ZZCSXMRGF'] =  function (tender) {//组织措施项目人工费(市场人工费)
+        if(cbTools.isUnDef(calcBase.fixedBills[fixedFlag.CONSTRUCTION_ORGANIZATION])){
+            return 0;
+        }
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let bill = calcBase.fixedBills[fixedFlag.CONSTRUCTION_ORGANIZATION]['bill'];
+        if(cbTools.isUnDef(bill)) return 0;
+        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
+        return cbTools.isDef(bill.feesIndex.marketLabour) && cbTools.isDef(bill.feesIndex.marketLabour[totalFeeType]) ? bill.feesIndex.marketLabour[totalFeeType] : 0;
+    };
+    baseFigureTemplate['ZZCSXMCLF'] =  function (tender) {//组织措施项目材料费(市场材料费)
+        if(cbTools.isUnDef(calcBase.fixedBills[fixedFlag.CONSTRUCTION_ORGANIZATION])){
+            return 0;
+        }
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let bill = calcBase.fixedBills[fixedFlag.CONSTRUCTION_ORGANIZATION]['bill'];
+        if(cbTools.isUnDef(bill)) return 0;
+        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
+        return cbTools.isDef(bill.feesIndex.marketMaterial) && cbTools.isDef(bill.feesIndex.marketMaterial[totalFeeType]) ? bill.feesIndex.marketMaterial[totalFeeType] : 0;
+    };
+    baseFigureTemplate['ZZCSXMJXF'] =  function (tender) {//组织措施项目机械费(市场机械费)
+        if(cbTools.isUnDef(calcBase.fixedBills[fixedFlag.CONSTRUCTION_ORGANIZATION])){
+            return 0;
+        }
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let bill = calcBase.fixedBills[fixedFlag.CONSTRUCTION_ORGANIZATION]['bill'];
+        if(cbTools.isUnDef(bill)) return 0;
+        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
+        return cbTools.isDef(bill.feesIndex.marketMachine) && cbTools.isDef(bill.feesIndex.marketMachine[totalFeeType]) ? bill.feesIndex.marketMachine[totalFeeType] : 0;
+    };
+    baseFigureTemplate['JSCSXMRGF'] =  function (tender) {//技术措施项目人工费(市场人工费)
+        if(cbTools.isUnDef(calcBase.fixedBills[fixedFlag.CONSTRUCTION_TECH])){
+            return 0;
+        }
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let bill = calcBase.fixedBills[fixedFlag.CONSTRUCTION_TECH]['bill'];
+        if(cbTools.isUnDef(bill)) return 0;
+        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
+        return cbTools.isDef(bill.feesIndex.marketLabour) && cbTools.isDef(bill.feesIndex.marketLabour[totalFeeType]) ? bill.feesIndex.marketLabour[totalFeeType] : 0;
+    };
+    baseFigureTemplate['JSCSXMCLF'] =  function (tender) {//技术措施项目材料费(市场材料费)
+        if(cbTools.isUnDef(calcBase.fixedBills[fixedFlag.CONSTRUCTION_TECH])){
+            return 0;
+        }
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let bill = calcBase.fixedBills[fixedFlag.CONSTRUCTION_TECH]['bill'];
+        if(cbTools.isUnDef(bill)) return 0;
+        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
+        return cbTools.isDef(bill.feesIndex.marketMaterial) && cbTools.isDef(bill.feesIndex.marketMaterial[totalFeeType]) ? bill.feesIndex.marketMaterial[totalFeeType] : 0;
+    };
+    baseFigureTemplate['JSCSXMJXF'] =  function (tender) {//技术措施项目机械费(市场机械费)
+        if(cbTools.isUnDef(calcBase.fixedBills[fixedFlag.CONSTRUCTION_TECH])){
+            return 0;
+        }
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let bill = calcBase.fixedBills[fixedFlag.CONSTRUCTION_TECH]['bill'];
+        if(cbTools.isUnDef(bill)) return 0;
+        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
+        return cbTools.isDef(bill.feesIndex.marketMachine) && cbTools.isDef(bill.feesIndex.marketMachine[totalFeeType]) ? bill.feesIndex.marketMachine[totalFeeType] : 0;
+    };
+    baseFigureTemplate['FBRGF'] =  function (tender) {//分包人工费(市场人工费)
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let rst = 0;
+        let rations = calcBase.project.Ration.datas;
+        for(let ration of rations){
+            if(ration.isSubcontract && ration.feesIndex && ration.feesIndex.marketLabour){
+                rst = parseFloat(rst + ration.feesIndex.marketLabour[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
+            }
+        }
+        return rst;
+    };
+    baseFigureTemplate['FBCLF'] =  function (tender) {//分包材料费(市场材料费)
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let rst = 0;
+        let rations = calcBase.project.Ration.datas;
+        for(let ration of rations){
+            if(ration.isSubcontract && ration.feesIndex && ration.feesIndex.marketMaterial){
+                rst = parseFloat(rst + ration.feesIndex.marketMaterial[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
+            }
+        }
+        return rst;
+    };
+    baseFigureTemplate['FBJXF'] =  function (tender) {//分包机械费(市场机械费)
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let rst = 0;
+        let rations = calcBase.project.Ration.datas;
+        for(let ration of rations){
+            if(ration.isSubcontract && ration.feesIndex && ration.feesIndex.marketMachine){
+                rst = parseFloat(rst + ration.feesIndex.marketMachine[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
+            }
+        }
+        return rst;
+    };
+    baseFigureTemplate['GJXMDERGF'] =  function (tender) {//估计项目定额人工费
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let rst = 0;
+        let rations = calcBase.project.Ration.datas;
+        for(let ration of rations){
+            if(ration.evaluationProject && ration.feesIndex && ration.feesIndex.labour){
+                rst = parseFloat(rst + ration.feesIndex.labour[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
+            }
+        }
+        return rst;
+    };
+    baseFigureTemplate['GJXMDEJXF'] =  function (tender) {//估计项目定额机械费
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let rst = 0;
+        let rations = calcBase.project.Ration.datas;
+        for(let ration of rations){
+            if(ration.evaluationProject && ration.feesIndex && ration.feesIndex.machine){
+                rst = parseFloat(rst + ration.feesIndex.machine[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
+            }
+        }
+        return rst;
+    };
+    baseFigureTemplate['GJXMZJF'] =  function (tender) {//估计项目直接费
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let rst = 0;
+        let rations = calcBase.project.Ration.datas;
+        for(let ration of rations){
+            if(ration.evaluationProject && ration.feesIndex && ration.feesIndex.direct){
+                rst = parseFloat(rst + ration.feesIndex.direct[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
+            }
+        }
+        return rst;
+    };
+    baseFigureTemplate['GJXMRGF'] =  function (tender) {//估计项目人工费(市场人工费)
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let rst = 0;
+        let rations = calcBase.project.Ration.datas;
+        for(let ration of rations){
+            if(ration.evaluationProject && ration.feesIndex && ration.feesIndex.marketLabour){
+                rst = parseFloat(rst + ration.feesIndex.marketLabour[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
+            }
+        }
+        return rst;
+    };
+    baseFigureTemplate['GJXMCLF'] =  function (tender) {//估计项目材料费(市场材料费)
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let rst = 0;
+        let rations = calcBase.project.Ration.datas;
+        for(let ration of rations){
+            if(ration.evaluationProject && ration.feesIndex && ration.feesIndex.marketMaterial){
+                rst = parseFloat(rst + ration.feesIndex.marketMaterial[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
+            }
+        }
+        return rst;
+    };
+    baseFigureTemplate['GJXMJXF'] =  function (tender) {//估计项目机械费(市场机械费)
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let rst = 0;
+        let rations = calcBase.project.Ration.datas;
+        for(let ration of rations){
+            if(ration.evaluationProject && ration.feesIndex && ration.feesIndex.marketMachine){
+                rst = parseFloat(rst + ration.feesIndex.marketMachine[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
+            }
+        }
+        return rst;
+    };
+    baseFigureTemplate['GJXMZCF'] =  function (tender) {//估计项目主材费
+        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
+        let rst = 0;
+        let rations = calcBase.project.Ration.datas;
+        for(let ration of rations){
+            if(ration.evaluationProject && ration.feesIndex && ration.feesIndex.mainMaterial){
+                rst = parseFloat(rst + ration.feesIndex.mainMaterial[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
+            }
+        }
+        return rst;
+    };
+    baseFigureTemplate['GJXMGR'] =  function (tender) {//估计项目工日
+        const quantityType = tender ? 'tenderQuantity' : 'quantity';
+        let rst = 0;
+        let rations = calcBase.project.Ration.datas;
+        let rationGljs = calcBase.project.ration_glj.datas;
+        for (let ration of rations) {
+            if (ration.evaluationProject && ration.type === rationType.ration) {
+                for(let glj of rationGljs){
+                    if(ration.ID === glj.rationID && glj.type === gljType.LABOUR){
+                        rst = parseFloat(rst + parseFloat(glj[quantityType] * ration[quantityType]).toDecimal(decimalObj.glj.quantity)).toDecimal(decimalObj.glj.quantity);
+                    }
+                }
+            }
+        }
+        return rst;
+    };
+}
+//增加清单基数分类估价项目、去除分类税前工程造价
+if(typeof $ !== 'undefined' && $('#cbClassList')){
+    $('#cbClassList').find('li:eq(8)').remove();
+    let $li = $('<li class="p-1"><a id="cb_GJXM" href="javascript:void(0);">估价项目</a></li>');
+    $li.insertAfter($('#cbClassList').find('li:eq(4)'));
+}
+
+
 
 
 

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

@@ -44,7 +44,7 @@
         <div class="modal-dialog modal-lg" role="document">
             <div class="modal-content">
                 <div class="modal-header">
-                    <h5 class="modal-title">选择登录版本</h5>
+                    <h5 class="modal-title">选择费用定额</h5>
                     <p class="m-0 text-warning"><i class="fa fa-exclamation-triangle"></i> <b>登录设置</b> 中可以修改您的登录习惯。</p>
                 </div>
                 <div class="modal-body">

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

@@ -44,7 +44,7 @@
                         <legend class="my-3">登录设置</legend>
                         <form method="post" action="/user/save-preferences">
                             <div class="form-group">
-                                <label class="form-control-label">登录时选择版本</label>
+                                <label class="form-control-label">登录时选择费用定额</label>
                                 <div class="form-control">
                                     <div class="form-check form-check-inline">
                                       <input name="login_ask" type="radio" class="form-check-input" value="1"
@@ -54,14 +54,14 @@
                                     <div class="form-check form-check-inline">
                                       <input name="login_ask" type="radio" class="form-check-input" value="0"
                                         <% if(preferenceSetting.login_ask === 0) { %>checked="checked" <% } %>>
-                                      <span class="form-check-label">指定版本</span>
+                                      <span class="form-check-label">指定费用定额</span>
                                     </div>
                                 </div>
                             </div>
                             <div class="form-group">
-                                <label class="form-control-label">指定版本</label>
+                                <label class="form-control-label">指定费用定额</label>
                                 <select class="form-control" name="select_version">
-                                    <option value="">请选择版本</option>
+                                    <option value="">请选择费用定额</option>
                                     <% if (compilationList.length > 0) {%>
                                     <% compilationList.forEach(function(compilation) { %>
                                     <option value="<%= compilation._id %>" <% if(preferenceSetting.select_version === compilation._id.toString()) { %>selected="selected" <% } %>><%= compilation.name %></option>