zhangweicheng 7 years ago
parent
commit
9b3700c536

+ 24 - 0
modules/main/controllers/installation_controller.js

@@ -0,0 +1,24 @@
+/**
+ * Created by zhang on 2018/2/5.
+ */
+var installation_facade = require('../facade/installation_facade');
+let logger = require("../../../logs/log_helper").logger;
+module.exports={
+    updateInstallationFee:updateInstallationFee
+}
+async function  updateInstallationFee(req, res) {
+    let result={
+        error:0
+    }
+    try {
+        let data = req.body.data;
+        data = JSON.parse(data);
+        let datas= await installation_facade.updateInstallationFee(data.projectID,data.updateData);
+        result.data=datas;
+    }catch (err){
+        logger.err(err);
+        result.error=1;
+        result.message = err.message;
+    }
+    res.json(result);
+}

+ 60 - 5
modules/main/facade/installation_facade.js

@@ -9,8 +9,58 @@ let consts = require('../../main/models/project_consts')
 
 module.exports={
     copyInstallationFeeFromLib:copyInstallationFeeFromLib,
+    updateInstallationFee:updateInstallationFee,
     getData:getData
 };
+async function updateInstallationFee(projectID,updateData) {
+    let result = {};
+    let tasks = generateUpdateTask(projectID,updateData);
+    if(tasks.length>0){
+         result =await installationFeeModel.bulkWrite(tasks);
+    }
+    return result;
+}
+
+function generateUpdateTask(projectID,updateData) {
+    let tasks = [];
+    if(updateData instanceof Array){
+        for(let ud of updateData){
+            let [uquery,udoc] = createUpdateQuery(projectID,ud);
+            let task={
+                updateOne:{
+                    filter:uquery,
+                    update :udoc
+                }
+            };
+            tasks.push(task);
+        }
+    } else {
+        let [query,doc] = createUpdateQuery(projectID,updateData);
+        let task={
+            updateOne:{
+                filter:query,
+                update :doc
+            }
+        };
+        tasks.push(task);
+    }
+    return tasks;
+
+}
+
+function createUpdateQuery(projectID,data) {
+    let updateKey = data.type+'.ID';
+    let query = {
+        projectID:projectID,
+        ID:data.ID,
+    };
+    query[updateKey] = data.itemID;
+    let udoc = {};
+    for(let property in data.doc){
+        udoc[data.type+'.$.'+property] = data.doc[property];
+    }
+    return [query,udoc];
+}
 
 async function copyInstallationFeeFromLib(projectID,engineering_id) {
 
@@ -21,6 +71,7 @@ async function copyInstallationFeeFromLib(projectID,engineering_id) {
     for(let rl of ration_lib){
        let installFeeItems = await installFeeItemModel.find({'rationRepId':rl.id});
        let installSections = await installSectionModel.find({'rationRepId':rl.id});
+       let positionMap = {};
        let newInstallationFee = {
            libID:rl.id,
            libName:rl.name,
@@ -38,6 +89,7 @@ async function copyInstallationFeeFromLib(projectID,engineering_id) {
                     position:ifee.position,
                     ID:ifee.ID
                 };
+               positionMap[ifee.ID] = ifee.position;//设置选取位置对应表,为给规项赋值
                tem_installFeeItem.push(tem_fee);
            }
            newInstallationFee.installFeeItem = tem_installFeeItem;
@@ -50,8 +102,8 @@ async function copyInstallationFeeFromLib(projectID,engineering_id) {
            for(let isect of installSections){
                 let tem_sec={
                     ID:isect.ID,
-                    feeItemId:isect.feeItemId,
-                    name:isect.name
+                    name:isect.name,
+                    feeItemId:isect.feeItemId
                 };
                 if(isect.feeRule && isect.feeRule.length > 0){//规则项
                     tem_sec.feeRuleId = isect.feeRule[0].ID; //选中第一个
@@ -64,12 +116,15 @@ async function copyInstallationFeeFromLib(projectID,engineering_id) {
                             feeRate: ifeeR.feeRate,
                             labour: ifeeR.labour,
                             material: ifeeR.material,
-                            machine: ifeeR.machine
+                            machine: ifeeR.machine,
+                            sectionId:isect.ID,
+                            feeItemId:isect.feeItemId,
+                            position:positionMap[isect.feeItemId]
                         };
-                        tem_feeRule.sectionId = isect.ID;
-                        tem_feeRule.feeItemId = isect.feeItemId;
                         tem_feeRules.push(tem_feeRule);
                     }
+                }else {
+                    tem_sec.feeRuleId = "";
                 }
                tem_installSections.push(tem_sec);
            }

+ 7 - 4
modules/main/models/installation_fee.js

@@ -15,7 +15,9 @@ let feeRuleSchema = new Schema({
     feeRate: Number,
     labour: Number,
     material: Number,
-    machine: Number
+    machine: Number,
+    position: String,//记取位置
+    billID:String//记取位置对应的清单ID
 });
 
 //安装增加费-分册章节
@@ -23,8 +25,7 @@ let installSectionSchema = new Schema({
     ID: String,
     feeItemId: String,
     feeRuleId: String,
-    name: String,
-    position: String//记取位置
+    name: String
 });
 
 //安装增加费-费用项
@@ -32,7 +33,9 @@ let installFeeItemSchema = new Schema({
     ID: String,
     feeItem: String, //费用项
     feeType: String, //费用类型
-    position: String//记取位置
+    position: String,//记取位置
+    billID:String,//记取位置对应的清单ID
+    isCal: {type: Number,default:0}//是否记取0:false 1:true
 });
 
 let installationFeeSchema = new Schema({

+ 15 - 0
modules/main/routes/installation_route.js

@@ -0,0 +1,15 @@
+/**
+ * Created by zhang on 2018/2/5.
+ */
+
+let express = require('express');
+let installationController = require('../controllers/installation_controller');
+
+module.exports = function (app) {
+    let installationRouter = express.Router();
+
+    installationRouter.post('/updateInstallationFee', installationController.updateInstallationFee);
+
+
+    app.use('/installation',installationRouter);
+};

+ 4 - 1
public/web/id_tree.js

@@ -664,7 +664,10 @@ var idTree = {
         Tree.prototype.bind = function (eventName, eventFun) {
             this.event[eventName] = eventFun;
         };
-
+        Tree.prototype.getNodeByID = function (ID) {
+            let node = this.nodes[this.prefix+ID];
+            return node;
+        };
         return new Tree(setting);
     },
     updateType: {update: 'update', new: 'new', delete: 'delete'}

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

@@ -153,6 +153,12 @@ var sheetCommonObj = {
                 if(val!=null&&setting.header[col].cellType === "checkBox"){
                     this.setCheckBoxCell(row,col,sheet,val)
                  }
+                 if(setting.header[col].cellType === "comboBox"){
+                     this.setComboBox(row,col,sheet,setting.header[col].options);
+                 }
+                if(setting.header[col].cellType === "selectButton"){
+                    this.setSelectButton(row,col,sheet,setting.header[col]);
+                }
                  if(setting.owner==='gljTree'){
                     if(setting.header[col].cellType === "checkBox"){
                         val==1?val:0;
@@ -227,6 +233,90 @@ var sheetCommonObj = {
         sheet.getCell(row, col).hAlign(GC.Spread.Sheets.HorizontalAlign.center);
 
     },
+    setComboBox(row,col,sheet,options){
+        //let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
+        let dynamicCombo = sheetCommonObj.getDynamicCombo();
+        dynamicCombo.itemHeight(options.length).items(options);
+        sheet.setCellType(row, col,dynamicCombo,GC.Spread.Sheets.SheetArea.viewport);
+    },
+    setSelectButton(row,col,sheet,header){
+        let getSelectButton = function (cellWidth=100) {
+            function moreButton() {
+
+            }
+            moreButton.prototype = new GC.Spread.Sheets.CellTypes.Button();
+            moreButton.prototype.paint = function (ctx, value, x, y, w, h, style, options){
+                GC.Spread.Sheets.CellTypes.Button.prototype.paint.call(this, ctx, value, x, y, w, h, style, options);
+                let buttonW = cellWidth/5;
+                let endX = x+w-2;
+                if(value){
+                    let textWidth = ctx.measureText(value).width;
+                    let spaceWidth = cellWidth - buttonW;
+                    let textEndX = x+2+textWidth;
+                    if(spaceWidth<textWidth){
+                        for(let i = value.length-1;i>1;i--){
+                            let newValue = value.substr(0,i);
+                            let newTestWidth =  ctx.measureText(newValue).width;
+                            if(spaceWidth>newTestWidth){
+                                value = newValue;
+                                textEndX = x+2+newTestWidth;
+                                break;
+                            }
+                        }
+                    }
+                    ctx.fillText(value,textEndX,y+h-5);
+                }
+
+                //画三个点
+                ctx.save();
+                ctx.beginPath();
+                ctx.arc(endX-buttonW/2,y+h/2,1,0,360,false);
+                ctx.arc(endX-buttonW/2-4,y+h/2,1,0,360,false);
+                ctx.arc(endX-buttonW/2+4,y+h/2,1,0,360,false);
+                ctx.fillStyle="black";//填充颜色,默认是黑色
+                ctx.fill();//画实心圆
+                ctx.closePath();
+                ctx.restore();
+            };
+
+            moreButton.prototype.processMouseLeave= function (hitinfo) {
+                let newCell = new selectButton();
+                hitinfo.sheet.setCellType(hitinfo.row, hitinfo.col, newCell, GC.Spread.Sheets.SheetArea.viewport);
+                hitinfo.sheet.getCell(hitinfo.row, hitinfo.col).locked(false);
+            };
+
+            function selectButton() {
+            }
+
+            selectButton.prototype = new GC.Spread.Sheets.CellTypes.Text();
+
+            selectButton.prototype.paint = function (ctx, value, x, y, w, h, style, options){
+                GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this,arguments);
+            };
+            selectButton.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
+                return {
+                    x: x,
+                    y: y,
+                    row: context.row,
+                    col: context.col,
+                    cellStyle: cellStyle,
+                    cellRect: cellRect,
+                    sheetArea: context.sheetArea
+                };
+            };
+            selectButton.prototype.processMouseDown = function (hitinfo){
+                if(hitinfo.sheet.getCell(hitinfo.row,hitinfo.col).locked()!=true){
+                    let b1 = new moreButton();
+                    b1.marginLeft(cellWidth*4/5);
+                    hitinfo.sheet.setCellType(hitinfo.row, hitinfo.col, b1, GC.Spread.Sheets.SheetArea.viewport);
+                    hitinfo.sheet.getCell(hitinfo.row, hitinfo.col).locked(true);
+                }
+            };
+            return new selectButton();
+        };
+        sheet.setCellType(row, col,getSelectButton(header.headerWidth),GC.Spread.Sheets.SheetArea.viewport);
+
+    },
     chkIfEmpty: function(rObj, setting) {
         var rst = true;
         if (rObj) {
@@ -258,7 +348,6 @@ var sheetCommonObj = {
             let sheet = options.sheet;
             if (options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex() && (!forLocked || forLocked && !sheet.getCell(options.row, options.col).locked())) {
                 return GC.Spread.Sheets.CellTypes.ComboBox.prototype.getHitInfo.apply(this, arguments);
-
             } else {
                 return GC.Spread.Sheets.CellTypes.Base.prototype.getHitInfo.apply(this, arguments);
             }

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

@@ -337,4 +337,12 @@ div.resize{
 }
 .zlfb-check{
     margin-left: 0;
+}
+
+legend.legend{
+    display:block;
+    width:auto;
+    font-size:0.9rem;
+    top:-15px;
+    background: white;
 }

+ 60 - 35
web/building_saas/main/html/main.html

@@ -863,8 +863,8 @@
 
     <!--弹出 计取安装费用-->
     <div class="modal fade" id="calc_installation_fee" data-backdrop="static">
-        <div class="modal-dialog modal-lg" role="document">
-            <div class="modal-content">
+        <div class="modal-dialog modal-lg" style="max-width: 1100px" role="document">
+            <div class="modal-content" style="width: 1100px">
                 <div class="modal-header">
                     <h5 class="modal-title">统一设置计取安装费用</h5>
                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
@@ -872,42 +872,33 @@
                     </button>
                 </div>
                 <div class="modal-body">
-                    <div style="height:200px"><!--sjs id设置在这个div-->
-                        <div class="row">
-                            <div class="modal-auto-height col-8" style="overflow: hidden" id="feeItemSheet">
-                                test ....
-                            </div>
-                            <div class="modal-auto-height col-4" style="overflow: hidden" id="install_setting">
-                                <div style="height: 100px;border:1px solid #f00" >
-                                    <fieldset class="form-group" >
-                                        <h5>分项费用</h5>
-                                        <div class="form-check">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" name="install_setting_radios" id="all_project_calc" value="0" type="radio">
-                                                整个项目统一计取
-                                            </label>
-                                        </div>
-                                        <div class="form-check">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" name="install_setting_radios" id="FB_calc" value="1" type="radio">
-                                                每个分部单独计取
-                                            </label>
-                                        </div>
-                                    </fieldset>
-                                </div>
+                    <div class="row" style="height:300px"><!--sjs id设置在这个div-->
+                        <div class=" col-8" style="overflow: hidden" id="feeItemSheet">
+                        </div>
+                        <div class=" col-4" style="overflow: hidden" id="install_setting">
+                            <div style="height: 100px;" >
+                                <!--<div class="setting_title">整个项目统一计取</div>-->
+                                <fieldset class="form-group"  style="border:1px solid #b3b3b3;padding: 15px">
+                                    <legend class="legend" >分项费用:</legend>
+                                    <div class="form-check">
+                                        <label class="form-check-label">
+                                            <input class="form-check-input" name="install_setting_radios" id="all_project_calc" value="0" checked type="radio">
+                                            整个项目统一计取
+                                        </label>
+                                    </div>
+                                    <div class="form-check">
+                                        <label class="form-check-label">
+                                            <input class="form-check-input" name="install_setting_radios" id="FB_calc" value="1" type="radio">
+                                            每个分部单独计取
+                                        </label>
+                                    </div>
+                                </fieldset>
                             </div>
                         </div>
-                        <!--<table class="table table-sm table-bordered m-0">
-                            <thead><tr><th></th><th>计取</th><th>费用项</th><th>费用类型</th><th>记取位置</th></tr></thead>
-                            <tr><td>1</td><td></td><td>重庆市安装工程计价定额(2008)</td><td></td><td></td></tr>
-                            <tr><td>2</td><td><input type="checkbox"></td><td>-高层增加费</td><td>子目费用</td><td><a href="javacript:void(0);" data-toggle="modal" data-target="#jqaz-wz">点击</a></td></tr>
-                        </table>-->
                     </div>
-                    <div style="height:200px"><!--sjs id设置在这个div-->
-                        <table class="table table-sm table-bordered m-0">
-                            <thead><tr><th></th><th>分册章节</th><th>费用规则</th><th>编码</th><th>基数</th><th>费率(%)</th><th>其中人工(%)</th><th>其中材料(%)</th><th>其中机械(%)</th><th>记取位置</th></tr></thead>
-                            <tr><td>1</td><td>第一册 机械设备安装工程1~6、8~16章节</td><td>超高费(标高15m以内(第一册 机械设备安装工程1~6章节))</td><td>AZFY1</td><td>人材机乘系数</td><td></td><td>25</td><td></td><td>25</td><td><a href="javacript:void(0);" data-toggle="modal" data-target="#jqaz-wz">点击</a></td></tr>
-                        </table>
+                    <br>
+                    <div class="row" style="height:400px"><!--sjs id设置在这个div-->
+                        <div class="col-12" style="overflow: hidden" id="feeDetailSheet"></div>
                     </div>
                 </div>
                 <div class="modal-footer">
@@ -919,6 +910,40 @@
         </div>
     </div>
 
+    <!--弹出 指定具体位置(计取安装费用)-->
+    <div class="modal fade" id="calc_position" data-backdrop="static">
+        <input type="hidden" id ='calc_position_from'>
+        <div class="modal-dialog modal-lg"  role="document">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h5 class="modal-title">指定具体位置</h5>
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                        <span aria-hidden="true">&times;</span>
+                    </button>
+                </div>
+                <div class="modal-body">
+                    <div class="row mb-2">
+                        <div class="col-8">
+                            <div class="input-group input-group-sm">
+                                <input type="text" class="form-control" placeholder="输入编码 或 名称 " id="filterKeyword" aria-describedby="basic-addon2">
+                                <div class="input-group-append">
+                                    <button class="btn btn-secondary" id="positionSheetFilter" type="button"><i class="fa fa-search"></i> 过滤</button>
+                                    <button class="btn btn-outline-secondary" id="cancelFilter" type="button">取消过滤</button>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="row" style="height:400px"><!--sjs id设置在这个div-->
+                        <div class="col-12" style="overflow: hidden" id="positionSpread"></div>
+                    </div>
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                    <button class="btn btn-primary" id="select_position_confirm">确定</button>
+                </div>
+            </div>
+        </div>
+    </div>
         <!-- JS. -->
         <script type="text/javascript" src="/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
 

+ 8 - 1
web/building_saas/main/js/models/bills.js

@@ -512,7 +512,14 @@ var Bills = {
                 }
             }
         };
-
+        bills.prototype.getMeasureNode = function (controller) {//取措施项目工程节点
+            let roots =  controller.tree.roots;
+            for(let root of roots){
+                if(isFlag(root.data)&&root.data.flagsIndex.fixed.flag==fixedFlag.MEASURE){
+                    return root;
+                }
+            }
+        };
         bills.prototype.deleteSelectedNode=function(){//删除选中单行时的节点
             let controller = projectObj.mainController, project = projectObj.project;
             let selected = controller.tree.selected, parent = selected.parent;

+ 31 - 1
web/building_saas/main/js/models/installation_fee.js

@@ -22,7 +22,37 @@ var installation_fee = {
         installation_fee.prototype.loadData = function (datas) {
             this.datas = datas;
         };
-
+        installation_fee.prototype.getInstallationFeeByLibID=function(libID){
+            return _.find(this.datas,{'libID':libID});
+        };
+        installation_fee.prototype.getFeeRuleByFeeItem = function (feeItem) {
+            let installFee = projectObj.project.installation_fee.getInstallationFeeByLibID(feeItem.libID);
+            let impacRules = _.filter(installFee.feeRule,{'feeItemId':feeItem.ID});
+            return impacRules;
+        };
+        installation_fee.prototype.getFeeRuleBySection = function (section) {
+            let installFee = projectObj.project.installation_fee.getInstallationFeeByLibID(section.libID);
+            let impacRules = _.filter(installFee.feeRule,{'sectionId':section.ID});
+            return impacRules;
+        };
+        installation_fee.prototype.getInstallSectionsByfeeItemID=function(libID,feeItemId){
+            let installationFee = this.getInstallationFeeByLibID(libID);
+            let installSections = _.filter(installationFee.installSection,{'feeItemId':feeItemId});
+            return installSections;
+        };
+        installation_fee.prototype.getInstallSectionByID = function(libID,ID){
+            let installFee = projectObj.project.installation_fee.getInstallationFeeByLibID(libID);
+            return _.find(installFee.installSection,{'ID':ID});
+        };
+        installation_fee.prototype.getFeeRuleBySectionID=function(libID,sectionId){
+            let installationFee = this.getInstallationFeeByLibID(libID);
+            let feeRules = _.filter(installationFee.feeRule,{'sectionId':sectionId});
+            return feeRules;
+        };
+        installation_fee.prototype.getFeeRuleByID = function (libID,feeRuleID) {
+            let installationFee = this.getInstallationFeeByLibID(libID);
+            return _.find(installationFee.feeRule,{'ID':feeRuleID});
+        };
         // 提交数据后返回数据处理
         installation_fee.prototype.doAfterUpdate = function(err, data){
 

+ 3 - 0
web/building_saas/main/js/models/main_consts.js

@@ -283,3 +283,6 @@ const engineeringType = {
     // 安装修缮工程
     BUILD_IN_REPAIR: 14
 };
+
+const installFeeType = ['子目费用','分项费用','措施费用'];
+const installSectionBase = ['分别按人材机乘系数','人工','材料','机械'];

+ 640 - 17
web/building_saas/main/js/views/installation_fee_view.js

@@ -3,25 +3,133 @@
  */
 let installationFeeObj={
     rationInstallSheet:null,
-    installationFeeSpread:null,
-    rationInstallsetting: {
+    feeItemSpread:null,
+    feeItemSheet:null,
+    feeItemData:null,
+    feeItemSetting:{
         header: [
-            {headerName: "按统一设置", headerWidth: 100, dataCode: "name", dataType: "String"},
-            {headerName: "费用项", headerWidth: 120, dataCode: "stdValue", hAlign: "right", dataType: "String"},
-            {headerName: "费用规则", headerWidth: 120, dataCode: "actualValue", hAlign: "right", dataType: "String"},
-            {headerName: "编码", headerWidth: 120, dataCode: "actualValue", hAlign: "right", dataType: "String"},
-            {headerName: "基数", headerWidth: 120, dataCode: "actualValue", hAlign: "right", dataType: "String"},
-            {headerName: "费率(%)", headerWidth: 120, dataCode: "actualValue", hAlign: "right", dataType: "String"},
-            {headerName: "其中人工(%)", headerWidth: 120, dataCode: "actualValue", hAlign: "right", dataType: "String"},
-            {headerName: "其中材料(%)", headerWidth: 120, dataCode: "actualValue", hAlign: "right", dataType: "String"},
-            {headerName: "其中机械(%)", headerWidth: 120, dataCode: "actualValue", hAlign: "right", dataType: "String"},
-            {headerName: "费用类型", headerWidth: 120, dataCode: "actualValue", hAlign: "right", dataType: "String"},
-            {headerName: "记取位置", headerWidth: 120, dataCode: "actualValue", hAlign: "right", dataType: "String"}
+            {headerName: "计取", headerWidth: 90, dataCode: "isCal", dataType: "String",cellType: "checkBox"},
+            {headerName: "费用项", headerWidth: 300, dataCode: "feeItem", hAlign: "left", dataType: "String"},
+            {headerName: "费用类型", headerWidth: 100, dataCode: "feeType", hAlign: "center", dataType: "String",cellType:'comboBox',options:installFeeType},
+            {headerName: "记取位置", headerWidth: 140, dataCode: "displayPosition", hAlign: "left", dataType: "String",cellType:'selectButton'}
         ],
         view: {
-            lockColumns: [0, 1]
+            lockColumns: [0,1]
         }
     },
+    feeDetailSpread:null,
+    feeDetailSheet:null,
+    feeDetailData:null,
+    feeDetailSetting: {
+        header: [
+            {headerName: "分册章节", headerWidth: 150, dataCode: "name", dataType: "String"},
+            {headerName: "费用规则", headerWidth: 220, dataCode: "rule", hAlign: "left", dataType: "String"},
+            {headerName: "编码", headerWidth: 70, dataCode: "code", hAlign: "left", dataType: "String"},
+            {headerName: "基数", headerWidth: 80, dataCode: "base", hAlign: "left", dataType: "String"},
+            {headerName: "费率(%)", headerWidth: 80, dataCode: "feeRate", hAlign: "right", dataType: "String"},
+            {headerName: "其中人工(%)", headerWidth: 100, dataCode: "labour", hAlign: "right", dataType: "String"},
+            {headerName: "其中材料(%)", headerWidth: 100, dataCode: "material", hAlign: "right", dataType: "String"},
+            {headerName: "其中机械(%)", headerWidth: 100, dataCode: "machine", hAlign: "right", dataType: "String"},
+            {headerName: "记取位置", headerWidth: 100, dataCode: "position", hAlign: "left", dataType: "String",cellType:'selectButton'}
+        ],
+        view: {
+            lockColumns: [0, 2]
+        }
+    },
+    positionSpread:null,
+    positionSheet:null,
+    positionData:null,
+    selectionTree:null,
+    selectionTreeController:null,
+    positionSetting:{
+        "emptyRows":0,
+        "headRows":1,
+        "headRowHeight":[30],
+        "defaultRowHeight": 21,
+        "treeCol": 0,
+        "cols":[
+            {
+                "width":250,
+                "readOnly": true,
+                "head":{
+                    "titleNames":["编码"],
+                    "spanCols":[1],
+                    "spanRows":[1],
+                    "vAlign":[1],
+                    "hAlign":[1],
+                    "font":["Arial"]
+                },
+                "data":{
+                    "field":"code",
+                    "vAlign":1,
+                    "hAlign":0,
+                    "font":"Arial"
+                }
+             },
+            {
+                "width":100,
+                "readOnly": true,
+                "head":{
+                    "titleNames":["类别"],
+                    "spanCols":[1],
+                    "spanRows":[1],
+                    "vAlign":[1],
+                    "hAlign":[1],
+                    "font":["Arial"]
+                },
+                "data":{
+                    "field":"type",
+                    "vAlign":1,
+                    "hAlign":1,
+                    "font":"Arial"
+                }
+            },
+            {
+                "width":250,
+                "readOnly": true,
+                "head":{
+                    "titleNames":["名称"],
+                    "spanCols":[1],
+                    "spanRows":[1],
+                    "vAlign":[1],
+                    "hAlign":[1],
+                    "font":["Arial"]
+                },
+                "data":{
+                    "field":"name",
+                    "vAlign":0,
+                    "hAlign":0,
+                    "font":"Arial"
+                }
+            },
+            {
+                "width":100,
+                "readOnly": true,
+                "head":{
+                    "titleNames":["具体位置"],
+                    "spanCols":[1],
+                    "spanRows":[1],
+                    "vAlign":[1],
+                    "hAlign":[1],
+                    "font":["Arial"]
+                },
+                "data":{
+                    "field":"selected",
+                    "vAlign":1,
+                    "hAlign":1,
+                    "font":"Arial",
+                    "cellType":function (node) {
+                        if(node.data.canSelect == true){
+                            return new GC.Spread.Sheets.CellTypes.CheckBox();
+                        }
+                    }
+                }
+            }
+        ]
+
+    },
+    positionData:null,
+    positionSelectedObject:null,
     showCalcInstallSettingDiv:function () {
         $("#calc_installation_fee").modal({show:true});
     },
@@ -31,16 +139,531 @@ let installationFeeObj={
         if(engineering==engineeringType.BUILD_IN){//如果是安装工程,则显示
             $('#AZZJF_div').show();
         }
+    },
+    initInstallationFeeSpread:function(){
+        //初始化费用项表格
+      this.feeItemSpread = SheetDataHelper.createNewSpread($("#feeItemSheet")[0]);
+      this.feeItemSheet = this.feeItemSpread.getSheet(0);
+      this.initSheet(this.feeItemSheet,this.feeItemSetting);
+      this.feeItemSheet.name('feeItemSheet');
+
+      this.feeItemSheet.bind(GC.Spread.Sheets.Events.SelectionChanged, this.onFeeItemSelectionChange);
+      this.feeItemSpread.bind(GC.Spread.Sheets.Events.ButtonClicked, this.onSelectButtonClick);
+      this.showFeeItemData();
+
+      //初始化章节项表格
+       this.feeDetailSpread = SheetDataHelper.createNewSpread($("#feeDetailSheet")[0]);
+       this.feeDetailSheet = this.feeDetailSpread.getSheet(0);
+       this.initSheet(this.feeDetailSheet,this.feeDetailSetting);
+       this.feeDetailSheet.bind(GC.Spread.Sheets.Events.SelectionChanged,this.onFeeDetailSelectionChange);
+       this.feeDetailSpread.bind(GC.Spread.Sheets.Events.ButtonClicked, this.onSelectButtonClick);
+       this.feeDetailSheet.name('feeDetailSheet');
+       this.feeDetailSheet.setRowCount(0);
+    },
+    onFeeItemSelectionChange:function (e, info) {
+        let newSelections = info.newSelections;
+        let row = newSelections[0].row;
+        let selected = installationFeeObj.feeItemData[row];
+        if(selected&&selected.libID){//说明是选中了费用项
+            installationFeeObj.positionButtonChecking(row,selected);
+            installationFeeObj.showFeeDetailData(selected.libID,selected.ID);
+        }else {
+            installationFeeObj.showFeeDetailData();
+        }
+        installationFeeObj.feeItemSheet.repaint();
+    },
+    onFeeDetailSelectionChange:function (e,info) {
+
+        installationFeeObj.feeDetailSheet.repaint();
+    },
+    positionButtonChecking:function (row,recode) {//按钮有效性检查
+        if(recode.feeType){
+            installationFeeObj.feeItemSheet.getCell(row,3).locked(recode.feeType=='子目费用');
+        }
+    },
+    onSelectButtonClick:function (e,info) {
+        let sheet = info.sheet, row = info.row, col = info.col;
+        let cellType = sheet.getCellType(row, col);
+        if(cellType instanceof GC.Spread.Sheets.CellTypes.Button){
+            installationFeeObj.onPositionButtonClick(e,info);
+        }else {
+            installationFeeObj.onCalcCheckBoxClick(e,info);
+        }
+    },
+    onPositionButtonClick : function(e,info){//选取位置按钮
+        $('#calc_position_from').val(info.sheetName);
+        $('#calc_position').modal({show:true});
+    },
+    onCalcCheckBoxClick: function(e,info){
+        let me = installationFeeObj;
+        var checkboxValue = info.sheet.getCell(info.row, info.col).value();
+        var newval = 0;
+        if (checkboxValue) {
+            newval = 0;
+            info.sheet.getCell(info.row, info.col).value(newval);
+        } else {
+            newval = 1;
+            info.sheet.getCell(info.row, info.col).value(newval);
+        }
+        info.newValue = newval;
+        me.onFeeItemValueChange(e,info);
+    },
+    showFeeItemData:function () {
+        this.feeItemData = this.getFeeItemData(projectObj.project.installation_fee.datas);
+        this.feeItemSheet.setRowCount(0);
+        this.feeItemSheet.getRange(-1, 1, -1, 1).cellType(gljOprObj.getTreeNodeCellType(this.feeItemData));
+        sheetCommonObj.showData(this.feeItemSheet, this.feeItemSetting, this.feeItemData);
+        this.feeItemSheet.setRowCount(this.feeItemData.length);
+        for(let i =0 ;i < this.feeItemData.length;i++){
+            let data = this.feeItemData[i];
+            if(data.hasOwnProperty('subList')){//根节点不可编辑
+                this.feeItemSheet.getRange(i,-1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).locked(true);//this.feeItemSheet.getCell(i, 2).locked(true);
+                this.feeItemSheet.getRange(i,2,1,2).cellType(new GC.Spread.Sheets.CellTypes.Text());//费用类型、记取位置两列替换成普通的单元格;
+            }
+        }
+
+    },
+    showFeeDetailData:function (libID,feeItemId) {
+        this.feeDetailSheet.setRowCount(0);
+        if(libID&&feeItemId){
+            this.feeDetailData = this.getFeeDetailData(libID,feeItemId);
+        }else {
+            this.feeDetailData = []
+        }
+        sheetCommonObj.showData(this.feeDetailSheet, this.feeDetailSetting, this.feeDetailData);
+        this.feeDetailSheet.setRowCount(this.feeDetailData.length);
+        if(this.feeDetailData.length>0){
+            this.feeDetailSheet.suspendPaint();
+            this.feeDetailSheet.suspendEvent();
+            this.feeDetailSheet.getRange(0, -1, this.feeDetailData.length, -1, GC.Spread.Sheets.SheetArea.viewport).wordWrap(true);
+            let feeItem = this.feeItemData[this.feeItemSheet.getSelections()[0].row];
+            for(let i =0;i<this.feeDetailData.length;i++){
+                this.feeDetailSheet.autoFitRow(i);
+                this.setDetailRuleCell(i,this.feeDetailData[i]);//设置费用规则下拉选项
+                this.lockDetailSheet(i,this.feeDetailData[i],feeItem);
+            }
+            this.feeDetailSheet.resumeEvent();
+            this.feeDetailSheet.resumePaint();
+        }
+    },
+    lockDetailSheet:function(row,detail,feeItem){
+        if(detail.feeRuleId){//选中了规则项
+            for(let col=0;col<this.feeDetailSetting.header.length;col++) {
+                let header = this.feeDetailSetting.header[col];
+                if(header.dataCode=='feeRate'){
+                    let baseIndex = installSectionBase.indexOf(detail.base);
+                    if(baseIndex<1){
+                        this.feeDetailSheet.getCell(row,col).locked(true);
+                    }
+                }
+                if(header.dataCode=='position'){
+                    this.feeDetailSheet.getCell(row,col).locked(feeItem.feeType=='子目费用');
+                }
+            }
+        }else {//没有规则项则相关的单元格都锁定
+            this.feeDetailSheet.getRange(row, 3, 1, this.feeDetailSetting.header.length-3, GC.Spread.Sheets.SheetArea.viewport).locked(true);
+        }
+    },
+    setDetailRuleCell:function(row,detail){
+        let impactRules = projectObj.project.installation_fee.getFeeRuleBySection(detail);
+        let options=[{text:"无",value:""}];
+        for(let ir of impactRules){
+            options.push({text:ir.rule,value:ir.ID});
+        }
+        let dynamicCombo = sheetCommonObj.getDynamicCombo();//new GC.Spread.Sheets.CellTypes.ComboBox();
+        dynamicCombo.items(options);
+        dynamicCombo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
+        this.feeDetailSheet.setCellType(row, 1, dynamicCombo, GC.Spread.Sheets.SheetArea.viewport);
+    },
+    getFeeItemData:function (datas) {
+        let feeItemShowArray = [];
+        for(let d of datas){
+            let tem_Lib = {
+                feeItem:d.libName,
+                subList:d.installFeeItem,
+                collapsed:false
+            };
+            feeItemShowArray.push(tem_Lib);
+            if(d.installFeeItem && d.installFeeItem.length > 0){
+                for(let t_if of d.installFeeItem){
+                    t_if.installFeeID = d.ID,
+                    t_if.libID = d.libID;
+                    t_if.isMixRatio = true;
+                    t_if.displayPosition = this.getDisplayText(t_if);
+                    feeItemShowArray.push(t_if);
+                }
+            }
+        }
+        return feeItemShowArray;
+    },
+    getDisplayText:function (item) {
+        if(item.billID){
+            let node = projectObj.project.mainTree.getNodeByID(item.billID);
+            if(node){
+                return node.data.code +" "+node.data.name;
+            }
+
+        }
+        return  item.position;
+    },
+    getFeeDetailData : function(libID,feeItemId){
+        let feeDetailArr = [];
+        let installSections =projectObj.project.installation_fee.getInstallSectionsByfeeItemID(libID,feeItemId);
+        for(let is of installSections){
+            let tem_detail = {
+                ID:is.ID,
+                feeItemId:is.feeItemId,
+                name:is.name,
+                feeRuleId:is.feeRuleId,
+                libID:libID,
+                rule:is.feeRuleId,
+            };
+            if(is.feeRuleId){
+                let feeRule = projectObj.project.installation_fee.getFeeRuleByID(libID,is.feeRuleId);
+                if(feeRule){
+                    tem_detail.code = feeRule.code;
+                    tem_detail.base = feeRule.base;
+                    tem_detail.feeRate = feeRule.feeRate;
+                    tem_detail.labour = feeRule.labour;
+                    tem_detail.material = feeRule.material;
+                    tem_detail.machine = feeRule.machine;
+                    tem_detail.position = installationFeeObj.getDisplayText(feeRule);
+                    tem_detail.billID = feeRule.billID;
+                }
+            }
+            feeDetailArr.push(tem_detail);
+        }
+        return feeDetailArr;
+
+    },
+    initSheet: function (sheet,setting) {
+        var me = this;
+        sheetCommonObj.initSheet(sheet, setting, 30);
+        sheet.bind(GC.Spread.Sheets.Events.ValueChanged, me.onSheetValueChange);
+    },
+    initPositionSpread:function () {
+        this.positionSpread = SheetDataHelper.createNewSpread($('#positionSpread')[0]);
+        this.selectionTree = idTree.createNew({id: 'ID', pid: 'ParentID', nid: 'NextSiblingID', rootId: -1, autoUpdate: false});
+        this.selectionTreeController = TREE_SHEET_CONTROLLER.createNew(this.selectionTree, this.positionSpread.getActiveSheet(), this.positionSetting);
+        this.positionSheet = this.positionSpread.getActiveSheet();
+        this.positionSpread.bind(GC.Spread.Sheets.Events.ButtonClicked, this.onPositionCheckBoxClick);
+    },
+    onPositionCheckBoxClick:function (e,args) {
+        let me = installationFeeObj;
+        var checkboxValue = args.sheet.getCell(args.row, args.col).value();
+        var newval = 0;
+        if (checkboxValue) {
+            newval = 0;
+            args.sheet.getCell(args.row, args.col).value(newval);
+        } else {
+            newval = 1;
+            args.sheet.getCell(args.row, args.col).value(newval);
+        }
+        if(me.positionSelectedObject==null){//如果之前没选中任何一条记录,则记住选中位置
+            me.positionSelectedObject ={
+               row : args.row,
+               col: args.col,
+               recode:me.positionData[args.row]
+           }
+        }else {
+            if(args.row==me.positionSelectedObject.row){//如果是在已选中的记录中再点一次选中复框,则去掉选中记录
+                me.positionSelectedObject = null;
+            }else {//切换选中记录
+                //去掉之前选中位置的打勾
+                args.sheet.getCell(me.positionSelectedObject.row, me.positionSelectedObject.col).value(0);
+                me.positionSelectedObject ={
+                    row : args.row,
+                    col: args.col,
+                    recode:me.positionData[args.row]
+                }
+            }
+        }
+
+    },
+    loadSelectionNodes : function () {
+        this.positionData =this.getBillDataForSelect();
+        this.selectionTree.loadDatas(this.positionData);
+        this.selectionTreeController.showTreeData();
+    },
+    filterSelectionNodes:function () {
+        let keyword = $('#filterKeyword').val();
+        let resultData =[], newTreeIDs=[], newDatas = [];
+        let allPositionData = this.getBillDataForSelect();
+        if(keyword&&keyword!=""){//按关键字过滤出结果
+            resultData = _.filter(allPositionData,function (item) {
+                if(item.canSelect == true){
+                    if(item.code.indexOf(keyword)!=-1||item.name.indexOf(keyword)!=-1){
+                        return true;
+                    }
+                }
+            });
+        }
+        for(let tem of resultData){//取出所有父节点ID
+            let temNode = projectObj.project.mainTree.getNodeByID(tem.ID);
+            if(temNode){
+                getParentIDs(temNode,newTreeIDs);
+            }
+        }
+        if(newTreeIDs.length > 0){//生成过滤后的记录
+            for(let p_tem of allPositionData){
+                if(_.includes(newTreeIDs,p_tem.ID)){
+                    newDatas.push(p_tem);
+                }
+            }
+        }
+        this.positionData = newDatas;
+        this.selectionTree.loadDatas(this.positionData);
+        this.selectionTreeController.showTreeData();
+
+        function getParentIDs(temNode,idArrays) {
+            idArrays.push(temNode.data.ID);
+            if(temNode.parent!=null){
+                getParentIDs(temNode.parent,idArrays);
+            }
+        }
+    },
+    getBillDataForSelect:function () {
+        let controller = projectObj.mainController, project = projectObj.project;
+        let selection = this.feeItemSheet.getSelections()[0];
+        let from = $('#calc_position_from').val();
+        let feeItem = this.feeItemData[selection.row];
+        let rootNode = null;
+        let allNodes = [];
+        let datas = [];
+        let billID = null;
+        if(from =="feeItemSheet"){
+            if(feeItem.billID){
+                billID = feeItem.billID;
+            }
+        }
+        if(from =="feeDetailSheet") {
+            let detailSelection = this.feeDetailSheet.getSelections()[0];
+            let detail = this.feeDetailData[detailSelection.row];
+            if(detail.billID){
+                billID = detail.billID;
+            }
+        }
+
+        if(feeItem.feeType=='措施费用'){
+            rootNode = project.Bills.getMeasureNode(controller);
+        }else if(feeItem.feeType=='分项费用'){
+            rootNode = project.Bills.getFBFXNode(controller);
+        }
+        allNodes.push(rootNode);
+        controller.tree.getAllSubNode(rootNode.source,allNodes);
+        for(let n of allNodes){
+            let temData = {
+                ID:n.data.ID,
+                NextSiblingID:n.data.NextSiblingID,
+                ParentID:n.data.ParentID,
+                type : billText[n.data.type],
+                code : n.data.code,
+                name : n.data.name
+            };
+            //project.mainTree.selected.data.calcBase&&project.mainTree.selected.data.calcBase!=""
+            if(n.data.type == billType.FX){//分项才能选
+                temData.canSelect = true;
+            }else if(n.data.type == billType.BILL){//如果是清单类型,则是叶子节点并且没有使用基数计算的清单
+                if (n.children.length==0&&!(n.data.calcBase&&n.data.calcBase!="")){
+                    temData.canSelect = true;
+                }
+            }
+            if(billID&&n.data.ID == billID){
+                temData.selected = 1;
+                this.positionSelectedObject ={
+                    row : datas.length,
+                    col: 3,
+                    recode:temData
+                }
+            }
+            datas.push(temData);
+        }
+        return datas;
+    },
+    selectPositionConfirm:function () {
+        let pobj = this.positionSelectedObject;
+        let from = $('#calc_position_from').val();
+        if(pobj){
+            if(from=='feeItemSheet'){
+                this.updateFeeItemPosition(pobj.recode);
+            }else if(from=='feeDetailSheet'){
+                this.updateFeeRulePosition(pobj.recode);
+            }
+        }
+        $("#calc_position").modal('hide');
+    },
+    updateFeeRulePosition:function (recode) {
+        let me = this;
+        let itemSelection  = this.feeItemSheet.getSelections()[0];
+        let feeItem = this.feeItemData[itemSelection.row];
+        let detailSelection = this.feeDetailSheet.getSelections()[0];
+        let detail = this.feeDetailData[detailSelection.row];
+        let itemUpdateData = null;
+        let updateData = null;
+        if(detail.billID ==recode.ID ){//和原来的位置没变
+            return;
+        }
+        let detailUpdateData = me.getDetailUpdateData(detail,{position:recode.code,billID:recode.ID},'feeRule');
+        if(recode.ID!=feeItem.billID){//不一样的情况下要清空费用项的选取位置
+            itemUpdateData = me.getFeeItemUpdateData(feeItem,{ position: "", billID:""});
+        }
+        itemUpdateData==null?updateData = detailUpdateData:updateData=[detailUpdateData,itemUpdateData];
+        $.bootstrapLoading.start();
+        me.submitInstallationUpdate(updateData,function (data) {
+            //更新缓存
+            if(itemUpdateData){
+                feeItem.position ="";
+                feeItem.billID = "";
+                feeItem.displayPosition = "";
+                me.feeItemSheet.getCell(itemSelection.row, itemSelection.col).value(feeItem.displayPosition);
+            }
+            let feeRule = projectObj.project.installation_fee.getFeeRuleByID(feeItem.libID,detail.feeRuleId);
+            feeRule.position = recode.code;
+            feeRule.billID = recode.ID;
+            me.showFeeDetailData(feeItem.libID,feeItem.ID);
+            $.bootstrapLoading.end();
+        });
+    },
+    updateFeeItemPosition:function(recode){
+        let me = this;
+        let selection = this.feeItemSheet.getSelections()[0];
+        let feeItem = this.feeItemData[selection.row];
+        if(feeItem.billID ==recode.ID ){//和原来的位置没变
+            return;
+        }
+        let updateData = me.getFeeItemUpdateData(feeItem,{ position: recode.code, billID:recode.ID});
+        let [dataArray,impacRules] = me.getFeeRuleUpdateData(feeItem,recode);
+        dataArray.push(updateData);
+        $.bootstrapLoading.start();
+        me.submitInstallationUpdate(dataArray,function (data) {
+            //更新缓存
+            feeItem.position =recode.code;
+            feeItem.billID = recode.ID;
+            feeItem.displayPosition = recode.code + ' '+recode.name;
+            me.feeItemSheet.getCell(selection.row, selection.col).value(feeItem.displayPosition);
+            for(let ir of impacRules){
+                ir.position = recode.code;
+                ir.billID  = recode.ID;
+            }
+            me.showFeeDetailData(feeItem.libID,feeItem.ID);
+            $.bootstrapLoading.end();
+        });
+    },
+    getFeeRuleUpdateData : function (feeItem,recode) {
+        let dataArray = [];
+        let impacRules = projectObj.project.installation_fee.getFeeRuleByFeeItem(feeItem);
+        for(let ir of impacRules){
+            let tem_data = {
+                ID:feeItem.installFeeID,
+                itemID:ir.ID,
+                type:'feeRule',
+                doc:{position: recode.code, billID:recode.ID}
+            };
+            dataArray.push(tem_data);
+        }
+        return [dataArray,impacRules]
+    },
+    onSheetValueChange:function (e,info) {
+        if(info.sheetName=='feeItemSheet'){
+            installationFeeObj.onFeeItemValueChange(e,info);
+        }
+        if(info.sheetName == 'feeDetailSheet'){
+            installationFeeObj.onFeeDetailValueChange(e,info);
+        }
+    },
+    onFeeItemValueChange:function (e,info) {
+        let me = installationFeeObj;
+        let feeItem = this.feeItemData[info.row];
+        let header = this.feeItemSetting.header[info.col];
+        let doc={};
+        doc[header.dataCode] = info.newValue;
+        let updateData = installationFeeObj.getFeeItemUpdateData(feeItem,doc);
+        $.bootstrapLoading.start();
+        me.submitInstallationUpdate(updateData,function (data) {
+            //更新缓存
+            feeItem[header.dataCode]=info.newValue;
+            me.feeItemSheet.getCell(info.row, info.col).value(info.newValue);
+            $.bootstrapLoading.end();
+        });
+    },
+    onFeeDetailValueChange:function (e,info) {
+        console.log("value change");
+        let me = installationFeeObj;
+        let feeDetail = this.feeDetailData[info.row];
+        let header = this.feeDetailSetting.header[info.col];
+        let fiedID = header.dataCode;
+        let updateData = null;
+        if(fiedID == 'rule'){//选择新的规则项
+            updateData = me.getDetailUpdateData(feeDetail,{"feeRuleId":info.newValue},'installSection');
+        }
+        me.submitInstallationUpdate(updateData,function (data) {
+            if(updateData.type=="installSection"){
+                let section = projectObj.project.installation_fee.getInstallSectionByID(feeDetail.libID,feeDetail.ID);
+                section.feeRuleId = info.newValue;
+            }
+
+            me.showFeeDetailData(feeDetail.libID,feeDetail.feeItemId);
+        });
+    },
+    getDetailUpdateData : function (detail,doc,type) {//type:installSection/feeRule
+        let installationFee = projectObj.project.installation_fee.getInstallationFeeByLibID(detail.libID);
+        let updateData = {
+            ID:installationFee.ID,
+            itemID:type=="installSection"?detail.ID:detail.feeRuleId,
+            type:type,
+            doc:doc
+        };
+        return updateData;
+    },
+    getFeeItemUpdateData : function (item,doc) {
+        let updateData = {
+            ID:item.installFeeID,
+            itemID:item.ID,
+            type:'installFeeItem',
+            doc:doc
+        };
+        return updateData;
+    },
+    submitInstallationUpdate:function (updateData,callback) {
+        CommonAjax.post('/installation/updateInstallationFee',{'projectID':projectInfoObj.projectInfo.ID,'updateData':updateData},function (data) {
+            callback(data);
+        })
     }
 };
 
+
 $(function () {
     $('#calc_installation_fee').on('shown.bs.modal',function () {
-        if(installationFeeObj.installationFeeSpread == null){//初始化显示
-
+        if(installationFeeObj.feeItemSpread == null){//初始化显示
+            installationFeeObj.initInstallationFeeSpread();
+        }else {
+            installationFeeObj.showFeeItemData();
+            installationFeeObj.showFeeDetailData();
+        }
+    });
+    $('#calc_position').on('shown.bs.modal',function () {
+        installationFeeObj.positionSelectedObject = null;
+        if (!installationFeeObj.positionSpread) {
+            installationFeeObj.initPositionSpread();
         }
+        installationFeeObj.loadSelectionNodes();
+    });
+
+   /* $('#calc_position').on('hidden.bs.modal',function () {
+
+    });*/
+    $('#positionSheetFilter').click(function (){
+        installationFeeObj.positionSelectedObject = null;//清空选中记录
+        installationFeeObj.filterSelectionNodes();
+    });
 
-    })
+    $('#cancelFilter').click(function (){
+        installationFeeObj.positionSelectedObject = null;//清空选中记录
+        installationFeeObj.loadSelectionNodes();
+    });
+    $('#select_position_confirm').click(function (){
+        installationFeeObj.selectPositionConfirm();
+    });
 
 
 

+ 0 - 1
web/building_saas/main/js/views/main_tree_col.js

@@ -243,7 +243,6 @@ let MainTreeCol = {
                 }
             }
         },
-
         isSubcontract: function (node){
             if (calcTools.isRationCategory(node))
                 return new GC.Spread.Sheets.CellTypes.CheckBox();