zhongzewei 7 years ago
parent
commit
d42ee20ec5

+ 3 - 10
web/maintain/std_glj_lib/js/components.js

@@ -135,15 +135,7 @@ let componentOprObj = {
     showGljItems: function(data, type) {
         let me = componentOprObj, re = repositoryGljObj;
         if (me.workBook) {
-            let cacheSection = [];
-            let pArr = re.parentNodeIds["_pNodeId_" + type];
-            for (let i = 0; i < data.length; i++) {
-                if (pArr && pArr.indexOf(data[i].gljClass) >= 0) {
-                    cacheSection.push(data[i]);
-                } else if (type == data[i].gljClass) {
-                    cacheSection.push(data[i]);
-                }
-            }
+            let cacheSection = data;
             sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
             sheetsOprObj.showData(me.workBook.getSheet(0), me.setting, cacheSection, re.distTypeTree);
             me.workBook.getSheet(0).setRowCount(cacheSection.length);
@@ -195,6 +187,7 @@ let componentTypeTreeOprObj = {
                 me.currentCache = me.getCache();
             }
         }
-        me.showGljItems(me.showGljList, gljTypeId);
+        //me.showGljItems(me.showGljList, gljTypeId);
+        me.showGljItems(me.currentCache, gljTypeId);
     }
 }

+ 14 - 8
web/maintain/std_glj_lib/js/glj.js

@@ -194,15 +194,17 @@ let repositoryGljObj = {
     showGljItems: function(data, type) {
         let me = repositoryGljObj;
         if (me.workBook) {
-            let cacheSection = [];
-            let pArr = me.parentNodeIds["_pNodeId_" + type];
+            //let cacheSection = [];
+            let cacheSection = data;
+            /*let pArr = me.parentNodeIds["_pNodeId_" + type];
+            console.log(pArr);
             for (let i = 0; i < data.length; i++) {
                 if (pArr && pArr.indexOf(data[i].gljClass) >= 0) {
                     cacheSection.push(data[i]);
                 } else if (type == data[i].gljClass) {
                     cacheSection.push(data[i]);
                 }
-            }
+            }*/
             sheetCommonObj.cleanData(me.workBook.getSheet(0), me.setting, -1);
             sheetsOprObj.showData(me.workBook.getSheet(0), me.setting, cacheSection, me.distTypeTree);
             sheetCommonObj.setStaticCombo(me.workBook.getActiveSheet(), 0, 5, cacheSection.length, me.distTypeTree.comboDatas, false, 'text');
@@ -529,7 +531,7 @@ let repositoryGljObj = {
                 }
             }
         }
-        if(me.gljCurTypeId !== 732){
+        if(!me.parentNodeIds["_pNodeId_" + me.gljCurTypeId]){
             rObj.gljClass = me.gljCurTypeId;
         }
         if(updateArr.length >0 || addArr.length >0){
@@ -785,7 +787,9 @@ let repositoryGljObj = {
             }
         }
         pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) : 0;
-        pasteObj.gljClass = me.gljCurTypeId;
+        if(!me.parentNodeIds["_pNodeId_" + me.gljCurTypeId]){
+            pasteObj.gljClass = me.gljCurTypeId;
+        }
         return true;
     },
     canPasted: function (info) {
@@ -885,7 +889,7 @@ let repositoryGljObj = {
             }
         }
         else{
-            if(info.cellRange.colCount === me.setting.header.length - 1 && info.cellRange.col + info.cellRange.colCount - 1 >= 5){
+            if(info.cellRange.colCount === me.setting.header.length && info.cellRange.col + info.cellRange.colCount - 1 >= 5){
                 for(let i = 0; i < items.length; i++){
                     if(me.isValidObj(items[i])){
                         items[i].component = [];
@@ -989,7 +993,8 @@ let repositoryGljObj = {
                     else{
                         me.currentCache = me.getCache();
                     }
-                    me.showGljItems(me.gljList, me.gljCurTypeId);
+                    //me.showGljItems(me.gljList, me.gljCurTypeId);
+                    me.showGljItems(me.currentCache, me.gljCurTypeId);
                     //getCurrentGlj
                     let row = me.workBook.getSheet(0).getSelections()[0].row;
                     me.currentGlj = row < me.currentCache.length ? me.currentCache[row] : null;
@@ -1110,7 +1115,8 @@ let gljTypeTreeOprObj = {
             me.currentOprParent = 0;
             me.currentCache = me.getCache();
         }
-        me.showGljItems(me.gljList, gljTypeId);
+        //me.showGljItems(me.gljList, gljTypeId);
+        me.showGljItems(me.currentCache, gljTypeId);
     },
     beforeRename: function(treeId, treeNode, newName, isCancel) {
         if (newName.length == 0) {

+ 0 - 2
web/maintain/std_glj_lib/js/gljComponent.js

@@ -316,10 +316,8 @@ let gljComponentOprObj = {
         }
         else if(args.col === 4 && me.currentEditingComponent.code && args.editingText && args.editingText.trim().length > 0){//消耗量
             let consumeAmt = parseFloat(args.editingText);
-            console.log(consumeAmt);
             if(!isNaN(consumeAmt) && consumeAmt !== me.currentEditingComponent.consumeAmt){
                 let roundCons = scMathUtil.roundTo(parseFloat(consumeAmt), -3);
-                console.log(roundCons);
                 let component = that.currentGlj.component;
                 for(let i = 0; i < component.length; i++){
                     if(component[i].ID === that.currentComponent[args.row].ID){