소스 검색

修改工程量、悬浮窗口提示

zhangweicheng 7 년 전
부모
커밋
d0e59d0775

+ 11 - 0
modules/glj/models/glj_list_model.js

@@ -109,6 +109,7 @@ class GLJListModel extends BaseModel {
                 projectGLJIDList: gljIdList
             };
             let quantityData = await RationGLJFacade.getQuantityByProjectGLJ(condition);
+            let rationTypeQuantity = await RationGLJFacade.getRationTypeGLJQuantity(projectId);
             let quantityList = {};
             // 整理数据 得到总定额消耗量
             for (let tmp of quantityData) {
@@ -122,6 +123,16 @@ class GLJListModel extends BaseModel {
                     quantityList[tmp_con_key] = scMathUtil.roundTo(quantityList[tmp_con_key]+tmp.quantity * tmpNum,-quantity_decimal);
                 }
             }
+            //计算定额类型工料机的消耗量
+            for(let rq of rationTypeQuantity){
+                let rq_key = keyMap[rq.projectGLJID];
+                let rq_quantity= scMathUtil.roundForObj(rq.quantity,quantity_decimal);
+                if(quantityList[rq_key] === undefined){
+                    quantityList[rq_key] =  scMathUtil.roundTo(rq_quantity,-quantity_decimal);
+                }else {
+                    quantityList[rq_key] = scMathUtil.roundTo(quantityList[rq_key]+rq_quantity,-quantity_decimal);
+                }
+            }
             // 整理获取有组成物的项目工料机的数据
             let connect_keys = [];
             for(let tmp of gljData) {

+ 18 - 16
modules/main/facade/quantity_detail_facade.js

@@ -112,9 +112,7 @@ async function updateRegex(datas) {
     await quantity_detail_model.bulkWrite(generateUpdateTaks(updateTasks));
     resultObjec.refreshList=updateTasks;
     if(datas.query.refreshQuantity==true){
-        let data = {};
-        data.quantity = await summateResults(datas.query,detailList,decimal);
-        data.isFromDetail = 1;
+        let data = await summateResults(datas.query,detailList,decimal);
         node.data = data;
         resultObjec.node = node;
     }
@@ -259,9 +257,7 @@ async function insertRecodeWithReg (doc) {
         let newRecord = await quantity_detail_model.create(doc) ;
         detailList.push(newRecord);
         if(refreshQuantity==true){
-            let data = {};
-            data.quantity = await summateResults(doc,detailList,decimal);
-            data.isFromDetail = 1;
+            let data = await summateResults(doc,detailList,decimal);
             returnObjec.node.data = data;
         }
         returnObjec.newRecord = newRecord;
@@ -283,9 +279,7 @@ async function doIsSummationUpdate(query,doc) {
     await quantity_detail_model.update(query,doc);
     let detailList = await getDatailList(query,returnObjec);
     if(refreshQuantity==true){
-        let data = {};
-        data.quantity = await summateResults(query,detailList,decimal);
-        data.isFromDetail = 1;
+        let data = await summateResults(query,detailList,decimal);
         returnObjec.node.data = data;
     }
     return returnObjec;
@@ -331,6 +325,7 @@ function updateReferenceRecode(index,detailList,updateTasks) {
 
 async function summateResults (query,detailList,decimal) {
     let quantity = 0;
+    let doc = {};
      decimal = decimal?decimal:await decimal_facade.getProjectDecimal(query.projectID);
     for(let d of detailList){
         if(d.isSummation==1){
@@ -340,17 +335,25 @@ async function summateResults (query,detailList,decimal) {
     }
     if(query.hasOwnProperty('rationID')){
         let ration = await  ration_model.findOne({'ID':query.rationID,'projectID':query.projectID,deleteInfo: null});
+        let bill = await bill_model.findOne({'projectID':query.projectID,deleteInfo: null,"ID":ration.billsItemID});
+        let bill_decimal = await decimal_facade.getBillsQuantityDecimal(query.projectID,bill.unit);
+        let bill_quantity = scMathUtil.roundForObj(bill.quantity,bill_decimal);
+        let contain = scMathUtil.roundForObj(quantity/bill_quantity,decimal.process);
+        let r_quantity = quantity;
         quantity = getQuantityByUnit(quantity,ration.unit);
         quantity = scMathUtil.roundTo(quantity, -decimal.ration.quantity);
-        await ration_model.update({'ID':query.rationID,'projectID':query.projectID,deleteInfo: null},{quantity:quantity,isFromDetail:1});
+        doc={quantity:quantity,isFromDetail:1,quantityEXP:'GCLMXHJ',contain:contain};
+        await ration_model.update({'ID':query.rationID,'projectID':query.projectID,deleteInfo: null},doc);
+        doc.r_quantity = r_quantity;
     }else {
         let bill = await bill_model.findOne({'ID':query.billID,'projectID':query.projectID,deleteInfo: null});
         decimal = await decimal_facade.getBillsQuantityDecimal(query.projectID,bill.unit);
-        quantity = getQuantityByUnit(quantity,bill.unit);
+       // quantity = getQuantityByUnit(quantity,bill.unit);
         quantity = scMathUtil.roundTo(quantity, -decimal);
-        await bill_model.update({'ID':query.billID,'projectID':query.projectID,deleteInfo: null},{quantity:quantity,isFromDetail:1});
+        doc = {quantity:quantity,isFromDetail:1};
+        await bill_model.update({'ID':query.billID,'projectID':query.projectID,deleteInfo: null},doc);
     }
-    return quantity
+    return doc
 }
 
 function getQuantityByUnit(quantity,unit) {
@@ -476,9 +479,8 @@ async function deleteRecode(doc) {
     await quantity_detail_model.deleteOne({ID:doc.ID,projectID:doc.projectID});
     _.remove(quantity_detail_List,{ID:doc.ID,projectID:doc.projectID});
 
-    let n_data = {};//更新节点信息
-    n_data.quantity = await summateResults(query,quantity_detail_List,decimal);
-    n_data.isFromDetail = 1;
+    //更新节点信息
+    let n_data = await summateResults(query,quantity_detail_List,decimal);
     resultObject.node.data = n_data;
 
     let r_data ={

+ 1 - 0
modules/main/models/ration.js

@@ -38,6 +38,7 @@ let rationSchema = new Schema({
     unit: String,
     quantity: String,
     contain:String,//含量
+    quantityEXP:String,//工程量表达式
     programID: Number,
     marketUnitFee: String,
     marketTotalFee: String,

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

@@ -37,7 +37,8 @@ module.exports = {
     mReplaceGLJ: mReplaceGLJ,
     updateRationGLJByEdit: updateRationGLJByEdit,
     getGLJClass: getGLJClass,
-    insertGLJAsRation: insertGLJAsRation
+    insertGLJAsRation: insertGLJAsRation,
+    getRationTypeGLJQuantity:getRationTypeGLJQuantity
 }
 
 let operationMap = {
@@ -765,6 +766,11 @@ async function insertGLJAsRation(data) {
     return gljList;
 }
 
+async function  getRationTypeGLJQuantity(projectID) {
+    let rations = await ration.find({'projectID': projectID,'type':3,'deleteInfo': null}, ['ID', 'projectGLJID','quantity']);
+    return rations;
+}
+
 async function changAdjustState(data, rationList) {
     let stateList = [];
     for (let r of rationList) {

+ 1 - 0
modules/ration_glj/models/ration_glj_temp.js

@@ -50,6 +50,7 @@ let rationSchema = new Schema({
     unit: String,
     quantity: String,
     contain:String,//含量
+    quantityEXP:String,//工程量表达式
     programID: Number,
     marketUnitFee: String,
     marketTotalFee: String,

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

@@ -131,6 +131,10 @@ var TREE_SHEET_HELPER = {
                     }
                     return data;
                 };
+                if(colSetting.data.field=="quantity"){
+                    let tag = node.data.quantityEXP?node.data.quantityEXP:'';
+                    sheet.setTag(iRow, iCol,tag);
+                }
                 if (colSetting.data.getText && Object.prototype.toString.apply(colSetting.data.getText) === "[object Function]") {
                     cell.value(colSetting.data.getText(node));
                 } else {
@@ -317,7 +321,9 @@ var TREE_SHEET_HELPER = {
         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) {
+            if(setting.cols[hitinfo.col].data.field=="quantity"){
+                text = tag;
+            }else if(tag !== undefined && tag) {
                 text = tag;
             }
             if (setting.pos && text && text !== '') {

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

@@ -933,7 +933,9 @@ class CalcProgram {
                     fees: node.data.fees,
                     isFromDetail:node.data.isFromDetail,
                     feeRate: node.data.feeRate,
-                    feeRateID: node.data.feeRateID
+                    feeRateID: node.data.feeRateID,
+                    contain:node.data.contain,
+                    quantityEXP:node.data.quantityEXP
                 };
                 if(node.sourceType==ModuleNames.ration && node.data.type==rationType.gljRation){//定额类型的工料机做特殊处理
                     data.code=node.data.code;

+ 4 - 2
web/building_saas/main/js/models/project_glj.js

@@ -157,8 +157,10 @@ ProjectGLJ.prototype.updatePriceFromRG = function (recode, updateField, newval)
 };
 
 ProjectGLJ.prototype.updatePropertyFromMainSpread = function (node, updateField, newval) {
-    if (updateField == "contain") {
-
+    if (updateField == "contain") {//更新含量和工程量时,要走定额更新的逻辑
+        projectObj.project.Ration.updateContain(newval,node);
+    }if(updateField == "quantity"){
+        projectObj.project.quantity_detail.editMainTreeNodeQuantity(newval,node,updateField);
     } else {
         this.updateGLJProperty(node, updateField, newval);
     }

+ 115 - 5
web/building_saas/main/js/models/quantity_detail.js

@@ -146,7 +146,9 @@ var quantity_detail = {
                     me.cleanQuantityDetail();
                 }else {
                     data.newRecord?me.refreshAfterSave(data.newRecord):me.refreshAfterSave(data);
-                    data.node?gljOprObj.refreshTreeNode(data.node):"";
+                    if(data.node){
+                      me.refreshRationOrBillNodes(data.node);
+                    }
                     //gljOprObj.detailSheet.setActiveCell(0,0);
                     //gljOprObj.detailSheet.clearSelection();
                 }
@@ -156,6 +158,19 @@ var quantity_detail = {
                 $.bootstrapLoading.end();
             });
         };
+        quantity_detail.prototype.refreshRationOrBillNodes=function(node){//工程量明细更新后触发定额或清单工程量改变,进行相应的更新
+            var nodes = gljOprObj.refreshTreeNode(node);
+            if(nodes.length>0){//触发计算
+                let newNode = nodes[0];
+                if(newNode.sourceType === project.Bills.getSourceType()){
+                    console.log(newNode.data.quantity);
+                    this.updateBillQuantity(newNode.data.quantity,newNode);
+                }else {//更新定额所使用的值要用还没转换前的
+                    this.updateRationQuantity(node.data.r_quantity,newNode,newNode.data.quantityEXP);//to do 加上工程量表达式和含量更新
+                }
+            }
+        };
+
         quantity_detail.prototype.insertQuantityDetail = function (row) {
             var args = {
                 row:row,
@@ -175,7 +190,9 @@ var quantity_detail = {
                $.bootstrapLoading.start();
                var callback=function (result) {
                    me.refreshAfterDelete(result.data);
-                   result.node?gljOprObj.refreshTreeNode(result.node):"";
+                   if(result.node){//触发计算
+                       me.refreshRationOrBillNodes(result.node);
+                   }
                    $.bootstrapLoading.end();
                }
                CommonAjax.post("/quantity_detail/deleteRecode",recode,callback,function () {
@@ -315,7 +332,9 @@ var quantity_detail = {
             $.bootstrapLoading.start();
             var callback = function (data) {
                 me.refreshAfterUpdate(data);
-                data.node?gljOprObj.refreshTreeNode(data.node):"";
+                if(data.node){
+                  me.refreshRationOrBillNodes(data.node);
+                }
                 $.bootstrapLoading.end();
             }
             CommonAjax.post(url,postData,callback,function () {
@@ -489,10 +508,9 @@ var quantity_detail = {
             }
             return validate;
         };
-        quantity_detail.prototype.autoTransformQuantity = function(value,node){
+        quantity_detail.prototype.autoTransformQuantity = function(value,node){//根据单位转换定额工程量
             let data = node.data;
             let option = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS,'rationQuanACToRationUnit');
-            console.log(option);
             if(option==true&&node.sourceType === project.Ration.getSourceType()&&data.unit) {//还需加入判读是否转换
                 let times = parseInt(data.unit);
                 if (isNaN(times)) {
@@ -502,6 +520,98 @@ var quantity_detail = {
             }
             return value;
         };
+        quantity_detail.prototype.reverseQuantity = function (value,node) {//根据单位反向运算出工程量
+            let data = node.data;
+            if(node.sourceType === project.Ration.getSourceType()&&data.unit){
+                let times = parseInt(data.unit);
+                if (isNaN(times)) {
+                    times = 1
+                }
+                value = value * times;
+            }
+            return value
+        };
+        quantity_detail.prototype.editMainTreeNodeQuantity=function (value,node,fieldName) {
+            var me = this;
+            if(isNaN(value)){
+                alert("当前输入的数据类型不正确,请重新输入");
+                projectObj.mainController.refreshTreeNode([node]);
+            }else {
+                value=value?value:0;
+                setTimeout(function () {//spreadjs事件和提示窗口会有冲突,所以要用延时的方法
+                    if(project.quantity_detail.quantityEditChecking(value,node,fieldName)){
+                        node.data.isFromDetail=0;
+                        project.quantity_detail.cleanQuantityDetail(node,true);
+                        if(node.sourceType === project.Bills.getSourceType()){
+                            me.updateBillQuantity(value,node);
+                        }else {
+                            me.updateRationQuantity(value,node);//to do 加上工程量表达式和含量更新
+                        }
+                    }else {
+                        projectObj.mainController.refreshTreeNode([node]);
+                    }
+                },100);
+            }
+        };
+        quantity_detail.prototype.updateBillQuantity=function (value,node) {
+            value = scMathUtil.roundForObj(value,getDecimal("quantity",node));
+            node.data.quantity = value+"";
+            let needUpdateChildren = [];//需更新的子定额
+            let gljNodes=[];//当定额工程量改变时需刷新的子工料机
+            if(node.children.length>0){//如果有子项则
+                for(let rationNode of node.children){
+                    let EXPString = rationNode.data.quantityEXP+"";
+                    if(EXPString.indexOf("QDL")!=-1){//如果定额的工程量是通过计算出来的,则应该重新计算。
+                        let tem_contain = scMathUtil.roundForObj(rationNode.data.contain,getDecimal("process"));
+                        let tem_quantity = scMathUtil.roundForObj(value*tem_contain,getDecimal("quantity",rationNode));
+                        rationNode.data.quantity = this.autoTransformQuantity(tem_quantity,rationNode);
+                        rationNode.changed = true;
+                        needUpdateChildren.push(rationNode);
+                        if (rationNode.children.length>0){//如果有子工料机
+                            gljNodes = gljNodes.concat(rationNode.children);
+                        }
+                    }else {
+                        let tem_contain=0;
+                        if(value&&value!=0){
+                           let children_quantity = scMathUtil.roundForObj(rationNode.data.quantity,getDecimal("quantity"),rationNode);
+                           children_quantity = scMathUtil.roundForObj(this.reverseQuantity(children_quantity,rationNode),getDecimal("quantity",rationNode));
+                            tem_contain =scMathUtil.roundForObj(children_quantity/value,getDecimal("process"));
+                        }
+                        rationNode.data.contain = tem_contain;
+                        rationNode.changed = true;
+                        needUpdateChildren.push(rationNode);
+                    }
+                }
+            }
+            if(needUpdateChildren.length>0){
+                project.calcProgram.calcRationsAndSave(needUpdateChildren);
+            }else {
+                node.changed = true;
+                project.calcProgram.calculate(node);
+                project.calcProgram.saveNode(node);
+            }
+            if(gljNodes.length>0){
+                projectObj.mainController.refreshTreeNode(gljNodes);
+            }
+        };
+        quantity_detail.prototype.updateRationQuantity=function(value,node,quantityEXP){
+            node.data.quantityEXP = quantityEXP?quantityEXP:value;
+            value = scMathUtil.roundForObj(value,getDecimal("ration.quantity"));
+            if(node.parent.data.quantity&&node.parent.data.quantity!=0&&node.parent.data.quantity!=""){
+                var billQuantity = scMathUtil.roundForObj(node.parent.data.quantity,getDecimal("quantity",node.parent));
+                node.data.contain = scMathUtil.roundForObj(value/billQuantity,getDecimal("process"));
+            }else {
+                node.data.contain=0;
+            }
+            value = project.quantity_detail.autoTransformQuantity(value,node);
+            value = scMathUtil.roundForObj(value,decimalObj.decimal("quantity",node))
+            node.data.quantity=value;
+            node.changed = true;
+            project.calcProgram.calculate(node);
+            project.calcProgram.saveNode(node);
+            projectObj.mainController.refreshTreeNode(node.children);//刷新子工料机总消耗量
+            gljOprObj.showRationGLJSheetData();
+        };
         quantity_detail.prototype.getDecimal=function (node) {
             var decimal = 3;
             if(node.sourceType === project.Bills.getSourceType()){

+ 35 - 2
web/building_saas/main/js/models/ration.js

@@ -335,13 +335,17 @@ var Ration = {
 
         ration.prototype.CalculateQuantity = function (ration) {
             // calculate ration Quantity
+            let quantity_decimal = getDecimal("ration.quantity");
+            let process_decimal = getDecimal("process");
             if (optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'rationQuanACToBillsQuan')) {
                 let billsNode = this.project.Bills.tree.findNode(ration[this.project.masterField.ration]);
                 let billsQuantity = billsNode.data.quantity ? billsNode.data.quantity : 0;
+                ration.contain = 1;
+                ration.quantityEXP="QDL";
                 if (optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'rationQuanACToRationUnit')) {
-                    ration.quantity = (billsQuantity / this.FilterNumberFromUnit(ration.unit)).toDecimal(4);
+                    ration.quantity = (billsQuantity / this.FilterNumberFromUnit(ration.unit)).toDecimal(quantity_decimal);
                 } else {
-                    ration.quantity = billsQuantity.toDecimal(4);
+                    ration.quantity = billsQuantity.toDecimal(quantity_decimal);
                 }
             }
         };
@@ -379,6 +383,35 @@ var Ration = {
 
             this.project.endUpdate();
         };
+        ration.prototype.updateContain=function (value,node) {
+            if(isNaN(value)){
+                alert("当前输入的数据类型不正确,请重新输入");
+                projectObj.mainController.refreshTreeNode([node]);
+                return;
+            }
+            let billNode = node.parent;
+            let contain = scMathUtil.roundForObj(value,getDecimal("process"));
+            if(node.data.quantityEXP=="GCLMXHJ"){//如果定额工程量是来自工程量明细
+                var c = confirm('已有工程量明细,是否清空明细表,采用手工输入的表达式?');
+                if(c){
+                    node.data.isFromDetail=0;
+                    project.quantity_detail.cleanQuantityDetail(node,true);
+                }else {
+                    projectObj.mainController.refreshTreeNode([node]);
+                    return;
+                }
+            }
+            let billQuantity = billNode.data.quantity||billNode.data.quantity!=""?billNode.data.quantity:0;
+            billQuantity = parseFloat(billQuantity);
+            node.data.contain = contain;
+            node.data.quantityEXP="QDL*"+contain;
+            node.data.quantity=scMathUtil.roundForObj(billQuantity*contain,getDecimal("quantity"),node);
+            node.data.quantity = projectObj.project.quantity_detail.autoTransformQuantity(node.data.quantity,node);//按单位做转换
+            node.changed = true;
+            project.calcProgram.calculate(node);
+            project.calcProgram.saveNode(node);
+            projectObj.mainController.refreshTreeNode(node.children);//刷新子工料机树节点总消耗量
+        };
         
         return new ration(project);
     }

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

@@ -992,8 +992,6 @@ var gljOprObj = {
         }
     },
     updateRationTypeGLJ: function (value, node, fieldName) {
-        console.log(fieldName)
-        console.log(value);
         let newval;
         let updatePrice = false;
         if (fieldName == "marketUnitFee") {
@@ -1363,6 +1361,7 @@ var gljOprObj = {
             }
         }
         projectObj.mainController.refreshTreeNode(nodes);
+        return nodes;
 
     },
     getTreeNodeCellType: function (data) {

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

@@ -129,6 +129,9 @@ let MainTreeCol = {
         },
         forMarketPrice: function (node) {
             return MainTreeCol.readOnly.bills(node) || (MainTreeCol.readOnly.ration(node) && node.data.type == rationType.ration) || gljOprObj.marketPriceReadOnly(node);
+        },
+        forContain:function (node) {
+            return MainTreeCol.readOnly.non_ration(node)&&!MainTreeCol.readOnly.glj(node);
         }
     },
     cellType: {

+ 22 - 18
web/building_saas/main/js/views/project_view.js

@@ -119,7 +119,7 @@ var projectObj = {
         return value;
     },
     checkSpreadEditingText: function (editingText, colSetting) {
-        if (colSetting.data.field === 'quantity') {
+        if (colSetting.data.field === 'quantity'||colSetting.data.field === 'contain') {
             return this.checkFormulaValidField(editingText, colSetting);
         }
         else if (colSetting.data.field === 'programID') {
@@ -268,7 +268,7 @@ var projectObj = {
         let project = projectObj.project, fieldName = colSetting.data.field;
         if(node.sourceType==project.ration_glj.getSourceType()){
             project.ration_glj.updateFromMainSpread(value,node,fieldName);
-        }if(node.sourceType==ModuleNames.ration&&node.data.type==rationType.gljRation){
+        }else if(node.sourceType==ModuleNames.ration&&node.data.type==rationType.gljRation){
             gljOprObj.updateRationTypeGLJ(value,node,fieldName);
         } else if (value !== calcFees.getFee(node.data, fieldName)||fieldName == 'quantity') {//工程量需要进行转换,所以做特殊处理
             if (fieldName === 'code' && !project.calcProgram.isVolumePrice(node)) {
@@ -276,25 +276,14 @@ var projectObj = {
             }
             else if(fieldName ==='feeRate'){
                 project.FeeRate.updateFeeRateFromBills(value,node,fieldName);
+            }else if(fieldName ==='contain'){//编辑含量
+                project.Ration.updateContain(value,node);
             }
             else if (fieldName === 'quantity' || fieldName === 'marketUnitFee' || fieldName === 'programID' ||
                 fieldName === 'subType' || fieldName === 'calcBase' || fieldName === 'feesIndex.common.unitFee'){
                 if (fieldName === 'quantity') {
-                   if (value) {
-                       value = project.quantity_detail.autoTransformQuantity(value,node);
-                       value = scMathUtil.roundForObj(value,decimalObj.decimal(fieldName,node));
-                       if(value==node.data[fieldName]){
-                           projectObj.mainController.refreshTreeNode([node]);
-                           return;
-                       }
-                   };
-                   if(project.quantity_detail.quantityEditChecking(value,node,fieldName)){
-                       node.data.isFromDetail=0;
-                       project.quantity_detail.cleanQuantityDetail(node,true);
-                   }else {
-                       projectObj.mainController.refreshTreeNode([node]);
-                       return;
-                   }
+                    project.quantity_detail.editMainTreeNodeQuantity(value,node,fieldName);
+                    return;
                 }
                 else if (fieldName === 'marketUnitFee' || fieldName === 'feesIndex.common.unitFee') {
                     if (value) {value = parseFloat(value).toDecimal(decimalObj.decimal("unitPrice", node))};
@@ -446,7 +435,9 @@ var projectObj = {
                             col.data.wordWrap = true;
                         }
                     }
-
+                    if(col.data.field ==='quantity'){
+                        col.showHint = true;
+                    }
                     // for test digit. CSLAAAAA
                     if (col.data.field.hasSubStr("totalFee"))
                        col.data.formatter = MainTreeCol.getNumberFormatter(decimalObj.ration.totalPrice, false)
@@ -486,6 +477,19 @@ var projectObj = {
                 return target.hitTestType === GC.Spread.Sheets.SheetArea.viewport || target.hitTestType === GC.Spread.Sheets.SheetArea.rowHeader;
             },
             items: {
+                "insertRootBill": {
+                    name: "插入大项",
+                    icon: 'fa-sign-in',
+                    disabled: function () {
+                        //return project.mainTree.selected ? project.mainTree.selected.sourceType !== project.Bills.getSourceType() : false;
+                    },
+                    callback: function (key, opt) {
+                        //ProjectController.addBills(project, controller);
+                    },
+                    visible: function(key, opt){
+                        return false;
+                    }
+                },
                 "insertBills": {
                     name: "插入清单",
                     icon: 'fa-sign-in',