Browse Source

Merge branch 'master' of http://192.168.1.12:3000/SmartCost/ConstructionCost

TonyKang 7 years ago
parent
commit
63c3475b0f

+ 2 - 2
lib/jquery-ui/jquery-ui.css

@@ -1063,7 +1063,7 @@ a.ui-button:active,
 	width: 16px;
 	height: 16px;
 }
-.ui-icon,
+/*.ui-icon,
 .ui-widget-content .ui-icon {
 	background-image: url("images/ui-icons_444444_256x240.png");
 }
@@ -1090,7 +1090,7 @@ a.ui-button:active,
 }
 .ui-button .ui-icon {
 	background-image: url("images/ui-icons_777777_256x240.png");
-}
+}*/
 
 /* positioning */
 .ui-icon-blank { background-position: 16px 16px; }

+ 3 - 0
public/web/PerfectLoad.js

@@ -4,6 +4,9 @@
 
 jQuery.bootstrapLoading = {
     start: function (options) {
+        if($('#loadingPage').is(':visible')){
+            return;
+        }
         var defaults = {
             opacity: 0.5,
             //loading页面透明度

+ 8 - 0
web/building_saas/main/html/main.html

@@ -263,6 +263,14 @@
                                           <button id="guidanceInsertRation" class="btn btn-primary btn-sm mx-3" type="button">插入定额</button>
                                           <button id="guidanceInsertBills" class="btn btn-primary btn-sm mx-3" type="button">插入清单</button>
                                       </div>
+                                      <!--搜索结果窗体-->
+                                      <div class="side-search-box col-12 p-2" id="billsGuidanceSearchResult" style="display: none;">
+                                          <div class="d-flex justify-content-between">
+                                              <span id = 'billsGuidanceSearchResultCount'>搜索结果:5</span>
+                                              <a class="btn btn-secondary btn-sm" href="javascript:void(0);" id="nextBillsGuidance">查找下一条</a>
+                                              <a title="关闭搜索" class="btn btn-link btn-sm" href="javascript:void(0);" id="closeSearchBillsGuidance"><i class="fa fa-remove" aria-hidden="true"></i></a>
+                                          </div>
+                                      </div>
                                   </div>
                                   <div class="row" style="margin-left: 1px;">
                                       <div id="billsGuidance_bills" class="main-data-side-zb" style="width: 53%; float: left; margin: 0; padding: 0;">

+ 12 - 1
web/building_saas/main/js/models/ration.js

@@ -484,8 +484,18 @@ var Ration = {
                     }
                     newDatas.push({itemQuery: items[i].itemQuery, newData: newData, firstLibID: rationLibObj.getFirstStdRationLibID(), calQuantity: calQuantity, brUpdate: brUpdate, needInstall: needInstall})
                 }
-
+                let showLoding = true;
                 $.bootstrapLoading.start();
+                //保证由于异步的关系loading界面被隐藏,比如清单指引插入清单定额时,endUpdate中提前隐藏了loading
+                let interval =setInterval(function () {
+                    if(!$('#loadingPage').is(':visible') && showLoding){
+                        $.bootstrapLoading.start();
+                        clearInterval(interval);
+                    }
+                    else{
+                        clearInterval(interval);
+                    }
+                }, 100);
                 CommonAjax.post("/ration/addMultiRation",{newDatas: newDatas},function (rstData) {
                     let newNodes = [];
                     //更新缓存
@@ -525,6 +535,7 @@ var Ration = {
                         if(callback){
                             callback();
                         }
+                        showLoding = false;
                         $.bootstrapLoading.end();
                     });
                 })

+ 0 - 4
web/building_saas/main/js/views/character_content_view.js

@@ -877,10 +877,6 @@ let pageCCOprObj = {
 
     },
     setItemContentNode: function (node, jobs, items, name = '') {
-        console.log(`jobs`);
-        console.log(jobs);
-        console.log(`items`);
-        console.log(items);
         let theCont = contentOprObj, theCha = characterOprObj,
             jobContent, itemCharacter, contentTxt, characterTxt;
         jobContent = theCont.buildJobContent(jobs);

+ 105 - 5
web/building_saas/main/js/views/std_billsGuidance_lib.js

@@ -158,7 +158,7 @@ const billsGuidance = (function () {
         },
         headers: [
             {name: '项目指引', dataCode: 'name', width: 300, vAlign: 'center', hAlign: 'left', formatter: '@'},
-            {name: '选择', dataCode: 'name', width: 50, vAlign: 'center', hAlign: 'center', formatter: '@'},
+            {name: '选择', dataCode: 'select', width: 50, vAlign: 'center', hAlign: 'center', formatter: '@'},
         ],
         events: {
             EditStarting: function (sender, args) {
@@ -172,11 +172,29 @@ const billsGuidance = (function () {
                 }
             },
             CellDoubleClick: function (sender, args) {
-                if(guideItem.headers[args.col]['dataCode'] === 'name'){
-                    if(!bills.tree.selected){
-                        return;
+                if(!bills.tree.selected){
+                    return;
+                }
+                let node = bills.tree.selected.guidance.tree.selected;
+                if(!node){
+                    return;
+                }
+                if(node.children.length === 0){
+                    if(guideItem.headers[args.col]['dataCode'] === 'name'){
+                        insertRations(getInsertRationData([args.row]));
                     }
-                    insertRations(getInsertRationData([args.row]));
+                }
+                else {
+                    node.setExpanded(!node.expanded);
+                    renderSheetFunc(args.sheet, function () {
+                        let iCount = node.posterityCount(), i, child;
+                        for (i = 0; i < iCount; i++) {
+                            child = bills.tree.selected.guidance.tree.items[args.row + i + 1];
+                            args.sheet.setRowVisible(args.row + i + 1, child.visible, args.sheetArea);
+                        }
+                        args.sheet.invalidateLayout();
+                    });
+                    args.sheet.repaint();
                 }
             }
         }
@@ -449,6 +467,25 @@ const billsGuidance = (function () {
             });
         }
     }
+    //展开至搜索出来点的节点
+    //@param {Array}nodes @return {void}
+    function expandSearchNodes(nodes){
+        let that = this;
+        let billsSheet = bills.workBook.getActiveSheet();
+        renderSheetFunc(billsSheet, function () {
+            function expParentNode(node){
+                if(node.parent && !node.parent.expanded){
+                    node.parent.setExpanded(true);
+                    expParentNode(node.parent);
+                }
+            }
+            for(let node of nodes){
+                expParentNode(node);
+            }
+            TREE_SHEET_HELPER.refreshTreeNodeData(bills.treeSetting, billsSheet, bills.tree.roots, true);
+            TREE_SHEET_HELPER.refreshNodesVisible(bills.tree.roots, billsSheet, true);
+        });
+    }
     //各按钮监听事件
     //@return {void}
     function bindBtn(){
@@ -460,6 +497,9 @@ const billsGuidance = (function () {
         });
         //更改清单指引库
         $('#stdBillsGuidanceLibSelect').change(function () {
+            //关闭搜索窗口
+            $('#billsGuidanceSearchResult').hide();
+            billsLibObj.clearHighLight(bills.workBook);
             libInitSel($(this).select().val());
             //记住选项
             sessionStorage.setItem('stdBillsGuidance', $(this).select().val());
@@ -486,6 +526,66 @@ const billsGuidance = (function () {
                 }
             }
         });
+        //搜索
+        $('#stdBillsGuidanceSearch>span>button').click(function () {
+            let billsSheet = bills.workBook.getActiveSheet();
+            billsLibObj.clearHighLight(bills.workBook);
+            let keyword = $('#stdBillsGuidanceSearch>input').val();
+            if (!keyword || keyword === '') {
+                $('#billsGuidanceSearchResult').hide();
+                return;
+            }
+
+            let result = bills.tree.items.filter(function (item) {
+                let codeIs = item.data.code ? item.data.code.indexOf(keyword) !== -1 : false;
+                let nameIs = item.data.name ? item.data.name.indexOf(keyword) !== -1 : false;
+                return codeIs || nameIs;
+            });
+            result.sort(function (x, y) {
+                return x.serialNo() - y.serialNo();
+            });
+            if (result.length !== 0) {
+                //展开搜索出来的节点
+                expandSearchNodes(result);
+                //设置记住展开
+                sessionStorage.setItem('stdBillsGuidanceExpState', bills.tree.getExpState(bills.tree.items));
+
+                let sel = billsSheet.getSelections();
+                bills.controller.setTreeSelected(result[0]);
+                billsSheet.setSelection(result[0].serialNo(), sel[0].col, 1, 1);
+                billsInitSel(result[0].serialNo());
+
+                for (let node of result) {
+                    billsSheet.getRange(node.serialNo(), -1, 1, -1).backColor('lemonChiffon');
+                }
+
+                $('#nextBillsGuidance').show();
+                $('#nextBillsGuidance').unbind('click');
+                $('#nextBillsGuidance').bind('click', function () {
+                    let cur = bills.tree.selected, resultIndex = result.indexOf(cur), sel = billsSheet.getSelections();
+                    if (resultIndex === result.length - 1) {
+                        bills.controller.setTreeSelected(result[0]);
+                        billsSheet.setSelection(result[0].serialNo(), sel[0].col, 1, 1);
+                        billsInitSel(result[0].serialNo());
+                    } else {
+                        bills.controller.setTreeSelected(result[resultIndex + 1]);
+                        billsSheet.setSelection(result[resultIndex + 1].serialNo(), sel[0].col, 1, 1);
+                        billsInitSel(result[resultIndex + 1].serialNo());
+                    }
+                });
+            } else {
+                billsLibObj.clearHighLight(bills.workBook);
+                $('#nextBillsGuidance').hide();
+            }
+            $('#billsGuidanceSearchResultCount').text('搜索结果:' + result.length);
+            $('#billsGuidanceSearchResult').show();
+        });
+        // 关闭搜索结果
+        $('#closeSearchBillsGuidance').click(function () {
+            $('#billsGuidanceSearchResult').hide();
+            billsLibObj.clearHighLight(bills.workBook);
+            refreshWorkBook();
+        });
     }
     //刷新表
     //@return {void}