Browse Source

人材机焦点debug

zhongzewei 6 năm trước cách đây
mục cha
commit
43d85faa05

+ 2 - 2
web/maintain/std_glj_lib/js/components.js

@@ -213,7 +213,7 @@ let componentOprObj = {
                     $.bootstrapLoading.end();
                     //更新定额
                     if(updateBasePrc.length > 0){
-                        re.updateRationBasePrcRq(updateBasePrc);
+                        re.updateRationBasePrcRq(updateBasePrc, that.workBook);
                     }
                 } else {
                     if($('#component').is(':visible')){
@@ -258,7 +258,7 @@ let componentOprObj = {
                     re.currentGlj.basePrice = gljBasePrc;
                     re.reshowGljBasePrc(re.currentGlj);
                     updateBasePrc.push({gljId: re.currentGlj.ID, gljType: re.currentGlj.gljType, basePrice: gljBasePrc});
-                    re.updateRationBasePrcRq(updateBasePrc);
+                    re.updateRationBasePrcRq(updateBasePrc, that.workBook);
                 }
                 updateArr.push(re.currentGlj);
                 that.updateComponent(updateArr);

+ 10 - 2
web/maintain/std_glj_lib/js/glj.js

@@ -1139,7 +1139,7 @@ let repositoryGljObj = {
             me.updateRationBasePrcRq(updateBasePrcArr);
         }
     },
-    updateRationBasePrcRq: function (basePrcArr) {
+    updateRationBasePrcRq: function (basePrcArr, workBook, callback) {
         let me = this;
         me.prevent = true;
         $.bootstrapLoading.start();
@@ -1152,8 +1152,16 @@ let repositoryGljObj = {
                 if(result.error){
                     alert("计算定额基价失败");
                 }
-                me.workBook.focus(true);
+                if(workBook){
+                    workBook.focus(true);
+                }
+                else {
+                    me.workBook.focus(true);
+                }
                 me.prevent = false;
+                if(callback){
+                    callback();
+                }
                 $.bootstrapLoading.end();
             }
         });

+ 17 - 6
web/maintain/std_glj_lib/js/gljComponent.js

@@ -123,7 +123,7 @@ let gljComponentOprObj = {
                     updateArr.push(that.currentGlj);
                     me.updateComponent(updateArr);
                     if(updateBasePrc.length > 0){
-                        that.updateRationBasePrcRq(updateBasePrc);
+                        that.updateRationBasePrcRq(updateBasePrc, me.workBook);
                     }
                 }
             }
@@ -205,7 +205,7 @@ let gljComponentOprObj = {
                                 updateArr.push(that.currentGlj);
                                 me.updateComponent(updateArr);
                                 if(updateBasePrcArr.length > 0 && that.rationLibs.length > 0){
-                                    that.updateRationBasePrcRq(updateBasePrcArr);
+                                    that.updateRationBasePrcRq(updateBasePrcArr, me.workBook);
                                 }
                             }},
                             "batchClear": {name: '批量删除消耗量为0的组成物', disabled: insertDis, icon: 'fa-remove', callback: function (key, opt) {
@@ -223,6 +223,9 @@ let gljComponentOprObj = {
     },
     onCellEditStart: function(sender, args) {
         let me = gljComponentOprObj, that = repositoryGljObj;
+        if(me.isPending){
+            args.cancel = true;
+        }
         let rObj = me.getRowData(args.sheet, args.row, me.setting);
         me.currentEditingComponent = rObj;
         let thatRow = that.workBook.getSheet(0).getSelections()[0].row;
@@ -239,7 +242,6 @@ let gljComponentOprObj = {
         }
     },
     onCellEditEnd: function (sender, args) {
-        console.log('enterED');
         let me = gljComponentOprObj, that = repositoryGljObj, updateBasePrc = [];
         let gljList = that.gljList, updateArr = [];
         //if(args.editingText !== me.currentEditingComponent.code){
@@ -362,7 +364,10 @@ let gljComponentOprObj = {
         if(updateArr.length > 0){
             me.updateComponent(updateArr);
             if(updateBasePrc.length > 0){
-                that.updateRationBasePrcRq(updateBasePrc);
+                me.isPending = true;
+                that.updateRationBasePrcRq(updateBasePrc, me.workBook, function () {
+                    me.isPending = false;
+                });
             }
         }
         let focusInter = setInterval(function () {
@@ -374,11 +379,14 @@ let gljComponentOprObj = {
     },
     onClipboardPasting: function (sender, info) {
         let me = gljComponentOprObj;
+        if(me.isPending){
+            info.cancel = true
+        }
         let that = repositoryGljObj;
         let maxCol = info.cellRange.col + info.cellRange.colCount - 1;
         //复制的列数超过正确的列数,不可复制
         if(info.cellRange.col !== 0 && info.cellRange.col !== 4 || info.cellRange.colCount > 1 || (that.currentGlj.gljType === 4 && that.isComponent(that.currentGlj.ID, that.gljList))){
-            args.cancel = true;
+            info.cancel = true;
         }
     },
     onClipboardPasted: function (sender, info) {
@@ -496,7 +504,10 @@ let gljComponentOprObj = {
         if(updateArr.length > 0){
             me.updateComponent(updateArr);
             if(updateBasePrc.length > 0){
-                that.updateRationBasePrcRq(updateBasePrc);
+                me.isPending = true;
+                that.updateRationBasePrcRq(updateBasePrc, me.workBook, function () {
+                    me.isPending = false;
+                });
             }
         }
         else {