Bladeren bron

bug 修改

lilei 9 maanden geleden
bovenliggende
commit
f4c4225017

+ 8 - 0
api/purchase.js

@@ -8,6 +8,14 @@ export const purchaseSave = params => {
     data: params
   })
 }
+// 采购单校验
+export const purchaseCheck = params => {
+  return request({
+    url: `purchase/createVerify`,
+    method: 'post',
+    data: params
+  })
+}
 // 采购单-分页
 export const purchaseQueryPage = params => {
   return request({

+ 20 - 7
pages/index/index.vue

@@ -93,12 +93,12 @@
 					</view>
 					<!-- 产品分类 -->
 					<view class="ptype-nav pa-box" v-if="hasShopiing&&productTypeList.length">
-						<swiper class="swiper" @change="e=>{currentPtypeDot=e.detail.current}">
+						<swiper class="swiper" :style="{height:navHeight==44?'170px':'150px'}" @change="e=>{currentPtypeDot=e.detail.current}">
 							<swiper-item v-for="(item, idx) in productTypeList" :index="idx" :key="item.id">
 								<iconItemsList :list="item.list" type="img"></iconItemsList>
 							</swiper-item>
 						</swiper>
-						<view class="indicator-dots">
+						<view class="indicator-dots" v-if="productTypeList.length>1">
 							<view v-for="(item,idx) in productTypeList" :key="idx" :class="currentPtypeDot==idx?'indicator-dots-active':''" ></view>
 						</view>
 					</view>
@@ -187,6 +187,7 @@
 				status: 'loading',
 				noDataText: '暂无数据',
 				hasShopiing: true, // 是否开通商城
+				showPopup: false, // 去认证弹框
 				bondRecord: null, // 保证金
 				list:[], // 扫描记录滚动
 				slist:[], // 红包滚动
@@ -379,8 +380,12 @@
 					this.hasShopiing = true
 					// 隐藏促销模块
 					this.hidePromoTab()
-					// 商品分类
-					this.getGoodType()
+					if(flag){
+						// 获取推荐产品
+						this.productList = []
+						this.hotProductPageNo = 1
+						this.getProductList()
+					}
 				}
 			},
 			// 扫描vin
@@ -396,6 +401,12 @@
 						})
 						return true
 					}
+					if(this.userInfo.sysUserFlag == '0'){
+						uni.navigateTo({
+							url: '/pages/storeManage/storeAuth'
+						})
+						return true
+					}
 					uni.navigateTo({
 						url:'/pagesB/cart/index',
 						target: 'page'
@@ -646,8 +657,10 @@
 						// 获取扫描记录
 						this.getVinLog()
 					}else{
-						// 商品分类
-						this.getGoodType()
+						// 获取推荐产品
+						this.productList = []
+						this.hotProductPageNo = 1
+						this.getProductList()
 					}
 				}
 			},
@@ -925,7 +938,7 @@
 				uni.navigateTo({
 					url: "/pagesA/digitalShelf/choosePart?vinNumber="+item.vinCode+"&carList="+encodeURIComponent(JSON.stringify(item))+'&type=log'
 				})
-			}
+			},
 		}
 	}
 </script>

+ 6 - 0
pages/morePage/morePage.vue

@@ -389,6 +389,12 @@
 						})
 						return true
 					}
+					if(this.userInfo.sysUserFlag == '0'){
+						uni.navigateTo({
+							url: '/pages/storeManage/storeAuth'
+						})
+						return true
+					}
 					uni.navigateTo({
 						url:'/pagesB/cart/index',
 						target: 'page'

+ 6 - 0
pages/promo/index.vue

@@ -127,6 +127,12 @@
 						})
 						return true
 					}
