shish 8 месяцев назад
Родитель
Сommit
df7731ca52

+ 1 - 0
ghsApp/src/admin/home/apply.vue

@@ -73,6 +73,7 @@ export default {
                         {name: "收入统计",img: `${this.$constant.hostUrl}/image/ghs/home/jyzk.png`,url: "/admin/stat/kdIncome"},
                         {name: "花材销量",img: `${this.$constant.hostUrl}/image/ghs/home/jyzk.png`,url: "/admin/stat/productSale"},
                         {name: "客户业绩",img: `${this.$constant.hostUrl}/image/ghs/home/jyzk.png`,url: "/admin/stat/customSale"},
+                        {name: "划片业绩",img: `${this.$constant.hostUrl}/image/ghs/home/jyzk.png`,url: "/admin/stat/distSale"},
                         {name: "收支分类",img: `${this.$constant.hostUrl}/image/ghs/home/jyzk.png`,url: "/admin/stat/classProfit"},
                         {name: "供货业绩",img: `${this.$constant.hostUrl}/image/ghs/home/jyzk.png`,url: "/admin/stat/cgStat"},
                         {name: "采购人业绩",img: `${this.$constant.hostUrl}/image/ghs/home/jyzk.png`,url: "/admin/stat/cgYj"},

+ 8 - 8
ghsApp/src/admin/stat/customSale.vue

@@ -17,23 +17,23 @@
 					<t-table :headerBackgroundColor="'#F0F2F6'">
 						<t-tr header>
 							<t-th>客户</t-th>
-							<t-th>订单金额</t-th>
-							<t-th>退款金额</t-th>
-							<t-th>实际金额</t-th>
-							<t-th>订单数</t-th>
+							<t-th>笔数</t-th>
+							<t-th>金额</t-th>
+							<t-th>成本</t-th>
+							<t-th>利润</t-th>
 						</t-tr>
 							<block v-if="profile.list && !$util.isEmpty(profile.list)">
 								<view v-for="(item, index) in profile.list" :key="index">
 									<t-tr>
 										<t-td><view style="color:#333333;font-size:28upx;">{{item.customName?item.customName:'-'}}</view></t-td>
-										<t-td><view style="color:#333333;font-size:28upx;">¥{{parseFloat(item.orderPrice)}}</view></t-td>
-										<t-td><view style="color:#333333;font-size:28upx;">¥{{parseFloat(item.tkPrice)}}</view></t-td>
-										<t-td><view style="color:#333333;font-size:28upx;">¥{{parseFloat(item.amount)}}</view></t-td>
 										<t-td><view style="color:#333333;font-size:28upx;">{{parseFloat(item.num)}}</view></t-td>
+										<t-td><view style="color:#333333;font-size:28upx;">¥{{parseFloat(item.amount)}}</view></t-td>
+										<t-td><view style="color:#333333;font-size:28upx;">¥{{parseFloat(item.cost)}}</view></t-td>
+										<t-td><view style="color:#333333;font-size:28upx;">¥{{parseFloat(item.profit)}}</view></t-td>
 									</t-tr>
 								</view>
 							</block>
-							<t-tr><t-td><view style="color:black;font-weight:bold;font-size:28upx;">{{profile.totalNum||0}}笔 实际金额¥{{profile.totalAmount||0}}</view></t-td></t-tr>
+							<t-tr><t-td><view style="color:black;font-weight:bold;font-size:28upx;">{{profile.totalNum||0}}笔¥{{profile.totalAmount||0}} 成本¥{{ profile.totalCost }} 利润¥{{ profile.totalProfit }}</view></t-td></t-tr>
 					</t-table>
 				</block>
 			</view>

+ 183 - 0
ghsApp/src/admin/stat/distSale.vue

@@ -0,0 +1,183 @@
+<template>
+<view class="app-content">
+	<view class="ex-page">
+		<view class="input-wrap_box">
+			<view>
+				<AppSearchModule placeholder="输入拼音首字母搜索" @input="searchFn"/>
+			</view>
+		</view>
+
+		<view class="top-bar">
+			<DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
+		</view>
+
+		<view class="main-view">
+			<view class="space-view ex-table">
+				<block>
+					<t-table :headerBackgroundColor="'#F0F2F6'">
+						<t-tr header>
+							<t-th>片区</t-th>
+							<t-th>笔数</t-th>
+							<t-th>金额</t-th>
+							<t-th>成本</t-th>
+							<t-th>利润</t-th>
+						</t-tr>
+							<block v-if="profile.list && !$util.isEmpty(profile.list)">
+								<view v-for="(item, index) in profile.list" :key="index">
+									<t-tr>
+										<t-td><view style="color:#333333;font-size:28upx;">{{item.distName?item.distName:'-'}}</view></t-td>
+										<t-td><view style="color:#333333;font-size:28upx;">{{parseFloat(item.num)}}</view></t-td>
+										<t-td><view style="color:#333333;font-size:28upx;">¥{{parseFloat(item.amount)}}</view></t-td>
+										<t-td><view style="color:#333333;font-size:28upx;">¥{{parseFloat(item.cost)}}</view></t-td>
+										<t-td><view style="color:#333333;font-size:28upx;">¥{{parseFloat(item.profit)}}</view></t-td>
+									</t-tr>
+								</view>
+							</block>
+							<t-tr><t-td><view style="color:black;font-weight:bold;font-size:28upx;">{{profile.totalNum||0}}笔¥{{profile.totalAmount||0}} 成本¥{{ profile.totalCost }} 利润¥{{ profile.totalProfit }}</view></t-td></t-tr>
+					</t-table>
+				</block>
+			</view>
+		</view>
+
+	</view>
+</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import SelectList from "@/components/plugin/selectList";
+import { getStatDist } from "@/api/stat";
+import { list } from "@/mixins";
+import ShopSelect from "@/components/module/shopSelect";
+import DateSelect from "@/components/module/dateSelect";
+import AppSearchModule from "@/components/module/app-search";
+import {mapActions, mapGetters} from "vuex";
+export default {
+	components: { SelectList, AppWrapperEmpty,ShopSelect,AppSearchModule,DateSelect },
+	mixins: [list],
+	computed: {		...mapGetters(["getDictionariesInfo","getLoginInfo"])	},
+	data() {
+		return {
+			params:{
+				searchTime:'',
+				startTime: "",
+				endTime: "",
+			},
+			profile:[],
+			searchText:'',
+		};
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this.getList().then(res => {
+			uni.stopPullDownRefresh();
+		});
+	},
+	methods: {
+		...mapActions(['setUserShopAll']),
+		searchFn(e){
+			this.searchText = e;
+		},
+		selectDateFn(val) {
+			this.params = {...this.params,...val}
+			this.init();			
+		},
+		async init() {
+			this.getList();
+		},
+		getList() {
+			let that = this
+			uni.showLoading()
+			getStatDist(this.params).then(res => {
+				uni.hideLoading()
+				that.profile = res.data
+			});
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.ex-page {
+	background: white;
+	padding-top:20upx;
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.top-bar {
+		position: absolute;
+		left: 0;
+		top:130upx;
+		display: flex;
+		width: 100%;
+		z-index: 20;
+		.bar{
+			width: 50%;
+			height: 100%;
+			text-align: center;
+			&:nth-child(1){
+				border-right: 1upx solid #eeeeec;
+			}
+		}
+	}
+	.main-view {
+		margin-top: 90upx;
+		flex: 1;
+		background-color: #f9fbfc;
+		.space-view {
+			background-color: #fff;
+			.change-level{
+				font-size:22upx;
+				padding:10upx 15upx;
+			}
+		}
+		.ex-info {
+			padding: 30upx;
+			.info-cell {
+				display: flex;
+				align-items: center;
+				font-size: 28upx;
+				&:not(:first-child) {
+					margin-top: 20upx;
+				}
+				.cell-label {
+					width: 110upx;
+					color: #666666;
+				}
+				.cell-value {
+					margin-left: 40upx;
+					color: #333;
+					&.warning {
+						color: #ffaf1d;
+					}
+					&.success {
+						color: #27c325;
+					}
+				}
+			}
+		}
+		.ex-table {
+			::v-deep.icon-info {
+				color: #333333;
+			}
+		}
+	}
+	.bar-view {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 30upx;
+		width: 100%;
+		height: 100upx;
+
+		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
+		.info-view {
+			font-size: 26upx;
+		}
+		.btn-view {
+			display: flex;
+			.admin-button-com {
+				margin: 0 10upx;
+			}
+		}
+	}
+}
+</style>

+ 2 - 15
ghsApp/src/admin/stat/stock.vue

@@ -10,11 +10,10 @@
 					<button class="admin-button-com middle default" @click="downStock()">下载Excel</button>
 				</view>
 			</view>
-			<view class="top-bar" style="margin-left:80upx;font-size:38upx;padding:30upx 0 20upx 0;">
+			<view class="top-bar" style="margin-left:80upx;font-size:34upx;padding:30upx 0 20upx 0;">
 				<text @click="showStock">实时库存</text>
-				<text style="margin-left:50upx;" @click="showAllItem">全部花材</text>
 			</view>
-			<view style="margin-left:30upx;padding-top:10upx;padding-bottom:10upx;font-size:26upx;">这个页面,请使用app打开,小程序打开会卡死</view>
+			<view style="margin-left:30upx;padding-top:10upx;padding-bottom:10upx;font-size:28upx;">这个页面,请使用app打开,小程序打开会卡死</view>
 			<scroll-view scroll-y scroll-with-animation class="main-view">
 				<view class="space-view ex-table">
 					<t-table :headerBackgroundColor="'#F0F2F6'">
@@ -217,18 +216,6 @@ export default {
 					that.classItemData = res.data.classItem ? res.data.classItem : []
 				}
 			})
-		},
-		showAllItem(){
-			this.shopId = this.getMyShopInfo.id;
-			let type = '';
-			let that = this
-			uni.showLoading()
-			getProductDataApi({ type, shopId: this.shopId,status:0,requestType:'itemList'}).then(res=>{
-				uni.hideLoading()
-				if(res.code == 1){
-					that.classItemData = res.data.classItem ? res.data.classItem : []
-				}
-			})
 		}
 	}
 };

