|
@@ -315,59 +315,70 @@ let cbTools = {
|
|
|
};
|
|
|
|
|
|
let baseFigureTemplate = {
|
|
|
- 'FBFXGCF': function () {
|
|
|
+ 'FBFXGCF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['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.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'FBFXDEJJRGF': function () {
|
|
|
+ 'FBFXDEJJRGF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['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.labour) && cbTools.isDef(bill.feesIndex.labour.totalFee) ? bill.feesIndex.labour.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.labour) && cbTools.isDef(bill.feesIndex.labour[totalFeeType]) ? bill.feesIndex.labour[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'FBFXDEJJCLF': function () {
|
|
|
+ 'FBFXDEJJCLF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['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.material) && cbTools.isDef(bill.feesIndex.material.totalFee) ? bill.feesIndex.material.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.material) && cbTools.isDef(bill.feesIndex.material[totalFeeType]) ? bill.feesIndex.material[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'FBFXDEJJJXF': function () {
|
|
|
+ 'FBFXDEJJJXF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['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.machine) && cbTools.isDef(bill.feesIndex.machine.totalFee) ? bill.feesIndex.machine.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.machine) && cbTools.isDef(bill.feesIndex.machine[totalFeeType]) ? bill.feesIndex.machine[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'FBFXTZRGF': function () {
|
|
|
+ 'FBFXTZRGF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['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.adjustLabour) && cbTools.isDef(bill.feesIndex.adjustLabour.totalFee) ? bill.feesIndex.adjustLabour.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.adjustLabour) && cbTools.isDef(bill.feesIndex.adjustLabour[totalFeeType]) ? bill.feesIndex.adjustLabour[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'FBFXTZJSRGF': function () {
|
|
|
+ 'FBFXTZJSRGF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['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.adjustMachineLabour) && cbTools.isDef(bill.feesIndex.adjustMachineLabour.totalFee) ? bill.feesIndex.adjustMachineLabour.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.adjustMachineLabour) && cbTools.isDef(bill.feesIndex.adjustMachineLabour[totalFeeType]) ? bill.feesIndex.adjustMachineLabour[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'FBFXZCF': function () {
|
|
|
+ 'FBFXZCF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['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.mainMaterial) && cbTools.isDef(bill.feesIndex.mainMaterial.totalFee) ? bill.feesIndex.mainMaterial.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.mainMaterial) && cbTools.isDef(bill.feesIndex.mainMaterial[totalFeeType]) ? bill.feesIndex.mainMaterial[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'FBFXSBF': function () {
|
|
|
+ 'FBFXSBF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['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.equipment) && cbTools.isDef(bill.feesIndex.equipment.totalFee) ? bill.feesIndex.equipment.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.equipment) && cbTools.isDef(bill.feesIndex.equipment[totalFeeType]) ? bill.feesIndex.equipment[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'FBFXWJJCLF': function () {
|
|
|
- return (this['FBFXZCF']() + this['FBFXSBF']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ 'FBFXWJJCLF': function (tender) {
|
|
|
+ return (this['FBFXZCF'](tender) + this['FBFXSBF'](tender)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
//统计分部分项下工料机类型为“人工”的总消耗量
|
|
|
- 'FBFXRGGR': function () {
|
|
|
+ 'FBFXRGGR': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
+ const quantityType = tender ? 'tenderQuantity' : 'quantity';
|
|
|
+ //todo 调用subdivisionTenderQuantity
|
|
|
let projGljs = calcBase.project.projectGLJ.datas.gljList;
|
|
|
let rst = 0;
|
|
|
for(let glj of projGljs){
|
|
@@ -379,92 +390,105 @@ let baseFigureTemplate = {
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
- 'FBFXDEJJZJGCF': function () {
|
|
|
- return (this['FBFXDEJJRGF']() + this['FBFXDEJJCLF']() + this['FBFXDEJJJXF']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ 'FBFXDEJJZJGCF': function (tender) {
|
|
|
+ return (this['FBFXDEJJRGF'](tender) + this['FBFXDEJJCLF'](tender) + this['FBFXDEJJJXF'](tender)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
- 'CSXMF': function () {
|
|
|
+ 'CSXMF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.MEASURE]['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.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'ZZCSXMF': function () {
|
|
|
+ 'ZZCSXMF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_ORGANIZATION]['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.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'ZZCSXMDEJJZJGCF': function () {
|
|
|
- return (this['ZZCSXMDEJJRGF']() + this['ZZCSXMDEJJCLF']() + this['ZZCSXMDEJJJXF']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ 'ZZCSXMDEJJZJGCF': function (tender) {
|
|
|
+ return (this['ZZCSXMDEJJRGF'](tender) + this['ZZCSXMDEJJCLF'](tender) + this['ZZCSXMDEJJJXF'](tender)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
- 'ZZCSXMDEJJRGF': function () {
|
|
|
+ 'ZZCSXMDEJJRGF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_ORGANIZATION]['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.labour) && cbTools.isDef(bill.feesIndex.labour.totalFee) ? bill.feesIndex.labour.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.labour) && cbTools.isDef(bill.feesIndex.labour[totalFeeType]) ? bill.feesIndex.labour[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'ZZCSXMDEJJCLF': function () {
|
|
|
+ 'ZZCSXMDEJJCLF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_ORGANIZATION]['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.material) && cbTools.isDef(bill.feesIndex.material.totalFee) ? bill.feesIndex.material.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.material) && cbTools.isDef(bill.feesIndex.material[totalFeeType]) ? bill.feesIndex.material[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'ZZCSXMDEJJJXF': function () {
|
|
|
+ 'ZZCSXMDEJJJXF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_ORGANIZATION]['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.machine) && cbTools.isDef(bill.feesIndex.machine.totalFee) ? bill.feesIndex.machine.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.machine) && cbTools.isDef(bill.feesIndex.machine[totalFeeType]) ? bill.feesIndex.machine[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'JSCSXMF': function () {
|
|
|
+ 'JSCSXMF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['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.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'JSCSXMDEJJRGF': function () {
|
|
|
+ 'JSCSXMDEJJRGF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['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.labour) && cbTools.isDef(bill.feesIndex.labour.totalFee) ? bill.feesIndex.labour.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.labour) && cbTools.isDef(bill.feesIndex.labour[totalFeeType]) ? bill.feesIndex.labour[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'JSCSXMDEJJCLF': function () {
|
|
|
+ 'JSCSXMDEJJCLF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['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.material) && cbTools.isDef(bill.feesIndex.material.totalFee) ? bill.feesIndex.material.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.material) && cbTools.isDef(bill.feesIndex.material[totalFeeType]) ? bill.feesIndex.material[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'JSCSXMDEJJJXF': function () {
|
|
|
+ 'JSCSXMDEJJJXF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['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.machine) && cbTools.isDef(bill.feesIndex.machine.totalFee) ? bill.feesIndex.machine.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.machine) && cbTools.isDef(bill.feesIndex.machine[totalFeeType]) ? bill.feesIndex.machine[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'JSCSXMTZRGF': function () {
|
|
|
+ 'JSCSXMTZRGF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['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.adjustLabour) && cbTools.isDef(bill.feesIndex.adjustLabour.totalFee) ? bill.feesIndex.adjustLabour.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.adjustLabour) && cbTools.isDef(bill.feesIndex.adjustLabour[totalFeeType]) ? bill.feesIndex.adjustLabour[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'JSCSXMTZJSRGF': function () {
|
|
|
+ 'JSCSXMTZJSRGF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['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.adjustMachineLabour) && cbTools.isDef(bill.feesIndex.adjustMachineLabour.totalFee) ? bill.feesIndex.adjustMachineLabour.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.adjustMachineLabour) && cbTools.isDef(bill.feesIndex.adjustMachineLabour[totalFeeType]) ? bill.feesIndex.adjustMachineLabour[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'JSCSXMZCF': function () {
|
|
|
+ 'JSCSXMZCF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['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.mainMaterial) && cbTools.isDef(bill.feesIndex.mainMaterial.totalFee) ? bill.feesIndex.mainMaterial.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.mainMaterial) && cbTools.isDef(bill.feesIndex.mainMaterial[totalFeeType]) ? bill.feesIndex.mainMaterial[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'JSCSXMSBF': function () {
|
|
|
+ 'JSCSXMSBF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['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.equipment) && cbTools.isDef(bill.feesIndex.equipment.totalFee) ? bill.feesIndex.equipment.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.equipment) && cbTools.isDef(bill.feesIndex.equipment[totalFeeType]) ? bill.feesIndex.equipment[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'JSCSXMWJJCLF': function () {
|
|
|
- return (this['JSCSXMZCF']() + this['JSCSXMSBF']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ 'JSCSXMWJJCLF': function (tender) {
|
|
|
+ return (this['JSCSXMZCF'](tender) + this['JSCSXMSBF'](tender)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
'JSCSXMRGGR': function () {
|
|
|
let rst = 0;
|
|
@@ -478,36 +502,39 @@ let baseFigureTemplate = {
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
- 'JSCSXMDEJJZJGCF': function () {
|
|
|
- return (this['JSCSXMDEJJRGF']() + this['JSCSXMDEJJCLF']() + this['JSCSXMDEJJJXF']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ 'JSCSXMDEJJZJGCF': function (tender) {
|
|
|
+ return (this['JSCSXMDEJJRGF'](tender) + this['JSCSXMDEJJCLF'](tender) + this['JSCSXMDEJJJXF'](tender)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
- 'QTXMF': function () {
|
|
|
+ 'QTXMF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.OTHER]['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.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'GF': function () {
|
|
|
+ 'GF': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CHARGE]['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.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'SJ': function () {
|
|
|
+ 'SJ': function (tender) {
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.TAX]['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.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
|
|
|
},
|
|
|
- 'SQGCZJ': function () {//税前工程造价
|
|
|
+ 'SQGCZJ': function (tender) {//税前工程造价
|
|
|
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]);
|
|
|
+ return projectObj.project.calcProgram.getBeforeTaxTotalFee([node], tender);
|
|
|
},
|
|
|
- 'RCJJC': function () {//人材机价差
|
|
|
- return (this['RGJC']() + this['CLJC']() + this['JXJC']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ 'RCJJC': function (tender) {//人材机价差
|
|
|
+ return (this['RGJC'](tender) + this['CLJC'](tender) + this['JXJC'](tender)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
'RGJC': function () {//人工价差
|
|
|
let rst = 0;
|
|
@@ -551,8 +578,8 @@ let baseFigureTemplate = {
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
- 'FBFXRCJJC': function () {//分部分项人材机价差
|
|
|
- return (this['FBFXRGJC']() + this['FBFXCLJC']() + this['FBFXJXJC']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ 'FBFXRCJJC': function (tender) {//分部分项人材机价差
|
|
|
+ return (this['FBFXRGJC'](tender) + this['FBFXCLJC'](tender) + this['FBFXJXJC'](tender)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
'FBFXRGJC': function () {//分部分项人工价差
|
|
|
let rst = 0;
|
|
@@ -596,8 +623,8 @@ let baseFigureTemplate = {
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
- 'JSCSXMRCJJC': function () {//技术措施项目人材机价差
|
|
|
- return (this['JSCSXMRGJC']() + this['JSCSXMCLJC']() + this['JSCSXMJXJC']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ 'JSCSXMRCJJC': function (tender) {//技术措施项目人材机价差
|
|
|
+ return (this['JSCSXMRGJC'](tender) + this['JSCSXMCLJC'](tender) + this['JSCSXMJXJC'](tender)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
'JSCSXMRGJC': function () {//技术措施项目人工价差
|
|
|
let rst = 0;
|
|
@@ -801,76 +828,84 @@ let baseFigureTemplate = {
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
- 'ZGCLFFZM': function () {//暂估材料费(从子目汇总)
|
|
|
+ 'ZGCLFFZM': function (tender) {//暂估材料费(从子目汇总)
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
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;
|
|
|
+ return cbTools.isDef(bill.feesIndex.estimate) && cbTools.isDef(bill.feesIndex.estimate[totalFeeType]) ? bill.feesIndex.estimate[totalFeeType] : 0;
|
|
|
},
|
|
|
'ZGCLFFGLJ': function () {//暂估材料费(从工料机汇总表汇总)
|
|
|
return 0;
|
|
|
},
|
|
|
- 'FBF': function () {//分包费
|
|
|
+ 'FBF': function (tender) {//分包费
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
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)
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.common[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
|
|
|
}
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
- 'FBDEJJRGF': function () {//分包定额基价人工费
|
|
|
+ 'FBDEJJRGF': function (tender) {//分包定额基价人工费
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
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)
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.labour[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
|
|
|
}
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
- 'FBDEJJCLF': function () {//分包定额基价材料费
|
|
|
+ 'FBDEJJCLF': function (tender) {//分包定额基价材料费
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
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)
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.material[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
|
|
|
}
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
- 'FBDEJJJXF': function(){//分包定额基价机械费
|
|
|
+ 'FBDEJJJXF': function(tender){//分包定额基价机械费
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
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)
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.machine[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
|
|
|
}
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
- 'FBZCF': function () {//分包主材费
|
|
|
+ 'FBZCF': function (tender) {//分包主材费
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
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)
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.mainMaterial[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
|
|
|
}
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
- 'FBSBF': function () {//分包设备费
|
|
|
+ 'FBSBF': function (tender) {//分包设备费
|
|
|
+ const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
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)
|
|
|
+ rst = parseFloat(rst + ration.feesIndex.equipment[totalFeeType]).toDecimal(decimalObj.ration.totalPrice)
|
|
|
}
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
- 'FBRGGR': function () {//分包人工工日
|
|
|
+ 'FBRGGR': function (tender) {//分包人工工日
|
|
|
+ const quantityType = tender ? 'tenderQuantity' : 'quantity';
|
|
|
let rst = 0;
|
|
|
let rationObjs = [];//查找定额工料机
|
|
|
let rations = calcBase.project.Ration.datas;
|
|
@@ -879,22 +914,22 @@ let baseFigureTemplate = {
|
|
|
if(ration.isSubcontract){
|
|
|
//定额
|
|
|
if(ration.type === rationType.ration){
|
|
|
- rationObjs.push({ID: ration.ID, quantity: ration.quantity});
|
|
|
+ rationObjs.push({ID: ration.ID, quantity: ration[quantityType]});
|
|
|
}
|
|
|
//量人 type 2, subType 1
|
|
|
else if(ration.type === rationType.volumePrice && ration.subType === volumePriceMaps['量人']){
|
|
|
- rst = parseFloat(rst + ration.quantity).toDecimal(decimalObj.glj.quantity);
|
|
|
+ rst = parseFloat(rst + ration[quantityType]).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);
|
|
|
+ rst = parseFloat(rst + ration[quantityType]).toDecimal(decimalObj.glj.quantity);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for(let ration of rationObjs){
|
|
|
for(let glj of rationGljs){
|
|
|
if(ration.ID === glj.rationID && glj.type === gljType.LABOUR){
|
|
|
- rst = parseFloat(rst + parseFloat(glj.quantity * ration.quantity).toDecimal(decimalObj.glj.quantity)).toDecimal(decimalObj.glj.quantity);
|
|
|
+ rst = parseFloat(rst + parseFloat(glj[quantityType] * ration.quantity).toDecimal(decimalObj.glj.quantity)).toDecimal(decimalObj.glj.quantity);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1325,6 +1360,13 @@ let cbCalctor = {
|
|
|
}
|
|
|
return baseFigureTemplate[calcBase.baseFigures[figure]['base']]();
|
|
|
},
|
|
|
+ //调价后计算基数
|
|
|
+ tenderBase: function (figure) {
|
|
|
+ if(figure === 'NONE'){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ return baseFigureTemplate[calcBase.baseFigures[figure]['base']](true);
|
|
|
+ },
|
|
|
//ID引用
|
|
|
ref: function (fExp) {
|
|
|
let ID = cbParser.getUID([fExp]);
|
|
@@ -1400,11 +1442,18 @@ let calcBase = {
|
|
|
if(!cbTools.isNum(calcBaseValue)){
|
|
|
throw '表达式不正确';
|
|
|
}
|
|
|
+ //调价
|
|
|
+ let tenderCalcExp = calcExp.replace(new RegExp('base', 'g'), 'tenderBase');
|
|
|
+ let tenderCalcBaseValue = eval(tenderCalcExp);
|
|
|
+ if(!cbTools.isNum(tenderCalcBaseValue)){
|
|
|
+ throw '表达式不正确';
|
|
|
+ }
|
|
|
|
|
|
//存储
|
|
|
me.success = true;
|
|
|
node.data.calcBase = exp;
|
|
|
node.data.calcBaseValue = parseFloat(calcBaseValue).toDecimal(decimalObj.decimal('totalPrice', node));
|
|
|
+ node.data.tenderCalcBaseValue = parseFloat(tenderCalcBaseValue).toDecimal(decimalObj.decimal('totalPrice', node));
|
|
|
node.changed = true;
|
|
|
}
|
|
|
catch (err){
|