浏览代码

fix:筛选条件逻辑调整、市场分析项目明细列表逻辑调整

tsz 2 年之前
父节点
当前提交
d4be087aae

+ 7 - 1
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/report_detail_month.js

@@ -251,8 +251,14 @@ var vNode = {
         })
       },
       // 点击项目
-      setLinkUrl () {
+      setLinkUrl (data) {
         this.saveState()
+        if(data) {
+          const params = {
+            sid: (data.id || data.sourceinfoid)
+          }
+          sessionStorage.setItem('bigvip-fid', JSON.stringify(params))
+        }
         location.href = '/jyapp/big/page/pro_follow_detail'
       },
       setBuyerLink (data) {

+ 2 - 2
src/jfw/modules/app/src/web/templates/big-member/page_report_analysis_pro_list.html

@@ -30,9 +30,9 @@
           <project-cell @set-winner-link="setWinnerLink" @set-buyer-link="setBuyerLink(item)" @set-link-url="setLinkUrl" :item="item" v-for="item in projectInfo.list" :key="item.id">
             <div class="update-time">
               <div class="update-time-label">
-                本月项目更新时间:
+                成交时间:
               </div>
-              <div class="update-time-content">${item.lastTime?utils.dateFromNow(item.lastTime*1000):'--'}</div>
+              <div class="update-time-content">${item.dealTime?utils.dateFromNow(item.dealTime*1000):'--'}</div>
             </div>
           </project-cell>
         </van-list>

+ 1 - 1
src/jfw/modules/app/src/web/templates/big-member/page_report_detail_month.html

@@ -838,7 +838,7 @@
                 <div class="chart_title">本月项目规模排行榜TOP30</div>
                 <div>
                     <div class="current-list current-list-new" v-for="(item,index) in showScaleWin">
-                        <div class="win-name">
+                        <div class="win-name" @click="setLinkUrl(item)">
                             <span v-if="index === 0" class="index first-index">${index + 1}</span>
                             <span v-else-if="index === 1" class="index second-index">${index + 1}</span>
                             <span v-else-if="index === 2" class="index third-index">${index + 1}</span>

+ 1 - 1
src/web/staticres/common-module/collection/js/area-city-mobile.js

@@ -157,7 +157,7 @@ var areaCityMobileComponent = {
               } else {
                 cities.city.forEach(c => {
                   // 将市区重组成一个新的对象
-                  if(newData) {
+                  if(newData && JSON.stringify(newData) !== '{}') {
                     const apiArea = newData[pName]
                     apiArea.forEach(v => {
                       if (v == c.name) {

+ 13 - 0
src/web/staticres/common-module/collection/js/cate-mobile.js

@@ -79,6 +79,10 @@ var cateComponent = {
       default: function () {
         return []
       }
+    },
+    isAll: {
+      type: Boolean,
+      default: false
     }
   },
   template: cateComponentTemplate,
@@ -297,6 +301,15 @@ var cateComponent = {
         data: cateArr,
         t: t
       }
+      if(this.isAll) {
+        if(this.checkedAll) {
+          params = {
+            name: 'cateItem',
+            data: [],
+            t: t
+          }
+        }
+      }
       this.$emit('confirm', params)
       return params
     }

+ 14 - 0
src/web/staticres/common-module/collection/js/industry-mobile.js

@@ -74,6 +74,10 @@ var industryComponent = {
     'onlyshowsome': {
       type: Boolean,
       default: false
+    },
+    isAll: {
+      type: Boolean,
+      default: false
     }
   },
   template: industryComponentTemplate,
@@ -426,6 +430,16 @@ var industryComponent = {
         detail: this.getSelected(),
         t: t
       }
+      if(this.isAll) {
+        if(this.checkedAll) {
+          params = {
+            name: 'industryItem',
+            data: [],
+            detail: {},
+            t: t
+          }
+        }
+      }
       this.$emit('confirm', params)
       return params
     }

+ 15 - 0
src/web/staticres/common-module/collection/js/keyword-mobile.js

@@ -90,6 +90,11 @@ var keywordComponent = {
         // "智慧生活"
       ]
     },
+    // 如果选择全部传空
+    isAll: {
+      type: Boolean,
+      default: false
+    },
     useKeyCard: {
       type: Boolean,
       default: false
@@ -548,6 +553,16 @@ var keywordComponent = {
         detail: detailArr,
         t: t
       }
+      if(this.isAll) {
+        if(this.checkedAll) {
+          params = {
+            name: 'keywordItem',
+            data: [],
+            detail: [],
+            t: t
+          }
+        }
+      }
       this.$emit('confirm', params)
     },
     checkNoKey () {

+ 24 - 10
src/web/staticres/common-module/filter/js/filter_limit.js

@@ -41,6 +41,7 @@ var filterTemp = `
           <keyword-component
               ref="keywordSelector"
               protype="bigmember"
+              :is-all="setAll.keysAll"
               :keyphraseslist="keyphraseslist"
               :keyformat="keyformat"
               :use-key-card="true"
@@ -66,6 +67,7 @@ var filterTemp = `
       <div class="popup-header header-title">选择区域</div>
       <div class="j-main">
           <area-city-mobile
+              :is-all="setAll.areaAll"
               ref="areaCitySelector"
               @cancel="cancel($event, 'area')"
               @confirm="confirm($event, 'area')"></area-city-mobile>
@@ -88,6 +90,7 @@ var filterTemp = `
       <div class="j-main">
           <industry-component
               ref="industrySelector"
+              :is-all="setAll.industryAll"
               :selectindustrylist="filters.industry"
               @cancel="cancel($event, 'industry')"
               @confirm="confirm($event, 'industry')"></industry-component>
@@ -110,6 +113,7 @@ var filterTemp = `
       <div class="j-main">
           <cate-component
               ref="buyerclassSelector"
+              :is-all="setAll.buyerAll"
               :selectcatelist="filters.buyerclass"
               @cancel="cancel($event, 'buyerclass')"
               @confirm="confirm($event, 'buyerclass')"></cate-component>
@@ -319,6 +323,12 @@ var filterComponent = {
         area: false,
         industry: false,
         buyerclass: false
+      },
+      setAll: {
+        keysAll: true,
+        areaAll: true,
+        buyerAll: true,
+        industryAll: true,
       }
     }
   },
@@ -508,11 +518,15 @@ var filterComponent = {
       if (Array.isArray(keys) && keys.length) {
         return keys
       } else {
-        if(this.$refs.keywordSelector) {
-          var allKeys = this.$refs.keywordSelector.keywordGroupList
-          return allKeys
-        } else {
+        if (this.setAll.keysAll) {
           return []
+        } else {
+          if(this.$refs.keywordSelector) {
+            var allKeys = this.$refs.keywordSelector.keywordGroupList
+            return allKeys
+          } else {
+            return []
+          }
         }
       }
     },
@@ -547,17 +561,17 @@ var filterComponent = {
         filters.industryDetail = {}
       } else if (type === 'buyerclass') {
         filters.buyerclass = []
-      } else if (type === 'date') {
-        // this.filters.rangeTime.start = ''
-        // this.filters.rangeTime.edd = ''
-        // this.filters.rangeTime.exact = 'sinceYearBeforeLast'
-        // this.initDateTimeSelector(this.filters.rangeTime.exact)
+      } else if (type === 'buyerUnit') {
+        this.filters.buyerUnit = ''
+      } else if (type === 'winnerUnit') {
+        this.filters.winnerUnit = ''
       } else {
         this.resetFilter('keys')
         this.resetFilter('area')
         this.resetFilter('industry')
         this.resetFilter('buyerclass')
-        this.resetFilter('date')
+        this.resetFilter('buyerUnit')
+        this.resetFilter('winnerUnit')
       }
     },
     toSubManageButtonClick: function () {

+ 21 - 8
src/web/staticres/common-module/report-analysis/js/report_analysis.js

@@ -376,19 +376,27 @@ var vm = new Vue({
     // 设置排序方式
     setsortType (data) {
       this.sections.areaScatter.sortType = data
-      this.sections.areaScatter.setCityList = this.formatterWinData(this.sections.areaScatter.setCityList, data===0?'total':'amount')
+      const type = data===0 ? 'total' : 'amount'
+      // const list = this.setCitySort(this.sections.areaScatter.setCityList, type)
       let newArr = []
       if(data === 0) {
         newArr = this.sections.areaScatter.setCityList.sort((a, b) => b.total - a.total)
       } else {
         newArr = this.sections.areaScatter.setCityList.sort((a, b) => b.amount - a.amount)
       }
+      this.sections.areaScatter.setCityList = this.formatterWinData(newArr, type)
       this.sortOptionTitle = this.sortOptionContent[data].text
       this.sections.areaScatter.setCityList = newArr
     },
     cancelSelectArea () {
       this.sections.areaScatter.showAreaPopup = false
     },
+    // 城市排序
+    setCitySort (list, type) {
+      return list.sort((a, b) => {
+        a[type] - b[type]
+      })
+    },
     // 选择省份展示城市分布(单选)
     confirmSelectArea (data) {
       console.log(data)
@@ -397,7 +405,13 @@ var vm = new Vue({
           if(item.area == data.data[0]) {
             this.sections.areaScatter.selectArea = item
             const areaSort = this.sections.areaScatter.sortType === 0 ? 'total' : 'amount'
-            this.sections.areaScatter.setCityList = this.formatterWinData(item.areaDetails, areaSort)
+            let newArr = []
+            if(this.sections.areaScatter.sortType === 0) {
+              newArr = item.areaDetails.sort((a, b) => b.total - a.total)
+            } else {
+              newArr = item.areaDetails.sort((a, b) => b.amount - a.amount)
+            }
+            this.sections.areaScatter.setCityList = this.formatterWinData(newArr, areaSort)
             this.sections.areaScatter.setCityList = this.sections.areaScatter.setCityList.sort((a, b) => b[areaSort] - a[areaSort])
             if(this.sections.areaScatter.setCityList.length > 5) {
               this.sections.areaScatter.showAreaCityListBtn = true
@@ -1389,12 +1403,11 @@ var vm = new Vue({
       const list = areacitylist
       const ZXS = ['北京', '天津', '上海', '重庆', '台湾', '澳门', '香港']
       const result  = list.reduce((max, item) => {
-        const isTianjinIncluded = ZXS.includes(item.area)
-        if(!isTianjinIncluded) {
-          return item.total > max.total ? item : max
-        } else {
-          return max
-        }
+        const isMaxZXS = ZXS.includes(max.area)
+        const isZXS = ZXS.includes(item.area);
+        const isMaxTotal = item.total > max.total;
+        const isNotZXSMaxTotal = (isMaxTotal && !isZXS) || isMaxZXS;
+        return isNotZXSMaxTotal ? item : max
       })
       if (result.areaDetails.length > 5) {
         this.sections.areaScatter.showAreaCityListBtn = true

+ 7 - 3
src/web/staticres/common-module/report-analysis/js/report_analysis_pro_list.js

@@ -152,6 +152,8 @@ var vm = new Vue({
       }
       if (data.area && data.area !== '{}') {
         this.initFilters.area = JSON.parse(data.area)
+      } else {
+        this.initFilters.area = {}
       }
       if (data.industry && data.industry !== '{}') {
         this.$set(this.filters, 'industryDetail', JSON.parse(data.industry))
@@ -200,7 +202,6 @@ var vm = new Vue({
     },
     onListLoad: function () {
       this.filterData.pageNum++
-      this.vanlistParams.loading = true
       this.getProjectInfo(this.filterData)
     },
     // 查询项目明细
@@ -223,6 +224,7 @@ var vm = new Vue({
       delete data.selectKeysArr
       const params = {
         ...this.listParams,
+        rid: utils.getParam('id'),
         keysItems: JSON.stringify(items),
         area: JSON.stringify(area),
         industry: JSON.stringify(data.industry),
@@ -240,6 +242,7 @@ var vm = new Vue({
       this.getProjectInfo(params)
     },
     getProjectInfo: function (params) {
+      this.vanlistParams.loading = true
       const loading = this.showLoading()
       $.ajax({
         type: 'POST',
@@ -247,7 +250,6 @@ var vm = new Vue({
         data: params,
         // contentType: 'application/json',
         success: function(res) {
-          this.vanlistParams.loading = false
           if (res && res.error_code === 0 && res.data) {
             if (!res.data.list) {
               this.projectInfo.list = []
@@ -257,11 +259,12 @@ var vm = new Vue({
               }
               return
             }
-            if (this.listParams.pageNum === 1) {
+            if (params.pageNum === 1) {
               this.projectInfo = res.data
             } else {
               this.projectInfo.list = this.projectInfo.list.concat(res.data.list)
             }
+            this.vanlistParams.loading = false
             res.data.total = res.data.total > 5000 ? 5000 : res.data.total
             const pageTotalNum = res.data.total / this.listParams.pageSize
             const pageResidue = res.data.total % this.listParams.pageSize
@@ -280,6 +283,7 @@ var vm = new Vue({
             }
           } else {
             this.projectInfo.list = []
+            this.vanlistParams.loading = false
             this.$toast(res.error_msg)
           }
           if(loading) {

+ 2 - 2
src/web/templates/big-member/wx/page_report_analysis_pro_list.html

@@ -41,9 +41,9 @@
           <project-cell @set-winner-link="setWinnerLink" @set-buyer-link="setBuyerLink(item)" @set-link-url="setLinkUrl" :item="item" v-for="item in projectInfo.list" :key="item.id">
             <div class="update-time">
               <div class="update-time-label">
-                本月项目更新时间:
+                成交时间:
               </div>
-              <div class="update-time-content">${item.lastTime?utils.dateFromNow(item.lastTime*1000):'--'}</div>
+              <div class="update-time-content">${item.dealTime?utils.dateFromNow(item.dealTime*1000):'--'}</div>
             </div>
           </project-cell>
         </van-list>