瀏覽代碼

定额章节树ID

zhongzewei 7 年之前
父節點
當前提交
d938166765
共有 2 個文件被更改,包括 43 次插入9 次删除
  1. 39 5
      web/maintain/ration_repository/js/section_tree.js
  2. 4 4
      web/over_write/js/chongqing_2018.js

+ 39 - 5
web/maintain/ration_repository/js/section_tree.js

@@ -60,6 +60,23 @@ let sectionTreeObj = {
             cols:[
                 {
                     head: {
+                        titleNames: ['ID'],
+                        spanCols: [1],
+                        spanRows: [2],
+                        vAlign: [1, 1],
+                        hAlign: [1, 1],
+                        font: 'Arial'
+                    },
+                    data: {
+                        field: 'ID',
+                        vAlign: 1,
+                        hAlign: 0,
+                        font: 'Arial'
+                    },
+                    width: 40
+                },
+                {
+                    head: {
                         titleNames: ['名称'],
                         spanCols: [1],
                         spanRows: [2],
@@ -73,13 +90,13 @@ let sectionTreeObj = {
                         hAlign: 0,
                         font: 'Arial'
                     },
-                    width: 400
+                    width: 370
                 }
             ],
             headRows: 1,
             headRowHeight: [25],
             emptyRows: 0,
-            treeCol: 0
+            treeCol: 1
         },
         tree: {
             id: 'ID',
@@ -136,7 +153,9 @@ let sectionTreeObj = {
         let me = sectionTreeObj;
         const Events = GC.Spread.Sheets.Events;
         sheet.bind(Events.SelectionChanged, me.onSelectionChanged);
+        sheet.bind(Events.EditStarting, me.onEditStarting);
         sheet.bind(Events.EditEnded, me.onEditEnded);
+        sheet.bind(Events.ClipboardPasting, me.onClipboardPasting);
         sheet.bind(Events.ClipboardPasted, me.onClipboardPasted);
     },
 
@@ -153,6 +172,14 @@ let sectionTreeObj = {
         }*/
     },
 
+    onEditStarting: function (sender, args) {
+        let me = sectionTreeObj;
+        let dataCode = me.setting.sheet.cols[args.col]['data']['field'];
+        if(dataCode === 'ID'){
+            args.cancel = true;
+        }
+    },
+
     onEditEnded: function (sender, args) {
         let me = sectionTreeObj;
         let postData = [];
@@ -171,9 +198,16 @@ let sectionTreeObj = {
         }
     },
 
+    onClipboardPasting: function (sender, info) {
+        let me = sectionTreeObj;
+        if(info.cellRange.col === 0){
+            info.cancel = true;
+        }
+    },
+
     onClipboardPasted: function (sender, info) {
         let me = sectionTreeObj;
-        let items = sheetCommonObj.analyzePasteData({header: [{dataCode: 'name'}]}, info);
+        let items = sheetCommonObj.analyzePasteData({header: [{dataCode: 'ID'}, {dataCode: 'name'}]}, info);
         let postData = [];
         let frontData = [];
         for(let i = 0, len = items.length; i < len; i++){
@@ -198,7 +232,7 @@ let sectionTreeObj = {
             }, function () {
                 for(let i = 0, len = frontData.length; i < len; i++){
                     let node = me.cache[frontData[i]['row']];
-                    me.sheet.setValue(frontData[i]['row'], 0, me.isDef(node) ? node.data.name : '');
+                    me.sheet.setValue(frontData[i]['row'], 1, me.isDef(node) ? node.data.name : '');
                 }
             });
         }
@@ -575,7 +609,7 @@ let sectionTreeObj = {
             sheetCommonObj.cleanSheet(rationInstObj.sheet, rationInstObj.setting, -1);
             return;
         }
-        me.workBook.getActiveSheet().setActiveCell(node.serialNo(), 0);
+        me.workBook.getActiveSheet().setActiveCell(node.serialNo(), me.workBook.getActiveSheet().getActiveColumnIndex());
         me.initTools(node);
         me.refreshBtn(node);
         if(!me.isDef(node.children) || node.children.length === 0){

+ 4 - 4
web/over_write/js/chongqing_2018.js

@@ -2,9 +2,9 @@
  * Created by Zhong on 2018/8/14.
  */
 //允许使用的工料机类型:人工、普通材料、混凝土、砂浆、配合比、商品混凝土、商品砂浆、其他材料费、机械台班、机上人工、机械组成物、仪器仪表、燃料动力费、折旧费、
-// 检修费、维护费、安拆费及场外运费、校验费、其他费用、主材、企业管理费、利润、一般风险费
+// 检修费、维护费、安拆费及场外运费、校验费、其他费用、其他施工机具使用费、主材、企业管理费、利润、一般风险费
 if(allowGljType){
-    allowGljType = [1, 201, 202, 203, 204, 205, 206, 207, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 4, 6, 7, 8];
+    allowGljType = [1, 201, 202, 203, 204, 205, 206, 207, 301, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 4, 6, 7, 8];
 }
 if(allowComponent){
     //允许含有组成物的工料机类型:混凝土、砂浆、配合比、机械台班、仪器仪表、主材
@@ -12,7 +12,7 @@ if(allowComponent){
 }
 if(componentType){
     //可以作为组成物的工料机类型:普通材料、机械组成物、机上人工、燃料动力费、折旧费、检修费、维护费、安拆费及场外运费、校验费、其他费用、主材
-    componentType = [201, 302, 303, 305, 306, 307, 308, 309, 310, 311, 4];
+    componentType = [201, 303, 305, 306, 307, 308, 309, 310, 311, 4];
 }
 if(machineAllowComponent){
     //允许含有组成物的机械工料机类型:机械台班、仪器仪表
@@ -20,7 +20,7 @@ if(machineAllowComponent){
 }
 if(machineComponent){
     //可以作为机械工料机组成物的工料机类型:机械组成物、机上人工、燃料动力费、折旧费、检修费、维护费、安拆费及场外运费、校验费、其他费用
-    machineComponent = [302, 303, 305, 306, 307, 308, 309, 310, 311];
+    machineComponent = [303, 305, 306, 307, 308, 309, 310, 311];
 }
 if(materialAllowComponent){
     //允许含有组成物的材料工料机类型:混凝土、砂浆、配合比