浏览代码

客户分析,统计

lilei 2 年之前
父节点
当前提交
274bc65df1

+ 44 - 0
pages.json

@@ -653,6 +653,45 @@
             }
             
         }
+        ,{
+            "path" : "pages/statistics/index",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "销售统计",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/vinAnalyse/shelfList",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "选择货架",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/vinAnalyse/shelfAnalyse",
+            "style": {
+            	"navigationBarTitleText": "vin分析",
+            	"navigationStyle":"custom",
+            	"app-plus":{
+            		"titleNView": {
+            			"titleAlign": "left",
+            			"buttons": [ //原生标题栏按钮配置,
+            				{
+            					"text": "\ue626 适配产品统计" ,//原生标题栏增加分享按钮,点击事件可通过页面的 onNavigationBarButtonTap 函数进行监听u
+            					"fontSrc": "/static/iconfont/iconfont.ttf",
+            					"fontSize": "14",
+            					"color": "#00aaff",
+            					"width":"140px"
+            				}
+            			]
+            		}
+            	}
+            }
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
@@ -686,6 +725,11 @@
 				"text": "货架",
 				"visible": true
 			},
+			{
+				"pagePath": "pages/statistics/index",
+				"text": "统计",
+				"visible": true
+			},
 			{
 				"pagePath": "pages/userCenter/index",
 				"text": "我的",

+ 6 - 0
pages/index/index.vue

@@ -46,6 +46,12 @@
 					 </div>
 					 <div class="title">货架订单</div>
 				 </div>
+				 <div class="graid-box-1" @click="toPage('/pages/vinAnalyse/shelfList')" v-if="$hasPermissions('M_shelfOrder_mobile')">
+					 <div class="icon">
+						<u-icon name="fenxi" custom-prefix="iscm-icon" size="65"></u-icon>
+					 </div>
+					 <div class="title">VIN分析</div>
+				 </div>
 				 <!-- <div class="graid-box-1" @click="toPage('/pages/index/printAbc')">
 					 <div class="title">打印ABC</div>
 				 </div> -->

+ 3 - 1
pages/login/login.vue

@@ -176,7 +176,9 @@ export default {
 					getApp().globalData.token = res.data.access_token;
 					console.log(res.data.auth_user)
 					// 设置别名
-					skJGPush.setAlias({'alias':'user_'+ getApp().globalData.buildType +'_' + res.data.auth_user.userid ,'sequence': new Date().getTime()})
+					//#ifdef APP-PLUS
+					 skJGPush.setAlias({'alias':'user_'+ getApp().globalData.buildType +'_' + res.data.auth_user.userid ,'sequence': new Date().getTime()})
+					//#endif
 					//登录成功将用户名密码存储到用户本地
 					if (_this.isRemember) {
 						//用户勾选“记住密码”

+ 6 - 0
pages/sales/index.vue

@@ -117,6 +117,12 @@
 			})
 			uni.setTabBarItem({
 			  "index": 3,
+			  "iconPath": "static/"+theme+"/tabbar/statistics.png",
+			  "selectedIconPath": "static/"+theme+"/tabbar/statistics-active.png",
+			  "visible": this.$hasPermissions('M_shelfManage_mobile')
+			})
+			uni.setTabBarItem({
+			  "index": 4,
 			  "iconPath": "static/"+theme+"/tabbar/user.png",
 			  "selectedIconPath": "static/"+theme+"/tabbar/user-active.png",
 			})

+ 22 - 0
pages/statistics/index.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+		萨芬撒旦法
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 172 - 0
pages/vinAnalyse/search.vue

@@ -0,0 +1,172 @@
+<template>
+	<view class="modal-box">
+		<u-popup v-model="isShow"  @close="isShow=false" mode="right" length="85%" >
+			<u-form :model="form" ref="uForm" label-width="180" class="form-content">
+				<u-form-item label="产品编码"><u-input v-model.trim="form.code" placeholder="请输入产品编码" input-align="right" /></u-form-item>
+				<u-form-item label="原厂编码"><u-input v-model.trim="form.origCode" placeholder="请输入原厂编码" input-align="right" /></u-form-item>
+				<u-form-item label="产品名称"><u-input v-model.trim="form.name" placeholder="请输入产品名称" input-align="right" /></u-form-item>
+				<u-form-item label="产品品牌"><u-input v-model="brandName" @click="brandModal=true" disabled placeholder="请选择产品品牌" input-align="right" /></u-form-item>
+				<u-form-item label="产品分类"><u-input v-model="productTypeNameArr" @click="showTypeModal=true" disabled placeholder="请选择产品分类" input-align="right" /></u-form-item>
+			</u-form>
+			<view class="form-footer-btn">
+				<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" @click="handleClean">重置</u-button>
+				<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="handleSearch">查询</u-button>
+			</view>
+		</u-popup>
+		<!-- 产品品牌 -->
+		<productBrand :openModal="brandModal" :itemSn="form.productBrandSn" @choose="brandChoose" @clean="brandClean" @close="brandModal=false" />
+		<!-- 产品分类 -->
+		<productType :openModal="showTypeModal" :nowData="nowData" @choose="typeChoose" @clean="typeClean" @close="showTypeModal=false" />
+	</view>
+</template>
+
+<script>
+	import productBrand from '@/pages/common/productBrand.vue'
+	import productType from '@/pages/common/productType.vue'
+	import { dealerProductTypeList } from '@/api/dealerProductType'
+	export default{
+		components: { productBrand, productType },
+		props:{
+			showModal:{
+				type: Boolean,
+				default: false
+			}
+			
+		},
+		computed: {
+			productTypeNameArr: function() {
+				let str = ''
+				this.nowData.data.map(item => {
+					str += item.productTypeName+' / '
+				})
+				return str ? str.substr(0, str.length-3) : ''
+			}
+		},
+		data(){
+			return{
+				form: {
+					code: '', //  产品编码
+					name: '', //  产品名称
+					origCode: '', //  原厂编码
+					productBrandSn: undefined, //  产品品牌
+					productTypeSn1: undefined, //  产品分类1
+					productTypeSn2: undefined, //  产品分类2
+					productTypeSn3: undefined, //  产品分类3
+				},
+				customBtnStyle: {  //  自定义按钮样式
+					borderColor: this.$config('primaryColor'),
+					backgroundColor: this.$config('primaryColor'),
+					color: '#fff'
+				},
+				nowData: {
+					data: [],
+					indArr: [],
+					nowInd: 0
+				},
+				brandName: '',
+				isShow:this.showModal,
+				showTypeModal: false,
+				brandModal:false
+			}
+		},
+		methods:{
+			// 表单清空
+			handleClean(){
+				this.form.code = ''
+				this.form.name = ''
+				this.form.origCode = ''
+				this.brandClean()
+				this.typeClean()
+				setTimeout(()=>{
+					this.handleSearch()
+				},300)
+			},
+			handleSearch(){
+				let data = JSON.parse(JSON.stringify(this.form))
+				console.log(data)
+				this.$emit('refresh', data)
+				this.isShow=false
+			},
+			// 选择品牌
+			brandChoose(data){
+				this.brandName = data.brandName
+				this.form.productBrandSn = data.brandSn
+			},
+			// 清空品牌
+			brandClean(){
+				this.brandName = ''
+				this.form.productBrandSn = undefined
+			},
+			// 选择分类
+			typeChoose(obj){
+				this.nowData = {
+					data: obj.data,
+					indArr: obj.indArr,
+					nowInd: obj.nowInd
+				}
+				this.form.productTypeSn1 = this.nowData.data[0]&&this.nowData.data[0].productTypeSn ? this.nowData.data[0].productTypeSn : undefined
+				this.form.productTypeSn2 = this.nowData.data[0]&&this.nowData.data[1].productTypeSn ? this.nowData.data[1].productTypeSn : undefined
+				this.form.productTypeSn3 = this.nowData.data[0]&&this.nowData.data[2].productTypeSn ? this.nowData.data[2].productTypeSn : undefined
+			},
+			// 清空分类
+			typeClean(){
+				this.nowData = {
+					data: [],
+					indArr: [],
+					nowInd: 0
+				}
+				this.form.productTypeSn1 = undefined
+				this.form.productTypeSn2 = undefined
+				this.form.productTypeSn3 = undefined
+			}
+		},
+		watch:{
+			//  父页面传过来的弹框状态
+			showModal (newValue, oldValue) {
+				this.isShow = newValue
+			},
+			//  重定义的弹框状态
+			isShow (newValue, oldValue) {
+				if (!newValue) {
+					this.$emit('close')
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.modal-box{
+		width: 100%;
+		.search-title {
+			text-align: center;
+			padding: 30upx 22upx;
+			color: #333;
+			border-bottom: 1px solid #eee;
+		}
+		.form-content{
+			display: block;
+			padding: 0 20upx;
+			box-sizing: content-box;
+		}
+		.u-form-item{
+			padding: 20upx 10upx;
+		}
+		.form-footer-btn{
+			margin: 60upx 30upx 30upx;
+			display: flex;
+			justify-content: space-between;
+		}
+		.form-footer-btn {
+			display: flex;
+			padding: 20upx;
+			margin-top: 200upx;
+			.handle-btn {
+				font-size: 28upx;
+				margin: 0 30upx;
+				width: 100%;
+				flex: 1;
+			}
+		}
+	}
+</style>

+ 239 - 0
pages/vinAnalyse/shelfAnalyse.vue

@@ -0,0 +1,239 @@
+<template>
+	<view class="shelf-analyse-content">
+		<view class="checkbox-price">
+			<u-checkbox-group  placement="row" :size="24">
+				<u-checkbox v-model="item.checked" activeColor="rgb(4, 133, 246)" v-for="(item,index) in tabList" :key="index" :name="item.val">{{item.name}}</u-checkbox>
+			</u-checkbox-group>
+			<view class="search" @click="showModal=true">
+				筛选 <u-icon name="arrow-down"></u-icon>
+			</view>
+		</view>
+		<scroll-view class="product-list" scroll-y @scrolltolower="onreachBottom">
+			<view class="st-detailList-main">
+				<view class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="toViewDetail(item)">
+					<view class="st-detailList-item-con flex align_center">
+						<view class="pimgs">
+							<u-image :src="item.productMainPic&&item.productMainPic.imageUrl?item.productMainPic.imageUrl:`../../static/${theme}/def_img@2x.png`" width="100" height="100" border-radius="10"></u-image>
+						</view>
+						<view class="flex_1">
+							<view class="flex align_center justify_between">
+								<view>
+									LJJLDS234DD323453
+								</view>
+								<view class="font_13">
+									2022-05-06 12:25:36
+								</view>
+							</view>
+							<view class="padding_3">{{item.name || '--'}} </view>
+						</view>
+					</view>
+					<view class="price-all flex" v-if="selPriceShow">
+						<view class="price-item" v-if="priceList[0].checked">
+							<view>空调滤清器</view>
+							<text class="green">有适配</text>
+						</view>
+						<view class="price-item" v-if="priceList[1].checked">
+							<view>空气滤清器</view>
+							<text class="red">无适配</text>
+						</view>
+						<view class="price-item" v-if="priceList[2].checked">
+							<view>机油滤清器</view>
+							<text>--</text>
+						</view>
+					</view>
+				</view>
+				<u-empty v-if="listData.length == 0 &&status!='loading'" :text="noDataText" mode="list" ></u-empty>
+				<view style="padding-bottom: 20upx;">
+					<u-loadmore v-if="totalNum>listData.length || status=='loading'" :status="status" />
+				</view>
+			</view>
+		</scroll-view>
+		<!-- 搜索弹窗 -->
+		<search :showModal="showModal" @refresh="refreshList" @close="showModal=false"/>
+	</view>
+</template>
+
+<script>
+	import { toThousands } from '@/libs/tools'
+	import { dealerProductList } from '@/api/sales'
+	import search from './search.vue'
+	import copyText from '@/pages/common/copyText.vue'
+	export default{
+		components:{search,copyText},
+		data(){
+			return{
+				toThousands,
+				listData:[],
+				totalNum:0,
+				priceList:[
+					{ name: '空调滤清器', checked: true, val: 'kt' },
+					{ name: '空气滤清器', checked: true, val: 'kq' },
+					{ name: '机油滤清器', checked: true, val: 'jy' },
+				],
+				pageNo:1,
+				pageSize:15,
+				noDataText: '暂无数据',
+				theme: '',
+				status: 'loadmore',
+				showModal:false,
+				params:{},
+				detail: null
+			}
+		},
+		onNavigationBarButtonTap(e){
+		},
+		computed: {
+			selPriceShow() {
+				const a = this.priceList.filter(item => item.checked)
+				return a.length > 0
+			},
+			tabList(){
+				return this.priceList
+			}
+		},
+		onLoad(option) {
+			this.detail = JSON.parse(option.data)
+			this.theme = getApp().globalData.theme
+			uni.setNavigationBarTitle({
+				title: this.detail.shelfName
+			})
+			this.getList()
+		},
+		methods:{
+			toPage(url){
+				uni.switchTab({
+					url:url
+				})
+			},
+			// 刷新列表
+			refreshList(val){
+				this.params =val ? val : {},
+				this.listData = []
+				this.totalNum = 0
+				this.getList(1)
+			},
+			// 列表
+			getList(pageNo){
+				const _this = this
+				if (pageNo) {
+					this.pageNo = pageNo
+				}
+				let params = Object.assign(this.params, { pageNo: this.pageNo, pageSize: this.pageSize })
+				this.status = "loading"
+				console.log(params)
+				dealerProductList(params).then(res => {
+					if (res.status == 200) {
+						if(this.pageNo>1){
+							this.listData = this.listData.concat(res.data.list || [])
+						}else{
+							this.listData = res.data.list || []
+						}
+						this.totalNum = res.data.count || 0
+					} else {
+						this.listData = []
+						this.totalNum = 0
+						this.noDataText = res.message
+					}
+					this.status = "loadmore"
+				})
+			},
+			// scroll-view到底部加载更多
+			onreachBottom() {
+				if(this.listData.length < this.totalNum){
+					this.pageNo += 1
+					this.getList()
+				}
+			},
+			// 查看销售记录
+			toViewDetail(row){
+				uni.navigateTo({
+					url: "/pages/sales/salesRecord?productSn="+row.productSn + "&productName="+row.name+ "&productCode="+row.code
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.shelf-analyse-content{
+		width:100%;
+		height: 100vh;
+		.checkbox-price{
+			background-color: #fff;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding: 0 25rpx;
+			color: #191919;
+			.search{
+				color:#00aaff;
+			}
+		}
+		.product-list{
+			height: calc(100vh - 94upx);
+				.st-detailList-main{
+					padding: 20upx;
+					.st-detailList-main-item{
+						background: #ffffff;
+						padding: 20upx;
+						margin-bottom: 25upx;
+						border-radius: 25upx;
+						box-shadow: 1px 1px 3px #EEEEEE;
+						.st-detailList-item-con{
+							padding: 20upx 0;
+							font-size: 26upx;
+							.red{
+								color: red;
+							}
+							.pimgs{
+								margin-right: 16upx;
+							}
+							.font_13{
+								font-size: 24upx;
+								color: #999;
+							}
+							.padding_3{
+								padding: 6upx 0;
+								word-break: break-all;
+							}
+						}
+						.price-all{
+							border-top: 1px solid #e4e7ed;
+							padding: 10upx 20upx 0;
+							.price-item{
+								width: 33.3%;
+								border-right:  1px solid #e4e7ed;
+								text-align: center;
+								>view{
+									color:#999;
+									margin-bottom: 10rpx;
+									font-size: 24rpx;
+								}
+								>text{
+									border:1rpx solid #eee;
+									font-size: 20rpx;
+									padding:5rpx 10rpx;
+									border-radius: 10rpx;
+									min-width: 100rpx;
+									display: inline-block;
+								}
+								.red{
+									color:#ff5500;
+									border-color: #ff5500;
+								}
+								.green{
+									color:#00cb00;
+									border-color: #00cb00;
+								}
+							}
+							.price-item:last-child{
+								border-right:  none;
+							}
+						}
+					}
+				}
+				
+				
+		}
+	}
+</style>

+ 167 - 0
pages/vinAnalyse/shelfList.vue

@@ -0,0 +1,167 @@
+<template>
+	<view class="moreShelfPart flex flex_column">
+		<view class="moreShelfPart-search">
+			<u-search
+			placeholder="请输入货架名称搜索" 
+			v-model="shelfName" 
+			:show-action="isGobleSearch" 
+			@input="change"
+			@focus="isGobleSearch=true"
+			@blur="isGobleSearch=false"
+			@custom="getShelfList" 
+			@search="getShelfList" 
+			@clear="clearSearch"
+			:action-style="{'color': '#fff', 'font-size': '24upx', 'background-color': '#57a3f3', 'border-radius': '6upx', 'padding': '12upx 0'}">
+			</u-search>
+		</view>
+		<view class="moreShelfPart-body">
+			<view class="nav-right">
+				<view 
+				class="nav-right-item" 
+				v-for="(item, index) in shelfList" 
+				:key="item.id" 
+				@click="viewDetail(item)"
+				>
+					<view class="item-info">
+						<view class="item-name">
+							<text>{{item.shelfName}}</text>
+						</view>
+						<view class="item-detail">
+							<view>
+								累计扫描VIN数量:
+								<text class="item-detail-text">{{item.totalProfitLossQty}}</text>
+							</view>
+						</view>
+					</view>
+				</view>
+				<view v-if="shelfList&&shelfList.length==0">
+					<u-empty v-if="status!='loading'" :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="100"></u-empty>
+				</view>
+				<view style="padding: 20upx;" v-if="shelfList.length">
+					<u-loadmore :status="status" />
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { selectShelfStockCheck, stockCheckDeleteBySn } from '@/api/stockCheck'
+	import { clzConfirm } from '@/libs/tools'
+	export default {
+		data() {
+			return {
+				shelfName: '',
+				isGobleSearch: false,
+				shelfList: [],
+				noDataText: '暂无货架',
+				status: 'loading',
+				tempData: null,
+			}
+		},
+		onShow() {
+			this.getShelfList()
+		},
+		methods: {
+			clearSearch(){
+				this.shelfName = ''
+				this.shelfList = []
+				this.getShelfList()
+			},
+			change(v){
+				if(v==''){
+					this.clearSearch()
+				}
+			},
+			// 获取数字货架列表
+			getShelfList(){
+				const _this = this
+				_this.status = 'loading'
+				selectShelfStockCheck().then(res => {
+					uni.hideLoading()
+					if(res.status==200){
+						let list = res.data.filter(item => item.shelfName.indexOf(this.shelfName)>=0)
+						if (list && list.length){
+							_this.status = 'nomore'
+							_this.shelfList = list
+						} else {
+							_this.shelfList = []
+							_this.status = 'nomore'
+							_this.noDataText = '没有查询到相关货架'
+						}
+					}else{
+						_this.status = 'loadmore'
+						_this.shelfList = []
+						_this.noDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
+					}
+				})
+			},
+			viewDetail(item){
+				uni.navigateTo({
+					url:"/pages/vinAnalyse/shelfAnalyse?data="+encodeURIComponent(JSON.stringify(item))
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="less">
+	.moreShelfPart{
+		width: 100%;
+		height: 100vh;
+		background-color: #f8f8f8;
+		.moreShelfPart-search{
+			padding: 20rpx;
+		}
+		.moreShelfPart-body{
+			flex-grow: 1;
+		}
+		.nav-right{
+			padding: 0 30upx;
+			height: calc(100vh - 110rpx);
+			box-sizing: border-box;
+			overflow: auto;
+			.nav-right-item{
+				padding:20upx;
+				border: 2rpx solid #f5f5f5;
+				border-radius: 15upx;
+				margin-bottom: 20upx;
+				box-shadow: 3rpx 3rpx 8rpx #eee;
+				background-color: #ffff;
+				&:active{
+					background: #f8f8f8;
+				}
+				.item-info{
+					.item-name{
+						font-size: 30upx;
+						display: flex;
+						align-items: center;
+					}
+					.item-detail{
+						margin-top: 15rpx;
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+						color: #9DA8B5;
+						font-size: 26upx;
+						.item-detail-text{
+							font-size: 26upx;
+							color: #333;
+						}
+					}
+				}
+				.button-box{
+					display: flex;
+					margin-top: 20upx;
+					button{
+						margin: 0 10upx;
+					}
+					> text{
+						font-size: 24upx;
+						color: #00aaff;
+					}
+				}
+			}
+		}
+	}
+</style>

二进制
static/default/tabbar/statistics-active.png


二进制
static/default/tabbar/statistics.png


文件差异内容过多而无法显示
+ 0 - 0
static/iconfont/iconfont.css


二进制
static/iconfont/iconfont.ttf


部分文件因为文件数量过多而无法显示