Browse Source

Merge branch '1.0.0_online' of http://192.168.1.12:3000/SmartCost/ConstructionCost into 1.0.0_online

TonyKang 6 năm trước cách đây
mục cha
commit
35775f8711

+ 28 - 5
modules/complementary_ration_lib/models/compleRationModel.js

@@ -163,17 +163,39 @@ class CompleRatoinDao {
             });
             for(let ration of rations){
                 let hintsArr = [];
+                let stdGljIds = [],
+                    comGljIds = [],
+                    stdGljs = [],
+                    comGljs = [];
+                let gljAmtMapping = {};
                 for(let rationGlj of ration.rationGljList){
-                    let glj;
+                    gljAmtMapping[rationGlj.gljId] = rationGlj.consumeAmt;
                     if(!isDef(rationGlj.type) || rationGlj.type === 'std'){
-                         glj = await stdGljModel.findOne({ID: rationGlj.gljId});
+                        stdGljIds.push(rationGlj.gljId);
                     }
                     else {
-                         glj = await complementaryGljModel.findOne({uesrId: userId, ID: rationGlj.gljId});
+                        comGljIds.push(rationGlj.gljId);
                     }
-                    if(isDef(glj)){
-                        hintsArr.push(` ${glj.code} ${glj.name}${glj.specs ? '   ' + glj.specs : ''} &nbsp ${glj.unit}   ${rationGlj.consumeAmt}`);
+                }
+                if(stdGljIds.length > 0) {
+                    stdGljs = await stdGljModel.find({ID: {$in: stdGljIds}});
+                }
+                if(comGljIds.length > 0) {
+                    comGljs = await complementaryGljModel.find({userId: userId, ID: {$in: comGljIds}});
+                }
+                let gljDatas = stdGljs.concat(comGljs);
+                gljDatas.sort(function (a, b) {
+                    let aV = a.gljType + a.code,
+                        bV = b.gljType + b.code;
+                    if(aV > bV) {
+                        return 1;
+                    } else if (aV < bV) {
+                        return -1;
                     }
+                    return 0;
+                });
+                for(let glj of gljDatas){
+                    hintsArr.push(` ${glj.code} ${glj.name}${glj.specs ? '&nbsp;&nbsp;&nbsp;' + glj.specs : ''}&nbsp;&nbsp&nbsp;${glj.unit}&nbsp;&nbsp;&nbsp;${gljAmtMapping[glj.ID]}`)
                 }
                 hintsArr.push(`基价 元 ${ration.basePrice}`);
                 if(ration.jobContent && ration.jobContent.toString().trim() !== ''){
@@ -190,6 +212,7 @@ class CompleRatoinDao {
             callback(0, rations);
         }
         catch(err){
+            console.log(err);
             callback(err, null);
         }
     }

+ 16 - 1
modules/complementary_ration_lib/models/searchModel.js

@@ -95,7 +95,7 @@ class SearchDao{
             comGljIds = Array.from(new Set(comGljIds));
             let gljIDMapping = {};
             if(stdGljIds.length > 0){
-                let stdGljs = await stdGljModel.find({ID: {$in: stdGljIds}}, '-_id ID code name specs unit');
+                let stdGljs = await stdGljModel.find({ID: {$in: stdGljIds}}, '-_id ID code name specs unit gljType');
                 for(let stdGlj of stdGljs){
                     gljIDMapping[stdGlj.ID] = stdGlj;
                 }
@@ -108,6 +108,21 @@ class SearchDao{
             }
             for(let ration of stdRations){
                 let hintsArr = [];
+                //对人材机进行排序
+                ration.rationGljList.sort(function (a, b) {
+                    let gljA = gljIDMapping[a.gljId],
+                        gljB = gljIDMapping[b.gljId];
+                    if(gljA && gljB){
+                        let aV = gljA.gljType + gljA.code,
+                            bV = gljB.gljType + gljB.code;
+                        if(aV > bV) {
+                            return 1;
+                        } else if(aV < bV) {
+                            return -1;
+                        }
+                    }
+                    return 0;
+                });
                 for(let rationGlj of ration.rationGljList){
                     let glj = gljIDMapping[rationGlj.gljId];
                     if(glj){

+ 92 - 0
public/web/tree_sheet/tree_sheet_helper.js

@@ -306,7 +306,11 @@ var TREE_SHEET_HELPER = {
         let levelIndent = -5;
         let halfBoxLength = 5;
         let halfExpandLength = 3;
+    
         let isRationNode = sheet.name()=="mainSheet" && initNode.sourceType == ModuleNames.ration&&initNode.data.type == rationType.ration;
+        let questionImg = document.getElementById('question_pic'),
+            questionImgWidth = 16,
+            questionImgHeight = 16;
 
         let TreeNodeCellType = function () {
             this.clickDropDown = false; //如果是点击下拉框的三角形的时候,默认展开下拉框
@@ -421,6 +425,12 @@ var TREE_SHEET_HELPER = {
             if (isRationNode&& options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex()) {
                 sheetCommonObj.drowTriangle(ctx,x+w-12,y+h/2+2);
             }
+            //定额库章节树问号
+            if(sheet.name() === 'stdRationLib_chapter' && this.enterCell && options.row === this.enterCell.row ){
+                let centerX = Math.floor(x) + w - 20;
+                let centerY = Math.floor((y + (y + h)) / 2);
+                ctx.drawImage(questionImg, centerX + 3, centerY - 7, questionImgWidth,questionImgHeight);
+            }
 
         };
         TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
@@ -435,6 +445,12 @@ var TREE_SHEET_HELPER = {
             };
         };
         TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
+            //点击问号符,弹出说明、工程量计算规则窗口
+            if(hitinfo.sheet.name() === 'stdRationLib_chapter') {
+                if(hitinfo.x < hitinfo.cellRect.x + hitinfo.cellRect.width && hitinfo.x > hitinfo.cellRect.x + hitinfo.cellRect.width - questionImgWidth) {
+                    rationLibObj.initQuestionModal(hitinfo.row);
+                }
+            }
             let offset = -1;
             let node = tree.items[hitinfo.row];
             tree.selected = node;
@@ -476,6 +492,15 @@ var TREE_SHEET_HELPER = {
         TreeNodeCellType.prototype.processMouseEnter = function(hitinfo){
             if(hitinfo.sheet.name() === 'stdBillsGuidance_bills'){
                 TREE_SHEET_HELPER.delayShowTips(hitinfo,setting);
+            } else if(hitinfo.sheet.name() === 'stdRationLib_chapter'){
+                if(this.enterCell==null){
+                    this.enterCell={
+                        row:hitinfo.row,
+                        col:hitinfo.col
+                    };
+                    hitinfo.sheet.invalidateLayout();
+                    hitinfo.sheet.repaint();
+                }
             }
         };
         TreeNodeCellType.prototype.processMouseMove = function(hitinfo){//造价书主界面,当鼠标移动到单元格最右往左50个像素内时才显示悬浮提示内容
@@ -490,6 +515,11 @@ var TREE_SHEET_HELPER = {
         };
         TreeNodeCellType.prototype.processMouseLeave = function (hitinfo) {
             TREE_SHEET_HELPER.hideTipsDiv();
+            if(hitinfo.sheet.name() === 'stdRationLib_chapter') {
+                this.enterCell = null;
+                hitinfo.sheet.invalidateLayout();
+                hitinfo.sheet.repaint();
+            }
         };
 
         if(isRationNode){
@@ -661,5 +691,67 @@ var TREE_SHEET_HELPER = {
                 }
             }
         },delayTimes);
+    },
+    getQuestionCellType: function (mouseDownCallback = null) {
+        let img = document.getElementById('question_pic'),
+            imgWidth = 16,
+            imgHeight = 16;
+        let QuestionCellType = function () {};
+        QuestionCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
+        QuestionCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
+            if (style.backColor) {
+                ctx.save();
+                ctx.fillStyle = style.backColor;
+                ctx.fillRect(x, y, w, h);
+                ctx.restore();
+            } else {
+                ctx.clearRect(x, y, w, h);
+            }
+            GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
+            if(this.editingCell){
+                let centerX = Math.floor(x) + w - 20;
+                let centerY = Math.floor((y + (y + h)) / 2);
+                ctx.drawImage(img, centerX + 3, centerY - 7, imgWidth,imgHeight);
+            }
+        };
+        QuestionCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
+            return {
+                x: x,
+                y: y,
+                row: context.row,
+                col: context.col,
+                cellStyle: cellStyle,
+                cellRect: cellRect,
+                sheetArea: context.sheetArea
+            };
+        };
+        QuestionCellType.prototype.processMouseDown = function (hitinfo) {
+            //弹出说明等窗口
+            if(this.editingCell && this.editingCell.row === hitinfo.row){
+                let offSet = hitinfo.cellRect.x + hitinfo.cellRect.width;
+                if(hitinfo.x < offSet && hitinfo.x > offSet - imgWidth){
+                    if(mouseDownCallback) {
+                        mouseDownCallback(hitinfo.row);
+                    }
+                    //$('#rationQuestionModal').modal('show');
+                }
+            }
+        };
+        QuestionCellType.prototype.processMouseEnter = function (hitinfo){
+            if(this.editingCell==null){
+                this.editingCell={
+                    row:hitinfo.row,
+                    col:hitinfo.col
+                };
+                hitinfo.sheet.invalidateLayout();
+                hitinfo.sheet.repaint();
+            }
+        };
+        QuestionCellType.prototype.processMouseLeave = function (hitinfo) {
+            this.editingCell=null;
+            hitinfo.sheet.invalidateLayout();
+            hitinfo.sheet.repaint();
+        };
+        return new QuestionCellType();
     }
 };

+ 14 - 7
web/building_saas/complementary_glj_lib/html/tools-gongliaoji.html

@@ -16,6 +16,10 @@
     <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.sc.css" type="text/css">
     <!--endinject-->
     <style type="text/css">
+        .ztree * {
+            font-family: Calibri;
+            font-size: 0.9rem;
+        }
         .modal-lg{max-width: 1000px}
     </style>
 </head>
@@ -54,8 +58,11 @@
                         <span aria-hidden="true">&times;</span>
                     </button>
                 </div>
-                <div class="modal-body">
-                        <div style="width: 33%; float: left;">
+                <div class="modal-body" style="padding-left: 0; padding-right: 3px; margin-left: 0;">
+                        <div style="width: 36%; float: left;">
+                            <input type="radio" class="glj-radio" name="glj" value="allGljs">所有&nbsp;&nbsp;
+                            <input type="radio" class="glj-radio" name="glj" value="stdGljs">标准&nbsp;&nbsp;
+                            <input type="radio" class="glj-radio" name="glj" value="complementaryGljs">补充&nbsp;&nbsp;
                             <div  class="modal-auto-height" id="componentTreeDiv" style="overflow: hidden">
                                 <!--<div class="print-list">-->
                                 <div style="width: 100%; height: 100%; overflow: auto">
@@ -64,14 +71,14 @@
                                 <!--</div>-->
                             </div>
                         </div>
-                        <div style="width: 67%; padding-left: 8px; float: left;">
+                        <div style="width: 64%; padding-left: 3px; float: left;">
                             <div class="row">
                                 <div class="col-12" id="gljRadios">
                                     <div class="row">
                                         <div class="col-7" style="margin-top: 5px;">
-                                            <input type="radio" class="glj-radio" name="glj" value="allGljs">所有&nbsp;&nbsp;
+                           <!--                 <input type="radio" class="glj-radio" name="glj" value="allGljs">所有&nbsp;&nbsp;
                                             <input type="radio" class="glj-radio" name="glj" value="stdGljs">标准&nbsp;&nbsp;
-                                            <input type="radio" class="glj-radio" name="glj" value="complementaryGljs">补充&nbsp;&nbsp;
+                                            <input type="radio" class="glj-radio" name="glj" value="complementaryGljs">补充&nbsp;&nbsp;-->
                                         </div>
                                         <div class="input-group col-5" style="margin-bottom: 5px;">
                                             <input type="text" class="form-control form-control-sm" placeholder="请输入筛选编码或名称" value="" id="gljSearchKeyword">
@@ -241,7 +248,7 @@
             //解决spreadjs sheet初始化没高度宽度
             $('#modalCon').width($(window).width()*0.5);
             $('#componentTreeDiv').height($(window).height() - 300);
-            $("#componentSheet").height($("#componentTreeDiv").height()-21.6);
+            $("#componentSheet").height($("#componentTreeDiv").height() - 15);
             $("#componentSheet").width($('#modalCon').width() * 0.63);
             pageOprObj.initPage($("#GLJListSheet")[0], $('#gljComponentSheet')[0], $("#componentSheet")[0]);
         });
@@ -249,7 +256,7 @@
         $(window).resize(function () {
             $('#modalCon').width($(window).width()*0.5);
             $('#componentTreeDiv').height($(window).height() - 300);
-            $("#componentSheet").height($("#componentTreeDiv").height()-21.6);
+            $("#componentSheet").height($("#componentTreeDiv").height()-15);
             $("#componentSheet").width($('#modalCon').width()* 0.63);
         });
   	</SCRIPT>

+ 7 - 3
web/building_saas/complementary_ration_lib/html/dinge.html

@@ -16,6 +16,10 @@
     <link rel="stylesheet" href="/lib/jquery-contextmenu/jquery.contextMenu.css" type="text/css">
     <!--endinject-->
     <style type="text/css">
+        .ztree * {
+            font-family: Calibri;
+            font-size: 0.9rem;
+        }
         .nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active{
             border: 2px solid #ff6501;
             color: #495057;
@@ -468,8 +472,8 @@
                     <span aria-hidden="true">&times;</span>
                 </button>
             </div>
-            <div class="modal-body">
-                <div style="width: 33%; float: left;">
+            <div class="modal-body" style="padding-left: 0; padding-right: 3px; margin-left: 0;">
+                <div style="width: 36%; float: left;">
                     <div  class="modal-auto-height" id="gljSelTreeDiv" style="overflow: hidden">
                         <!--<div class="print-list">-->
                         <div style="width: 100%; height: 100%; overflow: auto">
@@ -478,7 +482,7 @@
                         <!--</div>-->
                     </div>
                 </div>
-                <div style="width: 67%; padding-left: 8px; float: left;">
+                <div style="width: 64%; padding-left: 3px; float: left;">
                     <div class="row">
                         <div class="col-12" id="gljRadios">
                             <div class="row">

+ 24 - 9
web/building_saas/complementary_ration_lib/js/ration.js

@@ -74,33 +74,48 @@ let rationOprObj = {
             me.rationSelInit(row);
         }
     },
-    rationSelInit: function (row) {
+    //focusOnSection,焦点返回章节表
+    rationSelInit: function (row, focusOnSection = null) {
         let me = rationOprObj,
             sheetGLJ = rationGLJOprObj.sheet, settingGLJ = rationGLJOprObj.setting,
             sheetCoe = rationCoeOprObj.sheet, settingCoe = rationCoeOprObj.setting,
             sheetAss = rationAssistOprObj.sheet, settingAss = rationAssistOprObj.setting,
             sheetInst = rationInstObj.sheet, settingInst = rationInstObj.setting;
-        sheetCommonObj.cleanSheet(sheetGLJ, settingGLJ, -1);
-        sheetCommonObj.cleanSheet(sheetCoe, settingCoe, -1);
-        sheetCommonObj.cleanSheet(sheetAss, settingAss, -1);
-        sheetCommonObj.cleanSheet(sheetInst, settingInst, -1);
+        sheetCommonObj.cleanData(sheetGLJ, settingGLJ, -1);
+        sheetCommonObj.cleanData(sheetCoe, settingCoe, -1);
+        sheetCommonObj.cleanData(sheetAss, settingAss, -1);
+        sheetCommonObj.cleanData(sheetInst, settingInst, -1);
         let cacheSection = me.getCache();
         if (cacheSection && row < cacheSection.length) {
             rationGLJOprObj.getGljItems(cacheSection[row], function () {
-                me.workBook.focus(true);
+                if (focusOnSection) {
+                    sectionTreeObj.workBook.focus(true);
+                } else {
+                    me.workBook.focus(true);
+                }
             });
             rationCoeOprObj.getCoeItems(cacheSection[row], function () {
-                me.workBook.focus(true);
+                if (focusOnSection) {
+                    sectionTreeObj.workBook.focus(true);
+                } else {
+                    me.workBook.focus(true);
+                }
             });
             rationAssistOprObj.getAssItems(cacheSection[row]);
             rationInstObj.getInstItems(cacheSection[row], function () {
-                me.workBook.focus(true);
+                if (focusOnSection) {
+                    sectionTreeObj.workBook.focus(true);
+                } else {
+                    me.workBook.focus(true);
+                }
             });
         }
         else {
             rationGLJOprObj.currentRationItem = null;
         }
-        me.workBook.focus(true);
+        if (!focusOnSection) {
+            me.workBook.focus(true);
+        }
     },
     isDef: function (v) {
         return v !== undefined && v !== null;

+ 30 - 22
web/building_saas/complementary_ration_lib/js/ration_glj.js

@@ -405,10 +405,14 @@ var rationGLJOprObj = {
                         me.cache["_GLJ_" + me.currentRationItem.ID] = me.cache["_GLJ_" + me.currentRationItem.ID].concat(recoveryArr);
                     }
                     me.cache["_GLJ_" + me.currentRationItem.ID].sort(function(a, b) {
-                        var rst = 0;
-                        if (a.code > b.code) rst = 1
-                        else if (a.code < b.code) rst = -1;
-                        return rst;
+                        let aV = a.gljType + a.code,
+                            bV = b.gljType + b.code;
+                        if (aV > bV) {
+                            return 1;
+                        } else if (aV < bV) {
+                            return -1
+                        }
+                        return 0;
                     });
                 }
                 me.showGljItems(me.currentRationItem.ID);
@@ -426,10 +430,14 @@ var rationGLJOprObj = {
                 }
                 //更新的工料机不存在
                 me.cache["_GLJ_" + me.currentRationItem.ID].sort(function(a, b) {
-                    var rst = 0;
-                    if (a.code > b.code) rst = 1
-                    else if (a.code < b.code) rst = -1;
-                    return rst;
+                    let aV = a.gljType + a.code,
+                        bV = b.gljType + b.code;
+                    if (aV > bV) {
+                        return 1;
+                    } else if (aV < bV) {
+                        return -1
+                    }
+                    return 0;
                 });
                 $('#alertModalBtn').click();
                 $('#alertText').text("人材机"+ codes + "不存在,请查找你所需要的人材机,或新增人材机");
@@ -562,14 +570,14 @@ var rationGLJOprObj = {
                 }
                 function compare(){
                     return function (a, b) {
-                        let rst = 0;
-                        if (a.code > b.code) {
-                            rst = 1;
+                        let aV = a.gljType + a.code,
+                            bV = b.gljType + b.code;
+                        if (aV > bV) {
+                            return 1;
+                        } else if (aV < bV) {
+                            return -1
                         }
-                        else if (a.code < b.code) {
-                            rst = -1;
-                        }
-                        return rst;
+                        return 0;
                     }
                 }
                 cacheArr.sort(compare());
@@ -584,14 +592,14 @@ var rationGLJOprObj = {
         if (me.cache["_GLJ_" + rationID]) {
             sheetCommonObj.cleanData(me.sheet, me.setting, -1);
             me.cache["_GLJ_" + rationID].sort(function (a, b) {
-                let rst = 0;
-                if(a.code > b.code){
-                    rst = 1;
-                }
-                else if(a.code < b.code){
-                    rst = -1;
+                let aV = a.gljType + a.code,
+                    bV = b.gljType + b.code;
+                if (aV > bV) {
+                    return 1;
+                } else if (aV < bV) {
+                    return -1
                 }
-                return rst;
+                return 0;
             });
             sheetsOprObj.showData(me.sheet, me.setting, me.cache["_GLJ_" + rationID], me.distTypeTree);
         }

+ 1 - 1
web/building_saas/complementary_ration_lib/js/section_tree.js

@@ -462,7 +462,7 @@ let sectionTreeObj = {
             rationOprObj.workBook.getSheet(0).clearSelection();
             rationOprObj.getRationItems(node.data.ID, function () {
                 rationOprObj.workBook.getActiveSheet().setActiveCell(0, 0);
-                rationOprObj.rationSelInit(0);
+                rationOprObj.rationSelInit(0, true);
             });
             rationOprObj.setCombo(rationOprObj.workBook.getSheet(0), 'dynamic');
         }

+ 1 - 1
web/building_saas/js/global.js

@@ -30,7 +30,7 @@ function autoFlashHeight(){
     $(".gc-list").height($(window).height()-headerHeight-toolsbarHeight-40);
     $(".share-list").height($(window).height()-headerHeight-toolsbarHeight-40);
     $(".form-view").height($(window).height()-headerHeight-ftoolsbarHeight);
-    $(".form-list").height($(window).height()-headerHeight-50 );
+    $(".form-list").height($(window).height()-headerHeight);
     $('#comments').find('textarea').height($('#comments').height() - 25);
     typeof(adaptiveTzjnrWidth)== 'function' ?adaptiveTzjnrWidth():''
 };

+ 97 - 5
web/building_saas/main/html/main.html

@@ -25,6 +25,12 @@
     <!-- jquery.contextmenu -->
    <!-- <link rel="stylesheet" href="/lib/jquery-contextmenu/jquery.contextMenu.css" type="text/css">-->
     <!-- endinject -->
+    <style type="text/css">
+        .ztree * {
+            font-family: Calibri;
+            font-size: 0.9rem;
+        }
+    </style>
     <script>
         // 这里的变量供页面调用
         let lockBills = '<%- projectData.property.lockBills %>';
@@ -40,6 +46,7 @@
         <span id="tool-toast-content">右键不支持粘贴外部内容,请使用Ctrl+V粘贴。<span id="toolToastBtn">我知道了</span></span>
     </div>
 </div>-->
+<img src="/web/dest/css/img/question.png" id="question_pic" style="display: none">
     <div class="header">
          <div class="top-msg clearfix">
             <div class="alert alert-warning alert-dismissible" role="alert" id="notify" style="display: none">
@@ -858,8 +865,8 @@
                     <input type="hidden" id="actionType">
                 </div>
                 <div class="modal-body" style="padding-left: 0; padding-right: 3px; margin-left: 0;">
-                        <div style="width: 25%; float: left;">
-                            <div  class="modal-auto-height" id="componentTreeDiv" style=" height: 415px; overflow: hidden;">
+                        <div style="width: 32%; float: left;">
+                            <div  class="modal-auto-height" id="componentTreeDiv" style=" height: 435px; overflow: hidden;">
                                 <!--<div class="print-list">-->
                                 <div style="width: 100%; height: 100%; overflow: auto">
                                     <ul id="gljTree" class="ztree"></ul>
@@ -867,7 +874,7 @@
                                 <!--</div>-->
                             </div>
                         </div>
-                        <div style="width:75%; padding-left: 3px; float: left;">
+                        <div style="width:67%; padding-left: 3px; float: left;">
                             <div id="gljRadios">
                                 <div class="row">
                                     <div class="col-7" style="margin-top: 5px;">
@@ -1465,8 +1472,93 @@
             </div>
         </div>
     </div>
-
-    <img src="/web/dest/css/img/folder_open.png" id="folder_open_pic" style="display: none">
+<!--清单问号弹出 补注弹窗-->
+<div class="modal fade" id="billsQuestionModal" data-backdrop="static">
+    <div class="modal-dialog modal-lg" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">补注</h5>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+            </div>
+            <div class="modal-body">
+                <div class="modal-auto-height" id="billsQuestionContent">
+                    <h3>标题1</h3>
+                    <h4>标题2</h4>
+                    <h5>标题3</h5>
+                    <p>这是一行文本</p>
+                    <p>这是一行<b>文本</b></p>
+                    <p class="text-indent">这是一行带缩进的文本</p>
+                    <table class="table table-sm table-bordered">
+                        <tr><th>表头1</th><th>表头2</th><th>表头3</th></tr>
+                        <tr><td>内容1</td><td>内容2</td><td>内容3</td></tr>
+                        <tr><td>内容4</td><td>内容5</td><td>内容6</td></tr>
+                    </table>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--定额弹出 说明 和 工程量计算规则-->
+<div class="modal fade" id="rationQuestionModal" data-backdrop="static">
+    <div class="modal-dialog modal-lg" role="document">
+        <div class="modal-content">
+            <div class="modal-body">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true">×</span>
+                </button>
+                <ul class="nav nav-tabs mb-3" role="tablist">
+                    <li class="nav-item">
+                        <a class="nav-link active px-3" data-toggle="tab" href="#m-explanation" role="tab">说明</a>
+                    </li>
+                    <li class="nav-item">
+                        <a class="nav-link px-3" data-toggle="tab" href="#m-ruleText" role="tab">工程量计算规则</a>
+                    </li>
+                </ul>
+                <div class="tab-content">
+                    <div class="tab-pane active" id="m-explanation" role="tabpanel">
+                        <div class="modal-auto-height" id="explanationContent">
+                            <h3>标题1</h3>
+                            <h4>标题2</h4>
+                            <h5>标题3</h5>
+                            <p>这是一行文本</p>
+                            <p>这是一行<b>文本</b></p>
+                            <p class="text-indent">这是一行带缩进的文本</p>
+                            <table class="table table-sm table-bordered">
+                                <tr><th>表头1</th><th>表头2</th><th>表头3</th></tr>
+                                <tr><td>内容1</td><td>内容2</td><td>内容3</td></tr>
+                                <tr><td>内容4</td><td>内容5</td><td>内容6</td></tr>
+                            </table>
+                        </div>
+                    </div>
+                    <div class="tab-pane" id="m-ruleText" role="tabpanel">
+                        <div class="modal-auto-height" id="ruleTextContent">
+                            <h3>标题x1</h3>
+                            <h4>标题2</h4>
+                            <h5>标题3</h5>
+                            <p>这是一行文本</p>
+                            <p>这是一行<b>文本</b></p>
+                            <p class="text-indent">这是一行带缩进的文本</p>
+                            <table class="table table-sm table-bordered">
+                                <tr><th>表头1</th><th>表头2</th><th>表头3</th></tr>
+                                <tr><td>内容1</td><td>内容2</td><td>内容3</td></tr>
+                                <tr><td>内容4</td><td>内容5</td><td>内容6</td></tr>
+                            </table>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<img src="/web/dest/css/img/folder_open.png" id="folder_open_pic" style="display: none">
     <img src="/web/dest/css/img/folder_close.png" id="folder_close_pic" style="display: none">
     <img src="/web/dest/css/img/project.png" id="proj_pic" style="display: none">
     <img src="/web/dest/css/img/engineering.png" id="eng_pic" style="display: none">

+ 5 - 0
web/building_saas/main/js/controllers/material_controller.js

@@ -179,6 +179,7 @@ let MaterialController = {
     initSpread:function () {
         if(!this.spread){
             this.spread = SheetDataHelper.createNewSpread($("#replaceM")[0]);
+            sheetCommonObj.spreadDefaultStyle(this.spread);
             this.initSheet();
         }else {
             this.spread.refresh();
@@ -214,6 +215,10 @@ let MaterialController = {
         }
     },
     onReplaceButtonClick:function(e, args){
+        //项目只读
+        if(projectReadOnly) {
+            return;
+        }
         let me = MaterialController;
         let sheet = args.sheet, row = args.row, col = args.col;
         let dataCode = me.setting.header[col].dataCode, item = me.datas[row], doc = {};

+ 3 - 0
web/building_saas/main/js/main.js

@@ -136,6 +136,7 @@ function slideResize(eles, limit, type, callback) {
             else{
                 eles.nearSpread[type](nEleChangeSize);
                 eles.farSpread[type](fEleChangeSize - navSize);
+                eles.farElement[type](fEleChangeSize);
             }
             //实时刷新页面
             mouseMoveCount+=Math.abs(moveSize);//取移动的决对值
@@ -219,6 +220,7 @@ function setSizeWithPercent(tag,eles,nearSize,farSize,type) {
         nearSize = (nearSize/(nearSize + farSize))* totalHeight;
         eles.nearSpread[type](nearSize);
         eles.farSpread[type](totalHeight - nearSize);
+        eles.farElement[type](totalHeight - nearSize + navSize);
     }
 }
 
@@ -235,6 +237,7 @@ function setDefaultSize(tag,eles,type) {
         let nearSize = (o_nearSize/(o_nearSize + o_farSize))* totalHeight;
         eles.nearSpread[type](nearSize);
         eles.farSpread[type](totalHeight - nearSize);
+        eles.farElement[type](totalHeight - nearSize + navSize);
     }
 }
 

+ 2 - 2
web/building_saas/main/js/views/glj_view.js

@@ -86,8 +86,8 @@ var gljOprObj = {
         header: [
             {headerName: "选择", headerWidth: 40, dataCode: "select", hAlign: "center", vAlign: "center", cellType: "checkBox"},
             {headerName: "编码", headerWidth: 80, dataCode: "code", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"},
-            {headerName: "名称", headerWidth: 220, dataCode: "name", dataType: "String", hAlign: "left", vAlign: "center"},
-            {headerName: "规格型号", headerWidth: 185, dataCode: "specs", dataType: "String", hAlign: "left", vAlign: "center"},
+            {headerName: "名称", headerWidth: 160, dataCode: "name", dataType: "String", hAlign: "left", vAlign: "center"},
+            {headerName: "规格型号", headerWidth: 160, dataCode: "specs", dataType: "String", hAlign: "left", vAlign: "center"},
             {headerName: "单位", headerWidth: 40, dataCode: "unit", dataType: "String", hAlign: "center", vAlign: "center"},
             {headerName: "单价", headerWidth: 55, dataCode: "basePrice", dataType: "Number", formatter: "0.00", hAlign: "right", vAlign: "center"},
             {headerName: "类型", headerWidth: 60, dataCode: "gljType", dataType: "String", hAlign: "center", vAlign: "center"},

+ 5 - 0
web/building_saas/main/js/views/side_tools.js

@@ -1,6 +1,10 @@
 /**
  * Created by Mai on 2017/6/16.
  */
+$(window).resize(function() {
+    sheetCommonObj.setColumnWidthByRate($('#stdRationChapter').width() - 40, rationLibObj.rationChapterSpread, rationLibObj.rationChapterTreeSetting.cols);
+    rationLibObj.refreshSpread();
+});
 //造价书与清单定额库左右拖动
 let sideResizeEles = {};
 sideResizeEles.id = 'stdRationTab';
@@ -21,6 +25,7 @@ slideResize(sideResizeEles, {min: 250, max: $('#zaojiashu').width()-260}, 'width
         billsGuidance.refreshWorkBook();
     }
     else if(sideResizeEles.id === 'stdRationTab'){
+        sheetCommonObj.setColumnWidthByRate($('#stdRationChapter').width() - 40, rationLibObj.rationChapterSpread, rationLibObj.rationChapterTreeSetting.cols);
         rationLibObj.refreshSpread();
     }
     else{

+ 19 - 20
web/building_saas/main/js/views/std_billsGuidance_lib.js

@@ -444,6 +444,17 @@ const billsGuidance = (function () {
             buildSheet(module);
         }
     }
+    //点击清单名称后面的问号,弹出补注窗口并设置当前节点(或xxx父节点)的补注
+    //@param {Number}row(当前焦点行) @return {void}
+    function initRechargeModal(row) {
+        let node = bills.tree.items[row];
+        while (node && !node.data.recharge){
+            node = node.parent;
+        }
+        let recharge = node && node.data.recharge ? node.data.recharge : '无内容';
+        $('#billsQuestionContent').html(recharge);
+        $('#billsQuestionModal').modal('show');
+    }
     //初始化并输出树
     //@param {Object}module {Object}sheet {Object}treeSetting {Array}datas
     function initTree(module, sheet, treeSetting, datas){
@@ -456,6 +467,11 @@ const billsGuidance = (function () {
         module.controller.showTreeData();
         if(module === bills){
             setBillsHint(bills.tree.items, stdBillsJobData, stdBillsFeatureData);
+            renderSheetFunc(sheet, function () {
+                for(let i = 0; i < bills.tree.items.length; i++){
+                    sheet.setCellType(i, 1, TREE_SHEET_HELPER.getQuestionCellType(initRechargeModal));
+        }
+            });
         }
     }
     //项目指引表焦点控制
@@ -731,24 +747,6 @@ const billsGuidance = (function () {
             this.isEscKey=false;
             this.displayText='';
         }
-       /* function getHtml(node, cellRect, cellStyle, top) {
-            if(!node){
-                return '';
-            }
-            let height = cellRect.height;
-            top = top.replace('px', '');
-            let htmlArr = [];
-            let options = getOptions(node.data, bills.tree.selected.elf.datas);
-            //let optionsTitle = node.data.options.split(';').join('\n');
-            htmlArr.push(`<div style="height: ${height}px; background: ${cellStyle.backColor};overflow: hidden; white-space: nowrap; text-overflow: ellipsis">${node.data.options}</div><div id="optDiv" style="position: fixed; width: ${cellRect.width}px; top: ${top - (options.length - 2) * height - 5}px;background: ${cellStyle.backColor};border: 1px solid; overflow: auto; height: ${options.length > 6 ? height*6 : height*options.length+5}px; font-size: 0.9rem;">`);
-            for(let opt of options){
-                htmlArr.push(`<div title="${opt.name ? opt.name : ''}" class="elf-options" style="height: ${height}px;overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
-                        <input rank="${opt.rank}" value="${opt.ID}" style="margin-left: 5px; vertical-align: middle" type="checkbox" 
-                    ${node.data.optionChecked && _.find(node.data.optionChecked, {ID: opt.ID}) ? 'checked' : ''}> ${opt.name ? opt.name : ''}</div>`);
-            }
-            htmlArr.push(`</div>`);
-            return htmlArr.join('');
-        }*/
         function setOptionsDiv($editor, node, cellRect, cellStyle, top) {
             if(!node){
                 return '';
@@ -774,6 +772,7 @@ const billsGuidance = (function () {
                             $(input).prop('checked', false);
                         }
                         $(this).prop('checked', 'checked');
+                        elfItem.workBook.getSheet(0).endEdit();
                     } else {//多选
 
                     }
@@ -1376,7 +1375,7 @@ const billsGuidance = (function () {
             refreshWorkBook();
         });
         //监听alt建,确定选项单选多选状态
-        $('#billsGuidance_items').keydown(function(e){
+       /* $('#billsGuidance_items').keydown(function(e){
             if(e.keyCode === 18){
                 billsGuidanceSelMode = 1;
             }
@@ -1385,7 +1384,7 @@ const billsGuidance = (function () {
             if(e.keyCode === 18){
                 billsGuidanceSelMode = 0;
             }
-        });
+        });*/
     }
     //刷新表
     //@return {void}

+ 17 - 0
web/building_saas/main/js/views/std_ration_lib.js

@@ -62,6 +62,21 @@ var rationLibObj = {
             rationLibObj.loadStdRation(select.val());
         }
     },
+    initQuestionModal: function(row) {
+        let node = rationLibObj.tree.items[row];
+        while (node && !node.data.explanation){
+            node = node.parent;
+        }
+        let explanation = node && node.data.explanation ? node.data.explanation : '无内容';
+        $('#explanationContent').html(explanation);
+        node = rationLibObj.tree.items[row];
+        while (node && !node.data.ruleText){
+            node = node.parent;
+        }
+        let ruleText = node && node.data.ruleText ? node.data.ruleText : '无内容';
+        $('#ruleTextContent').html(ruleText);
+        $('#rationQuestionModal').modal('show');
+    },
     loadStdRation: function (rationLibID) {
         $.bootstrapLoading.start();
         var that = this;
@@ -69,6 +84,7 @@ var rationLibObj = {
             var rationChapterTree = idTree.createNew({id: 'ID', pid: 'ParentID', nid: 'NextSiblingID', rootId: -1, autoUpdate: false});
             that.tree = rationChapterTree;
             var rationChapterTreeController = TREE_SHEET_CONTROLLER.createNew(rationChapterTree, that.rationChapterSpread.getActiveSheet(), that.rationChapterTreeSetting);
+            sheetCommonObj.setColumnWidthByRate($('#stdRationChapter').width() - 40, that.rationChapterSpread, that.rationChapterTreeSetting.cols);
             rationChapterTree.loadDatas(datas);
             //读取展开收起状态
             let currentExpState = sessionStorage.getItem('stdRationLibExpState');
@@ -270,6 +286,7 @@ var rationLibObj = {
         "defaultRowHeight": 21,
         "treeCol": 0,
         "cols":[{
+            "rateWidth": 1,
             "width":400,
             "readOnly": true,
             "head":{

BIN
web/dest/css/img/question.png


BIN
web/dest/css/img/refresh.png