浏览代码

概算项目使用预算定额,因工程类别ID超出,找不到计算程序无法汇总问题。

chenshilong 4 年之前
父节点
当前提交
1061d902e7

+ 1 - 1
web/building_saas/main/js/models/calc_program.js

@@ -1091,7 +1091,7 @@ let calcTools = {
         let rations = projectObj.project.Ration.datas;
         for (const r of rations) {
             let tpl = projectObj.project.calcProgram.compiledTemplates[r.programID];
-            if (!arr.includes(tpl))
+            if (tpl && !arr.includes(tpl))
               arr.push(tpl);
         };
         arr.sort(function (x, y) {return x.ID - y.ID});

+ 4 - 4
web/building_saas/main/js/views/gather_fees_view.js

@@ -268,11 +268,11 @@ $(document).ready(function(){
         sessionStorage.setItem('mainTab', '#tab_gather_fees');
         $(e.relatedTarget.hash).removeClass('active');
         // 每次进来都要重新计算一次
-        if (!gatherFeesView.mainSpread)
-            gatherFeesView.buildSheet()
-        else
-            gatherFeesView.mainSpread.refresh();
+        if (!gatherFeesView.mainSpread) {
+            gatherFeesView.buildSheet();
+        }
 
+        gatherFeesView.mainSpread.refresh();
         gatherFeesView.showData();
     });
 

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

@@ -443,6 +443,10 @@ var projectObj = {
     },
     updateCellValue: function (node, value, colSetting,editingText) {
         let project = projectObj.project, fieldName = colSetting.data.field;
+        if(fieldName === 'programID' && value === undefined){
+            return projectObj.mainController.refreshTreeNode([node]);
+        }
+
         if(node.sourceType==project.ration_glj.getSourceType()){
             project.ration_glj.updateFromMainSpread(value,node,fieldName);
         }