|
|
@@ -892,14 +892,19 @@ const ImportXML = (() => {
|
|
|
return gljsSrc.map(gljSrc => {
|
|
|
countData.projectGLJCount++;
|
|
|
//编码都取原始编码,如果原始编码为空,都取编码
|
|
|
- let orgCode = getValue(gljSrc, ['_原始代码']),
|
|
|
+ let sourceCode = getValue(gljSrc, ['_原始代码']),
|
|
|
code = getValue(gljSrc, ['_代码']);
|
|
|
- if (!orgCode) {
|
|
|
- orgCode = code;
|
|
|
+ if (!sourceCode) {
|
|
|
+ sourceCode = code;
|
|
|
}
|
|
|
+ // 人材机的真正原始编号应按规矩处理,不能直接读取编码。
|
|
|
+ // 应取sourceCode,qtf文件中原始代码的最后一个“-”前面的文本;如果没有“-”则直接取原始代码
|
|
|
+ const orgCodeReg = /.*(?=-\d+$)/;
|
|
|
+ const match = sourceCode.match(orgCodeReg);
|
|
|
+ const orgCode = match ? match[0] : sourceCode;
|
|
|
let gljData = {
|
|
|
customCode: code, //处理自定义的代码 (有的公司定额人材机代码、人材机代码是用自动生成的代码)
|
|
|
- code: orgCode,
|
|
|
+ code: sourceCode,
|
|
|
original_code: orgCode,
|
|
|
name: getValue(gljSrc, ['_名称']),
|
|
|
specs: getValue(gljSrc, ['_规格']),
|
|
|
@@ -1208,6 +1213,11 @@ const ImportXML = (() => {
|
|
|
addFixedBlock(fixedFlag.PROVISIONAL, tenderData.other.provisional.items, tenderData.other.provisional.fees);
|
|
|
//专业工程暂估价
|
|
|
addFixedBlock(fixedFlag.ENGINEERING_ESITIMATE, tenderData.other.engineeringPro.items, tenderData.other.engineeringPro.fees);
|
|
|
+ // 专业工程暂估价汇总金额设置为暂估价清单金额
|
|
|
+ let estimateFixedBills = billsTarget.find(d => getFlag(d) === fixedFlag.ESTIMATE);
|
|
|
+ if (estimateFixedBills) {
|
|
|
+ estimateFixedBills.fees = tenderData.other.engineeringPro.fees;
|
|
|
+ }
|
|
|
//计日工
|
|
|
addFixedBlock(fixedFlag.DAYWORK, null, tenderData.other.dayWork.fees);
|
|
|
//人工
|
|
|
@@ -1321,6 +1331,7 @@ const ImportXML = (() => {
|
|
|
GF: '{规费}',
|
|
|
SJ: '{税金}',
|
|
|
SJHJ: '{税金}',
|
|
|
+ SQGCZJ: '{税前工程造价}'
|
|
|
};
|
|
|
//转换计算基数
|
|
|
//1.有子项数据,则清空基数
|
|
|
@@ -1531,8 +1542,8 @@ const ImportXML = (() => {
|
|
|
mixRatio: [] //组成物
|
|
|
};
|
|
|
//工料机汇总code-数据映射
|
|
|
- // 项目人材机customCode、original_code-原始数据映射,有的导入数据中,有一部分关联自生成材料号CX,有的关联原始代码...
|
|
|
- // 因此customCode、original_code都需要跟原始数据映射,通过customCode取不到数据的时候,通过orgCode获取
|
|
|
+ // 项目人材机customCode、code-原始数据映射,有的导入数据中,有一部分关联自生成材料号CX,有的关联代码...
|
|
|
+ // 因此customCode、code都需要跟原始数据映射,通过customCode取不到数据的时候,通过orgCode获取
|
|
|
let projectGLJMap = {};
|
|
|
//投标文件才需要导入定额等数据
|
|
|
if (importFileKind === FileKind.tender) {
|
|
|
@@ -1544,14 +1555,14 @@ const ImportXML = (() => {
|
|
|
pGLJ.shortName = pGLJ.shortName || '材';
|
|
|
//gljCodeMap[pGLJ.code] = pGLJ;
|
|
|
projectGLJMap[pGLJ.customCode] = pGLJ;
|
|
|
- projectGLJMap[pGLJ.original_code] = pGLJ;
|
|
|
+ projectGLJMap[pGLJ.code] = pGLJ;
|
|
|
});
|
|
|
//处理项目人材机数据
|
|
|
tenderData.gljSummary.forEach(pGLJ => {
|
|
|
//组成物数据
|
|
|
pGLJ.ratios.forEach(ratio => {
|
|
|
let matchData = projectGLJMap[ratio.code];
|
|
|
- ratio.code = matchData.original_code;
|
|
|
+ ratio.code = matchData.code;
|
|
|
ratio.projectGLJID = pGLJ.id; //后端查找标准数据后,方便更新组成物数据
|
|
|
ratio.id = IDPlaceholder.ratio++;
|
|
|
ratio.unit_price_file_id = tenderData.property.unitPriceFile.id;
|
|
|
@@ -1559,7 +1570,7 @@ const ImportXML = (() => {
|
|
|
ratio.name = matchData ? matchData.name : '';
|
|
|
ratio.specs = matchData ? matchData.specs : '';
|
|
|
ratio.type = matchData ? matchData.type : 1;
|
|
|
- ratio.connect_key = [pGLJ.original_code || 'null', pGLJ.name || 'null', pGLJ.specs || 'null', pGLJ.unit || 'null', pGLJ.type].join('|-|');
|
|
|
+ ratio.connect_key = [pGLJ.code || 'null', pGLJ.name || 'null', pGLJ.specs || 'null', pGLJ.unit || 'null', pGLJ.type].join('|-|');
|
|
|
rst.mixRatio.push(ratio);
|
|
|
});
|
|
|
delete pGLJ.ratios;
|
|
|
@@ -1650,7 +1661,8 @@ const ImportXML = (() => {
|
|
|
if (!bills.quantity || !ration.quantity){
|
|
|
ration.contain = '0';
|
|
|
} else {
|
|
|
- ration.contain = scMathUtil.roundForObj(ration.quantity / bills.quantity, 6);
|
|
|
+ let tempV = ration.quantity / bills.quantity;
|
|
|
+ ration.contain = isFinite(tempV) ? scMathUtil.roundForObj(tempV, 6) : '0';
|
|
|
}
|
|
|
//工程量表达式:工程量 * 单位前的量
|
|
|
/*if (!ration.unit) {
|
|
|
@@ -1663,12 +1675,13 @@ const ImportXML = (() => {
|
|
|
? scMathUtil.roundForObj(ration.quantity * unitNum[0], qDecimal ? qDecimal[0] - 1 : 0)
|
|
|
: ration.quantity;
|
|
|
}*/
|
|
|
+ // 问题
|
|
|
//处理定额人材机,添加需要的数据
|
|
|
ration.rationGljs.forEach(rGLJ => {
|
|
|
let matchGLJ = projectGLJMap[rGLJ.code];
|
|
|
if (matchGLJ) {
|
|
|
rGLJ.projectGLJID = matchGLJ.id;
|
|
|
- rGLJ.code = matchGLJ.original_code;
|
|
|
+ rGLJ.code = matchGLJ.code;
|
|
|
rGLJ.type = matchGLJ.type;
|
|
|
rGLJ.shortName = matchGLJ.shortName;
|
|
|
rGLJ.name = matchGLJ.name;
|