Ver código fonte

跟进分析

xiaohaizhao 6 meses atrás
pai
commit
63bab37569

+ 9 - 1
salesPanel/dataOverview/Client/followUpAnalysis.js → salesPanel/dataOverview/Clue/followUpAnalysis.js

@@ -1,6 +1,11 @@
 const _Http = getApp().globalData.http;
 import * as echarts from '../../ec-canvas/echarts';
 Component({
+    properties: {
+        idname: {
+            type: [String, Number]
+        }
+    },
     options: {
         addGlobalClass: true
     },
@@ -34,7 +39,7 @@ Component({
             content.where.isleave = isleave;
 
             _Http.basic({
-                "id": 20231017152704,
+                "id": this.data.idname,
                 content
             }).then(res => {
                 if (res.code != '1') return wx.showToast({
@@ -48,6 +53,9 @@ Component({
             console.log("data", data)
             const colors = ['#6CD2A1', '#5F9DFC', '#ECB937', '#F69240'],
                 getMapText = getApp().globalData.Language.getMapText;
+
+            data.followup = data.followup || data.histogram;
+            data.tbzzl = data.tbzzl || data.lineChart;
             let legend = [getMapText('去年同期跟进'), getMapText('本期跟进'), `${getMapText('同比增长率')}`],
                 series = [{
                         name: getMapText('去年同期跟进'),

+ 0 - 0
salesPanel/dataOverview/Client/followUpAnalysis.json → salesPanel/dataOverview/Clue/followUpAnalysis.json


+ 0 - 0
salesPanel/dataOverview/Client/followUpAnalysis.scss → salesPanel/dataOverview/Clue/followUpAnalysis.scss


+ 0 - 0
salesPanel/dataOverview/Client/followUpAnalysis.wxml → salesPanel/dataOverview/Clue/followUpAnalysis.wxml


+ 0 - 170
salesPanel/dataOverview/Project/followUpAnalysis.js

@@ -1,170 +0,0 @@
-const _Http = getApp().globalData.http;
-import * as echarts from '../../ec-canvas/echarts';
-Component({
-    options: {
-        addGlobalClass: true
-    },
-    lifetimes: {
-        attached: function () {
-            getApp().globalData.Language.getLanguagePackage(this)
-        }
-    },
-    data: {
-        year: new Date().getFullYear().toString(),
-        "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
-            enddate: new Date().toISOString().split('T')[0],
-            where: {}
-        }
-    },
-    methods: {
-        async getList(init = false) {
-            let content = this.data.content
-            const {
-                dataid,
-                type,
-                username,
-                isleave
-            } = getCurrentPages()[getCurrentPages().length - 1].data;
-            if (content.dataid != dataid || content.type != type || isleave != isleave) init = true
-            content.dataid = dataid;
-            content.type = type;
-            content.username = username;
-            content.where.isleave = isleave;
-
-            _Http.basic({
-                "id": 20231018163004,
-                content
-            }).then(res => {
-                if (res.code != '1') return wx.showToast({
-                    title: res.data,
-                    icon: "none"
-                })
-                this.initChart(res.data)
-            })
-        },
-        initChart(data) {
-            console.log("data", data)
-            const colors = ['#6CD2A1', '#5F9DFC', '#ECB937', '#F69240'],
-                getMapText = getApp().globalData.Language.getMapText;
-            let legend = [getMapText('去年同期跟进'), getMapText('本期跟进'), `${getMapText('同比增长率')}`],
-                series = [{
-                        name: getMapText('去年同期跟进'),
-                        type: 'bar',
-                        data: data.followup.filter(v => v.key == '去年同期跟进').map(v => v.value),
-                        smooth: true
-                    },
-                    {
-                        name: getMapText('本期跟进'),
-                        type: 'bar',
-                        yAxisIndex: 1,
-                        data: data.followup.filter(v => v.key == '本期跟进').map(v => v.value),
-                        smooth: true
-                    },
-                    {
-                        name: getMapText('同比增长率'),
-                        type: 'line',
-                        yAxisIndex: 2,
-                        data: data.tbzzl.map(v => v.value),
-                        smooth: true
-                    }
-                ]
-            const option = {
-                color: colors,
-                tooltip: {
-                    trigger: 'axis',
-                    confine: true, // Ensure tooltip stays within the chart area
-                    formatter: function (params) {
-                        let tooltipText = '';
-                        params.forEach((item, index) => {
-                            tooltipText += `${index==0?item.axisValue+'\n':''}${item.marker}${item.seriesName}: ${item.value}${item.seriesName == getMapText('同比增长率')||item.seriesName == getMapText('准交率') ? '%' : ''}\n`;
-                        });
-                        return tooltipText;
-                    },
-                    textStyle: {
-                        fontSize: 10, // Reduced font size
-                        lineHeight: 14 // Adjusted line height for smaller tooltip height
-                    }
-                },
-                legend: {
-                    data: legend
-                },
-                xAxis: [{
-                    type: 'category',
-                    axisTick: {
-                        alignWithLabel: true
-                    },
-                    data: data.tbzzl.map(v => v.date),
-                    axisLabel: {
-                        interval: 0,
-                        rotate: 45
-                    }
-                }],
-                yAxis: [{
-                        type: 'value',
-                        name: '',
-                        position: 'right',
-                        offset: 80,
-                        alignTicks: true,
-                        axisLine: {
-                            show: true,
-                        },
-                        axisLabel: {
-                            formatter: '{value}'
-                        }
-                    },
-                    {
-                        type: 'value',
-                        name: '',
-                        position: 'left',
-                        alignTicks: true,
-                        axisLine: {
-                            show: false,
-                        },
-                        axisLabel: {
-                            formatter: '{value}',
-                            rotate: 45
-                        }
-                    },
-                    {
-                        type: 'value',
-                        name: '',
-                        position: 'right',
-                        alignTicks: true,
-                        offset: 80,
-                        axisLine: {
-                            show: false,
-                            lineStyle: {
-                                color: colors[1]
-                            }
-                        },
-                        axisLabel: {
-                            formatter: '{value}'
-                        }
-                    },
-
-                ],
-                series
-            };
-            this.chartComponent = this.selectComponent('#mychart');
-            this.chartComponent.init((canvas, width, height, dpr) => {
-                const chart = echarts.init(canvas, null, {
-                    width,
-                    height,
-                    devicePixelRatio: dpr
-                });
-                chart.setOption(option);
-                return chart;
-            });
-        },
-        changeDate({
-            detail
-        }) {
-            this.setData({
-                "content.enddate": detail
-            })
-            this.getList(true)
-        },
-    }
-})

+ 0 - 6
salesPanel/dataOverview/Project/followUpAnalysis.json

@@ -1,6 +0,0 @@
-{
-    "component": true,
-    "usingComponents": {
-        "ec-canvas": "../../ec-canvas/ec-canvas"
-    }
-}

+ 0 - 7
salesPanel/dataOverview/Project/followUpAnalysis.scss

@@ -1,7 +0,0 @@
-@import "../../customerBlance/index.scss";
-
-.chart2 {
-	ec-canvas {
-		top: -590rpx;
-	}
-}

+ 0 - 7
salesPanel/dataOverview/Project/followUpAnalysis.wxml

@@ -1,7 +0,0 @@
-<viewDate title='分析日期' bind:onChange='changeDate' />
-<view class="global-card">
-	<view class="chart"></view>
-</view>
-<view class="chart2">
-	<ec-canvas id="mychart" canvas-id="chart" ec="{{ ec }}"></ec-canvas>
-</view>

+ 3 - 0
salesPanel/dataOverview/list/Clue.js

@@ -21,6 +21,9 @@ Component({
         }, {
             label: "近12月线索新增分析",
             model: "#NewAnalysisAdded"
+        }, {
+            label: "近12月线索跟进分析",
+            model: "#followUpAnalysis"
         }, {
             label: "近12月线索转化分析",
             model: "#AnalysisOfLeadConversion"

+ 2 - 1
salesPanel/dataOverview/list/Clue.json

@@ -3,6 +3,7 @@
     "usingComponents": {
         "DataOverview": "../Clue/dataOverview",
         "AnalysisOfLeadConversion": "../Clue/AnalysisOfLeadConversion",
-        "NewAnalysisAdded": "../Clue/NewAnalysisAdded"
+        "NewAnalysisAdded": "../Clue/NewAnalysisAdded",
+        "followUpAnalysis": "../Clue/followUpAnalysis"
     }
 }

+ 1 - 1
salesPanel/dataOverview/list/Clue.wxml

@@ -2,6 +2,6 @@
     <DataOverview slot='数据概况' id='DataOverview' />
     <NewAnalysisAdded  slot='近12月线索新增分析' id='NewAnalysisAdded' />
     <AnalysisOfLeadConversion  slot='近12月线索转化分析' id='AnalysisOfLeadConversion' />
-
+    <followUpAnalysis slot='近12月线索跟进分析' idname='20231015124504' id='followUpAnalysis' />
     
 </Yl_FunTabs>

+ 1 - 1
salesPanel/dataOverview/list/Project.json

@@ -3,6 +3,6 @@
     "usingComponents": {
         "DataOverview": "../Project/dataOverview",
         "ProjectQuotationQuantity": "../Project/ProjectQuotationQuantity",
-        "followUpAnalysis": "../Project/followUpAnalysis"
+        "followUpAnalysis": "../Clue/followUpAnalysis"
     }
 }

+ 1 - 1
salesPanel/dataOverview/list/Project.wxml

@@ -1,5 +1,5 @@
 <Yl_FunTabs id='Yl_FunTabs' safety='{{false}}' list='{{tabsList}}' mode='buts' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <DataOverview slot='数据概况' id='DataOverview' />
     <ProjectQuotationQuantity slot='近12月项目报价分析' id='ProjectQuotationQuantity' />
-    <followUpAnalysis slot='近12月项目跟进分析' id='followUpAnalysis' />
+    <followUpAnalysis slot='近12月项目跟进分析' idname='20231018163004' id='followUpAnalysis' />
 </Yl_FunTabs>

+ 1 - 1
salesPanel/dataOverview/list/client.json

@@ -3,6 +3,6 @@
     "usingComponents": {
         "DataOverview": "../Client/dataOverview",
         "ClientQuotationQuantity": "../Client/ClientQuotationQuantity",
-        "followUpAnalysis": "../Client/followUpAnalysis"
+        "followUpAnalysis": "../Clue/followUpAnalysis"
     }
 }

+ 1 - 1
salesPanel/dataOverview/list/client.wxml

@@ -1,5 +1,5 @@
 <Yl_FunTabs id='Yl_FunTabs' safety='{{false}}' list='{{tabsList}}' mode='buts' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <DataOverview slot='数据概况' id='DataOverview' />
     <ClientQuotationQuantity slot='近12月客户报价分析' id='ClientQuotationQuantity' />
-    <followUpAnalysis slot='近12月客户跟进分析' id='followUpAnalysis' />
+    <followUpAnalysis slot='近12月客户跟进分析' idname='20231017152704' id='followUpAnalysis' />
 </Yl_FunTabs>