zhangweicheng 5 سال پیش
والد
کامیت
2d5cec9393

+ 1 - 0
modules/all_models/divide_setting.js

@@ -6,6 +6,7 @@ let divideSchema = {
   projectID:Number,
   divideList:[Schema.Types.Mixed],
   ration_gljs:[Schema.Types.Mixed],
+  ration_coes:[Schema.Types.Mixed],
   bills:[Schema.Types.Mixed]
 }
 

+ 6 - 1
modules/main/controllers/ration_controller.js

@@ -40,7 +40,6 @@ let controller = {
     updateMaterialRation:async function(req){
         let data = req.body.data;
         data = JSON.parse(data);
-        console.log(data);
         let result = await ration_facade.updateMaterialRation(data,req.session.sessionCompilation);
         //取运费和原价数据
        if(result.projectGLJList){
@@ -52,6 +51,12 @@ let controller = {
        }
         return result
     },
+    updateDivideRation:async function(req){
+      let data = req.body.data;
+      data = JSON.parse(data);
+      let result = await ration_facade.updateDivideRation(data,req.session.sessionCompilation);
+      return result
+    },
     addMultiRation: async function (req) {
         let data = req.body.data;
         if(typeof data === 'object'){

+ 7 - 0
modules/main/facade/divide_facade.js

@@ -27,6 +27,12 @@ async function updateItem(data){
     }
     if(u.type == "delete"){
       tasks.push({updateOne: {filter: {ID: ID}, update: {"$pull":{divideList:{ID:u.ID}} }}});
+      if(u.itemType == "定额"){
+        await divideModel.update(
+          {ID:ID},
+          { $pull: {ration_gljs:{rationID:u.ID},ration_coes:{rationID:u.ID}}},
+          { multi: true })
+      }
     }
 
   }
@@ -49,6 +55,7 @@ function getData(projectID, callback) {
             projectID:projectID,
             divideList:[],
             ration_gljs:[],
+            ration_coes:[],
             bills:[]
           }
           await divideModel.create(datas);

+ 40 - 6
modules/main/facade/ration_facade.js

@@ -6,6 +6,7 @@ module.exports = {
   replaceRations: replaceRations,
   addNewRation:addNewRation,
   updateMaterialRation:updateMaterialRation,
+  updateDivideRation:updateDivideRation,
   addMaterialRation:addMaterialRation,
   addMultiRation: addMultiRation,
   getSameSectionRations:getSameSectionRations,
@@ -33,6 +34,7 @@ let ration_coe = mongoose.model('ration_coe');
 let ration_model = require('../models/ration');
 let bill_model = require('../models/bills');
 let decimal_facade = require('./decimal_facade');
+let divide_facade = require('./divide_facade');
 let installationFeeModel = mongoose.model("installation_fee");
 let rationInstallationModel = mongoose.model('ration_installation');
 let rationTemplateModel = mongoose.model('ration_template');
@@ -57,6 +59,7 @@ let projectModel = mongoose.model('projects');
 let unitPriceModel = mongoose.model('unit_price');
 let unitPriceFileModel = mongoose.model('unit_price_file');
 let vvTaxModel =  mongoose.model("std_vehicleVesselTax_items");
+let divideModel = mongoose.model("divide_setting");
 
 const fs = require('fs');
 
@@ -98,6 +101,20 @@ async function updateMaterialRation(data,compilation){
     return result;
 }
 
+async function updateDivideRation(data,compilation){
+  let result = {};
+    switch (data.type){
+        case "add":
+            result = await addDivideRation(data,compilation);
+            break;
+        case "delete":
+            result = await deleteDivideRation(data);
+        case "update":
+            result = await modifyDivideRation(data,compilation);
+    }
+    return result;
+}
+
 async function deleteMaterialRation(data) {
     let model = data.type == "freight"?freightCalcModel:originaltCalcModel;
     await model.update(
@@ -146,14 +163,33 @@ async function addMaterialRation(data,compilation) {
     return{ration:newRation,ration_gljs:ration_gljs,projectGLJList:projectGLJList};
 }
 
-async function getNewMaterialRationDatas(data,compilation){
+
+async function addDivideRation(data,compilation){
+  let [newRation,ration_gljs,projectGLJList,ration_coes] = await getNewMaterialRationDatas(data,compilation,true);
+  delete newRation.projectID; 
+  newRation.type=1;
+  newRation.ParentID = data.ParentID;
+  newRation.itemType = "定额";
+  newRation.programID = data.programID;
+  newRation.seq = data.seq;
+  await divideModel.update({ID:data.divideID},{$push:{divideList:newRation,ration_gljs:{$each:ration_gljs},ration_coes:{$each:ration_coes}}});
+  if(data.divideDatas.length > 0)await divide_facade.updateItem({ID:data.divideID,updateDatas:data.divideDatas});
+  return{ration:newRation,ration_gljs:ration_gljs,projectGLJList:projectGLJList,ration_coes};
+}
+
+async function getNewMaterialRationDatas(data,compilation,withCoe = false){
     let searchDao = new SearchDao();
     let stdRation = await searchDao.getRationItem(data.userID, compilation._id, data.rationRepIds,data.code);
     if(!stdRation) throw  "找不到指定的定额!";//new Error("找不到指定的定额!");
 
     let newRation = await createNewMaterialRation(stdRation,data.quantityDecimal,data.projectID);
     let [ration_gljs,projectGLJList] = await addRationGLJ(stdRation,newRation,compilation,true,data.connect_key);
-    return [newRation,ration_gljs,projectGLJList];
+    let result = [newRation,ration_gljs,projectGLJList]
+    if(withCoe == true){
+      let ration_coes = await addRationCoe(stdRation,newRation,compilation,true);
+      result.push(ration_coes);
+    }
+    return result;
 }
 
 
@@ -406,11 +442,9 @@ async function addRationTemplate(std,newRation) {
 }
 
 
-async function addRationCoe(std,newRation,compilation) {
+async function addRationCoe(std,newRation,compilation,notInsert = false) {
     let ration_coe_list = [];
     let seq = 0;
-    let stdCoeIDs = [];
-    let coeMap={}
 
     if(std.hasOwnProperty('rationCoeList')&&std.rationCoeList.length>0){//添加标准库的工料机
         for(let sub of std.rationCoeList){
@@ -441,7 +475,7 @@ async function addRationCoe(std,newRation,compilation) {
     }
     let lastCoe = await getCustomerCoe(newRation.projectID,newRation.ID,seq,compilation);
     ration_coe_list.push(lastCoe);
-    await ration_coe.insertMany(ration_coe_list);
+    if(notInsert!=true) await ration_coe.insertMany(ration_coe_list);//分摊下的时候不保存在这里
     return ration_coe_list;
 
 }

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

@@ -20,5 +20,6 @@ module.exports = function (app) {
     rationRouter.post('/applyTemplate', rationController.action);
     rationRouter.post('/updateRationAss', rationController.action);
     rationRouter.post('/updateCoeAdjust', rationController.action);
+    rationRouter.post('/updateDivideRation', rationController.action);
     app.use('/ration', rationRouter);
 };

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

@@ -432,7 +432,7 @@ var TREE_SHEET_HELPER = {
                 sheetCommonObj.drowTriangle(ctx,x+w-12,y+h/2+2);
             }
             //定额库章节树问号
-            if(sheet.name() === 'stdRationLib_chapter' && this.enterCell && options.row === this.enterCell.row
+            if((sheet.name() === 'stdRationLib_chapter'|| sheet.name() === 'divide_stdRationLib_chapter') && this.enterCell && options.row === this.enterCell.row
                 && typeof rationLibObj !== 'undefined' && rationLibObj.hasExplanationRuleText(options.row)){
                 let centerX = Math.floor(x) + w - 20;
                 let centerY = Math.floor((y + (y + h)) / 2);
@@ -453,9 +453,9 @@ var TREE_SHEET_HELPER = {
         };
         TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
             //点击问号符,弹出说明、工程量计算规则窗口
-            if(hitinfo.sheet.name() === 'stdRationLib_chapter' && typeof rationLibObj !== 'undefined' && rationLibObj.hasExplanationRuleText(hitinfo.row)) {
+            if((hitinfo.sheet.name() === 'stdRationLib_chapter'|| sheet.name() === 'divide_stdRationLib_chapter') && typeof rationLibObj !== 'undefined' && rationLibObj.hasExplanationRuleText(hitinfo.row)) {
                 if(hitinfo.x < hitinfo.cellRect.x + hitinfo.cellRect.width && hitinfo.x > hitinfo.cellRect.x + hitinfo.cellRect.width - questionImgWidth) {
-                    rationLibObj.initQuestionModal(hitinfo.row);
+                    rationLibObj.initQuestionModal(hitinfo.row,sheet.name());
                 }
             }
             let offset = -1;
@@ -482,6 +482,9 @@ var TREE_SHEET_HELPER = {
                 else if(sheetName === 'stdRationLib_chapter'){
                     sessionStorage.setItem('stdRationLibExpState', rationLibObj.tree.getExpState(rationLibObj.tree.items));
                 }
+                else if(sheetName === 'divide_stdRationLib_chapter'){
+                  sessionStorage.setItem('divide_stdRationLibExpState', rationLibObj["divide_tree"].getExpState(rationLibObj["divide_tree"].items));
+                } 
                 else if(sheetName === 'stdBillsGuidance_bills'){
                     sessionStorage.setItem('stdBillsGuidanceExpState', billsGuidance.bills.tree.getExpState(billsGuidance.bills.tree.items));
                 }
@@ -501,7 +504,7 @@ var TREE_SHEET_HELPER = {
         TreeNodeCellType.prototype.processMouseEnter = function(hitinfo){
             if(hitinfo.sheet.name() === 'stdBillsGuidance_bills'){
                 TREE_SHEET_HELPER.delayShowTips(hitinfo,setting);
-            } else if(hitinfo.sheet.name() === 'stdRationLib_chapter'){
+            } else if(hitinfo.sheet.name() === 'stdRationLib_chapter'||hitinfo.sheet.name() === 'divide_stdRationLib_chapter'){
                 if(this.enterCell==null){
                     this.enterCell={
                         row:hitinfo.row,
@@ -524,7 +527,7 @@ var TREE_SHEET_HELPER = {
         };
         TreeNodeCellType.prototype.processMouseLeave = function (hitinfo) {
             TREE_SHEET_HELPER.hideTipsDiv();
-            if(hitinfo.sheet.name() === 'stdRationLib_chapter') {
+            if(hitinfo.sheet.name() === 'stdRationLib_chapter'||hitinfo.sheet.name() === 'divide_stdRationLib_chapter') {
                 this.enterCell = null;
                 hitinfo.sheet.invalidateLayout();
                 hitinfo.sheet.repaint();

+ 10 - 10
web/building_saas/main/html/divide.html

@@ -25,17 +25,17 @@
           <div class="bottom-content" id="divideBottom">
               <ul class="nav nav-tabs d-flex" role="tablist">
                   <li class="nav-item">
-                      <a class="nav-link active show" id="divide_glj_nav" data-toggle="tab" href="#divide_sub" role="tab" aria-selected="true">工料机</a>
+                      <a class="nav-link active show" id="divide_glj_nav" data-toggle="tab" href="#divide_subItems" role="tab" aria-selected="true">工料机</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link " id="divede_calc_nav" data-toggle="tab" href="#divide_sub" role="tab" aria-selected="false">计算程序</a>
+                      <a class="nav-link " id="divede_calc_nav" data-toggle="tab" href="#divide_subItems" role="tab" aria-selected="false">计算程序</a>
                   </li>
               </ul>
               <!-- Tab panes -->
               <div class="tab-content"> 
-                  <div class="tab-pane" id="divide_sub" role="tabpanel">
-                      <div class="main-data-bottom" id="divide_sub_sheet" style="overflow:hidden"></div>
-                      <div class="main-data-bottom ovf-hidden" id="divide_itemTextDiv">
+                  <div class="tab-pane active" id="divide_subItems" role="tabpanel">
+                      <div class="main-data-bottom" id="divide_subSpread" style="overflow:hidden;float: left;width: 100%;"></div>
+                      <div class="main-data-bottom ovf-hidden col-auto p-0" id="divide_itemTextDiv" style="display: none">
                         <div class="resize-x main-data-bottom ovf-hidden" id="divide_rgResize" style="display: none"></div>
                         <div class="item_spread main-data-bottom ovf-hidden " id="divide_gljSubDiv" style="width: 99%;">
                             <div class="tab-content">
@@ -63,12 +63,12 @@
                                 <div id="divide_zmhs_nav" style="display: none">
                                     <ul class="nav nav-tabs">
                                         <li class="nav-item" data-toggle="tooltip" data-placement="left" title="收起">
-                                            <a data-toggle="tab" href="#rnc-close" role="tab" class="zmhs-link nav-link">收起<!--<i class="fa fa-arrow-right"></i>--></a>
+                                            <a data-toggle="tab" href="#divide_rnc-close" role="tab" class="zmhs-link nav-link">收起<!--<i class="fa fa-arrow-right"></i>--></a>
                                         </li>
                                        
-                                        <li class="nav-item" data-toggle="tooltip" data-placement="left" title="附注条件"><a data-toggle="tab"  id="divide_hs-nav" href="#divide_rnc-zm" role="tab"class="zmhs-link nav-link">换算</a></li>
-                                        <li class="nav-item" data-toggle="tooltip" data-placement="left" title="自定义系数"><a data-toggle="tab" href="#divide_rnc-cus" role="tab"class="zmhs-link nav-link">系数</a></li>
-                                        <li class="nav-item" data-toggle="tooltip" data-placement="left" title="定额稳定土"><a data-toggle="tab" href="#divide_rnc-stable" role="tab" class="zmhs-link nav-link">稳定土</a></li>
+                                        <li class="nav-item" data-toggle="tooltip" data-placement="left" title="附注条件"><a data-toggle="tab"  id="divide_hs-nav" href="#divide_rnc-zm" role="tab"class="divide_zmhs-link nav-link">换算</a></li>
+                                        <li class="nav-item" data-toggle="tooltip" data-placement="left" title="自定义系数"><a data-toggle="tab" href="#divide_rnc-cus" role="tab"class="divide_zmhs-link nav-link">系数</a></li>
+                                        <li class="nav-item" data-toggle="tooltip" data-placement="left" title="定额稳定土"><a data-toggle="tab" href="#divide_rnc-stable" role="tab" class="divide_zmhs-link nav-link">稳定土</a></li>
                                     </ul>
                                 </div>
                             </div>
@@ -109,7 +109,7 @@
                 </div>
             </div>
             <div class="top-content" id="divide_deTopDiv" style="overflow: hidden">
-                <div class="main-data-side-d" id="divide_stdRationChapter"></div>
+                <div class="" id="divide_stdRationChapter"></div>
             </div>
             <div class="resize-y" id="divide_deResize" style="background: #F1F1F1"></div>
             <div class="bottom-content" id="divide_deBottomDiv">

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

@@ -17,13 +17,13 @@ $(function () {
         $(e.relatedTarget.hash).removeClass('active');
         $("#subItems").addClass('active');
         $(gljOprObj.activeTab).addClass('active');
+        subObj.initGljSubTab();
         autoFlashHeight();
         projectObj.refreshMainSpread();
         billsGuidance.refreshWorkBook();
         billsLibObj.refreshBillsSpread();
         billsLibObj.refreshBillsRelaSpread();
         rationLibObj.refreshSpread();
-        subObj.initGljSubTab();
         //autoFlashHeight 里已经包含了 refreshSubSpread();
     });
 

+ 224 - 27
web/building_saas/main/js/views/divide_view.js

@@ -40,9 +40,12 @@ let divideObj = {
   },
   divideSpread:null,
   billsSpread:null,
+  divideSubSpread:null,
+  showDivideGljSubTab:false,
   initSpread:function(){
     this.initDivideSpread();
     this.initBillsSpread();
+    this.initDivideSubSpread();
     if(!projectReadOnly){
       this.initDivideRightClick();
     }else {
@@ -58,6 +61,7 @@ let divideObj = {
     if(!$('#divide_main').is(':visible')) return;
     if(this.divideSpread) this.divideSpread.refresh();
     if(this.billsSpread) this.billsSpread.refresh();
+    if(this.divideSubSpread) this.divideSubSpread.refresh();
   },
   showDivideDatas:function(){
     if(!$('#divide_main_sheet').is(':visible')) return;
@@ -110,7 +114,7 @@ let divideObj = {
         //金额,预算价,取费类别不可编辑
         if(dataCode =="totalPrice" || dataCode =="marketPrice" || dataCode =="programID" ) return false;
         //有子项时,单价不可编辑
-        if(_.find(me.divideDatas,{ParentID:data.ID})) return false;
+        if(dataCode =="unitPrice"&& _.find(me.divideDatas,{ParentID:data.ID})) return false;
       }
       if( data.itemType == "量价" && dataCode =="totalPrice") return false//量价:“金额”不可编辑。
       if(data.itemType == "定额"){ //定额:“单位”、“单价”、“金额”、“预算价”
@@ -145,12 +149,16 @@ let divideObj = {
       itemType:itemType,
       ParentID:-1
     };
-    if(type) newItem.type = type;
+    if(type) newItem.subType = type;
     let selected = this.getSelectedItem();
     if(itemType!="分摊项"){//当插入定额或者量价时:
       newItem.ParentID = selected.itemType == "分摊项"?selected.ID:selected.ParentID;
+    }
+    if(itemType == "定额") newItem.type = rationType.ration;
+    if(itemType == "量价"){
+      newItem['programID'] = projectObj.project.calcProgram.compiledTemplateMaps["费率为0"];
+      newItem.type = rationType.volumePrice;
     } 
-    if(itemType == "量价") newItem['programID'] = projectObj.project.calcProgram.compiledTemplateMaps["费率为0"];
 
     let [seq,datas] = this.getNewSeqs(selected,newItem);
     newItem.seq = seq;
@@ -167,7 +175,7 @@ let divideObj = {
         if(s.ParentID == selected.ID) subItems.push({type:"delete",ID:s.ID});
       }
     }
-    subItems.push({type:"delete",ID:selected.ID});
+    subItems.push({type:"delete",ID:selected.ID,itemType:selected.itemType});
     await this.updateItem(subItems);
   },
   getNewSeqs:function(selected,newItem){
@@ -191,18 +199,64 @@ let divideObj = {
     try {
       $.bootstrapLoading.start();
       let result = ajaxPost("/divide/updateItem",{ID:divideSetting.ID,updateDatas:datas})
-      for(let d of datas){
-        if(d.type == "add"){
-          divideSetting.divideList.push(d.doc);
-        }
-        if(d.type == "delete"){
-          _.remove(divideSetting.divideList,{'ID':d.ID});
-        }
-        if(d.type == "update"){
-          let item = _.find(divideSetting.divideList,{'ID':d.ID});
-          if(item) gljUtil.updateProperty(item,d.doc);
-        }
+      this.refreshDivideCaches(datas);
+    } catch (error) {
+      console.log(error)
+    }
+    $.bootstrapLoading.end();
+    this.showDatas();
+  },
+  refreshDivideCaches:function(datas){
+    let divideSetting =  projectObj.project.divide_setting.datas
+    for(let d of datas){
+      if(d.type == "add"){
+        divideSetting.divideList.push(d.doc);
       }
+      if(d.type == "delete"){
+        _.remove(divideSetting.divideList,{'ID':d.ID});
+        if(d.itemType =="定额"){
+          _.remove(divideSetting.ration_gljs,{'rationID':d.ID});
+          _.remove(divideSetting.ration_coes,{'rationID':d.ID});
+        } 
+      }
+      if(d.type == "update"){
+        let item = _.find(divideSetting.divideList,{'ID':d.ID});
+        if(item) gljUtil.updateProperty(item,d.doc);
+      }
+    }
+  },
+  addDivideRation:async function(rationRepId,code){
+    let selected = this.getSelectedItem();
+    if(!selected) return;
+    let divideSetting =  projectObj.project.divide_setting.datas
+    let pEngineer = projectObj.project.projectInfo.property.projectEngineering;
+    let libIDs = [rationRepId];
+    let defaultLibID = rationLibObj.getDefaultStdRationLibID();
+    let data = {userID:userID,defaultLibID:defaultLibID, rationRepIds: libIDs, code: code,quantityDecimal:getDecimal("ration.quantity"),projectID:projectObj.project.ID()};
+    data.ParentID = selected.itemType == "分摊项"?selected.ID:selected.ParentID;
+    let [seq,datas] = this.getNewSeqs(selected,data);
+    data.type="add";
+    data.seq = seq;
+    data.divideID = divideSetting.ID;
+    if(pEngineer) data.programID = pEngineer;
+    data.divideDatas = datas;
+    let sel = this.divideSheet.getSelections()[0];
+    this.divideSheet.setSelection(sel.row+1,sel.col,sel.rowCount,sel.colCount);
+    await this.updateDivideRation(data);
+
+  },
+  updateDivideRation:async function(data){
+    let divideSetting =  projectObj.project.divide_setting.datas
+    try {
+      $.bootstrapLoading.start();
+      let result = await ajaxPost("/ration/updateDivideRation",data)
+      if(data.type=="add"){
+        data.divideDatas.push({type:"add",doc:result.ration});
+        this.refreshDivideCaches(data.divideDatas);
+        if(result.projectGLJList) projectObj.project.projectGLJ.loadNewProjectGLJToCaches(result.projectGLJList,true);   
+        if(result.ration_gljs) divideSetting.ration_gljs = divideSetting.ration_gljs.concat(result.ration_gljs);
+        if(result.ration_coes) divideSetting.ration_coes = divideSetting.ration_coes.concat(result.ration_coes);
+      } 
     } catch (error) {
       console.log(error)
     }
@@ -210,6 +264,7 @@ let divideObj = {
     this.showDatas();
   },
 
+
   initDivideSpread:function(){
     if(this.divideSpread) return;
     this.divideSpread = SheetDataHelper.createNewSpread($("#divide_main_sheet")[0]);
@@ -218,11 +273,9 @@ let divideObj = {
     sheetCommonObj.initSheet(this.divideSheet, this.divideSetting, 2);
     this.divideSheet.bind(GC.Spread.Sheets.Events.EditStarting,this.onDivideEditStarting);
     this.divideSheet.bind(GC.Spread.Sheets.Events.ValueChanged,this.onDivideValueChange)
-/*     ;
+    this.divideSheet.bind(GC.Spread.Sheets.Events.SelectionChanged,this.onDivideSelectionChange);  
+    /*     ;
     this.divideSheet.bind(GC.Spread.Sheets.Events.RangeChanged, this.onCoeRangeChanged); */
-    this.divideSheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function (e,args) {
-        args.sheet.repaint();
-    });
 
     SheetDataHelper.protectdSheet(this.divideSheet);
   },
@@ -250,6 +303,15 @@ let divideObj = {
 
     await me.updateItem([me.getDivideUpdateData(recode,dataCode,value)]);
   },
+  onDivideSelectionChange:function(sender,args){
+    let me = divideObj;
+    let newSel = args.newSelections[0];
+    let oldSel = args.oldSelections?args.oldSelections[0]:{};
+    if(newSel.row != oldSel.row){
+      me.initNavItem();
+    }
+    args.sheet.repaint();
+  },
   getDivideUpdateData:function(recode,dataCode,value){
     let doc = {};
     if(recode.itemType == "分摊项"){
@@ -275,6 +337,84 @@ let divideObj = {
     sheetCommonObj.initSheet(this.billsSheet, this.billsSetting, 0);
     SheetDataHelper.protectdSheet(this.divideSheet);
   },
+  initDivideSubSpread:function(){
+    if(this.divideSubSpread) return;
+    this.divideSubSpread = SheetDataHelper.createNewSpread($("#divide_subSpread")[0],2);
+    sheetCommonObj.spreadDefaultStyle(this.divideSubSpread);
+    this.divideSubSheet = this.divideSubSpread.getSheet(0);
+    sheetCommonObj.initSheet(this.divideSubSheet, gljCol.ration_glj_setting, 0);
+    SheetDataHelper.protectdSheet(this.divideSubSheet);
+  },
+  initNavItem(){
+    let selected = this.getSelectedItem();
+    if(selected.itemType == "分摊项"){
+      $("#divide_itemTextDiv").hide();
+      $(`#divide_subSpread`).css('width', "100%");
+    }else{
+      $("#divide_itemTextDiv").show();
+      if(this.showDivideGljSubTab == true){
+        $("#divide_gljSubDiv").show();
+        $("#divide_rgResize").show();
+      } else {
+          $("#divide_gljSubDiv").hide();
+          $("#divide_rgResize").hide();
+      }
+      this.initItemWidth();
+    }  
+    this.divideSubSpread.refresh();
+  },
+  initItemWidth:function (){
+    //总宽度
+    let totalWidth = $('#divide_subItems').width();
+    //人材机和项目特征文本比例
+    const openWidth = 30;//打开项目特征工具条
+    const tab_tem = (305+openWidth+10)/totalWidth;//tab显示框默认宽度:305(表格宽度) + 30(工具条宽度)+10(resize div 宽度)
+    let //默认比例
+        textPercent = tab_tem * 100 + '%',//'15%',
+        rcjPercent = (1 - tab_tem)* 100 + '%';//85
+    //文本没显示,则打开工具条固定30px转换百分比
+    if (!this.showDivideGljSubTab) {
+        textPercent = openWidth / totalWidth;
+        rcjPercent = 1 - textPercent;
+        textPercent = textPercent * 100 + '%';
+        rcjPercent = rcjPercent * 100 + '%';
+    }
+    //设置特征及内容与排版规则的比例
+    $('#divide_subSpread').css('width', rcjPercent);
+    $('#divide_itemTextDiv').css('width', textPercent);
+    //打开了项目特征,则继续加载人材机表和项目特征文本具体比例
+    if (divideObj.showDivideGljSubTab === true) {
+        let rg_sideResizeEles = this.getSubSideResize();
+        SlideResize.loadHorizonWidth(rg_sideResizeEles.eleObj.module,
+            [rg_sideResizeEles.eleObj.resize], [rg_sideResizeEles.eleObj.left, rg_sideResizeEles.eleObj.right]);
+        $("#divide_gljSubDiv").width( $('#divide_itemTextDiv').width() - rg_sideResizeEles.eleObj.resize.width() - 30)
+    }
+  },
+  initDivideGljSubTab:function(){
+    if(this.showDivideGljSubTab == true){
+      $("#divide_gljSubDiv").show();
+      $("#divide_rgResize").show();
+    } else {
+        $("#divide_gljSubDiv").hide();
+        $("#divide_rgResize").hide();
+    }
+    this.initItemWidth();
+  },
+  getSubSideResize: function () {
+    let rg_sideResizeEles = {};
+    rg_sideResizeEles.eleObj = {
+        module: this.moduleName,
+        resize: $('#divide_rgResize'),
+        parent: $('#divide_subItems'),
+        left: $('#divide_subSpread'),
+        right: $('#divide_itemTextDiv')
+    };
+    rg_sideResizeEles.limit = {
+        min: 100,
+        max: `$('#divide_subItems').width()-100`
+    };
+    return rg_sideResizeEles;
+  },
   initDivideRightClick:function(){
     //如果当前行是无组成物的“普通材料”、“绿化苗木”、“外购砼构件”、“商品混凝土”、“商品砂浆”,则右键“添加计算材料”按钮有效。
     let me = this;
@@ -356,11 +496,11 @@ let divideObj = {
     let divideResizeEles = {};
     divideResizeEles.eleObj = {
         module: 'divide',
-        resize: $('#divideResize'),
+        resize: $('#divide_rgResize'),
         top: $('#divide_top'),
         topSpread: $('#divide_main_sheet'),
         bottom: $('#divideBottom'),
-        bottomSpread: [$('#sub_sheet')]
+        bottomSpread: [$('#divide_subSpread')]
     };
     divideResizeEles.limit = {
         min: 150,
@@ -381,7 +521,9 @@ function loadDivideHeight(){
   let divideResizeEles = me.getDivideResizeEles();
   SlideResize.loadVerticalHeight(divideResizeEles.eleObj.module, divideResizeEles.eleObj, divideResizeEles.limit, function () {
       me.refreshViews();
+      zmhs_obj.refresh();
   });
+  if($('#divide_de').is(':visible')) showDivideSide($($("#divide_stdRationTab").attr('relaPanel')), true, $("#divide_stdRationTab").attr('id'));
 }
 
 $('#tab_divide').on('shown.bs.tab', function (e) {
@@ -389,7 +531,7 @@ $('#tab_divide').on('shown.bs.tab', function (e) {
   loadDivideHeight();
   divideObj.initSpread();
   divideObj.showDatas();
-
+  divideObj.initNavItem();
 })
 
 $('.divide-nav-link').bind('click', function () {//$('.side-tabs ul li a').bind   2018-11-23  使用更多标签,所以不能这样绑定事件了
@@ -452,11 +594,11 @@ function showDivideSide(tabPanel, show, id){
       $('.divide_side .tab-pane').hide();
       tabPanel.show();//locateTab要等div显示后才执行刷新操作
       //加载打开的库与主界面的宽度比
-      SlideResize.loadHorizonWidth(id, [divideSideResizeEles.eleObj.resize], [divideSideResizeEles.eleObj.left, divideSideResizeEles.eleObj.right], function(){
-          
-        if (id === 'stdRationTab') {//加载定额库内部上下高度
+      SlideResize.loadHorizonWidth(id, [divideSideResizeEles.eleObj.resize], [divideSideResizeEles.eleObj.left, divideSideResizeEles.eleObj.right], function(){      
+        if (id === 'divide_stdRationTab') {//加载定额库内部上下高度
             SlideResize.loadVerticalHeight(dividRationLibResizeEles.eleObj.module, dividRationLibResizeEles.eleObj, dividRationLibResizeEles.limit, function () {
-                //sheetCommonObj.setColumnWidthByRate($('#divide_stdRationChapter').width() - 30, rationLibObj.rationChapterSpread, rationLibObj.rationChapterTreeSetting.cols);
+              if(rationLibObj.divide_rationChapterSpread) rationLibObj.divide_rationChapterSpread.refresh();
+              if(rationLibObj.divide_sectionRationsSpread) rationLibObj.divide_sectionRationsSpread.refresh();
             });
           }
       });
@@ -465,4 +607,59 @@ function showDivideSide(tabPanel, show, id){
       divideSideResizeEles.eleObj.right.css('width', '0%');
       tabPanel.hide();
   }
-}
+}
+
+$('#divide_stdRationTab').bind('click', function () {
+  var select = $('#divide_stdRationLibSelect');
+  rationLibObj.checkSpread('divide');
+  if (select[0].options.length === 0) {
+      rationLibObj.loadStdRationLibs('divide');
+      //rationLibObj.loadStdRationContextMenu();
+  }; 
+  divideObj.initNavItem();
+});
+
+$('#divide_stdRationLibSelect').change(function () {
+  var select = $(this);
+  if (this.children.length !== 0) {
+      let rationLibId = select.val();
+      sessionStorage.setItem('divide_stdRationLib', rationLibId);
+      sessionStorage.removeItem('divide_stdRationLibExpState');
+      rationLibObj.loadStdRation(rationLibId,'divide');
+  }
+});
+
+$('.divide_gljSubTab ul li a').bind('click',function () {
+  if(this.hash =="#divide_rnc-close"){
+    $("#divide_zmhs_nav").hide();
+    $("#divide_zmhs_toogle").show();
+    closeTab(this);
+    divideObj.showDivideGljSubTab = false;
+  }else{
+    divideObj.showDivideGljSubTab = true;
+  }
+  divideObj.initDivideGljSubTab();
+  if(divideObj.divideSubSpread) divideObj.divideSubSpread.refresh();
+});
+
+$('.divide_gljSubTab ul li a').on('shown.bs.tab', function () {
+  if(this.hash == "#divide_rnc-zm"){
+      zmhs_obj.initCoeSpread();
+  }else if(this.hash == "#divide_rnc-fz"){
+      zmhs_obj.initAssSpread();
+  }else if(this.hash == "#divide_rnc-cus"){
+      zmhs_obj.initCusSpread();
+  }else if(this.hash == "#divide_rnc-stable"){
+      zmhs_obj.initStableSpread();
+  } 
+  zmhs_obj.refresh();
+  zmhs_obj.showDatas();
+});
+
+$('#divide_zmhs_toogle').bind('click',function (){
+  $("#divide_zmhs_nav").show();
+  if(divideObj.showDivideGljSubTab == false){
+      $("#divide_hs-nav").click();
+  }
+   $("#divide_zmhs_toogle").hide();
+});

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

@@ -18,7 +18,7 @@ let gljCol = {
             //{headerName: "暂估", headerWidth: 45, dataCode: "isEstimate", dataType: "String", hAlign: "center", vAlign: "center", cellType: "checkBox"}
         ],
         view: {
-            lockColumns: [ "adjustPrice", "rationItemQuantity", "quantity", "totalQuantity", "isEstimate"],//这里以后改成dataCode好一点
+            lockColumns: [ "adjustPrice", "rationItemQuantity", "quantity", "totalQuantity", "isEstimate"],
             rowHeaderWidth:25
         },
         getStyle:function (data) {

+ 1 - 2
web/building_saas/main/js/views/glj_view.js

@@ -944,8 +944,7 @@ var gljOprObj = {
                 var decimal = getDecimal("glj.unitPrice");
                 newval = number_util.checkNumberValue(value, decimal);
             }
-        }
-        else {
+        }else {
             if (value != null) {
                 projectObj.project.projectGLJ.updatePropertyFromMainSpread(node, fieldName, value,editingText);
                 return;

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

@@ -442,6 +442,7 @@ var projectObj = {
             project.ration_glj.updateFromMainSpread(value,node,fieldName);
         }
         else if(calcTools.isGljRation(node)){
+            if(fieldName === 'feesIndex.common.unitFee') fieldName = 'marketUnitFee';
             gljOprObj.updateRationTypeGLJ(value,node,fieldName,editingText);
         }
         else if(fieldName === 'remark'){

+ 59 - 40
web/building_saas/main/js/views/std_ration_lib.js

@@ -18,19 +18,22 @@ var rationLibObj = {
         TREE_SHEET_HELPER.initSetting($('#stdSectionRations')[0], rationLibObj.sectionRationsSetting);
     },
     checkSpread: function () {
-        if (!this.rationChapterSpread) {
-            this.rationChapterSpread = SheetDataHelper.createNewSpread($('#stdRationChapter')[0]);
-            this.rationChapterSpread.getSheet(0).options.rowHeaderVisible = false;
-            sheetCommonObj.spreadDefaultStyle(this.rationChapterSpread);
-            this.rationChapterSpread.getSheet(0).name('stdRationLib_chapter');
-            this.rationChapterSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onChapterSpreadCellDoubleClick);
-        }
-        if (!this.sectionRationsSpread) {
-            this.sectionRationsSpread = SheetDataHelper.createNewSpread($('#stdSectionRations')[0]);
-            this.sectionRationsSpread.getSheet(0).setColumnWidth(0, 1, GC.Spread.Sheets.SheetArea.rowHeader);
-            sheetCommonObj.spreadDefaultStyle(this.sectionRationsSpread);
+        let from = $('#divide_de').is(':visible')?"divide_":"";
+        if (!this[from+'rationChapterSpread']) {
+             this[from+'rationChapterSpread'] = SheetDataHelper.createNewSpread($(`#${from}stdRationChapter`)[0]);
+             let rationChapterSpread = this[from+'rationChapterSpread'];
+            rationChapterSpread.getSheet(0).options.rowHeaderVisible = false;
+            sheetCommonObj.spreadDefaultStyle(rationChapterSpread);
+            rationChapterSpread.getSheet(0).name(from+'stdRationLib_chapter');
+            rationChapterSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onChapterSpreadCellDoubleClick);
+        }
+        if (!this[from+'sectionRationsSpread']) {
+            this[from+'sectionRationsSpread'] = SheetDataHelper.createNewSpread($(`#${from}stdSectionRations`)[0]);
+            let sectionRationsSpread = this[from+'sectionRationsSpread'];
+            sectionRationsSpread.getSheet(0).setColumnWidth(0, 1, GC.Spread.Sheets.SheetArea.rowHeader);
+            sheetCommonObj.spreadDefaultStyle(sectionRationsSpread);
             if (!projectReadOnly) {
-                this.sectionRationsSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onRationSpreadCellDoubleClick);
+                sectionRationsSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onRationSpreadCellDoubleClick);
             }
             this.refreshSettingForHint();
         }
@@ -47,15 +50,19 @@ var rationLibObj = {
         }
     },
     loadStdRationLibs: function () {
-        let select = $('#stdRationLibSelect');
+        let from = $('#divide_de').is(':visible')?"divide_":"";
+        let select = $(`#${from}stdRationLibSelect`);
         select.empty();
         let ration_lib = projectObj.project.projectInfo.engineeringInfo.ration_lib;
-        ration_lib.push({
+        if(rationLibObj.inited != true){
+          ration_lib.push({
             isDefault: false,
             id: rationLibObj.compleRationLibId,
             name: '我的补充定额'
-        });
-        let selectedRationLib = sessionStorage.getItem('stdRationLib');
+          });
+        }
+     
+        let selectedRationLib = sessionStorage.getItem(`${from}stdRationLib`);
         ration_lib.forEach(function (data) {
             let option = $('<option>').val(data.id).text(data.name);
             if(selectedRationLib){
@@ -74,13 +81,14 @@ var rationLibObj = {
             rationLibObj.loadStdRation(select.val());
         }
     },
-    initQuestionModal: function(row) {
-        let node = rationLibObj.tree.items[row];
+    initQuestionModal: function(row,sheetName) {
+        let pre = $('#divide_de').is(':visible')?"divide_":"";
+        let node = rationLibObj[pre+'tree'].items[row];
         while (node && !node.data.explanation){
             node = node.parent;
         }
         let explanation = node && node.data.explanation ? node.data.explanation : '无内容';
-        node = rationLibObj.tree.items[row];
+        node = rationLibObj[pre+'tree'].items[row];
         $('#questionContent1').html(explanation);
         while (node && !node.data.ruleText){
             node = node.parent;
@@ -90,8 +98,9 @@ var rationLibObj = {
         $('#questionContent2').html(ruleText);
         $('#questionModal').modal('show');
     },
-    hasExplanationRuleText: function(row) {
-        let node = rationLibObj.tree.items[row];
+    hasExplanationRuleText: function(row) { 
+        let pre = $('#divide_de').is(':visible')?"divide_":"";
+        let node = rationLibObj[pre+'tree'].items[row];
         if (!node) {
             return false;
         }
@@ -103,20 +112,22 @@ var rationLibObj = {
         }
         return false;
     },
-    loadStdRation: function (rationLibID) {
+    loadStdRation: function (rationLibID){
+        let from = $('#divide_de').is(':visible')?"divide_":"";
         $.bootstrapLoading.start();
         rationLibObj.curLibType = rationLibID === rationLibObj.compleRationLibId ? rationLibObj.libType.complementary : rationLibObj.libType.std;
         var that = this;
+        let rationChapterSpread = this[from+'rationChapterSpread'];
         var showRationChapterTree = function (datas) {
             var rationChapterTree = idTree.createNew({id: 'ID', pid: 'ParentID', nid: 'NextSiblingID', rootId: -1, autoUpdate: false});
-            that.tree = rationChapterTree;
-            var rationChapterTreeController = TREE_SHEET_CONTROLLER.createNew(rationChapterTree, that.rationChapterSpread.getActiveSheet(), that.rationChapterTreeSetting);
-            sheetCommonObj.setColumnWidthByRate($('#stdRationChapter').width() - 40, that.rationChapterSpread, that.rationChapterTreeSetting.cols);
+            that[from+'tree'] = rationChapterTree;
+            var rationChapterTreeController = TREE_SHEET_CONTROLLER.createNew(rationChapterTree, rationChapterSpread.getActiveSheet(), that.rationChapterTreeSetting);
+            sheetCommonObj.setColumnWidthByRate($(`#${from}stdRationChapter`).width() - 40, rationChapterSpread, that.rationChapterTreeSetting.cols);
             rationChapterTree.loadDatas(datas);
             //读取展开收起状态
-            let currentExpState = sessionStorage.getItem('stdRationLibExpState');
+            let currentExpState = sessionStorage.getItem(from+'stdRationLibExpState');
             if(currentExpState){
-                that.tree.setExpandedByState(that.tree.items, currentExpState);
+                that[from+'tree'].setExpandedByState(that[from+'tree'].items, currentExpState);
             }
             else {
                 //展开至第一层
@@ -124,18 +135,19 @@ var rationLibObj = {
                     root.setExpanded(false);
                     that.tree.setRootExpanded(root.children, false);
                 } */
-                that.tree.setRootExpanded(that.tree.roots, false);
+                that[from+'tree'].setRootExpanded(that[from+'tree'].roots, false);
             }
             rationChapterTreeController.showTreeData();
-            rationLibObj.rationChapterSpread.getSheet(0).options.rowHeaderVisible = true;
+            rationChapterSpread.getSheet(0).options.rowHeaderVisible = true;
             rationChapterTreeController.bind(TREE_SHEET_CONTROLLER.eventName.treeSelectedChanged, function (node) {
-                rationLibObj.loadSectionRations(node && node.children.length === 0 ? node.getID() : null);
+              rationLibObj.loadSectionRations(node && node.children.length === 0 ? node.getID() : null);
             });
-
+            
+          
             if (rationChapterTree.firstNode() && rationChapterTree.firstNode().length === 0) {
                 rationLibObj.loadSectionRations(rationChapterTree.firstNode().getID());
             } else {
-                rationLibObj.loadSectionRations();
+                rationLibObj.loadSectionRations(null);
             };
         };
         //type: 0-补充库 1-标准库
@@ -182,13 +194,14 @@ var rationLibObj = {
     },
     loadSectionRations: function (sectionID) {
         let me = this;
+        let from = $('#divide_de').is(':visible')?"divide_":"";
         var showDatas = function (datas, setting) {
-            let rationSheet = rationLibObj.sectionRationsSpread.getActiveSheet();
+            let rationSheet = rationLibObj[from+"sectionRationsSpread"].getActiveSheet();
             /*TREE_SHEET_HELPER.massOperationSheet(rationSheet, function () {
                 rationSheet.setColumnWidth(0, 25, GC.Spread.Sheets.SheetArea.rowHeader);
             });*/
-            SheetDataHelper.loadSheetHeader(setting, rationLibObj.sectionRationsSpread.getActiveSheet());
-            SheetDataHelper.loadSheetData(setting, rationLibObj.sectionRationsSpread.getActiveSheet(), datas);
+            SheetDataHelper.loadSheetHeader(setting, rationLibObj[from+"sectionRationsSpread"].getActiveSheet());
+            SheetDataHelper.loadSheetData(setting, rationLibObj[from+"sectionRationsSpread"].getActiveSheet(), datas);
             rationLibObj.setTagForHint(rationSheet, datas);
         };
         //定额名称的处理:
@@ -233,7 +246,7 @@ var rationLibObj = {
         }
         if (sectionID) {
             CommonAjax.post('/complementaryRation/api/getRationGljItemsBySection', {user_Id: userID, sectionId: sectionID, type: me.curLibType}, function (datas) {
-                let chapterSheet = me.rationChapterSpread.getActiveSheet();
+                let chapterSheet = me[from+'rationChapterSpread'].getActiveSheet();
                 let sectionName = chapterSheet.getText(chapterSheet.getActiveRowIndex(), chapterSheet.getActiveColumnIndex());
                 simplifyName(sectionName, datas);
                 showDatas(datas, rationLibObj.sectionRationsSetting);
@@ -249,16 +262,21 @@ var rationLibObj = {
         }
     },
     onRationSpreadCellDoubleClick: function (sender, args) {
-        var select = $('#stdRationLibSelect'), rationCode = args.sheet.getText(args.row, 0);
+        let pre = $('#divide_de').is(':visible')?"divide_":"";
+        var select = $(`#${pre}stdRationLibSelect`), rationCode = args.sheet.getText(args.row, 0);
         if (rationCode !== '') {
             let query = {userID: userID, rationRepId: select.val(), code: rationCode};
             //搜索结果全部定额中双击添加定额、有可能同名不同库,更新查询的库ID
             if (rationLibObj.resultCache && rationLibObj.resultCache[args.row]) {
                 query.rationRepId = rationLibObj.resultCache[args.row].type === 'std' ? rationLibObj.resultCache[args.row].rationRepId : rationLibObj.compleRationLibId;
             }
-            projectObj.project.Ration.addNewRation(query,rationType.ration, function () {
+            if(pre =="divide_"){
+              divideObj.addDivideRation(select.val(),rationCode);
+            }else{
+              projectObj.project.Ration.addNewRation(query,rationType.ration, function () {
                 projectObj.setActiveCell('quantity', true);
             });
+            }
         }
     },
     //滚动条到底部加载
@@ -499,8 +517,9 @@ var rationLibObj = {
             alert('当前项目无定额库,请添加定额库。');
             return null;
         }
-        if($('#stdRationLibSelect').val()){
-            return parseInt($('#stdRationLibSelect').val());
+        let pre = $('#divide_de').is(':visible')?"divide_":"";
+        if($(`#${pre}stdRationLibSelect`).val()){
+            return parseInt($(`#${pre}stdRationLibSelect`).val());
         }else {
             return projectObj.project.projectInfo.engineeringInfo.ration_lib[0].id;
         }

+ 23 - 22
web/building_saas/main/js/views/zmhs_view.js

@@ -90,21 +90,22 @@ let zmhs_obj = {
         this.initAssSpread();
     },
     initCoeSpread:function () {
-        if(zmhs_obj.coeSpread == null){
-            this.coeSpread = SheetDataHelper.createNewSpread($("#coeSpread")[0]);
-            sheetCommonObj.spreadDefaultStyle(this.coeSpread);
-            this.coeSheet = this.coeSpread.getSheet(0);
-            sheetCommonObj.initSheet(this.coeSheet, this.coeSetting, 30);
-            this.coeSheet.name('ration_coe');
-            //this.coeSheet.bind(GC.Spread.Sheets.Events.CellClick, this.onCoeCellClick);  配合自定义系数使用,现在自定义系数不在这显示了
-            this.coeSpread.bind(GC.Spread.Sheets.Events.ButtonClicked, this.onButtonClick);
-            this.coeSheet.bind(GC.Spread.Sheets.Events.ValueChanged,this.onCoeValueChange);
-            this.coeSheet.bind(GC.Spread.Sheets.Events.RangeChanged, this.onCoeRangeChanged);
-            this.coeSheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function (e,args) {
-                args.sheet.repaint();
-            });
-            SheetDataHelper.protectdSheet(this.coeSheet);
-        }
+      let pre = $('#divide_subSpread').is(':visible')?"divide_":"";
+      if(zmhs_obj[pre+"coeSpread"] == null){
+          this[pre+"coeSpread"] = SheetDataHelper.createNewSpread($("#"+pre+"coeSpread")[0]);
+          sheetCommonObj.spreadDefaultStyle(this[pre+"coeSpread"]);
+          this[pre+"coeSheet"] = this[pre+"coeSpread"].getSheet(0);
+          sheetCommonObj.initSheet(this[pre+"coeSheet"], this.coeSetting, 30);
+          this[pre+"coeSheet"].name(pre+'ration_coe');
+          //this.coeSheet.bind(GC.Spread.Sheets.Events.CellClick, this.onCoeCellClick);  配合自定义系数使用,现在自定义系数不在这显示了
+          this[pre+"coeSpread"].bind(GC.Spread.Sheets.Events.ButtonClicked, this.onButtonClick);
+          this[pre+"coeSheet"].bind(GC.Spread.Sheets.Events.ValueChanged,this.onCoeValueChange);
+          this[pre+"coeSheet"].bind(GC.Spread.Sheets.Events.RangeChanged, this.onCoeRangeChanged);
+          this[pre+"coeSheet"].bind(GC.Spread.Sheets.Events.SelectionChanged, function (e,args) {
+              args.sheet.repaint();
+          });
+          SheetDataHelper.protectdSheet(this[pre+"coeSheet"]);
+      }
     },
     initCusSpread:function () {
         if(zmhs_obj.cusSpread == null){
@@ -292,14 +293,14 @@ let zmhs_obj = {
         }
         return calcInstall;
     },
-
-
     refresh:function () {
-        $('#coeSpread').is(':visible')&&this.coeSpread?this.coeSpread.refresh():'';
-        $('#coeSpread').is(':visible')&&this.coeSpread?this.showDatas():'';//这里combobox下拉框要重新加载一下
-        $('#cusSpread').is(':visible')&&this.cusSpread?this.cusSpread.refresh():'';
-        $('#assSpread').is(':visible')&&this.assSpread?this.assSpread.refresh():'';
-        $('#stableSpread').is(':visible')&&this.stableSpread?this.stableSpread.refresh():'';
+        zmhs_obj.initSpread();
+        let pre = $('#divide_subSpread').is(':visible')?"divide_":"";
+        $('#'+pre+'coeSpread').is(':visible')&&this[pre+'coeSpread']?this[pre+'coeSpread'].refresh():'';
+        $('#'+pre+'coeSpread').is(':visible')&&this[pre+'coeSpread']?this.showDatas():'';//这里combobox下拉框要重新加载一下
+        $('#'+pre+'cusSpread').is(':visible')&&this[pre+'cusSpread']?this[pre+'cusSpread'].refresh():'';
+        $('#'+pre+'assSpread').is(':visible')&&this[pre+'assSpread']?this[pre+'assSpread'].refresh():'';
+        $('#'+pre+'stableSpread').is(':visible')&&this[pre+'stableSpread']?this[pre+'stableSpread'].refresh():'';
     },
     showDatas:function () {
         if($('#itemCharacterText').is(':visible'))MaterialController.showItemCharacterText()