浏览代码

树结构添加标识

zhongzewei 7 年之前
父节点
当前提交
47df3d57d2

+ 5 - 1
public/web/tree_sheet/tree_sheet_helper.js

@@ -103,8 +103,12 @@ var TREE_SHEET_HELPER = {
     },
     refreshTreeNodeData: function (setting, sheet, nodes, recursive) {
         nodes.forEach(function (node) {
+            let iRow = node.serialNo();
+            let nodeStyle = projectObj.getNodeColorStyle(node);
+            //test
+            sheet.setStyle(iRow, -1, nodeStyle);
+            //test
             setting.cols.forEach(function (colSetting, iCol) {
-                var iRow = node.serialNo();
                 var cell = sheet.getCell(iRow, iCol, GC.Spread.Sheets.SheetArea.viewport);
 
                 // var getFieldText = function () {

+ 1 - 1
web/building_saas/complementary_ration_lib/html/dinge.html

@@ -430,11 +430,11 @@
         </div>
         <!-- JS. -->
         <script type="text/javascript" src = "/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
+        <script type="text/javascript" src="/lib/jquery/jquery-3.2.1.min.js"></script>
         <script type="text/javascript" src="/lib/jquery-contextmenu/jquery.contextMenu.min.js"></script>
         <script type="text/javascript" src="/lib/jquery-contextmenu/jquery.ui.position.js"></script>
         <!--inject:js-->
         <script>GC.Spread.Sheets.LicenseKey = "559432293813965#A0y3iTOzEDOzkjMyMDN9UTNiojIklkI1pjIEJCLi4TPB9mM5AFNTd4cvZ7SaJUVy3CWKtWYXx4VVhjMpp7dYNGdx2ia9sEVlZGOTh7NRlTUwkWR9wEV4gmbjBDZ4ElR8N7cGdHVvEWVBtCOwIGW0ZmeYVWVr3mI0IyUiwCMzETN8kzNzYTM0IicfJye&Qf35VfiEzRwEkI0IyQiwiIwEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNyMzM5ADI5ADNwcTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56ciojIz5GRiwiI8+Y9sWY9QmZ0Jyp96uL9v6L0wap9biY9qiq95q197Wr9g+89iojIh94Wiqi";</script>
-        <script type="text/javascript" src="/lib/jquery/jquery-3.2.1.min.js"></script>
         <script type="text/javascript" src="/lib/popper/popper.min.js"></script>
         <script type="text/javascript" src="/lib/bootstrap/bootstrap.min.js"></script>
         <script type="text/javascript" src="/web/building_saas/complementary_ration_lib/js/global.js"></script>

+ 5 - 1
web/building_saas/complementary_ration_lib/js/ration_coe.js

@@ -243,12 +243,16 @@ var rationCoeOprObj = {
             ration.rationCoeList.length == 0){return;};*/
 
         var coeList = ration.rationCoeList;
+        let coeIDs = [];
+        for(let i = 0, len = coeList.length; i < len; i++){
+            coeIDs.push(coeList[i].ID);
+        }
         var curCache = me.cache["_Coe_" + ration.ID];
         if (curCache) {
             me.showCoeItems(ration.ID);
             //sheetCommonObj.lockCells(me.sheet, me.setting);
         } else if(!curCache && typeof coeList !== 'undefined' && coeList.length > 0) {
-            var data = {"libID": me.libID, "coeIDs": coeList};
+            var data = {"libID": me.libID, "coeIDs": coeIDs};
             CommonAjax.post('api/getCoeItemsByIDs', data, function (rstData) {
                 sheetCommonObj.cleanData(me.sheet, me.setting, -1);
                 var tempResult = [];

+ 6 - 3
web/building_saas/main/js/views/calc_base_view.js

@@ -79,7 +79,10 @@ let calcBaseView = {
         let cols = this.setting.header;
         let fuc = function () {
             sheet.setRowCount(datas.length);
-            sheet.setFormatter(-1, 1, '@');
+            //sheet.setFormatter(-1, 1, '@');
+            let style = new GC.Spread.Sheets.Style();
+            style.formatter = MainTreeCol.getNumberFormatter(decimalObj.bills.totalPrice, true);
+            sheet.setStyle(-1, 1, style);
             for(let col = 0, cLen = cols.length; col < cLen; col++){
                 sheet.getRange(-1, col, -1, 1).hAlign(GC.Spread.Sheets.HorizontalAlign[cols[col]['hAlign']]);
                 sheet.getRange(-1, col, -1, 1).vAlign(GC.Spread.Sheets.VerticalAlign[cols[col]['vAlign']]);
@@ -212,11 +215,11 @@ let calcBaseView = {
         }
         CalcBaseCellType.prototype = new ns.CellTypes.Text();
         CalcBaseCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
-            if(value!=null){
+          //  if(value!=null){
                // ctx.fillText(value,x+3+ctx.measureText(value).width,y+h-3);
                // ctx.fillText(value,x+w-3,y+h-3);
                 GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
-            }
+           // }
             if(calcBaseView.editingCell){
                 if(calcBaseView.editingCell.row==options.row&&calcBaseView.editingCell.col==options.col){
                     var image = document.getElementById('f_btn'),imageMagin = 3;

+ 3 - 3
web/building_saas/main/js/views/fee_rate_view.js

@@ -251,10 +251,10 @@ var feeRateObject={
         }
         FeeRateEditCellType.prototype = new ns.CellTypes.Text();
         FeeRateEditCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
-            if(value!=null){
+           // if(value!=null){
                // ctx.fillText(value,x+3+ctx.measureText(value).width,y+h-3);
-                ctx.fillText(value,x+w-3,y+h-3);
-            }
+             GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
+           // }
             if(feeRateObject.editingCell){
                 if(feeRateObject.editingCell.row==options.row&&feeRateObject.editingCell.col==options.col){
                     var image = document.getElementById('f_btn'),imageMagin = 3;

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

@@ -158,9 +158,6 @@ let projFeatureView = {
         let me = projFeatureView;
         let items = sheetCommonObj.analyzePasteData(me.setting, args);
         let recRows = [];
-        console.log(args);
-        console.log(items);
-        console.log('enter');
         if(items.length === 0){
             return;
         }

+ 63 - 0
web/building_saas/main/js/views/project_view.js

@@ -834,6 +834,69 @@ var projectObj = {
                 isTotalShowing = true;
             }, 200);
         };
+    },
+    //根据节点获取行style(颜色、字体加粗)
+    getNodeColorStyle: function (node) {
+        let type, backColor = null, font = null;
+        if(!isDef(node)){
+            return null;
+        }
+        //清单大类
+        if(node.sourceType === this.project.Bills.getSourceType()){
+            //大项费用
+            if(node.data.type === billType.DXFY){
+                type = 0;
+            }
+            //分部
+            if(node.data.type === billType.FB){
+                type = 1;
+            }
+            //分项
+            else if(node.data.type === billType.FX){
+                type = 2;
+            }
+            //清单
+            else if(node.data.type === billType.BILL){
+                //非叶子节点的清单
+                if(node.source.children.length > 0){
+                    type = 1;
+                }
+                //未使用基数计算的叶子节点的清单
+                else if(node.source.children.length === 0 && (!isDef(node.data.calcBase) || node.data.calcBase === '')){
+                    type = 2;
+                }
+                //使用基数计算的叶子节点的清单
+                else if(node.source.children.length === 0 && isDef(node.data.calcBase && node.data.calcBaseValue !== '')){
+                    type = 3;
+                }
+            }
+        }
+        //定额下的主材、设备
+        else if(node.sourceType === this.project.ration_glj.getSourceType()){
+            type = 4;
+        }
+        switch (type){
+            case 0: font = 'bold 15px "Arial"'; break;
+            case 1: backColor = '#c1d3e3'; break;
+            case 2: backColor = '#dae5ee'; break;
+            case 3: backColor = '#e5f3f2';  break;
+            case 4: backColor = '#4DBCFB';   break;
+        }
+        if(!font && !backColor){
+            return null;
+        }
+        let style = new GC.Spread.Sheets.Style();
+        if(font){
+            style.font = 'bold 15px "Arial"';
+        }
+        if(backColor){
+            style.backColor = backColor;
+            style.borderLeft = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
+            style.borderTop = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
+            style.borderRight = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
+            style.borderBottom = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
+        }
+        return style;
     }
 };
 // 点击合计框中的复制

+ 1 - 0
web/building_saas/pm/html/project-management.html

@@ -503,6 +503,7 @@
 <script src="/public/web/date_util.js"></script>
 <script src="/public/web/tree_table/tree_table.js"></script>
 <script type="text/javascript" src="/public/web/common_ajax.js"></script>
+<script src="/lib/JSExpressionEval_src/Date.js"></script>
 <script src="/web/building_saas/pm/js/pm_ajax.js"></script>
 <script src="/web/building_saas/pm/js/pm_main.js" charset="UTF-8"></script>
 <script src="/web/building_saas/pm/js/pm_gc.js"></script>

+ 2 - 3
web/building_saas/pm/js/pm_gc.js

@@ -233,9 +233,8 @@ function v_getFiles(type, files){
     for(let i = 0, len = files.length; i < len; i ++){
         let recName = type === fileType.unitPriceFile ?  files[i].name + '单价文件' : files[i].name + '费率文件';
         let fileId = type === fileType.unitPriceFile ? files[i].id : files[i].ID;
-        let recTime = new Date();
-        let recTimeA = recTime.Format('yyyy-MM-dd');
-        let recTimeB = recTime.Format('hh:mm:ss');
+        let recTimeA = formatDate(new Date(files[i].deleteInfo.deleteDateTime), 'yyyy-MM-dd');
+        let recTimeB = formatDate(new Date(files[i].deleteInfo.deleteDateTime), 'HH:mm:ss');
         html += '<tr><td>'+ recName +'</td><td>' + recTimeA + '<br>' + recTimeB + '</td><td><input name="fileItems" type="checkbox" fileId = "' + fileId + '" fileType = "' + type + '"></td></tr>';
     }
     return html;