Przeglądaj źródła

近12月出货未开票金额趋势分析

xiaohaizhao 11 miesięcy temu
rodzic
commit
8c18c19c83

+ 9 - 2
project.private.config.json

@@ -11,11 +11,18 @@
         "miniprogram": {
             "list": [
                 {
-                    "name": "数据总揽",
-                    "pathName": "salesPanel/dataOverview/index",
+                    "name": "salesPanel/index/index",
+                    "pathName": "salesPanel/index/index",
                     "query": "",
                     "scene": null,
                     "launchMode": "default"
+                },
+                {
+                    "name": "数据总揽",
+                    "pathName": "salesPanel/dataOverview/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
                 }
             ]
         }

+ 175 - 0
salesPanel/GoodsDispatchedButInvoiceNotIssued/index.js

@@ -0,0 +1,175 @@
+const _Http = getApp().globalData.http,
+    currency = require("../../utils/currency"),
+    CNY = (value, symbol = "¥", precision = 2) => currency(value, {
+        symbol,
+        precision
+    }).format();
+
+import * as echarts from '../ec-canvas/echarts';
+Component({
+    properties: {
+
+    },
+    options: {
+        addGlobalClass: true
+    },
+    lifetimes: {
+        attached: function () {
+            getApp().globalData.Language.getLanguagePackage(this)
+        }
+    },
+    data: {
+        "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": 20231016122504,
+                content
+            }).then(res => {
+                console.log("近12月出货未开票金额趋势分析", res)
+                if (res.code != '1') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                })
+                this.initChart(res.data)
+            })
+        },
+        initChart(data) {
+            console.log("data", data)
+            let dividend = wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000,
+                getMapText = getApp().globalData.Language.getMapText,
+                list = [{
+                    name: "0-3月出货未开票金额(万元)",
+                    key: 'zerotothree',
+                    color: "#6395F9"
+                }, {
+                    name: "3-6月出货未开票金额(万元)",
+                    key: 'threetosix',
+                    color: "#62DAAB"
+                }, {
+                    name: "6-12月出货未开票金额(万元)",
+                    key: 'sixtotwelve',
+                    color: "#657797"
+                }, {
+                    name: "一年以上出货未开票金额(万元)",
+                    key: 'twelveup',
+                    color: "#F6C022"
+                }];
+
+            // Format data values to keep two decimal places
+            data = data.map(item => {
+                let formattedItem = {
+                    ...item
+                };
+                list.forEach(v => {
+                    formattedItem[v.key] = (formattedItem[v.key]).toFixed(2);
+                });
+                return formattedItem;
+            });
+            const option = {
+                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('同比增长率') ? '%' : ''}\n`;
+                        });
+                        return tooltipText;
+                    },
+                    textStyle: {
+                        fontSize: 10, // Reduced font size
+                        // Adjusted line height for smaller tooltip height
+                    }
+                },
+                legend: {
+                    data: list.map(v => getMapText(v.name)),
+                    top: '0rpx', // Moved legend position upwards by 10rpx
+                    textStyle: {
+                        fontSize: 12 // Reduced font size for legend text
+                    }
+                },
+                grid: {
+                    top: '32%', // Adjust grid top to leave space for the legend
+                    left: '3%',
+                    right: '4%',
+                    bottom: '3%',
+                    containLabel: true
+                },
+                xAxis: {
+                    type: 'category',
+                    boundaryGap: false,
+                    data: data.map(v => v.date),
+                    axisLabel: {
+                        interval: 0, // Force display all labels
+                        rotate: 45, // Rotate labels to prevent overlap
+                        fontSize: 10 // Reduced font size for X-axis labels
+                    }
+                },
+                yAxis: {
+                    type: 'value',
+                    axisLabel: {
+                        fontSize: 10 // Reduced font size for Y-axis labels
+                    }
+                },
+                series: list.map(v => {
+                    return {
+                        name: getMapText(v.name),
+                        type: 'line',
+                        stack: 'Total',
+                        data: data.map(obj => obj[v.key]),
+                        itemStyle: {
+                            color: v.color
+                        },
+                        lineStyle: {
+                            color: v.color
+                        }
+                    }
+                })
+            };
+            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)
+        },
+        showExplain(e) {
+            const {
+                name
+            } = e.currentTarget.dataset;
+            getApp().globalData.Language.modeBoxPrompts(getApp().globalData.Language.getMapText('统计到当前查询时间为止的') + name + "(" + getApp().globalData.Language.getMapText('审核状态') + ")")
+        },
+    }
+})

+ 6 - 0
salesPanel/GoodsDispatchedButInvoiceNotIssued/index.json

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

+ 19 - 0
salesPanel/GoodsDispatchedButInvoiceNotIssued/index.scss

@@ -0,0 +1,19 @@
+@import "../customerBlance/index.scss";
+
+.chart {
+	height: 630rpx;
+	width: 100vw;
+}
+
+.chart2 {
+	position: relative;
+
+	ec-canvas {
+		position: absolute;
+		top: -670rpx;
+		width: 700rpx;
+		height: 630rpx;
+		z-index: 2;
+		right: 20rpx;
+	}
+}

+ 7 - 0
salesPanel/GoodsDispatchedButInvoiceNotIssued/index.wxml

@@ -0,0 +1,7 @@
+<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>

+ 8 - 1
salesPanel/index/index.js

@@ -44,11 +44,18 @@ Page({
         }, {
             label: "开票金额趋势分析",
             model: "#InvoiceTrendAnalysis"
+        }, {
+            label: "近12月出货未开票金额趋势分析",
+            model: "#GoodsDispatchedButInvoiceNotIssued"
         }, {
             label: "已下单未出货分析",
             model: "#ShipmentAnalysis1"
+        }, {
+            label: "出货未开票分析"
+        }, {
+            label: "财务回款分析"
         }],
-        tabsActive: 0,
+        tabsActive: 11,
         showFiltrate: false,
         dataid: wx.getStorageSync('userMsg').userid,
         username: wx.getStorageSync('userMsg').name,

+ 1 - 0
salesPanel/index/index.json

@@ -4,6 +4,7 @@
         "CustomerBlance": "../customerBlance/index",
         "biddingAnalysis": "../biddingAnalysis/index",
         "TrendAnalysis": "../trendAnalysis/index",
+        "GoodsDispatchedButInvoiceNotIssued": "../GoodsDispatchedButInvoiceNotIssued/index",
         "ShipmentAnalysis": "../shipmentAnalysis/index",
         "analysisOfOrderTypeDistribution": "../analysisOfOrderTypeDistribution/index",
         "AnalysisOfTheProportionOfProductCategoriesInOrders": "../AnalysisOfTheProportionOfProductCategoriesInOrders/index",

+ 1 - 0
salesPanel/index/index.wxml

@@ -26,6 +26,7 @@
     <ShipmentAnalysis slot="未出货已延期情况分析" mode='未出货已延期情况分析' id="ShipmentAnalysis3" />
     <analysisOfOrderTypeDistribution slot="订单类型占比分析" id="AnalysisOfOrderTypeDistribution" />
     <AnalysisOfTheProportionOfProductCategoriesInOrders slot="订单产品类别占比分析" id="AnalysisOfTheProportionOfProductCategoriesInOrders" />
+    <GoodsDispatchedButInvoiceNotIssued slot="近12月出货未开票金额趋势分析" id="GoodsDispatchedButInvoiceNotIssued" />
     <top10 slot="销售TOP10" id="Top10" />
 </Yl_FunTabs>
 <Yl_Filtrate1 id="Yl_Filtrate1" show='{{showFiltrate}}' list="{{[]}}" bindhandle="handleFilter">