shish před 3 roky
rodič
revize
a1349fbf52

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

@@ -82,6 +82,7 @@ export default {
             {name: "采购花材",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgItem",pf:1},
             {name: "花束统计",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/kind",pf:1},
             {name: "绿植统计",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/kindLz",pf:1},
+            {name: "损耗总览",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/waste"}
           ]
         }
       ]

+ 6 - 0
hdApp/src/admin/home/workbench.vue

@@ -41,6 +41,12 @@
             {{ $util.numberFormat(data.todayData.bouquet) || 0 }}
           </div>
         </div>
+        <div class="info-list" @click="goToWastage" >
+          <div class="info-list-name">损耗</div>
+          <div class="info-list-value">
+            {{ $util.numberFormat(data.todayData.wastage) || 0 }}
+          </div>
+        </div>
       </div>
     </div>
 

+ 181 - 0
hdApp/src/admin/stat/waste.vue

@@ -0,0 +1,181 @@
+<template>
+<view class="app-content">
+	<view class="ex-page">
+		<view scroll-y scroll-with-animation class="main-view">
+			<view class="space-view ex-table">
+				<block v-if="!$util.isEmpty(profile)">
+					<t-table :headerBackgroundColor="'#F0F2F6'">
+						<t-tr header>
+							<t-th><view style="width:180upx;">月份</view></t-th>
+							<t-th>数量</t-th>
+							<t-th>总成本</t-th>
+							<t-th>总售价</t-th>
+						</t-tr>
+						<view v-for="(item, index) in profile" :key="index" @click="goDetail(item)">
+							<t-tr>
+								<t-td><view style="color:#333333;font-size:28upx;width:180upx;">{{item.time}}</view></t-td>
+								<t-td><view style="color:#333333;font-size:30upx;">{{item.num ? parseFloat(item.num) : 0}}</view></t-td>
+								<t-td><view style="color:#333333;font-size:30upx;">¥{{item.cost ? parseFloat(item.cost) : 0}}</view></t-td>
+								<t-td><view style="color:#333333;font-size:30upx;">¥{{item.price ? parseFloat(item.price) : 0}}</view></t-td>
+							</t-tr>
+						</view>
+					</t-table>
+				</block>
+			</view>
+			<view style="margin-top:30upx;margin-bottom:30upx;font-size:30upx;font-weight:bold;text-align:center;">
+				<text>总计&nbsp;{{totalNum}}扎</text>
+				<text style="margin-left:22upx;">成本 ¥{{totalCost}}</text>
+				<text style="margin-left:22upx;">售价 ¥{{totalPrice}}</text>
+			</view>
+		</view>
+	</view>
+</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import SelectList from "@/components/plugin/selectList";
+import { getWaste } from "@/api/stat";
+import { list } from "@/mixins";
+import ShopSelect from "@/components/module/shopSelect";
+import DateSelect from "@/components/module/dateSelect";
+import {mapActions, mapGetters} from "vuex";
+import AppSearchModule from "@/components/module/app-search";
+export default {
+	components: { SelectList, AppWrapperEmpty,ShopSelect,DateSelect,AppSearchModule},
+	mixins: [list],
+	computed: {		...mapGetters(["getDictionariesInfo","getLoginInfo"])	},
+	data() {
+		return {
+			isShow:false,
+			shopId:'',
+			nowTime: "",
+			showTimeDropdown: false,
+			nowShop: "",
+			showShopDropdown: false,
+			dataList: [],
+			params:{
+				searchTime:'',
+				startTime: "",
+				endTime: ""
+			},
+			profile:[],
+			totalNum:0,
+			totalCost:0,
+			totalPrice:0
+		};
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this.getStatList().then(res => {
+			uni.stopPullDownRefresh();
+		});
+	},
+	onLoad(e) {
+		this.shopId = this.getLoginInfo.shopId;
+	},
+	methods: {
+		...mapActions(['setUserShopAll']),
+		//选择时间
+		selectDateFn(val) {
+			this.params = {...this.params,...val}
+			this.init();			
+		},
+		async init() {
+			this.getStatList();
+		},
+		getStatList() {
+			let that = this
+			uni.showLoading()
+			getWaste(this.params).then(res => {
+				uni.hideLoading()
+                this.profile = res.data.list
+				this.totalNum = res.data.totalNum||0
+				this.totalCost = res.data.totalCost||0
+				this.totalPrice = res.data.totalPrice||0
+			});
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.ex-page {
+	background: white;
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.top-bar {
+		position: absolute;
+		left: 0;
+		display: flex;
+		width: 100%;
+		top:36upx;
+		z-index: 20;
+		.bar{
+			width: 50%;
+			height: 100%;
+			text-align: center;
+			&:nth-child(1){
+				border-right: 1upx solid #eeeeec;
+			}
+		}
+	}
+	.main-view {
+		flex: 1;
+		background-color: #f9fbfc;
+		.space-view {
+			background-color: #fff;
+			color:#333333;
+			font-size:28upx;
+		}
+		.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: 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>

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

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const getWaste = async data => {
+	return https.get('/stat/waste', data)
+}
+
 export const getStatMake = data => {
 	return https.get('/stat-kind/stat-make', data)
 }

+ 2 - 1
hdApp/src/pages.json

@@ -300,7 +300,8 @@
 				{"path": "mayPayStat","style": {"navigationBarTitleText": "应付款"}},
 				{"path": "kind","style": {"navigationBarTitleText": "花束统计"}},
 				{"path": "kindLz","style": {"navigationBarTitleText": "绿植统计"}},
-				{"path": "makeStat","style": {"navigationBarTitleText": "制作统计"}}
+				{"path": "makeStat","style": {"navigationBarTitleText": "制作统计"}},
+				{"path": "waste","style": {"navigationBarTitleText": "损耗总览"}}
 			]
 		},
 		{