Browse Source

bug 修复

lilei 2 năm trước cách đây
mục cha
commit
bb91cb0a6f

+ 6 - 6
pagesA/digitalShelf/choosePart.vue

@@ -56,7 +56,7 @@
 											<view class="item-detail-text flex_1">
 												<view @click="openPriceModal(item)">
 													<text class="item-price" v-if="showCarPrice">¥{{item.price||0}}</text>
-													<text class="item-price" v-else>¥{{item.cost||0}}</text>
+													<text class="item-price" v-if="showCostPrice">¥{{item.cost||0}}</text>
 													<u-icon name="arrow-right" v-if="priceShowVal"></u-icon>
 												</view>
 											</view>
@@ -108,7 +108,7 @@
 									<view class="flex justify_between">
 										<view class="item-detail-text flex_1" @click="openPriceModal(item)">
 											<text class="item-price" v-if="showCarPrice">¥{{item.price||0}}</text>
-											<text class="item-price" v-else>¥{{item.cost||0}}</text>
+											<text class="item-price" v-if="showCostPrice">¥{{item.cost||0}}</text>
 											<u-icon name="arrow-right" v-if="priceShowVal"></u-icon>
 										</view>
 										<view class="item-detail-text" v-if="item.currentInven">
@@ -180,7 +180,7 @@
 									<view class="flex justify_between">
 										<view class="item-detail-text flex_1">
 											<text class="item-price" v-if="showCarPrice">¥{{item.price||0}}</text>
-											<text class="item-price" v-else>¥{{item.cost||0}}</text>
+											<text class="item-price" v-if="showCostPrice">¥{{item.cost||0}}</text>
 										</view>
 										<view class="item-detail-text">
 											<u-number-box @change="updateCartNums" @blur="updateCartNums" v-model="item.qty" :index="'cart_'+item.productSn" :min="0" :max="item.currentInven||999999"></u-number-box>
@@ -323,7 +323,7 @@
 			getShowPriceType(){
 				const storeShelf = this.$store.state.vuex_storeShelf
 				findShelfUserParam({shelfSn: storeShelf?storeShelf.shelfSn:''}).then(res => {
-					this.priceShowVal = res.data.carOwnerPrice == '1' && res.data.purchasesPrice == '1'
+					this.priceShowVal = res.data ? res.data.carOwnerPrice == '1' && res.data.purchasesPrice == '1' : false
 					// 选中了2中价格,则从列表显示价格中取值
 					if(this.priceShowVal){
 						// 进货价
@@ -332,9 +332,9 @@
 						this.showCarPrice = res.data.priceShowType == 'CAR_OWNER_PRICE'
 					}else{
 						// 进货价
-						this.showCostPrice = res.data.purchasesPrice == '1'
+						this.showCostPrice = res.data ? res.data.purchasesPrice == '1' : false
 						// 车主价
-						this.showCarPrice = res.data.carOwnerPrice == '1'
+						this.showCarPrice = res.data ? res.data.carOwnerPrice == '1' : false
 					}
 				})
 			},

+ 1 - 1
pagesA/queryByCode/confirmQh.vue

@@ -12,7 +12,7 @@
 		 		<u-number-box :min="1" :max="nowData.currentInven" v-model="qty" color="#000" bg-color="#fff" size="36" :input-height="80" :input-width="180"></u-number-box>
 		 	</view>
 		 	<view class="kucun flex justify_center">
-				<view class="pcode">
+				<view class="pcode" v-if="nowData.showPrice">
 					<view>
 						价格:<text class="item-price">{{nowData.showPrice||0}}</text>
 					</view>

+ 5 - 5
pagesA/queryByCode/queryByCode.vue

@@ -37,7 +37,7 @@
 								<view class="pname flex align_center justify_between">
 									<view class="pcode">
 										<text class="item-price" v-if="showCarPrice">价格:¥{{item.price||0}}</text>
-										<text class="item-price" v-else>价格:¥{{item.cost||0}}</text>
+										<text class="item-price" v-if="showCostPrice">价格:¥{{item.cost||0}}</text>
 									</view>
 									<view class="kc">库存:<text>{{item.currentInven}}</text>{{item.unit}}</view>
 								</view>
@@ -95,7 +95,7 @@
 		methods: {
 			getShowPriceType(){
 				findShelfUserParam({shelfSn: this.shelfSn}).then(res => {
-					this.priceShowVal = res.data.carOwnerPrice == '1' && res.data.purchasesPrice == '1'
+					this.priceShowVal = res.data ? res.data.carOwnerPrice == '1' && res.data.purchasesPrice == '1' : false
 					// 选中了2中价格,则从列表显示价格中取值
 					if(this.priceShowVal){
 						// 进货价
@@ -104,9 +104,9 @@
 						this.showCarPrice = res.data.priceShowType == 'CAR_OWNER_PRICE'
 					}else{
 						// 进货价
-						this.showCostPrice = res.data.purchasesPrice == '1'
+						this.showCostPrice = res.data ? res.data.purchasesPrice == '1' : false
 						// 车主价
-						this.showCarPrice = res.data.carOwnerPrice == '1'
+						this.showCarPrice = res.data ? res.data.carOwnerPrice == '1' : false
 					}
 				})
 			},
@@ -116,7 +116,7 @@
 					const params = {
 						shelfSn: this.shelfSn, 
 						billSource: 'product_code',
-						showPrice: this.showCarPrice ? item.price : item.cost
+						showPrice: this.showCarPrice ? item.price : (this.showCostPrice?item.cost:'')
 					}
 					this.$store.state.vuex_tempData = Object.assign(params, item)
 					uni.navigateTo({