Explorar o código

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

chenshilong %!s(int64=6) %!d(string=hai) anos
pai
achega
9fe32e77b3
Modificáronse 27 ficheiros con 890 adicións e 431 borrados
  1. 1 0
      config/gulpConfig.js
  2. 2 4
      modules/all_models/compleRation_ration.js
  3. 2 4
      modules/all_models/stdRation_ration.js
  4. 9 10
      modules/main/controllers/ration_controller.js
  5. 17 17
      modules/main/facade/ration_facade.js
  6. 74 22
      public/web/slideResize.js
  7. 4 2
      web/building_saas/complementary_glj_lib/js/glj.js
  8. 30 13
      web/building_saas/complementary_ration_lib/html/dinge.html
  9. 154 20
      web/building_saas/complementary_ration_lib/js/coe.js
  10. 2 0
      web/building_saas/complementary_ration_lib/js/global.js
  11. 53 0
      web/building_saas/complementary_ration_lib/js/ration.js
  12. 14 1
      web/building_saas/css/custom.css
  13. 2 2
      web/building_saas/css/main.css
  14. 4 4
      web/building_saas/glj/html/project_glj.html
  15. 134 126
      web/building_saas/main/html/main.html
  16. 30 0
      web/building_saas/main/js/controllers/project_controller.js
  17. 19 14
      web/building_saas/main/js/main.js
  18. 7 1
      web/building_saas/main/js/models/bills.js
  19. 1 2
      web/building_saas/main/js/models/project.js
  20. 4 4
      web/building_saas/main/js/views/character_content_view.js
  21. 27 9
      web/building_saas/main/js/views/locate_view.js
  22. 64 30
      web/building_saas/main/js/views/mbzm_view.js
  23. 17 9
      web/building_saas/main/js/views/project_glj_view.js
  24. 32 13
      web/building_saas/main/js/views/project_view.js
  25. 3 0
      web/building_saas/main/js/views/quantity_edit_view.js
  26. 141 80
      web/building_saas/main/js/views/side_tools.js
  27. 43 44
      web/building_saas/main/js/views/sub_view.js

+ 1 - 0
config/gulpConfig.js

