Browse Source

定额编号下拉选择相邻定额功能,bugs

zhangweicheng 6 years ago
parent
commit
82f33c70c1

+ 1 - 2
modules/complementary_ration_lib/models/searchModel.js

@@ -22,8 +22,7 @@ class SearchDao{
             if(isDef(stdRation)){
             if(isDef(stdRation)){
                 ration = stdRation._doc;
                 ration = stdRation._doc;
                 ration.type = 'std';
                 ration.type = 'std';
-            }
-            else{
+            } else{
                 let compleQuery = {userId: userId, rationRepId: {$in: rationRepIds}, code: code, deleteInfo: null};
                 let compleQuery = {userId: userId, rationRepId: {$in: rationRepIds}, code: code, deleteInfo: null};
                 if(ID){
                 if(ID){
                     compleQuery = {ID: ID, deleteInfo: null};
                     compleQuery = {ID: ID, deleteInfo: null};

+ 5 - 0
modules/main/controllers/ration_controller.js

@@ -32,6 +32,11 @@ let controller = {
         }
         }
         data = JSON.parse(data);
         data = JSON.parse(data);
         return await ration_facade.addMultiRation(data.newDatas,req.session.sessionCompilation);
         return await ration_facade.addMultiRation(data.newDatas,req.session.sessionCompilation);
+    },
+    getSameSectionRations:async function(req){//取同个章节相邻的定额
+        let data = req.body.data;
+        data = JSON.parse(data);
+        return await ration_facade.getSameSectionRations(data,req.session.sessionUser.id);
     }
     }
 };
 };
 
 

+ 30 - 1
modules/main/facade/ration_facade.js

@@ -16,6 +16,9 @@ let rationInstallationModel = mongoose.model('ration_installation');
 const uuidV1 = require('uuid/v1');
 const uuidV1 = require('uuid/v1');
 let std_glj_lib_gljList_model = mongoose.model('std_glj_lib_gljList');
 let std_glj_lib_gljList_model = mongoose.model('std_glj_lib_gljList');
 let complementary_glj_model =  mongoose.model('complementary_glj_lib');
 let complementary_glj_model =  mongoose.model('complementary_glj_lib');
+let rationItemModel = mongoose.model("std_ration_lib_ration_items");
+let complementaryGljModel = mongoose.model('complementary_glj_lib');
+
 let coeMolde = mongoose.model('std_ration_lib_coe_list');
 let coeMolde = mongoose.model('std_ration_lib_coe_list');
 let _= require('lodash');
 let _= require('lodash');
 const projectDao = require('../../pm/models/project_model').project;
 const projectDao = require('../../pm/models/project_model').project;