+					if(this.userInfo.sysUserFlag == '0'){
+						uni.navigateTo({
+							url: '/pages/storeManage/storeAuth'
+						})
+						return true
+					}
 					uni.navigateTo({
 						url:'/pagesB/cart/index',
 						target: 'page'

+ 17 - 1
pages/storeManage/storeAuth.vue

@@ -191,7 +191,23 @@
 			this.storeApply = this.$store.state.vuex_storeAuthInfo
 			if(this.storeApply){
 				this.isRead = this.storeApply.auditStatus == 'WAIT' || this.storeApply.auditStatus == 'PASS'
-				this.tipTit = this.storeApply.auditStatus == 'WAIT' ? '门店认证资料审核中,请耐心等待' : (this.storeApply.auditStatus == 'REFUSE' ? '门店认证资料审核不通过,请重新提交审核!' : '')
+				const titText = {'WAIT':'门店认证资料审核中,请耐心等待',"REFUSE":'门店认证资料审核不通过,请重新提交审核!','PASS':'门店认证审核已通过,请重新登录!'}
+				this.tipTit = titText[this.storeApply.auditStatus]
+				if(this.storeApply.auditStatus=='PASS'){
+					uni.showModal({
+						title: '提示',
+						content: '门店认证审核已通过,请重新登录!',
+						confirmText: '去登录',
+						showCancel: false,
+						success() {
+							this.$store.dispatch('userLogout');
+							uni.redirectTo({
+								url: '/pages/login/login'
+							});
+						}
+					})						
+				}
+				// 赋值
 				this.form = Object.assign(this.form, this.storeApply)
 				this.storePhotoList = this.form.storeImage ? [{url:this.form.storeImage}] : []
 				this.yyzzPhotoList = this.form.licenseImage ? [{url:this.form.licenseImage}] : [],

+ 19 - 18
pagesA/digitalShelf/choosePart.vue

@@ -68,11 +68,15 @@
 					<!-- 其它配件 -->
 					<sticky-section>
 						<sticky-header>
-							<view class="nav-right-title flex align_center justify_between">
-								其它配件
+							<view class="nav-right-title flex align_center justify_between" @click="showOther=!showOther">
+								其它配件 
+								<view class="flex align_center">
+									{{showOther?'隐藏':'展开'}}
+									<uni-icons :type="showOther?'arrowup':'arrowdown'" size="22" color="#666"></uni-icons>
+								</view>
 							</view>
 						</sticky-header>
-						<list-view>
+						<list-view v-if="showOther">
 							<otherPartItem
 							v-for="(item,index) in partList"
 							:key="index"
@@ -137,9 +141,7 @@
 				<scroll-view type="list" scroll-y="true" class="cpb_cart-list">
 					<view class="nav-right-item flex" v-for="(item, index) in partListData" :key="item.productSn">
 						<view class="uni-col-2">
-							<u-image 
-							:src="item.images ? item.images+'?x-oss-process=image/resize,m_fixed,h_80,w_80,color_ffffff' : '/static/def_imgs.png'" 
-							border-radius="30" width="150" height="150" bg-color="#EBEBEB" ></u-image>
+							<u-image :src="item.images ? item.images+'?x-oss-process=image/resize,m_fixed,h_80,w_80,color_ffffff' : '/static/def_imgs.png'" border-radius="30" width="150" height="150" bg-color="#EBEBEB" ></u-image>
 						</view>
 						<view class="item-info uni-col-10">
 							<view class="item-name">
@@ -155,15 +157,15 @@
 									<view class="flex" v-if="item.productTypeSn=='543766811373752320'" style="padding-bottom: 5px;">
 										<uni-tag :text="item.origCode" inverted :circle="true" type="success"></uni-tag>
 									</view>
-									<view class="flex justify_between">
-										<view class="item-detail-text flex_1">
+									<view class="flex align_center justify_between">
+										<view class="item-detail-text">
 											<text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice">{{item.price?'¥'+item.price:'暂无价格'}}</text>
 											<text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
 										</view>
 										<view class="item-detail-text">
 											<view class="flex align_center qty-box">
 												<view class="qty-btn" @click="updateCartNums(item.qty-1,'cart_'+item.productSn,item.currentInven||999999,1)" :class="(item.qty <= 0)?'qty-disabled':''">-</view>
-												<view class="qty-num"><input type="number" @blur="e=>updateCartNums(Number(e.detail.value),'cart_'+item.productSn,item.currentInven||999999,0)" :value="item.qty"/></view>
+												<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+20+'px'}"><input type="number" @blur="e=>updateCartNums(Number(e.detail.value),'cart_'+item.productSn,item.currentInven||999999,0)" :value="item.qty"/></view>
 												<view class="qty-btn" @click="updateCartNums(item.qty+1,'cart_'+item.productSn,item.currentInven||999999,1)" :class="(item.qty >= (item.currentInven||999999))?'qty-disabled':''">+</view>
 											</view>
 											<!-- <uni-number-box @change="e=>updateCartNums({value:e,index:'cart_'+item.productSn})" v-model="item.qty" :index="'cart_'+item.productSn" :min="0" :max="item.currentInven||999999"></uni-number-box> -->
@@ -246,7 +248,7 @@
 		},
 		data() {
 			return {
-				showOther: true,
+				showOther: false,
 				showPriceModal: false,
 				hideFooter: false,
 				theme: '',
@@ -476,7 +478,7 @@
 				}
 				this.getShelfProductList()
 			},
-			 // 获取数字货架配件列表
+			 // 获取数字货架其它配件列表
 			 getShelfProductList(){
 			 	const _this = this
 			 	let params = {
@@ -487,7 +489,6 @@
 			 	}
 			 	_this.status = 'loading'
 			 	getShelfProductList(params).then(res => {
-					console.log(res,'获取数字货架配件列表')
 			 		uni.hideLoading()
 			 		if(res.status == 200){
 						_this.total = Number(res.data.count)
@@ -646,19 +647,19 @@
 					const v = value > max ? max : value
 					if(value > max && type == 0){
 						if(row){
-							row.qty = value
+							row.qty = Number(value)
 							this.$nextTick(()=>{
-								row.qty = v
+								row.qty = Number(v)
 							})
 						}
 					}else{
-						row.qty = v
+						row.qty = Number(v)
 					}
 				}
 				// 同步更新Vin适配配件列表上的
-				this.updateListData(sn.split('_')[1],'vinPartList',value,!!value)
+				this.updateListData(sn.split('_')[1],'vinPartList',Number(value),!!value)
 				// 同步更新其它配件列表上的
-				this.updateListData(sn.split('_')[1],'partList',value,!!value)
+				this.updateListData(sn.split('_')[1],'partList',Number(value),!!value)
 			},
 			// 打开购物车
 			openCart(){
@@ -895,7 +896,7 @@
 					padding: 20upx 25upx;
 					border-bottom: 2rpx solid #eee;
 					background: #fff;
-					> text{
+					> view{
 						color: #9E9E9E;
 						font-weight: normal;
 					}

+ 6 - 4
pagesA/digitalShelf/components/otherPartItem.vue

@@ -44,7 +44,7 @@
 								>+</view>
 								<view class="flex align_center qty-box" v-else>
 									<view class="qty-btn" @click="changeQty(item.qty-1,item,1)" :class="(item.qty <= 0)?'qty-disabled':''">-</view>
-									<view class="qty-num"><input type="number" @blur="e=>changeQty(Number(e.detail.value),item,0)" v-model="item.qty"/></view>
+									<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+'px'}"><input type="number" @blur="e=>changeQty(Number(e.detail.value),item,0)" v-model="item.qty"/></view>
 									<view class="qty-btn" @click="changeQty(item.qty+1,item,1)" :class="(item.qty >= item.currentInven)?'qty-disabled':''">+</view>
 								</view>
 								<!-- <uni-number-box v-else :hideInput="true" @change="e=>updateNums(e,item.productSn)" v-model="item.qty" :min="0" :max="item.currentInven"></uni-number-box> -->
@@ -53,7 +53,7 @@
 								<text @click="addPart(item)" v-if="!item.checked" class="phtxt">我要急送</text>
 								<view class="flex align_center qty-box" v-else>
 									<view class="qty-btn" @click="changeQty(item.qty-1,item,1)" :class="(item.qty <= 0)?'qty-disabled':''">-</view>
-									<view class="qty-num"><input type="number" @blur="e=>changeQty(Number(e.detail.value),item,0)" v-model="item.qty"/></view>
+									<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+'px'}"><input type="number" @blur="e=>changeQty(Number(e.detail.value),item,0)" v-model="item.qty"/></view>
 									<view class="qty-btn" @click="changeQty(item.qty+1,item,1)" :class="(item.qty >= 999999)?'qty-disabled':''">+</view>
 								</view>
 								<!-- <uni-number-box v-else :hideInput="true" @change="e=>updateNums(e,item.productSn)" v-model="item.qty" :min="0"></uni-number-box> -->
@@ -126,12 +126,14 @@
 			},
 			updateNums(value, id) {
 				this.$emit('updateNums', {
-					value: value,
+					value: Number(value),
 					index: id
 				})
 			},
 			viewImg(item) {
-				this.$emit('viewImg', item)
+				if(item.images){
+					this.$emit('viewImg',item)
+				}
 			}
 		}
 	}

