Browse Source

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/ConstructionCost

vian 4 years ago
parent
commit
3070b094a4

+ 39 - 0
modules/main/controllers/info_price_controller.js

@@ -0,0 +1,39 @@
+/**
+ * Created by jimiz on 2017/4/9.
+ */
+let info_price_facade = require('../facade/info_price_facade');
+
+let logger = require("../../../logs/log_helper").logger;
+let controller = {
+    getOptions:async function (req){
+        let data = req.body.data;
+        data = JSON.parse(data);
+        return await info_price_facade.getOptions(data,req.session.sessionCompilation);
+    },
+    getDataByCondition:async function (req){
+      let data = req.body.data;
+      data = JSON.parse(data);
+      return await info_price_facade.getDataByCondition(data,req.session.sessionCompilation);
+    }
+};
+
+module.exports = {
+    action:async function(req,res){//自动跳转到URL对应的controller方法
+        let result={
+            error:0
+        }
+        try {
+            let functionName = req.url.replace(/\//g,"");
+            result.data = controller[functionName]?await controller[functionName](req):"";
+        }catch (err){
+            logger.err(err);
+            result.error=1;
+            result.message = err.message;
+        }
+        res.json(result);
+    }
+};
+
+
+
+

+ 47 - 0
modules/main/facade/info_price_facade.js

@@ -0,0 +1,47 @@
+/**
+ * Created by zhang on 2020/7/20
+ */
+module.exports={
+  getOptions,
+  getDataByCondition
+};
+
+const mongoose = require('mongoose');
+let infoLibModel = mongoose.model("std_price_info_lib");
+let infoItemsModel = mongoose.model("std_price_info_items");
+let _ = require("lodash");
+async function getOptions(data,compilation){//data 是预留对象,暂时不用
+  let compilationID = compilation._id;
+  let areaMap={};
+  let areas= [];
+  let periodMap={};
+  let libList = await infoLibModel.find({"compilationID":compilationID}).lean();
+  for(let l of libList){
+    for(let area of l.areas){
+      if(!areaMap[area]) areas.push(area);
+    }
+    //2020-05
+    let periodArray = l.period.split("-");
+    periodMap[periodArray[0]]?periodMap[periodArray[0]].push(periodArray[1]):periodMap[periodArray[0]]=[periodArray[1]]
+  }
+ 
+ 
+  for(let key in periodMap){
+    periodMap[key] = _.sortBy(periodMap[key]);
+  }
+  return {areas:areas,periodMap:periodMap}
+}
+
+
+async function getDataByCondition(data,compilation){
+  let result = {};
+  data.condition["compilationID"] = compilation._id;
+  if(data.keyWord) data.condition.name = {"$regex":new RegExp(data.keyWord, "i")};
+  if(data.lastID){ //有最后一行说明是查询下一页
+    data.condition["_id"] = {$gt:mongoose.Types.ObjectId(data.lastID)};
+  }else{
+    result.totalSize = await infoItemsModel.find(data.condition).count();
+  }
+  result.items = await infoItemsModel.find(data.condition).lean().sort({"_id":1}).limit(50);
+  return result;
+}

+ 13 - 0
modules/main/routes/info_price_route.js

@@ -0,0 +1,13 @@
+/**
+ * Created by jimiz on 2017/4/7.
+ */
+let express = require('express');
+
+module.exports = function (app) {
+    let infoRouter = express.Router();
+    let infoController = require('../controllers/info_price_controller');
+    infoRouter.post('/getOptions', infoController.action);
+    infoRouter.post('/getDataByCondition', infoController.action);
+
+    app.use('/infoPrice', infoRouter);
+};

+ 1 - 0
modules/reports/rpt_component/jpc_flow_tab.js

@@ -612,6 +612,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
                 while (true) {
                     if (currentRecAmt > 0) pageStatus[JV.STATUS_SEGMENT_START] = false;
                     if (pageIdx > 0) pageStatus[JV.STATUS_REPORT_START] = false;
+                    private_resetBandArea(); // 这里得预先算maxRowRec(实际数据情况,会有章首页框,在章数据多的情况下,章第二页开始就得补上章首页框不显示遗留下来的row)
                     //开始判断各种scenarios
                     adHocAutoHeightAmt = 0;
                     if (me.auto_height_fields_idx.length > 0) {

+ 3 - 2
modules/users/controllers/boot_controller.js

@@ -32,7 +32,8 @@ class BootController extends BaseController {
             let compilationData = await compilationModel.getCompilationById(compilationId);
             // 判断当前用户的是使用免费版还是专业版
             compilationVersion = await userModel.getVersionFromUpgrade(sessionUser.ssoId, compilationId);
-            request.session.compilationVersion = compilationVersion;
+            request.session.compilationVersion = compilationVersion.version;
+            request.session.sessionUser.compilationDeadline = compilationVersion.deadline;
             request.session.sessionCompilation = compilationData;
             if(sessionUser.latest_used !== compilationId) userModel.updateLatestUsed(sessionUser.id,compilationId);
         }
@@ -55,4 +56,4 @@ class BootController extends BaseController {
     }
 
 }
-export default BootController;
+export default BootController;

+ 1 - 1
modules/users/controllers/cld_controller.js

@@ -108,7 +108,7 @@ class CLDController {
         let ssoID = request.body.ssoId;
         let compilationID = request.body.cid;
         let deadline = request.body.deadline || '';
-        let status = parseInt(request.body.status);
+        let status = parseInt(request.body.status); // 1.升级、2.降级、3.续期
         let smssend = parseInt(request.body.smssend);
         try {
 

+ 4 - 2
modules/users/controllers/login_controller.js

@@ -107,7 +107,8 @@ class LoginController {
                     let compilationData = await compilationModel.getCompilationById(preferenceSetting.select_version);
                     // 判断当前用户的是使用免费版还是专业版
                     let compilationVersion = await userModel.getVersionFromUpgrade(sessionUser.ssoId, preferenceSetting.select_version);
-                    request.session.compilationVersion = compilationVersion;
+                    request.session.compilationVersion = compilationVersion.version;
+                    request.session.sessionUser.compilationDeadline = compilationVersion.deadline;
                     request.session.sessionCompilation = compilationData;
                     if(request.session.sessionUser.latest_used !== preferenceSetting.select_version) await userModel.updateLatestUsed(request.session.sessionUser.id,preferenceSetting.select_version);
                 }
@@ -295,7 +296,8 @@ class LoginController {
                 // 判断当前用户的是使用免费版还是专业版
                 let compilationVersion = await userModel.getVersionFromUpgrade(sessionUser.ssoId, preferenceSetting.select_version);
                 console.log("当前用户的是使用免费版还是专业版 完成------------------");
-                request.session.compilationVersion = compilationVersion;
+                request.session.compilationVersion = compilationVersion.version;
+                request.session.sessionUser.compilationDeadline = compilationVersion.deadline;
                 request.session.sessionCompilation = compilationData;
                 if(request.session.sessionUser.latest_used !== preferenceSetting.select_version) await userModel.updateLatestUsed(request.session.sessionUser.id,preferenceSetting.select_version);
             }

+ 3 - 1
modules/users/controllers/user_controller.js

@@ -154,6 +154,7 @@ class UserController extends BaseController {
                     });
                     if (oneCompilationIndex !== -1) {
                         compilationList[oneCompilationIndex].isUpgrade = userUpgradeList[index].isUpgrade;
+                        compilationList[oneCompilationIndex].deadline = userUpgradeList[index].deadline;
                     }
                 }
             }
@@ -235,7 +236,8 @@ class UserController extends BaseController {
                 // 判断当前用户的是使用免费版还是专业版
                 let userModel = new UserModel();
                 let compilationVersion = await userModel.getVersionFromUpgrade(sessionUserData.ssoId, compilationData._id);
-                request.session.compilationVersion = compilationVersion;
+                request.session.compilationVersion = compilationVersion.version;
+                request.session.sessionUser.compilationDeadline = compilationVersion.deadline;
                 request.session.sessionCompilation = compilationData;
             }
         } catch (error) {

+ 6 - 2
modules/users/models/user_model.js

@@ -350,16 +350,20 @@ class UserModel extends BaseModel {
      */
     async getVersionFromUpgrade(ssoId, compilationId){
         let version = '大司空云计价(免费公用版)';
+        let deadline = '';
         let userData = await this.findDataBySsoId(ssoId);
         if (userData.upgrade_list !== undefined) {
             let compilationInfo = userData.upgrade_list.find(function (item) {
                 return item.compilationID === compilationId;
             });
             if (compilationInfo !== undefined && compilationInfo.isUpgrade === true) {
-                version = '大司空云计价(专业版)';
+                version = '大司空云计价(专业版)';
+                if (compilationInfo.deadline !== undefined && compilationInfo.deadline !== '') {
+                    deadline = compilationInfo.deadline;
+                }
             }
         }
-        return version;
+        return {version: version, deadline: deadline};
     }
 
     /**

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

@@ -501,4 +501,4 @@ margin-right: 100px !important;
 }
 .menu-input:focus {
   outline: none;
-}
+}

+ 41 - 7
web/building_saas/glj/html/project_glj.html

@@ -15,6 +15,7 @@
             <option value="priceCoe">价格指数调整法</option>
         </select>
     </div>
+    
 </div>
 
 <div class="container-fluid">
@@ -86,9 +87,9 @@
                   <li class="nav-item">
                     <a class="nav-link " id="ration-nav" data-toggle="tab" href="#ph_div" role="tab" aria-selected="true">相关定额</a>
                   </li>
-                  <!--  <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>
-                    </li>-->
+                  <li class="nav-item">
+                    <a class="nav-link" id="info-nav"  data-toggle="tab" data-name="info"  href="#info_price_div" role="tab">信息价</a>
+                </li>
                    
                    <!-- <li class="nav-item">
                         <a class="nav-link" data-toggle="tab" data-name="machine_sheet" id="machine_ratio_link" href="#ph_div" role="tab">机械单价</a>
@@ -105,10 +106,43 @@
                         <div class="main-data-bottom" id="mix_ratio_sheet" style="overflow:hidden">
                         </div>
                     </div>
-             <!--       <div class="tab-pane" id="jx_div" role="tabpanel">
-                        <div class="main-data-bottom" id="machine_sheet">
-                        </div>
-                    </div>-->
+                   <div class="tab-pane" id="info_price_div" role="tabpanel">
+                    <div class="form-inline py-1 toolsbar_feeRate" id="infoToolDiv" style="background:#f7f7f9">
+                      <label class="mx-2" for="info_area">地区</label>
+                      <select class="form-control form-control-sm" style="font-size: .875rem; width:120px;" id="info_area">
+                        <option value=""></option>
+                        <option value="江北区" >江北区</option>
+                      </select>
+                      <label class="mx-2" for="info_year">期数</label>
+                      <select class="form-control form-control-sm" style="font-size: .875rem; width:100px;" id="info_year">
+                        <option value=""></option>
+                        <option value="2020" >2020</option>
+                        <option value="2019" >2019</option>
+                        <option value="2018" >2018</option>
+                        <option value="2017" >2017</option>
+                      </select>
+                      <select class="form-control form-control-sm" style="font-size: .875rem; width:80px;" id="info_month">
+                        <option value=""></option>
+                        <option value="01" >01</option>
+                        <option value="02" >02</option>
+                        <option value="03" >03</option>
+                        <option value="04" >04</option>
+                        <option value="05" >05</option>
+                        <option value="06" >06</option>
+                        <option value="07" >07</option>
+                        <option value="08" >08</option>
+                        <option value="09" >09</option>
+                        <option value="10" >10</option>
+                        <option value="11" >11</option>
+                        <option value="12" >12</option>
+                      </select>
+                      &nbsp;
+                      <input type="text" class="form-control form-control-sm" id="info_search_name">
+                      <button type="button" class="btn btn-outline-primary btn-sm mr-auto" id="info_search_btn"><i class="fa fa-search" aria-hidden="true"></i></button>
+                      <button type="button" class="btn btn-primary  btn-sm" id="muti_apply_info">批量套用</button>
+                   </div>
+                    <div class="main-data-bottom" id="info_price_sheet"> </div>
+                    </div>
                 </div>
             </div>
         </div>

BIN
web/building_saas/img/vip.png


BIN
web/building_saas/img/vip1.png


BIN
web/building_saas/img/vip2.png


+ 13 - 5
web/building_saas/main/js/controllers/block_controller.js

@@ -329,13 +329,13 @@ let BlockController = {
              //更新前端缓存
              me.updateCache(result);
              //插入树节点
-             let rationNodes = me.addToTree(parentID,nextID,result.bills,result.rations);
+             let [rationNodes,calcNodes] = me.addToTree(parentID,nextID,result.bills,result.rations);
              //主材设备工料机插入主树
              project.ration_glj.addToMainTree(result.ration_gljs);
              //更新计算程序模板,并进行重新计算
-             project.calcProgram.calcNodesAndSave(rationNodes,async function () {
+             project.calcProgram.calcNodesAndSave(calcNodes,async function () {
                  installationFeeObj.calcInstallationFee();
-                await OVER_HEIGHT.reCalcOverHeightFee();
+                 await OVER_HEIGHT.reCalcOverHeightFee();
                  await itemIncreaseFeeObj.calcItemIncreaseFeeByNodes(rationNodes);
              });
         })
@@ -374,8 +374,9 @@ let BlockController = {
     addToTree:function (parentID,nextID,bills,rations) {
         let project = projectObj.project;
         let Bills = project.Bills,mainTree = project.mainTree;
+        let parentNodeMap={};//用于去重
         let parentMap_b = {},parentMap_r = {};
-        let newNodes = [],firstNode = null,rationNodes=[];
+        let newNodes = [],firstNode = null,rationNodes=[],billNodes=[],calcNodes=[];
 
         createParentMap(parentMap_b,bills,'bills');
         createParentMap(parentMap_r,rations,'ration');
@@ -397,7 +398,13 @@ let BlockController = {
         const serialNo = firstNode.serialNo();
         projectObj.mainController.sheet.setSelection(serialNo, sels[0].col, 1, 1);
         projectObj.mainController.sheet.showRow(serialNo, GC.Spread.Sheets.VerticalPosition.center);
-        return rationNodes;
+        //没有子节点的清单父节点要进行汇总计算
+        for(let b of billNodes){
+          if(!b.children || b.children.length == 0){
+            if(b.parent &&!parentNodeMap[b.parent.ID]) calcNodes.push(b.parent);
+          }  
+        }
+        return [rationNodes,rationNodes.concat(calcNodes)];
 
         function loadTreeNode(parentID,nextID,data,type) {
             let newNode = null;
@@ -422,6 +429,7 @@ let BlockController = {
                     }
 
                 }
+                billNodes.push(newNode);
             }else if(type == 'ration'){
                 newNode = project.mainTree.insert(parentID, nextID, data.ID);
                 newNode.source = data;

+ 3 - 3
web/building_saas/main/js/models/bills.js

@@ -675,7 +675,7 @@ var Bills = {
             }
         };
         bills.prototype.getMeasureNode = function (controller) {//取措施项目工程节点
-            let roots =  controller.tree.roots;
+            let roots = controller?controller.tree.roots:projectObj.project.mainTree.roots;
             for(let root of roots){
                 if(isFlag(root.data)&&root.data.flagsIndex.fixed.flag==fixedFlag.MEASURE){
                     return root;
@@ -954,7 +954,7 @@ var Bills = {
             let controller = projectObj.mainController;
             let parentNode;
             if(type == '措施费用'){
-                parentNode = this.getTechNode();
+                parentNode = installationFeeObj.getMeasureParentNode();
             }else {
                 let rootNode = this.getFBFXNode(controller);
                 parentNode =getLeaveBill(rootNode.source);
@@ -987,7 +987,7 @@ var Bills = {
                 code : this.newFormatCode(code),
                 name:'安装增加费',
                 unit:'元',
-                stdCode:code,
+                stdCode:code.substring(0,9),
                 userID:userID,
                 billsLibId:projectObj.project.projectInfo.engineeringInfo.bill_lib[0].id,
                 quantity:'1'

+ 4 - 0
web/building_saas/main/js/models/calc_program.js

@@ -1996,6 +1996,7 @@ class CalcProgram {
         let dataArr = [];
         for (let node of treeNodes){
             if (node.changed){
+                // console.log(node.data.name);
                 let data = calcTools.cutNodeForSave(node);
                 let newData = {'type': node.sourceType, 'data': data};
                 dataArr.push(newData);
@@ -2487,6 +2488,9 @@ class CalcProgram {
         else if (sOption =='priceBase_ZM')
             tender = tenderTypes.ttReverseRation;
         if (tender == tenderTypes.ttReverseGLJ || tender == tenderTypes.ttReverseRation){
+            if (!tender_obj.tenderTree)
+                tender_obj.createTree();
+
             this.initReverseTenderDatas();
             this.prepareForDistribute(tender_obj.tenderTree.roots[0]);
             this.distributeTargetTotalFee(tender_obj.tenderTree.roots[0]);

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

@@ -857,6 +857,9 @@ let installationFeeObj={
             }
         }
     },
+    getMeasureParentNode:function(){
+      return projectObj.project.Bills.getTechNode();//默认取技术措施项目
+    },
     updateModifyFeeRulePosition:function (recode) {
         let me = this;
         let riselection = me.modifyFeeRuleSheet.getSelections()[0];

+ 137 - 3
web/building_saas/main/js/views/project_glj_view.js

@@ -13,6 +13,18 @@ let projectGljObject={
     materialTreeSheet:null,
     projectGljSheetData:[],
     mixRatioSetting:{},
+    infoPriceSetting:{
+      header:[
+        {headerName: "材料名称", headerWidth: 360, dataCode: "name", dataType: "String"},
+        {headerName: "规格型号", headerWidth: 240, dataCode: "specs", hAlign: "left", dataType: "String"},
+        {headerName: "单位", headerWidth: 50, dataCode: "unit", dataType: "String",hAlign: "center"},
+        {headerName: "含税市场价", headerWidth: 160, dataCode: "taxPrice", hAlign: "right", dataType: "Number",validator:"number"}//,decimalField:"glj.unitPrice"
+    ],
+    view: {
+        lockColumns: [0,1,2,3,4]//,
+        //colHeaderHeight:30
+      }
+    },
     relatedRationSetting:{
       header:[
         {headerName: "编码", headerWidth: 100, dataCode: "code", dataType: "String"},
@@ -64,6 +76,18 @@ let projectGljObject={
         {ID:'MAIN_MATERIAL',text:'主材'},
         {ID:'EQUIPMENT',text:'设备'}
     ],
+    initInfoPriceSpread:function(){
+      if(this.infoPriceSpread) return this.infoPriceSpread.refresh();
+      this.infoPriceSpread = SheetDataHelper.createNewSpread($("#info_price_sheet")[0]);
+      sheetCommonObj.spreadDefaultStyle(this.infoPriceSpread);
+      this.infoPriceSheet = this.infoPriceSpread .getSheet(0);
+      this.initSheet(this.infoPriceSheet,this.infoPriceSetting);
+      this.infoPriceSheet.bind(GC.Spread.Sheets.Events.TopRowChanged, _.debounce(this.onInfoTopRowChanged, 100));
+      this.infoPriceSheet.name('infoPriceSheet');
+      this.infoPriceSheet.setRowCount(0);
+
+      this.getInfoPriceOptions();
+    },
     initSpreads:function(){
         if(this.projectGljSpread==null) this.initProjectGljSpread();
         //if(materialAdjustObj.spread == null) materialAdjustObj.initSpread();
@@ -348,7 +372,12 @@ let projectGljObject={
       sheetCommonObj.showData(me.relatedRationSheet, me.relatedRationSetting,rations);
       me.relatedRationSheet.setRowCount(rations.length);
     },
-
+    showInforPriceData:function(datas){
+      let me = this;
+      me.infoPriceData = datas;
+      sheetCommonObj.showData(me.infoPriceSheet, me.infoPriceSetting,datas);
+      me.infoPriceSheet.setRowCount(datas.length);
+    },
     getMixRatioSheetData:function (glj) {
         let data ={
             id:glj.id,
@@ -1195,6 +1224,10 @@ let projectGljObject={
                     callback: function (key, opt) {
                         let row = me.rightClickTarget.row;
                         me.deleteMixRatio(row);
+                    },
+                    visible: function(key, opt){
+                      if(!$('#mixRatio-nav').hasClass('active')) return false;
+                      return true;
                     }
                 },
                 "addMixRatio":{
@@ -1207,6 +1240,10 @@ let projectGljObject={
                     callback: function (key, opt) {
                         me.selectedProjectGLJ = projectGljObject.getProjectGLJSelected();
                         getGLJData('addMix', null, true, null);
+                    },
+                    visible: function(key, opt){
+                      if(!$('#mixRatio-nav').hasClass('active')) return false;
+                      return true;
                     }
                 }
             }
@@ -1261,6 +1298,66 @@ let projectGljObject={
         }
         htmlString += '</ul>';
         $('#ALL').after(htmlString);
+    },
+    getInfoPriceOptions:async function(){
+      let options =await ajaxPost("/infoPrice/getOptions",{});
+      this.infoPriceOptions=options;
+      this.createSelectOptions($("#info_area"),options.areas);
+      let years = _.keysIn(options.periodMap);
+      this.createSelectOptions($("#info_year"),_.sortBy(years));   
+    },
+    createSelectOptions:function(ele,opts){
+      ele.empty();
+      let str = `<option value=""></option>`;
+      for(let o of opts){
+        str +=`<option value="${o}">${o}</option>`
+      }
+      ele.html(str);
+    },
+    onInfoTopRowChanged:function(sender, args){
+      let me = projectGljObject;
+      const bottomRow = args.sheet.getViewportBottomRow(1);
+      if(me.infoPriceData >= me.infoPriceTotalSize) return;
+      if(me.infoPriceData.length - bottomRow < 20 ){   
+        if(projectGljObject.infoPriceLastLoadingRow == me.infoPriceData.length){//如果最后一行已经加载过了,就不用再加载了,不然会重复加载
+          return;
+        }
+        console.log(bottomRow);
+        me.infoPriceLastLoadingRow = me.infoPriceData.length;
+        me.searchInfoPrice(me.infoPriceData[me.infoPriceData.length - 1]._id)
+      } 
+
+      
+    },
+    searchInfoPrice:async function(objectID){
+      let year = $('#info_year').val();
+      let month =  $('#info_month').val();
+      let area = $('#info_area').val();
+      let keyWord = $('#info_search_name').val();
+      let me = projectGljObject;
+      try {
+        if(year !="" && month!="" && area!="") {
+          let condition = {
+            period:year+"-"+month,
+            area:area
+          }
+          let data ={condition:condition};
+          if(keyWord !="")  data.keyWord = keyWord;
+          if(objectID) data.lastID = objectID;
+          let result = await ajaxPost("/infoPrice/getDataByCondition",data);
+          if(objectID){//分页查询
+            sheetCommonObj.appendData(me.infoPriceSheet, me.infoPriceData.length, 0, me.infoPriceSetting, result.items);
+            me.infoPriceData.splice(me.infoPriceData.length, 0, ...result.items);
+          }else{
+            me.infoPriceTotalSize = result.totalSize;
+            me.infoPriceLastLoadingRow = 0;
+            me.showInforPriceData(result.items);
+          }
+        }
+      } catch (error) {
+        console.log(error) 
+      }
+      
     }
 };
 
@@ -1317,6 +1414,11 @@ function loadProjectGljSize() {
           SlideResize.loadVerticalHeight(pojGljResizeEles.eleObj.module, pojGljResizeEles.eleObj, pojGljResizeEles.limit, function () {
             me.projectGljSpread?me.projectGljSpread.refresh():'';
             me.mixRatioSpread?me.mixRatioSpread.refresh():'';
+            //信息价相关
+            $('#info_price_sheet').height($("#mix_ratio_sheet").height() - $("#infoToolDiv").height());
+            if($('#info_price_sheet').is(':visible')) me.initInfoPriceSpread();
+           
+            
           });
         }
        
@@ -1609,6 +1711,38 @@ $(function () {
       projectGljObject.mixRatioSpread.refresh();
       projectGljObject.showRelatedRationDatas();
     });
-});
-
+    $("#info-nav").on('shown.bs.tab', function () {
+      $('#info_price_sheet').height($("#mix_ratio_sheet").height() - $("#infoToolDiv").height());
+      projectGljObject.initInfoPriceSpread();
+     /*  
+      projectGljObject.showRelatedRationDatas(); */
+    });
+    $('#info_year').change(function () {
+      let periodMap = projectGljObject.infoPriceOptions.periodMap;
+      let year = $(this).val();
+      let month = $("#info_month").val();
+      let options = periodMap[year];
+      projectGljObject.createSelectOptions($("#info_month"),periodMap[year]);
+      if(month !=""){
+        if(_.includes(options,month)){
+          $("#info_month").val(month);
+          projectGljObject.searchInfoPrice();
+        }
+      }
+    });
+    $('#info_month').change(function () {
+      projectGljObject.searchInfoPrice();
+    });
+    $('#info_area').change(function () {
+      projectGljObject.searchInfoPrice();
+    });
+    $('#info_search_name').on('keypress', function (e) {
+      if (e.keyCode === 13) {
+        projectGljObject.searchInfoPrice();
+      }
+    });
+    $('#info_search_btn').on('click', function (e) {
+      projectGljObject.searchInfoPrice();
+    });
 
