zhongzewei 6 年之前
父节点
当前提交
d0a86b4d99

+ 63 - 0
modules/ration_repository/models/ration_item.js

@@ -940,6 +940,69 @@ rationItemDAO.prototype.exportExcelData = async function(rationRepId) {
         const ration = [sectionId, feeType, tmp.ID, tmp.code, tmp.name, tmp.caption, tmp.basePrice];
         rationData.push(ration);
     }
+    //根据编号排序,优先级:number-number-..., number, Anumber....
+    /*let regConnector = /-/g,
+        regLetter = /[a-z,A-Z]/g,
+        regNum = /\d+/g;
+    rationData.sort(function (a, b) {
+        let aCode = a[3],
+            bCode = b[3],
+            rst = 0;
+        function compareConnector(arrA, arrB) {
+            let lessArr = arrA.length <= arrB ? arrA : arrB;
+            for (let i = 0; i < lessArr.length; i++) {
+                let result = compareUnit(arrA[i], arrB[i]);
+                if (result !== 0) {
+                    return result;
+                } else {
+
+                }
+            }
+            function compareUnit(uA, uB) {
+                let uAV = parseFloat(uA),
+                    uBV = parseFloat(uB);
+                if (uAV > uBV) {
+                    return 1;
+                } else if (uAV < uBV) {
+                    return -1;
+                }
+                return 0;
+            }
+        }
+        if (regConnector.test(a) && !regConnector.test(b)) {
+            rst = -1;
+        } else if (!regConnector.test(a) && regConnector.test(b)) {
+            rst = 1;
+        } else if (regConnector.test(a) && regConnector.test(b)) {
+
+        }
+    });
+    rationData.sort(function (a, b) {
+        let aCode = a[3],
+            bCode = b[3],
+            rst = 0,
+            splitA = aCode.split('-'),
+            splitB = bCode.split('-');
+        if(splitA[0] > splitB[0]){
+            rst = 1;
+        }
+        else if(splitA[0] < splitB[0]){
+            rst = -1;
+        }
+        else {
+            if(splitA[1] && splitB[1]){
+                let floatA = parseFloat(splitA[1]),
+                    floatB = parseFloat(splitB[1]);
+                if(floatA > floatB){
+                    rst = 1;
+                }
+                else if(floatA < floatB){
+                    rst = -1;
+                }
+            }
+        }
+        return rst;
+    });*/
     const excelData = [['树ID', '取费专业', '定额ID', '定额编码', '定额名', '定额显示名称', '基价']];
     excelData.push.apply(excelData, rationData);
 

+ 74 - 65
web/maintain/billsGuidance_lib/js/billsGuidance.js

