Browse Source

bug 修复

lilei 2 years ago
parent
commit
a2c3fe5d19

+ 32 - 22
pages/digitalShelf/choosePart.vue

@@ -54,11 +54,18 @@
 										</view>
 										<view class="flex justify_between">
 											<view class="item-detail-text flex_1" v-if="item.affiliation=='SHELF'">
-												<text class="item-price" v-if="showJhPrice">¥{{item.cost||0}}</text>
-												<text class="item-price" v-else>¥{{item.price||0}}</text>
+												 <view v-if="showPrice[0]">
+												 	<view v-if="showPrice[1]=='PURCHASES_PRICE'">
+												 		<text class="item-price" v-if="isAdmin || showPrice[2]">¥{{item.cost||0}}</text>
+												 	</view>
+												 	<text v-else class="item-price">¥{{item.price||0}}</text>
+												 </view>
 											</view>
 											<view class="item-detail-text flex_1" v-if="item.affiliation=='SUPER_CATALOGUE'">
-												<text class="item-price" v-if="!showJhPrice">¥{{item.price||0}}</text>
+												<view v-if="showPrice[0]">
+													<text class="item-price" v-if="showPrice[1]!='PURCHASES_PRICE'">¥{{item.price||0}}</text>
+													<text class="item-price" v-else></text>
+												</view>
 											</view>
 											<view class="item-detail-text" v-if="item.currentInven">
 												<u-button shape="circle" @click="addPart(item)" v-if="!item.checked" :custom-style="{width:'48upx',height:'48upx'}" type="primary" size="mini">
@@ -106,10 +113,13 @@
 										<text class="item-detail-text">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
 									</view>
 									<view class="flex justify_between">
-										<view class="item-detail-text flex_1">
-											<text class="item-price" v-if="showJhPrice">¥{{item.cost||0}}</text>
-											<text class="item-price" v-else>¥{{item.price||0}}</text>
+										<view class="item-detail-text flex_1" v-if="showPrice[0]">
+											<view v-if="showPrice[1]=='PURCHASES_PRICE'">
+												<text class="item-price" v-if="isAdmin || showPrice[2]">¥{{item.cost||0}}</text>
+											</view>
+											<text v-else class="item-price">¥{{item.price||0}}</text>
 										</view>
+										<view class="item-detail-text flex_1" v-else></view>
 										<view class="item-detail-text" v-if="item.currentInven">
 											<u-button shape="circle" @click="addPart(item)" v-if="!item.checked" :custom-style="{width:'48upx',height:'48upx',background:'#066cff'}" type="primary" size="mini">
 												<u-icon name="plus" color="#fff" size="28"></u-icon>
@@ -174,12 +184,19 @@
 										<text class="item-detail-text" v-if="item.affiliation!='SUPER_CATALOGUE'">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
 									</view>
 									<view class="flex justify_between">
-										<view class="item-detail-text flex_1" v-if="item.affiliation&&item.affiliation=='SHELF'">
-											<text class="item-price" v-if="showJhPrice">¥{{item.cost||0}}</text>
-											<text class="item-price" v-else>¥{{item.price||0}}</text>
+										<view class="item-detail-text flex_1" v-if="item.affiliation=='SUPER_CATALOGUE'">
+											<view v-if="showPrice[0]">
+												<text class="item-price" v-if="showPrice[1]=='CAR_OWNER_PRICE'">¥{{item.price||0}}</text>
+												<text class="item-price" v-else></text>
+											</view>
 										</view>
 										<view class="item-detail-text flex_1" v-else>
-											<text class="item-price" v-if="!showJhPrice">¥{{item.price||0}}</text>
+											 <view v-if="showPrice[0]">
+												  <view v-if="showPrice[1]=='PURCHASES_PRICE'">
+												  	<text class="item-price" v-if="isAdmin || showPrice[2]">¥{{item.cost||0}}</text>
+												  </view>
+												  <text v-else class="item-price">¥{{item.price||0}}</text>
+											 </view>
 										</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>
@@ -253,18 +270,11 @@
 			storeApply(){
 				return this.$store.state.vuex_storeAuthInfo || null
 			},
-			showJhPrice(){
-				const showPrice = this.$store.state.vuex_showPrice
-				const isAdmin = this.userInfo.superAdmin == 1
-				const isJhPrice = showPrice[0] && showPrice[1] == 'PURCHASES_PRICE'
-				// 是管理员
-				if(isAdmin){
-					// 是否进货价
-					return isJhPrice
-				}else{
-					// 员工且是否可见进货价
-					return isJhPrice && showPrice[2]
-				}
+			showPrice(){
+				return this.$store.state.vuex_showPrice
+			},
+			isAdmin(){
+				return this.userInfo.superAdmin == 1
 			}
 		},
 		onLoad(opts) {

+ 13 - 2
pages/index/index.vue

@@ -59,7 +59,7 @@
 				<u-icon name="scan" size="60"></u-icon><text class="ml10">扫描VIN</text>
 			</view>
 			<!-- 直接取货 -->
-			<view class="quickButton flex align_center" v-if="userInfo.sysUserFlag == '1'" @click="showAction = true">
+			<view class="quickButton flex align_center" v-if="userInfo.sysUserFlag == '1'" @click="openTakeGood">
 				<text>没有VIN,直接取货</text>
 			</view>
 			<view class="flex align_center justify_center">
@@ -348,6 +348,17 @@
 			},
 			// 保证金支付
 			toPayBondAmount(){},