+ 4 - 0
ghsApp/src/api/stat/index.js

@@ -75,6 +75,10 @@ export const getStatKhCgProfile = data => {
 	return https.get('/stat-kh-cg/profile', data)
 }
 
+export const getStatDist = data => {
+	return https.get('/stat-kh-cg/dist', data)
+}
+
 //客户下单排行
 export const getStatCgGhsProfile = data => {
 	return https.get('/stat-cg-ghs/profile', data)

+ 2 - 1
ghsApp/src/pages.json

@@ -288,7 +288,8 @@
 				{"path": "classProfit","style": {"navigationBarTitleText": "收支分类"}},
 				{"path": "productSale","style": {"navigationBarTitleText": "花材销量"}},
 				{"path": "kdIncome","style": {"navigationBarTitleText": "收入统计"}},
-				{"path": "customSale","style": {"navigationBarTitleText": "客户下单排行"}},
+				{"path": "customSale","style": {"navigationBarTitleText": "客户业绩"}},
+				{"path": "distSale","style": {"navigationBarTitleText": "划片业绩"}},
 				{"path": "clear","style": {"navigationBarTitleText": "结账跟踪"}},
 				{"path": "incomeStat","style": {"navigationBarTitleText": "应收款"}},
 				{"path": "cgStat","style": {"navigationBarTitleText": "供货业绩"}},