@@ -552,77 +552,86 @@ const billsGuidance = (function () {
             if(sheet && sheet.getParent().qo){
                 setting.pos = SheetDataHelper.getObjPos(sheet.getParent().qo);
             }
-            if (setting.pos && text && text !== '') {
-                //固定不显示的div,存储文本获取固定div宽度,toolTipElement由于显示和隐藏,获取宽度不正确
-                if(!this._fixedTipElement){
-                    let div = $('#fixedTip1')[0];
-                    if (!div) {
-                        div = document.createElement("div");
-                        $(div).css("padding", 5)
-                            .attr("id", 'fixedTip');
-                        $(div).hide();
-                        document.body.insertBefore(div, null);
-                    }
-                    this._fixedTipElement = div;
-                }
-                $(this._fixedTipElement).width('');
-                $(this._fixedTipElement).html(text);
-                if (!this._toolTipElement) {
-                    let div = $('#autoTip1')[0];
-                    if (!div) {
-                        div = document.createElement("div");
-                        $(div).css("position", "absolute")
-                            .css("border", "1px #C0C0C0 solid")
-                            .css("box-shadow", "1px 2px 5px rgba(0,0,0,0.4)")
-                            .css("font", "0.9rem Calibri")
-                            .css("background", "white")
-                            .css("padding", 5)
-                            .attr("id", 'autoTip1');
-                        $(div).hide();
-                        document.body.insertBefore(div, null);
-                    }
-                    this._toolTipElement = div;
-                    $(this._toolTipElement).width('');
-                    //实时读取位置信息
-                    if(hitinfo.sheet && hitinfo.sheet.getParent().qo){
-                        setting.pos = SheetDataHelper.getObjPos(hitinfo.sheet.getParent().qo);
-                    }
-                    $(this._toolTipElement).html(text);
-                    //定额库定额特殊处理
-                    if($(hitinfo.sheet.getParent().qo).attr('id') === 'rationSpread'){
-                        let divWidth = $(this._fixedTipElement).width(),
-                            divHeight = $(this._fixedTipElement).height();
-                        if(divWidth > 600){
-                            divWidth = 590;
-                            $(this._toolTipElement).width(divWidth);
+            let delayTimes = 500; //延时时间
+            let now_timeStamp = +new Date();
+            this.tipTimeStamp = now_timeStamp;
+            let me = this;
+            setTimeout(function () {
+                if(now_timeStamp - me.tipTimeStamp == 0){//鼠标停下的时候才显示
+                    if (setting.pos && text && text !== '') {
+                        //固定不显示的div,存储文本获取固定div宽度,toolTipElement由于显示和隐藏,获取宽度不正确
+                        if(!me._fixedTipElement){
+                            let div = $('#fixedTip1')[0];
+                            if (!div) {
+                                div = document.createElement("div");
+                                $(div).css("padding", 5)
+                                    .attr("id", 'fixedTip');
+                                $(div).hide();
+                                document.body.insertBefore(div, null);
+                            }
+                            me._fixedTipElement = div;
                         }
-                        let top = setting.pos.y  + hitinfo.y - divHeight < 0 ? 0 :  setting.pos.y + hitinfo.cellRect.y - divHeight;
-                        $(this._toolTipElement).css("top", top).css("left", setting.pos.x - divWidth);
-                    }
-                    else{
-                        $(this._toolTipElement).css("top", setting.pos.y + hitinfo.y +15).css("left", setting.pos.x + hitinfo.x + 15);
-                    }
-                    //名称
-                    if(hitinfo.col === 2){
-                        let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
-                            zoom = hitinfo.sheet.zoom();
-                        let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
-                        let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
-                        let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
-                        if(textLength > cellWidth){
-                            $(this._toolTipElement).css("top", setting.pos.y + hitinfo.y +15).css("left", setting.pos.x + hitinfo.x + 15);
-                            $(this._toolTipElement).show("fast");
-                            ration.tipDiv = 'show';//做个标记
+                        $(me._fixedTipElement).width('');
+                        $(me._fixedTipElement).html(text);
+                        if (!me._toolTipElement) {
+                            let div = $('#autoTip1')[0];
+                            if (!div) {
+                                div = document.createElement("div");
+                                $(div).css("position", "absolute")
+                                    .css("border", "1px #C0C0C0 solid")
+                                    .css("box-shadow", "1px 2px 5px rgba(0,0,0,0.4)")
+                                    .css("font", "0.9rem Calibri")
+                                    .css("background", "white")
+                                    .css("padding", 5)
+                                    .attr("id", 'autoTip1');
+                                $(div).hide();
+                                document.body.insertBefore(div, null);
+                            }
+                            me._toolTipElement = div;
+                            $(me._toolTipElement).width('');
+                            //实时读取位置信息
+                            if(hitinfo.sheet && hitinfo.sheet.getParent().qo){
+                                setting.pos = SheetDataHelper.getObjPos(hitinfo.sheet.getParent().qo);
+                            }
+                            $(me._toolTipElement).html(text);
+                            //定额库定额特殊处理
+                            if($(hitinfo.sheet.getParent().qo).attr('id') === 'rationSpread'){
+                                let divWidth = $(me._fixedTipElement).width(),
+                                    divHeight = $(me._fixedTipElement).height();
+                                if(divWidth > 600){
+                                    divWidth = 590;
+                                    $(me._toolTipElement).width(divWidth);
+                                }
+                                let top = setting.pos.y  + hitinfo.y - divHeight < 0 ? 0 :  setting.pos.y + hitinfo.cellRect.y - divHeight;
+                                $(me._toolTipElement).css("top", top).css("left", setting.pos.x - divWidth);
+                            }
+                            else{
+                                $(me._toolTipElement).css("top", setting.pos.y + hitinfo.y +15).css("left", setting.pos.x + hitinfo.x + 15);
+                            }
+                            //名称
+                            if(hitinfo.col === 2){
+                                let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
+                                    zoom = hitinfo.sheet.zoom();
+                                let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
+                                let textLength = me.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
+                                let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
+                                if(textLength > cellWidth){
+                                    $(me._toolTipElement).css("top", setting.pos.y + hitinfo.y +15).css("left", setting.pos.x + hitinfo.x + 15);
+                                    $(me._toolTipElement).show("fast");
+                                    ration.tipDiv = 'show';//做个标记
+                                }
+                            }
+                            else {
+                                $(me._toolTipElement).show("fast");
+                                ration.tipDiv = 'show';//做个标记
+                            }
                         }
                     }
-                    else {
-                        $(this._toolTipElement).show("fast");
-                        ration.tipDiv = 'show';//做个标记
-                    }
                 }
-            }
+            },delayTimes);
         };
         TipCellType.prototype.processMouseLeave = function (hininfo) {
+            this.tipTimeStamp = +new Date();
             ration.tipDiv = 'hide';
             if (this._toolTipElement) {
                 $(this._toolTipElement).hide();

+ 4 - 17
web/maintain/bills_lib/html/qingdan.html

@@ -266,6 +266,7 @@
         </div>
     </div>
     <!--弹出html填写帮助-->
+    <!--弹出html填写帮助-->
     <div class="modal fade" id="help" style="display: none;" aria-hidden="true">
         <div class="modal-dialog" role="document">
             <div class="modal-content">
@@ -276,28 +277,14 @@
                     </button>
                 </div>
                 <div class="modal-body">
-                    <p class="mb-0">标题:&lt;h3&gt;、&lt;h4&gt;、&lt;h5&gt;</p>
-                    <p class="text-primary mb-0">&lt;h3&gt;标题1&lt;/h3&gt;</p>
-                    <h3>标题1</h3>
-                    <p class="text-primary mb-0">&lt;h4&gt;标题2&lt;/h4&gt;</p>
-                    <h4>标题2</h4>
-                    <p class="text-primary mb-0">&lt;h5&gt;标题3&lt;/h5&gt;</p>
-                    <h5>标题3</h5>
-                    <p class="text-primary mb-0">&lt;p&gt;这是一行文本&lt;/p&gt;</p>
-                    <p>这是一行文本</p>
-                    <p class="mb-0">加粗:&lt;b&gt;</p>
-                    <p class="text-primary mb-0">&lt;p&gt;这是一行&lt;b&gt;文本&lt;/b&gt;&lt;/p&gt;</p>
-                    <p>这是一行<b>文本</b></p>
-                    <p class="mb-0">缩进:text-indent</p>
-                    <p class="text-primary mb-0">&lt;p class="text-indent" &gt;这是一行带缩进的文本&lt;/p&gt;</p>
-                    <p class="text-indent">这是一行带缩进的文本</p>
+                    <p class="text-primary">&lt;p&gt;这是一行文本&lt;/p&gt;</p>
                     <p class="mb-0">文本居中:text-center</p>
                     <p class="text-primary">&lt;p class="text-center" &gt;这是一行文本&lt;/p&gt;</p>
                     <p class="mb-0">文本居右:text-right</p>
                     <p class="text-primary">&lt;p class="text-right" &gt;这是一行文本&lt;/p&gt;</p>
                     <p class="mb-0">文本居左(默认已居左):text-left</p>
                     <p class="text-primary">&lt;p class="text-left" &gt;这是一行文本&lt;/p&gt;</p>
-                    <p class="mb-0">表格:&lt;table&gt;&lt;tr&gt;&lt;th&gt;&lt;td&gt;</p>
+                    <p class="mb-0">表格:table、tr、th、td</p>
                     <p class="mb-0 text-primary">&lt;table&gt;</p>
                     <p class="mb-0 text-primary">&lt;tr&gt;&lt;th&gt;表头1&lt;/th&gt;&lt;th&gt;表头2&lt;/th&gt;&lt;th&gt;表头3&lt;/th&gt;&lt;/tr&gt;</p>
                     <p class="mb-0 text-primary">&lt;tr&gt;&lt;td&gt;内容1&lt;/td&gt;&lt;td&gt;内容2&lt;/td&gt;&lt;td&gt;内容3&lt;/td&gt;&lt;/tr&gt;</p>
@@ -331,7 +318,7 @@
                     <p class="mb-0 text-primary">&lt;/table&gt;</p>
                     <p>
                     <table class="table table-sm table-bordered">
-                        <tr><th colspan="2">表头1表头2</th><th>表头3</th></tr>
+                        <tr><th>表头1</th><th>表头2</th><th>表头3</th></tr>
                         <tr><td rowspan="2">内容1内容4</td><td>内容2</td><td>内容3</td></tr>
                         <tr><td>内容5</td><td>内容6</td></tr>
                     </table>

+ 5 - 4
web/maintain/ration_repository/dinge.html

@@ -540,6 +540,7 @@
         </div>
         <%include ../../common/html/uploadImg.html %>
         <!--弹出html填写帮助-->
+        <!--弹出html填写帮助-->
         <div class="modal fade" id="help" style="display: none;" aria-hidden="true">
             <div class="modal-dialog" role="document">
                 <div class="modal-content">
@@ -572,7 +573,7 @@
                         <p class="mb-0">文本居左(默认已居左):text-left</p>
                         <p class="text-primary">&lt;p class="text-left" &gt;这是一行文本&lt;/p&gt;</p>
                         <p class="mb-0">表格:&lt;table&gt;、&lt;tr&gt;、&lt;th&gt;、&lt;td&gt;</p>
-                        <p class="mb-0 text-primary">&lt;table&gt;</p>
+                        <p class="mb-0 text-primary">&lt;table class="table table-sm table-border"&gt;</p>
                         <p class="mb-0 text-primary">&lt;tr&gt;&lt;th&gt;表头1&lt;/th&gt;&lt;th&gt;表头2&lt;/th&gt;&lt;th&gt;表头3&lt;/th&gt;&lt;/tr&gt;</p>
                         <p class="mb-0 text-primary">&lt;tr&gt;&lt;td&gt;内容1&lt;/td&gt;&lt;td&gt;内容2&lt;/td&gt;&lt;td&gt;内容3&lt;/td&gt;&lt;/tr&gt;</p>
                         <p class="mb-0 text-primary">&lt;tr&gt;&lt;td&gt;内容4&lt;/td&gt;&lt;td&gt;内容5&lt;/td&gt;&lt;td&gt;内容6&lt;/td&gt;&lt;/tr&gt;</p>
@@ -585,7 +586,7 @@
                         </table>
                         </p>
                         <p class="mb-0">合并横向单元格(2格):colspan="2"</p>
-                        <p class="mb-0 text-primary">&lt;table&gt;</p>
+                        <p class="mb-0 text-primary">&lt;table class="table table-sm table-border"&gt;</p>
                         <p class="mb-0 text-primary">&lt;tr&gt;&lt;th colspan="2"&gt;表头1表头2&lt;/th&gt;&lt;th&gt;表头3&lt;/th&gt;&lt;/tr&gt;</p>
                         <p class="mb-0 text-primary">&lt;tr&gt;&lt;td&gt;内容1&lt;/td&gt;&lt;td&gt;内容2&lt;/td&gt;&lt;td&gt;内容3&lt;/td&gt;&lt;/tr&gt;</p>
                         <p class="mb-0 text-primary">&lt;tr&gt;&lt;td&gt;内容4&lt;/td&gt;&lt;td&gt;内容5&lt;/td&gt;&lt;td&gt;内容6&lt;/td&gt;&lt;/tr&gt;</p>
@@ -598,14 +599,14 @@
                         </table>
                         </p>
                         <p class="mb-0">合并竖向单元格(2格):rowspan="2"</p>
-                        <p class="mb-0 text-primary">&lt;table&gt;</p>
+                        <p class="mb-0 text-primary">&lt;table class="table table-sm table-border"&gt;</p>
                         <p class="mb-0 text-primary">&lt;tr&gt;&lt;th&gt;表头1&lt;/th&gt;&lt;th&gt;表头2&lt;/th&gt;&lt;th&gt;表头3&lt;/th&gt;&lt;/tr&gt;</p>
                         <p class="mb-0 text-primary">&lt;tr&gt;&lt;td rowspan="2"&gt;内容1内容4&lt;/td&gt;&lt;td&gt;内容2&lt;/td&gt;&lt;td&gt;内容3&lt;/td&gt;&lt;/tr&gt;</p>
                         <p class="mb-0 text-primary">&lt;tr&gt;&lt;td&gt;内容5&lt;/td&gt;&lt;td&gt;内容6&lt;/td&gt;&lt;/tr&gt;</p>
                         <p class="mb-0 text-primary">&lt;/table&gt;</p>
                         <p>
                         <table class="table table-sm table-bordered">
-                            <tr><th colspan="2">表头1表头2</th><th>表头3</th></tr>
+                            <tr><th>表头1</th><th>表头2</th><th>表头3</th></tr>
                             <tr><td rowspan="2">内容1内容4</td><td>内容2</td><td>内容3</td></tr>
                             <tr><td>内容5</td><td>内容6</td></tr>
                         </table>

+ 20 - 5
web/maintain/ration_repository/js/ration.js

@@ -73,7 +73,8 @@ 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,
@@ -86,20 +87,34 @@ let rationOprObj = {
         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);
+        }
     },
 
     isInt: function (num) {

+ 1 - 1
web/maintain/ration_repository/js/section_tree.js

@@ -633,7 +633,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');
         }