lilei 1 年之前
父節點
當前提交
9202a97108
共有 1 個文件被更改,包括 42 次插入28 次删除
  1. 42 28
      pagesA/digitalShelf/choosePart.vue

+ 42 - 28
pagesA/digitalShelf/choosePart.vue

@@ -62,14 +62,14 @@
 											<view class="item-detail-text flex_1">
 											<view class="item-detail-text flex_1">
 												<!-- 货架产品 -->
 												<!-- 货架产品 -->
 												<view @click="openPriceModal(item,1,showShelfDetial)" v-if="item.affiliation=='SHELF'">
 												<view @click="openPriceModal(item,1,showShelfDetial)" v-if="item.affiliation=='SHELF'">
-													<text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice.shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</text>
-													<text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice.shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
+													<text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice&&configPrice.shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</text>
+													<text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice&&configPrice.shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
 													<u-icon name="arrow-right" v-if="priceShowVal&&showShelfDetial"></u-icon>
 													<u-icon name="arrow-right" v-if="priceShowVal&&showShelfDetial"></u-icon>
 												</view>
 												</view>
 												<!-- 非货架 -->
 												<!-- 非货架 -->
 												<view @click="openPriceModal(item,1,showNonShelfDetial)" v-else>
 												<view @click="openPriceModal(item,1,showNonShelfDetial)" v-else>
-													<text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice.non_shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</text>
-													<text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice.non_shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
+													<text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice&&configPrice.non_shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</text>
+													<text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice&&configPrice.non_shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
 													<u-icon name="arrow-right" v-if="priceShowVal&&showNonShelfDetial"></u-icon>
 													<u-icon name="arrow-right" v-if="priceShowVal&&showNonShelfDetial"></u-icon>
 												</view>
 												</view>
 											</view>
 											</view>
@@ -123,8 +123,8 @@
 									</view>
 									</view>
 									<view class="flex justify_between">
 									<view class="flex justify_between">
 										<view class="item-detail-text flex_1" @click="openPriceModal(item,0,showShelfDetial)">
 										<view class="item-detail-text flex_1" @click="openPriceModal(item,0,showShelfDetial)">
-											<text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice.shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</text>
-											<text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice.shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
+											<text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice&&configPrice.shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</text>
+											<text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice&&configPrice.shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
 											<u-icon name="arrow-right" v-if="priceShowVal&&showShelfDetial"></u-icon>
 											<u-icon name="arrow-right" v-if="priceShowVal&&showShelfDetial"></u-icon>
 										</view>
 										</view>
 										<view class="item-detail-text" v-if="item.currentInven">
 										<view class="item-detail-text" v-if="item.currentInven">
@@ -237,21 +237,21 @@
 					<text>{{tempData.name||'--'}}</text>
 					<text>{{tempData.name||'--'}}</text>
 				</view>
 				</view>
 				<view v-if="tempData.affiliation=='SHELF'">
 				<view v-if="tempData.affiliation=='SHELF'">
-					<view class="itemlist" v-if="configPrice.shelf_cost_show == '1'">
+					<view class="itemlist" v-if="configPrice&&configPrice.shelf_cost_show == '1'">
 						<text>进货价</text>
 						<text>进货价</text>
 						<text>{{tempData.cost?'¥'+tempData.cost:'暂无价格'}}</text>
 						<text>{{tempData.cost?'¥'+tempData.cost:'暂无价格'}}</text>
 					</view>
 					</view>
-					<view class="itemlist" v-if="configPrice.shelf_price_show == '1'">
+					<view class="itemlist" v-if="configPrice&&configPrice.shelf_price_show == '1'">
 						<text>车主价</text>
 						<text>车主价</text>
 						<text>{{tempData.price?'¥'+tempData.price:'暂无价格'}}</text>
 						<text>{{tempData.price?'¥'+tempData.price:'暂无价格'}}</text>
 					</view>
 					</view>
 				</view>
 				</view>
 				<view v-else>
 				<view v-else>
-					<view class="itemlist" v-if="configPrice.non_shelf_cost_show == '1'">
+					<view class="itemlist" v-if="configPrice&&configPrice.non_shelf_cost_show == '1'">
 						<text>进货价</text>
 						<text>进货价</text>
 						<text>{{tempData.cost?'¥'+tempData.cost:'暂无价格'}}</text>
 						<text>{{tempData.cost?'¥'+tempData.cost:'暂无价格'}}</text>
 					</view>
 					</view>
