shish 3 лет назад
Родитель
Сommit
63c725e2bd

+ 2 - 12
hdApp/src/admin/home/apply.vue

@@ -69,20 +69,10 @@ export default {
             {name: "收入渠道",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/kdIncome",pf:1},
             {name: "花材销量",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/productSale",pf:1},
             // {name: "客户下单榜",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/customSale",pf:1},
-            {name: "采购统计",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgStat",pf:1}
+            {name: "采购统计",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgStat",pf:1},
+            {name: "采购花材",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgItem",pf:1}
           ]
         }
-        // {
-        //   title: '代理商',
-        //   list: [
-        //     // {name: "新客福利",img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`,url: "/admin/hb/xrFl",pf:1},
-        //     // {name: "推荐福利",img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`,url: "/admin/hb/tjFl",pf:1},
-        //     // {name: "充值福利",img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`,url: "/admin/item/rechargeHb",pf:1},
-        //     // {name: "充值记录",img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`,url: "/admin/hb/rechargeList",pf:1},
-        //     // {name: "已发红包",img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`,url: "/admin/hb/list",pf:1},
-        //     { name: "邀请开店", img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`, url: "/pagesInvite/list",pf:1 }
-        //   ]
-        // }
       ]
     }
   },

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

@@ -95,6 +95,11 @@
 
       <template v-if="!$util.isEmpty(supplierList)">
 
+        <view style="background-color:white;margin-bottom:20upx;">
+          <button class="admin-button-com middle blue" style="margin-left:35upx;" @click="pageTo({url:'/admin/stat/cgItem'})">采购统计</button>
+          <button class="admin-button-com middle blue" style="margin-left:40upx;" @click="suggest()">改进建议</button>
+        </view>
+
         <view class="ghs_box flex-col justify-end" v-for="(ghsInfo, index) in supplierList" :key="index">
           <view class="image-text_7 flex-row justify-between">
             <view class="section_1 flex-col">
@@ -238,6 +243,17 @@ export default {
       })
   },
   methods: {
+    suggest(){
+      let that = this
+      that.$util.confirmModal({content:'请添加管理员微信反馈:15280215347',okText:'复制'},() => {
+        uni.setClipboardData({
+          data: '15280215347',
+          success: function() {
+            that.$msg("复制成功");
+          }
+        })
+			})
+    },
     bookItem(item){
       const { id } = item
       this.pageTo({url: '/pagesPurchase/bookProduct?id='+id})

+ 210 - 0
hdApp/src/admin/stat/cgItem.vue

@@ -0,0 +1,210 @@
+<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>
+		<scroll-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>花材</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>{{item.name}}</view></t-td>
+								<t-td><view>{{item.num?parseFloat(item.num):0}}</view></t-td>
+								<t-td><view>{{item.amount?parseFloat(item.amount):0}}</view></t-td>
+							</t-tr>
+						</view>
+					</t-table>
+				</block>
+			</view>
+		</scroll-view>
+	</view>
+</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import SelectList from "@/components/plugin/selectList";
+import { getStatCgItem } 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,
+			customizationTime:'',
+			shopId:'',
+			itemId:'',
+			nowTime: "",
+			showTimeDropdown: false,
+			nowShop: "",
+			showShopDropdown: false,
+			dataList: [],
+			params:{
+				itemId: '',
+				searchTime:'',
+				startTime: "",
+				endTime: "",
+				shopId: "",
+			},
+			profile:[],
+			storageData:[],
+			searchContent:'',
+		};
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this.getStatList().then(res => {
+			uni.stopPullDownRefresh();
+		});
+	},
+	onLoad(e) {
+		this.itemId = e.id;
+		this.params.itemId = e.id;
+		this.shopId = this.getLoginInfo.shopId;
+	},
+	methods: {
+		...mapActions(['setUserShopAll']),
+		searchFn(e){
+			this.searchContent = e;
+			this.filterStat()
+		},
+		filterStat(){
+			let that = this
+			if(this.searchContent.length > 0){
+				that.profile = [];
+				that.storageData.forEach(obj => {
+					let hasName = obj.name && obj.name.indexOf(this.searchContent) >= 0;
+					let elePy = (obj.py && obj.py.toLocaleUpperCase()) || "";
+					let hasPy = elePy.indexOf(this.searchContent.toLocaleUpperCase()) >= 0;
+					if (hasName || hasPy) {
+						that.profile.push(obj)
+					}
+				})
+			}else{
+				that.profile = that.storageData
+			}
+		},
+		//选择分店
+		selectShopFn(val){
+			this.params.shopId = val.id;
+			this.init();
+		},
+		//选择时间
+		selectDateFn(val) {
+			this.params = {...this.params,...val}
+			this.init();			
+		},
+		async init() {
+			this.getStatList();
+		},
+		getStatList() {
+			let that = this
+			uni.showLoading()
+			getStatCgItem(this.params).then(res => {
+				uni.hideLoading()
+				if (!this.$util.isEmpty(res.data.list)) {
+					that.storageData = res.data.list
+					that.filterStat()
+				}else{
+					that.storageData=[]
+				}
+			});
+		}
+	}
+};
+</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;
+		display: flex;
+		width: 100%;
+		top:116upx;
+		z-index: 20;
+		.bar{
+			width: 50%;
+			height: 100%;
+			text-align: center;
+			&:nth-child(1){
+				border-right: 1upx solid #eeeeec;
+			}
+		}
+	}
+	.main-view {
+		margin-top: 80upx;
+		flex: 1;
+		background-color: #f9fbfc;
+		.space-view {
+			background-color: #fff;
+		}
+		.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 getStatCgItem = data => {
+	return https.get('/stat-cg/profile', data)
+}
+
 export const getStatWorkCatItem = data => {
 	return https.get('/stat-work-cat-item/item-list', data)
 }