Browse Source

定额库批量粘贴问题

zhongzewei 6 years ago
parent
commit
a61da25aef
1 changed files with 11 additions and 6 deletions
  1. 11 6
      web/maintain/ration_repository/js/ration.js

+ 11 - 6
web/maintain/ration_repository/js/ration.js

@@ -512,16 +512,21 @@ let rationOprObj = {
         }
         }
     },
     },
     canPasted: function (beginCol, maxCol) {
     canPasted: function (beginCol, maxCol) {
-        let rst = false;
-        if(maxCol < 3 || beginCol > 6){
-            rst = true;
-        }
-        return rst;
+        let me = rationOprObj;
+        // 粘贴的列不可包含不可编辑的“基价”列
+        // 粘贴的最大列不可超出表格的最大列
+        if (me.canRations &&
+            (maxCol < 3 ||
+            (beginCol > 3 && maxCol <= me.setting.header.length - 1))
+        ) {
+            return true;
+        }
+        return false;
     },
     },
     onClipboardPasting: function(sender, args) {
     onClipboardPasting: function(sender, args) {
         let me = rationOprObj;
         let me = rationOprObj;
         let maxCol = args.cellRange.col + args.cellRange.colCount -1;
         let maxCol = args.cellRange.col + args.cellRange.colCount -1;
-        if(!me.canRations || !me.canPasted(args.cellRange.col, maxCol) || maxCol > me.setting.header.length - 1){
+        if (!me.canPasted(args.cellRange.col, maxCol)) {
             args.cancel = true;
             args.cancel = true;
         }
         }
     },
     },