+			openTakeGood(){
+				// 已有数字货架
+				if(this.hasShelf){
+					this.showAction = true
+				}else{
+					uni.showToast({
+						icon:'none',
+						title: '门店没有关联数字货架,无法使用此功能!'
+					})
+				}
+			},
 			// 选择取货方式
 			clickAction(index){
 				const shelfSn = this.hasShelf.shelfSn
@@ -362,7 +373,7 @@
 							// 二维码
 							if(res.scanType == 'QR_CODE'){
 								const ret = res.result.split("&")
-								params.productSn = ret[1] // 产品编码sn
+								params.productSn = ret[2] // 产品编码sn
 							}else{
 								params.qrCode = res.result
 							}

+ 1 - 1
pages/morePage/morePage.vue

@@ -54,7 +54,7 @@
 				</u-cell-item>
 			</u-cell-group>
 			<u-cell-group :border="false">
-				<u-cell-item title="价格显示设置" v-if="$hasPermissions('M_priceShow_mini')" @click="toPage('/pages/storeManage/priceSetting/priceSetting')" :title-style="{fontSize:'1em'}">
+				<u-cell-item title="价格显示设置" v-if="$hasPermissions('M_roleSetting_mini')" @click="toPage('/pages/storeManage/priceSetting/priceSetting')" :title-style="{fontSize:'1em'}">
 					<text slot="icon"></text>
 				</u-cell-item>
 			</u-cell-group>

+ 30 - 8
pages/queryByCode/confirmQh.vue

@@ -14,7 +14,7 @@
 		 	<view class="kucun">可用库存:<text>{{nowData.currentInven}}</text>{{nowData.unit}}</view>
 		 </view>
 		 <view class="buttons">
-			 <u-button :throttle-time="100" :loading="loading" @click="outShelfOrder" :custom-style="{ background: '#066cff', color: '#fff',width:'400rpx' }" shape="circle" type="info">
+			 <u-button :throttle-time="100" :loading="loading" @click="onSubmit" :custom-style="{ background: '#066cff', color: '#fff',width:'400rpx' }" shape="circle" type="info">
 			 	确认取货
 			 </u-button>
 		 </view>
@@ -35,6 +35,19 @@
 			 this.nowData = JSON.parse(decodeURIComponent(options.data));
 		},
 		methods: {
+			onSubmit(){
+				const _this = this
+				uni.showModal({
+					title: '提示',
+					content: '取货后扣减库存,确认取货吗?',
+					confirmText: '确定',
+					success(res) {
+						if(res.confirm){
+							_this.outShelfOrder()
+						}
+					}
+				})
+			},
 			// 确认取货
 			 outShelfOrder(){
 				 this.loading = true
@@ -48,18 +61,27 @@
 					 if(res.status == 200){
 						 uni.showToast({
 						 	icon:'none',
-							title: res.message
+							title: res.message,
+							duration: 4000
 						 })
 						 uni.redirectTo({
 						 	url: "/pages/digitalShelf/orderDetail?shelfOrderSn="+res.data.shelfOrderSn
 						 })
 					 }else{
-						 uni.showModal({
-						 	title: '取货失败',
-						 	content: res.message,
-						 	confirmText: '知道了',
-						 	showCancel: false,
-						 })
+						 if(res.errCode == 'VALIDATE_STOCK_LACK'){
+							 uni.showModal({
+							 	title: '以下产品库存不足',
+							 	content: res.message,
+							 	confirmText: '知道了',
+							 	showCancel: false,
+							 })
+						 }else{
+							 uni.showToast({
+							 	icon:'none',
+								title: res.message,
+								duration: 4000
+							 })
+						 }
 					 }
 					this.loading = false
 				 })

+ 26 - 15
pages/queryByCode/queryByCode.vue

@@ -26,10 +26,11 @@
 								<u-image :src="item.images?item.images:`/static/def_imgs.png`" width="128" height="128" border-radius="10"></u-image>
 							</view>
 							<view class="pinfo">
-								<view class="pname">
-									<text>{{item.shelfPlaceCode}}</text>{{item.code}}
+								<view class="pname flex align_center justify_between">
+									<view><text>{{item.shelfPlaceCode}}</text>{{item.code}}</view>
+									<view class="kc">库存:<text>{{item.currentInven}}</text>{{item.unit}}</view>
 								</view>
-								<view class="ptxt flex align_center justify_between">
+								<view class="ptxt">
 									<view>
 										<text class="pcode">{{item.name}}</text>
 									</view>
@@ -66,13 +67,26 @@
 		onLoad(opts) {
 			this.shelfSn = this.$store.state.vuex_storeShelf.shelfSn
 		},
+		onShow() {
+			if(this.queryWord!=''){
+				this.getpartList()
+			}
+		},
 		methods: {
 			//取货
 			toEdit(item){
-				const params = Object.assign({shelfSn: this.shelfSn, billSource: 'product_code'},item)
-				uni.navigateTo({
-					url: '/pages/queryByCode/confirmQh?data='+ encodeURIComponent(JSON.stringify(params))
-				})
+				if(item.currentInven){
+					const params = Object.assign({shelfSn: this.shelfSn, billSource: 'product_code'},item)
+					uni.navigateTo({
+						url: '/pages/queryByCode/confirmQh?data='+ encodeURIComponent(JSON.stringify(params))
+					})
+				}else{
+					uni.showToast({
+						icon:'none',
+						title: '库存不足,不能取货!',
+						duration: 4000
+					})
+				}
 			},
 			clearSearch(){
 				this.queryWord = ''
@@ -183,14 +197,11 @@
 						font-size: 28rpx;
 						color: #191919;
 						margin-bottom: 10rpx;
-						text{
-							font-weight: normal;
-							margin-right: 6rpx;
-							padding: 0 10rpx;
-							background: rgba(3, 54, 146, 0.15);
-							border-radius: 100rpx;
-							color: #033692;
-							font-size: 24rpx;
+						.kc{
+							color: #999;
+							text{
+								color: #333;
+							}
 						}
 					}
 					.ptxt{