+ 6 - 4
pagesA/digitalShelf/components/vinPartItem.vue

@@ -48,7 +48,7 @@
 								>+</view>
 								<view class="flex align_center qty-box" v-else>
 									<view class="qty-btn" @click="changeQty(item.qty-1,item,1)" :class="(item.qty <= 0)?'qty-disabled':''">-</view>
-									<view class="qty-num"><input type="number" @blur="e=>changeQty(Number(e.detail.value),item,0)" :value="item.qty"/></view>
+									<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+'px'}"><input type="number" @blur="e=>changeQty(Number(e.detail.value),item,0)" :value="item.qty"/></view>
 									<view class="qty-btn" @click="changeQty(item.qty+1,item,1)" :class="(item.qty >= item.currentInven)?'qty-disabled':''">+</view>
 								</view>
 								<!-- <uni-number-box v-else :hideInput="true" @change="e=>updateVinNums(e,item.productSn)" v-model="item.qty" :min="0" :max="item.currentInven"></uni-number-box> -->
@@ -57,7 +57,7 @@
 								<text v-if="!item.checked" @click="addPart(item)" class="phtxt">我要急送</text>
 								<view class="flex align_center qty-box" v-else>
 									<view class="qty-btn" @click="changeQty(item.qty-1,item,1)" :class="(item.qty <= 0)?'qty-disabled':''">-</view>
