Kaynağa Gözat

Merge branch '1.0.0_online' of http://192.168.1.41:3000/SmartCost/ConstructionCost into 1.0.0_online

TonyKang 6 yıl önce
ebeveyn
işleme
2e786fb814

+ 61 - 3
modules/main/facade/project_facade.js

@@ -12,7 +12,8 @@ module.exports = {
     markProjectsToChange:markProjectsToChange,
     getSEIProjects:getSEIProjects,
     loadSEIProjectData:loadSEIProjectData,
-    setSEILibData:setSEILibData
+    setSEILibData:setSEILibData,
+    getIndexReportData:getIndexReportData
 };
 
 let mongoose = require('mongoose');
@@ -37,8 +38,8 @@ let engineerFeatureLib = mongoose.model('std_engineer_feature_lib');
 let engineerInfoLib = mongoose.model('std_engineer_info_lib');
 let mainQuantityLib = mongoose.model('std_main_quantity_lib');
 let materialLib = mongoose.model('std_material_lib');
-
-
+import fixedFlag from '../../common/const/bills_fixed';
+const scMathUtil = require('../../../public/scMathUtil').getUtil();
 
 async function calcInstallationFee(data) {
     let result={};
@@ -381,4 +382,61 @@ async function setSEILibData(property){
         let economic = await economicLib.findOne({'ID':property.economicLibID});
         if(economic) property.economics = economic.index;
     }
+}
+
+async function getIndexReportData(projectID) {
+    let project = await projectsModel.findOne({ID:projectID});
+    let bills = await bill_model.getDataSync(projectID);
+    let engineerCostList = getEngineerCostData(project.property,bills);
+    let engineerEcoList = getEconomicDatas(project.property,bills);
+    let mainMaterialList = await getMainMaterialDatas(projectID,project.property);
+    let quantityList = await getQuantityDatas(project.property,bills);
+    let result = {
+        ProjectCostFields:engineerCostList,
+        ProjectEcoFields:engineerEcoList,
+        ProjectLabMaterialFields:mainMaterialList,
+        ProjectQtyFields:quantityList
+    };
+    return result
+}
+
+
+function getQuantityDatas(property,bills) {
+     return gljUtil.getQuantityDatas(property.engineerFeatures,property.mainQuantities,bills,fixedFlag,_,scMathUtil,property.decimal)
+}
+
+function getEconomicDatas(property,bills) {
+   return gljUtil.getEconomicDatas(property.engineerFeatures,property.economics,bills,fixedFlag,_,scMathUtil,property.decimal)
+}
+
+
+function getEngineerCostData(property,bills){
+    let datas = [];
+    let priceIndex = gljUtil.getEngineerCostData(property,bills,fixedFlag,scMathUtil);
+    for(let c of priceIndex.children){
+        let tem = {
+            name:c.name,
+            cost:parseFloat(c.attrs[0].value),
+            unitCost:parseFloat(c.attrs[1].value),
+            per:parseFloat(c.attrs[2].value)
+        };
+        datas.push(tem);
+    }
+    return datas;
+}
+
+async function getMainMaterialDatas(projectID,property) {
+    let gljListModel = new GLJListModel();
+    let [gljList, mixRatioConnectData,mixRatioMap,unitPriceMap] = await gljListModel.getListByProjectId(projectID, property.unitPriceFile?property.unitPriceFile.id:null);
+    gljList = JSON.parse(JSON.stringify(gljList));
+    await calcProjectGLJQuantity(projectID,{gljList:gljList,mixRatioMap:mixRatioMap},property);
+    return gljUtil.getMainMaterialDatas(property.engineerFeatures,property.materials,{gljList:gljList},property.calcOptions,property.decimal,false,_,scMathUtil)
+
+}
+
+async function calcProjectGLJQuantity(projectID,projectGLJDatas,property){
+    let q_decimal = property.decimal.glj.quantity;
+    let rationGLJDatas = await ration_glj_model.find({'projectID':projectID});
+    let rationDatas = await ration_model.model.find({'projectID':projectID});
+    gljUtil.calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,[],q_decimal)
 }

+ 21 - 1
public/gljUtil.js