@@ -82,6 +82,7 @@ module.exports = {
         'public/web/url_util.js',
         'public/web/number_util.js',
         'public/web/sheet/sheet_common.js',
+        'public/web/slideResize.js',
        // 'lib/ztree/*.js',
         'lib/spreadjs/sheets/gc.spread.sheets.all.11.1.2',
        // 'lib/spreadjs/views/gc.spread.views.dataview.10.0.0.min.js',

+ 2 - 4
modules/all_models/compleRation_ration.js

@@ -56,11 +56,9 @@ const compleRationSchema = new Schema({
     rationAssList: [compleRationAssItemSchema],
     rationInstList: [rationInstSchema],
     rationTemplateList : [new Schema({
+        rationID:Number,
         type: String,
-        code: String,
-        name: String,
-        billsLocation: String,
-        unit:String
+        billsLocation: String
     }, { _id: false })],
     deleteInfo: deleteSchema
 }, {versionKey: false});

+ 2 - 4
modules/all_models/stdRation_ration.js

@@ -48,11 +48,9 @@ const rationItemSchema = new Schema({
     rationAssList: [rationAssItemSchema],
     rationInstList: [rationInstSchema],
     rationTemplateList : [new Schema({
+        rationID:Number,
         type: String,
-        code: String,
-        name: String,
-        billsLocation: String,
-        unit:String
+        billsLocation: String
     }, { _id: false })]
 
 });

+ 9 - 10
modules/main/controllers/ration_controller.js

@@ -54,20 +54,19 @@ let controller = {
     applyTemplate:async function(req){
         let data = req.body.data;
         data = JSON.parse(data);
-        let rationResult = [],billsResult = [],updateDatas =[];
-        //先生成新定额
-        if(data.rations.create.length > 0){
-            rationResult = await ration_facade.addMultiRation(data.rations.create,req.session.sessionCompilation);
-        }
-        //再生成清单
-        if(data.bills.create.length > 0){
-            billsResult =  await bill_facade.createNewBills(data.bills.create)
-        }
+        let updateDatas =[];
+        let applyTasks = [
+            ration_facade.addMultiRation(data.rations.create,req.session.sessionCompilation),//先生成新定额
+            bill_facade.createNewBills(data.bills.create),
+        ];
         //整理更新的数据,调用一个方法更新
         updateDatas.push(data.ration_template);
         if(data.rations.update.length > 0)  prepareUpdateNodes(data.rations.update,updateDatas,"ration");
         if(data.bills.update.length > 0)  prepareUpdateNodes(data.bills.update,updateDatas,"bills");
-        await project_facade.updateNodes(updateDatas);
+        applyTasks.push(project_facade.updateNodes(updateDatas));
+        let [rationResult,billsResult,updates] = await Promise.all(applyTasks);
+
+
         return {rationResult:rationResult,billsResult:billsResult,updateDatas:updateDatas};
     }
 };

+ 17 - 17
modules/main/facade/ration_facade.js

@@ -258,18 +258,21 @@ async function addRationTemplate(std,newRation) {
     let templateList = [];
     if(std.hasOwnProperty('rationTemplateList') && std.rationTemplateList.length > 0){
         for(let tem of std.rationTemplateList){
-            let template = {
-                billID:"",
-                fxID:"",
-                quantity:"0",
-                coe:"0"
-            };
-            template.code = tem.code;
-            template.name = tem.name;
-            template.type = tem.type;
-            template.unit = tem.unit;
-            template.billsLocation = tem.billsLocation;
-            templateList.push(template)
+            let re_ration = await rationItemModel.findOne({rationRepId:std.rationRepId,ID:tem.rationID});
+            if(re_ration){
+                let template = {
+                    billID:"",
+                    fxID:"",
+                    quantity:"0",
+                    coe:"0"
+                };
+                template.code = re_ration.code;
+                template.name = re_ration.name;
+                template.type = tem.type;
+                template.unit = re_ration.unit;
+                template.billsLocation = tem.billsLocation;
+                templateList.push(template)
+            }
         }
     }
     if(templateList.length > 0){
@@ -418,9 +421,6 @@ async function addRationGLJ(std,newRation,compilation) {
                     std_glj.basePrice =  std_glj.priceProperty[ext.priceField];
                 }
             }
-            console.log("================================get std glj=============================================");
-            console.log(std_glj);
-            let std_gljTime = +new Date();
             if(std_glj){
                 newGLJ.name = std_glj.name;
                 newGLJ.code = std_glj.code;
@@ -442,8 +442,8 @@ async function addRationGLJ(std,newRation,compilation) {
                 newRationGLJList.push(newGLJ);
                 rationGLJShowList.push(info);
             }
-            let InfoFromProjectGLJ = +new Date();
-            console.log("找到项目工料机时间-------------------------------"+(InfoFromProjectGLJ - std_gljTime));
+            //let InfoFromProjectGLJ = +new Date();
+            //console.log("找到项目工料机时间-------------------------------"+(InfoFromProjectGLJ - std_gljTime));
         }
     }
     let before = +new Date();

+ 74 - 22
public/web/slideResize.js

@@ -9,11 +9,10 @@
  */
 
 /*
- * div之间的水平拖动,适应各种情况
- * module: 所属模块,防止不同页面相同id导致localstorage数据被覆盖
- * eleObj: resize, parent, left, right
- * limit: min, max
- * */
+* 拖动相关公共接口
+* 前台使用此接口时,注意在恢复系统默认设置时,
+* 清除相关缓存数据: project_view.js--->$('#property_default').click(callback)
+* */
 
 const SlideResize = (function() {
     //设置水平拖动条的宽度
@@ -35,7 +34,14 @@ const SlideResize = (function() {
     }
 
     let mouseMoveCount = 0;
-    function horizontalSlide(module, eleObj, limit, callback) {
+    /*
+     * div之间的水平拖动,适应各种情况
+     * @param {Object}eleObj: module所属模块,防止不同页面相同id导致localstorage数据被覆盖(放在对象里,因为可能有的地方要实时改这个module)
+     *         resize, parent, left, right
+     * @param {Object}limit: min, max
+     * @param {Function}callback 回调
+     * */
+    function horizontalSlide(eleObj, limit, callback) {
         const triggerCBSize = 5;
         let drag = false,
             startPoint = 0,
@@ -54,13 +60,14 @@ const SlideResize = (function() {
         });
         $('body').mousemove(function (e) {
             if (drag) {
+                console.log('drag');
                 let moveSize = e.clientX - startPoint;
                 leftChange = leftWidth + moveSize;
                 leftChange = leftChange < limit.min ? limit.min : leftChange;
-                leftChange = leftChange > limitMax ? limitMax - 3 : leftChange;
+                leftChange = leftChange > limitMax ? limitMax - 5 : leftChange;
                 rightChange = rightWidth - moveSize;
                 rightChange = rightChange < limit.min ? limit.min : rightChange;
-                rightChange = rightChange > limitMax ? limitMax - 3 : rightChange;
+                rightChange = rightChange > limitMax ? limitMax - 5 : rightChange;
                 let leftPercentWidth = leftChange / eleObj.parent.width() * 100 + '%',
                     rightPercentWidth = rightChange / eleObj.parent.width() * 100 + '%';
                 eleObj.left.css('width', leftPercentWidth);
@@ -79,9 +86,9 @@ const SlideResize = (function() {
                 mouseMoveCount = 0;
                 //将宽度信息存储到localstorage
                 let leftWidthInfo = eleObj.left[0].style.width;
-                setLocalCache(`${module}${eleObj.left.attr('id')}Width`, leftWidthInfo);
+                setLocalCache(`${eleObj.module}${eleObj.left.attr('id')}Width`, leftWidthInfo);
                 let rightWidthInfo = eleObj.right[0].style.width;
-                setLocalCache(`${module}${eleObj.right.attr('id')}Width`, rightWidthInfo);
+                setLocalCache(`${eleObj.module}${eleObj.right.attr('id')}Width`, rightWidthInfo);
             }
         });
     }
@@ -104,11 +111,12 @@ const SlideResize = (function() {
 
     /*
      * div上下拖动
-     * module: 所属模块,防止不同页面相同id导致localstorage数据被覆盖
-     * eleObj: resize, top, topSpread, bottom, bottomSpread
-     * limit: min, max, notTopSpread(上部分非spread部分的高度) notBottomSpread(下部分非spread部分的高度)
+     * @param {Object} eleObj: module所属模块,防止不同页面相同id导致localstorage数据被覆盖(放在对象里,因为可能有的地方要实时改这个module)
+     *        resize, top, topSpread, bottom, bottomSpread
+     * @param {Object}limit: min, max, notTopSpread(上部分非spread部分的高度) notBottomSpread(下部分非spread部分的高度)
+     * @param {Function}callback 回调
      * */
-    function verticalSlide(module, eleObj, limit, callback) {
+    function verticalSlide(eleObj, limit, callback) {
         const triggerCBSize = 5;
         let drag = false,
             startPoint = 0,
@@ -130,10 +138,10 @@ const SlideResize = (function() {
                 let moveSize = e.clientY - startPoint;
                 topChange = topHeight + moveSize;
                 topChange = topChange < limit.min ? limit.min : topChange;
-                topChange = topChange > limitMax ? limitMax - 3 : topChange;
+                topChange = topChange > limitMax ? limitMax : topChange;
                 bottomChange = bottomHeight - moveSize;
                 bottomChange = bottomChange < limit.min ? limit.min : bottomChange;
-                bottomChange = bottomChange > limitMax ? limitMax - 3 : bottomChange;
+                bottomChange = bottomChange > limitMax ? limitMax : bottomChange;
 
                 //设置上部分div高度
                 eleObj.top.height(topChange);
@@ -156,18 +164,19 @@ const SlideResize = (function() {
                 mouseMoveCount = 0;
                 //将高度信息存储到localstorage
                 let topHeightInfo = eleObj.top.height();
-                setLocalCache(`${module}${eleObj.top.attr('id')}Height`, topHeightInfo);
+                setLocalCache(`${eleObj.module}${eleObj.top.attr('id')}Height`, topHeightInfo);
                 let bottomHeightInfo = eleObj.bottom.height();
-                setLocalCache(`${module}${eleObj.bottom.attr('id')}Height`, bottomHeightInfo);
+                setLocalCache(`${eleObj.module}${eleObj.bottom.attr('id')}Height`, bottomHeightInfo);
             }
         });
     }
 
     /*
      * 加载上下高度
-     * module: 所属模块,防止不同页面相同id导致localstorage数据被覆盖
-     * eleObj: top, topSpread, bottom, bottomSpread
-     * limit: totalHeight(实时的上下部分总高度) notTopSpread(上部分非spread部分的高度) notBottomSpread(下部分非spread部分的高度)
+     * @param {String}module 所属模块,防止不同页面相同id导致localstorage数据被覆盖
+     * @param {Object}eleObj: module所属模块,防止不同页面相同id导致localstorage数据被覆盖(放在对象里,因为可能有的地方要实时改这个module) top, topSpread, bottom, bottomSpread
+     * @param {Object}limit: totalHeight(实时的上下部分总高度) notTopSpread(上部分非spread部分的高度) notBottomSpread(下部分非spread部分的高度)
+     * @param {Function}callback 回调
      * */
 
     function loadVerticalHeight(module, eleObj, limit, callback) {
@@ -195,5 +204,48 @@ const SlideResize = (function() {
         }
     }
 
-    return {horizontalSlide, loadHorizonWidth, verticalSlide, loadVerticalHeight}
+    /*
+    * 包含多个上下结构的拖动(n>= 2,只包含上下结构的地方可以用loadVerticalHeight)
+    * 加载多个结构高度
+    * @param {String}module所属模块,防止不同页面相同id导致localstorage数据被覆盖
+    * @param {Array}eles 元素为结构对象 内部: {container: 外部div, spread: 该div的Spread, notSpread: 该div不含Spread的高度, defaultProportion: 默认高度比例0.6}
+    * @param {String}totalHeight 各个结构div总高度-可编译字符串
+    * @param {Function}callback 回调
+    * */
+    function loadMultiVerticalHeight(module, eles, totalHeight, callback) {
+        //当前窗口拖动区域总高度
+        totalHeight = eval(totalHeight);
+        let cacheHeight = 0,//缓存中设置了高度的div总高度
+            notCacheProportion = 0;//缓存中没设置高度的div占用的总高度比例(每个div都有默认的高度比例) (有了缓存高度的div就是被拖动过的,被拖动过的div,其默认高度比例就没用了)
+        //获取缓存的总高度、未被拖动过的所有div的默认比例之和notCacheProportion (1-notCacheProportion)就是缓存高度的占总的比例
+        for (let ele of eles) {
+            let eleHeight = getLocalCache(`${module}${ele.container.attr('id')}Height`);
+            if (eleHeight !== null) {
+                eleHeight = parseFloat(eleHeight);
+                cacheHeight += eleHeight;
+            } else {
+                notCacheProportion += ele.defaultProportion;
+            }
+        }
+        //缓存高度占总的比例
+        let cacheProportion = 1 - notCacheProportion;
+        for (let ele of eles) {
+            let eleHeight = getLocalCache(`${module}${ele.container.attr('id')}Height`),
+                curHeight = 0;
+            if (eleHeight !== null) {
+                eleHeight = parseFloat(eleHeight);
+                //ele在当前窗口大小中的高度
+                curHeight = eleHeight / cacheHeight * cacheProportion * totalHeight;
+            } else {
+                curHeight = ele.defaultProportion * totalHeight;
+            }
+            ele.container.height(curHeight);
+            ele.spread.height(curHeight - ele.notSpread);
+        }
+        if (callback) {
+            callback();
+        }
+    }
+
+    return {setResizeWidth, horizontalSlide, loadHorizonWidth, verticalSlide, loadVerticalHeight, loadMultiVerticalHeight}
 })();

+ 4 - 2
web/building_saas/complementary_glj_lib/js/glj.js

@@ -20,20 +20,22 @@ $(document).ready(function () {
     });
     //章节树与人材机表
     let leftElesObj = {};
+    leftElesObj.module = moduleName;
     leftElesObj.resize = $('#leftResize');
     leftElesObj.parent = $('#dataRow');
     leftElesObj.left = $('#leftContent');
     leftElesObj.right = $('#midContent');
-    SlideResize.horizontalSlide(moduleName, leftElesObj, {min: 200, max: `$('#dataRow').width() - $('#rightContent').width() - 200`}, function () {
+    SlideResize.horizontalSlide(leftElesObj, {min: 200, max: `$('#dataRow').width() - $('#rightContent').width() - 200`}, function () {
         refreshALlWorkBook();
     });
     //人材机表与人材机组成物表
     let rightElesObj = {};
+    rightElesObj.module = moduleName;
     rightElesObj.resize = $('#rightResize');
     rightElesObj.parent = $('#dataRow');
     rightElesObj.left = $('#midContent');
     rightElesObj.right = $('#rightContent');
-    SlideResize.horizontalSlide(moduleName, rightElesObj, {min: 200, max: `$('#dataRow').width() - $('#leftContent').width() - 200`}, function () {
+    SlideResize.horizontalSlide(rightElesObj, {min: 200, max: `$('#dataRow').width() - $('#leftContent').width() - 200`}, function () {
         refreshALlWorkBook();
     });
 });

+ 30 - 13
web/building_saas/complementary_ration_lib/html/dinge.html

@@ -18,6 +18,19 @@
     <link rel="shortcut icon" href="/web/building_saas/css/favicon.ico">
     <link rel="icon" type="image/gif" href="/web/building_saas/css/animated_favicon1.gif">
     <style type="text/css">
+        div.resize-y{
+            height: 10px;
+            background: #efefef;
+            width: 100%;
+            cursor: s-resize;
+        }
+        div.resize-x{
+            width: 1%;
+            height: 100%;
+            background: #efefef;
+            cursor: w-resize;
+            float: left;
+        }
         .ztree * {
             font-family: Calibri;
             font-size: 0.9rem;
@@ -75,18 +88,20 @@
     <div class="content" style="margin-left: 0px">
         <div class="container-fluid">
             <div class="row" id="dataRow">
-                <div class="main-side p-0" style="width: 25%; height: 100%; overflow: hidden" id="leftContentg">
-                    <div class="tab-bar">
-                        <a href="javascript:void(0);" id="tree_Insert" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-plus" aria-hidden="true"></i></a>
-                        <a href="javascript:void(0);" id="tree_remove" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
-                        <a href="javascript:void(0);" id="tree_upLevel" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="升级"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
-                        <a href="javascript:void(0);" id="tree_downLevel" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="降级"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
-                        <a href="javascript:void(0);" id="tree_downMove" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
-                        <a href="javascript:void(0);" id="tree_upMove" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
-                    </div>
-                    <div class="tab-content" id="sectionSpread" style="overflow: hidden">
-                        <!--<ul id="rationChapterTree" class="ztree"></ul>-->
+                <div class="main-side p-0" id="leftContent" style="width: 25%; height: 100%; overflow: hidden">
+                    <div style="width: 99%; float: left">
+                        <div class="tab-bar">
+                            <a href="javascript:void(0);" id="tree_Insert" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-plus" aria-hidden="true"></i></a>
+                            <a href="javascript:void(0);" id="tree_remove" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
+                            <a href="javascript:void(0);" id="tree_upLevel" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="升级"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
+                            <a href="javascript:void(0);" id="tree_downLevel" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="降级"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
+                            <a href="javascript:void(0);" id="tree_downMove" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
+                            <a href="javascript:void(0);" id="tree_upMove" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                        </div>
+                        <div class="tab-content" id="sectionSpread" style="overflow: hidden">
+                        </div>
                     </div>
+                    <div class="resize-x" id="slideResizeLeft"></div>
                 </div>
                 <div class="main-content p-0" id="mainContent" style="width: 75%">
                     <!-- 右标签 -->
@@ -112,8 +127,9 @@
                         <div class="tab-pane active" id="tde" role="tabpanel">
                             <!--定额top-->
                             <div id="rationItemsSheet" class="main-data-top"></div>
+                            <div class="resize-y" id="rationSubResize"></div>
                             <!--定额bottom-->
-                            <div class="bottom-content">
+                            <div class="bottom-content" id="subContent">
                                 <!-- 标签 -->
                                 <ul class="nav nav-tabs" role="tablist">
                                     <li class="nav-item">
@@ -186,10 +202,11 @@
                     </div>
                 </div>
                 <div class="main-side p-0 main-side-right" id="zmhsContent" style="width: 25%; display: none">
-                    <div class="resize" id="rightResize" style="width: 1%; height: 100%; resize:horizontal; cursor: w-resize; float: left; background: #F1F1F1"></div>
+                    <div class="resize-x" id="slideResizeRight"></div>
                     <div style="width: 99%; float: left">
                         <div class="main-data-top-fluid" id="mainSpread">
                         </div>
+                        <div class="resize-y" id="zmhsAdjResize"></div>
                         <div class="bottom-content" id="contentSpread">
                         </div>
                     </div>

+ 154 - 20
web/building_saas/complementary_ration_lib/js/coe.js

@@ -3,35 +3,169 @@
  */
 //modiyied by zhong on 2017/9/21
 
-let moduleName = 'compleRation';
 $(document).ready(function () {
+    let moduleName = 'compleRation';
+    function refreshALlWorkBook() {
+        if (sectionTreeObj.workBook) {
+            sectionTreeObj.workBook.refresh();
+        }
+        if (rationOprObj.workBook) {
+            rationOprObj.workBook.refresh();
+        }
+        if (rationGLJOprObj.sheet && rationGLJOprObj.sheet.getParent()) {
+            rationGLJOprObj.sheet.getParent().refresh();
+        }
+        if (coeOprObj.workBook) {
+            coeOprObj.workBook.refresh();
+        }
+        if (gljAdjOprObj.workBook) {
+            gljAdjOprObj.workBook.refresh();
+        }
+    }
+    //定额章节树与定额表
+    let leftElesObj = {};
+    leftElesObj.module = moduleName;
+    leftElesObj.resize = $('#slideResizeLeft');
+    leftElesObj.parent = $('#dataRow');
+    leftElesObj.left = $('#leftContent');
+    leftElesObj.right = $('#mainContent');
+    let maxEval = `$('#zmhsContent').is(':visible') ? $('#dataRow').width() - $('#zmhsContent').width() - 300 : $('#dataRow').width()  - 300`;
+    SlideResize.horizontalSlide(leftElesObj, {min: 300, max: maxEval}, function () {
+        refreshALlWorkBook();
+    });
+    SlideResize.loadHorizonWidth(moduleName, [$('#slideResizeLeft')], [$('#leftContent'), $('#mainContent')], function () {
+        //refreshAfterZmhs(false);
+        let leftContentWidth = parseFloat($('#leftContent')[0].style.width.replace('%', '')),
+            mainContentWidth = parseFloat($('#mainContent')[0].style.width.replace('%', ''));
+        let surplus = 100 - leftContentWidth - mainContentWidth;
+        $('#leftContent').css('width', `${leftContentWidth + surplus / 2}%`);
+        $('#mainContent').css('width', `${mainContentWidth + surplus / 2}%`);
+
+        refreshALlWorkBook();
+    });
     //定额表与子目换算表
     let rightElesObj = {};
-    rightElesObj.resize = $('#rightResize');
+    rightElesObj.module = moduleName;
+    rightElesObj.resize = $('#slideResizeRight');
     rightElesObj.parent = $('#dataRow');
     rightElesObj.left = $('#mainContent');
     rightElesObj.right = $('#zmhsContent');
-    SlideResize.horizontalSlide(moduleName, rightElesObj, {min: 200, max: `$('#dataRow').width() - $('#leftContent').width() - 200`}, function () {
-        pageOprObj.refreshAllBooks();
+    let maxEvalRight = `$('#dataRow').width() - $('#leftContent').width() - 200`;
+    SlideResize.horizontalSlide(rightElesObj, {min: 200, max: maxEvalRight}, function () {
+        refreshALlWorkBook();
     });
-});
-
-$('#zmhs').click(function () {
-    if(!$(this).hasClass('active')){
-        $(this).addClass('active');
-        $('#mainContent').css('width', '50%');
-        $('#zmhsContent').show();
-        SlideResize.loadHorizonWidth(moduleName, [$('#mainContent'), $('#zmhsContent')], function () {
-            pageOprObj.refreshAllBooks();
-        });
-    } else {
-        $(this).removeClass('active');
-        $('#mainContent').css('width', '75%')
-        $('#zmhsContent').hide();
-        rationOprObj.workBook.refresh();
-        rationGLJOprObj.sheet.getParent().refresh();
+    //设置水平拖动条的宽度
+    //@param {Object dom}resize滚动条
+    function setResizeWidth (resize) {
+        const fixedWidth = 10;
+        //跟滚动条同层的其他节点
+        let bros = resize.parent().children();
+        //滚动条节点 及 同层非滚动条节点的索引
+        let index = bros.index(resize),
+            otherIndex = index ? 0 : 1;
+        const other = resize.parent().children(`:eq(${otherIndex})`);
+        let resizeParentWidth = resize.parent().width();
+        let resizeDecimalWidth = fixedWidth / resizeParentWidth,
+            otherDecimalWidth = 1 - resizeDecimalWidth;
+        let resizePercentWidth = resizeDecimalWidth * 100 + '%',
+            otherPercentWidth = otherDecimalWidth * 100 + '%';
+        resize.css('width', resizePercentWidth);
+        other.css('width', otherPercentWidth);
+    }
+    function refreshAfterZmhs(visible) {
+        const min = 20;
+        //宽度比例localstorage key
+        let leftContentKey = `${moduleName}${$('#leftContent').attr('id')}Width`,
+            mainContentKey = `${moduleName}${$('#mainContent').attr('id')}Width`,
+            zmhsContentKey = `${moduleName}${$('#zmhsContent').attr('id')}Width`;
+        let zmhsWidth = getLocalCache(zmhsContentKey) ? getLocalCache(zmhsContentKey) :$('#zmhsContent')[0].style.width,
+            mainContentWidth = $('#mainContent')[0].style.width,
+            leftContentWidth;
+        zmhsWidth = parseFloat(zmhsWidth.replace('%', ''));
+        mainContentWidth = parseFloat(mainContentWidth.replace('%', ''));
+        if (visible) {
+            mainContentWidth = mainContentWidth - zmhsWidth / 2 < min ? min : mainContentWidth - zmhsWidth / 2;
+            if (100 - mainContentWidth - zmhsWidth < min) {
+                leftContentWidth = min;
+                zmhsWidth = 100 - mainContentWidth - leftContentWidth;
+            } else {
+                leftContentWidth = 100 - mainContentWidth - zmhsWidth;
+            }
+        } else {
+            mainContentWidth += zmhsWidth / 2;
+            leftContentWidth = 100 - mainContentWidth;
+        }
+        $('#leftContent').css('width', `${leftContentWidth}%`);
+        setLocalCache(leftContentKey, `${leftContentWidth}%`);
+        $('#mainContent').css('width', `${mainContentWidth}%`);
+        setLocalCache(mainContentKey, `${mainContentWidth}%`);
+        $('#zmhsContent').css('width', `${zmhsWidth}%`);
+        setLocalCache(zmhsContentKey, `${zmhsWidth}%`);
+        let resizes = [$('#slideResizeLeft'), $('#slideResizeRight')];
+        for (let resize of resizes) {
+            setResizeWidth(resize);
+        }
     }
+    $('#zmhs').click(function () {
+        if(!$(this).hasClass('active')){
+            $(this).addClass('active');
+            refreshAfterZmhs(true);
+            $('#zmhsContent').show();
+            if(!coeOprObj.workBook){
+                pageObj.initPage();
+            }
+            refreshALlWorkBook();
+        } else {
+            $(this).removeClass('active');
+            refreshAfterZmhs(false);
+            $('#zmhsContent').hide();
+            refreshALlWorkBook();
+        }
+    });
+    //子目换算和调整表上下拖动
+    let zmhsAdjResize = getZmhsAdjResize();
+    SlideResize.verticalSlide(zmhsAdjResize.eleObj, zmhsAdjResize.limit, function () {
+        if (coeOprObj.workBook) {
+            coeOprObj.workBook.refresh();
+        }
+        if (gljAdjOprObj.workBook) {
+            gljAdjOprObj.workBook.refresh();
+        }
+    });
+    loadZmhsAdjSize(zmhsAdjResize);
 });
+function getZmhsAdjResize() {
+    let zmhsAdjResize = {};
+    zmhsAdjResize.eleObj = {
+        module: 'compleRation',
+        resize: $('#zmhsAdjResize'),
+        top: $('#mainSpread'),
+        topSpread: $('#mainSpread'),
+        bottom: $('#contentSpread'),
+        bottomSpread: $('#contentSpread')
+    };
+    zmhsAdjResize.limit = {
+        min: 150,
+        max: `$(window).height()-$('.header').height()-150-10`,
+        totalHeight: `$(window).height()-$('.header').height()-10`,
+        notTopSpread: 0,
+        notBottomSpread: 0,
+    };
+    return zmhsAdjResize;
+}
+function loadZmhsAdjSize(resizeObj) {
+    if (!resizeObj) {
+        resizeObj = getZmhsAdjResize();
+    }
+    SlideResize.loadVerticalHeight(resizeObj.eleObj.module, resizeObj.eleObj, resizeObj.limit, function () {
+        if (coeOprObj.workBook) {
+            coeOprObj.workBook.refresh();
+        }
+        if (gljAdjOprObj.workBook) {
+            gljAdjOprObj.workBook.refresh();
+        }
+    });
+}
 
 var pageObj = {
     initPage: function (){

+ 2 - 0
web/building_saas/complementary_ration_lib/js/global.js

@@ -25,6 +25,8 @@ function autoFlashHeight(){
     $('#explanationShow').height($(window).height()-headerHeight-toolsBar-100);
 //计算规则
     $('#ruleTextShow').height($(window).height()-headerHeight-toolsBar-100);
+    typeof loadRationSubSize !== 'undefined' ? loadRationSubSize() : '';
+    typeof loadZmhsAdjSize !== 'undefined' ? loadZmhsAdjSize() : '';
 };
 $(window).resize(autoFlashHeight);
 /*全局自适应高度结束*/

+ 53 - 0
web/building_saas/complementary_ration_lib/js/ration.js

@@ -2,6 +2,59 @@
  * Created by Tony on 2017/4/28.
  */
 
+$(document).ready(function () {
+    //定额表与下方子表上下拖动
+    let rationSubResize = getRationSubResize();
+    SlideResize.verticalSlide(rationSubResize.eleObj, rationSubResize.limit, function () {
+        if (rationOprObj.workBook) {
+            rationOprObj.workBook.refresh();
+        }
+        if (rationGLJOprObj.sheet && rationGLJOprObj.sheet.getParent()) {
+            rationGLJOprObj.sheet.getParent().refresh();
+        }
+    });
+    SlideResize.loadVerticalHeight(rationSubResize.eleObj.module, rationSubResize.eleObj, rationSubResize.limit, function () {
+        if (rationOprObj.workBook) {
+            rationOprObj.workBook.refresh();
+        }
+        if (rationGLJOprObj.sheet && rationGLJOprObj.sheet.getParent()) {
+            rationGLJOprObj.sheet.getParent().refresh();
+        }
+    });
+});
+function getRationSubResize() {
+    let rationSubResize = {};
+    rationSubResize.eleObj = {
+        module: 'compleRation',
+        resize: $('#rationSubResize'),
+        top: $('#rationItemsSheet'),
+        topSpread: $('#rationItemsSheet'),
+        bottom: $('#subContent'),
+        bottomSpread: $('#rdSpread')
+    };
+    rationSubResize.limit = {
+        min: 150,
+        max: `$(window).height()-$('.header').height()-$('.tools-bar').height()-150-10`,
+        totalHeight: `$(window).height()-$('.header').height()-$('.tools-bar').height()-10`,
+        notTopSpread: 0,
+        notBottomSpread: $('#subContent ul').height(),
+    };
+    return rationSubResize;
+}
+function loadRationSubSize(resizeObj) {
+    if (!resizeObj) {
+        resizeObj = getRationSubResize();
+    }
+    SlideResize.loadVerticalHeight(resizeObj.eleObj.module, resizeObj.eleObj, resizeObj.limit, function () {
+        if (rationOprObj.workBook) {
+            rationOprObj.workBook.refresh();
+        }
+        if (rationGLJOprObj.sheet && rationGLJOprObj.sheet.getParent()) {
+            rationGLJOprObj.sheet.getParent().refresh();
+        }
+    });
+}
+
 const digital = {
     gljPrc: -3,//计算定额基价时单个工料机价格取三位
     rationBasePrc: -2,

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

@@ -11,10 +11,23 @@ label.title{
 
 div.resize{
     height: 10px;
-    background: #f7f7f9;
+    background: #efefef;
     width: 100%;
     cursor: s-resize;
 }
+div.resize-y{
+    height: 10px;
+    background: #efefef;
+    width: 100%;
+    cursor: s-resize;
+}
+div.resize-x{
+    width: 1%;
+    height: 100%;
+    background: #efefef;
+    cursor: w-resize;
+    float: left;
+}
 /*.zlfb-check{
     margin-left: 20px;
 }*/

+ 2 - 2
web/building_saas/css/main.css

@@ -497,6 +497,6 @@ a{
     height: 30px;
     line-height: 30px;
     background:#F1F1F1;
-    bottom:30px;
-    left:2px;
+    bottom:25px;
+    left:0px;
 }

+ 4 - 4
web/building_saas/glj/html/project_glj.html

@@ -3,7 +3,7 @@
         display: none;
     }
 </style>
-<div class="toolsbar px-1">
+<div class="toolsbar px-1" id="projectGljToolsBar">
     <div class="form-inline py-1">
         <label class="mx-2">当前使用:<span id="current-name"></span>(<label class="a_color" id="pop-used-list" data-original-title="" title=""><span id="used-project-count">0</span>个单位工程使用</label>)
             <a class="btn btn-sm ml-1" href="#" data-toggle="modal" data-target="#change-unitFile"><i class="fa fa-exchange"></i> 选择其他</a>
@@ -30,12 +30,12 @@
             </ul>
         </div>
         <div class="main-content col p-0 col-lg-11" id="project-glj-main">
-            <div class="top-content">
+            <div class="top-content" id="projectGljTop">
                 <div class="main-data-top" style="width: 100% " id="project_glj_sheet">
                 </div>
             </div>
-            <div class="resize"></div>
-            <div class="bottom-content">
+            <div class="resize-y" id="projectGljResize"></div>
+            <div class="bottom-content" id="projectGljBottom">
                 <ul class="nav nav-tabs" role="tablist">
                   <!--  <li class="nav-item">
                         <a class="nav-link active" data-toggle="tab" data-name="ration_sheet" id="ration_link" href="#glj_de_div" role="tab">相关定额</a>

+ 134 - 126
web/building_saas/main/html/main.html

@@ -156,13 +156,13 @@
                           <li class="nav-item" id = "li_stdRationTab">
                               <a class="nav-link px-1 right-nav-link" href="javascript:void(0)" id="stdRationTab" relaPanel="#de">定额库</a>
                           </li>
-                          <li class="nav-item dropdown">
-                              <!--<a class="nav-link dropdown-toggle more" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">更多</a>-->
-                              <div class="dropdown-menu">
-                                  <a class="dropdown-item  right-nav-link"  href="javascript:void(0)" id = 'locateTab' relaPanel="#locate">查找定位</a>
-                                 <!-- <a class="dropdown-item" data-toggle="tab" href="#sqpz" role="tab">书签批注</a>-->
-                              </div>
-                          </li>
+                  <!--   <li class="nav-item dropdown show">
+                <a class="nav-link dropdown-toggle more" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">更多</a>
+                <div class="dropdown-menu show" x-placement="bottom-start" style="position: absolute; transform: translate3d(-107px, 32px, 0px); top: 0px; left: 0px; will-change: transform;">
+                <a class="dropdown-item right-nav-link" href="javascript:void(0)" id="locateTab" relapanel="#locate">查找定位</a><a class="dropdown-item right-nav-link" href="javascript:void(0)" id="blockLibTab" relapanel="#kmbk">块模板库</a>
+                &lt;!&ndash; <a class="dropdown-item" data-toggle="tab" href="#sqpz" role="tab">书签批注</a>&ndash;&gt;
+                </div>
+                </li>-->
                           <script>
                               //2018-11-23  zhang 模板库移动到更多下拉框
                               if (G_SHOW_BLOCK_LIB){
@@ -174,13 +174,13 @@
                   </div>
               </div>
               <div class="container-fluid">
-                  <div class="row">
+                  <div class="row" id="mainRow">
                       <!--col-lg-12 p-0-->
                       <div class="main-content" style="width: 100%; display: inline-block" id="main">
                           <div class="top-content" id="top_div" style="overflow:hidden;">
                               <div class="main-data-top" id="billsSpread"></div>
                           </div>
-                          <div class="resize"></div>
+                          <div class="resize-y" id="mainVerticalResize"></div>
                           <div class="bottom-content" id="bottom_div">
                               <ul class="nav nav-tabs" role="tablist">
                                   <li class="nav-item" id="QDJL_div">
@@ -213,9 +213,9 @@
                                   <li class="nav-item" id = "TZJNR_div">
                                       <a class="nav-link sub-item" id="linkTZJNR" data-toggle="tab" href="#subSpread" role="tab">特征及内容</a>
                                   </li>
-                                <!--  <li class="nav-item" id="MBZM_div">
+                                  <li class="nav-item" id="MBZM_div">
                                       <a class="nav-link sub-item" id="linkMBZM" data-toggle="tab" href="#subSpread" role="tab">模板子目</a>
-                                  </li>-->
+                                  </li>
                               </ul>
                               <!-- Tab panes -->
                               <div class="tab-content" id="tabCon">
@@ -263,114 +263,118 @@
                                       </div>
                                       <div id="tzjnrCon" class="container-fluid main-data-bottom" style="background: #F1F1F1; overflow: hidden">
                                           <div class="row" style="overflow: hidden">
-                                              <div class="p-0" id="jobDiv" style="position:relative">
-                                                  <div class="main-data-bottom ovf-hidden" id="jobSpread">
+                                              <div class="p-0" id="contentDiv" style="width: 90%; float: left">
+                                                  <div id="jobDiv" style="width: 25%; height: 100%; position:relative; float: left">
+                                                      <div class="main-data-bottom ovf-hidden" id="jobSpread" style="width: 99%; float: left">
+                                                      </div>
+                                                      <div class="resize-x" id="TZJNRResize"></div>
+                                                      <!--工具栏-->
+                                                      <div class="bottom-tools btn-group position-absolute">
+                                                          <a href="javascript:void(0);" id="jobInsert" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
+                                                          <a href="javascript:void(0);" id="jobAdd" class="btn btn-sm " data-toggle="tooltip" data-placement="bottom" title="" data-original-title="添加"><i class="fa fa-plus" aria-hidden="true"></i></a>
+                                                          <a href="javascript:void(0);" id="jobDel" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
+                                                          <a href="javascript:void(0);" id="jobDown" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
+                                                          <a href="javascript:void(0);" id="jobUp" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                                                      </div>
                                                   </div>
-                                                  <!--工具栏-->
-                                                  <div class="bottom-tools btn-group position-absolute">
-                                                      <a href="javascript:void(0);" id="jobInsert" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
-                                                      <a href="javascript:void(0);" id="jobAdd" class="btn btn-sm " data-toggle="tooltip" data-placement="bottom" title="" data-original-title="添加"><i class="fa fa-plus" aria-hidden="true"></i></a>
-                                                      <a href="javascript:void(0);" id="jobDel" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
-                                                      <a href="javascript:void(0);" id="jobDown" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
-                                                      <a href="javascript:void(0);" id="jobUp" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                                                  <div id="itemDiv" style="width: 75%; height: 100%; position:relative; float: left;">
+                                                      <div class="main-data-bottom ovf-hidden"  id="itemSpread">
+                                                      </div>
+                                                      <!--工具栏-->
+                                                      <div class="bottom-tools btn-group position-absolute">
+                                                          <a href="javascript:void(0);" id="itemInsert" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
+                                                          <a href="javascript:void(0);" id="itemAdd" class="btn btn-sm " data-toggle="tooltip" data-placement="bottom" title="" data-original-title="添加"><i class="fa fa-plus" aria-hidden="true"></i></a>
+                                                          <a href="javascript:void(0);" id="itemDel" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
+                                                          <a href="javascript:void(0);" id="itemDown" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
+                                                          <a href="javascript:void(0);" id="itemUp" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                                                      </div>
                                                   </div>
                                               </div>
-                                              <div class="p-0" id="TZJNRResize" style="position:relative; width: 0.2%; resize:horizontal; cursor: w-resize; background: #F1F1F1"></div>
-                                              <div class="p-0" id="itemDiv" style="position:relative">
-                                                  <div class="main-data-bottom ovf-hidden"  id="itemSpread">
-                                                  </div>
-                                                  <!--工具栏-->
-                                                  <div class="bottom-tools btn-group position-absolute">
-                                                      <a href="javascript:void(0);" id="itemInsert" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
-                                                      <a href="javascript:void(0);" id="itemAdd" class="btn btn-sm " data-toggle="tooltip" data-placement="bottom" title="" data-original-title="添加"><i class="fa fa-plus" aria-hidden="true"></i></a>
-                                                      <a href="javascript:void(0);" id="itemDel" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
-                                                      <a href="javascript:void(0);" id="itemDown" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
-                                                      <a href="javascript:void(0);" id="itemUp" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                                              <div class="p-0" id="ruleDiv" style="width: 10%; float: left;">
+                                                  <div class="p-0" id="openTypeSetting" >
+                                                      <div class="tn-nav d-flex align-items-start flex-column" data-toggle="tooltip" data-placement="left" title="" data-original-title="打开排版规则">
+                                                          <span class="mt-3 ml-2 text-primary">排版规则</span>
+                                                          <i class="fa fa-arrow-left mt-auto mb-3 text-primary ml-2"></i>
+                                                      </div>
                                                   </div>
-                                              </div>
-                                               <div class="p-0" id="openTypeSetting" >
-                                                   <div class="tn-nav d-flex align-items-start flex-column" data-toggle="tooltip" data-placement="left" title="" data-original-title="打开排版规则">
-                                                       <span class="mt-3 ml-2 text-primary">排版规则</span>
-                                                       <i class="fa fa-arrow-left mt-auto mb-3 text-primary ml-2"></i>
-                                                   </div>
-                                               </div>
-                                              <div class="p-0">
-                                                  <div class="main-data-bottom" id="add-rule" style="display: none;">
-                                                      <div class="container-fluid my-2">
-                                                          <div class="mb-1 row" style="text-align: center">
-                                                              <label class="col-5 px-0 col-form-label text-right">排版规则</label>
-                                                              <a id="closeTypeSetting" data-toggle="tooltip" data-placement="top" data-original-title="关闭排版规则" class="col-7 px-0 col-form-label" href="javascript:void(0);"><i class="fa fa-arrow-right"></i></a>
-                                                          </div>
-                                                          <p style="text-align: center">
-                                                              <% if (projectData.property.lockBills == true) { %>
-                                                              <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-current">应用到选中清单</button>
-                                                              <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-all">应用到所有清单</button>
-                                                              <% } else { %>
-                                                              <button class="btn btn-primary btn-sm" type="button" id="use-to-current">应用到选中清单</button>
-                                                              <button class="btn btn-primary btn-sm" type="button" id="use-to-all">应用到所有清单</button>
-                                                              <% } %>
-                                                          </p>
-                                                          <div class="mb-1 row">
-                                                              <label class="col-5 px-0 col-form-label text-right">添加位置:</label>
-                                                              <div class="col-7">
-                                                                  <select id="add-position" class="form-control form-control-sm">
-                                                                      <option value="1" selected="selected">添加到项目特征列</option>
-                                                                      <option value="2">添加到清单名称列</option>
-                                                                      <option value="3">添加到工作内容列</option>
-                                                                      <option value="4">分别添加到对应列</option>
-                                                                  </select>
+                                                  <div class="p-0">
+                                                      <div class="main-data-bottom" id="add-rule" style="display: none;">
+                                                          <div class="container-fluid my-2">
+                                                              <div class="mb-1 row" style="text-align: center">
+                                                                  <label class="col-5 px-0 col-form-label text-right">排版规则</label>
+                                                                  <a id="closeTypeSetting" data-toggle="tooltip" data-placement="top" data-original-title="关闭排版规则" class="col-7 px-0 col-form-label" href="javascript:void(0);"><i class="fa fa-arrow-right"></i></a>
                                                               </div>
-                                                          </div>
-                                                          <div class="mb-1 row">
-                                                              <label class="col-sm-5 px-0 col-form-label text-right">添加内容:</label>
-                                                              <div class="col-sm-7">
-                                                                  <select id="add-content" class="form-control form-control-sm">
-                                                                      <option value="">无</option>
-                                                                      <option value="1" selected="selected">项目特征+工作内容</option>
-                                                                      <option value="2">工作内容+项目特征</option>
-                                                                      <option value="3">项目特征</option>
-                                                                      <option value="4">工作内容</option>
-                                                                      <option value="5">定额子目</option>
-                                                                  </select>
+                                                              <p style="text-align: center">
+                                                                  <% if (projectData.property.lockBills == true) { %>
+                                                                  <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-current">应用到选中清单</button>
+                                                                  <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-all">应用到所有清单</button>
+                                                                  <% } else { %>
+                                                                  <button class="btn btn-primary btn-sm" type="button" id="use-to-current">应用到选中清单</button>
+                                                                  <button class="btn btn-primary btn-sm" type="button" id="use-to-all">应用到所有清单</button>
+                                                                  <% } %>
+                                                              </p>
+                                                              <div class="mb-1 row">
+                                                                  <label class="col-5 px-0 col-form-label text-right">添加位置:</label>
+                                                                  <div class="col-7">
+                                                                      <select id="add-position" class="form-control form-control-sm">
+                                                                          <option value="1" selected="selected">添加到项目特征列</option>
+                                                                          <option value="2">添加到清单名称列</option>
+                                                                          <option value="3">添加到工作内容列</option>
+                                                                          <option value="4">分别添加到对应列</option>
+                                                                      </select>
+                                                                  </div>
                                                               </div>
-                                                          </div>
-                                                          <div class="mb-1 row">
-                                                              <label class="col-5 px-0 col-form-label text-right">显示格式:</label>
-                                                              <div class="col-7">
-                                                                  <select id="display-format" class="form-control form-control-sm">
-                                                                      <option value="1" selected="selected">换行分隔</option>
-                                                                      <option value="2">逗号分隔</option>
-                                                                      <option value="3">括号分隔</option>
-                                                                  </select>
+                                                              <div class="mb-1 row">
+                                                                  <label class="col-sm-5 px-0 col-form-label text-right">添加内容:</label>
+                                                                  <div class="col-sm-7">
+                                                                      <select id="add-content" class="form-control form-control-sm">
+                                                                          <option value="">无</option>
+                                                                          <option value="1" selected="selected">项目特征+工作内容</option>
+                                                                          <option value="2">工作内容+项目特征</option>
+                                                                          <option value="3">项目特征</option>
+                                                                          <option value="4">工作内容</option>
+                                                                          <option value="5">定额子目</option>
+                                                                      </select>
+                                                                  </div>
                                                               </div>
-                                                          </div>
-                                                          <div class="mb-1 row">
-                                                              <label class="col-5 px-0 col-form-label text-right">特征生成方式:</label>
-                                                              <div class="col-7">
-                                                                  <select id="character-format" class="form-control form-control-sm">
-                                                                      <option value="1">特征值</option>
-                                                                      <option value="2" selected="selected">特征:特征值</option>
-                                                                  </select>
+                                                              <div class="mb-1 row">
+                                                                  <label class="col-5 px-0 col-form-label text-right">显示格式:</label>
+                                                                  <div class="col-7">
+                                                                      <select id="display-format" class="form-control form-control-sm">
+                                                                          <option value="1" selected="selected">换行分隔</option>
+                                                                          <option value="2">逗号分隔</option>
+                                                                          <option value="3">括号分隔</option>
+                                                                      </select>
+                                                                  </div>
                                                               </div>
-                                                          </div>
-                                                          <div class="mb-1 row">
-                                                              <label class="col-5 px-0 col-form-label text-right">子目生成方式:</label>
-                                                              <div class="col-7">
-                                                                  <select id="child-display-format" disabled="disabled" class="form-control form-control-sm">
-                                                                      <option value="1" selected="selected">编号+定额名称</option>
-                                                                      <option value="2">序号+定额名称</option>
-                                                                  </select>
+                                                              <div class="mb-1 row">
+                                                                  <label class="col-5 px-0 col-form-label text-right">特征生成方式:</label>
+                                                                  <div class="col-7">
+                                                                      <select id="character-format" class="form-control form-control-sm">
+                                                                          <option value="1">特征值</option>
+                                                                          <option value="2" selected="selected">特征:特征值</option>
+                                                                      </select>
+                                                                  </div>
                                                               </div>
-                                                          </div>
-                                                          <div class="mb-1 row">
-                                                              <label class="col-5 px-0 col-form-label text-right">序号格式:</label>
-                                                              <div class="col-7">
-                                                                  <select id="serial-type" class="form-control form-control-sm">
-                                                                      <option value="">无</option>
-                                                                      <option value="1" selected="selected">1.</option>
-                                                                      <option value="2">a.</option>
-                                                                      <option value="3">A.</option>
-                                                                  </select>
+                                                              <div class="mb-1 row">
+                                                                  <label class="col-5 px-0 col-form-label text-right">子目生成方式:</label>
+                                                                  <div class="col-7">
+                                                                      <select id="child-display-format" disabled="disabled" class="form-control form-control-sm">
+                                                                          <option value="1" selected="selected">编号+定额名称</option>
+                                                                          <option value="2">序号+定额名称</option>
+                                                                      </select>
+                                                                  </div>
+                                                              </div>
+                                                              <div class="mb-1 row">
+                                                                  <label class="col-5 px-0 col-form-label text-right">序号格式:</label>
+                                                                  <div class="col-7">
+                                                                      <select id="serial-type" class="form-control form-control-sm">
+                                                                          <option value="">无</option>
+                                                                          <option value="1" selected="selected">1.</option>
+                                                                          <option value="2">a.</option>
+                                                                          <option value="3">A.</option>
+                                                                      </select>
+                                                                  </div>
                                                               </div>
                                                           </div>
                                                       </div>
@@ -394,8 +398,8 @@
                               </div>
                           </div>
                       </div>
-                      <div class="main-side" style="display: inline-block">
-                          <div class="resize" id="sideResize" style="width: 1%; height: 100%; resize:horizontal; cursor: w-resize; float: left; background: #F1F1F1"></div>
+                      <div class="main-side" style="display: inline-block" id="mainSide">
+                          <div class="resize-x" id="sideResize"></div>
                           <div class="tab-content" style="width: 99%; height: 100%; float: left">
                               <!--查找定位-->
                               <div class="tab-pane" id="locate">
@@ -435,12 +439,12 @@
                                       </div>
                                   </div>
                                   <!--上下结构-->
-                                  <div class="top-content" style="overflow: hidden">
+                                  <div class="top-content" id="locateTopDiv" style="overflow: hidden">
                                       <div class="" id="locate_result" >
                                       </div>
                                   </div>
-                                  <div class="resize" id="locate_resize" style="background: #F1F1F1"></div>
-                                  <div class="bottom-content">
+                                  <div class="resize-y" id="locate_resize"></div>
+                                  <div class="bottom-content" id="locateBottomDiv">
                                       <div class="" id="locate_sub"></div>
                                   </div>
                                 <!--  <div class="main-data-side-y">
@@ -553,7 +557,7 @@
                               </div>
                               <!--定额库-->
                               <div class="tab-pane" id="de">
-                                  <div class="tools-bar-height-d container-fluid">
+                                  <div class="tools-bar-height-d container-fluid" id="deToolsBar">
                                       <div class="p-1 row">
                                           <select class="form-control form-control-sm col-6" id="stdRationLibSelect">
                                           </select>
@@ -589,17 +593,17 @@
                                           -->
                                       </div>
                                   </div>
-                                  <div class="top-content" style="overflow: hidden">
+                                  <div class="top-content" id="deTopDiv" style="overflow: hidden">
                                       <div class="main-data-side-d" id="stdRationChapter"></div>
                                   </div>
-                                  <div class="resize" id="deResize" style="background: #F1F1F1"></div>
-                                  <div class="bottom-content">
+                                  <div class="resize-y" id="deResize" style="background: #F1F1F1"></div>
+                                  <div class="bottom-content" id="deBottomDiv">
                                       <div class="main-data-bottom" id="stdSectionRations"></div>
                                   </div>
                               </div>
                               <!--块模板库-->
                               <div class="tab-pane" id="kmbk">
-                                  <div class="tools-bar-height-d container-fluid">
+                                  <div class="tools-bar-height-d container-fluid" id="kmbkToolsBar">
                                       <div class="p-1 row">
                                           <select class="form-control form-control-sm col-6" id="exampleSelect1">
                                               <option>我的模板库</option>
@@ -644,13 +648,16 @@
                                           </div>
                                       </div>
                                   </div>
-                                  <div class="top-content" style="overflow: hidden">
-                                      <div class="main-data-side-d" id="div_block_tree"></div>
+                                  <div class="top-content" style="overflow: hidden" id="kmbkTopDiv">
+                                      <div id="div_block_tree"></div>
                                   </div>
-                                  <div class="resize" id="kmbkResize" style="background-color:#dfdcdc;"></div>
-                                  <div class="bottom-content">
-                                      <div id="div_block_bill" style="height:90px"></div>
-                                      <div id="div_block_ration" style="height:100%"></div>
+                                  <div class="resize-y" id="kmbkResizeA"></div>
+                                  <div class="bottom-content" id="kmbkMidDiv">
+                                      <div id="div_block_bill"></div>
+                                  </div>
+                                  <div class="resize-y" id="kmbkResizeB"></div>
+                                  <div id="kmbkBottomDiv">
+                                      <div id="div_block_ration"></div>
                                   </div>
                               </div>
                           </div>
@@ -1891,6 +1898,7 @@
     <script type="text/javascript" src="/public/web/url_util.js"></script>
     <script type="text/javascript" src="/public/web/number_util.js"></script>
     <script type="text/javascript" src="/public/web/sheet/sheet_common.js"></script>
+    <script type="text/javascript" src="/public/web/slideResize.js"></script>
     <!-- JS. -->
     <!--<script src="/lib/popper/popper.min.js"></script>
     <script src="/lib/bootstrap/bootstrap.min.js"></script>-->

+ 30 - 0
web/building_saas/main/js/controllers/project_controller.js

@@ -233,6 +233,36 @@ ProjectController = {
         } else {
             alert('当前焦点行不是定额,无法替换。');
         }
+    },
+    addNewNodes:function (updateData){
+        let controller = projectObj.mainController;
+        let Bill = projectObj.project.Bills;
+        let newAddNode = [];
+        let newRationNodes = [];
+        for(let nb of updateData.bills.add){
+            let newSource = Bill.tree.insertByData(nb, nb.ParentID, -1, true);//按顺序插入的情况下,nextID为-1,树节点
+            let newNode = projectObj.project.mainTree.insert(nb.ParentID, -1, newSource.data.ID);
+            newNode.source = newSource;
+            newNode.sourceType = Bill.getSourceType();
+            newNode.data = newSource.data;
+            controller.sheet.addRows(newNode.serialNo(), 1);
+           // controller.sheet.showRow(newNode.serialNo(), GC.Spread.Sheets.VerticalPosition.center);
+            newAddNode.push(newNode);
+            Bill.datas.push(nb);
+        }
+        for(let nr of updateData.ration.add){
+            let newNode = projectObj.project.mainTree.insert(nr.billsItemID, -1, nr.ID);
+            newNode.source = nr;
+            newNode.sourceType = projectObj.project.Ration.getSourceType();
+            newNode.data = nr;
+            controller.sheet.addRows(newNode.serialNo(), 1);
+           // controller.sheet.showRow(newNode.serialNo(), GC.Spread.Sheets.VerticalPosition.center);
+            newAddNode.push(newNode);
+            newRationNodes.push(newNode);
+            projectObj.project.Ration.datas.push(nr);
+        }
+        TREE_SHEET_HELPER.refreshTreeNodeData(controller.setting, controller.sheet, newAddNode, false);
+        return newRationNodes;
     }
 /*    addVolumePrice: function (project, sheetController) {
         if (!project || !sheetController) { return null; }

+ 19 - 14
web/building_saas/main/js/main.js

@@ -1,7 +1,6 @@
 /**
  * Created by Mai on 2017/3/10.
  */
-
 $(function () {
     loadMainSize();
     $("#header-menu").removeAttr('style');
@@ -28,14 +27,12 @@ $(function () {
     $('#tab_report').on('shown.bs.tab', function(e){
         sessionStorage.setItem('mainTab', '#tab_report');
     });
-
-    slideResize(getMainResizeEles(), {min: 170, max: 700}, 'height', function() {
+    let mainResizeEles = getMainResizeEles();
+    SlideResize.verticalSlide(mainResizeEles.eleObj, mainResizeEles.limit, function(){
         projectObj.mainSpread.refresh();
         refreshSubSpread();
-        //zmhs_obj.refresh();
         $('#comments').find('textarea').height($('#comments').height() - 25);
     });
-
     const projectId = scUrlUtil.GetQueryString('project');
     // 绑定点击事件
     projectObj.mainSpread.bind(GC.Spread.Sheets.Events.CellClick, function(sender, info) {
@@ -52,20 +49,28 @@ $(function () {
 function getMainResizeEles() {
     // 读取本地存储的高度(必须放在载入spread之前)
     let mainResizeEles = {};
-    mainResizeEles.id = '#main';
-    mainResizeEles.resize = $('#main').find('.resize');
-    mainResizeEles.nearElement = $('#main').find('.top-content');
-    mainResizeEles.nearSpread = mainResizeEles.nearElement.children(".main-data-top");
-    mainResizeEles.farElement = $('#main').find('.bottom-content');
-    mainResizeEles.farSpread = mainResizeEles.farElement.children().find(".main-data-bottom");
-    mainResizeEles.nav = mainResizeEles.farElement.children('ul.nav');
+    mainResizeEles.eleObj = {
+        module: 'mainVertical',
+        resize: $('#mainVerticalResize'),
+        top: $('#top_div'),
+        topSpread: $('#top_div').children('.main-data-top'),
+        bottom: $('#bottom_div'),
+        bottomSpread: $('#bottom_div').children().find('.main-data-bottom'),
+    };
+    mainResizeEles.limit = {
+        min: 150,
+        max: `$(window).height()-$('.header').height()-$('.toolsbar').height()-150-10`,
+        notTopSpread: 0,
+        notBottomSpread: $('#bottom_div ul').height(),
+        totalHeight: `$(window).height()-$('.header').height()-$('.toolsbar').height()-10`
+    };
     return mainResizeEles;
 }
 
 function loadMainSize() {//加载造价书页面各高度
     // 读取本地存储的高度(必须放在载入spread之前)
-    let mainResizeEles = getMainResizeEles() ;
-    loadSize(mainResizeEles, 'height', function() {
+    let mainResizeEles = getMainResizeEles();
+    SlideResize.loadVerticalHeight(mainResizeEles.eleObj.module, mainResizeEles.eleObj, mainResizeEles.limit, function () {
         refreshSubSpread();
         zmhs_obj.refresh();
     });

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

@@ -738,6 +738,9 @@ var Bills = {
                 updateNodes.push(m_node);
                 controller.tree.getAllSubNode(m_node,updateNodes);
             }
+            console.log(mainNodes);
+            let refNodes = mbzm_obj.deleteReferenceRation(mainNodes,updateNodes);//删除子目关联定额节点
+            console.log(mainNodes);
             for(let u_node of updateNodes){
                 if(u_node.sourceType == project.Bills.getSourceType()){
                     billsUpdate[u_node.data.ID] = true;
@@ -777,7 +780,10 @@ var Bills = {
                         project.Ration.deleteSubListOfRation({ID:r_key});
                     }
                 }
-                controller.m_delete(mainNodes);//删除树节点
+                for(let r of refNodes){
+                    controller.m_delete([r],r.serialNo())//这里删除关联子目生成的定额因为是离散的树节点,所以要这样分开处理
+                }
+                controller.m_delete(mainNodes,mainNodes[0].serialNo());//删除树节点
                 me.tree.m_delete(idTreeNodes);
                 $.bootstrapLoading.end();
                 //重新计算

+ 1 - 2
web/building_saas/main/js/models/project.js

@@ -422,16 +422,15 @@ var PROJECT = {
                     temObj = _.find(this[d.type].datas,{"ID":d.data.ID});
                 }
                 if(temObj){
-                    console.log(temObj);
                     for(let key in d.data){
                         if(key == 'ID' || key == 'id'){
                             continue;
                         }
                         this.setValue(temObj,key,d.data[key])
                     }
-                    console.log(temObj);
                 }
             }
+            return refreshNode;
         };
         project.prototype.setValue=function (obj,key,value) {
             let keyArray = key.split('.');

+ 4 - 4
web/building_saas/main/js/views/character_content_view.js

@@ -1475,10 +1475,10 @@ let pageCCOprObj = {
     },
     resizeWidth: function () {
         let workBookWidth = pageCCOprObj.getWorkBookWidth();
-        contentOprObj.setRateWith($('#jobDiv').width() - 40);
-        sheetCommonObj.setColumnWidthByRate($('#jobDiv').width() - 40, contentOprObj.workBook, contentOprObj.setting.header);
-        characterOprObj.setRateWith($('#itemDiv').width() - 40);
-        sheetCommonObj.setColumnWidthByRate($('#itemDiv').width() - 40, characterOprObj.workBook, characterOprObj.setting.header);
+        contentOprObj.setRateWith($('#jobDiv').width() - 45);
+        sheetCommonObj.setColumnWidthByRate($('#jobDiv').width() - 55, contentOprObj.workBook, contentOprObj.setting.header);
+        characterOprObj.setRateWith($('#itemDiv').width() - 45);
+        sheetCommonObj.setColumnWidthByRate($('#itemDiv').width() - 48, characterOprObj.workBook, characterOprObj.setting.header);
     }
 }
 

+ 27 - 9
web/building_saas/main/js/views/locate_view.js

@@ -73,6 +73,14 @@ let locateObject={
             this.subSpread.refresh();
         }
     },
+    refreshWorkBook: function () {
+        if (this.mainSpread) {
+            this.mainSpread.refresh();
+        }
+        if (this.subSpread) {
+            this.subSpread.refresh();
+        }
+    },
     initSubSheet:function () {
         this.subSheet = this.subSpread .getSheet(0);
         sheetCommonObj.initSheet( this.subSheet, this.ration_setting);
@@ -85,19 +93,29 @@ let locateObject={
         //sheetCommonObj.showData(this.mainSheet,this.mainSettiong,datas);
         this.mainSpread.getActiveSheet().setRowCount(datas.length);
     },
+    refreshView: function (options, refreshWorkBook) {
+        let me = this;
+        let mainHeight = $(window).height()-$(".header").height()-$(".toolsbar").height()-$("#searchPanel").height();
+        let subHeight = 0;
+        $('#locateTopDiv').height(mainHeight);
+        $('#locate_result').height(mainHeight);
+        $('#locateBottomDiv').height(subHeight);
+        $('#locate_sub').height(subHeight - 7);
+        if(options == "ration_glj"){
+            let locateLibResize = getLocateLibResize();
+            SlideResize.loadVerticalHeight(locateLibResize.eleObj.module, locateLibResize.eleObj, locateLibResize.limit, function () {
+                locateObject.refreshWorkBook();
+            });
+        }
+        if (refreshWorkBook) {
+            me.refreshWorkBook();
+        }
+    },
     init:function () {
         let me = this;
         let options = $("input[name='content_type']:checked").val();
         let callback = function () {
-            let mainHeight = $(window).height()-$(".header").height()-$(".toolsbar").height()-$("#searchPanel").height();
-            let subHeight = 0;
-            if(options == "ration_glj"){
-                subHeight = mainHeight*0.4;
-                mainHeight = mainHeight*0.6;
-            }
-            console.log(mainHeight);
-            $('#locate_result').height(mainHeight);
-            $('#locate_sub').height(subHeight - 7);
+            me.refreshView(options, false);
             me.initMainSpread();
             me.initSubSpread();
             me.showMainData();

+ 64 - 30
web/building_saas/main/js/views/mbzm_view.js

@@ -117,7 +117,7 @@ let mbzm_obj={
     },
     updatePosition:function (recode) {
         let selection = this.sheet.getSelections()[0];
-        let selectedItem  =(this.datas[selection.row]);
+        let selectedItem =this.datas[selection.row];
         let updateField = $("#createLocation").val()==this.locateMap.INMEASURE?"billID":"fxID";
         if(selectedItem[updateField] == recode.ID) return;
         selectedItem[updateField] = recode.ID;
@@ -132,7 +132,7 @@ let mbzm_obj={
         if(this.datas.length <= 0) return;
         for(let d of this.datas){
             if(gljUtil.isDef(d.quantity)&& parseFloat(d.quantity)>0){
-                if(this.positionChecking(createLocation,d) == false){
+                if(this.positionChecking(createLocation,d) == false){//清单位置检查
                     alert(`请选择${d.code}生成的清单位置`);
                     return;
                 }
@@ -149,15 +149,37 @@ let mbzm_obj={
         console.log(data);
         $.bootstrapLoading.start();
         CommonAjax.post('/ration/applyTemplate',data,function (result) {
-            $.bootstrapLoading.end();
             let refreshNodes = projectObj.project.updateNodesCache(result.updateDatas);//更新要update的前端缓存,并返回要刷新的树节点
+            let nodeDatas = {ration:{add:[]}, bills:{add:[]}};
+            if(result.rationResult){
+                for(let rr of result.rationResult){
+                    nodeDatas.ration.add.push(rr.ration);//定额datas数据的push在addNodes里面做
+                    projectObj.project.Ration.addSubListOfRation(rr);//添加定额子项缓存
+                }
+            }
             //对于新插入的清单:
             if(result.billsResult.length > 0){
-
+                nodeDatas.bills.add = result.billsResult;
             }
-            //对于新插入的定额
-
+            let calRations = ProjectController.addNewNodes(nodeDatas);
+            if(refreshNodes.length > 0){
+                for(let r of refreshNodes){
+                    if(r.sourceType == ModuleNames.ration){
+                        calRations.push(r);
+                        if(r.data.quantityEXP =="MBGCL" ) projectObj.project.quantity_detail.cleanQuantityDetail(r,true);
+                    }
+                }
+                projectObj.mainController.refreshTreeNode(refreshNodes, false);
+            }
+            projectObj.project.projectGLJ.loadData(function () {
+                $.bootstrapLoading.end();
+                cbTools.refreshFormulaNodes();
+                //更新计算程序模板,并进行重新计算
+                projectObj.project.calcProgram.calcNodesAndSave(calRations,function () {
+                    installationFeeObj.calcInstallationFee();
+                });
 
+            });
             console.log(result);
         })
 
@@ -171,7 +193,7 @@ let mbzm_obj={
             }else if(_.isEmpty(data.billsLocation)){
                 validate = false
             }
-        }else {
+        }else if(type == mbzm_obj.locateMap.INFBFX){
             if(_.isEmpty(data.fxID)) {
                 validate = false;
             }else {
@@ -189,6 +211,7 @@ let mbzm_obj={
         let ration = this.getExistRation(data,referenceRationID,type);
         if(ration) {//如果存在,则比较清耗量、工程量表达式是否一致
             let tem =  this.getRationData(ration,data,quantity);//取更新信息
+
             if(tem){//如果不一致,则需要更新
                 rations.update.push(tem);
             }
@@ -204,30 +227,14 @@ let mbzm_obj={
         }else {
             this.createNewRationInFBFX(data,mainRation,quantity,rations,bills);
         }
-
-        /*[
-            {
-                type:'ration',
-                data:{
-                    projectID:1605,
-                    ID:"7b962fb0-1131-11e8-b3da-af725dadd7ae",
-                    name:'testRation'
-                }
-            },
-            {
-                type:'bills',
-                data:{
-                    projectID:1605,
-                    ID:"af9f0081-1127-11e8-99a8-2fc02230b6e7",
-                    name:'安全文明施工专项费用123'
-                }
-            }
-        ]*/
     },
     getRationData:function (ration,data,quantity) {
         let tem = {};
         if (ration.quantity + "" != quantity) tem.quantity = quantity;
-        if (gljUtil.isDef(data.coe) && data.coe != "0") tem.quantityEXP = "MBGCL";
+        if (gljUtil.isDef(data.coe) && data.coe != "0"&&ration.quantityEXP != "MBGCL") {
+            tem.isFromDetail = 0;
+            tem.quantityEXP = "MBGCL";
+        }
         if(!_.isEmpty(tem)) {
             tem.projectID = ration.projectID;
             tem.ID = ration.ID;
@@ -243,7 +250,7 @@ let mbzm_obj={
         if(rations.create.length > 0){
             serialNo = rations.create[rations.create.length -1].newData.serialNo + 1
         }
-        let n_ration = this.createNewRationData(data,newID,mainRation.data.referenceRationID,mainRation.data.billsItemID,serialNo,quantity,mainRation.data.libID);
+        let n_ration = this.createNewRationData(data,newID,mainRation.data.ID,mainRation.data.billsItemID,serialNo,quantity,mainRation.data.libID);
         rations.create.push(n_ration);
         //处理其它兄弟节点的序号
         let br = projectObj.project.Ration.getBillsSortRation();
@@ -287,6 +294,7 @@ let mbzm_obj={
                     ParentID:parentNode.data.ID,
                     NextSiblingID:-1,
                     code:projectObj.project.Bills.newFormatCode(data.billsLocation),
+                    type:billType.BILL,
                     billsLibId:projectInfoObj.projectInfo.engineeringInfo.bill_lib[0].id,//projectInfoObj.projectInfo.engineeringInfo.billsGuidance_lib
                     billsLocation : data.billsLocation//这个是用来在后端查找清单信息
                 };
@@ -385,7 +393,6 @@ let mbzm_obj={
         }
         return data.quantity
     },
-
     getExistRation:function (data,referenceRationID,type) {
         let temRation = null;
         //先检查要更新的定额是否已经存在
@@ -421,8 +428,35 @@ let mbzm_obj={
                 }
             }
         }
-
         return temRation;
+    },
+    hasReferenceRation:function (node) {
+        if(node.sourceType == ModuleNames.ration){
+            let  template = projectObj.project.ration_template.getTemplateByRationID(node.data.ID);
+            if(template){
+                let ration = _.find(projectObj.project.Ration.datas,{'referenceRationID':node.data.ID});
+                if(ration) return true;
+            }
+
+        }
+        return false;
+    },
+    deleteReferenceRation:function (mainNodes,updateNodes) {
+        let refNode = [];
+        for(let m of mainNodes){
+            if(this.hasReferenceRation(m)){
+                let  rations = _.filter(projectObj.project.Ration.datas,{'referenceRationID':m.data.ID});
+                for(let r of rations){
+                    let temNode =  projectObj.project.mainTree.getNodeByID(r.ID);
+                    if(temNode && updateNodes.indexOf(temNode) == -1){//能找到该节点,并且节点不在已经删除的列表中
+                        refNode.push(temNode);
+                        updateNodes.push(temNode);
+                        projectObj.mainController.tree.getAllSubNode(temNode,updateNodes)//添加显示到造价书页面的主材、设备节点
+                    }
+                }
+            }
+        }
+        return refNode;
     }
 };
 

+ 17 - 9
web/building_saas/main/js/views/project_glj_view.js

@@ -1070,13 +1070,21 @@ projectGljObject={
 
 function getProjectResizeEles() {
     let pojGljResizeEles = {};
-    pojGljResizeEles.id = '#project-glj-main';
-    pojGljResizeEles.resize = $('#project-glj-main').find('.resize');
-    pojGljResizeEles.nearElement = $('#project-glj-main').find('.top-content');
-    pojGljResizeEles.nearSpread = pojGljResizeEles.nearElement.children(".main-data-top");
-    pojGljResizeEles.farElement = $('#project-glj-main').find('.bottom-content');
-    pojGljResizeEles.farSpread = pojGljResizeEles.farElement.children().find(".main-data-bottom");
-    pojGljResizeEles.nav = pojGljResizeEles.farElement.children('ul.nav');
+    pojGljResizeEles.eleObj = {
+        module: 'projectGlj',
+        resize: $('#projectGljResize'),
+        top: $('#projectGljTop'),
+        topSpread: $('#project_glj_sheet'),
+        bottom: $('#projectGljBottom'),
+        bottomSpread: $('#mix_ratio_sheet')
+    };
+    pojGljResizeEles.limit = {
+        min: 150,
+        max: `$(window).height()-$('.header').height()-$('#projectGljToolsBar').height()-150-10`,//10: resize.height()
+        notTopSpread: 0,
+        notBottomSpread: $('#projectGljBottom ul').height(),
+        totalHeight: `$(window).height()-$('.header').height()-$('#projectGljToolsBar').height()-10`
+    };
     return pojGljResizeEles;
 }
 
@@ -1084,7 +1092,7 @@ function getProjectResizeEles() {
 function loadProjectGljSize() {
     let me = projectGljObject;
     let pojGljResizeEles = getProjectResizeEles();
-    loadSize(pojGljResizeEles, 'height', function () {
+    SlideResize.loadVerticalHeight(pojGljResizeEles.eleObj.module, pojGljResizeEles.eleObj, pojGljResizeEles.limit, function () {
         me.projectGljSpread?me.projectGljSpread.refresh():'';
         me.mixRatioSpread?me.mixRatioSpread.refresh():'';
     });
@@ -1116,7 +1124,7 @@ function getFileHierarchyInfo(treeData){
 
 $(function () {
     let pojGljResizeEles =  getProjectResizeEles();
-    slideResize(pojGljResizeEles, {min: 170, max: 700}, 'height', function () {
+    SlideResize.verticalSlide(pojGljResizeEles.eleObj, pojGljResizeEles.limit, function () {
         projectGljObject.projectGljSpread.refresh();
         projectGljObject.mixRatioSpread?projectGljObject.mixRatioSpread.refresh():'';
     });

+ 32 - 13
web/building_saas/main/js/views/project_view.js

@@ -2238,27 +2238,44 @@ $('#recColSetting').click(function () {
         $('#recColSetting').removeClass('disabled');
     });
 });
-
 //恢复默认系统设置
 $('#property_default').click(function () {
     let project = projectObj.project,
         projectID = project.ID();
     //清单精灵/指引窗口比例
-    removeLocalCache('farwidth:stdBillsGuidanceTab');
-    removeLocalCache('nearwidth:stdBillsGuidanceTab');
-    removeLocalCache('farheight:#zy');
-    removeLocalCache('nearheight:#zy');
+    removeLocalCache('stdBillsGuidanceTabmainWidth');
+    removeLocalCache('stdBillsGuidanceTabmainSideWidth');
     //定额库窗口比例
-    removeLocalCache('farwidth:stdRationTab');
-    removeLocalCache('nearwidth:stdRationTab');
-    removeLocalCache('farheight:#de');
-    removeLocalCache('nearheight:#de');
+    removeLocalCache('stdRationTabmainWidth');
+    removeLocalCache('stdRationTabmainSideWidth');
+    removeLocalCache('dedeTopDivHeight');
+    removeLocalCache('dedeBottomDivHeight');
+    //查找定位窗口比例
+    removeLocalCache('locateTabmainWidth');
+    removeLocalCache('locateTabmainSideWidth');
+    removeLocalCache('locatelocateTopDivHeight');
+    removeLocalCache('locatelocateBottomDivHeight');
     //主界面窗口比例
-    removeLocalCache('farheight:#main');
-    removeLocalCache('nearheight:#main');
+    removeLocalCache('mainVerticaltop_divHeight');
+    removeLocalCache('mainVerticalbottom_divHeight');
+    //特征及内容窗口比例
+    removeLocalCache('tzjnrjobDivWidth');
+    removeLocalCache('tzjnritemDivWidth');
     //人材机汇总窗口比例
-    removeLocalCache('farheight:#project-glj-main');
-    removeLocalCache('nearheight:#project-glj-main');
+    removeLocalCache('projectGljprojectGljTopHeight');
+    removeLocalCache('projectGljprojectGljBottomHeight');
+    //补充人材机库
+    removeLocalCache('compleGLjleftContentWidth');
+    removeLocalCache('compleGLjmidContentWidth');
+    removeLocalCache('compleGLjrightContentWidth');
+    //补充定额库
+    removeLocalCache('compleRationleftContentWidth');
+    removeLocalCache('compleRationmainContentWidth');
+    removeLocalCache('compleRationzmhsContentWidth');
+    removeLocalCache('compleRationrationItemsSheetHeight');
+    removeLocalCache('compleRationsubContentHeight');
+    removeLocalCache('compleRationmainSpreadHeight');
+    removeLocalCache('compleRationcontentSpreadHeight');
     CommonAjax.post('/pm/api/defaultSettings', {user_id: userID, projectID: projectID}, function (rstData) {
         window.location.href = `/main?project=${projectID}`;
     });
@@ -2473,6 +2490,8 @@ $('#delete_row').on('show.bs.modal', function (e) {//这里用show,在shown之
             showN = true;
             cancelText = "取消";
         }
+    }else if(isSingleSelect()&&mbzm_obj.hasReferenceRation(selected)){//“有模板关联的定额”右键点击删除,弹窗提示“删除主子目时将删除对应的关联子目,是否继续?  是 否” (只有单选中一条定额并且是有模板关联的定额)
+        showinfo = "<label>删除主子目时将删除对应的关联子目,是否继续?</label>";
     }
     $('#delete_showinfo').html(showinfo);
     showN==true? $('#deleteN').show():$('#deleteN').hide();

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

@@ -184,6 +184,9 @@ let quantityEditObj = {
             $("#quantityEditSpread").hide();
         }
         $("#quantityEXPValue").val(selected.data.quantityEXP);
+        selected.data.quantityEXP == "GCLMXHJ" || selected.data.quantityEXP =="MBGCL"?$("#quantityEXPValue").attr("disabled","disabled"):$("#quantityEXPValue").removeAttr("disabled");
+
+
     },
     checkingAndUpdate(quantityEXP,node){
         let me = this;

+ 141 - 80
web/building_saas/main/js/views/side_tools.js

@@ -7,122 +7,183 @@ $(window).resize(function() {
     billsGuidance.refreshWorkBook();
     rationLibObj.refreshSpread();
     BillsElf.setColumnWidthByRate();
+    loadSideToolsHeight();
 });
-//造价书与清单定额库左右拖动
+//造价书与库左右拖动
 let sideResizeEles = {};
-sideResizeEles.id = 'stdRationTab';
-sideResizeEles.resize = $('#sideResize');
-sideResizeEles.evFixedSize = `$(window).width()-$('.main-nav').width()-5`;
-sideResizeEles.nearElement = $('.main-content');
-sideResizeEles.nearSpread = $('.main-content');
-sideResizeEles.farElement = $('.main-side');
-sideResizeEles.farSpread = $('.main-side');
-sideResizeEles.nav = null;
-slideResize(sideResizeEles, {min: 250, max: $('#zaojiashu').width()-260}, 'width', function(){
-    adaptiveTzjnrWidth();
+sideResizeEles.eleObj = {
+    module: 'stdBillsGuidanceTab',
+    resize: $('#sideResize'),
+    parent: $('#mainRow'),
+    left: $('#main'),
+    right: $('#mainSide')
+};
+sideResizeEles.limit = {
+    min: 150,
+    max: `$('#mainRow').width()-150`
+};
+SlideResize.horizontalSlide(sideResizeEles.eleObj, sideResizeEles.limit, function(){
+    //adaptiveTzjnrWidth();
     MaterialController.showReplaceDiv();
     pageCCOprObj.resizeWidth();
     BillsElf.setColumnWidthByRate();
     projectObj.refreshMainSpread();
     refreshSubSpread();
-    if(sideResizeEles.id === 'stdBillsGuidanceTab'){
+    if (sideResizeEles.eleObj.module === 'stdBillsGuidanceTab') {//清单精灵(规则)
         billsGuidance.setColumnWidthByRate(billsGuidance.elfItem.workBook, $('#zy').width(), billsGuidance.elfItem.headers);
         billsGuidance.refreshWorkBook();
-    }
-    else if(sideResizeEles.id === 'stdRationTab'){
+    } else if (sideResizeEles.eleObj.module === 'stdRationTab') {//定额库
         sheetCommonObj.setColumnWidthByRate($('#stdRationChapter').width() - 40, rationLibObj.rationChapterSpread, rationLibObj.rationChapterTreeSetting.cols);
         rationLibObj.refreshSpread();
-    }
-    else if(sideResizeEles.id === 'blockLibTab'){
+    } else if (sideResizeEles.eleObj.module === 'blockLibTab') {//块模板库
         blockLibObj.refreshSpread();
-    }
-    else{
-        billsLibObj.refreshBillsSpread();
-        billsLibObj.refreshBillsRelaSpread();
+    } else if (sideResizeEles.eleObj.module === 'locateTab'){//查找定位
+        locateObject.refreshWorkBook();
     }
 });
 
-/*//清单指引上下拖动
-let billsGuidanceLibResizeEles = {};
-billsGuidanceLibResizeEles.id = '#zy';
-billsGuidanceLibResizeEles.resize = $('#zyResize');
-billsGuidanceLibResizeEles.nearElement = $('#zy').find('.top-content');
-billsGuidanceLibResizeEles.nearSpread = $('#billsGuidance_bills');
-billsGuidanceLibResizeEles.farElement = $('#zy').find('.bottom-content');
-billsGuidanceLibResizeEles.farSpread = $('#billsGuidance_items');
-billsGuidanceLibResizeEles.nav = null;
-slideResize(billsGuidanceLibResizeEles, {min: 147, max: 680}, 'height', function() {
-    billsGuidance.refreshWorkBook();
-});*/
-
 //定额库上下拖动
 let rationLibResizeEles = {};
-rationLibResizeEles.id = '#de';
-rationLibResizeEles.resize = $('#deResize');
-rationLibResizeEles.nearElement = $('#de').find('.top-content');
-rationLibResizeEles.nearSpread = $('#stdRationChapter');
-rationLibResizeEles.farElement = $('#de').find('.bottom-content');
-rationLibResizeEles.farSpread = $('#stdSectionRations');
-rationLibResizeEles.nav = null;
-slideResize(rationLibResizeEles, {min: 147, max: 680}, 'height', function() {
+rationLibResizeEles.eleObj = {
+    module: 'de',
+    resize: $('#deResize'),
+    top: $('#deTopDiv'),
+    topSpread: $('#stdRationChapter'),
+    bottom: $('#deBottomDiv'),
+    bottomSpread: $('#stdSectionRations')
+};
+rationLibResizeEles.limit = {
+    min: 150,
+    max: `$(window).height()-$('.header').height()-$('.toolsbar').height()-$('#deToolsBar').height()-150-10`,//10: resize.height()
+    notTopSpread: 0,
+    notBottomSpread: 0,
+    totalHeight: `$(window).height()-$('.header').height()-$('.toolsbar').height()-$('#deToolsBar').height()-10`
+};
+SlideResize.verticalSlide(rationLibResizeEles.eleObj, rationLibResizeEles.limit, function () {
     rationLibObj.refreshSpread();
 });
 
-//清单库上下拖动
-let billsLibResizeEles = {};
-billsLibResizeEles.id = '#qd';
-billsLibResizeEles.resize = $('#qdResize');
-billsLibResizeEles.nearElement = $('#qd').find('.top-content');
-billsLibResizeEles.nearSpread = $('#stdBillsSpread');
-billsLibResizeEles.farElement = $('#qd').find('.bottom-content');
-billsLibResizeEles.farSpread = billsLibResizeEles.farElement.find('.p-0');
-billsLibResizeEles.nav = null;
-slideResize(billsLibResizeEles, {min: 147, max: 680}, 'height', function() {
-    billsLibObj.refreshBillsSpread();
-    billsLibObj.refreshBillsRelaSpread();
+//查找定位上下拖动
+function getLocateLibResize(){
+    let resizeObj = {};
+    resizeObj.eleObj = {
+        module: 'locate',
+        resize: $('#locate_resize'),
+        top: $('#locateTopDiv'),
+        topSpread: $('#locate_result'),
+        bottom: $('#locateBottomDiv'),
+        bottomSpread: $('#locate_sub')
+    };
+    resizeObj.limit = {
+        min: 150,
+        max: `$(window).height()-$('.header').height()-$('.toolsbar').height()-$('#searchPanel').height()-150-10`,//10: resize.height()
+        notTopSpread: 0,
+        notBottomSpread: 0,
+        totalHeight: `$(window).height()-$('.header').height()-$('.toolsbar').height()-$('#searchPanel').height()-10`
+    };
+    return resizeObj;
+}
+let locateLibResize = getLocateLibResize();
+SlideResize.verticalSlide(locateLibResize.eleObj, locateLibResize.limit, function () {
+    locateObject.refreshWorkBook();
 });
 
-// 块模板库上下拖动
-let blockLibResizeEles = {};
-blockLibResizeEles.id = '#kmbk';
-blockLibResizeEles.resize = $('#kmbkResize');
-blockLibResizeEles.nearElement = $('#kmbk').find('.top-content');
-blockLibResizeEles.nearSpread = $('#div_block_tree');
-blockLibResizeEles.farElement = $('#kmbk').find('.bottom-content');
-blockLibResizeEles.farSpread = $('#div_block_detail');
-blockLibResizeEles.nav = null;
-slideResize(blockLibResizeEles, {min: 147, max: 680}, 'height', function() {
+// 块模板库上下拖动(上中)
+let blockLibTopMid = {};
+blockLibTopMid.eleObj = {
+    module: 'kmbk',
+    resize: $('#kmbkResizeA'),
+    top: $('#kmbkTopDiv'),
+    topSpread: $('#div_block_tree'),
+    bottom: $('#kmbkMidDiv'),
+    bottomSpread: $('#div_block_bill')
+};
+blockLibTopMid.limit = {
+    min: 100,
+    max: `$(window).height()-$('.header').height()-$('.toolsbar').height()-$('#kmbkToolsBar').height()-$('#kmbkBottomDiv').height()-100-10*2`,
+    notTopSpread: 0,
+    notBottomSpread: 0,
+    totalHeight: `$(window).height()-$('.header').height()-$('.toolsbar').height()-$('#kmbkToolsBar').height()-$('#kmbkBottomDiv').height()-10*2` //10: resize.height()
+};
+SlideResize.verticalSlide(blockLibTopMid.eleObj, blockLibTopMid.limit, function () {
     blockLibObj.refreshSpread();
 });
 
+// 块模板库上下拖动(中下)
+let blockLibMidBottom = {};
+blockLibMidBottom.eleObj = {
+    module: 'kmbk',
+    resize: $('#kmbkResizeB'),
+    top: $('#kmbkMidDiv'),
+    topSpread: $('#div_block_bill'),
+    bottom: $('#kmbkBottomDiv'),
+    bottomSpread: $('#div_block_ration')
+};
+blockLibMidBottom.limit = {
+    min: 100,
+    max: `$(window).height()-$('.header').height()-$('.toolsbar').height()-$('#kmbkToolsBar').height()-$('#kmbkTopDiv').height()-100-10*2`,
+    notTopSpread: 0,
+    notBottomSpread: 0,
+    totalHeight: `$(window).height()-$('.header').height()-$('.toolsbar').height()-$('#kmbkToolsBar').height()-$('#kmbkTopDiv').height()-10*2` //10: resize.height()
+};
+SlideResize.verticalSlide(blockLibMidBottom.eleObj, blockLibMidBottom.limit, function () {
+    blockLibObj.refreshSpread();
+});
+
+//加载块模板库多个结构的变量对象
+let blockLibMulti = {
+    module: 'kmbk',
+    eles: [
+        {container: $('#kmbkTopDiv'), spread: $('#div_block_tree'), notSpread: 0, defaultProportion: 0.6},
+        {container: $('#kmbkMidDiv'), spread: $('#div_block_bill'), notSpread: 0, defaultProportion: 0.15},
+        {container: $('#kmbkBottomDiv'), spread: $('#div_block_ration'), notSpread: 0, defaultProportion: 0.25},
+    ],
+    totalHeight: `$(window).height()-$('.header').height()-$('.toolsbar').height()-$('#kmbkToolsBar').height()-10*2`
+};
+
+//加载各库内部上下高度(有的库需要上下拖动)
+function loadSideToolsHeight() {
+    //定额库
+    if ($('#de').is(':visible')) {
+        SlideResize.loadVerticalHeight(rationLibResizeEles.eleObj.module, rationLibResizeEles.eleObj, rationLibResizeEles.limit, function () {
+            rationLibObj.refreshSpread();
+        });
+    } else if ($('#locate').is(':visible')) {
+        //查找定位
+        let options = $("input[name='content_type']:checked").val();
+        locateObject.refreshView(options, true);
+    } else if ($('#kmbk').is(':visible')) {
+        SlideResize.loadMultiVerticalHeight(blockLibMulti.module, blockLibMulti.eles, blockLibMulti.totalHeight, function () {
+            blockLibObj.refreshSpread();
+        });
+    }
+}
 
 var sideToolsObj = {
     showSideTools: function (tabPanel, show, id) {
-        sideResizeEles.id = id;
+        sideResizeEles.eleObj.module = id;
         if (show) {
-            sideResizeEles.nearElement.css('width', '66.666667%');
-            sideResizeEles.farElement.css('width', '33.333333%');
+            //刚打开各库时的默认比例
+            sideResizeEles.eleObj.left.css('width', '66.666667%');
+            sideResizeEles.eleObj.right.css('width', '33.333333%');
+            SlideResize.setResizeWidth(sideResizeEles.eleObj.resize);
             $('.main-side .tab-pane').hide();
             id === 'locateTab'?tabPanel.show(locateObject.onshow):tabPanel.show();//locateTab要等div显示后才执行刷新操作
-            loadSize(sideResizeEles, 'width', function(){
-                if(id === 'stdRationTab'){//定额库
-                    loadSize(rationLibResizeEles, 'height', function(){
-                    });
-                }
-                else if(id === 'blockLibTab'){//块模板库
-                    loadSize(blockLibResizeEles, 'height', function(){
+            //加载打开的库与主界面的宽度比
+            SlideResize.loadHorizonWidth(id, [sideResizeEles.eleObj.resize], [sideResizeEles.eleObj.left, sideResizeEles.eleObj.right], function(){
+                if (id === 'stdRationTab') {//加载定额库内部上下高度
+                    SlideResize.loadVerticalHeight(rationLibResizeEles.eleObj.module, rationLibResizeEles.eleObj, rationLibResizeEles.limit, function () {
+                        rationLibObj.refreshSpread();
                     });
-                }else if(id == "locateTab"){
-
-                }
-                else{//清单库
-                    loadSize(billsLibResizeEles, 'height', function(){
+                } else if (id === 'blockLibTab') {//块模板库
+                    SlideResize.loadMultiVerticalHeight(blockLibMulti.module, blockLibMulti.eles, blockLibMulti.totalHeight, function () {
+                        blockLibObj.refreshSpread();
                     });
                 }
             });
         } else {
-            sideResizeEles.nearElement.css('width', '100%');
-            sideResizeEles.farElement.css('width', '0%');
+            sideResizeEles.eleObj.left.css('width', '100%');
+            sideResizeEles.eleObj.right.css('width', '0%');
             tabPanel.hide();
         }
         adaptiveTzjnrWidth();

+ 43 - 44
web/building_saas/main/js/views/sub_view.js

@@ -168,39 +168,54 @@ $("#linkMBZM").click(function(){        // 模板子目
     gljOprObj.setNodeShowTab();
 });
 
+//特征及内容、工作内容与项目特征左右拖动
+let TZJNR_sideResizeEles = {};
+TZJNR_sideResizeEles.eleObj = {
+    module: 'tzjnr',
+    resize: $('#TZJNRResize'),
+    parent: $('#contentDiv'),
+    left: $('#jobDiv'),
+    right: $('#itemDiv')
+};
+TZJNR_sideResizeEles.limit = {
+    min: 100,
+    max: `$('#contentDiv').width()-100`
+};
+SlideResize.horizontalSlide(TZJNR_sideResizeEles.eleObj, TZJNR_sideResizeEles.limit, function () {
+    pageCCOprObj.resizeWidth();
+    refreshSubSpread();
+});
+
+//刷新特征内容与添加规则宽度
+function initTznrWidth(){
+    //特征及内容总宽度
+    let totalWidth = $('#tzjnrCon').width();
+    //特征及内容和排版规则比例
+    const typeSettingWidth = 30;//排版规则工具条
+    let addRuleVisible = $('#add-rule').is(':visible'),
+        addRulePercent = '33.3%',
+        contentPercent = '66.7%';
+    //排版规则没显示,则排版规则工具条固定30px转换百分比
+    if (!addRuleVisible) {
+        addRulePercent = typeSettingWidth / totalWidth;
+        contentPercent = 1 - addRulePercent;
+        addRulePercent = addRulePercent * 100 + '%';
+        contentPercent = contentPercent * 100 + '%';
+    }
+    //设置特征及内容与排版规则的比例
+    $('#contentDiv').css('width', contentPercent);
+    $('#ruleDiv').css('width', addRulePercent);
+}
 
 //特征及内容各模块宽度自适应
 function adaptiveTzjnrWidth() {
     if(gljOprObj.activeTab !== '#linkTZJNR'){
         return;
     }
-    let job_proportion = 0.33;
-    let item_proportion = 0.67;
-    if(subObj.TZJNRrePercent){
-        job_proportion = parseFloat(subObj.TZJNRrePercent.nearPercent)/100;
-        item_proportion = 1- job_proportion;
-    }
-
-    //排版规则工具条宽度
-    const typeSettingWidth = 30;
-    let tzjnrWidth = $('#tabCon').width();
-    //let tzjnrWidth = $(window).width() - $('.main-nav').width() - $('.main-side').width();
-    //2018-11-23 zhang 需求两个表格默认占比为25%:75%  还要可拖动
-    let extWidth = $('#add-rule').is(':visible')? tzjnrWidth / 3:typeSettingWidth;
-    let totalWidth = tzjnrWidth - extWidth - $('#TZJNRResize').width();
-    $('#jobDiv').css('width', totalWidth*job_proportion);
-    $('#itemDiv').css('width', totalWidth*item_proportion);
-    $('#add-rule').is(':visible')?$('#add-rule').css('width', extWidth): $('#openTypeSetting').css('width', extWidth);
-  /*  if($('#add-rule').is(':visible')){
-        let totalWidth = tzjnrWidth - tzjnrWidth / 3;
-        $('#jobDiv').css('width', totalWidth*0.25);
-        $('#itemDiv').css('width', totalWidth*0.75);
-        $('#add-rule').css('width', tzjnrWidth / 3);
-    } else{
-        $('#jobDiv').css('width', tzjnrWidth / 2);
-        $('#itemDiv').css('width', tzjnrWidth / 2 - typeSettingWidth);
-        $('#openTypeSetting').css('width', typeSettingWidth);
-    }*/
+    initTznrWidth();
+    //加载特征及内容里,工作内容和项目特征的比例
+    SlideResize.loadHorizonWidth(TZJNR_sideResizeEles.eleObj.module, [TZJNR_sideResizeEles.eleObj.resize],
+        [TZJNR_sideResizeEles.eleObj.left, TZJNR_sideResizeEles.eleObj.right]);
     pageCCOprObj.resizeWidth();
     refreshSubSpread();
 }
@@ -221,11 +236,9 @@ $("#linkTZJNR").click(function () {
     gljOprObj.activeTab='#linkTZJNR';
     $("#subItems").children().hide();
     $("#tzjnrCon").show();
-    adaptiveTzjnrWidth();
-    pageCCOprObj.resizeWidth();
     $("#add-rule p").not(":first").css('margin-bottom', 4);
     pageCCOprObj.active = true;
-    refreshSubSpread();
+    adaptiveTzjnrWidth();
     contentOprObj.workBook.getActiveSheet().showColumn(0, GC.Spread.Sheets.HorizontalPosition.left);
     characterOprObj.workBook.getActiveSheet().showColumn(0, GC.Spread.Sheets.HorizontalPosition.left);
     let selectedNode = projectObj.mainController.tree.selected;
@@ -648,18 +661,4 @@ $('#linkGCLMX').on('shown.bs.tab', function () {
 
 $('#linkAZZJF').on('shown.bs.tab', function () {
     gljOprObj.showDataIfRationSelect(projectObj.project.mainTree.selected, '111111');
-});
-
-let TZJNR_sideResizeEles = {};
-TZJNR_sideResizeEles.id = 'linkTZJNR';
-TZJNR_sideResizeEles.resize = $('#TZJNRResize');
-TZJNR_sideResizeEles.nearElement = $('#jobDiv');
-TZJNR_sideResizeEles.nearSpread = $('#jobSpread');
-TZJNR_sideResizeEles.farElement = $('#itemDiv');
-TZJNR_sideResizeEles.farSpread = $('#itemSpread');
-TZJNR_sideResizeEles.nav = null;
-slideResize(TZJNR_sideResizeEles, {min: 100, max: $('#tabCon').width() - 30,no_proportion:true}, 'width', function(rePercent){
-    if(rePercent) subObj.TZJNRrePercent = rePercent;
-    adaptiveTzjnrWidth();
-    refreshSubSpread();
 });