فهرست منبع

累进汇总设计

zhangweicheng 5 سال پیش
والد
کامیت
ab8e164f2f

+ 1 - 1
modules/main/facade/project_facade.js

@@ -288,7 +288,7 @@ async function getDefaultColSetting(libID){
     return await stdColSettingModel.findOne({ID: libID, deleted: false}, '-_id main_tree_col');
 }
 
-async function getBudgetSummayDatas(projectIDs,overWriteUrl){
+async function getBudgetSummayDatas(projectIDs,userID,compilationID,overWriteUrl){
     try {
         let projects = [];
         let names = [];

+ 2 - 1
modules/options/models/optionTypes.js

@@ -8,7 +8,8 @@
 const optionSetting = {
     GENERALOPTS: {
         rationQuanACToBillsQuan: true,//自动根据清单工程量填写定额工程量
-        rationQuanACToRationUnit: true//自动根据定额单位转换定额工程量
+        rationQuanACToRationUnit: true,
+        progressiveType:0//累进计算费用:0 统一累进办法;1 各汇总工程相加
     },
     //色彩相关
     COLOROPTS: {

+ 1 - 1
public/web/tree_sheet/tree_sheet_helper.js

@@ -559,7 +559,7 @@ var TREE_SHEET_HELPER = {
             };
 
             TreeNodeCellType.prototype.deactivateEditor = function (editorContext, context) {
-                    console.log("hehe")
+                    
             };
 
             TreeNodeCellType.prototype.updateEditor = function (editorContext, cellStyle, cellRect, context) {

+ 8 - 3
web/building_saas/main/js/views/options_view.js

@@ -12,7 +12,7 @@ let optionsOprObj = {
         let gOpts = me.options[me.optionsTypes.GENERALOPTS];
         if(gljUtil.isDef(gOpts)){
             for(let attr in gOpts){
-                me[attr].prop('checked', gOpts[attr]);
+              if(me[attr]) me[attr].prop('checked', gOpts[attr]);
             }
         }
     },
@@ -48,7 +48,9 @@ let optionsOprObj = {
         let v2 = this.rationQuanACToRationUnit.prop('checked');
         let orgV1 = this.getOption(this.optionsTypes.GENERALOPTS, 'rationQuanACToBillsQuan');
         let orgV2 = this.getOption(this.optionsTypes.GENERALOPTS, 'rationQuanACToRationUnit');
-        return v1 !== orgV1 || v2 !== orgV2;
+        let progressiveType = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'progressiveType');
+        let progressiveTypeVal = parseInt($("input[name='progressiveType']:checked").val())
+        return v1 !== orgV1 || v2 !== orgV2 || progressiveType!== progressiveTypeVal;
     }
 };
 
@@ -56,9 +58,12 @@ let optionsOprObj = {
 $('#poj-set').on('shown.bs.modal', function () {
     let orgV1 = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'rationQuanACToBillsQuan');
     let orgV2 = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'rationQuanACToRationUnit');
+    let progressiveType = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'progressiveType');
     optionsOprObj.rationQuanACToBillsQuan.prop('checked', orgV1);
     optionsOprObj.rationQuanACToRationUnit.prop('checked', orgV2);
-
+    progressiveType = progressiveType?progressiveType:0;
+    $('#progressive_unite').prop('checked', progressiveType == 0);
+    $('#progressive_sum').prop('checked', progressiveType == 1);
 });
 //选项移到了项目属性的系统选项中
 /*optionsOprObj.rationQuanACToBillsQuan.click(function () {

+ 4 - 11
web/building_saas/main/js/views/project_view.js

@@ -2337,15 +2337,12 @@ $('#poj-set').on('show.bs.modal', function () {
 
         let zg = projectObj.project.property.zanguCalcMode !== undefined &&
                  projectObj.project.property.zanguCalcMode !== null ? projectObj.project.property.zanguCalcMode : zanguCalcType.common;
-        let progressiveType = projectObj.project.property.progressiveType?projectObj.project.property.progressiveType:0;   
         setCalcFlag($('#rationContent'), leafBillGetFeeType.rationContent, ft);
         setCalcFlag($('#rationPriceConverse'), leafBillGetFeeType.rationPriceConverse, ft);
         setCalcFlag($('#rationPrice'), leafBillGetFeeType.rationPrice, ft);
         setCalcFlag($('#billsPrice'), leafBillGetFeeType.billsPrice, ft);
         setCalcFlag($('#zangu_common'), zanguCalcType.common, zg);
         setCalcFlag($('#zangu_gatherMaterial'), zanguCalcType.gatherMaterial, zg);
-        setCalcFlag($('#progressive_unite'), 0, progressiveType);
-        setCalcFlag($('#progressive_sum'), 1, progressiveType);
         
         let showAdjustPrice = projectObj.project.projSetting.glj_col?projectObj.project.projSetting.glj_col.showAdjustPrice:false;
         showAdjustPrice === true ? $("#tab_poj-settings-6").show():$("#tab_poj-settings-6").hide();
@@ -2505,12 +2502,6 @@ $('#property_ok').click(function () {
         reCalcRations = true;
     };
 
-    let progressiveType = parseInt($("input[name='progressiveType']:checked").val())
-    if (progressiveType !== project.property.progressiveType) {
-      properties['property.progressiveType'] = progressiveType;
-      project.property.progressiveType = progressiveType;
-  };
-
     //价差预备费,预算项目才有
     if (project.property.valuationType === 'bill') {
         let costGrowthRateV = $('#costGrowthRate').val(),
@@ -2569,10 +2560,12 @@ $('#property_ok').click(function () {
     //系统选项
     if(optionsOprObj.needToSaveGeneralOpts()){
         let v1 = optionsOprObj.rationQuanACToBillsQuan.prop('checked'),
-            v2 = optionsOprObj.rationQuanACToRationUnit.prop('checked');
+            v2 = optionsOprObj.rationQuanACToRationUnit.prop('checked'),
+            progressiveType = parseInt($("input[name='progressiveType']:checked").val());
         options.updateData = {
             rationQuanACToBillsQuan: v1,
-            rationQuanACToRationUnit: v2
+            rationQuanACToRationUnit: v2,
+            progressiveType:progressiveType
         };
     }