@@ -17,7 +17,11 @@ module.exports = {
     getBasePrice:getBasePrice,
     getAdjustPrice:getAdjustPrice,
     getGljTypeSeq:getGljTypeSeq,
-    sortRationGLJ:sortRationGLJ
+    sortRationGLJ:sortRationGLJ,
+    getEngineerCostData:getEngineerCostData,
+    getEconomicDatas:getEconomicDatas,
+    getMainMaterialDatas:getMainMaterialDatas,
+    getQuantityDatas:getQuantityDatas
 };
 
 function calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal) {
@@ -50,4 +54,20 @@ function getGljTypeSeq() {
 
 function sortRationGLJ(list,std) {
     return gljNodeUtil.sortRationGLJ(list,std);
+}
+
+function getEngineerCostData(property,bills,fixedFlag,scMathUtil) {
+    return gljNodeUtil.getEngineerCostData(property,bills,fixedFlag,scMathUtil);
+}
+
+function getEconomicDatas(engineerFeatures,economics,bills,fixedFlag,_,scMathUtil,decimal) {
+    return gljNodeUtil.getEconomicDatas(engineerFeatures,economics,bills,fixedFlag,_,scMathUtil,decimal);
+}
+
+function getMainMaterialDatas(engineerFeatures,materials,projectGLJData,calcOptions,decimalObj,isRadio,_,scMathUtil) {
+    return gljNodeUtil.getMainMaterialDatas(engineerFeatures,materials,projectGLJData,calcOptions,decimalObj,isRadio,_,scMathUtil);
+}
+
+function getQuantityDatas(engineerFeatures,mainQuantities,billsList,fixedFlag,_,scMathUtil,decimal) {
+    return gljNodeUtil.getQuantityDatas(engineerFeatures,mainQuantities,billsList,fixedFlag,_,scMathUtil,decimal);
 }

+ 232 - 0
public/web/gljUtil.js

@@ -319,6 +319,238 @@ let gljUtil = {
             return scMathUtil.roundToString(quantity * glj.quantity, gd);
         }
     },
+    getEngineerCostData:function(property,bills,fixedFlag,scMathUtil){
+        let priceIndex = {
+            name:"工程造价指标",
+            attrs:[],
+            children:[],
+        };
+        let fixMap = {};
+        let buildingArea = this.getBuildArea(property.engineerFeatures); //tender.property.projectFeature?getItemValueBykey(tender.property.projectFeature,"buildingArea"):1;//建筑面积
+
+        for(let b of bills){
+            if(b.flags && b.flags.length > 0){
+                let f = _.find(b.flags,{"fieldName":"fixed"});
+                if(f) fixMap[f.flag] = this.getTotalFee(b,scMathUtil,property.decimal);
+            }
+        }
+        //计算其他组织措施费 = 施工组织措施项目下的子项,除了  安全文明施工费、建设工程竣工档案编制费以外的项
+        let CONSTRUCTION_ORGANIZATION = fixMap[fixedFlag.CONSTRUCTION_ORGANIZATION]?fixMap[fixedFlag.CONSTRUCTION_ORGANIZATION]:0;
+        let SAFETY_CONSTRUCTION =  fixMap[fixedFlag.SAFETY_CONSTRUCTION]?fixMap[fixedFlag.SAFETY_CONSTRUCTION]:0;
+        let PROJECT_COMPLETE_ARCH_FEE =  fixMap[fixedFlag.PROJECT_COMPLETE_ARCH_FEE]? fixMap[fixedFlag.PROJECT_COMPLETE_ARCH_FEE]:0;
+        let other_org_fee = CONSTRUCTION_ORGANIZATION - SAFETY_CONSTRUCTION - PROJECT_COMPLETE_ARCH_FEE;
+        other_org_fee = other_org_fee >0 ?other_org_fee:0;
+        let engineerCost = fixMap[fixedFlag.ENGINEERINGCOST]?fixMap[fixedFlag.ENGINEERINGCOST]:1;
+        priceIndex.children.push(this.getEngineerFlag("分部分项工程费",fixMap[fixedFlag.SUB_ENGINERRING],engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("技术措施费",fixMap[fixedFlag.CONSTRUCTION_TECH],engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("安全文明施工费",fixMap[fixedFlag.SAFETY_CONSTRUCTION],engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("建设工程竣工档案编制费",fixMap[fixedFlag.PROJECT_COMPLETE_ARCH_FEE],engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("其他组织措施费",other_org_fee,engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("暂列金额",fixMap[fixedFlag.PROVISIONAL],engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("专业工程暂估价",fixMap[fixedFlag.ENGINEERING_ESITIMATE],engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("计日工",fixMap[fixedFlag.DAYWORK],engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("总承包服务费",fixMap[fixedFlag.TURN_KEY_CONTRACT],engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("索赔与现场签证",fixMap[fixedFlag.CLAIM_VISA],engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("规费",fixMap[fixedFlag.CHARGE],engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("税金",fixMap[fixedFlag.TAX],engineerCost,buildingArea,scMathUtil));
+        priceIndex.children.push(this.getEngineerFlag("工程造价",fixMap[fixedFlag.ENGINEERINGCOST],engineerCost,buildingArea,scMathUtil));
+        return priceIndex;
+    },
+    getBuildArea:function (features) {
+        if(features){
+            let areas = [];
+            for(let f of features){
+                if(f.index == true && f.value && f.value !=="" && this.IsNumber(f.value)) areas.push(f.value);
+            }
+            return areas.length==0?1:areas;
+        }
+        return 1
+    },
+    getEngineerFlag: function (name,totalCost,engineerCost,buildingArea,scMathUtil) {
+        totalCost = totalCost?totalCost:0;
+        let flag = {
+            name:name,
+            attrs:[
+                {name: "金额", value: scMathUtil.roundToString(totalCost,3)},
+                {name: "单方造价", value: scMathUtil.roundToString(this.calcUnitB(totalCost,buildingArea,scMathUtil),2)},
+                {name: "占造价比例", value: scMathUtil.roundToString(totalCost/engineerCost * 100,2)},
+            ],
+        };
+        return flag;
+    },
+    getTotalFee:function (b,scMathUtil,decimal) {
+        let total = 0;
+        if(b.fees && b.fees.length > 0){
+            for(let f of b.fees){
+                if(f.fieldName == "common"){
+                    total = scMathUtil.roundForObj(f.totalFee,decimal?decimal.bills.totalPrice:getDecimal("bills.totalPrice"));
+                }
+            }
+        }
+        return total;
+    },
+     IsNumber : function(pstrVal){
+        let dblNo = Number.NaN;
+        dblNo = new Number(pstrVal);
+        if (isNaN(dblNo)) return false;
+        return true;
+     },
+    calcUnitB:function (total,building,scMathUtil,coe,decimal = 3) {
+        if(Array.isArray(building)){
+            for(let b of building){
+                total = scMathUtil.roundForObj(total/b,6);
+            }
+        }else {
+            total = scMathUtil.roundForObj(total/building,6);
+        }
+        coe = gljUtil.isDef(coe)?coe:1;
+        return scMathUtil.roundForObj(total*coe,decimal);
+    },
+    getEconomicDatas:function(engineerFeatures,economics,billsList,fixedFlag,_,scMathUtil,decimal){
+        let datas = [];
+        let [bills,totalFee] = gljUtil.getIndexBills(billsList,fixedFlag,_,scMathUtil,decimal);
+        let billsGroup = _.groupBy(bills,'economicType');
+        if(!economics) return datas;
+        for(let e of economics){
+            let tem = {
+                name:e.name,
+                cost:0,
+                unitCost:0,
+                per:0
+            };
+            if(billsGroup[e.name]) setEconomics(billsGroup[e.name],totalFee,tem);
+            datas.push(tem);
+        }
+        function setEconomics(items,engineerCost,data) {
+            let cost = 0;
+            let priceDe = decimal?decimal.bills.totalPrice:getDecimal("bills.totalPrice");//getDecimal("bills.totalPrice");
+            for(let i of items){
+                i.totalFee =  scMathUtil.roundForObj(i.totalFee,priceDe);
+                cost = scMathUtil.roundForObj(cost + i.totalFee,decimal?decimal.process:getDecimal("process"))//getDecimal("process");
+            }
+            data.cost = scMathUtil.roundForObj(cost,priceDe,_);
+            data.unitCost = gljUtil.calUnitWidthCoe(data.cost,true,engineerFeatures,_,scMathUtil);//noNeedCoe = true 这里不需要乘以系数
+            data.per = engineerCost?scMathUtil.roundForObj(data.cost/engineerCost * 100,2):0;
+        }
+
+        return datas;
+    },
+    calUnitWidthCoe:function (total,noNeedCoe,engineerFeatures,_,scMathUtil) {
+        let areas = gljUtil.getBuildArea(engineerFeatures);
+        let f = _.find(engineerFeatures,{index:true});
+        return f && noNeedCoe!==true?gljUtil.calcUnitB(total,areas,scMathUtil,f.coe):gljUtil.calcUnitB(total,areas,scMathUtil);
+    },
+    getIndexBills:function (bills,fixedFlag,_,scMathUtil,decimal) {
+        let parentMap = {},datas = [],totalCost = 0;
+        let FBFX_b = null,teh_b = null,costNode=null;
+        for(let b of bills) {
+            parentMap[b.ParentID] ? parentMap[b.ParentID].push(b) : parentMap[b.ParentID] = [b];//有添加,无则生成
+            if(b.flags && b.flags.length > 0){
+                let f = _.find(b.flags,{"fieldName":"fixed"});
+                if(!f) continue;
+                if(f.flag == fixedFlag.SUB_ENGINERRING) FBFX_b = b;//过滤出分部分项工程;
+                if(f.flag == fixedFlag.CONSTRUCTION_TECH) teh_b = b;//过滤出技术措施项目;
+                if(f.flag == fixedFlag.ENGINEERINGCOST) costNode = b;//过滤出工程造价项目;
+            }
+        }
+        if(FBFX_b) getChildren(FBFX_b,parentMap,datas);
+        if(teh_b) getChildren(teh_b,parentMap,datas);
+        if(costNode) totalCost = gljUtil.getTotalFee(costNode,scMathUtil,decimal);
+
+        for(let td of datas){
+            if(parentMap[td.ID]){
+                td.economicType = "";
+                td.quantityIndexType = "";
+                td.quantityIndexUnit = "";
+                td.quantityIndexCoe = "";
+            }
+        }
+        return [datas,totalCost];
+
+        function getChildren(d,map,arr) {
+            let tem = {
+                ID:d.ID,
+                ParentID:d.ParentID,
+                code:d.code,
+                name:d.name,
+                unit:d.unit,
+                quantity:d.quantity,
+                totalFee:gljUtil.getTotalFee(d,scMathUtil,decimal),
+                economicType:d.economicType,
+                quantityIndexType:d.quantityIndexType,
+                quantityIndexUnit:d.quantityIndexUnit,
+                quantityIndexCoe:d.quantityIndexCoe,
+            };
+            arr.push(tem);
+            if(map[d.ID]){
+                for(let s of map[d.ID]){
+                    getChildren(s,map,arr)
+                }
+            }
+        }
+    },
+    getMainMaterialDatas:function (engineerFeatures,materials,projectGLJData,calcOptions,decimalObj,isRadio,_,scMathUtil) {
+        let datas = [];
+        let materialGroup = _.groupBy(projectGLJData.gljList,'materialIndexType');
+        if(!materials) return datas;
+        for(let m of materials){
+            let tem = {
+                name:m.name,
+                unit:m.unit,
+                unitPrice:0,
+                quantity:0,
+                unitIndex:0
+            };
+            if(materialGroup[m.name]) setMainMaterial(materialGroup[m.name],tem);
+            datas.push(tem);
+        }
+
+        function setMainMaterial(gljs,data) {
+            let quantity = 0 ,unitPrice=0;
+            for(let g of gljs){
+                if(!g.quantity || g.quantity=="") continue;
+                let marketPrice = gljUtil.getMarketPrice(g,projectGLJData,calcOptions,decimalObj,false,_,scMathUtil); // gljOprObj.setGLJPrice(tem,g);
+                let materialIndexCoe = g.materialIndexCoe?scMathUtil.roundForObj(g.materialIndexCoe,decimalObj.process):0;
+                let t_quantity = scMathUtil.roundForObj(g.quantity * materialIndexCoe,decimalObj.process);
+                quantity = scMathUtil.roundForObj(t_quantity + quantity,decimalObj.process);
+                let temPrice = scMathUtil.roundForObj(g.quantity * marketPrice,decimalObj.process);
+                unitPrice = scMathUtil.roundForObj(temPrice + unitPrice,decimalObj.process);
+            }
+            data.quantity = scMathUtil.roundForObj(quantity,2);
+            if(data.quantity) data.unitPrice = scMathUtil.roundForObj(unitPrice/data.quantity,2);
+            data.unitIndex = gljUtil.calUnitWidthCoe(data.quantity,false,engineerFeatures,_,scMathUtil);
+        }
+
+        return datas;
+    },
+    getQuantityDatas:function (engineerFeatures,mainQuantities,billsList,fixedFlag,_,scMathUtil,decimal) {//主要工程量指标
+        let datas = [];
+        let [bills,totalFee] = gljUtil.getIndexBills(billsList,fixedFlag,_,scMathUtil,decimal);//bills,fixedFlag,_,scMathUtil
+        let billsGroup = _.groupBy(bills,'quantityIndexType');
+        if(!mainQuantities) return datas;
+        for(let m of mainQuantities){
+            let tem = {
+                name : m.name,
+                quantityIndexUnit:m.unit,
+                quantity:0
+            };
+            if(billsGroup[m.name]) setQuantities(billsGroup[m.name],tem);
+
+            datas.push(tem);
+        }
+
+        function setQuantities(items,data) {
+            let quantity = 0;
+            for (let i of items){
+                let coe = i.quantityIndexCoe && i.quantityIndexCoe!=""?parseFloat(i.quantityIndexCoe):0;
+                i.quantity = scMathUtil.roundForObj(parseFloat(i.quantity)*coe,decimal.process);
+                quantity = scMathUtil.roundForObj(quantity +  i.quantity,decimal.process);
+            }
+            data.quantity = gljUtil.calUnitWidthCoe(quantity,false,engineerFeatures,_,scMathUtil);
+        }
+
+        return datas;
+    },
     fixedFlag : {
         // 分部分项工程
         SUB_ENGINERRING: 1,

+ 4 - 4
web/building_saas/main/js/models/bills.js

@@ -42,10 +42,10 @@ var Bills = {
                 }
                 if (uData.fees) {
                     for (let fee of uData.fees) {
-                        fee.unitFee = fee.unitFee.toFixed(2);
-                        fee.totalFee = fee.totalFee.toFixed(2);
-                        fee.tenderUnitFee = fee.tenderUnitFee.toFixed(2);
-                        fee.tenderTotalFee = fee.tenderTotalFee.toFixed(2);
+                        if(fee.unitFee)fee.unitFee = fee.unitFee.toFixed(2);
+                        if(fee.totalFee)fee.totalFee = fee.totalFee.toFixed(2);
+                        if(fee.tenderUnitFee)fee.tenderUnitFee = fee.tenderUnitFee.toFixed(2);
+                        if(fee.tenderTotalFee)fee.tenderTotalFee = fee.tenderTotalFee.toFixed(2);
                     }
                 }
                 return uData;

+ 18 - 4
web/building_saas/main/js/models/calc_program.js

@@ -360,9 +360,17 @@ let calcTools = {
                     if (!mds) mds = [];
                     for (let md of mds){
                         if (gljTypes.includes(md.type)){
-                            let gljQ = isTender ? me.uiGLJQty(glj["tenderQuantity"]) : me.uiGLJQty(glj["quantity"]);
+                            let gljQ = me.uiGLJQty(glj["quantity"]);
+                            let mdMP = md["marketPrice"];
+                            if (isTender){
+                                calcTools.calcGLJTenderPrice(md);
+                                mdMP = md["tenderPrice"];
+
+                                calcTools.calcGLJTenderQty(treeNode, glj);
+                                gljQ = me.uiGLJQty(glj["tenderQuantity"]);
+                            };
                             let mdQ = me.uiGLJQty(md.consumption);
-                            let mdMP = isTender ? md["tenderPrice"] : md["marketPrice"];
+
                             let mdAP = calcTools.hasAdjustPrice() ? md["adjustPrice"] : md["basePrice"];
                             // if (aprice != mprice){
                             temp = (temp + (gljQ * mdQ * mdMP).toDecimal(decimalObj.process)).toDecimal(decimalObj.process);
@@ -965,6 +973,10 @@ let calcTools = {
             return scMathUtil.roundForObj(node.data.feeRate,decimal);
 
         return 100;
+    },
+    isEmptyObject(obj){
+        let arr = Object.keys(obj);
+        return arr.length == 0;
     }
 };
 
@@ -1725,7 +1737,7 @@ class CalcProgram {
                         // 取费方式为子目含量,清单行/列的XX单价应 =ROUND( ∑ROUND(定额XX单价*含量,清单单价精度),清单单价精度)
                         if (me.project.property.billsCalcMode === leafBillGetFeeType.rationContent) {
                             buf = (buf + (ruf * parseFloatPlus(node.data.contain)).toDecimal(decimalObj.bills.unitPrice)).toDecimal(decimalObj.process);
-                            node.data.tenderContaion = (node.data.tenderQuantity / bq).toDecimal(decimalObj.decimal.process);
+                            node.data.tenderContaion = (node.data.tenderQuantity / bq).toDecimal(decimalObj.process);
                             btuf = (btuf + (rtuf * parseFloatPlus(node.data.tenderContaion)).toDecimal(decimalObj.bills.unitPrice)).toDecimal(decimalObj.process);
                         };
                         sum_rtf = (sum_rtf + rtf).toDecimal(decimalObj.process);
@@ -1907,6 +1919,8 @@ class CalcProgram {
     saveNodes(treeNodes, callback){
         if (treeNodes.length < 1) {
             $.bootstrapLoading.end();
+            this.rationMap = null;
+            this.pgljMap = null;
             return;
         }
 
@@ -2165,7 +2179,7 @@ class CalcProgram {
         }else if (tender == tenderTypes.ttReverseGLJ){
             treeNode.data.tenderQuantity = treeNode.data.quantity;
             let qcObj = treeNode.data.quantityCoe;
-            if (!qcObj){
+            if (!qcObj || calcTools.isEmptyObject(qcObj)){
                 treeNode.data.quantityCoe = {labour: coe, material: coe, machine: coe, main: coe, equipment: coe};
                 treeNode.changed = true;
             }else{

+ 8 - 119
web/building_saas/main/js/models/exportSEIInterface.js

@@ -4,136 +4,25 @@
 
 let exportUtil = {
     setEngineerPriceIndex:function (tender,projectData) {
-        let priceIndex = {
-            name:"工程造价指标",
-            attrs:[],
-            children:[],
-        };
-        let fixMap = {};
-        let buildingArea = this.getBuildArea(tender.property.engineerFeatures); //tender.property.projectFeature?getItemValueBykey(tender.property.projectFeature,"buildingArea"):1;//建筑面积
-
-        for(let b of projectData.bills){
-            if(b.flags && b.flags.length > 0){
-                let f = _.find(b.flags,{"fieldName":"fixed"});
-                if(f) fixMap[f.flag] = this.getTotalFee(b);
-            }
-        }
-        //计算其他组织措施费 = 施工组织措施项目下的子项,除了  安全文明施工费、建设工程竣工档案编制费以外的项
-        let CONSTRUCTION_ORGANIZATION = fixMap[fixedFlag.CONSTRUCTION_ORGANIZATION]?fixMap[fixedFlag.CONSTRUCTION_ORGANIZATION]:0;
-        let SAFETY_CONSTRUCTION =  fixMap[fixedFlag.SAFETY_CONSTRUCTION]?fixMap[fixedFlag.SAFETY_CONSTRUCTION]:0;
-        let PROJECT_COMPLETE_ARCH_FEE =  fixMap[fixedFlag.PROJECT_COMPLETE_ARCH_FEE]? fixMap[fixedFlag.PROJECT_COMPLETE_ARCH_FEE]:0;
-        let other_org_fee = CONSTRUCTION_ORGANIZATION - SAFETY_CONSTRUCTION - PROJECT_COMPLETE_ARCH_FEE;
-        other_org_fee = other_org_fee >0 ?other_org_fee:0;
-        let engineerCost = fixMap[fixedFlag.ENGINEERINGCOST]?fixMap[fixedFlag.ENGINEERINGCOST]:1;
-        priceIndex.children.push(this.getFlag("分部分项工程费",fixMap[fixedFlag.SUB_ENGINERRING],engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("技术措施费",fixMap[fixedFlag.CONSTRUCTION_TECH],engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("安全文明施工费",fixMap[fixedFlag.SAFETY_CONSTRUCTION],engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("建设工程竣工档案编制费",fixMap[fixedFlag.PROJECT_COMPLETE_ARCH_FEE],engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("其他组织措施费",other_org_fee,engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("暂列金额",fixMap[fixedFlag.PROVISIONAL],engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("专业工程暂估价",fixMap[fixedFlag.ENGINEERING_ESITIMATE],engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("计日工",fixMap[fixedFlag.DAYWORK],engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("总承包服务费",fixMap[fixedFlag.TURN_KEY_CONTRACT],engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("索赔与现场签证",fixMap[fixedFlag.CLAIM_VISA],engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("规费",fixMap[fixedFlag.CHARGE],engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("税金",fixMap[fixedFlag.TAX],engineerCost,buildingArea));
-        priceIndex.children.push(this.getFlag("工程造价",fixMap[fixedFlag.ENGINEERINGCOST],engineerCost,buildingArea));
-        return priceIndex;
+       return gljUtil.getEngineerCostData(tender.property,projectData.bills,fixedFlag,scMathUtil);
     },
     getTotalFee:function (b) {
-        let total = 0;
-        if(b.fees && b.fees.length > 0){
-            let common = _.find(b.fees,{"fieldName":"common"});
-            if(common) total = scMathUtil.roundForObj(common.totalFee,getDecimal("bills.totalPrice"))
-        }
-        return total;
+        return gljUtil.getTotalFee(b,scMathUtil);
     },
     getFlag: function (name,totalCost,engineerCost,buildingArea) {
-        totalCost = totalCost?totalCost:0;
-        let flag = {
-            name:name,
-            attrs:[
-                {name: "金额", value: scMathUtil.roundToString(totalCost,3)},
-                {name: "单方造价", value: scMathUtil.roundToString(exportUtil.calcUnitB(totalCost,buildingArea),2)},
-                {name: "占造价比例", value: scMathUtil.roundToString(totalCost/engineerCost * 100,2)},
-            ],
-        };
-        return flag;
+        return gljUtil.getEngineerFlag(name,totalCost,engineerCost,buildingArea);
     },
     getBuildArea:function (features) {
-        if(features){
-            let areas = [];
-            for(let f of features){
-                if(f.index == true && f.value && f.value !=="" && IsNumber(f.value)) areas.push(f.value);
-            }
-            return _.isEmpty(areas)?1:areas;
-        }
-        return 1
+        return gljUtil.getBuildArea(features)
     },
-    calcUnitB:function (total,building,coe,decimal = 3) {
-        if(Array.isArray(building)){
-            for(let b of building){
-                total = scMathUtil.roundForObj(total/b,6);
-            }
-        }else {
-            total = scMathUtil.roundForObj(total/building,6);
-        }
-        coe = gljUtil.isDef(coe)?coe:1;
-        return scMathUtil.roundForObj(total*coe,decimal);
+    calcUnitB:function (total,building,scMathUtil,coe,decimal = 3) {
+        return gljUtil.calcUnitB(total,building,scMathUtil,coe,decimal)
     },
     calUnitWidthCoe:function (total,noNeedCoe) {
-        let areas = exportUtil.getBuildArea(projectObj.project.property.engineerFeatures);
-        let f = _.find(projectObj.project.property.engineerFeatures,{index:true});
-        return f && noNeedCoe!==true?exportUtil.calcUnitB(total,areas,f.coe):exportUtil.calcUnitB(total,areas);
+        return gljUtil.calUnitWidthCoe(total,noNeedCoe,projectObj.project.property.engineerFeatures,_,scMathUtil);
     },
     getIndexBills:function (bills) {
-        let parentMap = {},datas = [],totalCost = 0;
-        let FBFX_b = null,teh_b = null,costNode=null;
-        for(let b of bills) {
-            parentMap[b.ParentID] ? parentMap[b.ParentID].push(b) : parentMap[b.ParentID] = [b];//有添加,无则生成
-            if(b.flags && b.flags.length > 0){
-                let f = _.find(b.flags,{"fieldName":"fixed"});
-                if(!f) continue;
-                if(f.flag == fixedFlag.SUB_ENGINERRING) FBFX_b = b;//过滤出分部分项工程;
-                if(f.flag == fixedFlag.CONSTRUCTION_TECH) teh_b = b;//过滤出技术措施项目;
-                if(f.flag == fixedFlag.ENGINEERINGCOST) costNode = b;//过滤出工程造价项目;
-            }
-        }
-        if(FBFX_b) getChildren(FBFX_b,parentMap,datas);
-        if(teh_b) getChildren(teh_b,parentMap,datas);
-        if(costNode) totalCost = exportUtil.getTotalFee(costNode);
-
-        for(let td of datas){
-            if(parentMap[td.ID]){
-                td.economicType = "";
-                td.quantityIndexType = "";
-                td.quantityIndexUnit = "";
-                td.quantityIndexCoe = "";
-            }
-        }
-        return [datas,totalCost];
-
-        function getChildren(d,map,arr) {
-            let tem = {
-                ID:d.ID,
-                ParentID:d.ParentID,
-                code:d.code,
-                name:d.name,
-                unit:d.unit,
-                quantity:d.quantity,
-                totalFee:exportUtil.getTotalFee(d),
-                economicType:d.economicType,
-                quantityIndexType:d.quantityIndexType,
-                quantityIndexUnit:d.quantityIndexUnit,
-                quantityIndexCoe:d.quantityIndexCoe,
-            };
-            arr.push(tem);
-            if(map[d.ID]){
-                for(let s of map[d.ID]){
-                    getChildren(s,map,arr)
-                }
-            }
-        }
+        return gljUtil.getIndexBills(bills,fixedFlag,_,scMathUtil);
     }
 };
 

+ 7 - 5
web/building_saas/main/js/models/exportStandardInterface.js

@@ -546,7 +546,7 @@ const XMLStandard = (function () {
                     failHint: `第${source.row}行清单-“名称”`},
                 {name: '计算基础表达式', value: source.calcBase, required: true},
                 {name: '计算基础说明', value: source.calcBaseState},
-                {name: '费率', value: exportKind === _config.EXPORT_KIND.Tender ? source.feeRate : '100', required: true},
+                {name: '费率', value: exportKind === _config.EXPORT_KIND.Tender ? source.feeRate : '0', required: true},
                 {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0', required: true},
                 {name: '暂估价标志', value: !!source.isEstimate, type: _config.TYPE.BOOL},
                 {name: '备注', value: source.remark},
@@ -748,10 +748,10 @@ const XMLStandard = (function () {
                 {name: '行代号', value: source.rowCode, maxLen: 20, required: true},
                 {name: '名称', value: source.name, minLen: 1, maxLen: 255, whiteSpace: _config.WHITE_SPACE.COLLAPSE, required: true,
                     failHint: `第${source.row}行清单-“名称”`},
-                {name: '计算基础表达式', value: exportKind === _config.EXPORT_KIND.Tender ? source.calcBase : '', maxLen: 255, required: true,
+                {name: '计算基础表达式', value: source.calcBase, maxLen: 255, required: true,
                     failHint: `第${source.row}行清单-“计算基础表达式”`},
-                {name: '计算基础说明', value: exportKind === _config.EXPORT_KIND.Tender ? source.calcBaseState : '', maxLen: 255},
-                {name: '费率', value: exportKind === _config.EXPORT_KIND.Tender ? source.feeRate : '100', type: _config.TYPE.DECIMAL, required: true},
+                {name: '计算基础说明', value: source.calcBaseState, maxLen: 255},
+                {name: '费率', value: exportKind === _config.EXPORT_KIND.Tender ? source.feeRate : '0', type: _config.TYPE.DECIMAL, required: true},
                 {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0', type: _config.TYPE.NUM2, required: true},
                 {name: '费用类别', value: source.feeType, enumeration: ['800', '900', '9001', '9002', '9003'], required: true,
                     enumerationHint: ['规费', '税金', '增值税', '附加税', '环境保护税'],
@@ -951,6 +951,8 @@ const XMLStandard = (function () {
         //@param {Number}tenderID(当前界面的单位工程ID,后台根据这个单位工程,去找其建设项目下所有数据)
         //@return {Object}(eleObj)
         async function loadProject(projectData) {
+            // 标记自检提示的开始(一次性多出多个文件类型,会导出多次)
+            _failList.push(_config.HINT_START);
             console.log(projectData);
             //标段
             let project = new Project({
@@ -1727,7 +1729,7 @@ const XMLStandard = (function () {
                             code: node.data.code,
                             name: node.data.name,
                             serviceContent: node.data.serviceContent,
-                            calcBaseValue: node.data.calcBase,
+                            calcBaseValue: node.data.calcBaseValue,
                             feeRate: _util.hasValue(node.data.feeRate) ? node.data.feeRate : 100,
                             fees: node.data.fees,
                             remark: node.data.remark

+ 60 - 3
web/building_saas/main/js/models/exportStdInterfaceBase.js

@@ -8,7 +8,8 @@
  * @version
  */
 const XML_EXPORT_BASE = (() => {
-
+    // 自检提示的开始记号,区分提示属于哪一部分的类型(eg: 招标、控制价),便于后续做提示的合并去重
+    const HINT_START = '--start--';
     // 属性类型
     const TYPE = {
         DATE: 1,        //日期类型YYYY-MM-DD
@@ -40,7 +41,7 @@ const XML_EXPORT_BASE = (() => {
         coe: 'priceCoe' // 价格指数调整法
     };
     // 加载数据间隔,减少服务器压力
-    const TIMEOUT_TIME = 500;
+    const TIMEOUT_TIME = 200;
     // 导出粒度
     const GRANULARITY = {
         PROJECT: 1,         //导出建设项目
@@ -55,6 +56,7 @@ const XML_EXPORT_BASE = (() => {
     };
     // 配置项
     const CONFIG = Object.freeze({
+        HINT_START,
         TYPE,
         WHITE_SPACE,
         TAX_TYPE,
@@ -164,7 +166,7 @@ const XML_EXPORT_BASE = (() => {
         let dateReg = /([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8])))/;
         for (let data of datas) {
             // 值统一转换成String
-            data.value = !isDef(data.value)
+            data.value = !hasValue(data.value)
                 ? DEFAULT_VALUE[data.type]
                     ? DEFAULT_VALUE[data.type]
                     : ''
@@ -238,6 +240,60 @@ const XML_EXPORT_BASE = (() => {
         }
         return rst;
     }
+    // 提取各导出类型的自检数据
+    function _extractHintParts(failList) {
+        let rst = [],
+            curPart;
+        for (let hint of failList) {
+            if (hint === HINT_START) {
+                curPart = [];
+                rst.push(curPart);
+                continue;
+            }
+            curPart.push(hint);
+        }
+        return rst;
+    }
+    // 自检提示去重
+    function deWeightHints(failList) {
+        let rst = [];
+        let hintParts = _extractHintParts(failList);
+        // 建设项目提示文本
+        let rootHints = [],
+            // 单位工程提示文本映射
+            tenderMap = {},
+            reg = /^<span style="font-weight: bold">单位工程/;
+        for (let hintPart of hintParts) {
+            // 单位工程xxx提示
+            let curTenderHint;
+            // 提取建设项目提示、各自单位工程提示
+            for (let hint of hintPart) {
+                if (reg.test(hint)) {
+                    curTenderHint = hint;
+                    if (!tenderMap[curTenderHint]) {
+                        tenderMap[curTenderHint] = [];
+                    }
+                    continue;
+                }
+                if (curTenderHint) {
+                    tenderMap[curTenderHint].push(hint);
+                } else {
+                    rootHints.push(hint);
+                }
+            }
+        }
+        // 建设项目提示去重,放入结果中
+        rootHints = [...new Set(rootHints)];
+        rst.push(...rootHints);
+        // 单位工程提示放入结果中
+        for (let tenderHint in tenderMap) {
+            rst.push(tenderHint);
+            // 单位工程提示去重
+            let tenderHints = [...new Set(tenderMap[tenderHint])];
+            rst.push(...tenderHints);
+        }
+        return rst;
+    }
     // 等待一段时间
     function setTimeoutSync(handle, time) {
         return new Promise((resolve, reject) => {
@@ -609,6 +665,7 @@ const XML_EXPORT_BASE = (() => {
     }
 
     const UTIL = Object.freeze({
+        deWeightHints,
         isDef,
         hasValue,
         setTimeoutSync,

+ 7 - 3
web/building_saas/main/js/models/importStandardInterface.js

@@ -1021,10 +1021,11 @@ const ImportXML = (() => {
                         ParentID: addtionalTax.ID,
                         NextSiblingID: -1,
                         name: feeBills.name,
+                        rowCode: feeBills.rowCode,
                         feeRate: feeBills.feeRate,
                     };
                     if (importFileKind === FileKind.tender) {
-                        subTaxData.rowCode = feeBills.rowCode;
+                        //subTaxData.rowCode = feeBills.rowCode;
                         subTaxData.fees = feeBills.fees;
                     }
                     if (preSubTax) {
@@ -1062,12 +1063,13 @@ const ImportXML = (() => {
                         isMatched = true;
                         findBills.calcBase = feeBills.calcBase;
                         findBills.feeRate = feeBills.feeRate;
+                        findBills.rowCode = feeBills.rowCode;
                         //后台配置的feeRateID优先级比feeRate高,导入数据有费率值时,需要清空这个配置
                         if (findBills.feeRate && parseFloat(findBills.feeRate) !== 0) {
                             findBills.feeRateID = null;
                         }
                         if (importFileKind === FileKind.tender) {
-                            findBills.rowCode = feeBills.rowCode;
+                            //findBills.rowCode = feeBills.rowCode;
                             findBills.fees = feeBills.fees;
                         }
                         break;
@@ -1079,11 +1081,12 @@ const ImportXML = (() => {
                             ParentID: -1,
                             NextSiblingID: -1,
                             name: feeBills.name,
+                            rowCode: feeBills.rowCode,
                             calcBase: feeBills.calcBase,
                             feeRate: feeBills.feeRate,
                         };
                         if (importFileKind === FileKind.tender) {
-                            dxfyData.rowCode = feeBills.rowCode;
+                            //dxfyData.rowCode = feeBills.rowCode;
                             dxfyData.fees = feeBills.fees;
                         }
                         if (!preDXFY) {
@@ -1119,6 +1122,7 @@ const ImportXML = (() => {
                     matchBills.calcBase = curBills.calcBase;
                     matchBills.feeRate = curBills.feeRate;
                     matchBills.fees = curBills.fees || [];
+                    matchBills.rowCode = curBills.rowCode;
                     if (curBills.flags && curBills.flags.length) {
                         matchBills.flags = curBills.flags;
                     }

+ 4 - 3
web/building_saas/main/js/views/export_view.js

@@ -10,7 +10,8 @@
 //导出接口相关
 const ExportView = (() => {
     let _base = XML_EXPORT_BASE,
-        _cache = _base.CACHE;
+        _cache = _base.CACHE,
+        _util = _base.UTIL;
     // 导出数据缓存
     let _exportCache = [];
     //设置工程编号表格数据设置
@@ -82,7 +83,7 @@ const ExportView = (() => {
                         _exportCache.push(...exportData);
                     }
                 }
-                failList = [...new Set(failList)];
+                failList = _util.deWeightHints(failList);
                 //设置提示弹窗
                 if (failList.length * 20 > 400) {
                     $('#hintBox_caption').addClass('export-check');
@@ -126,7 +127,7 @@ const ExportView = (() => {
                     }
                     pr.end();
                 }
-                failList = [...new Set(failList)];
+                failList = _util.deWeightHints(failList);
                 //错误-设置提示弹窗
                 if (failList.length * 20 > 400) {
                     $('#hintBox_caption').addClass('export-check');

+ 6 - 62
web/building_saas/main/js/views/index_view.js

@@ -259,7 +259,7 @@ let indexObj= {
                     cost:parseFloat(c.attrs[0].value),
                     unitCost:parseFloat(c.attrs[1].value),
                     per:parseFloat(c.attrs[2].value)
-                }
+                };
                 datas.push(tem);
             }
             return datas;
@@ -288,7 +288,8 @@ let indexObj= {
         sheet.setRowCount(quantityDatas.length);
     },
     getQuantityDatas:function (mainQuantities,billsList) {
-        let datas = [];
+        return gljUtil.getQuantityDatas(projectObj.project.property.engineerFeatures,mainQuantities,billsList,fixedFlag,_,scMathUtil,projectObj.project.property.decimal)
+       /* let datas = [];
         let [bills,totalFee] = exportUtil.getIndexBills(billsList);
         let billsGroup = _.groupBy(bills,'quantityIndexType');
         if(!mainQuantities) return datas;
@@ -313,71 +314,14 @@ let indexObj= {
             data.quantity = exportUtil.calUnitWidthCoe(quantity);
         }     
         
-        return datas;
+        return datas;*/
     },
     getEconomicDatas:function (economics,billsList) {
-        let datas = [];
-        let [bills,totalFee] = exportUtil.getIndexBills(billsList);
-        let billsGroup = _.groupBy(bills,'economicType');
-        if(!economics) return datas;
-        for(let e of economics){
-            let tem = {
-                name:e.name,
-                cost:0,
-                unitCost:0,
-                per:0
-            };
-            if(billsGroup[e.name]) setEconomics(billsGroup[e.name],totalFee,tem);
-            datas.push(tem);
-        }
-        function setEconomics(items,engineerCost,data) {
-            let cost = 0;
-            let priceDe = getDecimal("bills.totalPrice");
-            for(let i of items){
-                i.totalFee =  scMathUtil.roundForObj(i.totalFee,priceDe);
-                cost = scMathUtil.roundForObj(cost + i.totalFee,getDecimal("process"));
-            }
-            data.cost = scMathUtil.roundForObj(cost,priceDe);
-            data.unitCost = exportUtil.calUnitWidthCoe(data.cost,true);//noNeedCoe = true 这里不需要乘以系数
-            data.per = engineerCost?scMathUtil.roundForObj(data.cost/engineerCost * 100,2):0;
-        }
-
-        return datas;
+        return gljUtil.getEconomicDatas(projectObj.project.property.engineerFeatures,economics,billsList,fixedFlag,_,scMathUtil);
     },
 
     getMainMaterialDatas:function (materials,projectGLJData,calcOptions,decimalObj,isRadio,_,scMathUtil) {
-        let datas = [];
-        let materialGroup = _.groupBy(projectGLJData.gljList,'materialIndexType');
-        if(!materials) return datas;
-        for(let m of materials){
-            let tem = {
-                name:m.name,
-                unit:m.unit,
-                unitPrice:0,
-                quantity:0,
-                unitIndex:0
-            };
-            if(materialGroup[m.name]) setMainMaterial(materialGroup[m.name],tem);
-            datas.push(tem);
-        }
-
-        function setMainMaterial(gljs,data) {
-            let quantity = 0 ,unitPrice=0;
-            for(let g of gljs){
-                if(!g.quantity || g.quantity=="") continue;
-                let marketPrice = gljUtil.getMarketPrice(g,projectGLJData,calcOptions,decimalObj,false,_,scMathUtil); // gljOprObj.setGLJPrice(tem,g);
-                let materialIndexCoe = g.materialIndexCoe?scMathUtil.roundForObj(g.materialIndexCoe,getDecimal("process")):0;
-                let t_quantity = scMathUtil.roundForObj(g.quantity * materialIndexCoe,getDecimal("process"));
-                quantity = scMathUtil.roundForObj(t_quantity + quantity,getDecimal("process"));
-                let temPrice = scMathUtil.roundForObj(g.quantity * marketPrice,getDecimal("process"));
-                unitPrice = scMathUtil.roundForObj(temPrice + unitPrice,getDecimal("process"));
-            }
-            data.quantity = scMathUtil.roundForObj(quantity,2);
-            if(data.quantity) data.unitPrice = scMathUtil.roundForObj(unitPrice/data.quantity,2);
-            data.unitIndex = exportUtil.calUnitWidthCoe(data.quantity);
-        }
-
-        return datas;
+        return gljUtil.getMainMaterialDatas(projectObj.project.property.engineerFeatures,materials,projectGLJData,calcOptions,decimalObj,isRadio,_,scMathUtil);
     },
     showEcoQuantity:function () {
         let parentMap = {};

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

@@ -1322,7 +1322,7 @@ var projectObj = {
                         return !project.Ration.canAdd(project.mainTree.selected);
                     },
                     callback: function (key, opt) {
-                        project.Ration.addNewRation(null,rationType.ration,projectObj.selectColAndFocus,true);
+                        project.Ration.addNewRation(null,rationType.ration,projectObj.selectColAndFocus,false);
                        // ProjectController.addRation(project, controller, rationType.ration);
                     }/*,
                     visible: function(key, opt){
@@ -1953,7 +1953,7 @@ var projectObj = {
         TREE_SHEET_HELPER.massOperationSheet(sheet, function () {
             for(let node of nodes){
                 if(node && node.serialNo()!= -1){
-                    sheet.getRange(node.serialNo(), -1, 1, -1).backColor(me.getNodeColorStyle(sheet, node,tree).backColor);
+                    sheet.getRange(node.serialNo(), -1, 1, -1).backColor(me.getNodeColorStyle(sheet, node,tree)?me.getNodeColorStyle(sheet, node,tree).backColor:null);
                 }
             }
         });

+ 10 - 0
web/building_saas/main/js/views/tender_price_view.js

@@ -51,6 +51,7 @@ let tender_obj={
         this.tenderTreeSetting.setAutoFitRow = MainTreeCol.getEvent("setAutoFitRow");
         this.tenderController = TREE_SHEET_CONTROLLER.createNew(this.tenderTree, this.tenderSheet, this.tenderTreeSetting);
         this.tenderSheet.bind(GC.Spread.Sheets.Events.ValueChanged, this.onSheetValueChange);
+        this.tenderSheet.bind(GC.Spread.Sheets.Events.EnterCell, this.onEnterCell);
         this.tenderSheet.bind(GC.Spread.Sheets.Events.RangeChanged, this.onTenderRangeChange);
         this.tenderSheet.bind(GC.Spread.Sheets.Events.EditStarting,this.onEditStarting);
         this.tenderController.bind(TREE_SHEET_CONTROLLER.eventName.treeSelectedChanged, this.treeSelectedChanged);
@@ -202,6 +203,15 @@ let tender_obj={
         });
 
     },
+    onEnterCell : function (sender,args) {
+        let me = tender_obj, row = args.row, col = args.col;
+        if ([8, 9].includes(col)){
+            let node = me.tenderTree.items[row];
+            if (node.children && node.children.length > 0) {   // 父结点只读
+                me.tenderSheet.getCell(row, col).locked(true);// = true;
+            }
+        }
+    },
     updateChildrenValue:function (node,dataCode,value,datas,nodes) {
          if(node.children.length > 0){
             for(let c of node.children){

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

@@ -263,7 +263,7 @@ let zmhs_obj = {
         $('#assSpread').is(':visible')&&this.assSpread?this.assSpread.refresh():'';
     },
     showDatas:function () {
-        if($('#itemCharacterText').is(':visible'))MaterialController.showItemCharacterText()
+        if($('#itemCharacterText').is(':visible'))MaterialController.showItemCharacterText();
         if($('#coeSpread').is(':visible')) this.showCoeData();
         if($('#cusSpread').is(':visible')) this.showCusData();
         if($('#assSpread').is(':visible')) this.showAssData();

+ 3 - 3
web/users/js/login.js

@@ -312,18 +312,18 @@ function login(captchaObj) {
                 }
             } else if(response.error === 2) {
                 // $('#phonepass').modal('hide');
-                captchaObj.reset();
+                // captchaObj.reset();
                 $('#check_ssoId').val(response.ssoId);
                 $('#phone').modal('show');
             } else if(response.error === 3) {
-                captchaObj.reset();
+                // captchaObj.reset();
                 $('#phonepass').modal('show');
                 $('#mobileLogin').val(response.data);
             } else {
                 // $('#phonepass').modal('hide');
                 let msg = response.msg !== undefined ? response.msg : '未知错误';
                 showError(msg, $("input"));
-                captchaObj.reset();
+                // captchaObj.reset();
             }
         },
         error: function (result) {