|
|
@@ -224,6 +224,7 @@ async function exportSEI(projectID) {
|
|
|
async function setTenderData(tender,project) {
|
|
|
let projectData = await ajaxPost("/project/loadSEIProjectData",{projectID:tender.ID});
|
|
|
tender.children.push(setEngineerInfo(tender));//设置工程信息
|
|
|
+ tender.children.push(setEngineerFeature(tender));//设置工程特征
|
|
|
tender.children.push(setEngineerIndex(tender,projectData));
|
|
|
tender.children.push(await setGLJSummy(tender,projectData));
|
|
|
//
|
|
|
@@ -236,10 +237,106 @@ async function exportSEI(projectID) {
|
|
|
attrs:[],
|
|
|
children:[],
|
|
|
};
|
|
|
-
|
|
|
+ let indexName = tender.property.indexName?tender.property.indexName:"建筑工程";
|
|
|
index.children.push(exportUtil.setEngineerPriceIndex(tender,projectData));
|
|
|
+ index.children.push(setEngineerEcoIndex(tender,projectData,indexName));
|
|
|
+ index.children.push(setMainMaterialIndex(tender,projectData,indexName));
|
|
|
+ index.children.push(setQuantityIndex(tender,projectData,indexName));
|
|
|
|
|
|
return index;
|
|
|
+
|
|
|
+ function setMainMaterialIndex(tender,projectData,indexName){
|
|
|
+ let mainIndex = {
|
|
|
+ name:`${indexName}工料指标`,
|
|
|
+ attrs:[],
|
|
|
+ children:[]
|
|
|
+ };
|
|
|
+ if(projectData) gljUtil.calcProjectGLJQuantity(projectData.projectGLJs,projectData.ration_gljs,projectData.rations,projectData.bills,getDecimal("glj.quantity"),_,scMathUtil);
|
|
|
+ let materials = indexObj.getMainMaterialDatas(tender.property.materials,projectData.projectGLJs,tender.property.calcOptions,tender.property.decimal,false,_,scMathUtil);
|
|
|
+ for(let m of materials){
|
|
|
+ mainIndex.children.push(getMaterial(m))
|
|
|
+ }
|
|
|
+ let index = {
|
|
|
+ name:"主要工料价格及消耗量指标",
|
|
|
+ attrs:[],
|
|
|
+ children:[mainIndex]
|
|
|
+ };
|
|
|
+ return index;
|
|
|
+
|
|
|
+ function getMaterial(m) {
|
|
|
+ let material = {
|
|
|
+ name:m.name,
|
|
|
+ attrs:[
|
|
|
+ {name:"综合单价",value:scMathUtil.roundToString(m.unitPrice,2)},
|
|
|
+ {name:"数量",value:scMathUtil.roundToString(m.quantity,2)},
|
|
|
+ {name:"单方指标",value:scMathUtil.roundToString(m.unitIndex,3)},
|
|
|
+ {name:"单位",value:m.unit}
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ return material;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function setQuantityIndex(tender,projectData,indexName) {
|
|
|
+ let quantityIndex = {
|
|
|
+ name:`${indexName}量指标`,
|
|
|
+ attrs:[],
|
|
|
+ children:[]
|
|
|
+ };
|
|
|
+ let quantities = indexObj.getQuantityDatas(tender.property.mainQuantities,projectData.bills);
|
|
|
+ for(let q of quantities){
|
|
|
+ quantityIndex.children.push(getQuantity(q));
|
|
|
+ }
|
|
|
+
|
|
|
+ let index = {
|
|
|
+ name:`主要工程量指标`,
|
|
|
+ attrs:[],
|
|
|
+ children:[quantityIndex]
|
|
|
+ };
|
|
|
+ return index;
|
|
|
+
|
|
|
+ function getQuantity(q) {
|
|
|
+ let quantity = {
|
|
|
+ name:q.name,
|
|
|
+ attrs:[
|
|
|
+ {name:"工程量指标",value:scMathUtil.roundToString(q.quantity,3)},
|
|
|
+ {name:"单位",value:q.unit}
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ return quantity;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function setEngineerEcoIndex(tender,projectData,indexName) {
|
|
|
+ let ecoIndex = {
|
|
|
+ name:`${indexName}经济指标`,
|
|
|
+ attrs:[],
|
|
|
+ children:[]
|
|
|
+ };
|
|
|
+ let economicDatas = indexObj.getEconomicDatas(tender.property.economics,projectData.bills);
|
|
|
+ for(let e of economicDatas){
|
|
|
+ ecoIndex.children.push(getEco(e))
|
|
|
+ }
|
|
|
+ let index = {
|
|
|
+ name:`工程经济指标`,
|
|
|
+ attrs:[],
|
|
|
+ children:[ecoIndex]
|
|
|
+ };
|
|
|
+ return index;
|
|
|
+
|
|
|
+ function getEco(e) {
|
|
|
+ let eco = {
|
|
|
+ name:e.name,
|
|
|
+ attrs:[
|
|
|
+ {name:"综合合价",value:scMathUtil.roundToString(e.cost,2)},
|
|
|
+ {name:"单方指标",value:scMathUtil.roundToString(e.unitCost,2)},
|
|
|
+ {name:"占造价比例",value:scMathUtil.roundToString(e.per,2)}
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ return eco;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
async function setGLJSummy(tender,projectData) {
|
|
|
@@ -313,6 +410,52 @@ async function exportSEI(projectID) {
|
|
|
return info;
|
|
|
}
|
|
|
|
|
|
+ function setEngineerFeature(tender) {
|
|
|
+ let fea = {
|
|
|
+ name:"工程特征",
|
|
|
+ attrs:[],
|
|
|
+ children:[]
|
|
|
+ };
|
|
|
+ fea.children.push(setIndexName(tender));
|
|
|
+ return fea;
|
|
|
+
|
|
|
+ function setIndexName(tender) {
|
|
|
+ let indexName = {
|
|
|
+ name:tender.property.indexName?tender.property.indexName:"建筑工程",
|
|
|
+ attrs:[],
|
|
|
+ children:[]
|
|
|
+ };
|
|
|
+ setFeatures(tender,indexName.children);
|
|
|
+ return indexName
|
|
|
+ }
|
|
|
+ function setFeatures(tender,arr) {
|
|
|
+ let features = tender.property.engineerFeatures?tender.property.engineerFeatures:[];
|
|
|
+ let parentMap = _.groupBy(features,"ParentID");
|
|
|
+ let rootNodes = parentMap["-1"]?parentMap["-1"]:parentMap[null];
|
|
|
+ for(let r of rootNodes){
|
|
|
+ arr.push(getFeatrue(r,parentMap))
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function getFeatrue(node,parentMap){
|
|
|
+ if(parentMap[node.ID]){//如果有子节点,那么它就是一个节点
|
|
|
+ let tem = {
|
|
|
+ name:node.name.replace("*",""),
|
|
|
+ attrs:[],
|
|
|
+ children:[]
|
|
|
+ };
|
|
|
+ for(let s of parentMap[node.ID]){
|
|
|
+ let f = getFeatrue(s,parentMap);
|
|
|
+ f.children?tem.children.push(f):tem.attrs.push(f);//如果有children这个属性,则返回的是一个节点,如果没有,则返回的是一个属性
|
|
|
+ }
|
|
|
+ return tem;
|
|
|
+ }else {//如果没有子节点,那么它就是父节点的一个属性
|
|
|
+ return {name:node.name.replace("*",""),value:node.value};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
function getBaseInfo(project){
|
|
|
let basicInformation = {items:[]};
|
|
|
let tem = null;
|
|
|
@@ -421,9 +564,7 @@ async function exportSEI(projectID) {
|
|
|
|
|
|
$(function () {
|
|
|
$("#SEIMenu").click(async function () {
|
|
|
-
|
|
|
-
|
|
|
- await exportSEI(projectObj.project.property.rootProjectID)
|
|
|
+ await exportSEI(projectObj.project.property.rootProjectID);
|
|
|
$("#exportMenu").removeClass("show");
|
|
|
})
|
|
|
|