-					<view class="itemlist" v-if="configPrice.non_shelf_price_show == '1'">
+					<view class="itemlist" v-if="configPrice&&configPrice.non_shelf_price_show == '1'">
 						<text>车主价</text>
 						<text>车主价</text>
 						<text>{{tempData.price?'¥'+tempData.price:'暂无价格'}}</text>
 						<text>{{tempData.price?'¥'+tempData.price:'暂无价格'}}</text>
 					</view>
 					</view>
@@ -337,10 +337,10 @@
 				return this.$store.state.vuex_configPrice
 				return this.$store.state.vuex_configPrice
 			},
 			},
 			showShelfDetial(){
 			showShelfDetial(){
-				return this.configPrice.shelf_price_show == '1'&&this.configPrice.shelf_cost_show == '1'
+				return this.configPrice && this.configPrice.shelf_price_show == '1'&&this.configPrice.shelf_cost_show == '1'
 			},
 			},
 			showNonShelfDetial(){
 			showNonShelfDetial(){
-				return this.configPrice.non_shelf_price_show == '1'&&this.configPrice.non_shelf_cost_show == '1'
+				return this.configPrice && this.configPrice.non_shelf_price_show == '1'&&this.configPrice.non_shelf_cost_show == '1'
 			}
 			}
 		},
 		},
 		onLoad(opts) {
 		onLoad(opts) {
@@ -368,21 +368,27 @@
 		methods: {
 		methods: {
 			getShowPriceType(){
 			getShowPriceType(){
 				const storeShelf = this.$store.state.vuex_storeShelf
 				const storeShelf = this.$store.state.vuex_storeShelf
-				findShelfUserParam({shelfSn: storeShelf?storeShelf.shelfSn:''}).then(res => {
-					this.priceShowVal = res.data ? res.data.carOwnerPrice == '1' && res.data.purchasesPrice == '1' : false
-					// 选中了2中价格,则从列表显示价格中取值
-					if(this.priceShowVal){
-						// 进货价
-						this.showCostPrice = res.data.priceShowType == 'PURCHASES_PRICE'
-						// 车主价
-						this.showCarPrice = res.data.priceShowType == 'CAR_OWNER_PRICE'
-					}else{
-						// 进货价
-						this.showCostPrice = res.data ? res.data.purchasesPrice == '1' : false
-						// 车主价
-						this.showCarPrice = res.data ? res.data.carOwnerPrice == '1' : false
-					}
-				})
+				if(storeShelf){
+					findShelfUserParam({shelfSn: storeShelf?storeShelf.shelfSn:''}).then(res => {
+						this.priceShowVal = res.data ? res.data.carOwnerPrice == '1' && res.data.purchasesPrice == '1' : false
+						// 选中了2中价格,则从列表显示价格中取值
+						if(this.priceShowVal){
+							// 进货价
+							this.showCostPrice = res.data.priceShowType == 'PURCHASES_PRICE'
+							// 车主价
+							this.showCarPrice = res.data.priceShowType == 'CAR_OWNER_PRICE'
+						}else{
+							// 进货价
+							this.showCostPrice = res.data ? res.data.purchasesPrice == '1' : false
+							// 车主价
+							this.showCarPrice = res.data ? res.data.carOwnerPrice == '1' : false
+						}
+					})
+				}else{
+					this.priceShowVal = false
+					this.showCostPrice = false
+					this.showCarPrice = false
+				}
 			},
 			},
 			// 打开价格信息弹框
 			// 打开价格信息弹框
 			openPriceModal(row,type,show){
 			openPriceModal(row,type,show){
@@ -451,7 +457,7 @@
 					codeList: this.vinCode,
 					codeList: this.vinCode,
 					shelfSn: storeShelf?storeShelf.shelfSn:''
 					shelfSn: storeShelf?storeShelf.shelfSn:''
 				}).then(res => {
 				}).then(res => {
-					console.log(res,'getShelfProductType')
+					// console.log(res,'getShelfProductType')
 					this.leve2Data = this.labelToPart(res.data || [])
 					this.leve2Data = this.labelToPart(res.data || [])
 					// 默认该车适用或全部
 					// 默认该车适用或全部
 					this.selLeve2('all')
 					this.selLeve2('all')
@@ -668,6 +674,14 @@
 						})
 						})
 					}
 					}
 				}else{
 				}else{
+					const storeShelf = this.$store.state.vuex_storeShelf
+					if(!storeShelf){
+						uni.showToast({
+							icon: 'none',
+							title: '您还未开通数字货架,暂时无法使用'
+						})
+						return
+					}
 					// 已认证用户
 					// 已认证用户
 					if(this.partListData.length==0){
 					if(this.partListData.length==0){
 						uni.showToast({
 						uni.showToast({