-									<view class="qty-num"><input type="number" @blur="e=>changeQty(Number(e.detail.value),item,0)" :value="item.qty"/></view>
+									<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+'px'}"><input type="number" @blur="e=>changeQty(Number(e.detail.value),item,0)" :value="item.qty"/></view>
 									<view class="qty-btn" @click="changeQty(item.qty+1,item,1)" :class="(item.qty >= 999999)?'qty-disabled':''">+</view>
 								</view>
 								<!-- <uni-number-box v-else :hideInput="true" @change="e=>updateVinNums(e,item.productSn)" v-model="item.qty" :min="0"></uni-number-box> -->
@@ -137,12 +137,14 @@
 			},
 			updateNums(value, id) {
 				this.$emit('updateVinNums', {
-					value: value,
+					value: Number(value),
 					index: id
 				})
 			},
 			viewImg(item){
-				this.$emit('viewImg',item)
+				if(item.images){
+					this.$emit('viewImg',item)
+				}
 			}
 		}
 	}

+ 107 - 70
pagesB/cart/index.vue

@@ -74,7 +74,7 @@
 							</view> -->
 							<view class="cart-footer-right-button">
 								<button class="btns" :loading="loading" v-if="!editFlag" type="warn" size="mini" @click="settlement">去结算({{totalNum}})</button>
-								<button v-else class="btns" type="warn" plain size="mini" @click="batchRemove">删除({{totalNum}})</button>
+								<button v-else class="btns" type="warn" plain size="mini" @click="batchRemove">删除({{totalSel}})</button>
 							</view>
 						</view>
 					</view>
@@ -91,7 +91,7 @@
 	} from 'vuex'
 	import productItem from '@/pagesB/cart/productitem.vue'
 	import { getCartList, updateCart, deleteCart } from '@/api/cart.js'
-	import { purchaseSave } from '@/api/purchase.js'
+	import { purchaseSave, purchaseCheck } from '@/api/purchase.js'
 	export default {
 		components:{
 			productItem
@@ -116,11 +116,12 @@
 				},
 				// 查询条件
 				pageNo: 1,
-				pageSize: 5,
+				pageSize: 10000,
 				list: [],
 				total: 0,
 				totalAmount: 0,
 				totalNum: 0,
+				totalSel: 0,
 				editFlag: false,
 				allChecked: false,
 				screenWidth: 325,
@@ -167,29 +168,43 @@
 			  this.status = "loading"
 			  getCartList(params).then(res => {
 				if (res.status == 200) {
-				  const list = res.data.list
-				  const ret = []
-				  list.forEach(key => {
-						ret.push({
-							id: key.id,
-							checked: this.allChecked,
-							cartSn: key.cartSn,
-							price: key.price,
-							qty: key.qty,
-							productSn: key.productSn,
-							productName: key.productEntity.productName,
-							productImage: key.productEntity.images,
-							productCode: key.productEntity.code,
-							productOrigCode: key.productEntity.origCode,
-							unit: key.productEntity.unit,
-							status: key.status,
-							dealerScopeFlag: key.dealerScopeFlag
-						})
-				  })
-				  _this.list.push(ret)
 				  _this.total = res.data.count || 0
-				  _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
-				  _this.noDataText = _this.total>=_this.list.length ? '没有更多了' : '加载更多'
+				  const list = res.data.list
+				  for(let i=0;i<list.length;i=i+10){
+					  _this.list.push(list.slice(i,(i+10)>list.length?list.length:(i+10)).map(key=>{
+						  return {
+								id: key.id,
+								checked: _this.allChecked,
+								cartSn: key.cartSn,
+								price: key.price,
+								qty: key.qty,
+								productSn: key.productSn,
+								productName: key.productEntity.productName,
+								productImage: key.productEntity.images,
+								productCode: key.productEntity.code,
+								productOrigCode: key.productEntity.origCode,
+								unit: key.productEntity.unit,
+								status: key.status,
+								dealerScopeFlag: key.dealerScopeFlag
+						}
+					  }))
+				  }
+				  
+				  // 默认全选
+				  if(_this.pageNo == 1){
+					  _this.$nextTick(()=>{
+						  _this.chooseAll()
+					  })
+				  }
+				  // 判断是否最后一页
+				  const maxPages = Math.ceil(_this.total / _this.pageSize)
+				  if(this.pageNo >= maxPages){
+				  	_this.status = 'nomore'
+				  	_this.noDataText = '没有更多了'
+				  }else{
+					  _this.status = 'loadmore'
+					  _this.noDataText = '加载更多'
+				  }
 				} else {
 				  _this.list = []
 				  _this.total = 0
@@ -297,13 +312,13 @@
 				}
 				this.allChecked = !this.allChecked
 				this.list.forEach(key => {
-					// 编辑模式
+					// 编辑模式
 					if(!this.editFlag){
 						key.filter(item=>item.status == 1 && item.dealerScopeFlag == 1).forEach(item => {
 							item.checked = this.allChecked
 						})
 					}else{
-						// 编辑模式
+						// 编辑模式
 						key.forEach(item => {
 							item.checked = this.allChecked
 						})
@@ -351,23 +366,21 @@
 							 })
 							  
 							 // 删除购物车
-							 _this.removeCart(snList,true)
+							 _this.removeCart(snList,true,true)
 						}
 					}
 				})
 			},
 			// 删除商品
