Przeglądaj źródła

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

TonyKang 7 lat temu
rodzic
commit
0ec361c503

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

@@ -979,7 +979,7 @@ a.ui-button:focus {
 .ui-widget-header .ui-state-active,
 a.ui-button:active,
 .ui-button:active,
-.ui-button.ui-state-active:hover {
+/*.ui-button.ui-state-active:hover {
 	border: 1px solid #003eff;
 	background: #007fff;
 	font-weight: normal;
@@ -989,7 +989,7 @@ a.ui-button:active,
 .ui-state-active .ui-icon-background {
 	border: #003eff;
 	background-color: #ffffff;
-}
+}*/
 .ui-state-active a,
 .ui-state-active a:link,
 .ui-state-active a:visited {

+ 1 - 1
modules/complementary_ration_lib/models/compleRationModel.js

@@ -185,7 +185,7 @@ class CompleRatoinDao {
                     hintsArr = hintsArr.concat(ration.annotation.split('\n'));
                 }
                 ration._doc.hint = hintsArr.join('<br>');
-                ration._doc.hintHeight = hintsArr.length * perHintHeight;//控制定额库悬浮提示位置
+               // ration._doc.hintHeight = hintsArr.length * perHintHeight;//控制定额库悬浮提示位置
             }
             callback(0, rations);
         }

+ 34 - 5
public/web/sheet/sheet_data_helper.js

@@ -70,6 +70,9 @@ var SheetDataHelper = {
     },
     loadSheetHeader: function (setting, sheet) {
         this.massOperationSheet(sheet, function () {
+            if(setting.rowHeaderWidth !== undefined && setting.rowHeaderWidth !== null){
+                sheet.setColumnWidth(0, setting.rowHeaderWidth, GC.Spread.Sheets.SheetArea.rowHeader);
+            }
             if (setting.frozenCols) {
                 sheet.frozenColumnCount(setting.frozenCols);
             }
@@ -122,7 +125,13 @@ var SheetDataHelper = {
         style.wordWrap = setting.data.wordWrap;
         return style;
     },
+    getTipWidth: function(text){
+        const fontSize = 14.4;
+        let widthArr = text.split('<br>');
+        console.log(widthArr);
+    },
     loadSheetData: function (setting, sheet, datas) {
+        let me = this;
         SheetDataHelper.protectdSheet(sheet);
 
 
@@ -143,9 +152,9 @@ var SheetDataHelper = {
         TipCellType.prototype.processMouseEnter = function (hitinfo) {
             let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
             let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
-            let hintHeight = datas[hitinfo.row] ?
+       /*     let hintHeight = datas[hitinfo.row] ?
                                 datas[hitinfo.row].hintHeight ? datas[hitinfo.row].hintHeight : null
-                            : null; //定额库定额悬浮提示位置相关
+                            : null; //定额库定额悬浮提示位置相关*/
             if(tag !== undefined && tag){
                 text = tag;
             }
@@ -153,6 +162,19 @@ var SheetDataHelper = {
                 setting.pos = SheetDataHelper.getObjPos(sheet.getParent().qo);
             }
             if (setting.pos && text && text !== '') {
+                //固定不显示的div,存储文本获取固定div宽度,toolTipElement由于显示和隐藏,获取宽度不正确
+                if(!this._fixedTipElement){
+                    let div = $('#fixedTip')[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).html(text);
                 if (!this._toolTipElement) {
                     let div = $('#autoTip')[0];
                     if (!div) {
@@ -160,7 +182,7 @@ var SheetDataHelper = {
                         $(div).css("position", "absolute")
                             .css("border", "1px #C0C0C0 solid")
                             .css("box-shadow", "1px 2px 5px rgba(0,0,0,0.4)")
-                           // .css("font", "9pt Arial")
+                            .css("font", "0.9rem Calibri")
                             .css("background", "white")
                             .css("padding", 5)
                             .attr("id", 'autoTip');
@@ -168,9 +190,16 @@ var SheetDataHelper = {
                         document.body.insertBefore(div, null);
                     }
                     this._toolTipElement = div;
+                    //实时读取位置信息
+                    if(hitinfo.sheet && hitinfo.sheet.getParent().qo){
+                        setting.pos = SheetDataHelper.getObjPos(hitinfo.sheet.getParent().qo);
+                    }
                     $(this._toolTipElement).html(text);
-                    if(hintHeight){
-                        $(this._toolTipElement).css("top", setting.pos.y  + hitinfo.y - hintHeight).css("left", setting.pos.x + hitinfo.x + 15);
+                    //定额库定额特殊处理
+                    if($(hitinfo.sheet.getParent().qo).attr('id') === 'stdSectionRations'){
+                        let divWidth = $(this._fixedTipElement).width(),
+                            divHeight = $(this._fixedTipElement).height();
+                        $(this._toolTipElement).css("top", setting.pos.y  + hitinfo.y - divHeight).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);

+ 8 - 2
public/web/tree_sheet/tree_sheet_helper.js

@@ -51,6 +51,9 @@ var TREE_SHEET_HELPER = {
     },
     loadSheetHeader: function (setting, sheet) {
         this.massOperationSheet(sheet, function () {
+            if(setting.rowHeaderWidth !== undefined && setting.rowHeaderWidth !== null){
+                sheet.setColumnWidth(0, setting.rowHeaderWidth, GC.Spread.Sheets.SheetArea.rowHeader);
+            }
             if (setting.frozenCols) {
                 sheet.frozenColumnCount(setting.frozenCols);
             }
@@ -109,6 +112,9 @@ var TREE_SHEET_HELPER = {
     refreshTreeNodeData: function (setting, sheet, nodes, recursive) {
         nodes.forEach(function (node) {
             let iRow = node.serialNo();
+            if(setting.emptyRowHeader){
+                sheet.setValue(iRow, 0, '', GC.Spread.Sheets.SheetArea.rowHeader);
+            }
             if(typeof projectObj !== 'undefined'){
                 let nodeStyle = projectObj.getNodeColorStyle(sheet, node);
                 if(node.data.bgColour){
@@ -474,8 +480,8 @@ var TREE_SHEET_HELPER = {
                     $(div).css("position", "absolute")
                         .css("border", "1px #C0C0C0 solid")
                         .css("box-shadow", "1px 2px 5px rgba(0,0,0,0.4)")
-                        .css("font", "9pt Arial")
-                        .css("background", "white")
+                        .css("font", "0.9rem Calibri")
+                        .css("background", "White")
                         .css("padding", 5)
                         .attr("id", 'autoTip');
                     $(div).hide();

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

@@ -1363,11 +1363,15 @@
                     <div class="alert alert-success mt-3" id="uploadAlert" role="alert" style="display: none;">
                         广东XXXX项目清单.xlsx 准备导入上传
                     </div>
-                    <button style="margin-top: 2px;" type="button" class="btn btn-primary" id="uploadExample">示例</button>
+                    <!--<button style="margin-top: 2px;" type="button" class="btn btn-primary" id="uploadExample">示例</button>-->
                    <!-- <div id="uploadSheets" style="display: none; border-top: 1px solid #CED4DA;border-left: 1px solid #CED4DA;border-radius: 5px;margin-top: 5px;"></div>-->
+                    <div id="uploadSheetsHead" style="margin-left: 5px;margin-top: 5px; display: none;" class="input-group form-check"><label class="form-check-label" style="width:270px; overflow: hidden; font-weight: bold">
+                        选择工作表...</label><label style="margin-left: 10px; font-weight: bold">导入到...</label>
+                    </div>
                     <div id="uploadSheets"></div>
                 </div>
                 <div class="modal-footer">
+                    <button style="margin-right: 245px;" type="button" class="btn btn-primary" id="uploadExample">示例</button>
                     <a href="javascript:void(0);" class="btn btn-primary" id="importConfirm">确定导入</a>
                     <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                 </div>

+ 6 - 2
web/building_saas/main/js/models/calc_program.js

@@ -1714,8 +1714,9 @@ class CalcProgram {
                 treeNode.data.programID = null;
                 treeNode.changed = true;
             }
-
-            let f = treeNode.data.feeRate ? treeNode.data.feeRate : 100;
+            let f = 100;
+            if (treeNode.data.feeRate || treeNode.data.feeRate == 0)
+                f = treeNode.data.feeRate;
             let b = treeNode.data.calcBaseValue ? treeNode.data.calcBaseValue : 0;
             let tb = treeNode.data.tenderCalcBaseValue ? treeNode.data.tenderCalcBaseValue : 0;
             let q = nQ ? nQ : 1;
@@ -1998,6 +1999,9 @@ class CalcProgram {
         const totalFeeType = tender ? 'common.tenderTotalFee' : 'common.totalFee';
         function calcNodes(nodes) {
             for (let node of nodes) {
+                if(!node){
+                    continue;
+                }
                 if (!excludeNodes.includes(node)){
                     if (node.source && node.source.children && node.source.children.length > 0) {
                         calcNodes(node.children);

+ 17 - 2
web/building_saas/main/js/models/ration.js

@@ -627,14 +627,28 @@ var Ration = {
             }
             else return null;
         };
-        ration.prototype.addNewRationForPaste = function (rationType) {
+        ration.prototype.addNewRationFast = function (rationType) {
             let me = this;
             let project = projectObj.project, sheetController = projectObj.mainController;
             let engineering = projectInfoObj.projectInfo.property.engineering;
             let selected = project.mainTree.selected, newSource = null, newNode = null,pre=null,br=null;
             let billItemID = null,serialNo=1,nextID=null;
             if (selected === null) { return null; }
-            if (selected.sourceType === project.Ration.getSourceType()) {
+            if (selected.sourceType === project.Bills.getSourceType() && selected.depth() > 0) {
+                if(selected.data.type === billType.FB){
+                    return null;
+                }
+                else if (selected.source.children.length > 0) {
+                    alert('当前清单已有清单子项,不能套用定额。');
+                } else if (selected.data.calcBase&&selected.data.calcBase!="") {
+                    alert('当前有基数计算不能插入定额/量价/工料机。');
+                } else {
+                    billItemID = selected.source.getID();
+                    nextID = selected.tree.rootID();
+                    br = this.getBillsSortRation(billItemID);
+                    serialNo = br.length > 0 ? br[br.length - 1].serialNo + 1 : 1
+                }
+            } else if (selected.sourceType === project.Ration.getSourceType()) {
                 billItemID = selected.getParentID();
                 br = this.getBillsSortRation(billItemID);
                 serialNo = selected.data.serialNo+1;
@@ -669,6 +683,7 @@ var Ration = {
                     newNode.data = newSource;
                 })
                 ProjectController.syncDisplayNewNode(sheetController, newNode);
+                $.bootstrapLoading.end();
                 return newNode;
             }
             else return null;

+ 4 - 2
web/building_saas/main/js/views/importBills.js

@@ -62,11 +62,12 @@ const importBills = (function(){
         for(let i = 0; i < sheetsCount; i++){
             sheetNames.push(indexMapping[i]);
         }
-        let sheetArea = $('#uploadSheets');
+        let sheetArea = $('#uploadSheets'),
+            sheetHeader = $('#uploadSheetsHead');
         $('#uploadSheets').height('');
         sheetArea.empty();
         for(let sheetName of sheetNames){
-            let sheetDiv = $(`<div style="margin-left: 5px;margin-top: 5px;" class="input-group form-check"><label class="form-check-label" style="width:270px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
+            let sheetDiv = $(`<div style="margin-left: 5px;margin-top: 5px;" title="${sheetName}" class="input-group form-check"><label class="form-check-label" style="width:270px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
                            <input class="form-check-input" type="checkbox">${sheetName}</label></div>`);
             sheetDiv.find('input[type="checkbox"]').click(function () {
                 if($('#uploadAlert').is(':visible')){
@@ -92,6 +93,7 @@ const importBills = (function(){
         }
         if(sheetNames.length > 0){
             sheetArea.show();
+            sheetHeader.show();
         }
         if($('#uploadSheets').height() > 250){
             sheetArea.css('overflow', 'auto');

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

@@ -54,8 +54,8 @@ let MainTreeCol = {
             else
                 rst = isDef(node.data.code) ? node.data.code : '';
 
-            if (node.data.adjustState && rst != '')
-                rst = rst + rationPrefix.replace;
+/*            if (node.data.adjustState && rst != '')
+                rst = rst + rationPrefix.replace;*/
             return rst;
         },
         marketPrice:function (node) {

+ 7 - 4
web/building_saas/main/js/views/project_view.js

@@ -531,7 +531,7 @@ var projectObj = {
             if (isDef(node.data.prefix) && node.data.prefix !== rationPrefix.none){
                  value = value.replace(new RegExp(node.data.prefix), '');
             };
-            value = value.replace(new RegExp(rationPrefix.replace), '');
+            // value = value.replace(new RegExp(rationPrefix.replace), '');
             info.sheet.setValue(info.row, info.col, value);
         }
         if(node&&fieldName =='quantity'&&(node.data.quantityEXP !==null||node.data.quantityEXP !==undefined)){
@@ -644,7 +644,7 @@ var projectObj = {
                     for (let i = 0; i < add; i++) {
                         switch (nodeType) {
                             case 1:
-                                curNode = projectObj.project.Ration.addNewRationForPaste(rationType.ration);
+                                curNode = projectObj.project.Ration.addNewRationFast(rationType.ration);
                                 break;
                             case 2:
                                 curNode = ProjectController.addFB(projectObj.project, projectObj.mainController);
@@ -680,7 +680,7 @@ var projectObj = {
                         // 编号去掉“换、借、补”等多余的字
                         code = code.replace(new RegExp(rationPrefix.complementary), '');
                         code = code.replace(new RegExp(rationPrefix.borrow), '');
-                        code = code.replace(new RegExp(rationPrefix.replace), '');
+                        // code = code.replace(new RegExp(rationPrefix.replace), '');
                         updateRationCodes.push({'node':ptNode, value:code});
                     }
                     projectObj.project.Ration.updateRationCodes(updateRationCodes);
@@ -1920,7 +1920,9 @@ $('#downLevel').click(function () {
     }
 });
 $('#insertRation').click(function () {
-    projectObj.project.Ration.addNewRation(null,rationType.ration);
+    // projectObj.project.Ration.addNewRation(null,rationType.ration);
+    // 连续点工具栏的插入定额按钮,显示树结构画线有问题。
+    projectObj.project.Ration.addNewRationFast(rationType.ration);
 });
 $('#upMove').click(function () {
     var controller = projectObj.mainController, project = projectObj.project;
@@ -2693,6 +2695,7 @@ $(function () {
         //恢复选择表高度
         $('#uploadSheets').height('');
         $('#uploadSheets').hide();
+        $('#uploadSheetsHead').hide();
     });
 
     $("#billsSpread").mouseover(function(){

+ 2 - 0
web/building_saas/main/js/views/std_billsGuidance_lib.js

@@ -22,6 +22,8 @@ const billsGuidance = (function () {
         tree: null,
         controller: null,
         treeSetting: {
+            emptyRowHeader: true,
+            rowHeaderWidth: 15,
             treeCol: 0,
             emptyRows: 0,
             headRows: 1,

+ 4 - 2
web/building_saas/main/js/views/std_bills_lib.js

@@ -330,6 +330,8 @@ var billsLibObj = {
         });
     },
     stdBillsTreeSetting: {
+        "emptyRowHeader": true,
+        "rowHeaderWidth": 15,
         "treeCol": 0,
         "emptyRows":0,
         "headRows":1,
@@ -338,7 +340,7 @@ var billsLibObj = {
         ],
         "defaultRowHeight": 21,
         "cols":[{
-            "width":160,
+            "width":140,
             "readOnly": true,
             "head":{
                 "titleNames":["项目编码"],
@@ -355,7 +357,7 @@ var billsLibObj = {
                 "font":"Arial"
             }
         }, {
-            "width":220,
+            "width":190,
             "readOnly": true,
             "head":{
                 "titleNames":["项目名称"],

+ 5 - 4
web/building_saas/main/js/views/std_ration_lib.js

@@ -116,10 +116,10 @@ var rationLibObj = {
         sheet.suspendPaint();
         sheet.suspendEvent();
         for(let i = 0, len = sheet.getRowCount(); i < len; i++){
-            sheet.setTag(i, 1, '');
+            sheet.setTag(i, 0, '');
         }
         for(let i = 0, len = datas.length; i < len; i++){
-            sheet.setTag(i, 1, datas[i].hint ? datas[i].hint : '');
+            sheet.setTag(i, 0, datas[i].hint ? datas[i].hint : '');
         }
         sheet.resumePaint();
         sheet.resumeEvent();
@@ -189,6 +189,8 @@ var rationLibObj = {
         });
     },
     rationChapterTreeSetting: {
+        "emptyRowHeader": true,
+        "rowHeaderWidth": 15,
         "emptyRows":0,
         "headRows":1,
         "headRowHeight":[30],
@@ -221,6 +223,7 @@ var rationLibObj = {
         "cols":[{
             "width":60,
             "readOnly": true,
+            "showHint": true,
             "head":{
                 "titleNames":["编码"],
                 "spanCols":[1],
@@ -238,7 +241,6 @@ var rationLibObj = {
         }, {
             "width":220,
             "readOnly": true,
-            "showHint": true,
             "head":{
                 "titleNames":["名称"],
                 "spanCols":[1],
@@ -318,7 +320,6 @@ var rationLibObj = {
         }
         return parseInt(projectInfoObj.projectInfo.engineeringInfo.ration_lib[0].id);
     }
-
 };
 
 addEventOnResize(rationLibObj.refreshSettingForHint);