浏览代码

重庆建筑,地方信息价分类和搜索结果与通用地区合并

zhangweicheng 4 年之前
父节点
当前提交
2c312c9952

+ 15 - 3
modules/main/facade/info_price_facade.js

@@ -55,17 +55,29 @@ async function getClassByAreaID(data,compilation){
   let newList = [];
   let lib = await infoLibModel.findOne({compilationID:compilation._id,period:data.period})
   if(lib){
-    let infoClass =  await infoClassModel.find({areaID:data.areaID,libID:lib.ID}).lean();
+    let tList =await getClassList(data.areaID,lib.ID);
+    newList.push(...tList);
+    if(data.commonInfoPriceID){
+      cList = await getClassList(data.commonInfoPriceID,lib.ID);
+      newList.push(...cList);
+    }  
+  }
+  
+
+
+  async function getClassList(areaID,libID){
+    let temList = [];
+    let infoClass =  await infoClassModel.find({areaID:areaID,libID:libID}).lean();
     let parentMap=_.groupBy(infoClass, 'ParentID');
     for(let key in parentMap){
       parentMap[key] = projectfacade.sortChildren(parentMap[key]);
     }
     
     if(parentMap && parentMap['-1']){
-      getChildern(parentMap['-1'],newList,parentMap)
+      getChildern(parentMap['-1'],temList,parentMap)
     }
+    return temList;
   }
-  
 
 
   function getChildern(children,list,pm){

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

@@ -1699,7 +1699,9 @@ let projectGljObject = {
     try {
       if (year != "" && month != "" && areaID != ""){
         let period = year + "-" + month;
-        datas = await ajaxPost("/infoPrice/getClassByAreaID", {areaID:areaID,period:period});
+        let condition = {areaID:areaID,period:period};
+        if (projectGljObject.addCommonInfoPriceID) projectGljObject.addCommonInfoPriceID(condition);
+        datas = await ajaxPost("/infoPrice/getClassByAreaID", condition);
       }
       me.showInforClassData(datas);
     } catch (error) {

+ 2 - 2
web/over_write/js/chongqing_2018.js

@@ -11,9 +11,9 @@ if(typeof projectGljObject !== 'undefined'){
     ];
     $('#menu_index_info').show();
     //2020-11-06 暂时去掉主城区加载通用 
- /*  projectGljObject.addCommonInfoPriceID = function (condition) { 
+  projectGljObject.addCommonInfoPriceID = function (condition) { 
     if(condition.areaID != projectGljObject.commonInfoPriceID) condition.commonInfoPriceID = projectGljObject.commonInfoPriceID;
-  } */
+  }
 }
 if(typeof gljUtil !== 'undefined'){
     gljUtil.hasCompMachine = [301,304];//有组成物的机械