chenshilong 6 anos atrás
pai
commit
973111f1b6
1 arquivos alterados com 17 adições e 17 exclusões
  1. 17 17
      web/building_saas/main/js/views/block_lib.js

+ 17 - 17
web/building_saas/main/js/views/block_lib.js

@@ -57,8 +57,8 @@ var blockLibObj = {
             {headerName: "名称", headerWidth: 100, dataCode: "name", dataType: "String"},
             {headerName: "单位", headerWidth: 40, dataCode: "unit", dataType: "String", hAlign: "center"},
             {headerName: "含量", headerWidth: 40, dataCode: "contain", dataType: "Number"},
-            {headerName: "取费专业", headerWidth: 70, dataCode: "", dataType: "String", hAlign: "center"},
-            {headerName: "综合单价", headerWidth: 70, dataCode: "", dataType: "Number"},
+            {headerName: "取费专业", headerWidth: 70, dataCode: "programName", dataType: "String", hAlign: "center"},
+            {headerName: "综合单价", headerWidth: 70, dataCode: "unitFee", dataType: "Number"},
             {headerName: "子目换算状态", headerWidth: 90, dataCode: "adjustState", dataType: "String"}
         ],
         view: {
@@ -138,7 +138,6 @@ var blockLibObj = {
             let rCount = (rations.length > 0) ? rations.length : 1;
             me.rationSheet.setRowCount(rCount, GC.Spread.Sheets.SheetArea.viewport);
             sheetCommonObj.showData(me.rationSheet, me.rationSetting, rations);
-            me.changeRationText(rations);
         }
         else{
             sheetCommonObj.cleanSheet(me.billSheet, me.billSetting, 1);
@@ -378,8 +377,18 @@ var blockLibObj = {
             newNode.data.name = bill.name;
             newNode.data.unit = bill.unit;
             newNode.data.itemCharacterText = bill.itemCharacterText;
-            newNode.data.children = bill.children;
             newNode.data.unitFee = (bill.feesIndex && bill.feesIndex.common) ? bill.feesIndex.common.unitFee : 0;
+            newNode.data.children = bill.children;
+
+            for (let r of bill.children){
+                r.unitFee =  (r.feesIndex && r.feesIndex.common) ? r.feesIndex.common.unitFee : 0;
+                if (r.programID)
+                    r.programName = projectObj.project.calcProgram.compiledTemplateMaps[r.programID];
+                // delete r.ID;         // 这个不能删!
+                delete r.billsItemID;
+                delete r.fees;
+                delete r.feesIndex;
+            };
         }
 
         tree.selected = newNode;
@@ -398,6 +407,7 @@ var blockLibObj = {
         sheet.resumePaint();
     },
     reName: function (node, newName){
+        if (newName == '') return;
         node.data.fileName = newName;
         let idx = blockLibObj.mainTree.items.indexOf(node);
         blockLibObj.mainSheet.setValue(idx, 0, newName);
@@ -425,19 +435,6 @@ var blockLibObj = {
         if (this.rationSpread)
             this.rationSpread.refresh();
     },
-    changeRationText: function (rationDatas) {
-        let sheet = this.rationSheet;
-        sheet.suspendPaint();
-        sheet.suspendEvent();
-        for (let i = 0; i < rationDatas.length; i++) {
-            let pID = rationDatas[i].programID;
-            if (pID) sheet.setValue(i, 4, projectObj.project.calcProgram.compiledTemplateMaps[pID]);
-            if (rationDatas[i].feesIndex && rationDatas[i].feesIndex.common)
-                sheet.setValue(i, 5, rationDatas[i].feesIndex.common.unitFee);
-        }
-        sheet.resumeEvent();
-        sheet.resumePaint();
-    },
     loadTreeContextMenu: function (){
         let me = this;
         $.contextMenu({
@@ -539,6 +536,9 @@ var blockLibObj = {
             datas: block.children       // rations
         };
         BlockController.confirmPaste(vBlock_WC, projectNode, 'sub');
+    },
+    oneToMoreCloneXX: function () {
+        //
     }
 };