Pārlūkot izejas kodu

Merge branch 'dev/1.0.36_zsy' of jianyu/web into feature/v1.0.36

zhangsiya 1 gadu atpakaļ
vecāks
revīzija
d45a8816d7

+ 0 - 3
apps/bigmember_pc/src/components/selector/timeDropdown.vue

@@ -231,7 +231,6 @@ export default {
       this.isCustom = true
       this.$refs.selectSelector.toggleMenu()
       this.$refs.customPopover[0].doClose()
-      this.$emit('input', this.getState())
       this.$emit('change', this.getState())
     },
     handleChange(item) {
@@ -243,7 +242,6 @@ export default {
         this.time.end = ''
         this.$refs.selectSelector.toggleMenu()
         this.$refs.customPopover[0].doClose()
-        this.$emit('input', this.getState())
         this.$emit('change', this.getState())
       } else {
         this.isCustom = true
@@ -283,7 +281,6 @@ export default {
       } else {
         this.activeValue = data
       }
-      this.$emit('input', this.getState())
     }
   }
 }

+ 26 - 0
apps/bigmember_pc/src/utils/format/info-type-transform.js

@@ -131,4 +131,30 @@ export class InfoTypeTransform {
     }
     return map
   }
+  /**
+   * 输入参数
+   * {
+   *   招标公告: ['询价'],
+   *   招标预告: ['预告', '预审', '预审结果', '论证意见', '需求公示'],
+   * }
+   * 输出格式:一级分类为空数组则只显示一级分类,二级分类长度不同长度只显示二级分类
+   * ['询价', '招标预告']
+   */
+
+  static formatMoreMapToList (map) {
+    let resultArr = []
+    if(!map) return resultArr
+    if(typeof map === 'object') {
+      for (const key in infoTypeMapExp) {
+        if(map[key] && Array.isArray(map[key])) {
+          if(map[key].length === infoTypeMapExp[key].length) {
+            resultArr.push(key)
+          } else {
+            resultArr = resultArr.concat(map[key])
+          }
+        }
+      }
+    }
+    return resultArr
+  }
 }

+ 36 - 0
apps/bigmember_pc/src/utils/format/search-bid-filter.js

@@ -999,3 +999,39 @@ export class FilterHistoryAjaxModelRestore {
     return result
   }
 }
+
+/**
+ * 二级地区对象转换成,单个area、city、district
+ */
+export function areaObjTwoToSingle(obj, split = ',') {
+  const map = {
+    area: '',
+    city: ''
+  }
+  if (!obj) return map
+  const area = []
+  let city = []
+  for (const key in obj) {
+    if (Array.isArray(obj[key])) {
+      if (obj[key].length === 0) {
+        area.push(key)
+      } else {
+        city = city.concat(obj[key])
+      }
+    }
+  }
+  return {
+    area: area.join(split),
+    city: city.join(split)
+  }
+}
+
+// 信息类型 map
+/**
+ * 信息类型格式化,将map类型数据最终格式化成接口所需
+ * @param info
+ */
+export function infoTypeMapFormat (infoType = {}) {
+  const resultType = InfoTypeTransform.formatMoreMapToList(infoType)
+  return resultType ? resultType.join(',') : ''
+}

+ 10 - 10
apps/bigmember_pc/src/views/search/bidding/constant/search-filters-bi.js

