lilei 2 år sedan
förälder
incheckning
1a3cb9be74
3 ändrade filer med 267 tillägg och 80 borttagningar
  1. 7 0
      pages/stockCheck/startCheck.vue
  2. 76 73
      pages/vinAnalyse/search.vue
  3. 184 7
      pages/vinAnalyse/shelfAnalyse.vue

+ 7 - 0
pages/stockCheck/startCheck.vue

@@ -244,6 +244,13 @@
 				})
 			}
 		},
+		onBackPress(e) {
+		  if(this.showTab||this.editModal) {  
+			this.showTab = false;
+			this.editModal = false;
+			return true;  
+		  } 
+		},
 		onLoad(opts) {
 			this.nowData = JSON.parse(decodeURIComponent(opts.data));
 			this.stockCheckSn = this.nowData.stockCheckSn

+ 76 - 73
pages/vinAnalyse/search.vue

@@ -1,50 +1,70 @@
 <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 :model="form" ref="uForm" label-width="150" class="form-content">
+				<u-form-item label="扫描时间" prop="date" class="form-item">
+					<u-input clearable v-model="form.date" disabled placeholder="请选择扫描时间区间" class="form-item-inp" @click="showDate=true" />
+					<u-icon v-show="form.date.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="clearTime"></u-icon>
+				</u-form-item>
+				<u-form-item label="VIN"><u-input v-model.trim="form.code" placeholder="请输入VIN"/></u-form-item>
+				<u-form-item label="车辆品牌"><u-input v-model.trim="form.origCode" placeholder="请输入车辆品牌"/></u-form-item>
+				<u-form-item label="车型"><u-input v-model.trim="form.name" placeholder="请输入车型"/></u-form-item>
+				<u-form-item label="空调滤清器" label-position="top">
+					<u-radio-group v-model="value" :size="28">
+						<u-radio 
+							v-for="(item, index) in list" :key="index" 
+							:name="item.val"
+						>
+							{{item.name}}
+						</u-radio>
+					</u-radio-group>
+				</u-form-item>
+				<u-form-item label="空气滤清器" label-position="top">
+					<u-radio-group v-model="value" :size="28">
+						<u-radio 
+							v-for="(item, index) in list" :key="index" 
+							:name="item.val"
+						>
+							{{item.name}}
+						</u-radio>
+					</u-radio-group>
+				</u-form-item>
+				<u-form-item label="机油滤清器" label-position="top">
+					<u-radio-group v-model="value" :size="28">
+						<u-radio 
+							v-for="(item, index) in list" :key="index" 
+							:name="item.val"
+						>
+							{{item.name}}
+						</u-radio>
+					</u-radio-group>
+				</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" />
+		<!-- 选择日期范围 -->
+		<u-calendar v-model="showDate" @change="dateChange" mode="range"></u-calendar>
 	</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 },
+		components: { },
 		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: {
+					date: '',
+					beginDate: '',
+					endDate: '',
 					code: '', //  产品编码
 					name: '', //  产品名称
 					origCode: '', //  原厂编码
@@ -58,25 +78,47 @@
 					backgroundColor: this.$config('primaryColor'),
 					color: '#fff'
 				},
-				nowData: {
-					data: [],
-					indArr: [],
-					nowInd: 0
-				},
-				brandName: '',
+				list: [
+					{
+						name: '有适配',
+						val:'1',
+						disabled: false
+					},
+					{
+						name: '无适配',
+						val:'0',
+						disabled: false
+					},
+					{
+						name: '空(--)',
+						val:'',
+						disabled: false
+					}
+				],
+				showDate: false, // 是否显示时间弹窗
 				isShow:this.showModal,
 				showTypeModal: false,
 				brandModal:false
 			}
 		},
 		methods:{
+			// 时间  change
+			dateChange(date){
+				this.form.date = date.startDate + ' ~ ' + date.endDate
+				this.form.beginDate = date.startDate
+				this.form.endDate = date.endDate
+			},
+			//  清空创建时间
+			clearTime(){
+				this.form.date = ''
+				this.form.beginDate = ''
+				this.form.endDate = ''
+			},
 			// 表单清空
 			handleClean(){
 				this.form.code = ''
 				this.form.name = ''
 				this.form.origCode = ''
-				this.brandClean()
-				this.typeClean()
 				setTimeout(()=>{
 					this.handleSearch()
 				},300)
@@ -87,38 +129,6 @@
 				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:{
 			//  父页面传过来的弹框状态
@@ -138,29 +148,22 @@
 <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;
+			padding: 10upx;
 		}
 		.form-footer-btn{
-			margin: 60upx 30upx 30upx;
+			margin: 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;

+ 184 - 7
pages/vinAnalyse/shelfAnalyse.vue

@@ -50,6 +50,64 @@
 		</scroll-view>
 		<!-- 搜索弹窗 -->
 		<search :showModal="showModal" @refresh="refreshList" @close="showModal=false"/>
+		<!-- vin 详情 -->
+		<div class="cpb_cart-mask" v-if="showCart">
+			<div class="cpb_cart-box">
+				<div class="cpb_close flex align-center justify_center" @click="showCart=false">
+					<u-icon name="close"></u-icon>
+				</div>
+				<div class="cpb_cart-tit">
+					<view>VIN详情</view>
+					<view class="st-detailList-item-con flex">
+						<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>
+						</view>
+						<view class="flex_1">
+							<view class="padding_3">{{tempData.name || '--'}} </view>
+							<view class="font_13">
+								VIN:LJJLDS234DD323453
+							</view>
+						</view>
+					</view>
+				</div>
+				<div class="cpb_body flex justify_between">
+					<div class="cpb_tab">
+						<div class="active">空调滤清器</div>
+						<div>空气滤清器</div>
+						<div>机油滤清器</div>
+					</div>
+					<div class="cpb_cart-list">
+							<div 
+							v-for="(item, index) in productList" 
+							:key="item.id" 
+							>
+							<view class="nav-right-item flex">
+								<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>
+								</view>
+								<view class="item-info uni-col-10">
+									<view class="item-name">
+										{{item.product.productName}}
+									</view>
+									<view class="item-detail">
+										<view class="item-detail-info align_center flex justify_between">
+											<view>
+												{{item.productCode}}
+											</view>
+											<view class="flex justify_end">
+												<text class="item-detail-text">
+													库存:{{item.stockQty?item.stockQty:0}} {{item.product&&item.product.unit}}
+												</text>
+											</view>
+										</view>
+									</view>
+								</view>
+							</view>
+						</div>
+					</div>
+				</div>
+		</div>
+	</div>
 	</view>
 </template>
 
@@ -76,11 +134,24 @@
 				theme: '',
 				status: 'loadmore',
 				showModal:false,
+				showCart: false,
 				params:{},
-				detail: null
+				detail: null,
+				tempData: null,
+				productList: []
 			}
 		},
 		onNavigationBarButtonTap(e){
+			uni.navigateTo({
+				url:"/pages/vinAnalyse/shelfAnalyse?data="+encodeURIComponent(JSON.stringify(this.detail))
+			})
+		},
+		onBackPress(e) {
+		  if(this.showModal||this.showCart) {  
+			this.showModal = false;  
+			this.showCart = false;
+			return true;  
+		  } 
 		},
 		computed: {
 			selPriceShow() {
@@ -146,9 +217,8 @@
 			},
 			// 查看销售记录
 			toViewDetail(row){
-				uni.navigateTo({
-					url: "/pages/sales/salesRecord?productSn="+row.productSn + "&productName="+row.name+ "&productCode="+row.code
-				})
+				 this.tempData = row
+				 this.showCart = true
 			}
 		}
 	}