+});

+ 4 - 2
web/building_saas/main/js/views/project_view.js

@@ -1037,8 +1037,10 @@ var projectObj = {
                 //     && node.data.feesIndex.common.totalFee != 0){
                 //     if (node.data.feesIndex.common.tenderTotalFee == undefined || node.data.feesIndex.common.tenderTotalFee == 0)
                 // };
-                if (projectObj.project.projectInfo.lastFileVer != VERSION)
-                    projectObj.project.calcProgram.doTenderCalc();
+                 if (projectObj.project.projectInfo.lastFileVer != VERSION){
+                     projectObj.project.calcProgram.doTenderCalc();
+                     // console.log('旧项目,打开前进行了全局调价计算。')
+                 }
 
                 $.bootstrapLoading.end();
             }

+ 33 - 28
web/building_saas/main/js/views/tender_price_view.js

@@ -40,17 +40,44 @@ let tender_obj={
         "headRowHeight" : [21],
         "cols" : []
     },
+    createTree:function () {
+        let me = this;
+        if (me.tenderTree) return;
+        me.tenderTree = cacheTree.createNew(this);
+        me.tenderTreeSetting = me.createTenderTreeSetting();
+        TREE_SHEET_HELPER.initSetting($('#tenderSpread')[0], me.tenderTreeSetting );
+        me.tenderTreeSetting.setAutoFitRow = MainTreeCol.getEvent("setAutoFitRow");
+        let mainTree = projectObj.project.mainTree;
+        me.tenderTree.nodes={},me.tenderTree.selected = null,me.tenderTree.roots = [],me.tenderTree.items=[];
+
+        function createTenderNode(mainNode,parent,next) {
+            if(mainNode.sourceType != ModuleNames.ration_glj){//主材、设备的工料机不用显示
+                let newNode = me.tenderTree.addNode(parent, next, mainNode.data.ID);
+                newNode.data = mainNode.data;
+                newNode.source =  mainNode.source;
+                newNode.sourceType = mainNode.sourceType;
+                newNode.mainNode = mainNode;
+                if(mainNode.children.length > 0){
+                    for(let c of mainNode.children){
+                        createTenderNode(c,newNode,null);
+                    }
+                }
+                return newNode;
+            }
+        };
+
+        for(r of mainTree.roots){
+            createTenderNode(r,null,null);
+        };
+        me.tenderTree.sortTreeItems();
+    },
     initTenderSpread:function () {
+        this.createTree();
         if(!this.tenderSpread){
             this.tenderSpread = SheetDataHelper.createNewSpread($("#tenderSpread")[0]);
             sheetCommonObj.spreadDefaultStyle(this.tenderSpread);
-        }
+        };
         this.tenderSheet = this.tenderSpread.getSheet(0);
