浏览代码

Merge branch 'dev' of http://192.168.3.207:10080/jianyu/page_bigmember_pc into dev

TANGSHIZHE 4 年之前
父节点
当前提交
97c93d7689

+ 25 - 6
src/components/chart/HotChart.vue

@@ -19,6 +19,11 @@ export default {
       type: Object,
       required: false,
       default: () => ({})
+    },
+    showCycle: {
+      type: Boolean,
+      required: false,
+      default: false
     }
   },
   data () {
@@ -175,7 +180,7 @@ export default {
           },
           {
             type: 'group',
-            bottom: 0,
+            bottom: 20,
             right: 50,
             children: [{
               type: 'circle',
@@ -341,8 +346,10 @@ export default {
       const visualMap = options.visualMap
       const graphic = options.graphic
       let waitDelCount = 0
+      const curBudget = this.cycle
       for (var i = 9; i > -1; i--) {
         var nowArr = data.slice(i * 10, (i + 1) * 10)
+        console.log(nowArr, 'nowArr')
         var nowDelStatus = nowArr.filter((v) => { return v[3] > 0 })
         if (nowDelStatus.length > 0) {
           break
@@ -358,15 +365,13 @@ export default {
         return v
       })
       this.minusRows = waitDelCount
-      console.log(waitDelCount, '减掉几行')
       this.myChart.getDom().style.height = 500 - 48 * waitDelCount + 'px'
       series[0].data = data
       series[1].data = this.cycle && this.cycle !== 0 ? [this.getCoordinateInfo(data, this.cycle)] : []
-      // console.log(series[1].data)
       const maxNum = Math.max.apply(Math, series[0].data.map((o) => { return o[3] }))
       visualMap.max = maxNum < 10 ? 10 : maxNum
       graphic[graphic.length - 2].children[0].style.text = maxNum > 10 ? maxNum.toString() : '10'
-      graphic[0].children[0].style.text = '项目数量(个)'
+      graphic[0].children[0].style.text = this.showCycle ? '类似项目数量(个)' : '项目数量(个)'
       const pj = Math.floor((visualMap.max / 5) * 100) / 100
       visualMap[0].pieces = [
         { min: 0, max: 0, color: '#FFF4EB', symbol: 'rect' },
@@ -376,8 +381,22 @@ export default {
         { min: pj * 3, max: pj * 4, color: '#F48A5D', symbol: 'rect' },
         { min: pj * 4, color: '#F06326', symbol: 'rect' }
       ]
-      series.pop()
-      graphic.pop()
+      if (!this.showCycle) {
+        series.pop()
+        graphic.pop()
+      }
+      if (this.showCycle) {
+        series[1].tooltip.formatter = (params) => {
+          const arr = series[1].data[0] // 蓝点数据
+          let tip = ''
+          params.marker = '<span style="display:inline-block;margin-right:5px;border-radius:8px;width:8px;height:8px;background-color:' + params.color + '"></span>'
+          const count = '<span style="padding-left:13px;">类似项目数量:' + arr[3] + '个</span></br>'
+          const rate = (typeof arr[2] === 'number' && !isNaN(arr[2])) ? '<span style="padding-left:13px;">平均折扣率:' + (arr[2] * 100).fixed(2) + '%</span></br>' : ''
+          const budget = '<span style="padding-left:13px;">类似项目预算:' + arr[4] + '</span></br>'
+          tip = params.marker + '当前项目预算:' + (curBudget / 10000).fixed(2) + '万元<br/>' + budget + count + rate
+          return tip
+        }
+      }
       let index
       const myChart = this.myChart
       this.$nextTick(() => {

+ 15 - 11
src/components/report-data/SelectMonth.vue

@@ -31,6 +31,9 @@ export default {
     [Icon.name]: name
   },
   props: {
+    queryDate: {
+      type: Object
+    },
     getTypeTime: {
       type: Object,
       default () {
@@ -59,9 +62,9 @@ export default {
     this.getFirst()
   },
   methods: {
+    changeActive (time) {},
     getFirst () {
       getReportStartTime().then((res) => {
-        console.log(res)
         if (res.data) {
           if (res.data.month_firsttime !== 0) {
             this.month_starttime = res.data.month_firsttime
@@ -84,12 +87,10 @@ export default {
       } else {
         week = date.slice(4, 6)
       }
-      console.log(week)
       for (let a = week; a <= 12; a++) {
         var weeks = a
         aloneWeek.push(weeks + '')
       }
-      console.log(aloneWeek)
       // 月报不需要展示当月,加class隐藏
       const _this = this
       // aloneWeek.forEach(function (time, i) {
@@ -121,29 +122,32 @@ export default {
       }
       this.listWeek.push(aloneWeek)
       this.listWeek[0].forEach(function (item, index) {
-        console.log(item)
         if (item === nowweek) {
           _this.lastIndex = index
           _this.listWeek[0] = _this.listWeek[0].splice(0, index + 1)
         }
       })
       // 高亮处理
-      if (this.getTypeTime.judgeTime === 'month') {
-        this.isActive = this.listWeek[0].length - 2
-        this.isIndexActive = 0
+      const tempData = {
+        year: 0,
+        month: 0
+      }
+      if (this.queryDate && Object.keys(this.queryDate).length) {
+        tempData.year = this.listYear.indexOf(this.queryDate.year) || 0
+        tempData.month = this.listWeek[tempData.year].indexOf(this.queryDate.month) || (this.listWeek[tempData.year].length - ((this.getTypeTime.judgeTime === 'month') ? 2 : 1))
       } else {
-        this.isActive = this.listWeek[0].length - 1
-        this.isIndexActive = 0
+        tempData.year = 0
+        tempData.month = (this.listWeek[tempData.year].length - ((this.getTypeTime.judgeTime === 'month') ? 2 : 1))
       }
+      this.isActive = tempData.month
+      this.isIndexActive = tempData.year
     },
     getWeek (index, i, month) {
-      console.log(index, i, month)
       this.isActive = i
       this.isIndexActive = index
       if (month < 10) {
         month = '0' + month
       }
-      console.log(month)
       this.$emit('selectYear', this.listYear[index])
       this.$emit('selectYm', this.listYear[index] + month)
     },

+ 7 - 13
src/views/portrayal/components/AnalysisChart.vue

@@ -25,7 +25,7 @@
       <div class="chart-title">类似项目预算分布</div>
       <div class="chart-main">
         <div style="padding: 0 12px 12px;font-size: 12px;color: #9B9CA3;">单位(元)</div>
-        <hot-chart :datas="budget.data" :cycle="info.budget" :options="budget.options"></hot-chart>
+        <hot-chart :showCycle="true" :datas="budget.data" :cycle="info.budget" :options="budget.options"></hot-chart>
         <div class="chart-tips">注:少数缺失的项目预算,用中标金额补充;平均折扣率=(全部项目预算-全部中标金额)/全部项目预算,仅统计预算和中标金额同时存在的项目。</div>
       </div>
     </div>
@@ -223,16 +223,10 @@ export default {
       if (arr && arr.length > 0) {
         let data = []
         data = arr.map((v, i) => {
-          if (v.doc_count === 0) {
-            this.budget.data = []
-            this.budget.show = false
-            this.budget.flag = false
-          } else {
-            v.avg = v.avg === null ? '0' : v.avg
-            const x = i % 10
-            const y = 10 - Math.ceil((i + 1) / 10)
-            return [x, y, v.avg, v.doc_count, v.key]
-          }
+          v.avg = v.avg === null ? '0' : v.avg
+          const x = i % 10
+          const y = 10 - Math.ceil((i + 1) / 10)
+          return [x, y, v.avg, v.doc_count, v.key]
         })
         if (data.length > 0) {
           this.budget.data = data
@@ -338,9 +332,9 @@ export default {
         totalRange = sRange + '-' + mRange
       }
       let tip = ''
-      const count = '<span>项目数量:' + params.value[3] + '个</span></br>'
+      const count = '<span>类似项目数量:' + params.value[3] + '个</span></br>'
       const rate = (typeof params.value[2] === 'number' && !isNaN(params.value[2])) ? '<span>平均节支率:' + (params.value[2] * 100).fixed(2) + '%</span></br>' : ''
-      const budget = '<span>采购规模:' + totalRange + '</span></br>'
+      const budget = '<span>类似项目预算:' + totalRange + '</span></br>'
       tip = budget + count + rate
       return tip
     },

+ 43 - 6
src/views/reportData/pageWeek.vue

@@ -3,7 +3,7 @@
     <div class="page_week_main">
       <!-- 选择周报时间 -->
       <div class="week_time">
-        <SelectMonth @selectYm="getSelectTime"></SelectMonth>
+        <SelectMonth ref="selectMonth" :queryDate="getQueryTime" @selectYm="getSelectTime"></SelectMonth>
         <div class="select_report">
           <div class="week_report" v-for="(item, index) in weekList" :key="index" @click="selectWeek(index, item)" :class="{weekActive:index==isWeekIndex}">
             <div class="week_report_main">
@@ -111,6 +111,7 @@ export default {
   },
   data () {
     return {
+      canQuery: true,
       isWeekIndex: 0,
       start: 0,
       end: 0,
@@ -174,17 +175,37 @@ export default {
       }
     }
   },
-  created () {
+  mounted () {
     const nowtime = dateFormatter(new Date(), 'yyyyMM')
     this.getReportList(nowtime)
     if (this.$refs.weekitempoint && this.$refs.weekitempoint.length > 0) {
       this.$refs.weekitempoint[0].style.display = 'none'
     }
   },
+  computed: {
+    getQueryTime () {
+      const paramsDate = this.$route.query.start
+      if (paramsDate) {
+        const paramsData = {
+          year: dateFormatter(paramsDate * 1000, 'yyyy'),
+          month: Number(dateFormatter(paramsDate * 1000, 'MM')).toString(),
+          ym: dateFormatter(paramsDate * 1000, 'yyyyMM'),
+          start: this.$route.query.start,
+          end: this.$route.query.end
+        }
+        return paramsData
+      }
+      return false
+    }
+  },
   methods: {
     dateFormatter,
     // 周报列表
-    getReportList (time) {
+    getReportList (yearMonth) {
+      let time = yearMonth
+      if (this.getQueryTime) {
+        time = this.getQueryTime.ym
+      }
       getReportIndex({ ym: time }).then((res) => {
         console.log(res)
         if (res.data && res.data.list && res.data.list.length !== 0) {
@@ -201,9 +222,25 @@ export default {
             }
           })
           this.weekList = res.data.list
-          this.getDetail(res.data.list[0].startdate, res.data.list[0].enddate)
-          this.start = res.data.list[0].startdate
-          this.end = res.data.list[0].enddate
+          const queryData = {
+            start: res.data.list[0].startdate,
+            end: res.data.list[0].enddate
+          }
+          if (this.canQuery && this.getQueryTime) {
+            if (this.getQueryTime.ym === time) {
+              queryData.start = this.getQueryTime.start
+              queryData.end = this.getQueryTime.end
+              this.weekList.forEach((v, index) => {
+                if (String(v.startdate) === queryData.start) {
+                  this.isWeekIndex = index
+                }
+              })
+            }
+            this.canQuery = false
+          }
+          this.getDetail(queryData.start, queryData.end)
+          this.start = queryData.start
+          this.end = queryData.end
           this.nodata = true
         } else {
           this.weekList = []

+ 7 - 4
src/views/subscribe/Config.vue

@@ -67,10 +67,13 @@ export default {
       const res = data.data
       if (res) {
         this.setData.maxCount = res.key_max_length ? res.key_max_length : 0
-        if (res.member_jy && Object.keys(res.member_jy).length === 0) {
-          this.setdata.area = '全国'
-          this.setdata.industry = '全部'
-          this.setdata.infotypes = '全部类型'
+        if (!res.member_jy || Object.keys(res.member_jy).length === 0) {
+          this.setData.areaStr = '全国'
+          this.setData.buyClassStr = '全部'
+          this.setData.infoTypeStr = '全部类型'
+          this.setData.projectmatch = 0
+          this.setData.buyclassmatch = 0
+          this.setData.mathway = 1
         } else {
           // 项目匹配
           this.setData.projectmatch = res.member_jy.i_projectmatch