瀏覽代碼

收入统计

shish 4 年之前
父節點
當前提交
7b3f21e395

+ 4 - 3
ghsApp/src/admin/home/apply.vue

@@ -52,9 +52,10 @@ export default {
                     title:'统计',
                     list:[
                         {name: "利润表",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/statistics/profit"},
-                        {name: "花材销量",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/statistics/productSale"},
-                        {name: "客户下单排行",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/statistics/customSale"},
-                        {name: "应收款",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/statistics/incomeStat"},
+                        {name: "收入统计",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/statistics/kdIncome"},
+                        {name: "花材排行",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/statistics/productSale"},
+                        {name: "客户排行",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/statistics/customSale"},
+                        {name: "客户欠款",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/statistics/incomeStat"},
                         {name: "采购统计",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/statistics/cgStat"},
                         {name: "应付款",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/statistics/mayPayStat"},
                     ]

+ 1 - 1
ghsApp/src/admin/item/list.vue

@@ -3,7 +3,7 @@
     <app-tabs :tabs="tabs" :currentTab="tabIndex" @change="change" itemWidth="50%"/>
     <view class="input-wrap">
 			<view class="search-bar">
-				<app-search-module v-model="py" placeholder="输字母找,如小菊输xj" @input="searchFn"/>
+				<app-search-module v-model="py" placeholder="输字母找,如小菊输xj" @input="searchFn"/>
 			</view>
 			<view style="padding:0 0rpx 0 20rpx;" >
 				<button class="admin-button-com middle blue" style="margin-right:10rpx;" @click="downloadTable()">价格表</button>

+ 265 - 0
ghsApp/src/admin/statistics/kdIncome.vue

@@ -0,0 +1,265 @@
+<template>
+	<view class="ex-page">
+		<view class="top-bar">
+			<DateSelect class="bar"
+				:menuObj="menuTimeObj"
+				:selectItemId.sync="selectTimeId"
+				:typeTime="true"
+				:typeSelect="1" top="0px"
+				@selectSussess="selectSussess" />
+			<DorpdownSelect class="bar"
+				:menuObj.sync="menuObj"
+				:selectItemId.sync="shopId"
+				top="0"
+				@selectSussess="selectShopSussess" />
+		</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-tr>
+
+						<view v-for="(item, index) in profile" :key="index">
+							<t-tr>
+								<t-td><view>{{item.name}}</view></t-td>
+								<t-td><view>{{item.kd}}</view></t-td>
+								<t-td><view>{{item.refund}}</view></t-td>
+							</t-tr>
+						</view>
+
+					</t-table>
+				</block>
+			</view>
+			<view class="act-income">最终收入:¥{{income}}</view>
+		</view>
+
+	</view>
+</template>
+<script>
+const Month = (new Date().getMonth()+1)<10?'0'+(new Date().getMonth()+1):new Date().getMonth()+1
+const time = `${new Date().getFullYear()}-${Month}-${new Date().getDate()}`;
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import SelectList from "@/components/plugin/selectList";
+import { getStatKdProfile } from "@/api/statistics/index";
+import { list,selectShop } from "@/mixins";
+import DorpdownSelect from "@/components/module/shopSelect";
+import DateSelect from "@/components/module/dateSelect";
+import {mapActions, mapGetters} from "vuex";
+export default {
+	components: { SelectList, AppWrapperEmpty,DorpdownSelect,DateSelect},
+	mixins: [list,selectShop],
+	computed: {		...mapGetters(["getDictionariesInfo","getLoginInfo"])	},
+	data() {
+		return {
+			isShow:false,
+			customizationTime:'',
+			menuTimeObj:'',
+			menuShopObj:'',
+			selectTimeId:'',
+			shopId:'',
+			itemId:'',
+			selectListData: [
+				{
+					title: "时间",
+					key: "time",
+					default: "1",
+					data: [
+						{
+							name: "下午",
+							value: "1"
+						}
+					]
+				},
+				{
+					title: "全部",
+					key: "shopId",
+					default: "01",
+					data: [
+						{
+							name: "瑞景店",
+							value: "01"
+						},
+						{
+							name: "加州店",
+							value: "02"
+						}
+					]
+				}
+			],
+			nowTime: "",
+			showTimeDropdown: false,
+			nowShop: "",
+			showShopDropdown: false,
+			columns: [
+				{
+					name: "姓名",
+					dataIndex: "name",
+					color: "info"
+				},
+				{
+					name: "开单额",
+					dataIndex: "amount",
+					color: "info",
+					width: 120,
+					align: "center"
+				},
+				{
+					name: "开单数",
+					dataIndex: "num",
+					color: "info",
+					align: "center"
+				}
+			],
+			dataList: [],
+			params:{
+				itemId: '',
+				searchTime:'',
+				startTime: "",
+				endTime: "",
+				shopId: "",
+			},
+			profile:[],
+			income:0
+		};
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this._list().then(res => {
+			uni.stopPullDownRefresh();
+		});
+	},
+	onLoad(e) {
+		this.itemId = e.id;
+		this.params.itemId = e.id;
+		let dateDefaultOption = [];
+		let list = this.getDictionariesInfo.dateDefaultOption;
+		for (let i=0;i<list.length;i++){
+			dateDefaultOption.push({name:list[i].name,id:list[i].value})
+		}
+		this.menuTimeObj = {title:'时间',titleChild:'时间',list: dateDefaultOption};
+		this.shopId = this.getLoginInfo.shopId;
+	},
+	methods: {
+		...mapActions(['setUserShopAll']),
+		// 选择分店
+		selectShopSussess(val){
+			this.params.shopId = val.selectItem.id;
+			this.init();
+		},
+		//选择时间
+		selectSussess(val) {
+			this.params.selectTime = this.selectTimeId;
+			if(val.custom==1){
+				this.isShow = false;
+				this.params.startTime = val.start
+				this.params.endTime = val.end
+				this.init();
+			}else{
+				this.init();
+			}
+		},
+		//选择自定义时间取消
+		timeCancel(e){this.isShow = false;},
+		async init() {
+			this._list();
+		},
+		_list() {
+			let that = this
+			uni.showLoading()
+			getStatKdProfile(this.params).then(res => {
+				uni.hideLoading()
+				that.profile = res.data.list
+				that.income = res.data.income
+			});
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.ex-page {
+	padding-top:20rpx;
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.top-bar {
+		position: absolute;
+		left: 0;
+		display: flex;
+		width: 100%;
+		// box-shadow: 0 5upx 5upx 5upx rgba($color: #000000, $alpha: 0.2);
+		z-index: 20;
+		.bar{
+			width: 50%;
+			height: 100%;
+			text-align: center;
+			&:nth-child(1){
+				border-right: 1px solid #eeeeec;
+			}
+		}
+	}
+	.main-view {
+		margin-top: 60upx;
+		flex: 1;
+		background-color: #f9fbfc;
+		.space-view {
+			background-color: #fff;
+		}
+		.act-income{
+			margin-left:60rpx;
+			margin-top:30rpx;
+			font-size:30rpx;
+			color:rgb(92, 91, 91);
+		}
+		.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 {
+			/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: 0px -1px 6px 0px rgba(4, 0, 0, 0.06);
+		.info-view {
+			font-size: 26upx;
+		}
+		.btn-view {
+			display: flex;
+			.admin-button-com {
+				margin: 0 10upx;
+			}
+		}
+	}
+}
+</style>

+ 6 - 1
ghsApp/src/api/statistics/index.js

@@ -19,7 +19,12 @@ export const getStatProfit = data => {
 	return https.get('/stat/profit', data)
 }
 
-//花材销量
+//花材排行
 export const getStatItemProfit = data => {
 	return https.get('/stat-item/profile', data)
+}
+
+//收入统计
+export const getStatKdProfile = data => {
+	return https.get('/stat-kd/profile', data)
 }

+ 1 - 0
ghsApp/src/pages.json

@@ -194,6 +194,7 @@
 			"pages": [
 				{"path": "profit","style": {"navigationBarTitleText": "利润表"}},
 				{"path": "productSale","style": {"navigationBarTitleText": "花材销量"}},
+				{"path": "kdIncome","style": {"navigationBarTitleText": "收入统计"}},
 				{"path": "customSale","style": {"navigationBarTitleText": "客户销量"}},
 				{"path": "incomeStat","style": {"navigationBarTitleText": "应收款"}},
 				{"path": "cgStat","style": {"navigationBarTitleText": "采购统计"}},