|
@@ -747,6 +747,7 @@ async function getGLJSummayDatas(projectIDs) {
|
|
|
function getSummaryGLJDatas(gljList, decimal, nameList, prjTypeNames, compilationScopes) {
|
|
function getSummaryGLJDatas(gljList, decimal, nameList, prjTypeNames, compilationScopes) {
|
|
|
let datas = [],
|
|
let datas = [],
|
|
|
qdecimal = decimal.glj.quantity,
|
|
qdecimal = decimal.glj.quantity,
|
|
|
|
|
+ upDecimal = decimal.glj.unitPrice,
|
|
|
process = decimal.process;
|
|
process = decimal.process;
|
|
|
for (let tem of gljList) {
|
|
for (let tem of gljList) {
|
|
|
let d = {
|
|
let d = {
|
|
@@ -756,18 +757,24 @@ function getSummaryGLJDatas(gljList, decimal, nameList, prjTypeNames, compilatio
|
|
|
unit: tem.unit,
|
|
unit: tem.unit,
|
|
|
specs: tem.specs,
|
|
specs: tem.specs,
|
|
|
marketPrice: tem.marketPrice,
|
|
marketPrice: tem.marketPrice,
|
|
|
|
|
+ marketPriceList: [],
|
|
|
prjNames: nameList,
|
|
prjNames: nameList,
|
|
|
prjTypeNames: prjTypeNames,
|
|
prjTypeNames: prjTypeNames,
|
|
|
quantityList: [],
|
|
quantityList: [],
|
|
|
'编制范围明细': compilationScopes
|
|
'编制范围明细': compilationScopes
|
|
|
};
|
|
};
|
|
|
let totalQuantity = 0;
|
|
let totalQuantity = 0;
|
|
|
|
|
+ let totalPrice = 0;
|
|
|
for (let n of nameList) {
|
|
for (let n of nameList) {
|
|
|
let q = tem.quantityMap[n] ? scMathUtil.roundForObj(tem.quantityMap[n], qdecimal) : 0;
|
|
let q = tem.quantityMap[n] ? scMathUtil.roundForObj(tem.quantityMap[n], qdecimal) : 0;
|
|
|
totalQuantity = scMathUtil.roundForObj(q + totalQuantity, process);
|
|
totalQuantity = scMathUtil.roundForObj(q + totalQuantity, process);
|
|
|
d.quantityList.push(q);
|
|
d.quantityList.push(q);
|
|
|
|
|
+ let up = tem.unitPriceMap[n] ? scMathUtil.roundForObj(tem.unitPriceMap[n], upDecimal) : 0;
|
|
|
|
|
+ d.marketPriceList.push(up);
|
|
|
|
|
+ totalPrice = scMathUtil.roundForObj(q * up + totalPrice, process);
|
|
|
}
|
|
}
|
|
|
d.totalQuantity = scMathUtil.roundForObj(totalQuantity, qdecimal);
|
|
d.totalQuantity = scMathUtil.roundForObj(totalQuantity, qdecimal);
|
|
|
|
|
+ d.totalPrice = scMathUtil.roundForObj(totalPrice, upDecimal);
|
|
|
datas.push(d);
|
|
datas.push(d);
|
|
|
}
|
|
}
|
|
|
return datas;
|
|
return datas;
|
|
@@ -781,6 +788,8 @@ function mergeGLJ(mp, projects) {
|
|
|
for (let g of mp.gljList) {
|
|
for (let g of mp.gljList) {
|
|
|
g.quantityMap = {};
|
|
g.quantityMap = {};
|
|
|
g.quantityMap[mp.name] = g.tenderQuantity;
|
|
g.quantityMap[mp.name] = g.tenderQuantity;
|
|
|
|
|
+ g.unitPriceMap = {};
|
|
|
|
|
+ g.unitPriceMap[mp.name] = g.marketPrice;
|
|
|
gljMap[gljUtil.getIndex(g)] = g;
|
|
gljMap[gljUtil.getIndex(g)] = g;
|
|
|
gljList.push(g);
|
|
gljList.push(g);
|
|
|
|
|
|
|
@@ -790,11 +799,14 @@ function mergeGLJ(mp, projects) {
|
|
|
for (let t of temList) {
|
|
for (let t of temList) {
|
|
|
t.quantityMap = {};
|
|
t.quantityMap = {};
|
|
|
t.quantityMap[projects[i].name] = t.tenderQuantity;
|
|
t.quantityMap[projects[i].name] = t.tenderQuantity;
|
|
|
|
|
+ t.unitPriceMap = {};
|
|
|
|
|
+ t.unitPriceMap[projects[i].name] = t.marketPrice;
|
|
|
//这里除了5个属性相同判断为同一个之外,还要判断市场价相同,才认为是同一个工料机
|
|
//这里除了5个属性相同判断为同一个之外,还要判断市场价相同,才认为是同一个工料机
|
|
|
let connect_key = gljUtil.getIndex(t);
|
|
let connect_key = gljUtil.getIndex(t);
|
|
|
let g = gljMap[connect_key];
|
|
let g = gljMap[connect_key];
|
|
|
if (g && g.marketPrice == t.marketPrice) {
|
|
if (g && g.marketPrice == t.marketPrice) {
|
|
|
g.quantityMap[projects[i].name] = t.tenderQuantity;
|
|
g.quantityMap[projects[i].name] = t.tenderQuantity;
|
|
|
|
|
+ g.unitPriceMap[projects[i].name] = t.marketPrice;
|
|
|
} else {
|
|
} else {
|
|
|
gljMap[connect_key] = t;
|
|
gljMap[connect_key] = t;
|
|
|
gljList.push(t);
|
|
gljList.push(t);
|