|
@@ -81,7 +81,7 @@ let cbTools = {
|
|
|
for(let i = 0, len = figureF.length; i < len; i++){
|
|
|
let figure = figureF[i];
|
|
|
if(figure.type === 'base' && cbTools.isDef(calcBase.baseFigures[figure.value])){
|
|
|
- let bill = calcBase.baseFigures[figure.value]['fixedBill']['bill'];
|
|
|
+ let bill = this.isDef(calcBase.baseFigures[figure.value]['fixedBill']) ? calcBase.baseFigures[figure.value]['fixedBill']['bill'] : null;
|
|
|
if(this.isDef(bill) && ids.indexOf(bill.ID) === -1){
|
|
|
let node = this.getNodeByID(bill.ID);
|
|
|
if(this.isDef(node)){
|
|
@@ -120,7 +120,7 @@ let cbTools = {
|
|
|
for(let i in baseFigure){
|
|
|
let calcBase = baseFigure[i];
|
|
|
calcBase.fixedBill = null;
|
|
|
- if(cbTools.isDef(fixedBills[calcBase.fixedFlag])){
|
|
|
+ if(cbTools.isDef(calcBase.fixedFlag) && cbTools.isDef(fixedBills[calcBase.fixedFlag])){
|
|
|
fixedBills[calcBase.fixedFlag]['base'][i] = calcBase;
|
|
|
calcBase.fixedBill = fixedBills[calcBase.fixedFlag];
|
|
|
}
|
|
@@ -129,26 +129,34 @@ let cbTools = {
|
|
|
//生成清单基数计算分类模板
|
|
|
setBaseFigureClass: function (baseFigures, mapObj) {
|
|
|
mapObj['CONSTRUCTION_ORGANIZATION'] = Object.create(null);
|
|
|
+ mapObj['SAFETY_CONSTRUCTION'] = Object.create(null);
|
|
|
mapObj['OTHER'] = Object.create(null);
|
|
|
mapObj['CHARGE'] = Object.create(null);
|
|
|
mapObj['TAX'] = Object.create(null);
|
|
|
mapObj['OTHERS'] = Object.create(null);
|
|
|
- let filter = ['CSXMF', 'ZZCSXMF', 'ZZCSXMDEJJZJGCF', 'ZZCSXMDEJJRGF', 'ZZCSXMDEJJCLF', 'ZZCSXMDEJJJXF', 'QTXMF', 'GF', 'SJ'];
|
|
|
+ let filter = ['CSXMF', 'ZZCSXMF', 'ZZCSXMDEJJZJGCF', 'ZZCSXMDEJJRGF', 'ZZCSXMDEJJCLF', 'ZZCSXMDEJJJXF', 'QTXMF', 'GF', 'SJ', 'SQGCZJ'];
|
|
|
for(let figure in baseFigures){
|
|
|
if(filter.indexOf(baseFigures[figure]['base']) === -1){
|
|
|
mapObj['CONSTRUCTION_ORGANIZATION'][figure] = baseFigures[figure];
|
|
|
}
|
|
|
- if(baseFigures[figure]['base'] !== 'QTXMF'){
|
|
|
+ if(baseFigures[figure]['base'] !== 'QTXMF' && baseFigures[figure]['base'] !== 'SQGCZJ'){
|
|
|
mapObj['OTHER'][figure] = baseFigures[figure];
|
|
|
}
|
|
|
- if(baseFigures[figure]['base'] !== 'GF'){
|
|
|
+ if(baseFigures[figure]['base'] !== 'GF' && baseFigures[figure]['base'] !== 'SQGCZJ'){
|
|
|
mapObj['CHARGE'][figure] = baseFigures[figure];
|
|
|
}
|
|
|
- if(baseFigures[figure]['base'] !== 'SJ'){
|
|
|
+ if(baseFigures[figure]['base'] !== 'SJ' && baseFigures[figure]['base'] !== 'SQGCZJ'){
|
|
|
mapObj['TAX'][figure] = baseFigures[figure];
|
|
|
}
|
|
|
- mapObj['OTHERS'][figure] = baseFigures[figure];
|
|
|
+ if(baseFigures[figure]['base'] !== 'SQGCZJ'){
|
|
|
+ mapObj['OTHERS'][figure] = baseFigures[figure];
|
|
|
+ }
|
|
|
+ if(baseFigures[figure]['base'] === 'SQGCZJ'){
|
|
|
+ mapObj['SAFETY_CONSTRUCTION'][figure] = baseFigures[figure];
|
|
|
+ }
|
|
|
}
|
|
|
+ mapObj['SAFETY_CONSTRUCTION'] = Object.assign(mapObj['SAFETY_CONSTRUCTION'], mapObj['CONSTRUCTION_ORGANIZATION']);
|
|
|
+
|
|
|
},
|
|
|
getFigure: function (node) {
|
|
|
let calcBase = projectObj.project.calcBase;
|
|
@@ -160,6 +168,9 @@ let cbTools = {
|
|
|
else if(this.isFlag(node.data) && node.data.flagsIndex.fixed.flag === calcBase.fixedFlag.CONSTRUCTION_ORGANIZATION){
|
|
|
return calcBase.baseFigureClass.CONSTRUCTION_ORGANIZATION;
|
|
|
}
|
|
|
+ else if(this.isFlag(node.data) && node.data.flagsIndex.fixed.flag === calcBase.fixedFlag.SAFETY_CONSTRUCTION){
|
|
|
+ return calcBase.baseFigureClass.SAFETY_CONSTRUCTION;
|
|
|
+ }
|
|
|
else if(this.isFlag(node.data) && node.data.flagsIndex.fixed.flag === calcBase.fixedFlag.OTHER){
|
|
|
return calcBase.baseFigureClass.OTHER;
|
|
|
}
|
|
@@ -219,7 +230,9 @@ let cbTools = {
|
|
|
let bases = Array.from(new Set(tempBases));
|
|
|
//根据基数和行引用获取清单ID
|
|
|
for(let i = 0, len = bases.length; i < len; i++){
|
|
|
- if(bases[i]['type'] === 'base' && cbTools.isDef(calcBase.baseFigures[bases[i]['value']])){
|
|
|
+ //基数是跟清单直接关联的
|
|
|
+ if(bases[i]['type'] === 'base' && cbTools.isDef(calcBase.baseFigures[bases[i]['value']])
|
|
|
+ && cbTools.isDef(calcBase.baseFigures[bases[i]['value']]['fixedBill'])){
|
|
|
block.push(calcBase.baseFigures[bases[i]['value']]['fixedBill']['bill']['ID']);
|
|
|
}
|
|
|
else if(bases[i]['type'] === 'id'){
|
|
@@ -353,8 +366,18 @@ let baseFigureTemplate = {
|
|
|
'FBFXWJJCLF': function () {
|
|
|
return (this['FBFXZCF']() + this['FBFXSBF']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
+ //统计分部分项下工料机类型为“人工”的总消耗量
|
|
|
'FBFXRGGR': function () {
|
|
|
- return 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ let rst = 0;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.LABOUR){
|
|
|
+ if(cbTools.isDef(glj.subdivisionQuantity)){
|
|
|
+ rst = parseFloat(rst + glj.subdivisionQuantity).toDecimal(decimalObj.glj.quantity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
},
|
|
|
'FBFXGCLQDJJZJGCF': function () {
|
|
|
return (this['FBFXDEJJRGF']() + this['FBFXDEJJCLF']() + this['FBFXDEJJJXF']()).toDecimal(decimalObj.bills.totalPrice);
|
|
@@ -444,6 +467,15 @@ let baseFigureTemplate = {
|
|
|
return (this['JSCSXMZCF']() + this['JSCSXMSBF']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
'JSCSXMRGGR': function () {
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.LABOUR){
|
|
|
+ if(cbTools.isDef(glj.techQuantity)){
|
|
|
+ rst = parseFloat(rst + glj.techQuantity).toDecimal(decimalObj.glj.quantity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return 0;
|
|
|
},
|
|
|
'JSCSXMQDDEJJZJGCF': function () {
|
|
@@ -466,10 +498,415 @@ let baseFigureTemplate = {
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
+ },
|
|
|
+ 'SQGCZJ': function () {//税前工程造价
|
|
|
+ let bill = calcBase.fixedBills[calcBase.fixedFlag.SAFETY_CONSTRUCTION]['bill'];
|
|
|
+ if(cbTools.isUnDef(bill) || cbTools.isUnDef(bill.ID)) return 0;
|
|
|
+ let node = cbTools.getNodeByID(bill.ID);
|
|
|
+ if(cbTools.isUnDef(node)) return 0;
|
|
|
+ return projectObj.project.calcProgram.getBeforeTaxTotalFee([node]);
|
|
|
+ },
|
|
|
+ 'RCJJC': function () {//人材机价差
|
|
|
+ return (this['RGJC']() + this['CLJC']() + this['JXJC']()).toDecimal(2);
|
|
|
+ },
|
|
|
+ 'RGJC': function () {//人工价差
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.LABOUR){
|
|
|
+ //调整价
|
|
|
+ let adjPrc = calcBase.project.projectGLJ.getAdjustPrice(glj);
|
|
|
+ //价差
|
|
|
+ let dffPrc = parseFloat(glj.unit_price.market_price - adjPrc).toDecimal(decimalObj.glj.unitPrice);
|
|
|
+ rst = (rst + parseFloat(glj.quantity * dffPrc).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'CLJC': function () {//材料价差
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMaterialTypes.includes(glj.type) && glj.ratio_data.length === 0){//含有组成物的则用组成物计算,不含则自身算
|
|
|
+ //调整价
|
|
|
+ let adjPrc = calcBase.project.projectGLJ.getAdjustPrice(glj);
|
|
|
+ //价差
|
|
|
+ let dffPrc = parseFloat(glj.unit_price.market_price - adjPrc).toDecimal(decimalObj.glj.unitPrice);
|
|
|
+ rst = (rst + parseFloat(glj.quantity * dffPrc).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JXJC': function () {//机械价差
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMachineTypes.includes(glj.type) && glj.ratio_data.length === 0){
|
|
|
+ //调整价
|
|
|
+ let adjPrc = calcBase.project.projectGLJ.getAdjustPrice(glj);
|
|
|
+ //价差
|
|
|
+ let dffPrc = parseFloat(glj.unit_price.market_price - adjPrc).toDecimal(decimalObj.glj.unitPrice);
|
|
|
+ rst = (rst + parseFloat(glj.quantity * dffPrc).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'FBFXRCJJC': function () {//分部分项人材机价差
|
|
|
+ return (this['FBFXRGJC']() + this['FBFXCLJC']() + this['FBFXJXJC']()).toDecimal(2);
|
|
|
+ },
|
|
|
+ 'FBFXRGJC': function () {//分部分项人工价差
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.LABOUR && cbTools.isDef(glj.subdivisionQuantity)){
|
|
|
+ //调整价
|
|
|
+ let adjPrc = calcBase.project.projectGLJ.getAdjustPrice(glj);
|
|
|
+ //价差
|
|
|
+ let dffPrc = parseFloat(glj.unit_price.market_price - adjPrc).toDecimal(decimalObj.glj.unitPrice);
|
|
|
+ rst = (rst + parseFloat(glj.subdivisionQuantity * dffPrc).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'FBFXCLJC': function () {//分部分项材料价差
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMaterialTypes.includes(glj.type) && cbTools.isDef(glj.subdivisionQuantity) &&glj.ratio_data.length === 0){//含有组成物的则用组成物计算,不含则自身算
|
|
|
+ //调整价
|
|
|
+ let adjPrc = calcBase.project.projectGLJ.getAdjustPrice(glj);
|
|
|
+ //价差
|
|
|
+ let dffPrc = parseFloat(glj.unit_price.market_price - adjPrc).toDecimal(decimalObj.glj.unitPrice);
|
|
|
+ rst = (rst + parseFloat(glj.quantity * dffPrc).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'FBFXJXJC': function () {//分部分项机械价差
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMachineTypes.includes(glj.type) && cbTools.isDef(glj.subdivisionQuantity) && glj.ratio_data.length === 0){
|
|
|
+ //调整价
|
|
|
+ let adjPrc = calcBase.project.projectGLJ.getAdjustPrice(glj);
|
|
|
+ //价差
|
|
|
+ let dffPrc = parseFloat(glj.unit_price.market_price - adjPrc).toDecimal(decimalObj.glj.unitPrice);
|
|
|
+ rst = (rst + parseFloat(glj.subdivisionQuantity * dffPrc).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JSCSXMRCJJC': function () {//技术措施项目人材机价差
|
|
|
+ return (this['JSCSXMRGJC']() + this['JSCSXMCLJC']() + this['JSCSXMJXJC']()).toDecimal(2);
|
|
|
+ },
|
|
|
+ 'JSCSXMRGJC': function () {//技术措施项目人工价差
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.LABOUR && cbTools.isDef(glj.techQuantity)){
|
|
|
+ //调整价
|
|
|
+ let adjPrc = calcBase.project.projectGLJ.getAdjustPrice(glj);
|
|
|
+ //价差
|
|
|
+ let dffPrc = parseFloat(glj.unit_price.market_price - adjPrc).toDecimal(decimalObj.glj.unitPrice);
|
|
|
+ rst = (rst + parseFloat(glj.techQuantity * dffPrc).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JSCSXMCLJC': function () {//技术措施项目材料价差
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMaterialTypes.includes(glj.type) && cbTools.isDef(glj.techQuantity) &&glj.ratio_data.length === 0){//含有组成物的则用组成物计算,不含则自身算
|
|
|
+ //调整价
|
|
|
+ let adjPrc = calcBase.project.projectGLJ.getAdjustPrice(glj);
|
|
|
+ //价差
|
|
|
+ let dffPrc = parseFloat(glj.unit_price.market_price - adjPrc).toDecimal(decimalObj.glj.unitPrice);
|
|
|
+ rst = (rst + parseFloat(glj.techQuantity * dffPrc).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JSCSXMJXJC': function () {//技术措施项目机械价差
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMachineTypes.includes(glj.type) && cbTools.isDef(glj.techQuantity) && glj.ratio_data.length === 0){
|
|
|
+ //调整价
|
|
|
+ let adjPrc = calcBase.project.projectGLJ.getAdjustPrice(glj);
|
|
|
+ //价差
|
|
|
+ let dffPrc = parseFloat(glj.unit_price.market_price - adjPrc).toDecimal(decimalObj.glj.unitPrice);
|
|
|
+ rst = (rst + parseFloat(glj.techQuantity * dffPrc).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JGDEJJRGF': function () {//甲供定额基价人工费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.LABOUR){
|
|
|
+ rst = (rst + parseFloat(glj.supply_quantity * glj.basePrice).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JGDEJJCLF': function () {//甲供定额基价材料费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMaterialTypes.includes(glj.type) && glj.ratio_data.length === 0){
|
|
|
+ rst = (rst + parseFloat(glj.supply_quantity * glj.basePrice).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JGDEJJJXF': function () {//甲供定额基价机械费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMachineTypes.includes(glj.type) && glj.ratio_data.length === 0){
|
|
|
+ rst = (rst + parseFloat(glj.supply_quantity * glj.basePrice).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JGRGF': function () {//甲供人工费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.LABOUR){
|
|
|
+ rst = (rst + parseFloat(glj.supply_quantity * glj.unit_price.market_price).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JGCLF': function () {//甲供材料费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMaterialTypes.includes(glj.type) && glj.ratio_data.length === 0){
|
|
|
+ rst = (rst + parseFloat(glj.supply_quantity * glj.unit_price.market_price).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JGJXF': function () {//甲供机械费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMachineTypes.includes(glj.type) && glj.ratio_data.length === 0){
|
|
|
+ rst = (rst + parseFloat(glj.supply_quantity * glj.unit_price.market_price).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JGZCF': function () {//甲供主材费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.MAIN_MATERIAL && glj.ratio_data.length === 0){
|
|
|
+ rst = (rst + parseFloat(glj.supply_quantity * glj.unit_price.market_price).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JGSBF': function () {//甲供设备费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.EQUIPMENT){
|
|
|
+ rst = (rst + parseFloat(glj.supply_quantity * glj.unit_price.market_price).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JDDEJJRGF': function () {//甲定定额基价人工费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.LABOUR && glj.supply === supplyType.JDYG){
|
|
|
+ rst = (rst + parseFloat(glj.quantity * glj.basePrice).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JDDEJJCLF': function () {//甲定定额基价材料费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMaterialTypes.includes(glj.type) && glj.ratio_data.length === 0 && glj.supply === supplyType.JDYG){
|
|
|
+ rst = (rst + parseFloat(glj.quantity * glj.basePrice).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JDDEJJJXF': function () {//甲定定额基价机械费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMachineTypes.includes(glj.type) && glj.ratio_data.length === 0 && glj.supply === supplyType.JDYG){
|
|
|
+ rst = (rst + parseFloat(glj.quantity * glj.basePrice).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JDRGF': function () {//甲定人工费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.LABOUR && glj.supply === supplyType.JDYG){
|
|
|
+ rst = (rst + parseFloat(glj.quantity * glj.unit_price.market_price).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JDCLF': function () {//甲定材料费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMaterialTypes.includes(glj.type) && glj.ratio_data.length === 0 && glj.supply === supplyType.JDYG){
|
|
|
+ rst = (rst + parseFloat(glj.quantity * glj.unit_price.market_price).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JDJXF': function () {//甲定机械费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(baseMachineTypes.includes(glj.type) && glj.ratio_data.length === 0 && glj.supply === supplyType.JDYG){
|
|
|
+ console.log(glj);
|
|
|
+ rst = (rst + parseFloat(glj.quantity * glj.unit_price.market_price).toDecimal(2)).toDecimal(2);
|
|
|
+ console.log(rst);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JDZCF': function () {//甲定主材费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.MAIN_MATERIAL && glj.supply === supplyType.JDYG){
|
|
|
+ rst = (rst + parseFloat(glj.quantity * glj.unit_price.market_price).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'JDSBF': function () {//甲定设备费
|
|
|
+ let rst = 0;
|
|
|
+ let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
+ for(let glj of projGljs){
|
|
|
+ if(glj.type === gljType.EQUIPMENT && glj.supply === supplyType.JDYG){
|
|
|
+ rst = (rst + parseFloat(glj.quantity * glj.unit_price.market_price).toDecimal(2)).toDecimal(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'ZGCLFFZM': function () {//暂估材料费(从子目汇总)
|
|
|
+ let bill = calcBase.fixedBills[calcBase.fixedFlag.ENGINEERINGCOST]['bill'];
|
|
|
+ if(cbTools.isUnDef(bill)) return 0;
|
|
|
+ if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.estimate) && cbTools.isDef(bill.feesIndex.estimate.totalFee) ? bill.feesIndex.estimate.totalFee : 0;
|
|
|
+ },
|
|
|
+ 'ZGCLFFGLJ': function () {//暂估材料费(从工料机汇总表汇总)
|
|
|
+ return 0;
|
|
|
+ },
|
|
|
+ 'FBF': function () {//分包费
|
|
|
+ let rst = 0;
|
|
|
+ let rations = calcBase.project.Ration.datas;
|
|
|
+ for(let ration of rations){
|
|
|
+ if(ration.isSubcontract && ration.feesIndex && ration.feesIndex.common){
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.common.totalFee).toDecimal(decimalObj.ration.totalPrice)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'FBDEJJRGF': function () {//分包定额基价人工费
|
|
|
+ let rst = 0;
|
|
|
+ let rations = calcBase.project.Ration.datas;
|
|
|
+ for(let ration of rations){
|
|
|
+ if(ration.isSubcontract && ration.feesIndex && ration.feesIndex.labour){
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.labour.totalFee).toDecimal(decimalObj.ration.totalPrice)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'FBDEJJCLF': function () {//分包定额基价材料费
|
|
|
+ let rst = 0;
|
|
|
+ let rations = calcBase.project.Ration.datas;
|
|
|
+ for(let ration of rations){
|
|
|
+ if(ration.isSubcontract && ration.feesIndex && ration.feesIndex.material){
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.material.totalFee).toDecimal(decimalObj.ration.totalPrice)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'FBDEJJJXF': function(){//分包定额基价机械费
|
|
|
+ let rst = 0;
|
|
|
+ let rations = calcBase.project.Ration.datas;
|
|
|
+ for(let ration of rations){
|
|
|
+ if(ration.isSubcontract && ration.feesIndex && ration.feesIndex.machine){
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.machine.totalFee).toDecimal(decimalObj.ration.totalPrice)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'FBZCF': function () {//分包主材费
|
|
|
+ let rst = 0;
|
|
|
+ let rations = calcBase.project.Ration.datas;
|
|
|
+ for(let ration of rations){
|
|
|
+ if(ration.isSubcontract && ration.feesIndex && ration.feesIndex.mainMaterial){
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.mainMaterial.totalFee).toDecimal(decimalObj.ration.totalPrice)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'FBSBF': function () {//分包设备费
|
|
|
+ let rst = 0;
|
|
|
+ let rations = calcBase.project.Ration.datas;
|
|
|
+ for(let ration of rations){
|
|
|
+ if(ration.isSubcontract && ration.feesIndex && ration.feesIndex.equipment){
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.equipment.totalFee).toDecimal(decimalObj.ration.totalPrice)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ 'FBRGGR': function () {//分包人工工日
|
|
|
+ let rst = 0;
|
|
|
+ let rationIds = [];//查找定额工料机
|
|
|
+ let rations = calcBase.project.Ration.datas;
|
|
|
+ let rationGljs = calcBase.project.ration_glj.datas;
|
|
|
+ for(let ration of rations){
|
|
|
+ if(ration.isSubcontract){
|
|
|
+ //定额
|
|
|
+ if(ration.type === rationType.ration){
|
|
|
+ rationIds.push(ration.ID);
|
|
|
+ }
|
|
|
+ //量人 type 2, subType 1
|
|
|
+ else if(ration.type === rationType.volumePrice && ration.subType === volumePriceMaps['量人']){
|
|
|
+ rst = parseFloat(rst + ration.quantity).toDecimal(decimalObj.glj.quantity);
|
|
|
+ }
|
|
|
+ //定额类型的人工工料机,type 3, subType 1
|
|
|
+ else if(ration.type === rationType.gljRation && ration.subType === gljType.LABOUR){
|
|
|
+ rst = parseFloat(rst + ration.quantity).toDecimal(decimalObj.glj.quantity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for(let rationID of rationIds){
|
|
|
+ for(let glj of rationGljs){
|
|
|
+ if(rationID === glj.rationID){
|
|
|
+ rst = parseFloat(rst + glj.quantity).toDecimal(decimalObj.glj.quantity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+//基数的值不是通过清单节点获得的,则该基数的fixedBill为空,如价差、甲供、分包
|
|
|
let baseFigureMap = {
|
|
|
+ //与清单直接关联=======
|
|
|
'分部分项工程费': {base: 'FBFXGCF', fixedFlag: fixedFlag.SUB_ENGINERRING},
|
|
|
'分部分项定额基价人工费': {base: 'FBFXDEJJRGF', fixedFlag: fixedFlag.SUB_ENGINERRING},
|
|
|
'分部分项定额基价材料费': {base: 'FBFXDEJJCLF', fixedFlag: fixedFlag.SUB_ENGINERRING},
|
|
@@ -500,7 +937,46 @@ let baseFigureMap = {
|
|
|
'技术措施项目清单中的定额基价直接工程费': {base: 'JSCSXMQDDEJJZJGCF', fixedFlag: fixedFlag.CONSTRUCTION_TECH},
|
|
|
'其他项目费': {base: 'QTXMF', fixedFlag: fixedFlag.OTHER},
|
|
|
'规费': {base: 'GF', fixedFlag: fixedFlag.CHARGE},
|
|
|
- '税金': {base: 'SJ', fixedFlag: fixedFlag.TAX}
|
|
|
+ '税金': {base: 'SJ', fixedFlag: fixedFlag.TAX},
|
|
|
+ '税前工程造价': {base: 'SQGCZJ', fixedFlag: fixedFlag.SAFETY_CONSTRUCTION},//安全文明施工专项费用使用
|
|
|
+ //不于清单直接关联==========
|
|
|
+ '人材机价差': {base: 'RCJJC'},
|
|
|
+ '人工价差': {base: 'RGJC'},
|
|
|
+ '材料价差': {base: 'CLJC'},
|
|
|
+ '机械价差': {base: 'JXJC'},
|
|
|
+ '分部分项人材机价差': {base: 'FBFXRCJJC'},
|
|
|
+ '分部分项人工价差': {base: 'FBFXRGJC'},
|
|
|
+ '分部分项材料价差': {base: 'FBFXCLJC'},
|
|
|
+ '分部分项机械价差': {base: 'FBFXJXJC'},
|
|
|
+ '技术措施项目人材机价差': {base: 'JSCSXMRCJJC'},
|
|
|
+ '技术措施项目人工价差': {base: 'JSCSXMRGJC'},
|
|
|
+ '技术措施项目材料价差': {base: 'JSCSXMCLJC'},
|
|
|
+ '技术措施项目机械价差': {base: 'JSCSXMJXJC'},
|
|
|
+ '甲供定额基价人工费': {base: 'JGDEJJRGF'},
|
|
|
+ '甲供定额基价材料费': {base: 'JGDEJJCLF'},
|
|
|
+ '甲供定额基价机械费': {base: 'JGDEJJJXF'},
|
|
|
+ '甲供人工费': {base: 'JGRGF'},
|
|
|
+ '甲供材料费': {base: 'JGCLF'},
|
|
|
+ '甲供机械费': {base: 'JGJXF'},
|
|
|
+ '甲供主材费': {base: 'JGZCF'},
|
|
|
+ '甲供设备费': {base: 'JGSBF'},
|
|
|
+ '甲定定额基价人工费': {base: 'JDDEJJRGF'},
|
|
|
+ '甲定定额基价材料费': {base: 'JDDEJJCLF'},
|
|
|
+ '甲定定额基价机械费': {base: 'JDDEJJJXF'},
|
|
|
+ '甲定人工费': {base: 'JDRGF'},
|
|
|
+ '甲定材料费': {base: 'JDCLF'},
|
|
|
+ '甲定机械费': {base: 'JDJXF'},
|
|
|
+ '甲定主材费': {base: 'JDZCF'},
|
|
|
+ '甲定设备费': {base: 'JDSBF'},
|
|
|
+ '暂估材料费(从子目汇总)': {base: 'ZGCLFFZM'},
|
|
|
+ '暂估材料费(从工料机汇总表汇总)': {base: 'ZGCLFFGLJ'},
|
|
|
+ '分包费': {base: 'FBF'},
|
|
|
+ '分包定额基价人工费': {base: 'FBDEJJRGF'},
|
|
|
+ '分包定额基价材料费': {base: 'FBDEJJCLF'},
|
|
|
+ '分包定额基价机械费': {base: 'FBDEJJJXF'},
|
|
|
+ '分包主材费': {base: 'FBZCF'},
|
|
|
+ '分包设备费': {base: 'FBSBF'},
|
|
|
+ '分包人工工日': {base: 'FBRGGR'}
|
|
|
};
|
|
|
|
|
|
//输入式分析器
|
|
@@ -576,7 +1052,7 @@ let cbAnalyzer = {
|
|
|
let figure = figureF[i];
|
|
|
let bill = null;
|
|
|
if(figure.type === 'base' && cbTools.isDef(baseFigures[figure.value])){
|
|
|
- bill = baseFigures[figure.value]['fixedBill']['bill'];
|
|
|
+ bill = cbTools.isDef(baseFigures[figure.value]['fixedBill']) ? baseFigures[figure.value]['fixedBill']['bill'] : null;
|
|
|
}
|
|
|
else if(figure.type === 'id'){
|
|
|
let node = cbTools.getNodeByID(figure.value);
|
|
@@ -868,7 +1344,7 @@ let calcBase = {
|
|
|
cbTools.setBaseFigureClass(me.baseFigures, me.baseFigureClass);
|
|
|
},
|
|
|
getBase: function (figure) {
|
|
|
- return cbCalctor.base(figure);
|
|
|
+ return cbCalctor.base(figure);
|
|
|
|
|
|
},
|
|
|
getBaseByClass: function (node) {
|