Bläddra i källkod

批量插入清单-部位明细,计量单元处复制超过已有列数时,自动完善表头

MaiXinRong 5 år sedan
förälder
incheckning
17bffd9c17
2 ändrade filer med 22 tillägg och 0 borttagningar
  1. 11 0
      app/public/js/ledger.js
  2. 11 0
      app/public/js/revise.js

+ 11 - 0
app/public/js/ledger.js

@@ -2478,6 +2478,17 @@ $(document).ready(function() {
                     }
                 }
             });
+            this.posSpread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
+                const billsCount = info.sheet.getColumnCount() - 2, qdSheet = self.qdSpread.getActiveSheet();
+                const count = qdSheet.getRowCount();
+                if (billsCount > count) {
+                    qdSheet.setRowCount(billsCount);
+                    for (let i = count + 1; i <= billsCount; i++) {
+                        qdSheet.getCell(i - 1, 0, spreadNS.SheetArea.rowHeader).text('清单' + i);
+                        info.sheet.getCell(0, i + 2 - 1, spreadNS.SheetArea.colHeader).text('清单' + i);
+                    }
+                }
+            });
             this.qdSpread.bind(spreadNS.Events.EditEnded, function (e, info) {
                 if (info.col === 0) {
                     const dealBills = self.dealSpread.getActiveSheet().zh_data;

+ 11 - 0
app/public/js/revise.js

@@ -1917,6 +1917,17 @@ $(document).ready(() => {
                     }
                 }
             });
+            this.posSpread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
+                const billsCount = info.sheet.getColumnCount() - 2, qdSheet = self.qdSpread.getActiveSheet();
+                const count = qdSheet.getRowCount();
+                if (billsCount > count) {
+                    qdSheet.setRowCount(billsCount);
+                    for (let i = count + 1; i <= billsCount; i++) {
+                        qdSheet.getCell(i - 1, 0, spreadNS.SheetArea.rowHeader).text('清单' + i);
+                        info.sheet.getCell(0, i + 2 - 1, spreadNS.SheetArea.colHeader).text('清单' + i);
+                    }
+                }
+            });
             this.qdSpread.bind(spreadNS.Events.EditEnded, function (e, info) {
                 if (info.col === 0) {
                     const dealBills = self.dealSpread.getActiveSheet().zh_data;