-        this.tenderTree = cacheTree.createNew(this);
-        this.tenderTreeSetting = this.createTenderTreeSetting();
-        // console.log(this.tenderTreeSetting);
-        TREE_SHEET_HELPER.initSetting($('#tenderSpread')[0], this.tenderTreeSetting );
-        this.tenderTreeSetting.setAutoFitRow = MainTreeCol.getEvent("setAutoFitRow");
         this.tenderController = TREE_SHEET_CONTROLLER.createNew(this.tenderTree, this.tenderSheet, this.tenderTreeSetting);
         this.tenderSheet.bind(GC.Spread.Sheets.Events.ValueChanged, this.onSheetValueChange);
         this.tenderSheet.bind(GC.Spread.Sheets.Events.EnterCell, this.onEnterCell);
@@ -69,30 +96,8 @@ let tender_obj={
     },
     showTenderData:function () {
         let me = this;
-        let mainTree = projectObj.project.mainTree;
-        this.tenderTree.nodes={},this.tenderTree.selected = null,this.tenderTree.roots = [],this.tenderTree.items=[];
-        for(r of mainTree.roots){
-            createTenderNode(r,null,null);
-        }
-        me.tenderTree.sortTreeItems();
         this.tenderSheet.setRowCount(0);
         me.tenderController.showTreeData();
-
-        function createTenderNode(mainNode,parent,next) {
-            if(mainNode.sourceType != ModuleNames.ration_glj){//主材、设备的工料机不用显示
-                let newNode = me.tenderTree.addNode(parent, next, mainNode.data.ID);
-                newNode.data = mainNode.data;
-                newNode.source =  mainNode.source;
-                newNode.sourceType = mainNode.sourceType;
-                newNode.mainNode = mainNode;
-                if(mainNode.children.length > 0){
-                    for(let c of mainNode.children){
-                        createTenderNode(c,newNode,null);
-                    }
-                }
-                return newNode;
-            }
-        }
     },
     onTenderRangeChange:function (sender,info) {
         let me = tender_obj;

+ 9 - 3
web/common/html/header.html

@@ -53,9 +53,15 @@
             </li>
             <% if (!versionName.includes('免费')) {%>
               <li class="nav-item">
-                <a href="user/buy" target="_blank"><img src="/web/building_saas/img/vip.png" data-toggle="tooltip" data-placement="bottom" data-original-title="专业版用户"></a>
-              </li> 
-             <% } %> 
+                <a href="/user/buy" target="_blank">
+                    <% if (sessionUser.compilationDeadline !== '') { %>
+                    <img src="/web/building_saas/img/vip2.png" data-toggle="tooltip" data-placement="bottom" data-original-title="年限版用户">
+                    <% } else { %>
+                    <img src="/web/building_saas/img/vip.png" data-toggle="tooltip" data-placement="bottom" data-original-title="专业版用户">
+                    <% } %>
+                </a>
+              </li>
+             <% } %>
             <% if (action === 'index' && controller === 'main') {%>
             <li class="nav-item dropdown">
                 <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-wrench" data-placement="bottom"></i> 工具</a>

+ 3 - 0
web/over_write/js/guangdong_2018.js

@@ -174,6 +174,9 @@ if (typeof gljOprObj !== 'undefined') {
 }
 
 if (typeof installationFeeObj !== 'undefined') {
+  installationFeeObj.getMeasureParentNode=function(){
+    return projectObj.project.Bills.getMeasureNode();//取措施项目
+  },
   installationFeeObj.feeRateMap={
     "AZF0101":"39.86",
     "AZF0102":"39.92",

+ 26 - 15
web/users/html/user-buy.html

@@ -48,16 +48,16 @@
                         </div> -->
                         <legend class=" mb-4">激活专业版</legend>
                         <div class="row">
-                            <div class="col-sm-4 mb-5">
+                            <div class="col-sm-5 mb-5">
                                 <div class="card free-version">
                                   <div class=" card-body">
                                     <h3 class="card-title">免费版 </h3>
-                                      <p class="card-text">
+                                      <!--<p class="card-text">-->
                                     <!--  <ul class="pl-3">
                                           <li>只可创建 50 个单位工程</li>
                                           <li>报表带水印</li>
                                       </ul>-->
-                                      </p>
+                                      <!--</p>-->
                                   </div>
                                     <ul class="list-group list-group-flush">
                                         <% if (compilationList.length > 0) {%>
@@ -73,30 +73,41 @@
                                     </ul>
                                 </div>
                             </div>
-                            <div class="col-sm-4 mb-5">
+                            <div class="col-sm-5 mb-5">
                                 <div class="card pro-version">
-                                  <div class=" card-body">
-                                    <h3 class="card-title text-white">
-                                      <img src="/web/building_saas/img/vip.png">
-                                      专业版
+                                  <div class="card-body">
+                                    <h3 class="card-title">
+                                        专业版
+                                        <img src="/web/building_saas/img/vip.png" data-toggle="tooltip" data-placement="bottom" data-original-title="专业版用户">
+                                        <img src="/web/building_saas/img/vip2.png" data-toggle="tooltip" data-placement="bottom" data-original-title="年限版用户">
                                     </h3>
-                                      <p class="card-text">
-                                      <!--<ul class="pl-3">
-                                          <li>创建单位工程无限制</li>
-                                          <li>报表无水印</li>
-                                      </ul>-->
-                                      </p>
+                                      <!--<p class="card-text">-->
+                                      <!--&lt;!&ndash;<ul class="pl-3">-->
+                                          <!--<li>创建单位工程无限制</li>-->
+                                          <!--<li>报表无水印</li>-->
+                                      <!--</ul>&ndash;&gt;-->
+                                      <!--</p>-->
                                   </div>
                                     <ul class="list-group list-group-flush">
                                         <% if (compilationList.length > 0) {%>
                                         <% compilationList.forEach(function(compilation) { %>
                                         <li class="list-group-item d-flex justify-content-between">
-                                            <%= compilation.name %>
+                                            <div class="col-6">
+                                                <%= compilation.name %>
+                                                <% if (compilation.isUpgrade !== undefined && compilation.isUpgrade === true && compilation.deadline !== undefined && compilation.deadline !== '') { %>
+                                                <img src="/web/building_saas/img/vip2.png" data-toggle="tooltip" data-placement="bottom" data-original-title="年限版用户">
+                                                <% } else if (compilation.isUpgrade !== undefined && compilation.isUpgrade === true && (compilation.deadline === undefined || compilation.deadline === '')) { %>
+                                                <img src="/web/building_saas/img/vip.png" data-toggle="tooltip" data-placement="bottom" data-original-title="专业版用户">
+                                                <% } %>
+                                            </div>
+                                            <div class="ml-auto text-right">
                                             <% if (compilation.isUpgrade === undefined || compilation.isUpgrade !== true) { %>
                                             <a href="javascript:void(0);" class="btn btn-primary btn-sm getcategory" data-upgrade="<%= compilation.isUpgrade %>" data-category="<%= compilation.categoryID %>">立即激活</a>
                                             <% } else { %>
                                             <a href="javascript:void(0);" class="btn btn-outline-secondary btn-sm getcategory" data-title="<%= compilation.name %>" data-upgrade="<%= compilation.isUpgrade %>" data-category="<%= compilation.categoryID %>"><i class="fa fa-check"></i> 已激活</a>
+                                            <% if (compilation.deadline !== undefined && compilation.deadline !== '') { %><span class="d-block text-muted">到期:<%= compilation.deadline %></span><% } %>
                                             <% } %>
+                                            </div>
                                         </li>
                                         <% }) %>
                                         <% } %>