@@ -25,7 +28,8 @@ const fs = require('fs');
 module.exports = {
 module.exports = {
     replaceRations: replaceRations,
     replaceRations: replaceRations,
     addNewRation:addNewRation,
     addNewRation:addNewRation,
-    addMultiRation: addMultiRation
+    addMultiRation: addMultiRation,
+    getSameSectionRations:getSameSectionRations
 };
 };
 async function addNewRation(data,compilation) {
 async function addNewRation(data,compilation) {
     let query = data.itemQuery;
     let query = data.itemQuery;
@@ -60,6 +64,31 @@ async function addMultiRation(datas,compilation) {
     return rst;
     return rst;
 }
 }
 
 
+async function getSameSectionRations(data,userId){
+    //let userId
+    //要先根据定额获取所属章节的ID
+    let from = data.from;    //定额类型,是标准的还是用户定义的
+    let code = data.code;
+    let libID = data.libID;
+    let sectionId,rations=[];
+    if(from == 'std'){
+        let ration = await rationItemModel.findOne({rationRepId:libID,code:code},['sectionId']);
+        sectionId = ration.sectionId
+    }else {
+        let ration = await complementaryGljModel.findOne({userId:userId,code:code},['sectionId']);
+        sectionId = ration.sectionId
+    }
+    if(sectionId){
+        //{
+        let stdRations = await rationItemModel.find({sectionId: sectionId});
+        let comRations = await complementaryGljModel.find({userId: userId, sectionId: sectionId});
+        rations = stdRations.concat(comRations);
+        rations = _.sortBy(rations,'code');
+    }
+    return rations
+}
+
+
 async function  updateSerialNo(serialNoUpdate){
 async function  updateSerialNo(serialNoUpdate){
     let tasks=[];
     let tasks=[];
     for(let data of serialNoUpdate){
     for(let data of serialNoUpdate){

+ 1 - 1
modules/main/routes/ration_route.js

@@ -13,6 +13,6 @@ module.exports = function (app) {
     rationRouter.post('/replaceRations', rationController.action);
     rationRouter.post('/replaceRations', rationController.action);
     rationRouter.post('/addNewRation', rationController.action);
     rationRouter.post('/addNewRation', rationController.action);
     rationRouter.post('/addMultiRation', rationController.action);
     rationRouter.post('/addMultiRation', rationController.action);
-
+    rationRouter.post('/getSameSectionRations', rationController.action);
     app.use('/ration', rationRouter);
     app.use('/ration', rationRouter);
 };
 };

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

@@ -304,7 +304,7 @@ var sheetCommonObj = {
                 $editor.css("background", "white");
                 $editor.css("background", "white");
                 $editor.css("width", cellRect.width);
                 $editor.css("width", cellRect.width);
                 $editor.attr("gcUIElement", "gcEditingInput");
                 $editor.attr("gcUIElement", "gcEditingInput");
-                if(htmlGenerator) $editor.html(htmlGenerator(context,cellRect));
+                if(htmlGenerator) htmlGenerator(context,cellRect,$editor);
             }
             }
         }
         }
         CustomerCoeCellType.prototype.deactivateEditor = function (editorContext, context) {
         CustomerCoeCellType.prototype.deactivateEditor = function (editorContext, context) {
@@ -823,6 +823,16 @@ var sheetCommonObj = {
         ctx.stroke();
         ctx.stroke();
         ctx.restore();
         ctx.restore();
     },
     },
+    drowTriangle:function(ctx,x,y){//画向下三角形
+        ctx.save();
+        ctx.fillStyle = "black";
+        ctx.beginPath();
+        ctx.moveTo(x, y);
+        ctx.lineTo(x-3, y -6);
+        ctx.lineTo(x+3, y -6);
+        ctx.fill();
+        ctx.restore();
+    },
     drowSubItem: function (ctx, x, y, w, h, offset, hasNext,step) {
     drowSubItem: function (ctx, x, y, w, h, offset, hasNext,step) {
         let t_step = step?step:6;
         let t_step = step?step:6;
         offset += t_step;
         offset += t_step;

+ 167 - 71
public/web/tree_sheet/tree_sheet_helper.js

@@ -53,6 +53,8 @@ var TREE_SHEET_HELPER = {
         this.massOperationSheet(sheet, function () {
         this.massOperationSheet(sheet, function () {
             if(setting.rowHeaderWidth !== undefined && setting.rowHeaderWidth !== null){
             if(setting.rowHeaderWidth !== undefined && setting.rowHeaderWidth !== null){
                 sheet.setColumnWidth(0, setting.rowHeaderWidth, GC.Spread.Sheets.SheetArea.rowHeader);
                 sheet.setColumnWidth(0, setting.rowHeaderWidth, GC.Spread.Sheets.SheetArea.rowHeader);
+            }else {
+                sheet.setColumnWidth(0, 25, GC.Spread.Sheets.SheetArea.rowHeader);
             }
             }
             if (setting.frozenCols) {
             if (setting.frozenCols) {
                 sheet.frozenColumnCount(setting.frozenCols);
                 sheet.frozenColumnCount(setting.frozenCols);
@@ -189,6 +191,8 @@ var TREE_SHEET_HELPER = {
                 if (colSetting.data.cellType && Object.prototype.toString.apply(colSetting.data.cellType) !== "[object String]") {
                 if (colSetting.data.cellType && Object.prototype.toString.apply(colSetting.data.cellType) !== "[object String]") {
                     cell.cellType(colSetting.data.cellType(node,setting));
                     cell.cellType(colSetting.data.cellType(node,setting));
                 }
                 }
+                //树节点显示列
+                if(iCol == setting.treeCol) cell.cellType(TREE_SHEET_HELPER.getTreeNodeCellType(setting, sheet, node.tree,node));
                 if(colSetting.data.autoHeight == true){
                 if(colSetting.data.autoHeight == true){
                     colSetting.setAutoHeight(cell,node);
                     colSetting.setAutoHeight(cell,node);
                 }
                 }
@@ -225,14 +229,94 @@ var TREE_SHEET_HELPER = {
        sheet.invalidateLayout();
        sheet.invalidateLayout();
     },
     },
     showTreeData: function (setting, sheet, tree) {
     showTreeData: function (setting, sheet, tree) {
+        let TipCellType = function () {};
+        TipCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
+        TipCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
+            return {
+                x: x,
+                y: y,
+                row: context.row,
+                col: context.col,
+                cellStyle: cellStyle,
+                cellRect: cellRect,
+                sheet: context.sheet,
+                sheetArea: context.sheetArea
+            };
+        };
+        TipCellType.prototype.processMouseEnter = function (hitinfo) {
+            let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
+            let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
+            let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
+            let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
+                zoom = hitinfo.sheet.zoom();
+            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();
+            let dataField = setting.cols[hitinfo.col].data.field;
+
+            if((tag==undefined||tag=='')&&hitinfo.sheet.getCell(hitinfo.row,hitinfo.col).wordWrap()==true){//显示其它列的标记为空并且设置了自动换行
+                return;
+            }
+            if(dataField === 'itemCharacterText' || dataField === 'jobContentText' || dataField === 'adjustState'||dataField=="name"){
+                if((hitinfo.sheet.getParent() === projectObj.mainSpread||hitinfo.sheet.getParent() === tender_obj.tenderSpread) && textLength <= cellWidth)
+                 return;
+            }
+
+            if(hitinfo.sheet.name()=="mainSheet"){
+                if(dataField=="quantity"){//显示工程量明细
+                    text = tag;
+                }/*if(dataField=="name"){//项目特征及内容隐藏时,显示特征及内容
+                 if(projectObj.ifItemCharHiden(setting)&&tag!=''){
+                 text = tag;
+                 }else if(textLength <= cellWidth){
+                 return;
+                 }
+                 }*/
+                else if(tag !== undefined && tag) {
+                    text = tag;
+                }
+            }
+
+            TREE_SHEET_HELPER.showTipsDiv(text,setting,hitinfo);
+        };
+        TipCellType.prototype.processMouseLeave = function (hitinfo) {
+            TREE_SHEET_HELPER.hideTipsDiv();
+        }
+
+        TREE_SHEET_HELPER.protectdSheet(sheet);
+        TREE_SHEET_HELPER.massOperationSheet(sheet, function () {
+            sheet.rowOutlines.direction(GC.Spread.Sheets.Outlines.OutlineDirection.backward);
+            sheet.showRowOutline(false);
+            if (setting.defaultRowHeight) {
+                sheet.defaults.rowHeight = setting.defaultRowHeight;
+            }
+            sheet.setRowCount(tree.count() + setting.emptyRows, GC.Spread.Sheets.SheetArea.viewport);
+            sheet.getRange(tree.count(), -1, setting.emptyRows, -1).locked(true);
+            setting.cols.forEach(function (colSetting, iCol) {
+                sheet.setStyle(-1, iCol, TREE_SHEET_HELPER.getSheetCellStyle(colSetting));
+                if (colSetting.showHint) {
+                    sheet.getRange(-1, iCol, -1, 1).cellType(new TipCellType());
+                }
+                if(colSetting.formatter){
+                    sheet.setFormatter(-1, iCol, colSetting.formatter, GC.Spread.Sheets.SheetArea.viewport);
+                }
+            });
+            //sheet.getRange(-1, setting.treeCol, -1, 1).cellType(new TreeNodeCellType());
+            TREE_SHEET_HELPER.refreshTreeNodeData(setting, sheet, tree.roots, true);
+            TREE_SHEET_HELPER.refreshNodesVisible(tree.roots, sheet, true);
+        });
+    },
+    getTreeNodeCellType:function(setting, sheet,tree,initNode){
         let indent = 20;
         let indent = 20;
         let levelIndent = -5;
         let levelIndent = -5;
         let halfBoxLength = 5;
         let halfBoxLength = 5;
         let halfExpandLength = 3;
         let halfExpandLength = 3;
+        let isRationNode = sheet.name()=="mainSheet" && initNode.sourceType == ModuleNames.ration;
+
 
 
         let TreeNodeCellType = function () {
         let TreeNodeCellType = function () {
+            this.clickDropDown = false; //如果是点击下拉框的三角形的时候,默认展开下拉框
         };
         };
-        TreeNodeCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
+        TreeNodeCellType.prototype =isRationNode? new GC.Spread.Sheets.CellTypes.Base(): new GC.Spread.Sheets.CellTypes.Text();//new GC.Spread.Sheets.CellTypes.Text();
         TreeNodeCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
         TreeNodeCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
             if (style.backColor) {
             if (style.backColor) {
                 ctx.save();
                 ctx.save();
@@ -332,10 +416,17 @@ var TREE_SHEET_HELPER = {
                     parentCenterX -= (indent + levelIndent);
                     parentCenterX -= (indent + levelIndent);
                 }
                 }
             };
             };
+
             // Draw Text
             // Draw Text
             x = x + (node.depth() + 1) * indent +  node.depth() * levelIndent;
             x = x + (node.depth() + 1) * indent +  node.depth() * levelIndent;
             w = w - (node.depth() + 1) * indent - node.depth() * levelIndent;
             w = w - (node.depth() + 1) * indent - node.depth() * levelIndent;
             GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
             GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
+            //画下拉框三角形
+            let sheet = options.sheet;
+            if (isRationNode&& options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex()) {
+                sheetCommonObj.drowTriangle(ctx,x+w-12,y+h/2+2);
+            }
+
         };
         };
         TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
         TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
             return {
             return {
@@ -352,6 +443,13 @@ var TREE_SHEET_HELPER = {
             let offset = -1;
             let offset = -1;
             let node = tree.items[hitinfo.row];
             let node = tree.items[hitinfo.row];
             tree.selected = node;
             tree.selected = node;
+            if(isRationNode &&hitinfo.row === hitinfo.sheet.getActiveRowIndex() && hitinfo.col === hitinfo.sheet.getActiveColumnIndex()){
+                if( hitinfo.x > hitinfo.cellRect.x + hitinfo.cellRect.width - 17){
+                    this.clickDropDown = true;
+                    setTimeout(function () {hitinfo.sheet.startEdit();},10);
+                    return;
+                }
+            }
             if (!node || node.children.length === 0) { return; }
             if (!node || node.children.length === 0) { return; }
             let centerX = hitinfo.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
             let centerX = hitinfo.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
             let centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2;
             let centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2;
@@ -378,10 +476,10 @@ var TREE_SHEET_HELPER = {
                 });
                 });
                 hitinfo.sheet.repaint();
                 hitinfo.sheet.repaint();
             }
             }
+
         };
         };
         TreeNodeCellType.prototype.processMouseEnter = function(hitinfo){
         TreeNodeCellType.prototype.processMouseEnter = function(hitinfo){
             if(hitinfo.sheet.name() === 'stdBillsGuidance_bills'){
             if(hitinfo.sheet.name() === 'stdBillsGuidance_bills'){
-
                 TREE_SHEET_HELPER.delayShowTips(hitinfo,setting);
                 TREE_SHEET_HELPER.delayShowTips(hitinfo,setting);
             }
             }
         };
         };
@@ -399,81 +497,79 @@ var TREE_SHEET_HELPER = {
             TREE_SHEET_HELPER.hideTipsDiv();
             TREE_SHEET_HELPER.hideTipsDiv();
         };
         };
 
 
-        let TipCellType = function () {};
-        TipCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
-        TipCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
-            return {
-                x: x,
-                y: y,
-                row: context.row,
-                col: context.col,
-                cellStyle: cellStyle,
-                cellRect: cellRect,
-                sheet: context.sheet,
-                sheetArea: context.sheetArea
+        if(isRationNode){
+            TreeNodeCellType.prototype.createEditorElement = function (context) {
+                return document.createElement("div");
             };
             };
-        };
-        TipCellType.prototype.processMouseEnter = function (hitinfo) {
-            let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
-            let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
-            let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
-            let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
-                zoom = hitinfo.sheet.zoom();
-            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();
-            let dataField = setting.cols[hitinfo.col].data.field;
 
 
-            if((tag==undefined||tag=='')&&hitinfo.sheet.getCell(hitinfo.row,hitinfo.col).wordWrap()==true){//显示其它列的标记为空并且设置了自动换行
-                return;
-            }
-            if(dataField === 'itemCharacterText' || dataField === 'jobContentText' || dataField === 'adjustState'||dataField=="name"){
-                if((hitinfo.sheet.getParent() === projectObj.mainSpread||hitinfo.sheet.getParent() === tender_obj.tenderSpread) && textLength <= cellWidth)
-                 return;
-            }
+            TreeNodeCellType.prototype.activateEditor = function (editorContext, cellStyle, cellRect, context) {
+                $editor = $(editorContext);
+                $editor.css("position", "fixed");
+                $editor.css("background", 'white');
+                $editor.css("width", cellRect.width);
+                $editor.css("height", cellRect.height);
+                $editor.attr("gcUIElement", "gcEditingInput");//padding:0
+                $editor.html(` <div class="input-group input-group-sm">
+                                <input type="text" id="esInput" class="form-control" aria-label="Text input with dropdown button" autocomplete="off" value="${context.sheet.getValue(context.row,context.col)}"  style="background-color:${cellStyle.backColor}">
+                                <div class="">                           
+                                    <div class="triangle-border_dropdown tb-border_dropdown" id="esBtn" style="left: ${cellRect.width - 15+"px"}"></div>
+                                </div>
+                            </div>
+                `);
+                // <div class = "input-group-append"><button class="btn btn-outline-secondary dropdown-toggle" id="esBtn"  type="button"  aria-haspopup="true" aria-expanded="false"></button></div>
+                $editor.children('div').height(cellRect.height+2);
+                return $editor;
+            };
 
 
-            if(hitinfo.sheet.name()=="mainSheet"){
-                if(dataField=="quantity"){//显示工程量明细
-                    text = tag;
-                }/*if(dataField=="name"){//项目特征及内容隐藏时,显示特征及内容
-                 if(projectObj.ifItemCharHiden(setting)&&tag!=''){
-                 text = tag;
-                 }else if(textLength <= cellWidth){
-                 return;
-                 }
-                 }*/
-                else if(tag !== undefined && tag) {
-                    text = tag;
-                }
-            }
+            TreeNodeCellType.prototype.updateEditor = function (editorContext, cellStyle, cellRect, context) {
+                let me = this;
+                console.log("updateEditor -------");
+                $(editorContext).append(`<div><ul class="es-list" style="display: block;background-color:${cellStyle.backColor}"></ul></div>`);//<li class="" data-value="" style=""> <br></li>
+                projectObj.project.Ration.getNearRations(initNode.data,function(rations){
+                    if(rations.length > 0){
+                        let li_html = "";
+                        for(let r of rations){
+                            if(r.code==initNode.data.code) continue; //排除自已
+                            li_html += `<li class="es_li" data-value="${r.code}" >${r.code} ${r.name} ${r.unit}</li>`;//定额编码+空格+定额名称+空格+定额单位。
+                        }
+                        $(".es-list").html(li_html);
+                        $(".es-list").css("min-width",cellRect.width);
+                    }
+                    if(me.clickDropDown == false) $(".es-list").hide();
 
 
-            TREE_SHEET_HELPER.showTipsDiv(text,setting,hitinfo);
-        };
-        TipCellType.prototype.processMouseLeave = function (hitinfo) {
-            TREE_SHEET_HELPER.hideTipsDiv();
+                    $(".es-list").children(".es_li").bind('click',function (e) {
+                        $('#esInput').val(this.dataset.value);
+                        $(".es-list").hide();
+                        context.sheet.endEdit();
+                    })
+                    $("#esBtn").bind('click',function(e){
+                        $(".es-list").toggle();
+                    });
+                });
+            };
+            TreeNodeCellType.prototype.setEditorValue = function (editor, value, context) {
+                /*   $('#esInput').val(value);
+                 this.displayText = "hehe";*/
+            };
+            TreeNodeCellType.prototype.getEditorValue = function (editor, context) {
+                console.log("get value");
+                /*if(this.isEscKey !=true&& updateCallback){
+                 updateCallback();
+                 }*/
+                this.isEscKey = false;
+                console.log($('#esInput').val());
+                return   $('#esInput').val();
+            };
+            TreeNodeCellType.prototype.isReservedKey = function (e, context) {
+                //cell type handle tab key by itself
+                this.isEscKey = e.keyCode === GC.Spread.Commands.Key.esc;
+                return false;
+            };
         }
         }
 
 
-        TREE_SHEET_HELPER.protectdSheet(sheet);
-        TREE_SHEET_HELPER.massOperationSheet(sheet, function () {
-            sheet.rowOutlines.direction(GC.Spread.Sheets.Outlines.OutlineDirection.backward);
-            sheet.showRowOutline(false);
-            if (setting.defaultRowHeight) {
-                sheet.defaults.rowHeight = setting.defaultRowHeight;
-            }
-            sheet.setRowCount(tree.count() + setting.emptyRows, GC.Spread.Sheets.SheetArea.viewport);
-            sheet.getRange(tree.count(), -1, setting.emptyRows, -1).locked(true);
-            setting.cols.forEach(function (colSetting, iCol) {
-                sheet.setStyle(-1, iCol, TREE_SHEET_HELPER.getSheetCellStyle(colSetting));
-                if (colSetting.showHint) {
-                    sheet.getRange(-1, iCol, -1, 1).cellType(new TipCellType());
-                }
-                if(colSetting.formatter){
-                    sheet.setFormatter(-1, iCol, colSetting.formatter, GC.Spread.Sheets.SheetArea.viewport);
-                }
-            });
-            sheet.getRange(-1, setting.treeCol, -1, 1).cellType(new TreeNodeCellType());
-            TREE_SHEET_HELPER.refreshTreeNodeData(setting, sheet, tree.roots, true);
-            TREE_SHEET_HELPER.refreshNodesVisible(tree.roots, sheet, true);
-        });
+
+        return new TreeNodeCellType();
+
     },
     },
     showTipsDiv:function (text,setting,hitinfo) {
     showTipsDiv:function (text,setting,hitinfo) {
         if (setting.pos && text && text !== '') {
         if (setting.pos && text && text !== '') {

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

@@ -81,6 +81,26 @@ legend.legend{
     border-width:6px;
     border-width:6px;
     border-style:solid dashed dashed dashed;
     border-style:solid dashed dashed dashed;
 }
 }
+.triangle-border_dropdown {
+    position:absolute;
+    left:0px;
+    overflow:hidden;
+    width:0;
+    height:0;
+    border-width:4px;
+    z-index: 10;
+    border-style:solid dashed dashed dashed;
+}
+.tb-border_dropdown {
+    top:7px;
+    border-color:#000 transparent transparent transparent;
+}
+
+.tb-background_dropdown {
+    bottom:-11px;
+    border-color:#000 transparent transparent transparent;
+}
+
 .tb-border {
 .tb-border {
     bottom:-12px;
     bottom:-12px;
     border-color:#000 transparent transparent transparent;
     border-color:#000 transparent transparent transparent;
@@ -205,4 +225,27 @@ legend.legend{
 
 
 #toolToastBtn:active{
 #toolToastBtn:active{
     color:#354ea1
     color:#354ea1
-}
+}
+
+.select_input{
+    border:none;
+}
+
+.es-list>li:hover{
+    background: lightgrey;
+}
+.es-list>li{
+    font-size:13px;
+}
+.es-list{
+    white-space:nowrap;
+}
+
+.dropdown-toggle::after{
+    vertical-align:.5em
+}
+#esInput{
+    font-size:13px;
+    color: black;
+}
+

+ 7 - 4
web/building_saas/css/main.css

@@ -47,10 +47,13 @@ a{
 }
 }
 .top-msg{
 .top-msg{
     position: fixed;
     position: fixed;
-    top:0;
-    width:100%;
-    z-index: 999
+    top:10px;
+    width:900px;
+    z-index: 9999;
+    left:50%;
+    margin-left:-450px;
 }
 }
+
 .main {
 .main {
     position: relative;
     position: relative;
     background: #f7f7f9;
     background: #f7f7f9;
@@ -478,4 +481,4 @@ a{
     background:#F1F1F1;
     background:#F1F1F1;
     bottom:30px;
     bottom:30px;
     left:2px;
     left:2px;
-}
+}

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

@@ -42,7 +42,7 @@
 </div>-->
 </div>-->
     <div class="header">
     <div class="header">
          <div class="top-msg clearfix">
          <div class="top-msg clearfix">
-            <div class="alert alert-warning mb-0 py-0" role="alert" id="notify" style="display: none">
+            <div class="alert alert-warning alert-dismissible" role="alert" id="notify" style="display: none">
                 <button type="button" class="close" aria-label="Close" onclick="$('#notify').hide();">
                 <button type="button" class="close" aria-label="Close" onclick="$('#notify').hide();">
                   <span aria-hidden="true">&times;</span>
                   <span aria-hidden="true">&times;</span>
                 </button>
                 </button>

+ 9 - 0
web/building_saas/main/js/models/ration.js

@@ -747,6 +747,15 @@ var Ration = {
             }else {
             }else {
                 me.doContainUpdate(value,node);
                 me.doContainUpdate(value,node);
             }
             }
+        };
+        ration.prototype.getNearRations = function (ration,callback) {
+            if(ration&&ration.code && ration.code !=""){
+                CommonAjax.post("/ration/getSameSectionRations",{from:ration.from,code:ration.code,libID:ration.libID},function(rations){
+                    callback(rations);
+                })
+            }else {
+                callback([]);
+            }
 
 
         };
         };
         ration.prototype.doContainUpdate = function (value,node) {
         ration.prototype.doContainUpdate = function (value,node) {

+ 8 - 4
web/building_saas/main/js/views/zmhs_view.js

@@ -215,17 +215,21 @@ let zmhs_obj = {
         let recode = me.coeSheetData[args.row];
         let recode = me.coeSheetData[args.row];
         projectObj.project.ration_coe.adjustCoeClick(recode, newval);
         projectObj.project.ration_coe.adjustCoeClick(recode, newval);
     },
     },
-    generateHtmlString: function (context,cellRect) {//这里要改成动态的了,根据自定义系数内容生成对应的输入框
+    generateHtmlString: function (context,cellRect,$editor) {//这里要改成动态的了,根据自定义系数内容生成对应的输入框
         let me = zmhs_obj;
         let me = zmhs_obj;
         let height = cellRect.height;
         let height = cellRect.height;
-        let newString = "<div style='height:"+ height+"px'><div onclick='zmhs_obj.coeSheet.endEdit()' style='margin:-1px 1px 0px'>自定义系数</div></div><form style='margin-top:1px' ><table  width='100%'  cellpadding='0'  border='1px' bordercolor='#CCCCCC' cellspacing='0px' style='border-collapse:collapse;font-size: 10px;'>";
+        let offect = 0;
+        let newString = "<form style='margin-top:1px' ><table  width='100%'  cellpadding='0'  border='1px' bordercolor='#CCCCCC' cellspacing='0px' style='border-collapse:collapse;font-size: 10px;'>";
         let cus_coe =  me.coeSheetData[context.row];
         let cus_coe =  me.coeSheetData[context.row];
         if(cus_coe){
         if(cus_coe){
             for(let i =0;i< cus_coe.coes.length;i++){
             for(let i =0;i< cus_coe.coes.length;i++){
-                newString += me.getOneRow(cus_coe.coes[i].coeType, i, cus_coe.coes[i].coeType,height)
+                newString += me.getOneRow(cus_coe.coes[i].coeType, i, cus_coe.coes[i].coeType,height);
+                offect += height +1
             }
             }
         }
         }
-        newString += "</table></form>";
+        newString += "</table></form><div style='height:"+ height+"px'><div onclick='zmhs_obj.coeSheet.endEdit()' style='margin:-1px 1px 0px'>自定义系数</div></div>";
+        $editor.html(newString);
+        $editor.css("margin-top",-(offect+2));
         return newString;
         return newString;
     },
     },
     getOneRow: function (text, name, id,inputHeight) {
     getOneRow: function (text, name, id,inputHeight) {