Browse Source

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/ConstructionOperation

TonyKang 7 years ago
parent
commit
61289b2d95

+ 3 - 2
web/maintain/ration_repository/dinge.html

@@ -115,7 +115,8 @@
                                 <!--  <div class="m-2"><a href="javacript:void(0);" data-toggle="modal" data-target="#editTsm" title="编辑">编辑说明</a></div>-->
                                   <div class="main-content m-2">
                                       <h5>说明</h5>
-                                      <textarea id="explanationShow" class="form-control" rows="35" style="background: white;"></textarea>
+                                      <!--<textarea id="explanationShow" class="form-control" rows="35" style="background: white;"></textarea>-->
+                                      <textarea id="explanationShow" class="form-control" style="background: white;"></textarea>
                                   </div>
                               </div>
                           </div>
@@ -125,7 +126,7 @@
                          <!--         <div class="m-2"><a href="javacript:void(0);" data-toggle="modal" data-target="#editTjs" title="编辑">编辑计算规则</a></div>-->
                                   <div class="main-content m-2">
                                       <h5>计算规则</h5>
-                                      <textarea id="ruleTextShow" class="form-control"   rows="35" style="background: white;"></textarea>
+                                      <textarea id="ruleTextShow" class="form-control" style="background: white;"></textarea>
                                   </div>
                               </div>
                           </div>

+ 4 - 0
web/maintain/ration_repository/js/global.js

@@ -21,6 +21,10 @@ function autoFlashHeight(){
     $('#partialBody').find('tr').find('td:eq(0)').width(partialWidth * 0.06);
     $('#partialBody').find('tr').find('td:eq(1)').width(partialWidth * 0.3);
     $('#partialBody').find('tr').find('td:eq(2)').width(partialWidth * 0.64);
+    //说明
+    $('#explanationShow').height($(window).height()-headerHeight-toolsBar-100);
+    //计算规则
+    $('#ruleTextShow').height($(window).height()-headerHeight-toolsBar-100);
 };
 $(window).resize(autoFlashHeight);
 /*全局自适应高度结束*/

+ 33 - 18
web/maintain/ration_repository/js/installation.js

