Bladeren bron

项目预计成交统计

xiaohaizhao 1 jaar geleden
bovenliggende
commit
fa091ec3f0

+ 27 - 5
packageA/salesHourglass/index.js

@@ -16,8 +16,8 @@ const _Http = getApp().globalData.http,
             }
         } else if (length <= 8) {
             return { //万-千万
-                
-                show: CNY(currency(n).divide(wx.getStorageSync('languagecode')=='ZH' ? 10000 : 1000)).replace(regexp, '$1') + getApp().globalData.Language.getMapText('万元'),
+
+                show: CNY(currency(n).divide(wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000)).replace(regexp, '$1') + getApp().globalData.Language.getMapText('万元'),
                 value: CNY(n)
             }
         } else {
@@ -103,7 +103,13 @@ Page({
                 id: 4,
                 queryMonths: 3
             }]
-        }]
+        }],
+        firstTwelveMonths: {
+            dealaccuracyrate: '0%',
+            totaldealamount: 0,
+            totaldeviationamount: 0,
+            totalsignamount_due: 0
+        }
     },
     onLoad(options) {
         _Http.basic({
@@ -138,7 +144,7 @@ Page({
     onReady() {
         this.setChartData();
         this.selectComponent("#organization").setData({
-            isleave:1
+            isleave: 1
         })
         this.selectComponent("#organization").initDepAndUser();
         // this.selectComponent("#Yl_Filtrate1").queryMonths(12)
@@ -160,7 +166,7 @@ Page({
     }) {
         if (detail.name == 'reset') {
             this.selectComponent("#organization").setData({
-                isleave:1
+                isleave: 1
             })
             this.selectComponent("#organization").initDepAndUser()
             this.setData({
@@ -197,6 +203,7 @@ Page({
         this.setData({
             statistics: []
         })
+        console.log(this.data.content)
         _Http.basic({
             "id": 20230630151504,
             "content": this.data.content
@@ -232,6 +239,21 @@ Page({
                 }
             });
         })
+
+        _Http.basic({
+            "id": 20241028162104,
+            "content": this.data.content
+        }).then(res => {
+            console.log("前12个月总数据", res)
+            if (res.code != '1') return wx.showToast({
+                title: res.msg,
+                icon: "none"
+            })
+            res.data.dealaccuracyrate = (res.data.dealaccuracyrate * 100).toFixed(2) + '%'
+            this.setData({
+                firstTwelveMonths: res.data
+            })
+        })
     },
     renderChart() {
         return createElement(Chart, {

+ 54 - 0
packageA/salesHourglass/index.scss

@@ -25,6 +25,60 @@
     }
 }
 
+.box {
+    background-color: #fff;
+    padding: 20rpx 30rpx;
+    // padding-bottom: 0;
+    width: 100vw;
+    box-sizing: border-box;
+    margin-top: 20rpx;
+
+    .project-title {
+        line-height: 42rpx;
+        font-family: PingFang SC, PingFang SC;
+        font-weight: 600;
+        font-size: 30rpx;
+        color: #333333;
+    }
+
+    .project-total-data-box {
+        width: 690rpx;
+        background: #F6F6F6;
+        border-radius: 8rpx;
+        padding: 20rpx;
+        box-sizing: border-box;
+        margin-top: 20rpx;
+
+        .title {
+            line-height: 40rpx;
+            font-family: PingFangSC-Semibold, PingFangSC-Semibold;
+            font-weight: 600;
+            font-size: 28rpx;
+            color: #171A1D;
+        }
+
+        .row {
+            display: flex;
+
+            .col {
+                width: 50%;
+                display: flex;
+                line-height: 34rpx;
+                font-family: PingFang SC, PingFang SC;
+                font-size: 24rpx;
+                color: #666666;
+                margin-top: 10rpx;
+                box-sizing: border-box;
+                padding-right: 6rpx;
+
+                .green {
+                    color: #009966;
+                }
+            }
+        }
+    }
+}
+
 .item {
     background-color: #fff;
     padding: 20rpx 30rpx;

+ 32 - 0
packageA/salesHourglass/index.wxml

@@ -10,6 +10,38 @@
 <view class="container" style="height: {{cHeight}};" wx:if="{{statistics.length}}">
     <f2 onRender="{{onRenderChart}}" />
 </view>
+
+<view class="box">
+    <view class="project-title">
+        项目预计成交统计
+    </view>
+    <view class="project-total-data-box">
+        <view class="title">前12个月总数据</view>
+        <view class="row">
+            <view class="col">
+                准确率:
+                <text class="green">{{firstTwelveMonths.dealaccuracyrate}}</text>
+            </view>
+            <view class="col">
+                偏差金额:
+                <text class="green">{{firstTwelveMonths.totaldeviationamount + (language['万']||'万')}}</text>
+            </view>
+        </view>
+        <view class="row">
+            <view class="col">
+                预计签约金额:{{firstTwelveMonths.totalsignamount_due + (language['万']||'万') }}
+            </view>
+            <view class="col">
+                项目成交金额:{{firstTwelveMonths.totaldealamount + (language['万']||'万') }}
+            </view>
+        </view>
+    </view>
+    <view class="project-title" style="margin-top: 20rpx;">
+        未来12月预计签约金额统计
+    </view>
+
+
+</view>
 <view class="row-amount">
     <view>
         {{language['项目总计']||'项目总计'}}:{{statistics.length ? statistics[0].sequence1 : 0}}

+ 13 - 1
project.private.config.json

@@ -5,6 +5,18 @@
         "autoAudits": false,
         "compileHotReLoad": true
     },
-    "condition": {},
+    "condition": {
+        "miniprogram": {
+            "list": [
+                {
+                    "name": "销售漏斗",
+                    "pathName": "packageA/salesHourglass/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                }
+            ]
+        }
+    },
     "libVersion": "3.6.1"
 }