zhongzewei 6 年之前
父節點
當前提交
d07fbc87e3

+ 1 - 0
web/maintain/billsGuidance_lib/html/zhiyin.html

@@ -44,6 +44,7 @@
                         <a id="downLevel" href="javascript:void(0);" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title=""><i class="fa fa-arrow-right" aria-hidden="true"></i> 降级</a>
                         <a id="downMove" href="javascript:void(0);" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""><i class="fa fa-arrow-down" aria-hidden="true"></i> 下移</a>
                         <a id="upMove" href="javascript:void(0);" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""><i class="fa fa-arrow-up" aria-hidden="true"></i> 上移</a>
+                        <!--<a id="expandContract" href="javascript:void(0);" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""><i class="fa fa-minus-square-o" aria-hidden="true"></i> 收起定额</a>-->
                       </div>
                     </div>
                       <div class="main-top-content">

+ 18 - 0
web/maintain/billsGuidance_lib/js/billsGuidance.js

@@ -90,6 +90,13 @@ const billsGuidance = (function () {
         update: 'update',
         del: 'delete'
     };
+    //项目指引节点状态:展开全部、收起定额
+    const itemExpandState = {
+        expand: 1,
+        contract: 0
+    };
+    //项目指引当前节点展开收缩状态,默认展开全部
+    let curExpandState = 1;
     const guideItem = {
         dom: $('#guideItemSpread'),
         workBook: null,
@@ -343,7 +350,18 @@ const billsGuidance = (function () {
             guideItemInitSel(guideSheet.getActiveRowIndex() ? guideSheet.getActiveRowIndex() : 0);
         }
     }
+    //设置项目节点展开收起状态:展开全部、收起定额
+    //@param {Array}nodes(当前清单下的所有项目指引节点) {Number}expandState(展开全部1或收起定额0)
+    function setNodesExpandState(nodes, expandState) {
+        if(expandState === itemExpandState.contract) {
+            //找出所有定额节点的父节点
+            let rationParents = [];
+        } else {
+
+        }
+    }
     //根据奇偶层级设置节点底色,奇数层为蓝色(树节点深度为偶数)
+    //@param {Object}sheet {Array}nodes @return {void}
     function setNodesColor(sheet, nodes) {
         const color = '#DFE8F9';
         renderSheetFunc(sheet, function () {

+ 7 - 22
web/maintain/ration_repository/js/ration.js

@@ -71,27 +71,6 @@ let rationOprObj = {
             let row = info.newSelections[0].row;
             let me = rationOprObj;
             me.rationSelInit(row);
-          /*  sheetCommonObj.cleanSheet(sheetGLJ, settingGLJ, -1);
-            sheetCommonObj.cleanSheet(sheetCoe, settingCoe, -1);
-            sheetCommonObj.cleanSheet(sheetAss, settingAss, -1);
-            sheetCommonObj.cleanSheet(sheetInst, settingInst, -1);
-            let cacheSection = me.getCache();
-            if (cacheSection && row < cacheSection.length) {
-                rationGLJOprObj.getGljItems(cacheSection[row], function () {
-                    me.workBook.focus(true);
-                });
-                rationCoeOprObj.getCoeItems(cacheSection[row], function () {
-                    me.workBook.focus(true);
-                });
-                rationAssistOprObj.getAssItems(cacheSection[row]);
-                rationInstObj.getInstItems(cacheSection[row], function () {
-                    me.workBook.focus(true);
-                });
-            }
-            else {
-                rationGLJOprObj.currentRationItem = null;
-            }
-            me.workBook.focus(true);*/
         }
     },
     rationSelInit: function (row) {
@@ -636,7 +615,7 @@ let rationOprObj = {
             }
         });
     },
-    getRationItems: function(sectionID){
+    getRationItems: function(sectionID, callback = null){
         if (sectionID != -1) {
             let me = rationOprObj;
             me.mixUpdate = 0;
@@ -649,6 +628,9 @@ let rationOprObj = {
                 annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
                 me.showRationItems(sectionID);
                 sectionTreeObj.removeBtn.removeClass('disabled');
+                if(callback){
+                    callback();
+                }
             } else {
                 $.ajax({
                     type:"POST",
@@ -669,6 +651,9 @@ let rationOprObj = {
                             me.showRationItems(sectionID);
                         }
                         sectionTreeObj.removeBtn.removeClass('disabled');
+                        if(callback) {
+                            callback();
+                        }
                     },
                     error:function(err){
                         sectionTreeObj.removeBtn.removeClass('disabled');

+ 8 - 5
web/maintain/ration_repository/js/section_tree.js

@@ -631,7 +631,10 @@ let sectionTreeObj = {
             me.removeBtn.addClass('disabled');
             rationOprObj.canRations = true;
             rationOprObj.workBook.getSheet(0).clearSelection();
-            rationOprObj.getRationItems(node.data.ID);
+            rationOprObj.getRationItems(node.data.ID, function () {
+                rationOprObj.workBook.getActiveSheet().setActiveCell(0, 0);
+                rationOprObj.rationSelInit(0);
+            });
             rationOprObj.setCombo(rationOprObj.workBook.getSheet(0), 'dynamic');
         }
         else {
@@ -645,11 +648,11 @@ let sectionTreeObj = {
             annotationOprObj.hideTable($('#fzTableAll'), $('#fzTablePartial'));
             sheetCommonObj.cleanSheet(rationOprObj.workBook.getSheet(0), rationOprObj.setting, -1);
             rationGLJOprObj.sheet.getParent().focus(false);
+            sheetCommonObj.cleanSheet(rationGLJOprObj.sheet, rationGLJOprObj.setting, -1);
+            sheetCommonObj.cleanSheet(rationAssistOprObj.sheet, rationAssistOprObj.setting, -1);
+            sheetCommonObj.cleanSheet(rationCoeOprObj.sheet, rationCoeOprObj.setting, -1);
+            sheetCommonObj.cleanSheet(rationInstObj.sheet, rationInstObj.setting, -1);
         }
-        sheetCommonObj.cleanSheet(rationGLJOprObj.sheet, rationGLJOprObj.setting, -1);
-        sheetCommonObj.cleanSheet(rationAssistOprObj.sheet, rationAssistOprObj.setting, -1);
-        sheetCommonObj.cleanSheet(rationCoeOprObj.sheet, rationCoeOprObj.setting, -1);
-        sheetCommonObj.cleanSheet(rationInstObj.sheet, rationInstObj.setting, -1);
         me.workBook.focus(true);
     }
 };

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

@@ -442,7 +442,7 @@ let repositoryGljObj = {
         return false;
     },
 
-    getCurrentComponent: function (gljComponent) {
+    getCurrentComponent: function (gljComponent, sort = false) {
         let me = repositoryGljObj, rst = [];
         for(let i = 0; i < gljComponent.length; i++){
             let obj = {};
@@ -461,12 +461,14 @@ let repositoryGljObj = {
                 }
             }
         }
-        rst.sort(function (a, b) {
-            let r = 0;
-            if(a.code > b.code) r = 1;
-            else if(a.code < b.code) r = -1;
-            return r;
-        });
+        if(sort){
+            rst.sort(function (a, b) {
+                let r = 0;
+                if(a.code > b.code) r = 1;
+                else if(a.code < b.code) r = -1;
+                return r;
+            });
+        }
         return rst;
     },
     //获得引用了组成物id为componentId的工料机,和重新变化组成物数组、重新计算单价
@@ -550,9 +552,8 @@ let repositoryGljObj = {
             if(allowComponent.includes(me.currentCache[row].gljType)){
                 //展示数据
                 if(me.currentGlj.component.length > 0){
-                    me.currentComponent = me.getCurrentComponent(me.currentGlj.component);
+                    me.currentComponent = me.getCurrentComponent(me.currentGlj.component, true);
                     if(me.currentComponent.length > 0){
-                        console.log(me.currentComponent);
                         sheetsOprObj.showData(that, that.workBook.getSheet(0), that.setting, me.currentComponent);
                     }
                 }