瀏覽代碼

业绩目标

xiaohaizhao 1 年之前
父節點
當前提交
20035cca3a

+ 2 - 1
pages/index/home/index.json

@@ -2,6 +2,7 @@
   "component": true,
   "usingComponents": {
     "MsgList": "/pages/index/message/modules/list/index",
-    "van-notice-bar": "@vant/weapp/notice-bar/index"
+    "van-notice-bar": "@vant/weapp/notice-bar/index",
+    "figure": "../performance/modules/figure/index"
   }
 }

+ 1 - 0
pages/index/home/index.wxml

@@ -9,6 +9,7 @@
 	<navigator url="/marketing/annunciate/index">
 		<van-notice-bar left-icon="volume-o" text="{{annunciate.title}}" />
 	</navigator>
+	<figure />
 	<view class="grld">
 		<block wx:for="{{entrance}}" wx:key="index">
 			<view class="group" wx:if="{{item.list.length}}">

+ 3 - 3
pages/index/index.js

@@ -14,7 +14,7 @@ Page({
 			Home: false,
 			Message: false,
 			Market: false,
-			Collect: false,
+			Performance: false,
 			UserCenter: false,
 		};
 		if (options.PageCur) this.setData({
@@ -131,7 +131,7 @@ Page({
 					icon: "work-dingdan"
 				}, {
 					key: "qOrderBlank",
-					path: "/packageA/orderForm/rows",
+					path: "/packageA/orderForm/index",//row
 					icon: "work-dingdan"
 				}, {
 					name: "账户",
@@ -302,7 +302,7 @@ Page({
 	async NavChange(e) {
 		let cur = e.currentTarget.dataset.cur;
 		if (this.data.PageCur == cur) return;
-		if (cur == 'Market' || cur == 'Collect') {
+		if (cur == 'Market' || cur == 'Performance') {
 			let app = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案"])[0].apps
 			let item = app.find(v => v.name == (cur == 'Market' ? "wmarket" : "wshoppingtrolley"))
 			const res = await getApp().globalData.evidence(item);

+ 1 - 1
pages/index/index.json

@@ -2,7 +2,7 @@
 	"usingComponents": {
 		"cu-custom": "/colorui/components/cu-custom",
 		"Home": "./home/index",
-		"Collect": "./collect/index",
+		"Performance": "./performance/index",
 		"UserCenter": "./userCenter",
 		"Market": "./market/index",
 		"Message": "./message/index",

+ 3 - 3
pages/index/index.wxml

@@ -11,8 +11,8 @@
 <view hidden="{{PageCur!='Market'}}">
 	<Market id='Market' />
 </view>
-<view hidden="{{PageCur!='Collect'}}">
-	<Collect id='Collect' />
+<view hidden="{{PageCur!='Performance'}}">
+	<Performance id='Performance' />
 </view>
 <view hidden="{{PageCur!='UserCenter'}}">
 	<UserCenter id='UserCenter' />
@@ -30,7 +30,7 @@
 		</view> 消息
 	</view>
 	
-	<view class="action {{PageCur=='Market'?'text-blue':'text-gray'}} add-action" bindtap="NavChange" data-cur="Market">
+	<view class="action {{PageCur=='Performance'?'text-blue':'text-gray'}} add-action" bindtap="NavChange" data-cur="Performance">
 		<button class="cu-btn cuIcon-shopfill bg-blue shadow"></button>
 		业绩目标
 	</view>

+ 2 - 1
pages/index/performance/index.json

@@ -4,6 +4,7 @@
     "figure": "./modules/figure/index",
     "rankingList": "./modules/rankingList/index",
     "chart": "./modules/chart/index",
-    "histogram": "./modules/histogram/index"
+    "histogram": "./modules/histogram/index",
+    "orderForm": "./modules/orderForm/index"
   }
 }

+ 10 - 4
pages/index/performance/index.wxml

@@ -1,4 +1,10 @@
-<figure />
-<chart />
-<histogram id='histogram' />
-<rankingList />
+<scroll-view scroll-y style="height:100vh;">
+	<figure />
+	<chart />
+	<histogram id='histogram' />
+	<rankingList />
+	<orderForm />
+	<view style="height: 340rpx;">
+		
+	</view>
+</scroll-view>

+ 28 - 11
pages/index/performance/modules/chart/index.js

@@ -2,11 +2,9 @@ let _Http = getApp().globalData.http,
   {
     formatTime
   } = require("../../../../../utils/getTime"),
-  obj = {}
+  obj = {},
+  currency = require("../../../../../utils/currency");
 Component({
-  properties: {
-
-  },
   lifetimes: {
     attached: function () {
       let date = formatTime().split(" ")[0].split("/");
@@ -16,19 +14,32 @@ Component({
         day: date[2],
         quarter: Math.ceil(date[1] / 3)
       };
-      console.log(obj)
       this.getDetail()
+      _Http.basic({
+        id: 20231108160203,
+        content: {
+          date: Date.now()
+        }
+      }).then(res => {
+        console.log("获取区域", res)
+        if (res.msg != '成功') return;
+        this.setData({
+          areanames: res.data
+        })
+      })
     },
   },
   data: {
-
+    areanames: [],
+    sa_saleareaid: 0
   },
   methods: {
     getDetail() {
       _Http.basic({
         "id": "20231018103203",
         "content": {
-          date: Date.now()
+          date: Date.now(),
+          sa_saleareaid: this.data.sa_saleareaid
         },
       }).then(res => {
         console.log("获取经销商统计", res)
@@ -47,7 +58,7 @@ Component({
             fulfill: data.m10a + data.m11a + data.m12a,
             target: data.m10l + data.m11l + data.m12l,
           }].map(v => {
-            v.achievingRate = (v.fulfill / v.target) * 100 + '%'
+            v.achievingRate = currency((v.fulfill / v.target)) * 100 + '%'
             return v
           });
         this.setData({
@@ -57,7 +68,7 @@ Component({
             fulfill: data[`m${obj.month}a`],
             target: data[`m${obj.month}l`],
             distance: Math.abs(data[`m${obj.month}a`] - data[`m${obj.month}l`]), //差额
-            achievingRate: data[`m${obj.month}pl`] + "%", //达成
+            achievingRate: currency(data[`m${obj.month}pl`]) + "%", //达成
             color: "#FF9900"
           }, {
             label: "季度",
@@ -67,7 +78,7 @@ Component({
           }, {
             fulfill: data.y1a,
             target: data.y1l,
-            achievingRate: data.y1pl + '%',
+            achievingRate: currency(data.y1pl) + '%',
             label: "年度",
             distance: Math.abs(data.y1a - data.y1l), //差额
             color: "#FF001F"
@@ -76,7 +87,13 @@ Component({
             return v
           })
         })
-      })
+      });
+
+
+    },
+    onChange(e) {
+      this.data.sa_saleareaid = this.data.areanames[e.detail.value].sa_saleareaid;
+      this.getDetail()
     }
   }
 })

+ 2 - 1
pages/index/performance/modules/chart/index.scss

@@ -1,4 +1,5 @@
 .label {
+	display: flex;
 	padding: 30rpx;
 	padding-bottom: 10rpx;
 	box-sizing: border-box;
@@ -7,7 +8,7 @@
 	font-size: 30rpx;
 	font-weight: bold;
 
-	text{
+	picker{
 		color: #31A7FF;
 		margin-left: 6rpx;
 	}

+ 6 - 1
pages/index/performance/modules/chart/index.wxml

@@ -1,5 +1,9 @@
 <block wx:if="{{areafullname}}">
-	<view class="label">区域业绩目标<text wx:if="{{areafullname}}">({{areafullname}})</text></view>
+	<view class="label">区域业绩目标
+		<picker wx:if="{{areafullname}}" mode="selector" range='{{areanames}}' range-key='areaname' bindchange="onChange">
+			({{areafullname}})
+		</picker>
+	</view>
 	<view class="chart">
 		<view class="item" wx:for="{{statistics}}" style="color: {{item.color}} !important;">
 			<view class="circle" style="box-shadow: inset 0 0 0 8rpx  {{item.color}};">
@@ -23,4 +27,5 @@
 			</view>
 		</view>
 	</view>
+	<view style="height: 20rpx;" />
 </block>

+ 1 - 1
pages/index/performance/modules/figure/index.wxml

@@ -10,7 +10,7 @@
 
 	<view class="item">
 		<view class="title">
-			{{sell.label}}<text>{{returnedMoney.yearonyeargrowth}}<text class="iconfont icon-shengxu" /></text>
+			{{sell.label}}<text>{{sell.yearonyeargrowth}}<text class="iconfont icon-shengxu" /></text>
 		</view>
 		<view class="value">
 			{{sell.value}}<text>元</text>

+ 58 - 0
pages/index/performance/modules/orderForm/index.js

@@ -0,0 +1,58 @@
+let _Http = getApp().globalData.http,
+  content = {
+    pageNumber: 1,
+    pageTotal: 1,
+    pageSize: 10,
+    "where": {
+      "condition": "",
+      "status": "",
+      isnotxinjian: 1
+    }
+  },
+  currency = require("../../../../../utils/currency"),
+  CNY = value => currency(value, {
+    symbol: "",
+    precision: 2
+  }).format();
+
+Component({
+  lifetimes: {
+    attached: function () {
+      this.getList(true)
+    },
+  },
+  data: {
+    list: []
+  },
+  methods: {
+    getList(init = false) {
+      if (init) {
+        content.pageNumber = 1;
+        content.pageTotal = 1;
+      }
+      if (content.pageNumber > content.pageTotal) return;
+      _Http.basic({
+        "id": 20231025160203,
+        content
+      }).then(res => {
+        console.log("获取最新订单", res)
+        if (res.msg != '成功') return;
+        let list = res.data.map(v => {
+          return {
+            agentnum: v.agentnum,
+            amount: CNY(v.amount),
+            billdate: v.billdate,
+            sonum: v.sonum,
+            status: v.status,
+            qty: v.qty
+          }
+        });
+        this.setData({
+          list: res.pageNumber == 1 ? list : this.data.list.concat(list)
+        });
+        content.pageNumber = res.pageNumber + 1;
+        content.pageTotal = res.pageTotal;
+      })
+    }
+  }
+})

+ 4 - 0
pages/index/performance/modules/orderForm/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 77 - 0
pages/index/performance/modules/orderForm/index.scss

@@ -0,0 +1,77 @@
+.table {
+	width: 100vw;
+	background-color: #ffffff;
+	box-sizing: border-box;
+	margin-top: 30rpx;
+
+	.label {
+		display: flex;
+		align-items: center;
+		height: 80rpx;
+		padding: 0 20rpx;
+		font-weight: bold;
+		font-size: 26rpx;
+		color: #666;
+
+		.text {
+			display: inline-block;
+			width: 14rpx;
+			height: 26rpx;
+			background: #31A7FF;
+			margin-right: 14rpx;
+		}
+	}
+
+}
+
+.list {
+	position: relative;
+	padding: 20rpx 20rpx 0 40rpx;
+	box-sizing: border-box;
+
+	.title {
+		font-weight: bold;
+		margin-top: 8rpx;
+	}
+
+	.row {
+		width: 100%;
+		font-size: 24rpx;
+		color: #999;
+		margin-top: 8rpx;
+	}
+
+	.bor {
+		border-bottom: 1px solid rgb(209, 208, 208);
+		padding-bottom: 20rpx;
+	}
+
+	.status {
+		position: absolute;
+		right: 20rpx;
+		top: 20rpx;
+		padding: 6rpx 14rpx;
+		border-radius: 6rpx;
+		background-color: #FF8D00;
+		color: #fff;
+		font-size: 24rpx;
+	}
+
+	.sum {
+		color: #F3013B;
+		position: absolute;
+		bottom: 20rpx;
+		right: 20rpx;
+		font-weight: bold;
+	}
+}
+
+.list:first-child {
+	margin-top: 0 !important;
+}
+
+.list:last-child {
+	.bor {
+		border: none;
+	}
+}

+ 48 - 0
pages/index/performance/modules/orderForm/index.wxml

@@ -0,0 +1,48 @@
+<view class="table" hidden="{{!list.length}}">
+	<view class="label">
+		<text class="text" />
+		最新订单
+	</view>
+
+	<view class="list" wx:for="{{list}}" wx:key="sonum">
+		<view class="title">
+			{{item.agentnum}}
+		</view>
+		<view class="title">
+			{{item.sonum}}
+		</view>
+		<view class="row">
+			单据日期:{{item.billdate}}
+		</view>
+		<view class="row bor">
+			共计{{item.qty}}件商品
+		</view>
+
+		<view class="status" style="background-color: {{set.color(item.status)}};">
+			{{item.status}}
+		</view>
+		<view class="sum">
+			合计:{{item.amount}}元
+		</view>
+	</view>
+</view>
+
+<wxs module="set">
+	module.exports = {
+		color: function (statu) {
+			var color = '#999999';
+			switch (statu) {
+				case "审核":
+					color = '#FA8C16';
+					break;
+				case "提交":
+					color = '#52C41A';
+					break;
+				case "新建":
+					color = '#333333';
+					break;
+			};
+			return color;
+		}
+	}
+</wxs>

+ 3 - 1
pages/index/performance/modules/rankingList/index.js

@@ -64,9 +64,11 @@ Component({
             target: CNY(v.m10l + v.m11l + v.m12l),
           }];
           v.quarter = ar[obj.quarter - 1];
+          console.log(obj.month)
+          console.log(CNY(v[`m${obj.month}a`]))
           v.thisMonth = {
             fulfill: CNY(v[`m${obj.month}a`]),
-            target: CNY(v[`m${obj.month}a`])
+            target: CNY(v[`m${obj.month}l`])
           }
           v.sumamount_currentmonth = CNY(v.sumamount_currentmonth)
           v.sumamount_year = CNY(v.sumamount_year)

+ 5 - 4
pages/index/performance/modules/rankingList/index.scss

@@ -49,13 +49,14 @@
 
 				.tag {
 					position: absolute;
-					top: 10rpx;
-					width: 50rpx;
-					height: 50rpx;
+					top: 12rpx;
+					left: 4rpx;
+					width: 45rpx;
+					height: 45rpx;
 					text-align: center;
 					color: #fff;
 					font-weight: bold;
-					line-height: 50rpx;
+					line-height: 45rpx;
 					border-radius: 6rpx;
 				}
 			}

+ 3 - 3
pages/index/performance/modules/rankingList/index.wxml

@@ -1,7 +1,7 @@
 <view class="table" hidden="{{!list.length}}">
 	<view class="label">
 		<text class="text" />
-		区域经销商统计
+		区域经销商统计(万元)
 	</view>
 
 	<scroll-view class="scroll" scroll-x>
@@ -57,7 +57,7 @@
 				</view>
 				<view class="line-1">
 					<!-- 当月达成 -->
-					{{item.thisMonth.quarter}}
+					{{item.thisMonth.fulfill}}
 				</view>
 				<view class="line-1">
 					<!-- 季度目标 -->
@@ -65,7 +65,7 @@
 				</view>
 				<view class="line-1">
 					<!-- 季度达成 -->
-					{{item.quarter.quarter}}
+					{{item.quarter.fulfill}}
 				</view>
 			</view>
 		</view>

+ 1 - 1
project.private.config.json

@@ -5,7 +5,7 @@
     "compileHotReLoad": true,
     "urlCheck": false
   },
-  "libVersion": "2.24.7",
+  "libVersion": "3.1.5",
   "condition": {
     "miniprogram": {
       "list": [