Browse Source

表格列宽调整

MaiXinRong 5 years ago
parent
commit
8164cc4547

+ 15 - 15
app/const/spread.js

@@ -16,9 +16,9 @@ const stageDgnCols = ['deal_dgn_qty1', 'deal_dgn_qty2', 'c_dgn_qty1', 'c_dgn_qty
 const withCl = {
     ledger: {
         cols: [
-            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', cellType: 'tree'},
-            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@'},
+            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', cellType: 'tree'},
+            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@'},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
             {title: '设计数量|数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
@@ -64,9 +64,9 @@ const withCl = {
 const withoutCl = {
     ledger: {
         cols: [
-            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', cellType: 'tree'},
-            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@'},
+            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', cellType: 'tree'},
+            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@'},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
             {title: '设计数量|数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
@@ -104,9 +104,9 @@ const withoutCl = {
 const stageTz = {
     ledger: {
         cols: [
-            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', readOnly: true, cellType: 'tree'},
-            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', readOnly: true, cellType: 'tree'},
+            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@', readOnly: true},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@', readOnly: true},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', readOnly: true, cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
@@ -165,9 +165,9 @@ const stageTz = {
 const stageCl = {
     ledger: {
         cols: [
-            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', readOnly: true, cellType: 'tree'},
-            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', readOnly: true, cellType: 'tree'},
+            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@', readOnly: true},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@', readOnly: true},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', readOnly: true, cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '签约|数量', colSpan: '2|1', rowSpan: '1|1', field: 'deal_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
@@ -232,9 +232,9 @@ const stageCl = {
 const stageNoCl = {
     ledger: {
         cols: [
-            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', readOnly: true, cellType: 'tree'},
-            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', readOnly: true, cellType: 'tree'},
+            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@', readOnly: true},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@', readOnly: true},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', readOnly: true, cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '签约|数量', colSpan: '2|1', rowSpan: '1|1', field: 'deal_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},

+ 7 - 4
app/public/js/ledger.js

@@ -1509,7 +1509,7 @@ $(document).ready(function() {
                     }, {
                         cols: [
                             {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
-                            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+                            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
                             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true}
                         ],
                         treeCol: 0,
@@ -1519,6 +1519,7 @@ $(document).ready(function() {
                         defaultRowHeight: 21,
                         headerFont: '12px 微软雅黑',
                         font: '12px 微软雅黑',
+                        headColWidth: [0],
                     });
                     stdXmj.loadLib($('select', '#std-xmj').val());
                 }
@@ -1535,7 +1536,7 @@ $(document).ready(function() {
                     }, {
                         cols: [
                             {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
-                            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+                            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
                             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true}
                         ],
                         treeCol: 0,
@@ -1545,6 +1546,7 @@ $(document).ready(function() {
                         defaultRowHeight: 21,
                         headerFont: '12px 微软雅黑',
                         font: '12px 微软雅黑',
+                        headColWidth: [0],
                     });
                     stdGcl.loadLib($('select', '#std-gcl').val());
                 }
@@ -1554,7 +1556,7 @@ $(document).ready(function() {
                     dealBills = new DealBills('#deal-bills-spread', {
                         cols: [
                             {title: '清单编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-                            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+                            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
                             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true},
                             {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
                             {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
@@ -1566,6 +1568,7 @@ $(document).ready(function() {
                         defaultRowHeight: 21,
                         headerFont: '12px 微软雅黑',
                         font: '12px 微软雅黑',
+                        headColWidth: [0],
                     });
                     dealBills.loadData();
                 }
@@ -1579,7 +1582,7 @@ $(document).ready(function() {
                             cols: [
                                 {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
                                 {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 230, hAlign: 0, formatter: '@', readOnly: true},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
                                 {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
                                 {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
                                 {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},

+ 3 - 2
app/public/js/ledger_audit.js

@@ -155,7 +155,7 @@ $(document).ready(() => {
                 dealBills = new DealBills($('#deal-bills-spread')[0], {
                     cols: [
                         {title: '清单编号', field: 'code', width: 120, formatter: '@', readOnly: true},
-                        {title: '名称', field: 'name', width: 230, formatter: '@', readOnly: true},
+                        {title: '名称', field: 'name', width: 150, formatter: '@', readOnly: true},
                         {title: '单位', field: 'unit', width: 50, formatter: '@', readOnly: true},
                         {title: '单价', field: 'unit_price', width: 50, readOnly: true},
                         {title: '数量', field: 'quantity', width: 50, readOnly: true},
@@ -167,6 +167,7 @@ $(document).ready(() => {
                     defaultRowHeight: 21,
                     headerFont: '12px 微软雅黑',
                     font: '12px 微软雅黑',
+                    headColWidth: [0],
                 });
                 dealBills.loadData();
             } else if (tab.attr('content') === '#search' && !searchLedger) {
@@ -178,7 +179,7 @@ $(document).ready(() => {
                             cols: [
                                 {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
                                 {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 230, hAlign: 0, formatter: '@', readOnly: true},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
                                 {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
                                 {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
                                 {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},

+ 6 - 4
app/public/js/revise.js

@@ -1325,7 +1325,7 @@ $(document).ready(() => {
     const dealBills = new DealBills('#deal-bills-spread', {
         cols: [
             {title: '清单编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true},
             {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
             {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
@@ -1447,7 +1447,7 @@ $(document).ready(() => {
                     }, {
                         cols: [
                             {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
-                            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+                            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
                             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true}
                         ],
                         treeCol: 0,
@@ -1457,6 +1457,7 @@ $(document).ready(() => {
                         defaultRowHeight: 21,
                         headerFont: '12px 微软雅黑',
                         font: '12px 微软雅黑',
+                        headColWidth: [0],
                     });
                     stdXmj.loadLib($('select', '#std-xmj').val());
                 }
@@ -1473,7 +1474,7 @@ $(document).ready(() => {
                     }, {
                         cols: [
                             {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
-                            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+                            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
                             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true}
                         ],
                         treeCol: 0,
@@ -1483,6 +1484,7 @@ $(document).ready(() => {
                         defaultRowHeight: 21,
                         headerFont: '12px 微软雅黑',
                         font: '12px 微软雅黑',
+                        headColWidth: [0],
                     });
                     stdGcl.loadLib($('select', '#std-gcl').val());
                 }
@@ -1499,7 +1501,7 @@ $(document).ready(() => {
                             cols: [
                                 {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
                                 {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 230, hAlign: 0, formatter: '@', readOnly: true},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
                                 {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
                                 {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
                                 {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},

+ 1 - 1
app/public/js/revise_history.js

@@ -221,7 +221,7 @@ $(document).ready(() => {
                             cols: [
                                 {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
                                 {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 230, hAlign: 0, formatter: '@', readOnly: true},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
                                 {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
                                 {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
                                 {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},

+ 5 - 0
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -319,6 +319,11 @@ const SpreadJsObj = {
         this.beginMassOperation(sheet);
         setting.pos = sheet.getParent().pos;
         sheet.zh_setting = setting;
+        if (sheet.zh_setting.headColWidth) {
+            for (const [i, w] of sheet.zh_setting.headColWidth.entries()) {
+                sheet.setColumnWidth(i, w, spreadNS.SheetArea.rowHeader);
+            }
+        }
         this._initSheetDeafult(sheet);
         this._initSheetHeader(sheet);
         sheet.setRowCount(sheet.zh_setting.emptyRows);

+ 4 - 4
app/public/js/stage.js

@@ -1402,7 +1402,7 @@ $(document).ready(() => {
                 cols: [
                     {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@'},
                     {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
-                    {title: '名称', field: 'name', width: 230, hAlign: 0, formatter: '@'},
+                    {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@'},
                     {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@'},
                     {title: '单价', field: 'unit_price', hAlign: 2, width: 50},
                     {title: '数量', field: 'quantity', hAlign: 2, width: 50},
@@ -1685,11 +1685,11 @@ $(document).ready(() => {
             this.spreadSetting = {
                 cols: [
                     {title: '编号', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-                    {title: '中间计量表号', colSpan: '1', rowSpan: '1', field: 'im_code', hAlign: 0, width: 150, formatter: '@', readOnly: true},
-                    {title: '交工证书/凭证号', colSpan: '1', rowSpan: '1', field: 'doc_code', hAlign: 0, width: 180, formatter: '@'},
+                    {title: '中间计量表号', colSpan: '1', rowSpan: '1', field: 'im_code', hAlign: 0, width: 85, formatter: '@', readOnly: true},
+                    {title: '交工证书/凭证号', colSpan: '1', rowSpan: '1', field: 'doc_code', hAlign: 0, width: 110, formatter: '@'},
                     {
                         title: stage.im_type === imType.tz.value ? '本期计量金额' : '本期计量数量',
-                        colSpan: '1', rowSpan: '1', field: 'jl', hAlign: 2, width: 220, formatter: '@', readOnly: true
+                        colSpan: '1', rowSpan: '1', field: 'jl', hAlign: 2, width: 85, formatter: '@', readOnly: true
                     },
                 ],
                 headRows: 1,

+ 1 - 1
app/view/stage/index.ejs

@@ -203,7 +203,7 @@
                     <div id="search" class="tab-pane tab-select-show">
                         <div class="sjs-bar-1">
                             <div class="input-group input-group-sm pb-1">
-                                <div class="input-group-prepend">
+                                <div class="input-group-prepend" style="display: none;">
                                     <div class="input-group-text">
                                         <input type="radio" name="searchType" id="over"> 超计
                                     </div>