Ver código fonte

数据大屏暂存

qymljy 7 meses atrás
pai
commit
24ad7e12c2

+ 115 - 0
src/HManagement/serviceDataScreen/components/PieCharts.vue

@@ -0,0 +1,115 @@
+<template>
+  <div :style="{'width':width,'height':height }">
+    <div ref="typeEl" :style="{'width':wChart,'height':hChart }"></div>
+    <div class="title-font-style">{{title}}</div>
+  </div>
+</template>
+
+<script>
+import {Pie} from "@antv/g2plot";
+
+export default {
+  name: "PieCharts",
+  props:["width",'height','wChart','hChart','title'],
+  data(){
+    return {
+      param:{
+        id:20231018140404,
+        content:{
+          dataid:'',
+          dateType:'本年',
+          type:'',
+          where:{
+            begdate: "",
+            enddate: "",
+            isleave:'1',
+            unfinish:'0'
+          }
+        }
+      },
+      mapData:{},
+      typeMap:''
+    }
+  },
+  methods:{
+    async typeInit(init,title){
+      if (this.title == '项目跟进情况' || title == '项目跟进情况'){
+        this.param.id = 20231019085304
+      }else if (this.title == '项目类型分析' || title == '项目类型分析'){
+        this.param.id = 20231018140404
+      }else if (this.title == '客户跟进情况' || title == '客户跟进情况'){
+        this.param.id = 20231017151304
+      }
+      let res = await this.$api.requested(this.param)
+      this.mapData = res.data
+      console.log('项目类型数据',this.mapData)
+      if (init) {
+        this.typeMap = new Pie(this.$refs.typeEl, {
+          appendPadding: 10,
+          data:this.mapData,
+          angleField: 'ratio',
+          colorField: 'key',
+          radius: 1,
+          innerRadius: 0.79,
+          label:{
+            /*type: 'inner',
+            offset: '-50%',
+            style: {
+              textAlign: 'center',
+            },
+            autoRotate: false,*/
+            formatter: (datum) => `${datum.ratio}%`
+          },
+          tooltip:{
+            formatter: (datum) => {
+              return { name: datum.key, value: datum.ratio + '%' };
+            },
+          },
+          statistic: {
+            title: {
+              offsetY: -4,
+              style: {
+                fontSize:'16px'
+              },
+              content:this.title == '客户跟进情况' || title == '客户跟进情况'?'客户总数':'项目总数'
+            },
+            content: {
+              offsetY: 4,
+              style: {
+                whiteSpace: 'pre-wrap',
+                overflow: 'hidden',
+                textOverflow: 'ellipsis',
+                fontSize:'16px'
+              },
+              customHtml: (container, view, datum, data) => {
+                const text = data[0].totalqty
+                return text
+              },
+            },
+          },
+          legend: {
+            position:'top'
+          },
+          // 添加 中心统计文本 交互
+          interactions: [{ type: 'element-single-selected' },{ type: 'element-active' }],
+        });
+        this.typeMap.render();
+      } else {
+        this.typeMap.changeData(this.mapData)
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+.title-font-style{
+  font-family: Microsoft YaHei, Microsoft YaHei;
+  font-weight: 400;
+  font-size: 0.833vw;
+  color: #E6F4FF;
+  text-align: center;
+  font-style: normal;
+  text-transform: none;
+}
+</style>

+ 47 - 0
src/HManagement/serviceDataScreen/components/datePicker.vue

@@ -0,0 +1,47 @@
+<template>
+  <div>
+    <el-date-picker
+        v-model="value"
+        :type="type"
+        @change="$emit('selectTime',value)"
+        :value-format="value_format"
+        :format="format"
+        :append-to-body="false"
+        :clearable="false"
+        placeholder="选择日期">
+    </el-date-picker>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "datePicker",
+  props:['type','format','value_format'],
+  data(){
+    return {
+      value:""
+    }
+  }
+}
+</script>
+
+<style scoped>
+/deep/ .el-input__inner {
+  -webkit-appearance: none;
+  background-color: #061a31;
+  background-image: none;
+  box-sizing: border-box;
+  color: #c6d6e4;
+  display: inline-block;
+  font-size: inherit;
+  height: 40px;
+  line-height: 40px;
+  outline: 0;
+  padding: 0 30px !important;
+  transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
+  width: 100%;
+  box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16);
+  border-radius: 6px 6px 6px 6px;
+  border: 1px solid #CFDCE5;
+}
+</style>

+ 60 - 28
src/HManagement/serviceDataScreen/components/funnelBox.vue

@@ -1,24 +1,38 @@
 <template>
-  <div style="display:flex;justify-content: space-between">
-    <div style="width: 7vw;">
-      <div style="display:flex;justify-content: space-between">
-        <div class="box-funnel-title">阶段</div>
-        <div></div>
-      </div>
-      <div class="box-margin-top">
-        <span class="box-funnel-title-span1">预计签约:</span>
-        <span class="box-funnel-title-span2">7.13万元</span>
-      </div>
-      <div class="box-margin-top">
-        <span class="box-funnel-title-span1">项目成交:</span>
-        <span class="box-funnel-title-span3">7.13万元</span>
+  <div>
+    <div style="display:flex;justify-content: space-between">
+      <div style="width: 7vw">
+        <div style="display:flex;">
+          <div class="box-funnel-title" style="position: relative">{{data.stagename}}
+            <div class="div-style" :style="{'left':data.stagename.length >2?((data.stagename.length -1) + 0.633) +'vw':(2.333) +'vw'}">
+              <div class="box-circle-style" :style="{'color':data.color}"></div>
+              <div class="box-line-style" :style="{'color':data.color}"></div>
+            </div>
+          </div>
+        </div>
+        <div class="box-margin-top">
+          <span class="box-funnel-title-span1">预计签约:</span>
+          <span class="box-funnel-title-span2">{{data.signamount_due}}万元</span>
+        </div>
+        <div class="box-margin-top">
+          <span class="box-funnel-title-span1">项目成交:</span>
+          <span class="box-funnel-title-span3">{{data.dealamount}}万元</span>
+        </div>
       </div>
-    </div>
-    <div class="box-funnel-style" :style="{'width': width + 'vw','background':background}">
-      <div>
-        <div>
-          <div class="box-funnel-title-span5"></div>
-          <div class="box-funnel-title-span4"></div>
+      <div class="box-funnel-style" :style="{'width': width + 'vw','background':data.color}">
+        <div style="display: flex;justify-content: space-between;margin: 5% 15% 5% 15%">
+          <div>
+            <div class="box-funnel-title-span5">{{data.sequence1}}</div>
+            <div class="box-funnel-title-span4">项目总数</div>
+          </div>
+          <div>
+            <div class="box-funnel-title-span5">{{data.projectqty}}</div>
+            <div class="box-funnel-title-span4">当前项目数</div>
+          </div>
+          <div>
+            <div class="box-funnel-title-span5">{{data.zhl}}</div>
+            <div class="box-funnel-title-span4">转化率</div>
+          </div>
         </div>
       </div>
     </div>
@@ -28,7 +42,7 @@
 <script>
 export default {
   name: "funnelBox",
-  props:['width','background']
+  props:['width','background','data']
 }
 </script>
 
@@ -38,7 +52,8 @@ export default {
   /*background: #40DCF2;*/
   box-shadow: 0.000vw 0.156vw 0.313vw 0.052vw rgba(0,0,0,0.16);
   border-radius: 0.313vw 0.313vw 0.313vw 0.313vw;
-  opacity: 0.8;
+  /*opacity: 0.8;*/
+  /*border: 1px solid #d90a0a;*/
   margin: auto;
 }
 .box-funnel-title{
@@ -50,12 +65,16 @@ export default {
   font-style: normal;
   text-transform: none;
 }
+.box-funnel-title .div-style{
+  display: flex;
+  position: absolute;
+  top: 0.521vw;
+}
 .box-funnel-title-span1{
   font-family: Microsoft YaHei, Microsoft YaHei;
   font-weight: 400;
   font-size: 0.625vw;
   color: #CFDCE5;
-  line-height: 0.000vw;
   text-align: left;
   font-style: normal;
   text-transform: none;
@@ -65,7 +84,6 @@ export default {
   font-weight: 400;
   font-size: 0.625vw;
   color: #6CD2A1;
-  line-height: 0.000vw;
   text-align: left;
   font-style: normal;
   text-transform: none;
@@ -75,7 +93,6 @@ export default {
   font-weight: 400;
   font-size: 0.625vw;
   color: #5FB3E3;
-  line-height: 0.000vw;
   text-align: left;
   font-style: normal;
   text-transform: none;
@@ -85,22 +102,37 @@ export default {
   font-weight: 400;
   font-size: 0.625vw;
   color: #FFFFFF;
-  line-height: 0.000vw;
-  text-align: left;
+  text-align: center;
   font-style: normal;
   text-transform: none;
+  margin: auto;
 }
 .box-funnel-title-span5{
   font-family: Microsoft YaHei, Microsoft YaHei;
   font-weight: bold;
   font-size: 0.625vw;
   color: #FFFFFF;
-  line-height: 0.000vw;
-  text-align: left;
+  text-align: center;
   font-style: normal;
   text-transform: none;
+  margin: auto;
 }
 .box-margin-top{
   margin-top: 0.521vw;
 }
+.box-circle-style{
+  width: 0.521vw;
+  height: 0.521vw;
+  border: 0.104vw solid ;
+  border-radius: 0.504vw;
+  z-index: 100;
+  margin-top: -0.321vw;
+
+}
+.box-line-style{
+  width: 6.375vw;
+  height: 0vw;
+  border: 0.104vw solid;
+  z-index: 100;
+}
 </style>

+ 24 - 24
src/HManagement/serviceDataScreen/components/profileTemplate.vue

@@ -17,20 +17,20 @@
             </div>
             <div class="title-style">{{item.title}}</div>
           </div>
-          <div style="margin-right: 0.252vw;margin-top: 0.1vw" v-if="item.tips">
-            <el-tooltip placement="top" >
-              <div slot="content">
-              <span v-if="item.title == '已转化线索数'">
-                {{$t('①已转化线索数:销售线索应用中,已分配给业务员,已转化状态的线索数量。')}}<br/>
-                {{$t('②一条线索可进行两次转化:转化客户、转化项目,因此,已转化线索数≠转化客户线索数+转化项目线索数。')}}
-              </span>
-                <span v-else>
-                {{item.tips}}
-              </span>
-              </div>
-              <img style="vertical-align: middle" width="14px" height="14px" src="../../../assets/icons/Tips.svg" >
-            </el-tooltip>
-          </div>
+<!--          <div style="margin-right: 0.252vw;margin-top: 0.1vw" v-if="item.tips">-->
+<!--            <el-tooltip placement="top" >-->
+<!--              <div slot="content">-->
+<!--              <span v-if="item.title == '已转化线索数'">-->
+<!--                {{$t('①已转化线索数:销售线索应用中,已分配给业务员,已转化状态的线索数量。')}}<br/>-->
+<!--                {{$t('②一条线索可进行两次转化:转化客户、转化项目,因此,已转化线索数≠转化客户线索数+转化项目线索数。')}}-->
+<!--              </span>-->
+<!--                <span v-else>-->
+<!--                {{item.tips}}-->
+<!--              </span>-->
+<!--              </div>-->
+<!--              <img style="vertical-align: middle" width="14px" height="14px" src="../../../assets/icons/Tips.svg" >-->
+<!--            </el-tooltip>-->
+<!--          </div>-->
         </div>
       </div>
     </div>
@@ -41,16 +41,16 @@
             <div class="value-style">{{k.qty}}</div>
             <div class="title-style">{{k.value}}</div>
           </div>
-          <div style="margin-right: 0.252vw;margin-top: 0.1vw" v-if="k.value == '无分类客户'">
-            <el-tooltip placement="top" >
-              <div slot="content">
-                <span v-if="k.value == '无分类客户'">
-                  {{$t('无分类客户数:统计没有客户分类信息的客户数量')}}<br/>
-                </span>
-              </div>
-              <img style="vertical-align: middle" width="14px" height="14px" src="../../../assets/icons/Tips.svg" >
-            </el-tooltip>
-          </div>
+<!--          <div style="margin-right: 0.252vw;margin-top: 0.1vw" v-if="k.value == '无分类客户'">-->
+<!--            <el-tooltip placement="top" >-->
+<!--              <div slot="content">-->
+<!--                <span v-if="k.value == '无分类客户'">-->
+<!--                  {{$t('无分类客户数:统计没有客户分类信息的客户数量')}}<br/>-->
+<!--                </span>-->
+<!--              </div>-->
+<!--              <img style="vertical-align: middle" width="14px" height="14px" src="../../../assets/icons/Tips.svg" >-->
+<!--            </el-tooltip>-->
+<!--          </div>-->
         </div>
       </div>
     </div>

+ 25 - 2
src/HManagement/serviceDataScreen/index.vue

@@ -46,12 +46,12 @@
       </div>
       <div>
         <!-- 销售漏斗 -->
-        <salesFunnel></salesFunnel>
+        <salesFunnel ref="funnelRef"></salesFunnel>
         <div class="justify-style inline-top-20">
           <!-- 营销费用 -->
           <marketingExpenses ref="expensesRef"></marketingExpenses>
           <!-- 营销费用统计 -->
-          <marketingExpenseStatistics></marketingExpenseStatistics>
+          <marketingExpenseStatistics ref="exStatisticsRef"></marketingExpenseStatistics>
         </div>
       </div>
       <div>
@@ -283,12 +283,24 @@ export default {
       this.$refs.panelRef.paramChart.content.where.isleave = this.isleave
       this.$refs.panelRef.listData()
 
+      /*销售漏斗*/
+      this.$refs.funnelRef.param.content.dataid = id
+      this.$refs.funnelRef.param.content.type = this.departmentid !== ''?1:0
+      this.$refs.funnelRef.param.content.where.isleave = this.isleave
+      this.$refs.funnelRef.listData()
+
       /*营销费用*/
       this.$refs.expensesRef.param.content.dataid = id
       this.$refs.expensesRef.param.content.type = this.departmentid !== ''?1:0
       this.$refs.expensesRef.param.content.where.isleave = this.isleave
       this.$refs.expensesRef.listData()
 
+      /*营销费用统计*/
+      this.$refs.exStatisticsRef.param.content.dataid = id
+      this.$refs.exStatisticsRef.param.content.type = this.departmentid !== ''?1:0
+      this.$refs.exStatisticsRef.param.content.where.isleave = this.isleave
+      this.$refs.exStatisticsRef.typeInit(true)
+
       /*应收账款*/
       this.$refs.receivableRef.param.content.dataid = id
       this.$refs.receivableRef.param.content.type = this.departmentid !== ''?1:0
@@ -300,6 +312,17 @@ export default {
       this.$refs.profileRef.param.content.type = this.departmentid !== ''?1:0
       this.$refs.profileRef.param.content.where.isleave = this.isleave
       this.$refs.profileRef.listData()
+      this.$refs.profileRef.$refs.proTypRef.param.content.dataid = id
+      this.$refs.profileRef.$refs.proTypRef.param.content.type = this.departmentid !== ''?1:0
+      this.$refs.profileRef.$refs.proTypRef.param.content.where.isleave = this.isleave
+      let currentDate = new Date(); // 获取当前日期
+      let startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() ) // 计算起始日期
+      let endDate = currentDate.getFullYear() +'-' + 12 // 计算起始日期
+      this.$refs.profileRef.$refs.startRef.value = startDate
+      this.$refs.profileRef.$refs.endRef.value = endDate
+      this.$refs.profileRef.$refs.proTypRef.typeInit(true,'项目类型分析')
+      this.$refs.profileRef.$refs.proFowRef.typeInit(true,'项目跟进情况')
+      this.$refs.profileRef.$refs.cusFowRef.typeInit(true,'客户跟进情况')
     }
   },
   created() {

+ 97 - 2
src/HManagement/serviceDataScreen/modules/dataProfile.vue

@@ -21,7 +21,7 @@
               <el-button type="text" class="btn-unSelect" v-else @click="typeChange('报价')">{{$t(`报价`)}}</el-button>
             </div>
           </div>
-          <div>
+          <div style="display: flex;justify-content: left">
             <el-select v-model="param.content.dateType"  class="inline-16" size="small" @change="listData" :popper-append-to-body="false">
               <el-option :label="$t('全部')" value="全部"></el-option>
               <el-option :label="$t('本年')" value="本年"></el-option>
@@ -32,6 +32,30 @@
           </div>
         </div>
         <profileTemplate :dataProfile="dataProfile" :profileType="profileType"></profileTemplate>
+        <div class="bottom_justify">
+          <div class="title_font">
+            {{$t(`数据图例`)}}
+          </div>
+          <div class="title_right">
+            <el-select v-model="dateType"  class="inline-16" size="small" @change="dateTypeChange"  :popper-append-to-body="false">
+              <el-option :label="$t('全部')" value="全部"></el-option>
+              <el-option :label="$t('本年')" value="本年"></el-option>
+            </el-select>
+            <div class="line-style inline-16"></div>
+            <div class="inline-16">
+              <datePicker ref="startRef" type="date" @selectTime="begDateChange" format="yyyy-MM" value_format="yyyy-MM"></datePicker>
+            </div>
+            <div class="title_right_font inline-16">至</div>
+            <div>
+              <datePicker ref="endRef" type="date" @selectTime="endDateChange" format="yyyy-MM" value_format="yyyy-MM"></datePicker>
+            </div>
+          </div>
+        </div>
+        <div style="display:flex;justify-content: left;margin-top: 1.042vw">
+          <PieCharts ref="proTypRef" height="10.844vw" width="12.125vw" h-chart="9.633vw" w-chart="10.125vw" title="项目类型分析"></PieCharts>
+          <PieCharts ref="proFowRef" height="10.844vw" width="11.125vw" h-chart="9.633vw" w-chart="10.125vw" title="项目跟进情况"></PieCharts>
+          <PieCharts ref="cusFowRef" height="10.844vw" width="11.125vw" h-chart="9.633vw" w-chart="10.125vw" title="客户跟进情况"></PieCharts>
+        </div>
       </template>
     </borderTemplate>
   </div>
@@ -40,12 +64,15 @@
 <script>
 import borderTemplate from '../components/borderTemplate'
 import profileTemplate from "../components/profileTemplate";
+import datePicker from "../components/datePicker";
+import PieCharts from "../components/PieCharts";
 export default {
   name: "dataProfile",
-  components:{borderTemplate,profileTemplate},
+  components:{borderTemplate,profileTemplate,datePicker,PieCharts},
   data(){
     return {
       typeSelect:'线索',
+      dateType:'本年',
       param:{
         id:20231014114204,
         content:{
@@ -304,6 +331,40 @@ export default {
       }
       this.listData()
     },
+    dateTypeChange(){
+      if (this.dateType == '本年'){
+        let currentDate = new Date(); // 获取当前日期
+        let startDate = new Date(currentDate.getFullYear(), currentDate.getMonth()) // 计算起始日期
+        let endDate = currentDate.getFullYear() +'-' + 12 // 计算起始日期
+        this.$refs.startRef.value = startDate
+        this.$refs.endRef.value = endDate
+      }else {
+        this.$refs.startRef.value = ''
+        this.$refs.endRef.value = ''
+      }
+      this.$refs.proTypRef.param.content.dateType = this.dateType
+      this.$refs.proTypRef.typeInit(null,'项目类型分析')
+      this.$refs.proFowRef.param.content.dateType = this.dateType
+      this.$refs.proFowRef.typeInit(null,'项目跟进情况')
+      this.$refs.cusFowRef.param.content.dateType = this.dateType
+      this.$refs.cusFowRef.typeInit(null,'客户跟进情况')
+    },
+    begDateChange(val){
+      this.$refs.proTypRef.param.content.where.begdate = val
+      this.$refs.proTypRef.typeInit(null,'项目类型分析')
+      this.$refs.proFowRef.param.content.where.begdate = val
+      this.$refs.proFowRef.typeInit(null,'项目跟进情况')
+      this.$refs.cusFowRef.param.content.where.begdate = val
+      this.$refs.cusFowRef.typeInit(null,'客户跟进情况')
+    },
+    endDateChange(val){
+      this.$refs.proTypRef.param.content.where.begdate = val
+      this.$refs.proTypRef.typeInit(null,'项目类型分析')
+      this.$refs.proFowRef.param.content.where.begdate = val
+      this.$refs.proFowRef.typeInit(null,'项目跟进情况')
+      this.$refs.cusFowRef.param.content.where.begdate = val
+      this.$refs.cusFowRef.typeInit(null,'客户跟进情况')
+    }
   }
 }
 </script>
@@ -341,6 +402,40 @@ export default {
   text-transform: none;
   text-align: center;
 }
+.line-style{
+  width: 0.000vw;
+  height: 0.625vw;
+  border: 0.052vw solid #CFDCE5;
+  margin: auto;
+}
+.bottom_justify{
+  display: flex;
+  justify-content: space-between;
+  margin-top: 1.042vw;
+}
+.bottom_justify .title_font{
+  font-family: Microsoft YaHei, Microsoft YaHei;
+  font-weight: bold;
+  font-size: 0.833vw;
+  color: #E6F4FF;
+  text-align: left;
+  font-style: normal;
+  text-transform: none;
+}
+.bottom_justify .title_right{
+  display: flex;
+  justify-content: left;
+}
+.title_right .title_right_font{
+  font-family: Microsoft YaHei, Microsoft YaHei;
+  font-weight: 400;
+  font-size: 0.625vw;
+  color: #E6F4FF;
+  text-align: left;
+  font-style: normal;
+  text-transform: none;
+  margin: auto;
+}
 </style>
 <style  scoped>
  /deep/ .el-button--primary:focus, .el-button--primary:hover {

+ 115 - 2
src/HManagement/serviceDataScreen/modules/marketingExpenseStatistics.vue

@@ -1,14 +1,127 @@
 <template>
   <div>
-    <borderTemplate borderBox="width: 17.083vw;height: 12.500vw;" title="营销费用统计" detailTitle="查看详情"></borderTemplate>
+    <borderTemplate borderBox="width: 17.083vw;height: 12.500vw;" title="营销费用统计" detailTitle="查看详情">
+      <template slot="content">
+        <div>
+          <div style="display: flex;justify-content: right">
+            <el-select v-model="param.content.dateType"  class="inline-16" size="small" @change="typeInit(false)" :popper-append-to-body="false">
+              <el-option :label="$t('全部')" value="全部"></el-option>
+              <el-option :label="$t('本年')" value="本年"></el-option>
+            </el-select>
+          </div>
+          <div style="width: 15.125vw;height: 7.233vw;margin-top: 0.464vw;position: relative" ref="expenseRefChar">
+<!--            <el-button style="position: absolute;left: 90px;top: 90px" type="text" size="mini">切换{{btnTitle}}</el-button>-->
+          </div>
+        </div>
+      </template>
+    </borderTemplate>
   </div>
 </template>
 
 <script>
 import borderTemplate from '../components/borderTemplate'
+import {Pie} from "@antv/g2plot";
 export default {
   name: "marketingExpenseStatistics",
-  components:{borderTemplate}
+  components:{borderTemplate},
+  data(){
+    return {
+      dateType:'全部',
+      btnTitle:'客户',
+      param:{
+        id:2024062615133802,
+        content:{
+          dataid:'',
+          dateType:'全部',
+          ownertable:'sa_customers',
+          type:'',
+          where:{
+            isleave:'1',
+          }
+        }
+      },
+      mapData:'',
+      typeMap:''
+    }
+  },
+  methods:{
+    async typeInit(init){
+      if (this.btnTitle == '项目'){
+        this.param.id = 2024062915152702
+        this.param.content.ownertable = 'sa_project'
+      }else if (this.btnTitle == '客户'){
+        this.param.id = 2024062615133802
+        this.param.content.ownertable = 'sa_customers'
+      }
+      let res = await this.$api.requested(this.param)
+      // this.mapData = res.data[0].ratio
+      this.mapData = res.data[0].ratio.map(item=>{
+        return {
+          "totalamount": this.totalamount,//值
+          "type": item.type,
+          "rowindex": item.rowindex,
+          "ratio": Math.round(((item.ratio * 100)*100)/100), //比例
+          "value":item.value
+        }
+      })
+      console.log('项目类型数据',this.mapData)
+      if (init) {
+        this.typeMap = new Pie(this.$refs.expenseRefChar, {
+          appendPadding: 10,
+          data:this.mapData,
+          angleField: 'ratio',
+          colorField: 'type',
+          radius: 1,
+          innerRadius: 0.79,
+          label:{
+            /*type: 'inner',
+            offset: '-50%',
+            style: {
+              textAlign: 'center',
+            },
+            autoRotate: false,*/
+            formatter: (datum) => `${datum.ratio}%`
+          },
+          tooltip:{
+            formatter: (datum) => {
+              return { name: datum.key, value: datum.ratio + '%' };
+            },
+          },
+          statistic: {
+            title: {
+              offsetY: -4,
+              style: {
+                fontSize:'16px'
+              },
+              content:this.btnTitle == '项目'?'项目营销费用':'客户营销费用'
+            },
+            content: {
+              offsetY: 4,
+              style: {
+                whiteSpace: 'pre-wrap',
+                overflow: 'hidden',
+                textOverflow: 'ellipsis',
+                fontSize:'16px'
+              },
+              customHtml: (container, view, datum, data) => {
+                const text = res.data[0].ratio[0].total
+                return text
+              },
+            },
+          },
+          legend: {
+            position:'right',
+            top:'20px'
+          },
+          // 添加 中心统计文本 交互
+          interactions: [{ type: 'element-single-selected' },{ type: 'element-active' }],
+        });
+        this.typeMap.render();
+      } else {
+        this.typeMap.changeData(this.mapData)
+      }
+    }
+  }
 }
 </script>
 

+ 130 - 14
src/HManagement/serviceDataScreen/modules/salesFunnel.vue

@@ -4,20 +4,28 @@
       <template slot="content">
         <div style="display: flex;justify-content: space-between">
           <div>
-            <el-checkbox v-model="param.content.where.unfinish">包含失败、结案项目</el-checkbox>
+            <el-checkbox v-model="param.content.where.unfinish" true-label="0" false-label="1"  @change="listData">包含失败、结案项目</el-checkbox>
           </div>
-          <div>
-            <el-select v-model="param.content.dateType"  class="inline-16" size="small" @change="listData" :popper-append-to-body="false">
-              <el-option :label="$t('全部')" value="全部"></el-option>
-              <el-option :label="$t('本年')" value="本年"></el-option>
-              <el-option :label="$t('本季')" value="本季"></el-option>
-              <el-option :label="$t('本月')" value="本月"></el-option>
-              <el-option :label="$t('去年')" value="去年"></el-option>
+          <div style="display: flex;justify-content: left">
+            <el-select v-model="param.content.dateType"  class="inline-16" size="small" @change="listData(param.content.dateType)" :popper-append-to-body="false">
+              <el-option :label="$t('全部')" value="99"></el-option>
+              <el-option :label="$t('近一年')" value="1"></el-option>
+              <el-option :label="$t('近九个月')" value="2"></el-option>
+              <el-option :label="$t('近六个月')" value="3"></el-option>
+              <el-option :label="$t('近三个月')" value="4"></el-option>
             </el-select>
+            <div class="line-style inline-16"></div>
+            <div class="inline-16">
+              <datePicker ref="startRef" type="date" @selectTime="begDateChange" format="yyyy-MM-dd" value_format="yyyy-MM-dd"></datePicker>
+            </div>
+            <div class="title-span-font inline-16">至</div>
+            <div>
+              <datePicker ref="endRef" type="date" @selectTime="endDateChange" format="yyyy-MM-dd" value_format="yyyy-MM-dd"></datePicker>
+            </div>
           </div>
         </div>
         <div>
-          <funnelBox style="margin-top: 0.625vw;" v-for="(item,index) in colorSet"  :key="item.index" :width="width - (index * 1.042)" :background="item"></funnelBox>
+          <funnelBox style="margin-top: 0.625vw;" v-for="(item,index) in list"  :key="item.index" :width="width - (index * 1.042)" :data="item"></funnelBox>
         </div>
       </template>
     </borderTemplate>
@@ -27,20 +35,23 @@
 <script>
 import borderTemplate from '../components/borderTemplate'
 import funnelBox from "../components/funnelBox";
+import datePicker from "../components/datePicker";
 export default {
   name: "salesFunnel",
-  components:{borderTemplate,funnelBox},
+  components:{borderTemplate,funnelBox,datePicker},
   data(){
     return {
       param:{
         id:20230630151504,
         content:{
           dataid:'',
-          dateType:'',
+          dateType:'99',
           type:"",
           where:{
             isleave:'1',
-            unfinish:''
+            unfinish:'1',
+            begdate:"",
+            enddate:"",
           }
         }
       },
@@ -50,14 +61,119 @@ export default {
     }
   },
   methods:{
-    async listData(){
+    async listData(val){
       const res = await this.$api.requested(this.param)
-      this.list = res.data
+      this.list = []
+      this.list = res.data.map((item,index)=>{
+        return{
+          "stagename":item.stagename,
+          "color":this.colorSet[index],
+          "dealamount":item.dealamount,
+          "signamount_due":item.signamount_due,
+          "projectqty":item.projectqty,
+          "sequence1":item.sequence1,
+          "zhl":item.zhl? Math.round((item.zhl * 100)*100)/100 + '%':'--'
+        }
+      })
+      this.list.pop()
+      if (val) {
+        this.dataChange(val)
+      }
+    },
+    dataChange(val){
+      if (val == '1'){
+        let currentDate = new Date(); // 获取当前日期
+        let startDate = new Date(currentDate.getFullYear() - 1, currentDate.getMonth(), currentDate.getDate() + 1); // 计算起始日期
+        let endDate = currentDate; // 结束日期为当前日期
+        // this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
+        this.$refs.startRef.value = startDate.toISOString().split('T')[0]
+        this.$refs.endRef.value = endDate.toISOString().split('T')[0]
+      }else if (val == '2'){
+        let currentDate = new Date(); // 获取当前日期
+        let startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 9, currentDate.getDate() + 1); // 计算起始日期
+        let endDate = currentDate; // 结束日期为当前日期
+        // this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
+        this.$refs.startRef.value = startDate.toISOString().split('T')[0]
+        this.$refs.endRef.value = endDate.toISOString().split('T')[0]
+      }else if (val == '3'){
+        let currentDate = new Date(); // 获取当前日期
+        let startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 6, currentDate.getDate() + 1); // 计算起始日期
+        let endDate = currentDate; // 结束日期为当前日期
+        // this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
+        this.$refs.startRef.value = startDate.toISOString().split('T')[0]
+        this.$refs.endRef.value = endDate.toISOString().split('T')[0]
+      }else if (val == '4'){
+        let currentDate = new Date(); // 获取当前日期
+        let startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 3, currentDate.getDate() + 1); // 计算起始日期
+        let endDate = currentDate; // 结束日期为当前日期
+        // this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
+        this.$refs.startRef.value = startDate.toISOString().split('T')[0]
+        this.$refs.endRef.value = endDate.toISOString().split('T')[0]
+      }else if (val == '99'){
+        // this.dateSelect = []
+        this.$refs.startRef.value = ''
+        this.$refs.endRef.value = ''
+      }
+    },
+    begDateChange(val){
+      this.param.content.dateType = ''
+      this.param.content.where.begdate = val
+      this.listData()
+    },
+    endDateChange(val){
+      this.param.content.dateType = ''
+      this.param.content.where.enddate = val
+      this.listData()
     }
   }
 }
 </script>
 
 <style scoped>
+.line-style{
+  width: 0.000vw;
+  height: 0.625vw;
+  border: 0.052vw solid #CFDCE5;
+  line-height: 0.625vw;
+  vertical-align: middle;
+  margin: auto;
+}
+.title-span-font{
+  font-family: Microsoft YaHei, Microsoft YaHei;
+  font-weight: 400;
+  font-size: 0.625vw;
+  color: #E6F4FF;
+  text-align: left;
+  font-style: normal;
+  text-transform: none;
+  margin: auto;
+}
+/deep/ .el-checkbox__label {
+  display: inline-block;
+  padding-left: 0.521vw;
+  line-height: 0.990vw;
+  font-family: Microsoft YaHei, Microsoft YaHei;
+  font-weight: 400;
+  font-size: 0.729vw;
+  color: #E6F4FF;
+  text-align: left;
+  font-style: normal;
+  text-transform: none;
+}
+/deep/ .el-checkbox__input.is-checked+.el-checkbox__label {
+  color: #E6F4FF;
+}
+/*/deep/ .el-checkbox__inner {*/
+/*  display: inline-block;*/
+/*  position: relative;*/
+/*  border: 1px solid #dcdfe6;*/
+/*  border-radius: 2px;*/
+/*  box-sizing: border-box;*/
+/*  width: 24px;*/
+/*  height: 24px;*/
+/*  background-color: #fff;*/
+/*  z-index: 1;*/
+/*  transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);*/
+/*}*/
 
 </style>