xiaohaizhao 6 mēneši atpakaļ
vecāks
revīzija
fe94dd0225

+ 176 - 0
salesPanel/dataOverview/Client/situationAnalysis.js

@@ -0,0 +1,176 @@
+const _Http = getApp().globalData.http;
+
+import * as echarts from '../../ec-canvas/echarts';
+Component({
+    properties: {
+        idname: {
+            type: [String || Number]
+        }
+    },
+    options: {
+        addGlobalClass: true
+    },
+    lifetimes: {
+        attached: function () {
+            getApp().globalData.Language.getLanguagePackage(this)
+        }
+    },
+    data: {
+        dateTypes: ["全部", "本年"],
+        "content": {
+            pageNumber: 1,
+            pageTotal: 1,
+            dataid: wx.getStorageSync('userMsg').userid,
+            username: wx.getStorageSync('userMsg').name,
+            dateType: "本年",
+            type: 0,
+            where: {
+                begdate: "",
+                enddate: "",
+                isleave: "1",
+            }
+        },
+    },
+    methods: {
+        async getList(init = false) {
+            if (init.detail != undefined) init = init.detail;
+            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;
+            if (init) {
+                content.pageNumber = 1;
+                content.pageTotal = 1;
+            }
+            if (content.pageNumber > content.pageTotal) return;
+            _Http.basic({
+                "id": 20231018164504,
+                content
+            }).then(res => {
+                this.selectComponent('#ListBox').RefreshToComplete();
+                console.log('客户列表', res)
+                if (res.code != '1') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                })
+                this.setData({
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+                    "content.pageNumber": res.pageNumber + 1,
+                    "content.pageSize": res.pageSize,
+                })
+                this.selectComponent("#TimeRange").onCancel()
+
+                _Http.basic({
+                    id: this.data.idname,
+                    content
+                }).then(res1 => {
+                    console.log("图标", res1)
+                    this.initChart(res1.data, res.total);
+                })
+            })
+        },
+        initChart(data, total) {
+            const getMapText = getApp().globalData.Language.getMapText;
+            let option = {
+                tooltip: {
+                    trigger: 'item'
+                },
+                legend: {
+                    bottom: '5%', // Moved legend to the bottom
+                    left: 'center'
+                },
+                series: [{
+                    type: 'pie',
+                    radius: ['40%', '70%'],
+                    center: ['50%', '42%'], // Adjusted to align with the new legend position
+                    endAngle: 360,
+                    data: data.map(v => {
+                        return {
+                            name: getMapText(v.key),
+                            value: (v.ratio).toFixed(2),
+                        }
+                    }),
+                    label: {
+                        normal: {
+                            show: true,
+                            position: 'outside',
+                            formatter: '{b}: {c} ({d}%)',
+                            textStyle: {
+                                fontSize: 12,
+                                color: '#333'
+                            }
+                        },
+                        emphasis: {
+                            show: true,
+                            textStyle: {
+                                fontSize: 14,
+                                fontWeight: 'bold'
+                            }
+                        },
+                        rich: {
+                            total: {
+                                fontSize: 20,
+                                fontWeight: 'bold',
+                                color: '#333'
+                            },
+                            desc: {
+                                fontSize: 12,
+                                color: '#999'
+                            }
+                        }
+                    },
+                    labelLine: {
+                        normal: {
+                            show: true,
+                            length: 10,
+                            length2: 10
+                        }
+                    }
+                }]
+            };
+            option.graphic = {
+                type: 'text',
+                left: 'center',
+                top: '35%', // Adjusted to align with the new series position
+                style: {
+                    text: `${getMapText('客户总数')}\n\n${total}`,
+                    textAlign: 'center',
+                    fill: '#333',
+                    fontSize: 16,
+                    fontWeight: 'bold'
+                }
+            };
+            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;
+            });
+        },
+        toDetail(e) {
+            console.log(e)
+        },
+        changeDate({
+            detail
+        }) {
+            this.setData({
+                "content.dateType": detail.dateType,
+                "content.where.begdate": detail.begdate || "",
+                "content.where.enddate": detail.enddate || ""
+            })
+            this.getList(true)
+        }
+    }
+})

+ 6 - 0
salesPanel/dataOverview/Client/situationAnalysis.json

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

+ 2 - 0
salesPanel/dataOverview/Client/situationAnalysis.scss

@@ -0,0 +1,2 @@
+@import "../../analysisOfOrderTypeDistribution/index.scss";
+@import "../OverviewAndDetails/Client.scss";

+ 32 - 0
salesPanel/dataOverview/Client/situationAnalysis.wxml

