|
|
@@ -36,7 +36,7 @@ if(typeof materialComponent !== 'undefined'){
|
|
|
//可以作为材料工料机组成物的工料机类型:普通材料
|
|
|
materialComponent = [201];
|
|
|
}
|
|
|
-//覆盖前端基价计算
|
|
|
+//覆盖前端定额基价计算
|
|
|
//基价=人工费+材料费+机械费+管理费利润
|
|
|
//管理费利润=Round(人工费*(管理费消耗量+利润消耗量)%,2) 注:书中管理费、利润的单位都是“%”
|
|
|
if (typeof rationGLJOprObj !== 'undefined' && typeof rationGLJOprObj.rationCal !== 'undefined') {
|
|
|
@@ -50,12 +50,14 @@ if (typeof rationGLJOprObj !== 'undefined' && typeof rationGLJOprObj.rationCal !
|
|
|
let cacheArr = me.cache['_GLJ_' + me.currentRationItem.ID];
|
|
|
cacheArr.forEach(function (gljData) {
|
|
|
if(gljData.gljType && gljData.basePrice && gljData.consumeAmt){
|
|
|
- let parent = me.distTypeTree.distTypes[me.distTypeTree.prefix + gljData.gljType].parent;
|
|
|
- if(parent && parent.data.ID <= 3){
|
|
|
- price['gljType' + parent.data.ID].push(scMathUtil.roundTo(gljData.basePrice * gljData.consumeAmt, -3));//取三位
|
|
|
- }
|
|
|
- if(!parent && gljData.gljType <= 3){
|
|
|
- price['gljType' + gljData.gljType].push(scMathUtil.roundTo(gljData.basePrice * gljData.consumeAmt, -3));//取三位
|
|
|
+ let parentGLJType = parseInt(String(gljData.gljType)[0]);
|
|
|
+ if (parentGLJType <= 3) { // 人工、材料、机械
|
|
|
+ // 单位为%,单条基价计算为定额价*消耗量*0.01
|
|
|
+ if (gljData.unit === '%') {
|
|
|
+ price['gljType' + parentGLJType].push(scMathUtil.roundTo(gljData.basePrice * gljData.consumeAmt * 0.01, -3));//取三位
|
|
|
+ } else {
|
|
|
+ price['gljType' + parentGLJType].push(scMathUtil.roundTo(gljData.basePrice * gljData.consumeAmt, -3));//取三位
|
|
|
+ }
|
|
|
}
|
|
|
if([6, 7].includes(gljData.gljType)){
|
|
|
manageProfitConsume = scMathUtil.roundTo(manageProfitConsume + gljData.consumeAmt, -6);
|
|
|
@@ -100,6 +102,7 @@ if (typeof rationGLJOprObj !== 'undefined' && typeof rationGLJOprObj.rationCal !
|
|
|
|
|
|
if (typeof module !== 'undefined') {
|
|
|
module.exports = {
|
|
|
+ // 计算定额基价
|
|
|
calcRation: function (gljArr, scMathUtil) {
|
|
|
let labourPrc = [],
|
|
|
materialPrc = [],
|
|
|
@@ -109,7 +112,11 @@ if (typeof module !== 'undefined') {
|
|
|
updatePrc = {labourPrice: 0, materialPrice: 0, machinePrice: 0, manageProfitPrice: 0, basePrice: 0};
|
|
|
gljArr.forEach(function (gljItem) {
|
|
|
if(gljItem.gljParentType !== -1){
|
|
|
- singlePrc = scMathUtil.roundTo(gljItem.basePrice * gljItem.consumeAmt, -3);
|
|
|
+ if (gljItem.gljParentType <= 3 && gljItem.unit === '%') {
|
|
|
+ singlePrc = scMathUtil.roundTo(gljItem.basePrice * gljItem.consumeAmt * 0.01, -3);
|
|
|
+ } else {
|
|
|
+ singlePrc = scMathUtil.roundTo(gljItem.basePrice * gljItem.consumeAmt, -3);
|
|
|
+ }
|
|
|
if(gljItem.gljParentType === 1){
|
|
|
labourPrc.push(singlePrc);
|
|
|
} else if(gljItem.gljParentType ===2){
|