Browse Source

Vin 分析

chenrui 2 years ago
parent
commit
12064d7e79
2 changed files with 54 additions and 32 deletions
  1. 5 5
      pages/vinAnalyse/search.vue
  2. 49 27
      pages/vinAnalyse/shelfAnalyse.vue

+ 5 - 5
pages/vinAnalyse/search.vue

@@ -65,9 +65,9 @@
 					date: '',
 					date: '',
 					beginDate: '',
 					beginDate: '',
 					endDate: '',
 					endDate: '',
-					airConditionerFilterFlag:undefined,
-					airFilterFlag:undefined,
-					engineOilFilterFlag:undefined,
+					airConditionerFilterFlag:1,
+					airFilterFlag:1,
+					engineOilFilterFlag:1,
 					vinCode: undefined, 
 					vinCode: undefined, 
 					brandName: undefined,//车辆品牌
 					brandName: undefined,//车辆品牌
 					modelName: undefined//车型
 					modelName: undefined//车型
@@ -104,8 +104,8 @@
 			// 时间  change
 			// 时间  change
 			dateChange(date){
 			dateChange(date){
 				this.form.date = date.startDate + ' ~ ' + date.endDate
 				this.form.date = date.startDate + ' ~ ' + date.endDate
-				this.form.beginDate = date.startDate
-				this.form.endDate = date.endDate
+				this.form.beginDate = date.startDate + ' 00:00:00'
+				this.form.endDate = date.endDate + ' 23:59:59'
 			},
 			},
 			//  清空创建时间
 			//  清空创建时间
 			clearTime(){
 			clearTime(){

+ 49 - 27
pages/vinAnalyse/shelfAnalyse.vue

@@ -8,7 +8,7 @@
 				<text>筛选</text> <u-icon name="arrow-down"></u-icon>
 				<text>筛选</text> <u-icon name="arrow-down"></u-icon>
 			</view>
 			</view>
 		</view>
 		</view>
-		<scroll-view class="product-list" scroll-y @scrolltolower="onreachBottom">
+		<scroll-view class="product-list" scroll-y>
 			<view class="st-detailList-main">
 			<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-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="st-detailList-item-con flex align_center">
@@ -60,51 +60,58 @@
 					<view>VIN详情</view>
 					<view>VIN详情</view>
 					<view class="st-detailList-item-con flex">
 					<view class="st-detailList-item-con flex">
 						<view class="pimgs">
 						<view class="pimgs">
-							<u-image :src="tempData.productMainPic&&tempData.productMainPic.imageUrl?tempData.productMainPic.imageUrl:`../../static/${theme}/def_img@2x.png`" width="100" height="100" border-radius="10"></u-image>
+							<u-image :src="tempData.icon?tempData.icon:`../../static/${tempData.icon}/def_img@2x.png`" width="100" height="100" border-radius="10"></u-image>
 						</view>
 						</view>
 						<view class="flex_1 pimgs_right">
 						<view class="flex_1 pimgs_right">
-							<view class="padding_3">{{tempData.name || '--'}} </view>
+							<view class="padding_3">{{tempData.modelInfo || '--'}} </view>
 							<view class="font_13">
 							<view class="font_13">
-								VIN:LJJLDS234DD323453
+								VIN:{{tempData.vinCode}}
 							</view>
 							</view>
 						</view>
 						</view>
 					</view>
 					</view>
 				</div>
 				</div>
 				<div class="cpb_body flex justify_between">
 				<div class="cpb_body flex justify_between">
 					<div class="cpb_tab">
 					<div class="cpb_tab">
-						<div class="active">空调滤清器</div>
-						<div>空气滤清器</div>
-						<div>机油滤清器</div>
+						<div :class="selFlag==0?'active':''" @click="changeSel(0)">空调滤清器</div>
+						<div :class="selFlag==1?'active':''" @click="changeSel(1)">空气滤清器</div>
+						<div :class="selFlag==2?'active':''" @click="changeSel(2)">机油滤清器</div>
 					</div>
 					</div>
-					<div class="cpb_cart-list">
+					<div class="cpb_cart-list" v-if="productList.length>0">
 							<div 
 							<div 
 							v-for="(item, index) in productList" 
 							v-for="(item, index) in productList" 
-							:key="item.id" 
+							:key="index" 
 							>
 							>
 							<view class="nav-right-item flex">
 							<view class="nav-right-item flex">
 								<view class="uni-col-2">
 								<view class="uni-col-2">
-									<u-image :src="item.product&&item.product.images?item.product.images:`../../static/${$config('themePath')}/def_img@2x.png`" width="100" height="100" border-radius="30"></u-image>
+									<u-image :src="item.icon?item.icon:`../../static/${item.icon}/def_img@2x.png`" width="100" height="100" border-radius="30"></u-image>
 								</view>
 								</view>
 								<view class="item-info uni-col-10">
 								<view class="item-info uni-col-10">
 									<view class="item-name">
 									<view class="item-name">
-										{{item.product.productName}}
+										{{item.productName}}
 									</view>
 									</view>
 									<view class="item-detail">
 									<view class="item-detail">
 										<view class="item-detail-info align_center flex justify_between">
 										<view class="item-detail-info align_center flex justify_between">
 											<view>
 											<view>
 												{{item.productCode}}
 												{{item.productCode}}
 											</view>
 											</view>
-											<view class="flex justify_end">
+											<!-- 判断是否铺货 -->
+											<view class="flex justify_end" v-if="item.isShelfProduct">
 												<text class="item-detail-text">
 												<text class="item-detail-text">
-													库存:{{item.stockQty?item.stockQty:0}} {{item.product&&item.product.unit}}
+													库存:{{item.currQty?item.currQty:0}}
 												</text>
 												</text>
 											</view>
 											</view>
+											<view class="flex justify_end isShelf" v-else>
+												暂未铺货
+											</view>
 										</view>
 										</view>
 									</view>
 									</view>
 								</view>
 								</view>
 							</view>
 							</view>
 						</div>
 						</div>
 					</div>
 					</div>
+					<view class="cpb_cart-list" v-else>
+						<u-empty text="数据为空" mode="data"></u-empty>
+					</view>
 				</div>
 				</div>
 		</div>
 		</div>
 	</div>
 	</div>
@@ -139,7 +146,8 @@
 				detail: null,
 				detail: null,
 				tempData: null,
 				tempData: null,
 				productList: [],
 				productList: [],
-				shelfSn:''//货架名称
+				shelfSn:'',//货架名称,
+				selFlag:0
 			}
 			}
 		},
 		},
 		onNavigationBarButtonTap(e){
 		onNavigationBarButtonTap(e){
@@ -172,10 +180,6 @@
 			}
 			}
 			this.getList(ajaxData);
 			this.getList(ajaxData);
 			this.theme = getApp().globalData.theme
 			this.theme = getApp().globalData.theme
