xiaohaizhao 1 год назад
Родитель
Сommit
13d79e1fbd

+ 4 - 0
components/Yl_FunTabs/index.js

@@ -17,6 +17,10 @@ Component({
         mode: {
             type: String,
             value: "default" //buts
+        },
+        safety: {
+            type: Function,
+            value: true
         }
     },
     lifetimes: {

+ 1 - 1
components/Yl_FunTabs/index.wxml

@@ -19,4 +19,4 @@
     <slot name='{{list[active].label}}' />
     <slot />
 </view>
-<view class="safety" />
+<view wx:if="{{safety}}" class="safety" />

+ 9 - 2
project.private.config.json

@@ -9,12 +9,19 @@
         "miniprogram": {
             "list": [
                 {
-                    "name": "/portrayal/index/index",
-                    "pathName": "/portrayal/index/index",
+                    "name": "salesPanel/index/index",
+                    "pathName": "salesPanel/index/index",
                     "query": "",
                     "scene": null,
                     "launchMode": "default"
                 },
+                {
+                    "name": "/portrayal/index/index",
+                    "pathName": "/portrayal/index/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
                 {
                     "name": "packageA/setclient/detail",
                     "pathName": "packageA/setclient/detail",

+ 32 - 1
salesPanel/index/index.js

@@ -22,9 +22,15 @@ Page({
             label: "报价分析"
         }],
         tabsActive: 0,
+        showFiltrate: false,
+        dataid: wx.getStorageSync('userMsg').userid,
+        type: 0,
     },
     onLoad(options) {
         getApp().globalData.Language.getLanguagePackage(this, '销售数据');
+        this.selectComponent("#organization").initDepAndUser().then(res => {
+            console.log(res)
+        });
         this.partialRenewal();
     }, //tabs 切换
     tabsChange({
@@ -48,10 +54,35 @@ Page({
                 id = this.data.sa_projectid;
             if (total == null || init) {
                 Component.getList(id, init);
-                //initialize
             } else if (pageNumber <= pageTotal) {
                 Component.getList(id, false);
             }
         }
     },
+    openFiltrate() {
+        this.setData({
+            showFiltrate: true
+        })
+    },
+    handleFilter({
+        detail
+    }) {
+        if (detail.name == "close") return;
+        if (detail.name == 'reset') {
+            this.selectComponent("#organization").initDepAndUser()
+            this.setData({
+                dataid: wx.getStorageSync('userMsg').userid,
+                'type': 0
+            })
+        } else {
+            let active = this.selectComponent("#organization").data.result;
+            let type = active.userid ? 0 : 1,
+                dataid = type == 0 ? active.userid : active.departmentid
+            this.setData({
+                dataid,
+                type,
+            })
+        }
+        this.partialRenewal(true)
+    },
 })

+ 4 - 1
salesPanel/index/index.wxml

@@ -13,4 +13,7 @@
 </view>
 <Yl_FunTabs id='Yl_FunTabs' safety='{{false}}' list='{{tabsList}}' mode='buts' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Panel slot='销售面板' id='Panel' />
-</Yl_FunTabs>
+</Yl_FunTabs>
+<Yl_Filtrate1 id="Yl_Filtrate1" show='{{showFiltrate}}' list="{{[]}}" bindhandle="handleFilter" bindinterrupt='interrupt'>
+    <organization slot='head' defaultIsleave='1' dimissionF id='organization' />
+</Yl_Filtrate1>

+ 143 - 10
salesPanel/panel/index.js

@@ -17,9 +17,24 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                list: this.data.list.map(v => {
+                    v.name = getApp().globalData.Language.getMapText(v.type);
+                    v.color = v.datatype == this.data.content.type ? "#3874F6" : "";
+                    return v
+                }),
+                dates: this.data.dates.map(v => {
+                    v.name = getApp().globalData.Language.getMapText(v.value);
+                    v.color = v.value == this.data.content.dateType ? "#3874F6" : "";
+                    return v
+                })
+            })
+            console.log(this.data.dates)
         }
     },
     data: {
+        actionShow: false,
+        detaShow: false,
         list: [{
                 type: "订单",
                 datatype: 1
@@ -37,9 +52,18 @@ Component({
                 datatype: 4
             }
         ],
+        dates: [{
+            value: "去年"
+        }, {
+            value: "本年"
+        }, {
+            value: "本季"
+        }, {
+            value: "本月"
+        }],
         "content": {
-            "type": 1,
-            "dataid": 54,
+            dataid: wx.getStorageSync('userMsg').userid,
+            type: 0,
             "dateType": "本年",
             "datatype": 1
         },
@@ -50,6 +74,34 @@ Component({
         getList(init = false) {
             let content = this.data.content,
                 item = this.data.list[content.datatype - 1];
+            const {
+                dataid,
+                type
+            } = getCurrentPages()[getCurrentPages().length - 1].data;
+            if (content.dataid != dataid || content.type != type) {
+                init = true
+                this.setData({
+                    list: [{
+                            type: "订单",
+                            datatype: 1
+                        },
+                        {
+                            type: "出货",
+                            datatype: 2
+                        },
+                        {
+                            type: "开票",
+                            datatype: 3
+                        },
+                        {
+                            type: "回款",
+                            datatype: 4
+                        }
+                    ],
+                })
+            }
+            content.dataid = dataid;
+            content.type = type;
             if (!init && item.init) return;
             _Http.basic({
                 "id": 20231009125304,
@@ -63,21 +115,21 @@ Component({
                 })
                 let data = res.data,
                     dividend = wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000;
-                data.target_l = CNY(data.target_l / dividend);
-                data.nowTarget_l = CNY(data.nowTarget_l / dividend);
+                data.target_l = CNY(data.target_l / dividend, "");
+                data.nowTarget_l = CNY(data.nowTarget_l / dividend, "");
                 data.unamount = CNY(data.unamount / dividend);
-                data.amount = CNY(data.amount / dividend);
+                data.amount = CNY(data.amount / dividend, "");
                 data.unnowTarget_l = CNY(data.unnowTarget_l / dividend);
-                data.wcamount = (data.wcamount * 100).toFixed(2); // 达成率
-                data.tbxsje = (data.tbxsje * 100).toFixed(2); // 同比增长率
-                data.hbxsje = (data.hbxsje * 100).toFixed(2); // 环比增长率
+                data.wcamount = (data.wcamount * 100).toFixed(2) - 0; // 达成率
+                data.tbxsje = (data.tbxsje * 100).toFixed(2) - 0; // 同比增长率
+                data.hbxsje = (data.hbxsje * 100).toFixed(2) - 0; // 环比增长率
                 data.wcnowTarget_l = (data.wcnowTarget_l * 100).toFixed(2); // 累计目标达成率
                 data.init = true;
                 this.setData({
                     [`list[${content.datatype - 1}]`]: Object.assign(item, data),
                 })
-                console.log("list", this.data.list)
                 this.setHeight()
+                this.onCancel();
             })
 
         },
@@ -92,9 +144,90 @@ Component({
             detail
         }) {
             this.setData({
-                "content.datatype": detail.currentItemId
+                "content.datatype": detail.currentItemId,
+                list: this.data.list.map(item => {
+                    item.color = item.datatype == detail.currentItemId ? "#3874F6" : "";
+                    return item
+                })
             })
             this.getList();
         },
+        openAction() {
+            this.setData({
+                actionShow: true
+            })
+        },
+        openDateType() {
+            this.setData({
+                detaShow: true
+            })
+        },
+        onSelect(event) {
+            const {
+                datatype
+            } = event.detail;
+            if (this.data.content.datatype == datatype) return this.onCancel();
+            this.setData({
+                "content.datatype": datatype,
+                list: this.data.list.map(item => {
+                    item.color = item.datatype == datatype ? "#3874F6" : "";
+                    item.loading = item.datatype == datatype ? true : false;
+                    return item
+                })
+            })
+            console.log(this.data.content)
+        },
+        dateOnSelect(event) {
+            const {
+                value
+            } = event.detail;
+            if (this.data.content.dateType == value) return this.onCancel();
+            this.setData({
+                "content.dateType": value,
+                dates: this.data.dates.map(item => {
+                    item.color = item.value == value ? "#3874F6" : "";
+                    item.loading = item.value == value ? true : false;
+                    return item
+                }),
+                list: [{
+                        type: "订单",
+                        datatype: 1
+                    },
+                    {
+                        type: "出货",
+                        datatype: 2
+                    },
+                    {
+                        type: "开票",
+                        datatype: 3
+                    },
+                    {
+                        type: "回款",
+                        datatype: 4
+                    }
+                ],
+            })
+            this.getList(true)
+        },
+        onCancel() {
+            this.setData({
+                actionShow: false,
+                detaShow: false,
+                list: this.data.list.map(item => {
+                    item.loading = false;
+                    return item
+                }),
+                dates: this.data.dates.map(item => {
+                    item.loading = false;
+                    return item
+                })
+            })
+        },
+        showExplain() {
+            getApp().globalData.Language.modeBoxPrompts('①累计日标金额:到当前时间为止的累计的目标金额,不计算未经历时间的目标金额;②同比增长率:同比增长率是指本期和上一年同期相比较的增长率,计算公式为:同比增长率=(本期数-同期数):同期数x100%。③环比增长率:环比增长率是指本期和上期相比较的增长率,计算公式为:环比增长率 =(本期数-上期数)÷上期数 x100%。4日标达成率=实际金额:目标金额x100%')
+        },
+        toDetail() {
+            console.log("2131323312321312")
+        }
     }
 })

+ 145 - 3
salesPanel/panel/index.scss

@@ -1,5 +1,147 @@
-.head {
+.panel {
+	position: relative;
+	box-sizing: border-box;
 	display: flex;
-	height: 40rpx;
-	line-height: 40rpx;
+	flex-wrap: wrap;
+
+	.head {
+		display: flex;
+		margin-bottom: 20rpx;
+
+		.item {
+			line-height: 40rpx;
+			font-family: PingFang SC, PingFang SC;
+			font-weight: 700;
+			font-size: 28rpx;
+			color: #333333;
+
+			.iconfont {
+				margin-left: 10rpx;
+			}
+		}
+	}
+
+	.explain {
+		position: absolute;
+		top: 20rpx;
+		right: 20rpx;
+		font-size: 24rpx;
+		height: 40rpx;
+		width: 40rpx;
+		text-align: right;
+	}
+
+	.chart {
+		display: flex;
+		width: 100%;
+		justify-content: center;
+		margin: 20rpx 0;
+
+		.circle {
+			width: 280rpx;
+			height: 280rpx;
+			position: relative;
+			border-radius: 50%;
+			box-shadow: inset 0 0 0 20rpx var(--assist); // Adjusted thickness
+			transform: translateZ(0);
+
+			.ab {
+				position: absolute;
+				left: 0;
+				right: 0;
+				top: 0;
+				bottom: 0;
+				margin: auto;
+			}
+
+			&_left {
+				border: 20rpx solid #EBEEF5;
+				border-radius: 50%;
+				clip-path: inset(0 50% 0 0);
+			}
+
+			&_right {
+				border: 20rpx solid #EBEEF5;
+				border-radius: 50%;
+				clip-path: inset(0 0 0 50%);
+			}
+
+			&_text {
+				height: 100%;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+				font-size: 45rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				color: #666666;
+
+				.name {
+					line-height: 42rpx;
+					font-family: Microsoft YaHei, Microsoft YaHei;
+					font-size: 32rpx;
+					color: #999999;
+				}
+
+				.value {
+					line-height: 42rpx;
+					font-family: Microsoft YaHei, Microsoft YaHei;
+					font-weight: bold;
+					font-size: 32rpx;
+					color: #333333;
+					margin-top: 20rpx;
+				}
+			}
+		}
+	}
+
+
+	.card {
+		width: 100%;
+		border-radius: 20rpx;
+		border: 1rpx solid #E0E0E0;
+		padding: 20rpx 40rpx;
+		margin-top: 20rpx;
+
+		.title {
+			line-height: 32rpx;
+			font-family: Microsoft YaHei, Microsoft YaHei;
+			font-size: 24rpx;
+			color: #999999;
+		}
+
+		.price {
+			font-family: Microsoft YaHei, Microsoft YaHei;
+			font-size: 24rpx;
+			color: #3685FC;
+			margin-top: 10rpx;
+		}
+
+		.row {
+			line-height: 32rpx;
+			font-family: Microsoft YaHei, Microsoft YaHei;
+			font-size: 24rpx;
+			color: #999999;
+			margin-top: 6rpx;
+
+			.increase,
+			.decrease {
+				display: inline-block;
+				width: 0;
+				height: 0;
+				border-left: 8rpx solid transparent;
+				border-right: 8rpx solid transparent;
+			}
+
+			.increase {
+				border-bottom: 14rpx solid #009966;
+			}
+
+			.decrease {
+				border-top: 14rpx solid #EF0606;
+			}
+		}
+
+	}
+
 }

+ 74 - 4
salesPanel/panel/index.wxml

@@ -1,14 +1,84 @@
 <view id="head" />
-<swiper class='swiper' style="height: {{height}}px;" current='{{ content.datatype -1 }}' indicator-dots circular bindchange='swiperChange'>
+<swiper class='swiper' style="height: {{height}}px;" current='{{ content.datatype -1 }}' circular bindchange='swiperChange'>
     <swiper-item class='swiper-item' wx:for='{{list}}' item-id='{{item.datatype}}' wx:key="type">
         <Yl_ListBox id='ListBox{{item.datatype}}' bind:getlist='getList'>
             <view style="width: 100vw;">
-                <view class="global-card">
+                <view class="global-card panel" bind:tap="toDetail">
                     <view class="head">
-                        
+                        <view class="item" catch:tap="openAction">{{language[item.type]||item.type}}<text class="iconfont icon-webxialaxuanxiangjiantou"></text></view>
+                        <view class="item" catch:tap="openDateType" style="margin-left: 40rpx;">{{language[content.dateType]||content.dateType}}<text class="iconfont icon-webxialaxuanxiangjiantou"></text></view>
+                    </view>
+                    <view class="iconfont icon-wenhao explain" catch:tap="showExplain" />
+                    <view class="chart">
+                        <view class="circle">
+                            <view class="circle_left ab" style="{{render.leftRate(item.wcnowTarget_l)}}" />
+                            <view class="circle_right ab" style="{{render.rightRate(item.wcnowTarget_l)}}" />
+                            <view class="circle_text">
+                                <text class="name">{{language['目标达成率']||'目标达成率'}}</text>
+                                <text class="value">{{item.wcnowTarget_l}}%</text>
+                            </view>
+                        </view>
+                    </view>
+                    <view class="card">
+                        <view class="title">{{language['实际金额']||'实际金额'}}</view>
+                        <view class="price">
+                            ¥<text style="font-size: 40rpx;">{{item.amount}}</text>
+                        </view>
+                        <view class="row">
+                            {{language['年同比']||'年同比'}}:{{item.tbxsje}}%
+                            <view class="{{item.tbxsje>=0?'increase':'decrease'}}" />
+                        </view>
+                        <view class="row">
+                            {{language['年环比']||'年环比'}}:{{item.hbxsje}}%
+                            <view class="{{item.hbxsje>=0?'increase':'decrease'}}" />
+                        </view>
+                    </view>
+                    <view class="card">
+                        <view class="title">{{language['目标金额']||'目标金额'}}</view>
+                        <view class="price">
+                            ¥<text style="font-size: 40rpx;">{{item.target_l}}</text>
+                        </view>
+                        <view class="row">
+                            {{language['目标达成率']||'目标达成率'}}:{{item.wcamount}}%
+                        </view>
+                        <view class="row">
+                            {{language['实际与目标差额']||'实际与目标差额'}}:{{item.unamount}}
+                        </view>
+                    </view>
+                    <view class="card">
+                        <view class="title">{{language['累计目标金额']||'累计目标金额'}}</view>
+                        <view class="price">
+                            ¥<text style="font-size: 40rpx;">{{item.nowTarget_l}}</text>
+                        </view>
+                        <view class="row">
+                            {{language['目标达成率']||'目标达成率'}}:{{item.wcnowTarget_l}}%
+                        </view>
+                        <view class="row">
+                            {{language['实际与目标差额']||'实际与目标差额'}}:{{item.unnowTarget_l}}
+                        </view>
                     </view>
                 </view>
             </view>
         </Yl_ListBox>
     </swiper-item>
-</swiper>
+</swiper>
+
+<wxs module="render">
+    module.exports = {
+        rightRate: function (rate) {
+            if (rate - 0 < 50) {
+                return 'transform: rotate(' + 3.6 * (rate - 0) + 'deg);';
+            } else {
+                return 'transform: rotate(0);border-color: var(--assist);';
+            }
+        },
+        leftRate: function (rate) {
+            if (rate - 0 >= 50) {
+                return 'transform: rotate(' + 3.6 * (rate - 50) + 'deg);';
+            }
+        }
+    }
+</wxs>
+
+<van-action-sheet show="{{  actionShow }}" actions="{{ list }}" bind:select='onSelect' bind:cancel='onCancel' bind:click-overlay='onCancel' cancel-text="{{language['取消']||'取消'}}" />
+<van-action-sheet show="{{  detaShow }}" actions="{{ dates }}" bind:select='dateOnSelect' bind:cancel='onCancel' bind:click-overlay='onCancel' cancel-text="{{language['取消']||'取消'}}" />

+ 86 - 5
static/font-icon.wxss

@@ -3,12 +3,93 @@
 @import "./stylesheet.wxss";
 
 .iconfont {
-    font-family: "iconfont" !important;
-    font-size: 16px;
-    font-style: normal;
-    -webkit-font-smoothing: antialiased;
-    -moz-osx-font-smoothing: grayscale;
+  font-family: "iconfont" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
 }
+
+.icon-gantanhao:before {
+  content: "\e720";
+}
+
+.icon-wenhao:before {
+  content: "\e721";
+}
+
+.icon-xiangxixinxi1:before {
+  content: "\e71f";
+}
+
+.icon-xiangmumingcheng:before {
+  content: "\e71e";
+}
+
+.icon-feiyongleixing:before {
+  content: "\e71d";
+}
+
+.icon-lingyu:before {
+  content: "\e711";
+}
+
+.icon-chengjiaozhuangtai:before {
+  content: "\e712";
+}
+
+.icon-rili1:before {
+  content: "\e713";
+}
+
+.icon-kehuleixing:before {
+  content: "\e714";
+}
+
+.icon-xiangmuzhuangtai:before {
+  content: "\e715";
+}
+
+.icon-zhuangtai:before {
+  content: "\e716";
+}
+
+.icon-yewuyuan1:before {
+  content: "\e717";
+}
+
+.icon-kehudengji:before {
+  content: "\e718";
+}
+
+.icon-xiangmuleixing:before {
+  content: "\e719";
+}
+
+.icon-xiangxixinxi:before {
+  content: "\e71a";
+}
+
+.icon-yingxiaoleibie:before {
+  content: "\e71b";
+}
+
+.icon-bumen:before {
+  content: "\e71c";
+}
+
+.icon-zhushi:before {
+  content: "\e710";
+}
+
+.icon-dianjizhankai:before {
+  content: "\e70f";
+}
+
+.icon-rili:before {
+  content: "\e70e";
+}
+
 .icon-youshilieshi:before {
   content: "\e70d";
 }

Разница между файлами не показана из-за своего большого размера
+ 0 - 1
static/stylesheet.wxss


Некоторые файлы не были показаны из-за большого количества измененных файлов