lilei vor 2 Jahren
Ursprung
Commit
b1fdd0ece7
3 geänderte Dateien mit 84 neuen und 21 gelöschten Zeilen
  1. 7 0
      pages/digitalShelf/orderList.vue
  2. 44 11
      pages/queryByCode/confirmQh.vue
  3. 33 10
      pages/queryByCode/queryByCode.vue

+ 7 - 0
pages/digitalShelf/orderList.vue

@@ -227,6 +227,13 @@
 						if(this.current == 0){
 							this.tabList[0].count = this.tabList[0].count - 1
 						}
+					}else{
+						uni.showModal({
+							title: '提示',
+							content: res.message,
+							confirmText: '知道了',
+							showCancel: false
+						})
 					}
 					this.message(res.data.message)
 				})

+ 44 - 11
pages/queryByCode/confirmQh.vue

@@ -2,7 +2,7 @@
 	<view class="content" v-if="nowData">
 		 <view class="productInfo">
 			 <view><u-image :src="nowData.images" border-radius="16" width="160" height="160" bg-color="#EBEBEB"></u-image></view>
-			 <view><text class="item-no">{{ nowData.shelfPlaceCode }}</text><text>{{ nowData.code }}</text></view>
+			 <view style="display: block;"><text class="item-no">{{ nowData.shelfPlaceCode }}</text><text>{{ nowData.code }}</text></view>
 			 <view class="item-name">
 			 	<text>{{ nowData.name }}</text>
 			 </view>
@@ -11,7 +11,17 @@
 		 	<view class="u-ninput">
 		 		<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">可用库存:<text>{{nowData.currentInven}}</text>{{nowData.unit}}</view>
+		 	<view class="kucun flex justify_center">
+				<view class="pcode" v-if="showPrice[0]">
+					<view v-if="showPrice[1]=='PURCHASES_PRICE'">
+						价格:<text class="item-price" v-if="isAdmin || showPrice[2]">{{nowData.cost||0}}</text>
+					</view>
+					价格:<text v-else class="item-price">{{nowData.price||0}}</text>
+				</view>
+				<view>
+					可用库存:<text>{{nowData.currentInven}}</text>{{nowData.unit}}
+				</view>
+			</view>
 		 </view>
 		 <view class="buttons">
 			 <u-button :throttle-time="100" :loading="loading" @click="onSubmit" :custom-style="{ background: '#066cff', color: '#fff',width:'400rpx' }" shape="circle" type="info">
@@ -34,6 +44,17 @@
 		onLoad(options) {
 			 this.nowData = this.$store.state.vuex_tempData
 		},
+		computed: {
+			userInfo(){
+				return this.$store.state.vuex_userInfo
+			},
+			showPrice(){
+				return this.$store.state.vuex_showPrice
+			},
+			isAdmin(){
+				return this.userInfo.superAdmin == 1
+			}
+		},
 		methods: {
 			onSubmit(){
 				const _this = this
@@ -59,15 +80,24 @@
 						}]
 				 }).then(res => {
 					 if(res.status == 200){
-						 uni.showToast({
-						 	icon:'none',
-							title: res.message,
-							duration: 4000
-						 })
-						 uni.$emit("updateQueryByCodeList")
-						 uni.redirectTo({
-						 	url: "/pages/digitalShelf/orderDetail?shelfOrderSn="+res.data.shelfOrderSn
-						 })
+						 if(res.data&&res.data.remindMessage){
+							 uni.showModal({
+							 	title: '提示',
+							 	content: res.data.remindMessage,
+							 	confirmText: '知道了',
+							 	showCancel: false
+							 })
+						 }else{
+							 uni.showToast({
+							 	icon:'none',
+								title: res.message,
+								duration: 4000
+							 })
+							 uni.$emit("updateQueryByCodeList")
+							 uni.redirectTo({
+							 	url: "/pages/digitalShelf/orderDetail?shelfOrderSn="+res.data.shelfOrderSn
+							 })
+						 }
 					 }else{
 						 uni.showModal({
 						 	title: res.errCode == 'VALIDATE_STOCK_LACK' ? '以下产品库存不足' : '提示',
@@ -121,6 +151,9 @@
 			text{
 				color: #333;
 			}
+			.pcode{
+				margin-right: 20upx;
+			}
 		}
 		.u-ninput{
 			border: 2rpx solid #eee;

+ 33 - 10
pages/queryByCode/queryByCode.vue

@@ -7,9 +7,9 @@
 					focus
 					v-model="queryWord" 
 					@input="change"
-					@custom="getpartList" 
-					@search="getpartList" 
-					@clear="clearSearch" 
+					@custom="search" 
+					@search="search" 
+					@clear="clearSearch"
 					:height="90"
 					bg-color="#fff" 
 					:action-style="{borderRadius:'50rpx',color:'#ffffff',width: '120rpx',padding:'12rpx 20rpx',background:'#00aaff'}" 
@@ -28,13 +28,21 @@
 							<view class="pinfo">
 								<view class="pname flex align_center justify_between">
 									<view class="code"><text>{{item.shelfPlaceCode}}</text>{{item.code}}</view>
-									<view class="kc">库存:<text>{{item.currentInven}}</text>{{item.unit}}</view>
 								</view>
 								<view class="ptxt">
 									<view>
 										<text class="pcode">{{item.name}}</text>
 									</view>
 								</view>
+								<view class="pname flex align_center justify_between">
+									<view class="pcode" 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="kc">库存:<text>{{item.currentInven}}</text>{{item.unit}}</view>
+								</view>
 							</view>
 						</view>
 					</view>
@@ -70,6 +78,17 @@
 				this.getpartList()
 			})
 		},
+		computed: {
+			userInfo(){
+				return this.$store.state.vuex_userInfo
+			},
+			showPrice(){
+				return this.$store.state.vuex_showPrice
+			},
+			isAdmin(){
+				return this.userInfo.superAdmin == 1
+			}
+		},
 		onUnload() {
 			uni.$off("updateQueryByCodeList")
 		},
@@ -93,16 +112,20 @@
 					})
 				}
 			},
-			clearSearch(){
-				this.queryWord = ''
-				this.pageNo = 1
-				this.partList = []
-			},
 			change(v){
 				if(v==''){
 					this.clearSearch()
 				}
 			},
+			clearSearch(){
+				this.queryWord = ''
+				this.search()
+			},
+			search(){
+				this.pageNo = 1
+				this.partList = []
+				this.getpartList()
+			},
 			// 获取数字货架列表
 			getpartList(){
 				const _this = this
@@ -201,7 +224,6 @@
 					.pname{
 						font-size: 28rpx;
 						color: #191919;
-						margin-bottom: 10rpx;
 						.code{
 							text{
 								font-weight: normal;
@@ -224,6 +246,7 @@
 						font-size: 28rpx;
 						color: #333;
 						font-weight: bold;
+						margin: 10rpx 0;
 						.pnums{
 							color: #222;
 						}