-			// uni.setNavigationBarTitle({
-			// 	title: this.detail.shelfName
-			// })
-			// this.getList()
 		},
 		},
 		methods:{
 		methods:{
 			toPage(url){
 			toPage(url){
@@ -183,18 +187,20 @@
 					url:url
 					url:url
 				})
 				})
 			},
 			},
-			// 新列表
+			// 搜索查询新列表
 			refreshList(val){
 			refreshList(val){
-				debugger
 				this.params =val ? val : {},
 				this.params =val ? val : {},
 				this.listData = []
 				this.listData = []
 				this.totalNum = 0
 				this.totalNum = 0
+				delete val.date;
 				let ajaxData={
 				let ajaxData={
 					shelf_sn:this.shelfSn,
 					shelf_sn:this.shelfSn,
 					pageNo:1, 
 					pageNo:1, 
 					pageSize: this.pageSize 
 					pageSize: this.pageSize 
 				}
 				}
-				
+				if(val){
+					Object.assign(ajaxData,val);
+				}
 				this.getList(ajaxData);
 				this.getList(ajaxData);
 			},
 			},
 			// 列表
 			// 列表
@@ -217,16 +223,30 @@
 					this.status = "loadmore"
 					this.status = "loadmore"
 				})
 				})
 			},
 			},
-			
-			// 查看销售记录
+			changeSel(num){
+				this.selFlag=num;
+				this.$nextTick(()=>{
+					this.toViewDetail(this.tempData);
+				})
+			},
+			// 查看详情
 			toViewDetail(row){
 			toViewDetail(row){
 				 this.tempData = row
 				 this.tempData = row
-				 this.showCart = true
+				 queryDetail({id:row.id}).then(res => {
+					this.showCart = true
+					if(this.selFlag == 0){
+						this.productList=res.data.airConditionerFilter
+					}else if(this.selFlag == 1){
+						this.productList=res.data.airFilterFlag
+					}else{
+						this.productList=res.data.engineOilFilterFlag
+					}
+				})
+				 
 			}
 			}
 		},
 		},
-		// scroll-view到底部加载更多
+		//到底部加载更多
 		onReachBottom() {
 		onReachBottom() {
-			
 			if(this.listData.length < this.totalNum){
 			if(this.listData.length < this.totalNum){
 				this.pageNo += 1
 				this.pageNo += 1
 				let ajaxData={
 				let ajaxData={
@@ -375,7 +395,6 @@
 						margin-right: 16upx;
 						margin-right: 16upx;
 					}
 					}
 					.pimgs_right{
 					.pimgs_right{
-						background-color: red;
 						width:calc(100% - 66upx);
 						width:calc(100% - 66upx);
 					}
 					}
 					.font_13{
 					.font_13{
@@ -441,6 +460,9 @@
 								color: #999;
 								color: #999;
 								margin-left: 20upx;
 								margin-left: 20upx;
 							}
 							}
+							.isShelf{
+								color:coral;
+							}
 						}
 						}
 					}
 					}
 				}
 				}