|
|
@@ -336,6 +336,7 @@ const ImportXML = (() => {
|
|
|
differentiaSummary: loadDifferentiaSummary(src) ,//承包人材料差额法表
|
|
|
exponentialSummary: loadExponentialSummary(src) ,//承包人材料指数法表
|
|
|
evalBidSummary: loadEvalBidSummary(src), //评标材料表
|
|
|
+ evalSummary: loadEvalSummary(src) // 暂估价材料表
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
@@ -949,8 +950,13 @@ const ImportXML = (() => {
|
|
|
return gljsSrc.map(gljSrc => {
|
|
|
return {
|
|
|
code: getValue(gljSrc, ['_关联材料号']),
|
|
|
+ name: getValue(gljSrc, ['_名称']),
|
|
|
+ specs: getValue(gljSrc, ['_规格']),
|
|
|
+ unit: getValue(gljSrc, ['_单位']),
|
|
|
+ quantity: getValue(gljSrc, ['_数量']),
|
|
|
riskCoe: getValue(gljSrc, ['_风险系数']),
|
|
|
standardPrice: getValue(gljSrc, ['_基准单价']),
|
|
|
+ market_price: getValue(gljSrc, ['_投标单价']),
|
|
|
remark: getValue(gljSrc, ['_备注']),
|
|
|
};
|
|
|
});
|
|
|
@@ -961,6 +967,8 @@ const ImportXML = (() => {
|
|
|
return gljsSrc.map(gljSrc => {
|
|
|
return {
|
|
|
code: getValue(gljSrc, ['_关联材料号']),
|
|
|
+ name: getValue(gljSrc, ['_名称']),
|
|
|
+ specs: getValue(gljSrc, ['_规格']),
|
|
|
varWeight: getValue(gljSrc, ['_变值权重B']),
|
|
|
FO: getValue(gljSrc, ['_基本价格指数']),
|
|
|
FI: getValue(gljSrc, ['_现行价格指数']),
|
|
|
@@ -972,7 +980,38 @@ const ImportXML = (() => {
|
|
|
function loadEvalBidSummary(tenderSrc) {
|
|
|
let gljsSrc = arrayValue(tenderSrc, ['评标材料表', '材料明细']);
|
|
|
return gljsSrc.map(gljSrc => {
|
|
|
- return {code: getValue(gljSrc, ['_关联材料号'])};
|
|
|
+ return {
|
|
|
+ seq: getValue(gljSrc, ['_序号']),
|
|
|
+ code: getValue(gljSrc, ['_关联材料号']),
|
|
|
+ name: getValue(gljSrc, ['_材料名称']),
|
|
|
+ specs: getValue(gljSrc, ['_规格型号']),
|
|
|
+ unit: getValue(gljSrc, ['_计量单位']),
|
|
|
+ quantity: getValue(gljSrc, ['_数量']),
|
|
|
+ market_price: getValue(gljSrc, ['_单价']),
|
|
|
+ // 由于数据库有这两个字段,暂时也导入(前端隐藏了,目前实际上应该是没用的,以防万一)
|
|
|
+ originPlace: getValue(gljSrc, ['_产地']),
|
|
|
+ vender: getValue(gljSrc, ['_厂家']),
|
|
|
+ remark: getValue(gljSrc, ['_备注'])
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 暂估价材料
|
|
|
+ function loadEvalSummary(tenderSrc) {
|
|
|
+ const gljsSrc = arrayValue(tenderSrc, ['暂估价材料表', '材料明细']);
|
|
|
+ return gljsSrc.map(gljSrc => {
|
|
|
+ return {
|
|
|
+ seq: getValue(gljSrc, ['_序号']),
|
|
|
+ code: getValue(gljSrc, ['_关联材料号']),
|
|
|
+ name: getValue(gljSrc, ['_材料名称']),
|
|
|
+ specs: getValue(gljSrc, ['_规格型号']),
|
|
|
+ unit: getValue(gljSrc, ['_计量单位']),
|
|
|
+ quantity: getValue(gljSrc, ['_数量']),
|
|
|
+ market_price: getValue(gljSrc, ['_单价']),
|
|
|
+ // 由于数据库有这两个字段,暂时也导入(前端隐藏了,目前实际上应该是没用的,以防万一)
|
|
|
+ originPlace: getValue(gljSrc, ['_产地']),
|
|
|
+ vender: getValue(gljSrc, ['_厂家']),
|
|
|
+ remark: getValue(gljSrc, ['_备注'])
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -1540,6 +1579,9 @@ const ImportXML = (() => {
|
|
|
rationGLJ: [], //定额人材机
|
|
|
rationCoe: [], //定额系数,全为默认
|
|
|
projectGLJ: [], //项目人材机
|
|
|
+ contractorList: [], //承包人材料
|
|
|
+ bidEvaluationList: [], //评标材料
|
|
|
+ evaluationList: [], //暂估材料
|
|
|
unitPrice: [], //单价文件
|
|
|
mixRatio: [] //组成物
|
|
|
};
|
|
|
@@ -1581,38 +1623,52 @@ const ImportXML = (() => {
|
|
|
rst.unitPrice.push(getUnitPrice(pGLJ));
|
|
|
|
|
|
});
|
|
|
- //处理评标材料
|
|
|
- tenderData.evalBidSummary.forEach(glj => {
|
|
|
- let pGLJ = projectGLJMap[glj.code];
|
|
|
- if (pGLJ) {
|
|
|
- pGLJ.is_eval_material = true;
|
|
|
- }
|
|
|
- });
|
|
|
- //处理承包人材料差额法表
|
|
|
- tenderData.differentiaSummary.forEach(glj => {
|
|
|
- let pGLJ = projectGLJMap[glj.code];
|
|
|
- if (pGLJ) {
|
|
|
- pGLJ.is_info_adjust = 1;
|
|
|
- pGLJ.riskCoe = glj.riskCoe;
|
|
|
- pGLJ.standardPrice = glj.standardPrice;
|
|
|
- pGLJ.remark = glj.remark;
|
|
|
- }
|
|
|
- });
|
|
|
- //处理承包人材料指数法表
|
|
|
- tenderData.exponentialSummary.forEach(glj => {
|
|
|
- let pGLJ = projectGLJMap[glj.code];
|
|
|
- if (pGLJ) {
|
|
|
- pGLJ.is_coe_adjust = 1;
|
|
|
- pGLJ.varWeight = glj.varWeight;
|
|
|
- pGLJ.FO = glj.FO;
|
|
|
- pGLJ.FI = glj.FI;
|
|
|
- pGLJ.remark = glj.remark;
|
|
|
- }
|
|
|
- });
|
|
|
+ // 处理承包人材料(差额/指数)法表
|
|
|
+ handleContractorList();
|
|
|
+ // 处理评标材料
|
|
|
+ handleGLJRelatedList(tenderData.evalBidSummary, rst.bidEvaluationList, 'is_eval_material');
|
|
|
+ // 处理暂估价材料
|
|
|
+ handleGLJRelatedList(tenderData.evalSummary, rst.evaluationList, 'is_evaluate');
|
|
|
//处理定额数据
|
|
|
//获取含有定额数据的清单
|
|
|
handleRation(billsData);
|
|
|
}
|
|
|
+ // 处理与项目人材机关联的承包人材料
|
|
|
+ function handleContractorList() {
|
|
|
+ const contractorType = getAdjustType(tenderData);
|
|
|
+ const contractorData = contractorType === AdjustType.info ? tenderData.differentiaSummary : tenderData.exponentialSummary;
|
|
|
+ // 指数材料的单位和数量需要在差额里取,xml中指数表没有这两个字段(差额法表有且相同),入库却需要
|
|
|
+ /*if (contractorType === AdjustType.coe) {
|
|
|
+ const infoMap = {};
|
|
|
+ tenderData.differentiaSummary.forEach(data => infoMap[data.code] = data);
|
|
|
+ tenderData.exponentialSummary.forEach(data => {
|
|
|
+ const infoData = infoMap[data.code];
|
|
|
+ if (infoData) {
|
|
|
+ data.unit = infoData.unit;
|
|
|
+ data.quantity = infoData.quantity;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }*/
|
|
|
+ handleGLJRelatedList(contractorData, rst.contractorList, 'is_contractor_material');
|
|
|
+ }
|
|
|
+ // 处理与项目人材机关联的承包人材料、评标材料、暂估材料
|
|
|
+ function handleGLJRelatedList(list, container, relatedType) {
|
|
|
+ list.forEach(data => {
|
|
|
+ data.ID = uuid.v1();
|
|
|
+ data.projectID = tenderData.ID;
|
|
|
+ data.projectGLJID = -1;
|
|
|
+ if (typeof data.seq === 'undefined') {
|
|
|
+ data.seq = data.code;
|
|
|
+ }
|
|
|
+ const projectGLJ = projectGLJMap[data.code];
|
|
|
+ if (projectGLJ) {
|
|
|
+ projectGLJ[relatedType] = 1;
|
|
|
+ data.is_related = 1;
|
|
|
+ data.projectGLJID = projectGLJ.id;
|
|
|
+ }
|
|
|
+ container.push(data);
|
|
|
+ });
|
|
|
+ }
|
|
|
//处理清单 设置必要数据 删除无用属性
|
|
|
billsData.forEach(bills => {
|
|
|
//处理综合单价
|