-			removeCart(snList,isBatch){
+			removeCart(snList,isBatch,isTip){
 				const _this = this
-				uni.showLoading({
-					title: '删除中'
-				})
+				if(isTip){
+					uni.showLoading({
+						title: '删除中'
+					})
+				}
 				deleteCart({cartSns:snList}).then(ret => {
 					 if(ret.status == 200){
-						 uni.showToast({
-							 title: '删除成功',
-							 icon: 'none'
-						 })
 						 snList.forEach(sn => {
 							 _this.removeChoose(sn,isBatch)
 						 })
@@ -377,6 +390,12 @@
 							 // 判断是否全选
 							 _this.isAllChecked()
 						 }
+						 if(isTip){
+							uni.showToast({
+								 title: '删除成功',
+								 icon: 'none'
+							}) 
+						 }
 					 }
 					 uni.hideLoading()
 				})
@@ -398,45 +417,61 @@
 				// 获取已选商品
 				const detailList = []
 				const cartSn = []
-				const soldOutSn = []
-				const sellOutSn = []
-				this.list.forEach(key => {
+				_this.list.forEach(key => {
 					key.filter(item=>item.checked).forEach(item => {
-						// 已下架产品提示
-						if(item.status == 0){
-							soldOutSn.push(item.productCode)
-						}
-						//售罄产品提示
-						else if(item.dealerScopeFlag == 0){
-							sellOutSn.push(item.productCode)
-						}else{
-							detailList.push({
-								productSn:item.productSn,
-								productCode:item.productCode,
-								qty: item.qty,
-								price:item.price,
-							})
-							cartSn.push(item.cartSn)
-						}
+						 detailList.push({
+						 	productSn:item.productSn,
+						 	productCode:item.productCode,
+						 	qty: item.qty,
+						 	price:item.price,
+						 })
+						 cartSn.push({
+							 cartSn: item.cartSn,
+							 productSn:item.productSn
+						 })
 					})
 				})
 				
-				// 提示信息
-				if(soldOutSn.length || sellOutSn.length){
-					uni.showModal({
-						title: '提示',
-						content: (soldOutSn.length ? `产品${soldOutSn.join(',')}已下架,`:'')+(sellOutSn.length?`产品${sellOutSn.join(',')}已售罄,`:'')+`不可采购。是否继续采购其他产品?`,
-						success(res) {
-							if(res.confirm){
-								_this.submitForm(detailList,cartSn)
+				// 校验并提示信息
+				purchaseCheck({detailList:detailList}).then(res => {
+					if(res.status == 200){
+						const successList = res.data.successList.map(item => {
+							return {
+								productSn:item.productSn,
+								productCode: item.productCode,
+								qty: item.qty,
+								price:item.price
 							}
+						})
+						const delSn = cartSn.filter(item => successList.find(k => k.productSn == item.productSn)).map(item => item.cartSn)
+						const removeList = res.data.removeList.map(item => item.productCode)
+						const selloutList = res.data.selloutList.map(item => item.productCode)
+						console.log(successList,delSn)
+						console.log(removeList,selloutList)
+						// 有已下架或已售罄产品提示
+						if(removeList.length || selloutList.length){
+							uni.showModal({
+								title: '提示',
+								content: (removeList.length ? `产品${removeList.join(',')}已下架,`:'')+(selloutList.length?`产品${selloutList.join(',')}已售罄,`:'')+`不可采购。`+(successList.length?'是否继续采购其他产品?':''),
+								showCancel: successList.length,
+								confirmText: successList.length?'确定':'只知道了',
+								success(ret) {
+									if(ret.confirm && successList.length){
+										_this.submitForm(successList,delSn)
+									}
+								}
+							})
+						}else{
+							// 提交
+							_this.submitForm(successList,delSn)
 						}
-					})
-					return
-				}
-				
-				// 提交
-				this.submitForm(detailList,cartSn)
+					}else{
+						uni.showToast({
+							title: res.message,
+							icon: 'none'
+						})
+					}
+				})
 			},
 			// 确认提交
 			submitForm(detailList,cartSn){
@@ -452,7 +487,7 @@
 					uni.hideLoading()
 					if(res.status == 200){
 						// 删除已提交产品
-						this.removeCart(cartSn,true)
+						this.removeCart(cartSn,true,false)
 						res.data.detailList = []
 						this.$store.state.vuex_tempData = res.data
 						uni.navigateTo({
@@ -470,10 +505,12 @@
 			getChooseHeji(){
 				this.totalAmount = 0
 				this.totalNum = 0
+				this.totalSel = 0
 				this.list.forEach(key => {
 					key.filter(item=>item.checked).forEach(item => {
 						this.totalAmount += item.price * item.qty // 总金额
 						this.totalNum += item.qty // 总数量
+						this.totalSel += 1 // 已选数量
 					})
 				})
 			},

+ 21 - 9
pagesB/cart/productitem.vue

@@ -12,7 +12,7 @@
 				 <view class="choose-product-item-img">
 					<image mode="aspectFit" :src="item.productImage+'?x-oss-process=image/resize,p_30'" style="width: 100%;height: 180rpx;"></image>
 					<view class="back-price xiajia" v-if="item.status==0">下架</view>
-					<view class="back-price xiajia" v-if="item.dealerScopeFlag==0">售罄</view>
+					<view class="back-price xiajia" v-else-if="item.dealerScopeFlag==0">售罄</view>
 					<view class="choose-product-item-left-info-code">
 						<text max-lines="1" overflow="ellipsis">{{item.productCode}}</text>
 					</view>
@@ -27,11 +27,14 @@
 						<view>
 							<view v-if="item.status==1&&item.dealerScopeFlag==1" :style="{opacity:!item.edit?1:0,width:!item.edit?'auto':0}">
 								<view class="flex align_center qty-box">
-									<view class="qty-btn" @click="changeQty(item.qty-1,item.cartSn,1)" :class="(item.qty <= 1)?'qty-disabled':''">-</view>
-									<view class="qty-num"><input type="number" @blur="changeQty(item.qty,item.cartSn,0)" v-model="item.qty"/></view>
-									<view class="qty-btn" @click="changeQty(item.qty+1,item.cartSn,1)" :class="(item.qty >= 999999)?'qty-disabled':''">+</view>
+									<view class="qty-btn" @click="changeQty(item.qty-1,item,1)" :class="(item.qty <= 1)?'qty-disabled':''">-</view>
+									<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+'px'}"><input type="number" @blur="changeQty(item.qty,item,0)" v-model="item.qty"/></view>
+									<view class="qty-btn" @click="changeQty(item.qty+1,item,1)" :class="(item.qty >= 999)?'qty-disabled':''">+</view>
 								</view>
 							</view>
+							<view v-if="!item.edit && (item.status==0||item.dealerScopeFlag==0)" class="edit-qty">
+								X <text>{{item.qty}}</text>
+							</view>
 							<view v-if="item.edit" class="edit-qty">
 								X <text>{{item.qty}}</text>
 								<image style="width: 24px;height: 24px;" mode="aspectFill" :src="'../static/ashbin.png'" @click="remove(item.cartSn)"></image>
@@ -62,11 +65,20 @@
 			}
 		},
 		methods: {
-			changeQty(e, cartSn) {
-				if(e<=0 || e>=999999){
-					return
+			changeQty(value,item,type) {
+				const max = 999
+				const v = value > max ? max : (value==''?1:value)
+				if(value > max && type == 0){
+					this.updateNums(value,item.cartSn)
+					this.$nextTick(()=>{
+						this.updateNums(v,item.cartSn)
+					})
+				}else{
+					this.updateNums(v,item.cartSn)
 				}
-				this.$emit('changeQty', e, cartSn)
+			},
+			updateNums(e, cartSn) {
+				this.$emit('changeQty', Number(e), cartSn)
 			},
 			remove(cartSn){
 				this.$emit('remove', [cartSn], false)
@@ -98,7 +110,7 @@
 			}
 		}
 		.qty-num{
-			width: 30px;
+			width: 24px;
 			height: 22px;
 			line-height: 22px;
 			padding:0 3px;

+ 1 - 1
pagesB/components/chooseProductItemSkline.vue

@@ -10,7 +10,7 @@
 					<image mode="aspectFit" :src="item.productImage+'?x-oss-process=image/resize,p_30'" style="width: 100%;height: 100%;"></image>
 					<view class="back-price fantext" v-if="item.promoRuleValue&&!isView">返<text>{{item.promoRuleValue}}</text>元</view>
 					<view class="back-price xiajia" v-if="isView&&item.status==0">下架</view>
-					<view class="back-price xiajia" v-if="isView&&item.dealerScopeFlag==0">售罄</view>
+					<view class="back-price xiajia" v-else-if="isView&&item.dealerScopeFlag==0">售罄</view>
 					<view class="choose-product-item-left-info-code ellipsis-one">{{item.productCode}}</view>
 				 </view>
 				 <view class="choose-product-item-info">

+ 1 - 1
pagesB/procureOrder.vue

@@ -13,7 +13,7 @@
 			</view>
 		</view>
 		<view class="order-body">
-			<view class="info partList" v-if="partList.length" style="height: 50vh;overflow: auto;">
+			<view class="info partList" v-if="partList.length" style="max-height: 50vh;overflow: auto;">
 				<view class="infoList">
 					<view class="title">
 						产品列表

+ 100 - 31
pagesB/shopiing/productDetail.vue

@@ -37,9 +37,9 @@
 			<u-divider bg-color="">商品详情</u-divider>
 			<view class="product-info-guige" v-if="detail&&detail.product">
 				<view class="row">品牌:<text>{{detail.product.productBrandName||'--'}}</text></view>
-				<view class="row">原厂编码:<text>{{detail.product.origCode||'--'}} </text> <view class="copyText" @click="copy(detail.product.origCode)">复制</view></view>
-				<view class="row">产品编码:<text>{{detail.product.code||'--'}}</text> <view class="copyText" @click="copy(detail.product.origCode)">复制</view></view>
-				<view class="row">条形码:<text>{{detail.product.qrCode||'--'}}</text> <view class="copyText" @click="copy(detail.product.origCode)">复制</view></view>
+				<view class="row">原厂编码:<text>{{detail.product.origCode||'--'}} </text> <view class="copyText" v-if="detail.product.origCode" @click="copy(detail.product.origCode)">复制</view></view>
+				<view class="row">产品编码:<text>{{detail.product.code||'--'}}</text> <view class="copyText" v-if="detail.product.code" @click="copy(detail.product.code)">复制</view></view>
+				<view class="row">条形码:<text>{{detail.product.qrCode||'--'}}</text> <view class="copyText" v-if="detail.product.qrCode" @click="copy(detail.product.qrCode)">复制</view></view>
 				<view class="row-ban">商品尺寸:<text>{{detail.product.size||'--'}}</text></view>
 				<view class="row-ban">计量单位:<text>{{detail.product.unit||'--'}}</text></view>
 				<view class="row-ban">重量:<text>{{detail.product.weight||'--'}}</text></view>
@@ -104,6 +104,16 @@
 				<view :style="{height:safeAreaBottom+'px'}"></view>
 			</view>
 		</page-container>
+		
+		<!-- 去认证弹框 -->
+		<u-popup v-model="showPopup" mode="center" :border-radius="20" closeable>
+			<view style="background-color: #fff;padding: 1rem;">
+				<u-image width="533" height="415" src="/static/authimg.jpg"></u-image>
+				<view style="padding-top:1rem;" class="flex justify_center">
+					<u-button @click="toAuthStore()" shape="circle" :custom-style="{background:'#066cff',color:'#fff',width:'350rpx'}">开始认证</u-button>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -114,11 +124,12 @@
 	} from 'vuex'
 	import { addCart, getCartCount } from '@/api/cart.js'
 	import { getShopDetail } from '@/api/shop.js'
-	import { purchaseSave } from '@/api/purchase.js'
+	import { purchaseSave, purchaseCheck } from '@/api/purchase.js'
 	export default {
 		data() {
 			return {
 				showPopu: false, // 弹框
+				showPopup: false, // 去认证弹框
 				statusBarHeight: 0, // 状态栏高度
 				safeAreaBottom: 0, // 底部安全区域高度
 				imgList: [],
@@ -169,6 +180,13 @@
 					data: text,
 				})
 			},
+			// 去认证
+			toAuthStore(){
+				this.showPopup = false
+				uni.navigateTo({
+					url: '/pages/storeManage/storeAuth'
+				})
+			},
 			// 产品详情
 			getDetail(){
 				uni.showLoading({
@@ -204,21 +222,26 @@
 			// 加入购物车
 			addCart(){
 				if(this.hasLogin){
-					uni.showLoading({
-						title: '加入中...',
-						mask: true
-					})
-					// 加入购物车
-					addCart({
-						qty: 1,
-						price: this.detail.price,
-						productSn: this.detail.productSn
-					}).then(res => {
-						if(res.status == 200){
-							this.cartCount()
-							uni.hideLoading()
-						}
-					})
+					// 游客未认证
+					if(this.userInfo.sysUserFlag == '0'){
+						this.showPopup = true
+					}else{
+						uni.showLoading({
+							title: '加入中...',
+							mask: true
+						})
+						// 加入购物车
+						addCart({
+							qty: 1,
+							price: this.detail.price,
+							productSn: this.detail.productSn
+						}).then(res => {
+							if(res.status == 200){
+								this.cartCount()
+								uni.hideLoading()
+							}
+						})
+					}
 				}else{
 					uni.navigateTo({
 						url: '/pages/login/login'
@@ -240,18 +263,23 @@
 			// 立即购买
 			toBuy(){
 				if(this.hasLogin){
-					if(this.detail.status==0 || this.detail.dealerScopeFlag==0){
-						uni.showToast({
-							title: '此商品已'+(this.detail.status==0?'下架':'售罄'),
-							icon: 'none'
-						})
+					// 游客未认证
+					if(this.userInfo.sysUserFlag == '0'){
+						this.showPopup = true
 					}else{
-						// 打开数量选择弹框
-						if(!this.showPopu){
-							this.showPopu = true
+						if(this.detail.status==0 || this.detail.dealerScopeFlag==0){
+							uni.showToast({
+								title: '此商品已'+(this.detail.status==0?'下架':'售罄'),
+								icon: 'none'
+							})
 						}else{
-							// 提交
-							this.submitOrder()
+							// 打开数量选择弹框
+							if(!this.showPopu){
+								this.showPopu = true
+							}else{
+								// 提交
+								this.submitOrder()
+							}
 						}
 					}
 				}else{
@@ -266,15 +294,56 @@
 					title: '提交中...',
 					mask: true
 				})
-				const detailList = [{
+				const _this = this
+				purchaseCheck({detailList: [{
 							productSn:this.detail.productSn,
 							productCode:this.detail.productCode,
 							qty: this.qty,
 							price:this.detail.price,
-						}]
+						}]}).then(res => {
+					if(res.status == 200){
+						const successList = res.data.successList.map(item => {
+							return {
+								productSn:item.productSn,
+								productCode: item.productCode,
+								qty: item.qty,
+								price:item.price
+							}
+						})
+						const removeList = res.data.removeList.map(item => item.productCode)
+						const selloutList = res.data.selloutList.map(item => item.productCode)
+						// 有已下架或已售罄产品提示
+						if(removeList.length || selloutList.length){
+							uni.showModal({
+								title: '提示',
+								content: (removeList.length ? `产品${removeList.join(',')}已下架,`:'')+(selloutList.length?`产品${selloutList.join(',')}已售罄,`:'')+`不可采购。`+(successList.length?'是否继续采购其他产品?':''),
+								showCancel: successList.length,
+								confirmText: successList.length?'确定':'只知道了',
+								success(ret) {
+									uni.hideLoading()
+									if(ret.confirm && successList.length){
+										_this.submitForm(successList)
+									}
+								}
+							})
+						}else{
+							// 直接提交
+							_this.submitForm(successList)
+						}
+					}else{
+						uni.hideLoading()
+						uni.showToast({
+							title: res.message,
+							icon: 'none'
+						})
+					}
+				})
+			},
+			submitForm(detailList){
 				purchaseSave({
 					detailList: detailList
 				}).then(res => {
+					uni.hideLoading()
 					if(res.status == 200){
 						res.data.detailList = []
 						this.$store.state.vuex_tempData = res.data