@@ -51,10 +51,10 @@ function createBiSearchBidBaseSchema(propertyListData = {}) {
       }
     },
     {
-      key: 'subinformation',
+      key: 'subInformation',
       label: '业务类型:',
       defaultVal: [],
-      _name: 'subinformation',
+      _name: 'subInformation',
       _type: 'component',
       expand: {
         component: CommonCheckboxSelector,
@@ -138,7 +138,7 @@ function createBiSearchBidMoreSchema() {
       }
     },
     {
-      key: 'subtype',
+      key: 'subType',
       label: '信息类型',
       defaultVal: '',
       _name: 'subtype',
@@ -189,10 +189,10 @@ function createBiSearchBidMoreSchema() {
       }
     },
     {
-      key: 'changehand',
+      key: 'changeHand',
       label: '换手率',
       defaultVal: '',
-      _name: 'changehand',
+      _name: 'changeHand',
       _type: 'component',
       expand: {
         component: ChangeHandsDropdown,
@@ -211,10 +211,10 @@ function createBiSearchBidMoreSchema() {
       }
     },
     {
-      key: 'buyertel',
+      key: 'buyerTel',
       label: '采购单位联系方式',
       defaultVal: '',
-      _name: 'buyertel',
+      _name: 'buyerTel',
       _type: 'component',
       expand: {
         component: ContactSelector,
@@ -225,10 +225,10 @@ function createBiSearchBidMoreSchema() {
       }
     },
     {
-      key: 'winnertel',
+      key: 'winnerTel',
       label: '中标企业联系方式',
       defaultVal: '',
-      _name: 'winnertel',
+      _name: 'winnerTel',
       _type: 'component',
       expand: {
         component: ContactSelector,
@@ -239,7 +239,7 @@ function createBiSearchBidMoreSchema() {
       }
     },
     {
-      key: 'notkey',
+      key: 'notKey',
       label: '排除词',
       defaultVal: [],
       _name: 'notKeyComponent',

+ 35 - 9
apps/bigmember_pc/src/views/search/bidding/model/modules/filter.js

@@ -1,5 +1,9 @@
-import { ref } from 'vue'
-import  { FilterHistoryViewModel2AjaxModel } from '@/utils'
+import { ref, computed } from 'vue'
+import  {
+  FilterHistoryViewModel2AjaxModel,
+  areaObjTwoToSingle,
+  infoTypeMapFormat
+} from '@/utils'
 
 export function useSearchFilterModel(conf) {
   const { inBIPropertyIframe } = conf
@@ -41,7 +45,7 @@ export function useSearchFilterModel(conf) {
     // 到期时间
     expireTime: '',
     // 业务类型
-    subinformation: [],
+    subInformation: [],
     // 价格区间
     scale: [],
     // 合同周期
@@ -51,19 +55,19 @@ export function useSearchFilterModel(conf) {
     // 搜索范围
     selectType: ['title', 'content'],
     // 信息类型
-    subtype: {},
+    subType: {},
     // 发布时间
     publishTime: 'fiveyear',
     // 换手率
-    changehand: '',
+    changeHand: '',
     // 附件
     fileExists: '',
     // 采购单位联系方式
-    buyertel: '',
+    buyerTel: '',
     // 中标企业联系方式
-    winnertel: '',
+    winnerTel: '',
     // 排除词
-    notkey: []
+    notKey: []
   })
   const filterState = ref({})
   if(inBIPropertyIframe) {
@@ -109,7 +113,29 @@ export function useSearchFilterModel(conf) {
   }
   // 格式化物业专版的筛选条件
   function getFormatAPIPropertyParams() {
-    return filterState.value
+    const { publishTime, regionMap, notKey, subType } = filterState.value
+    const { area, city } = areaObjTwoToSingle(regionMap)
+    const rPublishTime = publishTime?.indexOf('_') > -1 ? publishTime.replace(/_/g, '-') :  FilterHistoryViewModel2AjaxModel.formatTime(publishTime, true, '-')
+    const rSubtype = infoTypeMapFormat(subType)
+    const params = {
+      bidField: 'BIProperty',
+      province: area,
+      city,
+      expireTime: filterState.value.expireTime,
+      subInformation: filterState.value.subInformation?.join(),
+      scale: filterState.value.scale?.join(),
+      period:  filterState.value.period?.join(),
+      propertyForm: filterState.value.propertyForm?.join(),
+      selectType: filterState.value.selectType?.join(','),
+      subType: rSubtype,
+      publishTime: rPublishTime,
+      changeHand: filterState.value.changeHand,
+      fileExists: filterState.value.fileExists,
+      buyerTel: filterState.value.buyerTel,
+      winnerTel: filterState.value.winnerTel,
+      exclusionWords: notKey?.join(','), // 排除词
+    }
+    return params
   }
   // 动态更新筛选条件
   function updateFilterBase (keyObj = {}) {