@@ -0,0 +1,32 @@
+<timeRange id='TimeRange' dateTypes='{{dateTypes}}' dateType='{{content.dateType}}' bind:onChange='changeDate' />
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<view class="global-card" wx:if='{{!list[0].isEmpty}}'>
+		<view class="chart">
+			<ec-canvas id="mychart" canvas-id="chart" ec="{{ ec }}"></ec-canvas>
+		</view>
+	</view>
+	<My_empty wx:if='{{list[0].isEmpty}}' />
+	<block wx:else>
+		<view class="global-card item" hover-class="navigator-hover" wx:for="{{list}}" wx:key="sa_customersid" data-item="{{item}}" bind:tap="toDetail">
+			<view class="title">
+				<text class="line-1">{{item.enterprisename || " --"}}</text>
+				<view class="status" style="background-color: {{sColors[item.status]}};">{{language[item.status]||item.status}}</view>
+				<view class="status status2" style="background-color: {{sColors[item.tradingstatus]}};">{{language[item.tradingstatus]||item.tradingstatus}}</view>
+			</view>
+			<view class="tag-box">
+				<van-tag custom-class='tag' wx:for="{{item.sys_tag}}" wx:key="index" wx:for-item='tag' color='#3874f6' text-color='#fff' round>{{language[tag]||tag}}</van-tag>
+			</view>
+			<view class="row">
+				<view class="col">{{language['负责人']||'负责人'}}:{{language[item.name]||item.name||' --'}}</view>
+				<view class="col">{{language['部门']||'部门'}}:{{language[item.depname]||item.depname||' --'}}</view>
+			</view>
+			<view class="row">{{language['客户类型']||'客户类型'}}:{{language[item.type] || item.type ||' --'}}</view>
+			<view class="row">{{language['客户分类']||'客户分类'}}:{{language[item.customergrade] || item.customergrade ||' --'}}</view>
+			<view class="row">{{language['客户等级']||'客户等级'}}:{{item.grade}}</view>
+			<view class="row">{{language['上级企业']||'上级企业'}}:{{item.parententerprisename ||' --' }}</view>
+			<view class="row">{{language['来源']||'来源'}}:{{item.source||' --'}}</view>
+			<view class="row">{{language['创建时间']||'创建时间'}}:{{item.createdate ||' --'}}</view>
+		</view>
+		<My_empty wx:if="{{list.length==0}}" />
+	</block>
+</Yl_ListBox>

+ 1 - 1
salesPanel/dataOverview/OverviewAndDetails/Client.wxml

@@ -14,7 +14,7 @@
 </view>
 <view style="height: 20rpx;" />
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
-	<view class="global-card item" wx:for="{{list}}" wx:key="sa_orderitemsid">
+	<view class="global-card item" wx:for="{{list}}" wx:key="sa_customersid">
 		<view class="title">
 			<text class="line-1">{{item.enterprisename || " --"}}</text>
 			<view class="status" style="background-color: {{sColors[item.status]}};">{{language[item.status]||item.status}}</view>

+ 1 - 1
salesPanel/dataOverview/OverviewAndDetails/Costs.wxml

@@ -14,7 +14,7 @@
 </view>
 <view style="height: 20rpx;" />
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
-	<view class="global-card item" wx:for="{{list}}" wx:key="sa_orderitemsid">
+	<view class="global-card item" wx:for="{{list}}" wx:key="sa_salesfeesid">
 		<view class="title">
 			<text class="line-1">{{item.billno || " --"}}</text>
 		</view>

+ 1 - 1
salesPanel/dataOverview/OverviewAndDetails/project.wxml

@@ -14,7 +14,7 @@
 </view>
 <view style="height: 20rpx;" />
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
-	<view class="global-card item" wx:for="{{list}}" wx:key="sa_orderitemsid">
+	<view class="global-card item" wx:for="{{list}}" wx:key="sa_projectid">
 		<view class="title">
 			<text class="line-1">{{item.projectname || " --"}}</text>
 			<view class="status" style="background-color: {{sColors[item.status]}};">{{language[item.status]||item.status}}</view>

+ 12 - 0
salesPanel/dataOverview/list/client.js

@@ -28,6 +28,18 @@ Component({
         }, {
             label: "近12月客户新增分析",
             model: "#NewAnalysisAdded"
+        }, {
+            label: "客户类型情况统计",
+            model: "#ClientType"
+        }, {
+            label: "客户联系人情况统计",
+            model: "#CustomerContactPerson"
+        }, {
+            label: "客户关联项目情况统计",
+            model: "#CustomerRelatedProject"
+        }, {
+            label: "客户跟进情况统计",
+            model: "#ClientFollowUp"
         }],
         init: false
     },

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

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

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

@@ -3,4 +3,13 @@
     <ClientQuotationQuantity slot='近12月客户报价分析' id='ClientQuotationQuantity' />
     <followUpAnalysis slot='近12月客户跟进分析' idname='20231017152704' id='followUpAnalysis' />
     <NewAnalysisAdded slot='近12月客户新增分析' idname='20231015202504' id='NewAnalysisAdded' />
-</Yl_FunTabs>
+    <SituationAnalysis slot='客户类型情况统计' idname='20231015203704' id='ClientType' />
+    <SituationAnalysis slot='客户联系人情况统计' idname='20231017141904' id='CustomerContactPerson' />
+    <SituationAnalysis slot='客户关联项目情况统计' idname='20231017143504' id='CustomerRelatedProject' />
+    <SituationAnalysis slot='客户跟进情况统计' idname='20231017151304' id='ClientFollowUp' />
+</Yl_FunTabs>
+
+<!-- //20231018164504 20231015203704
+//20231018164504 20231017141904
+//20231018164504 20231017143504
+//20231018164504 20231017151304 -->