@@ -163,14 +233,14 @@
 			display: flex;
 			align-items: center;
 			justify-content: space-between;
-			padding: 0 25rpx;
+			padding: 10rpx 25rpx;
 			color: #191919;
 			.search{
 				color:#00aaff;
 			}
 		}
 		.product-list{
-			height: calc(100vh - 94upx);
+			height: calc(100vh - 84upx);
 				.st-detailList-main{
 					padding: 20upx;
 					.st-detailList-main-item{
@@ -181,7 +251,7 @@
 						box-shadow: 1px 1px 3px #EEEEEE;
 						.st-detailList-item-con{
 							padding: 20upx 0;
-							font-size: 26upx;
+							font-size: 28upx;
 							.red{
 								color: red;
 							}
@@ -235,5 +305,112 @@
 				
 				
 		}
+		
+		// 详情
+		.cpb_cart-mask{
+			position: fixed;
+			width: 100%;
+			background: rgba(0,0,0,0.5);
+			z-index: 900;
+			bottom: 0;
+			top: 0;
+		}
+		.cpb_cart-box{
+			background-color: #fff;
+			position: absolute;
+			width: 100%;
+			z-index: 1000;
+			bottom: 0;
+			border-radius: 30rpx 30rpx 0 0;
+			max-height: 70vh;
+			display: flex;
+			flex-direction: column;
+			.cpb_close{
+				position: absolute;
+				top: 10rpx;
+				right: 20rpx;
+				width: 70rpx;
+				height: 70rpx;
+				font-size: 32rpx;
+				color: #999;
+			}
+			.cpb_cart-tit{
+				padding: 20rpx 30rpx 0;
+				font-size: 30rpx;
+				border-bottom: 2rpx solid #eee;
+				.st-detailList-item-con{
+					padding: 20upx 0;
+					font-size: 28upx;
+					.pimgs{
+						margin-right: 16upx;
+					}
+					.font_13{
+						font-size: 24upx;
+					}
+					.padding_3{
+						padding: 6upx 0;
+						word-break: break-all;
+					}
+				} 
+			}
+			.cpb_body{
+				height: 80vh;
+				.cpb_tab{
+					width: 25%;
+					height: 100%;
+					background-color: #f8f8f8;
+					> div{
+						padding: 30rpx 20rpx;
+						font-size: 24rpx;
+						text-align: center;
+					}
+					.active{
+						background-color: #fff;
+						border-left: 5rpx solid #00aaff;
+					}
+				}
+			}
+			.cpb_cart-list{
+				padding: 20rpx;
+				overflow: auto;
+				flex-grow: 1;
+				> view{
+					margin-bottom: 20rpx;
+				}
+				.nav-right-item{
+					padding: 0 30upx;
+				}
+				.item-name{
+					font-size: 30rpx;
+					text{
+						background: rgba(3, 54, 146, 0.15);
+						color: #1c588a;
+						border-radius: 1em;
+						font-size: 0.8em;
+						padding: 0 0.5em;
+						margin-right: 10upx;
+					}
+				}
+				.item-info{
+					border-bottom:2rpx solid #eee;
+					flex-grow: 1;
+					padding-left: 0.2em;
+				}
+				.item-detail{
+					.item-detail-info{
+						padding: 10upx 0 4upx;
+						font-size: 24upx;
+						> view{
+							padding-bottom: 20rpx;
+							align-items: center;
+							.item-detail-text{
+								color: #999;
+								margin-left: 20upx;
+							}
+						}
+					}
+				}
+			}
+		}
 	}
 </style>