MaiXinRong преди 5 години
родител
ревизия
295204366d
променени са 5 файла, в които са добавени 37 реда и са изтрити 7 реда
  1. 4 1
      app/public/js/revise.js
  2. 28 5
      app/public/js/shares/merge_peg.js
  3. 1 1
      app/service/stage_pos.js
  4. 2 0
      app/view/revise/history.ejs
  5. 2 0
      app/view/revise/info.ejs

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

@@ -1307,7 +1307,7 @@ $(document).ready(() => {
     posSpreadObj.loadCurPosData();
     SpreadJsObj.resetTopAndSelect(posSheet);
     posSpread.bind(spreadNS.Events.SelectionChanged, posSpreadObj.selectionChanged);
-    if (!readOnly) {
+    if (!readOnly && isTz) {
         $('#pos-expr').bind('change mouseleave', function () {
             if (this.readOnly) return;
 
@@ -1383,6 +1383,9 @@ $(document).ready(() => {
                     },
                     callback: function (key, opt) {
                         mergePeg.show();
+                    },
+                    visible: function (key, opt) {
+                        return isTz;
                     }
                 }
             }

+ 28 - 5
app/public/js/shares/merge_peg.js

@@ -47,16 +47,14 @@ const NewMergePeg = function (setting) {
                     peg = endPeg !== '' ? endPeg : '';
                 }
                 if (withPos) {
-                    peg = _.trim(sheet.getText(row, posCol)) + peg;
+                    peg += _.trim(sheet.getText(row, posCol));
                 }
                 sheet.setText(row, pegCol, peg);
             };
             if (row) {
                 const rows = row instanceof Array ? row : [row];
-                if (row instanceof Array) {
-                    for (const r of rows) {
-                        mergeRow(r)
-                    }
+                for (const r of rows) {
+                    mergeRow(r)
                 }
             } else {
                 for (let iRow = 0, iLen = sheet.getRowCount(); iRow < iLen; iRow++) {
@@ -84,6 +82,22 @@ const NewMergePeg = function (setting) {
             }
         },
         clipboardPasted: function (e, info) {
+            for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
+                const curRow = info.cellRange.row + iRow;
+                for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
+                    const curCol = info.cellRange.col+ iCol;
+                    const text = info.sheet.getText(curRow, curCol);
+                    if (curCol === spCol || curCol === epCol) {
+                        if (text.length > 10) {
+                            info.sheet.setText(curRow, curCol, text.substring(0, 10));
+                        }
+                    } else if (curCol === posCol) {
+                        if (text.length > 50) {
+                            info.sheet.setText(curRow, curCol, text.substring(0, 50));
+                        }
+                    }
+                }
+            }
             spreadObj.mergePeg();
         },
         deletePress: function (sheet) {
@@ -101,6 +115,15 @@ const NewMergePeg = function (setting) {
             spreadObj.mergePeg(row);
         },
         editEnded: function (e, info) {
+            if (info.col === spCol || info.col === epCol) {
+                if (info.editingText.length > 10) {
+                    info.sheet.setText(info.row, info.col, info.editingText.substring(0, 10));
+                }
+            } else if (info.col === posCol) {
+                if (info.editingText.length > 50) {
+                    info.sheet.setText(info.row, info.col, info.editingText.substring(0, 50));
+                }
+            }
             spreadObj.mergePeg(info.row);
         },
         cut: function (sheet, sel, callback) {

+ 1 - 1
app/service/stage_pos.js

@@ -161,7 +161,7 @@ module.exports = app => {
                     }
                     // 在主表pos中新增数据
                     const p = {
-                        id: this.uuid.v4(), tid: this.ctx.tender.id, lid: d.lid, name: d.name, porder: d.porder,
+                        id: this.uuid.v4(), tid: this.ctx.tender.id, lid: d.lid, name: d.name, porder: d.porder, position: d.position,
                         add_stage: this.ctx.stage.id,
                         add_times: this.ctx.stage.curTimes,
                         add_user: this.ctx.session.sessionUser.accountId,

+ 2 - 0
app/view/revise/history.ejs

@@ -39,6 +39,7 @@
                 <!--0号台帐模式-->
                 <div class="sjs-height-1" style="overflow: hidden" id="bills-spread">
                 </div>
+                <% if (ctx.tender.data.measure_type === measureType.tz.value) { %>
                 <div class="bcontent-wrap">
                     <div id="revise-resize" class="resize-y" id="top-spr" r-Type="height" div1=".sjs-height-1" div2=".bcontent-wrap" title="调整大小"><!--调整上下高度条--></div>
                     <div class="bc-bar mb-1">
@@ -53,6 +54,7 @@
                     <div class="sp-wrap" id="pos-spread">
                     </div>
                 </div>
+                <% } %>
             </div>
             <!--右栏-->
             <div class="c-body" id="right-view" style="display: none; width: 33%;">

+ 2 - 0
app/view/revise/info.ejs

@@ -75,6 +75,7 @@
                 <!--0号台帐模式-->
                 <div class="sjs-height-1" style="overflow: hidden" id="bills-spread">
                 </div>
+                <% if (ctx.tender.data.measure_type === measureType.tz.value) { %>
                 <div class="bcontent-wrap">
                     <div id="revise-resize" class="resize-y" id="top-spr" r-Type="height" div1=".sjs-height-1" div2=".bcontent-wrap" title="调整大小"><!--调整上下高度条--></div>
                     <div class="bc-bar mb-1">
@@ -99,6 +100,7 @@
                     <div class="sp-wrap" id="pos-spread">
                     </div>
                 </div>
+                <% } %>
             </div>
             <!--右栏-->
             <div class="c-body" id="right-view" style="display: none; width: 33%;">