|
@@ -2716,30 +2716,71 @@ class CalcProgram {
|
|
};
|
|
};
|
|
|
|
|
|
doTenderCalc(callback) {
|
|
doTenderCalc(callback) {
|
|
- $.bootstrapLoading.start();
|
|
|
|
- setTimeout(()=>{
|
|
|
|
- let tender = calcTools.getTenderType();
|
|
|
|
- if (tender == tenderTypes.ttReverseGLJ || tender == tenderTypes.ttReverseRation) {
|
|
|
|
- // 调价计算必须依赖调价树。
|
|
|
|
- if (!tender_obj.tenderTree){
|
|
|
|
- tender_obj.createTree();
|
|
|
|
- tender_obj.createTreeNodes();
|
|
|
|
- }
|
|
|
|
- // 反向调价+逼近原理:
|
|
|
|
- // 清理调价缓存 → 分摊目标金额(从子往父处理满载、从父往子分摊) → 全局反算 → 逼近 → 全局正算、存储
|
|
|
|
- this.reverseTenderInitDatas();
|
|
|
|
- this.prepareForDistribute(tender_obj.tenderTree.roots[0]);
|
|
|
|
- this.distributeTargetTotalFee(tender_obj.tenderTree.roots[0]);
|
|
|
|
- this.calcAllNodes(calcAllType.catAll, tender); // 先全局反算:得到每定额的coe、基础调后金额(误差大,需逼近)
|
|
|
|
- this.reverseTenderApproach(callback, tender); // 逼近上述基础调后金额
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 全局正算(用的是主树,无需调价树)
|
|
|
|
- this.calcAllNodesAndSave(calcAllType.catAll, callback, tenderTypes.ttCalc);
|
|
|
|
- })
|
|
|
|
|
|
+ $.bootstrapLoading.start();
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ let tender = calcTools.getTenderType();
|
|
|
|
+ if (tender == tenderTypes.ttReverseGLJ || tender == tenderTypes.ttReverseRation) {
|
|
|
|
+ // 调价计算必须依赖调价树。
|
|
|
|
+ if (!tender_obj.tenderTree){
|
|
|
|
+ tender_obj.createTree();
|
|
|
|
+ tender_obj.createTreeNodes();
|
|
|
|
+ }
|
|
|
|
+ // 反向调价+逼近原理:
|
|
|
|
+ // 清理调价缓存 → 分摊目标金额(从子往父处理满载、从父往子分摊) → 全局反算 → 逼近 → 全局正算、存储
|
|
|
|
+ this.reverseTenderInitDatas();
|
|
|
|
+ this.prepareForDistribute(tender_obj.tenderTree.roots[0]);
|
|
|
|
+ this.distributeTargetTotalFee(tender_obj.tenderTree.roots[0]);
|
|
|
|
+ this.calcAllNodes(calcAllType.catAll, tender); // 先全局反算:得到每定额的coe、基础调后金额(误差大,需逼近)
|
|
|
|
+ this.reverseTenderApproach(callback, tender); // 逼近上述基础调后金额
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 全局正算(用的是主树,无需调价树)
|
|
|
|
+ this.calcAllNodesAndSave(calcAllType.catAll, callback, tenderTypes.ttCalc);
|
|
|
|
+ })
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ gatherRationFees(programID){
|
|
|
|
+ $.bootstrapLoading.start();
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ // 先把符合的定额筛选出来,以提高速度。
|
|
|
|
+ let rations = [];
|
|
|
|
+ for (const r of projectObj.project.Ration.datas) {
|
|
|
|
+ if (r.programID == programID) rations.push(r);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ let gatherObj = {};
|
|
|
|
+ gatherObj.programID = programID;
|
|
|
|
+ for (let ft of cpFeeTypes) {
|
|
|
|
+ let ftObj = {};
|
|
|
|
+ ftObj.name = ft.name;
|
|
|
|
+
|
|
|
|
+ let sum_uf = 0, sum_tuf = 0, sum_tf = 0, sum_ttf = 0;
|
|
|
|
+ for (const r of rations) {
|
|
|
|
+ let uf = 0, tuf = 0, tf = 0, ttf = 0;
|
|
|
|
+ if (r.feesIndex && r.feesIndex[ft.type]) {
|
|
|
|
+ uf = parseFloatPlus(r.feesIndex[ft.type].unitFee).toDecimal(decimalObj.bills.unitPrice);
|
|
|
|
+ tuf = parseFloatPlus(r.feesIndex[ft.type].tenderUnitFee).toDecimal(decimalObj.bills.unitPrice);
|
|
|
|
+ tf = parseFloatPlus(r.feesIndex[ft.type].totalFee).toDecimal(decimalObj.bills.totalPrice);
|
|
|
|
+ ttf = parseFloatPlus(r.feesIndex[ft.type].tenderTotalFee).toDecimal(decimalObj.bills.totalPrice);
|
|
|
|
+ };
|
|
|
|
+ sum_uf = (sum_uf + uf).toDecimal(decimalObj.process);
|
|
|
|
+ sum_tuf = (sum_tuf + tuf).toDecimal(decimalObj.process);
|
|
|
|
+ sum_tf = (sum_tf + tf).toDecimal(decimalObj.process);
|
|
|
|
+ sum_ttf = (sum_ttf + ttf).toDecimal(decimalObj.process);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ ftObj.totalFee = sum_tf.toDecimal(decimalObj.bills.totalPrice);
|
|
|
|
+ ftObj.tenderTotalFee = sum_ttf.toDecimal(decimalObj.bills.totalPrice);
|
|
|
|
+ ftObj.unitFee = sum_uf.toDecimal(decimalObj.bills.unitPrice);
|
|
|
|
+ ftObj.tenderUnitFee = sum_tuf.toDecimal(decimalObj.bills.unitPrice);
|
|
|
|
+
|
|
|
|
+ gatherObj[ft.type] = ftObj;
|
|
|
|
+ };
|
|
|
|
+ console.log(gatherObj);
|
|
|
|
+ });
|
|
|
|
+ $.bootstrapLoading.end();
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
// export default analyzer;
|
|
// export default analyzer;
|