zhangweicheng 7 years ago
parent
commit
ae4c88462b

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

@@ -433,7 +433,7 @@ var TREE_SHEET_HELPER = {
             TREE_SHEET_HELPER.showTipsDiv(text,setting,hitinfo);
         };
         TipCellType.prototype.processMouseLeave = function (hitinfo) {
-            let me = this;
+            let me = TREE_SHEET_HELPER;
             TREE_SHEET_HELPER.tipDiv = 'hide';
             if (me._toolTipElement) {
                 $(me._toolTipElement).hide();

+ 17 - 1
web/building_saas/css/main.css

@@ -395,4 +395,20 @@ a{
 }
 .custom-file-input:lang(zh) ~ .custom-file-label::after {
     content: "浏览";
-}
+}
+/*.popover{position:absolute;
+    top:0;left:0;
+    z-index:1060;
+    display:block;
+    max-width:276px;
+    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;
+    background-color:black;
+    background-clip:padding-box;
+    border:1px solid black;
+    border-radius:.3rem}*/
+
+/*
+.arrow{
+    background-color:black;
+}
+*/

+ 1 - 1
web/building_saas/fee_rates/fee_rate.html

@@ -3,7 +3,7 @@
 <div >
 <div class="toolsbar_feeRate px-1 ">
     <div class="form-inline py-1">
-        <label class="mx-2" >当前使用:<span id="feeRateFileName">费率1</span>(<label class="a_color" id="pop-lv"><span id="projectCount">3</span> 个单位工程使用</label>)
+        <label  class="mx-2" >当前使用:<span id="feeRateFileName">费率1</span>(<label class="a_color" id="pop-lv"><span id="projectCount">3</span> 个单位工程使用</label>)
             <a class="btn btn-sm ml-1" href="#" data-toggle="modal" data-target="#change-lv" id="changFeeRateFile"><i class="fa fa-exchange"></i> 选择其他</a>
             <a class="btn btn-sm ml-1" href="#" data-toggle="modal" id="saveAs" data-target="#copy-lv"><i class="fa fa-files-o"></i> 另存单独用</a></label>
     </div>

+ 4 - 9
web/building_saas/main/js/views/fee_rate_view.js

@@ -917,22 +917,17 @@ var feeRateObject={
 function getPopoverContent() {
     var feeRateFile = projectObj.project.FeeRate.getActivateFeeRate();
     var usageProjects = feeRateFile.usageProjects;
-    var popover_content = "";
-    _.forEach(usageProjects,function (p,index) {
-        if(index>0){
-            popover_content+='<br>';
-        }
-        popover_content+=p.name;
-    })
+    let names = _.map(usageProjects,'name');
+    let popover_content = names.join('<br>');
     return popover_content;
 }
 
 $(function(){
-    $('#pop-lv').popover({
+    $('#pop-lv').tooltip({
             placement:"bottom",
             html:true,
             trigger:"hover | focus",
-            content:getPopoverContent
+            title:getPopoverContent
         }
     );
 

+ 10 - 10
web/building_saas/main/js/views/glj_col.js

@@ -36,13 +36,13 @@ let gljCol = {
             {headerName: "总消耗量", headerWidth: 90, dataCode: "quantity", hAlign: "right", dataType: "Number",decimalField:'glj.quantity'},
             {headerName: "暂估", headerWidth: 45, dataCode: "is_evaluate", hAlign: "center", dataType: "String",cellType:'checkBox'},
             {headerName: "主要\n材料", headerWidth: 45, dataCode: "is_main_material", hAlign: "center", dataType: "String",cellType:'checkBox'},
+            {headerName: "不调价", headerWidth: 55, dataCode: "is_adjust_price", dataType: "String",cellType: "checkBox"},
             {headerName: "供货方式", headerWidth: 70, dataCode: "supply", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:supplyComboMap},
             {headerName: "甲供数量", headerWidth: 90, dataCode: "supply_quantity", hAlign: "right", dataType: "Number",validator:"number",decimalField:'glj.quantity'},
             {headerName: "三材类别", headerWidth: 70, dataCode: "materialType", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:materialComboMap},
             {headerName: "三材系数", headerWidth: 70, dataCode: "materialCoe", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:'material'
             {headerName: "交货方式", headerWidth: 70, dataCode: "delivery", hAlign: "left", dataType: "String"},
             {headerName: "送达地点", headerWidth: 70, dataCode: "delivery_address", hAlign: "left", dataType: "String"},
-            {headerName: "不调价", headerWidth: 55, dataCode: "is_adjust_price", dataType: "String",cellType: "checkBox"},
             {headerName: "备注", headerWidth: 100, dataCode: "remark", hAlign: "left", dataType: "String"}
         ],
         view: {
@@ -52,15 +52,15 @@ let gljCol = {
     },
     mixRatio_Setting:{
         header:[
-            {headerName: "编码", headerWidth: 120, dataCode: "code", dataType: "String"},
-            {headerName: "名称", headerWidth: 120, dataCode: "name", dataType: "String"},
-            {headerName: "规格型号", headerWidth: 120, dataCode: "specs", dataType: "String"},
-            {headerName: "单位", headerWidth: 120, dataCode: "unit", hAlign: "center", dataType: "String"},
-            {headerName: "类型", headerWidth: 120, dataCode: "short_name", hAlign: "center", dataType: "String"},
-            {headerName: "定额价", headerWidth: 120, dataCode: "basePrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:'glj.unitPrice'
-            {headerName: "调整价", headerWidth: 120, dataCode: "adjustPrice", hAlign: "right", dataType: "Number"},//,decimalField:"glj.unitPrice"
-            {headerName: "市场价", headerWidth: 120, dataCode: "marketPrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
-            {headerName: "消耗量", headerWidth: 120, dataCode: "consumption", hAlign: "right", dataType: "Number",decimalField:"glj.quantity",validator:"number"}
+            {headerName: "编码", headerWidth: 80, dataCode: "code", dataType: "String"},
+            {headerName: "名称", headerWidth: 240, dataCode: "name", dataType: "String"},
+            {headerName: "规格型号", headerWidth: 190, dataCode: "specs", dataType: "String"},
+            {headerName: "单位", headerWidth: 45, dataCode: "unit", hAlign: "center", dataType: "String"},
+            {headerName: "类型", headerWidth: 45, dataCode: "short_name", hAlign: "center", dataType: "String"},
+            {headerName: "定额价", headerWidth: 80, dataCode: "basePrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:'glj.unitPrice'
+            {headerName: "调整价", headerWidth: 80, dataCode: "adjustPrice", hAlign: "right", dataType: "Number"},//,decimalField:"glj.unitPrice"
+            {headerName: "市场价", headerWidth: 80, dataCode: "marketPrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
+            {headerName: "消耗量", headerWidth: 80, dataCode: "consumption", hAlign: "right", dataType: "Number",decimalField:"glj.quantity",validator:"number"}
         ],
         view: {
             lockColumns: [0,1,2,3,4,5,6,7]

+ 34 - 20
web/building_saas/main/js/views/glj_view.js

@@ -553,12 +553,15 @@ var gljOprObj = {
         if(priceMap){
             for(let connectKey in priceMap){
                 let code = priceMap[connectKey].code;
+                let name = priceMap[connectKey].name;
+                let specs = priceMap[connectKey].specs;
                 if(code){
+                    let displayText = code +" "+name +" "+specs;
                    let preCode = code.split("-")[0];
                    if(codeMap[preCode]) {
-                       codeMap[preCode].push({text:code,value:connectKey});
+                       codeMap[preCode].push({text:displayText,value:connectKey});
                    }else {
-                       codeMap[preCode]=[{text:code ,value:connectKey}];
+                       codeMap[preCode]=[{text:displayText ,value:connectKey}];
                    }
                 }
             }
@@ -571,7 +574,8 @@ var gljOprObj = {
         this.sheet.suspendEvent();
         this.sheet.setRowCount(this.sheetData.length >30?this.sheetData.length:30);
         for (var i = 0; i < this.sheetData.length; i++) {
-            this.sheet.setCellType(i, 0,this.getTreeNodeCellType(this.sheetData,i,codeMap),GC.Spread.Sheets.SheetArea.viewport);
+            let options = this.getCodeOptions(this.sheetData[i],codeMap);
+            this.sheet.setCellType(i, 0,this.getTreeNodeCellType(this.sheetData,options),GC.Spread.Sheets.SheetArea.viewport);
             if (this.sheetData[i].hasOwnProperty('subList')) {
                 var collapsed = this.sheetData[i].collapsed == undefined ? true : this.sheetData[i].collapsed;
                 if (collapsed == true) {
@@ -582,6 +586,19 @@ var gljOprObj = {
         this.sheet.resumeEvent();
         this.sheet.resumePaint();
     },
+    getCodeOptions:function (recode,codeMap) {
+        let options = [];
+          if(recode.isMixRatio ===true){
+              return null;
+          }
+        let code = recode.code;
+        if(code) {
+            let preCode = code.split("-")[0];
+            if( codeMap[preCode]) options = codeMap[preCode];
+            if(options.length>0) _.remove(options,{'value':gljOprObj.getIndex(recode, gljKeyArray)})//去掉本身
+        }
+        return options;
+    },
     filterGljByRation: function (ration, datas) {
         var gljList = [];
         if (datas && datas.length > 0) {
@@ -1196,7 +1213,7 @@ var gljOprObj = {
         }
         return node;
     },
-    getTreeNodeCellType: function (data,index,codeMap) {
+    getTreeNodeCellType: function (data,comboboxOptions) {
         var ns = GC.Spread.Sheets;
         var rectW = 10;
         var rectH = 10;
@@ -1258,12 +1275,17 @@ var gljOprObj = {
             return offset;
         }
 
-        if(isDef(index) && data[index] && data[index].isMixRatio !==true){
-            TreeNodeCellType.prototype =  sheetCommonObj.getDynamicCombo();
-        }else {
-            TreeNodeCellType.prototype =  new ns.CellTypes.Text();
-        }
+        TreeNodeCellType.prototype =  comboboxOptions?sheetCommonObj.getDynamicCombo():new ns.CellTypes.Text();
+
         TreeNodeCellType.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);
+            }
             if (value != null) {
                 var offset = margin + rectW + 6;
                 var recode = data[options.row];
@@ -1283,7 +1305,7 @@ var gljOprObj = {
             }
         };
         TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
-            if(x < cellRect.x+cellRect.width -15){
+            if(x < cellRect.x+cellRect.width -15){//这里要判断点击的位置来决定return的内容,不能直接用combobox的方法
                 return {
                     x: x,
                     y: y,
@@ -1317,17 +1339,9 @@ var gljOprObj = {
            // GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
         };
         let cellType = new TreeNodeCellType();
-        let options = [];
-        if(isDef(index) && data[index] && data[index].isMixRatio !==true){
-            let code = data[index].code;
-            if(code) {
-                let preCode = code.split("-")[0];
-                if( codeMap[preCode]) options = codeMap[preCode];
-                if(options.length>0) _.remove(options,{'value':gljOprObj.getIndex(data[index], gljKeyArray)})//去掉本身
-
-            }
+        if(comboboxOptions){
             cellType.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
-            cellType.itemHeight(options.length).items(options);
+            cellType.itemHeight(comboboxOptions.length).items(comboboxOptions);
         }
         return cellType;
     },

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

@@ -1134,11 +1134,11 @@ $(function () {
      me.showProjectGljData();
      me.initMixRatio();
      });*/
-    $('#pop-used-list').popover({
+    $('#pop-used-list').tooltip({
             placement: "bottom",
             html: true,
             trigger: "hover | focus",
-            content: projectGljObject.getUsedTenderInfo
+            title: projectGljObject.getUsedTenderInfo
         }
     );
     // 单价文件切换弹框