Bläddra i källkod

Merge branch '1.0.0_online' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost into 1.0.0_online

zhongzewei 6 år sedan
förälder
incheckning
b4bec2944e

+ 1 - 1
public/web/sheet/sheet_common.js

@@ -319,7 +319,7 @@ var sheetCommonObj = {
                 $editor.css("position", "fixed");
                 $editor.css("background", "white");
                 //$editor.css("width", cellRect.width); 2018-11-15 改成固定列宽
-                $editor.css("width", 140);
+                $editor.css("width", 160);
                 $editor.attr("gcUIElement", "gcEditingInput");
                 if(htmlGenerator) htmlGenerator(context,cellRect,$editor);
             }

+ 8 - 0
public/web/slideResize.js

@@ -27,10 +27,18 @@ const SlideResize = (function() {
         let resizeParentWidth = resize.parent().width();
         let resizeDecimalWidth = fixedWidth / resizeParentWidth,
             otherDecimalWidth = 1 - resizeDecimalWidth;
+        if(bros.length > 2){ //当同层有多个子元素时,other 的宽度要排除其余的宽度
+            for(let i = 2; i< bros.length;i++){
+                otherDecimalWidth = otherDecimalWidth - $(bros[i]).width()/resizeParentWidth
+            }
+        }
+
         let resizePercentWidth = resizeDecimalWidth * 100 + '%',
             otherPercentWidth = otherDecimalWidth * 100 + '%';
         resize.css('width', resizePercentWidth);
         other.css('width', otherPercentWidth);
+
+
     }
 
     let mouseMoveCount = 0;

+ 0 - 1
web/building_saas/css/custom.css

@@ -274,7 +274,6 @@ legend.legend{
 .item_spread{
     width: 29.8%;
     float: left;
-    margin-top: -5px;
     background: #F1F1F1;
     word-wrap:break-word
 }

+ 62 - 8
web/building_saas/css/main.css

@@ -36,7 +36,7 @@ a{
     font-size: 1rem;
     height:38px;
     background:url(logo.png) no-repeat 0 0;
-    padding-left:40px;
+    padding-left:50px;
 }
 .header-logo div.v-title{
     font-size:11px;
@@ -169,6 +169,9 @@ a{
 .main-side.col-lg-0{
     width:0%;
 }
+.sidebar-middle{
+    height:80px;
+}
 .sidebar-bottom,.sidebar-bottom .col-lg-6,.sidebar-bottom .col-lg-12 {
     height:300px
 }
@@ -185,6 +188,14 @@ a{
     border-radius: 0;
     padding: 0.2em 0.5em
 }
+.bottom-tools {
+    height: 30px;
+    line-height: 30px;
+    background:#fff;
+    bottom:20px;
+    left:22px;
+    z-index: 999
+}
 .side-tabs .nav-tabs .nav-item {
     z-index: 999
 }
@@ -314,7 +325,7 @@ a{
 .bottom-content .tab-content .ovf-hidden{
     overflow: hidden;
 }
-.tn-nav{
+.tn-nav,.rn-nav{
     width:30px;
     height: 100%;
     border-left:1px solid #dee2e6 ;
@@ -326,6 +337,34 @@ a{
     background:#f7f7f9;
     cursor: pointer;
 }
+.rn-nav {
+    background: #f7f7f9
+}
+.rn-nav .nav{
+    padding: 0
+}
+.rn-nav .nav-tabs {
+    border:none;
+    margin-top:2px;
+}
+.rn-nav .nav-tabs .nav-link{
+    padding:0.8em 0.4em;
+    line-height: 16px
+}
+.rn-nav .nav-tabs .nav-link.active {
+    border:none;
+    background-color: #fff;
+    border-left:1px solid #fff;
+    margin-left:-1px;
+    border-top:1px solid #ccc;
+    border-bottom:1px solid #ccc;
+}
+.rn-nav .nav-tabs .nav-link span{
+    display:none;
+}
+.rn-nav .nav-tabs .nav-link.active span{
+    display: inline-block;
+}
 .form-signin {
     max-width: 500px;
     margin: 150px auto;
@@ -493,10 +532,25 @@ a{
 .navbar-crumb .f-nav li.focus .s-nav{
     display: block
 }
-.bottom-tools {
-    height: 30px;
-    line-height: 30px;
-    background:#F1F1F1;
-    bottom:25px;
-    left:0px;
+/*书签颜色*/
+.annotate-color-1{
+    background: #E2F2C5
+}
+.annotate-color-2{
+    background: #F9E2CF
+}
+.annotate-color-3{
+    background: #F2EFD9
+}
+.annotate-color-4{
+    background: #F5D1DA
+}
+.annotate-color-5{
+    background: #E3E3E3
+}
+.annotate-color-6{
+    background: #B6F3F2
 }
+.annotate-color-7{
+    background: #ECE0F5
+}

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

@@ -33,8 +33,7 @@ function autoFlashHeight(){
     $(".form-list").height($(window).height()-headerHeight);
     $('#comments').find('textarea').height($('#comments').height() - 25);
     typeof(adaptiveTzjnrWidth)== 'function' ?adaptiveTzjnrWidth():''
-    typeof MaterialController === 'object' ? MaterialController.initItemWidth() : '';
-    typeof zmhs_obj === 'object' ? zmhs_obj.loadSideResize() : '';
+    //typeof zmhs_obj === 'object' ? zmhs_obj.loadSideResize() : '';
 };
 
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 48 - 11
web/building_saas/main/html/main.html


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

@@ -220,15 +220,15 @@ let MaterialController = {
         if(selected&&parent){
             text = parent.data.itemCharacterText?parent.data.itemCharacterText.replace(/\n/g,"<br>"):"";
         }
-        if(text == "") {//为空的时候不显示
+       /* if(text == "") {//为空的时候不显示
             $("#replaceM").hide();
             $("#subSpread").removeClass("ration_glj_spread");
             $('#subSpread').css('width','');
             return;
-        }
-        $('#replaceM').css('margin-top',0);
-        this.toggleItemInit();
-        $("#replaceText").html(text);
+        }*/
+        //$('#replaceM').css('margin-top',0);
+        //this.toggleItemInit();
+        $("#itemCharacterText").html("<br>"+text);
     },
     //初始化人材机和项目特征文本两个区域的宽度,改变窗口大小时调用此方法,实时刷新
     initItemWidth: function () {

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

@@ -519,7 +519,8 @@ var gljOprObj = {
                 }else {
                     if($('#linkGLJ').hasClass('active')){
                         this.showRationGLJData(node);
-                        MaterialController.showReplaceDiv(node);
+                        subObj.showGljSubTabData();
+                       // MaterialController.showReplaceDiv(node);
                     }
                     if($('#linkAZZJF').hasClass('active')) installationFeeObj.showRationInstallationData(node);
                     if($('#linkMBZM').hasClass('active')) mbzm_obj.showMBZMData(node);
@@ -541,7 +542,7 @@ var gljOprObj = {
             MaterialController.hideReplaceDiv();
         }
         //子目换算
-        zmhs_obj.showZMHSData(node);
+        //zmhs_obj.showZMHSData(node);
         //   $('#dropdown').hide();
     },
     showMixRatio:function (node) {//显示组成物到定额工料机

+ 13 - 2
web/building_saas/main/js/views/mbzm_view.js

@@ -15,8 +15,8 @@ let mbzm_obj={
         header: [
             {headerName: "编码", headerWidth: 130, dataCode: "code", dataType: "String", formatter: "@"},
             {headerName: "模板类别", headerWidth: 260, dataCode: "name", dataType: "String", hAlign: "left"},
-            {headerName: "系数", headerWidth: 65, dataCode: "coe", dataType: "Number",validator:"number"},
             {headerName: "单位", headerWidth: 45, dataCode: "unit", dataType: "String", hAlign: "center",getText:'forUnit'},
+            {headerName: "系数", headerWidth: 65, dataCode: "coe", dataType: "Number",validator:"number"},
             {headerName: "工程量", headerWidth: 65, dataCode: "quantity", dataType: "Number",validator:"number"},
             {headerName: "关联类别", headerWidth: 100, dataCode: "type", dataType: "String"},
             {headerName: "清单位置", headerWidth: 200, dataCode: "position", hAlign: "left", dataType: "String",cellType:'selectButton',getText:'forPosition'},
@@ -81,7 +81,7 @@ let mbzm_obj={
                 if(template) {
                     $("#createLocation").val(template.createLocation);
                     let pcol = _.findIndex(this.setting.header,{dataCode:"position"});
-                    this.setting.header[pcol].visible = template.createLocation == 3?false:true;
+                    this.setting.header[pcol].visible = template.createLocation == this.locateMap.AFTERRATION?false:true;
                     datas = _.cloneDeep(template.templateList);
                 }
             }
@@ -289,7 +289,18 @@ let mbzm_obj={
                 }
             }
             if(billsID == ""){//也没有生成过的情况下,要自动生成清单
+                //2018-12-19  对于新生成的清单,根据新清单编码的前6位去查询有没有完全匹配的清单,有的话将这一节点做为新清单的父项清单
+                let subNodes=[];
+                //默认没有找到编码匹配的就挂在技术措施项目下
                 let parentNode = projectObj.project.Bills.getAutoParentNode("措施费用");
+                if(data.billsLocation.length >= 6){
+                    projectObj.mainController.tree.getAllSubNode(rootNode,subNodes);
+                    let tem_code = data.billsLocation.substr(0,6);
+                    let n_parentNode = _.find(subNodes,function (n) {
+                        return n.data.code == tem_code;
+                    });
+                    if(n_parentNode) parentNode = n_parentNode;
+                }
                 billsID = uuid.v1();
                 let newBill = {
                     ID:billsID,

+ 7 - 2
web/building_saas/main/js/views/side_tools.js

@@ -10,6 +10,9 @@ $(window).resize(function() {
     loadSideToolsHeight();
     //刷新主界面与各库中间的拖动条宽度:始终保持为一个宽度(在小窗口打开一个库,再放大窗口后,该拖动条宽度会变大)
     SlideResize.setResizeWidth($('#sideResize'));
+    subObj.initGljSubTab();
+    refreshSubSpread();
+
 });
 //造价书与各库左右拖动
 let sideResizeEles = {};
@@ -25,7 +28,8 @@ sideResizeEles.limit = {
     max: `$('#mainRow').width()-150`
 };
 SlideResize.horizontalSlide(sideResizeEles.eleObj, sideResizeEles.limit, function(){
-    MaterialController.showReplaceDiv();
+   // MaterialController.showReplaceDiv();
+    subObj.initGljSubTab();
     pageCCOprObj.resizeWidth();
     BillsElf.setColumnWidthByRate();
     projectObj.refreshMainSpread();
@@ -189,7 +193,8 @@ var sideToolsObj = {
         }
         adaptiveTzjnrWidth();
         autoFlashHeight();
-        MaterialController.showReplaceDiv();
+        subObj.initGljSubTab();
+        //MaterialController.showReplaceDiv();
         pageCCOprObj.resizeWidth();
         billsGuidance.refreshWorkBook();
         billsLibObj.refreshBillsSpread();

+ 95 - 3
web/building_saas/main/js/views/sub_view.js

@@ -10,6 +10,7 @@
 let subSpread = null;
 let subObj = {
     TZJNRrePercent:null,
+    showGljSubTab:false,
     initSubSpread:function () {
         //清单精灵
         BillsElf.buildSheet();
@@ -89,6 +90,54 @@ let subObj = {
             $(gljOprObj.billsTab).click();
         }
         projectObj.mainSpread.focus();
+    },
+    //初始化人材机和项目特征文本两个区域的宽度,改变窗口大小时调用此方法,实时刷新
+    initItemWidth:function (){
+        //总宽度
+        let totalWidth = $('#subItems').width();
+        //人材机和项目特征文本比例
+        const openWidth = 30;//打开项目特征工具条
+        let textVisible = $('#replaceText').is(':visible'),
+            //默认比例
+            textPercent = '15%',
+            rcjPercent = '85%';
+        //文本没显示,则打开工具条固定30px转换百分比
+        if (!subObj.showGljSubTab) {
+            textPercent = openWidth / totalWidth;
+            rcjPercent = 1 - textPercent;
+            textPercent = textPercent * 100 + '%';
+            rcjPercent = rcjPercent * 100 + '%';
+        }
+        //设置特征及内容与排版规则的比例
+        $('#subSpread').css('width', rcjPercent);
+        $('#itemTextDiv').css('width', textPercent);
+        //打开了项目特征,则继续加载人材机表和项目特征文本具体比例
+        if (subObj.showGljSubTab === true) {
+            let rg_sideResizeEles = MaterialController.getSideResize();
+            SlideResize.loadHorizonWidth(rg_sideResizeEles.eleObj.module,
+                [rg_sideResizeEles.eleObj.resize], [rg_sideResizeEles.eleObj.left, rg_sideResizeEles.eleObj.right]);
+            $("#gljSubDiv").width( $('#itemTextDiv').width() - rg_sideResizeEles.eleObj.resize.width() - 30)
+        }
+    },
+    initGljSubTab:function() {
+        if(!($('#linkGLJ').hasClass('active'))){
+            return;
+        }
+        if(this.showGljSubTab == true){
+            $("#gljSubDiv").show();
+            $("#rgResize").show();
+        } else {
+            $("#gljSubDiv").hide();
+            $("#rgResize").hide();
+        }
+        $("#subSpread").addClass("ration_glj_spread");
+        this.initItemWidth();
+    },
+    showGljSubTabData:function () {
+        this.initGljSubTab();
+        if($('#rnc-zm').is(':visible')) zmhs_obj.showCoeData();
+        if($('#rnc-fz').is(':visible')) zmhs_obj.showAssData();
+        refreshSubSpread();
     }
 };
 
@@ -97,8 +146,11 @@ let subObj = {
 $("#linkGLJ").click(function(){
     $("#subItems").children().hide();//控制显示subSpread,隐藏特征及内容spread
     //show
-    MaterialController.showReplaceDiv();
+    //MaterialController.showReplaceDiv();
+    subObj.showGljSubTabData();
     $("#subSpread").show();
+    $("#itemTextDiv").show();
+    $("#gljItemTab").show();
     pageCCOprObj.active = false;
     subSpread.options.allowUserDragFill = false;
     refreshSubSpread();
@@ -579,7 +631,8 @@ function refreshSubSpread(){
         if(MaterialController.spread) MaterialController.spread.refresh();
     }
     BillsElf.refreshWorkBook();
-    if($('#linkZMHS').hasClass('active')) zmhs_obj.refresh();
+    //if($('#linkZMHS').hasClass('active')) zmhs_obj.refresh();
+    if($('#rnc-zm').is(':visible')|| $('#rnc-fz').is(':visible')) zmhs_obj.refresh();
     if($('#linkMBZM').hasClass('active')) mbzm_obj.refresh();
 }
 
@@ -661,4 +714,43 @@ $('#linkGCLMX').on('shown.bs.tab', function () {
 
 $('#linkAZZJF').on('shown.bs.tab', function () {
     gljOprObj.showDataIfRationSelect(projectObj.project.mainTree.selected, '111111');
-});
+});
+
+$('.gljSubTab ul li a').bind('click',function () {
+    if($(this).hasClass("active")){//点击展开了后又点击了自身,这时要隐藏tab和修改本身class
+        subObj.showGljSubTab = false;
+        closeTab(this);
+        subSpread.focus();//要加上这个,不然右边侧栏的选中状态的border线不会消换
+    }else {
+        subObj.showGljSubTab = true;
+    }
+    subObj.initGljSubTab();
+    refreshSubSpread();
+});
+
+$('.gljSubTab ul li a').on('shown.bs.tab', function () {
+    if(this.hash == "#rnc-xm"){
+        MaterialController.showItemCharacterText();
+    }else if(this.hash == "#rnc-zm"){
+        zmhs_obj.initCoeSpread();
+        zmhs_obj.refresh();
+        zmhs_obj.showCoeData();
+    }else if(this.hash == "#rnc-fz"){
+        zmhs_obj.initAssSpread();
+        zmhs_obj.refresh();
+        zmhs_obj.showAssData();
+    }
+});
+
+function closeTab(elem) {
+    setTimeout(function () {
+        $(elem).removeClass("show");
+        $(elem).removeClass("active");
+        $(elem).attr("aria-selected",false);
+        $(elem.hash).removeClass("show");
+        $(elem.hash).removeClass("active");
+    },50);
+
+}
+
+

+ 41 - 28
web/building_saas/main/js/views/zmhs_view.js

@@ -45,30 +45,35 @@ let zmhs_obj = {
         }
     },
     initSpread:function () {
-        this.coeSpread = SheetDataHelper.createNewSpread($("#coeSpread")[0]);
-        sheetCommonObj.spreadDefaultStyle(this.coeSpread);
-        this.assSpread = SheetDataHelper.createNewSpread($("#assSpread")[0]);
-        sheetCommonObj.spreadDefaultStyle(this.assSpread);
-
-        this.coeSheet = this.coeSpread.getSheet(0);
-        sheetCommonObj.initSheet(this.coeSheet, this.coeSetting, 30);
-        this.coeSheet.name('ration_coe');
-        this.coeSheet.bind(GC.Spread.Sheets.Events.CellClick, this.onCoeCellClick);
-        this.coeSpread.bind(GC.Spread.Sheets.Events.ButtonClicked, this.onButtonClick);
-        this.coeSheet.bind(GC.Spread.Sheets.Events.ValueChanged,this.onCoeValueChange);
-        this.coeSheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function (e,args) {
-            args.sheet.repaint();
-        });
-
-
-        this.assSheet = this.assSpread.getSheet(0);
-        sheetCommonObj.initSheet(this.assSheet, this.assSetting, 30);
-        this.assSheet.bind(GC.Spread.Sheets.Events.EditEnded, this.onAssEditEnded);
-        this.assSheet.bind(GC.Spread.Sheets.Events.RangeChanged, this.onAssRangeChanged);
-        this.assSheet.name('ration_ass');
-        SheetDataHelper.protectdSheet(this.coeSheet);
-        if(projectReadOnly){
-            disableSpread(zmhs_obj.coeSpread);
+        this.initCoeSpread();
+        this.initAssSpread();
+    },
+    initCoeSpread:function () {
+        if(zmhs_obj.coeSpread == null){
+            this.coeSpread = SheetDataHelper.createNewSpread($("#coeSpread")[0]);
+            sheetCommonObj.spreadDefaultStyle(this.coeSpread);
+            this.coeSheet = this.coeSpread.getSheet(0);
+            sheetCommonObj.initSheet(this.coeSheet, this.coeSetting, 30);
+            this.coeSheet.name('ration_coe');
+            this.coeSheet.bind(GC.Spread.Sheets.Events.CellClick, this.onCoeCellClick);
+            this.coeSpread.bind(GC.Spread.Sheets.Events.ButtonClicked, this.onButtonClick);
+            this.coeSheet.bind(GC.Spread.Sheets.Events.ValueChanged,this.onCoeValueChange);
+            this.coeSheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function (e,args) {
+                args.sheet.repaint();
+            });
+            SheetDataHelper.protectdSheet(this.coeSheet);
+        }
+    },
+    initAssSpread:function () {
+        if(zmhs_obj.assSheet == null){
+            this.assSpread = SheetDataHelper.createNewSpread($("#assSpread")[0]);
+            sheetCommonObj.spreadDefaultStyle(this.assSpread);
+            this.assSheet = this.assSpread.getSheet(0);
+            sheetCommonObj.initSheet(this.assSheet, this.assSetting, 30);
+            this.assSheet.bind(GC.Spread.Sheets.Events.EditEnded, this.onAssEditEnded);
+            this.assSheet.bind(GC.Spread.Sheets.Events.RangeChanged, this.onAssRangeChanged);
+            this.assSheet.name('ration_ass');
+            SheetDataHelper.protectdSheet(this.assSheet);
         }
     },
     showCoeData:function (node) {
@@ -81,6 +86,8 @@ let zmhs_obj = {
         }
         sheetCommonObj.showData(this.coeSheet, this.coeSetting,coeList);
         if (coeList.length > 0) {
+            this.coeSheet.suspendPaint();
+            this.coeSheet.suspendEvent();
             for(let i =0;i<coeList.length;i++ ){
                 if(gljUtil.isDef(coeList[i].option_codes)&&coeList[i].option_codes!=""){
                     this.getComboBoxForCodes(coeList[i],i);//设置可选类型的下拉框
@@ -90,8 +97,13 @@ let zmhs_obj = {
                     this.coeSheet.setCellType(i, 1, sheetCommonObj.getCustomerCoeCellType(this.generateHtmlString,this.bindCusEditorValue,this.updateCusCoeAfterEditor), GC.Spread.Sheets.SheetArea.viewport);
                 }
             }
+            this.coeSheet.resumeEvent();
+            this.coeSheet.resumePaint();
         }
         this.coeSheetData = coeList;
+        if(projectReadOnly){
+            disableSpread(zmhs_obj.coeSpread);
+        }
     },
     getComboBoxForCodes:function (coe,i) {
         this.coeSheet.getCell(i, 2, GC.Spread.Sheets.SheetArea.viewport).locked(false);
@@ -103,7 +115,6 @@ let zmhs_obj = {
 
     },
 
-
     showAssData:function (node) {
         this.assSheet.suspendPaint();
         this.assSheet.suspendEvent();
@@ -115,7 +126,9 @@ let zmhs_obj = {
         this.assSheet.getRange(assList.length,-1,this.assSheet.getRowCount()-assList.length, -1, GC.Spread.Sheets.SheetArea.viewport).locked(true);
         this.assSheet.resumePaint();
         this.assSheet.resumeEvent();
-
+        if(projectReadOnly){
+            disableSpread(this.assSpread);
+        }
     },
     refreshAfterUpdate:function(result,reload){
         let ration_glj = projectObj.project.ration_glj;
@@ -423,8 +436,8 @@ let zmhs_obj = {
     }
 };
 
-let zmhsResize = zmhs_obj.getSideResize();
+/*let zmhsResize = zmhs_obj.getSideResize();
 SlideResize.horizontalSlide(zmhsResize.eleObj, zmhsResize.limit, function () {
     zmhs_obj.refresh();
-});
+});*/