qymljy 11 months ago
parent
commit
aa9b26f23d

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

@@ -8,6 +8,7 @@
         :format="format"
         :append-to-body="false"
         :clearable="false"
+        style="z-index: 999"
         placeholder="选择日期">
     </el-date-picker>
   </div>

+ 5 - 3
src/HManagement/serviceDataScreen/index.vue

@@ -41,10 +41,10 @@
         </div>
         <div class="inline-top-20">
           <!-- 销售面板 -->
-          <salesPanel ref="panelRef"></salesPanel>
+          <salesPanel style="z-index: 99;position: absolute" ref="panelRef"></salesPanel>
         </div>
       </div>
-      <div>
+      <div style="z-index: 10">
         <!-- 销售漏斗 -->
         <salesFunnel ref="funnelRef"></salesFunnel>
         <div class="justify-style inline-top-20">
@@ -281,7 +281,9 @@ export default {
       this.$refs.panelRef.paramChart.content.dataid = id
       this.$refs.panelRef.paramChart.content.type = this.departmentid !== ''?1:0
       this.$refs.panelRef.paramChart.content.where.isleave = this.isleave
-      this.$refs.panelRef.listData()
+      let year = new Date().getFullYear()
+      this.$refs.panelRef.$refs.pickerRef.value = String(year)
+      this.$refs.panelRef.listData(true)
 
       /*销售漏斗*/
       this.$refs.funnelRef.param.content.dataid = id

+ 7 - 4
src/HManagement/serviceDataScreen/modules/marketingExpenseStatistics.vue

@@ -4,6 +4,7 @@
       <template slot="content">
         <div>
           <div style="display: flex;justify-content: right">
+            <el-button  type="text" class="inline-16" @click="btnTitle == '客户'?btnTitle = '项目':btnTitle ='客户';typeInit(false)">切换{{btnTitle}}</el-button>
             <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>
@@ -27,7 +28,7 @@ export default {
   data(){
     return {
       dateType:'全部',
-      btnTitle:'客户',
+      btnTitle:'项目',
       param:{
         id:2024062615133802,
         content:{
@@ -46,10 +47,10 @@ export default {
   },
   methods:{
     async typeInit(init){
-      if (this.btnTitle == '项目'){
+      if (this.btnTitle == '客户'){
         this.param.id = 2024062915152702
         this.param.content.ownertable = 'sa_project'
-      }else if (this.btnTitle == '客户'){
+      }else if (this.btnTitle == '项目'){
         this.param.id = 2024062615133802
         this.param.content.ownertable = 'sa_customers'
       }
@@ -65,7 +66,9 @@ export default {
         }
       })
       console.log('项目类型数据',this.mapData)
+      let content = this.btnTitle == '项目'?'客户营销费用':'项目营销费用'
       if (init) {
+        console.log('11111ce')
         this.typeMap = new Pie(this.$refs.expenseRefChar, {
           appendPadding: 10,
           data:this.mapData,
@@ -93,7 +96,7 @@ export default {
               style: {
                 fontSize:'16px'
               },
-              content:this.btnTitle == '项目'?'项目营销费用':'客户营销费用'
+              content:content
             },
             content: {
               offsetY: 4,

+ 27 - 6
src/HManagement/serviceDataScreen/modules/salesPanel.vue

@@ -22,7 +22,7 @@
             </div>
           </div>
           <div>
-            <el-select v-model="param.content.dateType" class="inline-16" size="small" @change="listData" :popper-append-to-body="false">
+            <el-select v-model="param.content.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-option :label="$t('本季')" value="本季"></el-option>
@@ -97,8 +97,11 @@
             </div>
           </div>
         </div>
-        <div>
-          <div id="salesPanelChart"></div>
+        <div style="margin-top: 1.042vw">
+          <div style="display:flex;justify-content: right">
+            <datePicker ref="pickerRef" type="year" @selectTime="pickerChange" format="yyyy" value_format="yyyy"></datePicker>
+          </div>
+          <div id="salesPanelChart" style="height: 14.5vw"></div>
         </div>
       </template>
     </borderTemplate>
@@ -108,9 +111,10 @@
 <script>
 import borderTemplate from '../components/borderTemplate'
 import {DualAxes} from "@antv/g2plot";
+import datePicker from "../components/datePicker";
 export default {
   name: "salesPanel",
-  components:{borderTemplate},
+  components:{borderTemplate,datePicker},
   data(){
     return {
       typeSelect:'订单',
@@ -148,26 +152,43 @@ export default {
     }
   },
   methods:{
-    async listData(){
+    async listData(init,time){
       const res = await this.$api.requested(this.param)
       this.list = res.data
       this.percentage = Math.round(this.list.wcamount * 100 * 100) / 100;
       console.log(this.list,'销售看板')
-      this.renderPie()
+      if (init){
+        this.renderPie()
+      }else {
+        if (time){
+          this.queryModel()
+        }
+      }
+    },
+    dateTypeChange(){
+      this.listData(false,false)
+    },
+    pickerChange(val){
+      this.paramChart.content.year = val
+      this.listData(false,true)
     },
     typeChange(val){
       if (val == '订单'){
         this.typeSelect = '订单'
         this.param.content.datatype = 1
+        this.paramChart.content.datatype = 1
       }else if (val == '出货'){
         this.typeSelect = '出货'
         this.param.content.datatype = 2
+        this.paramChart.content.datatype = 2
       }else if (val == '开票'){
         this.typeSelect = '开票'
         this.param.content.datatype = 3
+        this.paramChart.content.datatype = 3
       }else if (val == '回款'){
         this.typeSelect = '回款'
         this.param.content.datatype = 4
+        this.paramChart.content.datatype = 4
       }
       this.listData()
     },