@@ -110,9 +110,9 @@ let feeItemObj = {
     deleteType: 'feeItem',
     setting: {
         header:[
-            {headerName:"费用项",headerWidth:300,dataCode:"feeItem", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"},
-            {headerName:"费用类型",headerWidth:150,dataCode:"feeType", dataType: "String", hAlign: "center", vAlign: "center"},
-            {headerName:"记取位置",headerWidth:150,dataCode:"position", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"}
+            {headerName:"费用项",headerWidth:200,dataCode:"feeItem", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"},
+            {headerName:"费用类型",headerWidth:80,dataCode:"feeType", dataType: "String", hAlign: "center", vAlign: "center"},
+            {headerName:"记取位置",headerWidth:100,dataCode:"position", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"}
         ],
         view: {lockColumns: []},
         comboItems: {feeType: ['子目费用', '分项费用', '措施费用']},
@@ -376,7 +376,7 @@ let sectionObj = {
     deleteType: 'section',
     setting: {
         header:[
-            {headerName:"分册章节",headerWidth:600,dataCode:"name", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"}
+            {headerName:"分册章节",headerWidth:330,dataCode:"name", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"}
         ],
         view: {lockColumns: []},
         options: {
@@ -607,13 +607,13 @@ let feeRuleObj = {
     base: {RCJ: '分别按人材机乘系数', RG: '人工', CL: '材料', JX: '机械'},
     setting: {
         header:[
-            {headerName:"编码",headerWidth:120,dataCode:"code", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"},
-            {headerName:"费用规则",headerWidth:400,dataCode:"rule", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"},
-            {headerName:"基数",headerWidth:160,dataCode:"base", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"},
-            {headerName:"费率(%)",headerWidth:120,dataCode:"feeRate", dataType: "String", formatter: "@", hAlign: "center", vAlign: "center"},
-            {headerName:"其中人工(%)",headerWidth:120,dataCode:"labour", dataType: "String", formatter: "@", hAlign: "center", vAlign: "center"},
-            {headerName:"其中材料(%)",headerWidth:120,dataCode:"material", dataType: "String", formatter: "@", hAlign: "center", vAlign: "center"},
-            {headerName:"其中机械(%)",headerWidth:120,dataCode:"machine", dataType: "String", formatter: "@", hAlign: "center", vAlign: "center"}
+            {headerName:"编码",headerWidth:80,dataCode:"code", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center", span:{row: 0, rowCount: 2, colCount: 1}},
+            {headerName:"费用规则",headerWidth:280,dataCode:"rule", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center", span:{row: 0, rowCount: 2, colCount: 1}},
+            {headerName:"基数",headerWidth:140,dataCode:"base", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center", span:{row: 0, rowCount: 2, colCount: 1}},
+            {headerName:"费率(%)",headerWidth:70,dataCode:"feeRate", dataType: "String", formatter: "@", hAlign: "center", vAlign: "center", span:{row: 0, rowCount: 2, colCount: 1}},
+            {headerName:"人工(%)",headerWidth:70,dataCode:"labour", dataType: "String", formatter: "@", hAlign: "center", vAlign: "center", span:{row: 1, rowCount: 1, colCount: 1}},
+            {headerName:"材料(%)",headerWidth:70,dataCode:"material", dataType: "String", formatter: "@", hAlign: "center", vAlign: "center", span:{row: 1, rowCount: 1, colCount: 1}},
+            {headerName:"机械(%)",headerWidth:70,dataCode:"machine", dataType: "String", formatter: "@", hAlign: "center", vAlign: "center", span:{row: 1, rowCount: 1, colCount: 1}}
         ],
         view: {lockColumns: []},
         comboItems: {base: ['分别按人材机乘系数', '人工', '材料', '机械']},
@@ -635,20 +635,35 @@ let feeRuleObj = {
             workbook.options[opt] = opts[opt];
         }
     },
-    renderFunc: function (sheet, func) {
-        sheet.suspendPaint();
-        sheet.suspendEvent();
-        if(this.isFunc(func)){
-            func();
+    buildHeader: function () {
+        if(!this.sheet){
+            return;
         }
-        sheet.resumePaint();
-        sheet.resumeEvent();
+        this.sheet.suspendPaint();
+        this.sheet.suspendEvent();
+        let ch = GC.Spread.Sheets.SheetArea.colHeader;
+        this.sheet.setRowCount(2, ch);
+        for(let i = 0; i < this.setting.header.length; i++){
+            let header = this.setting.header[i];
+            this.sheet.addSpan(header.span.row, i, header.span.rowCount, header.span.colCount, ch);
+            this.sheet.setValue(header.span.row, i, header.headerName, ch);
+            if(header.dataCode === 'feeRate'){
+                this.sheet.addSpan(header.span.row, i + 1, 1, 3, ch);
+                this.sheet.setValue(header.span.row, i + 1, '其中', ch);
+            }
+        }
+        this.sheet.resumePaint();
+        this.sheet.resumeEvent();
     },
     buildSheet: function () {
         let fi = feeItemObj;
         if(!this.isDef(this.workBook)){
             this.workBook = sheetCommonObj.buildSheet($('#instFeeRuleSpread')[0], this.setting, 10);
             this.sheet = this.workBook.getActiveSheet();
+            this.buildHeader();
+            this.sheet.setRowCount();
+
+
             sheetCommonObj.bindEscKey(this.workBook, [{sheet: this.sheet, editStarting: this.onEditStarting, editEnded: this.onEditEnded}])
             this.setOptions(this.workBook, this.setting.options);
             this.sheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values;

+ 6 - 6
web/maintain/ration_repository/js/repository_glj.js

@@ -41,12 +41,12 @@ repositoryGljObj = {
     distTypeTree: null,//add
     setting: {
         header:[
-            {headerName:"编码",headerWidth:120,dataCode:"code", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"},
-            {headerName:"名称",headerWidth:260,dataCode:"name", dataType: "String", hAlign: "left", vAlign: "center"},
-            {headerName:"规格型号",headerWidth:260,dataCode:"specs", dataType: "String", hAlign: "left", vAlign: "center"},
-            {headerName:"单位",headerWidth:120,dataCode:"unit", dataType: "String", hAlign: "center", vAlign: "center"},
-            {headerName:"定额价",headerWidth:120,dataCode:"basePrice", dataType: "Number", formatter: "0.00", hAlign: "right", vAlign: "center"},
-            {headerName:"类型",headerWidth:120,dataCode:"gljType", dataType: "String", hAlign: "center", vAlign: "center"}
+            {headerName:"编码",headerWidth:90,dataCode:"code", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"},
+            {headerName:"名称",headerWidth:200,dataCode:"name", dataType: "String", hAlign: "left", vAlign: "center"},
+            {headerName:"规格型号",headerWidth:110,dataCode:"specs", dataType: "String", hAlign: "left", vAlign: "center"},
+            {headerName:"单位",headerWidth:60,dataCode:"unit", dataType: "String", hAlign: "center", vAlign: "center"},
+            {headerName:"定额价",headerWidth:80,dataCode:"basePrice", dataType: "Number", formatter: "0.00", hAlign: "right", vAlign: "center"},
+            {headerName:"类型",headerWidth:90,dataCode:"gljType", dataType: "String", hAlign: "center", vAlign: "center"}
         ],
         view:{
             comboBox:[