Browse Source

bug 修复

lilei 2 years ago
parent
commit
7c69fcdae9

+ 11 - 9
components/kk-printer/index.vue

@@ -52,9 +52,9 @@
 										<text>{{item.deviceId}}</text>
 									</view>
 								</view>
-								<view style="width: 120rpx;">
+								<view style="width: 120rpx;text-align: right;">
 									<!-- <u-icon :size="60" color="#55aaff" name="plus-circle"></u-icon> -->
-									<u-button @tap="handleConnectDevice(item)" :loading="isConnecting" shape="circle" size="mini" :custom-style="{background:$config('primaryColor')}" type="primary">{{isConnecting?'连接中':'连接'}}</u-button>
+									<u-button :loading="isConnecting" @tap="handleConnectDevice(item)" shape="circle" size="mini" :custom-style="{background:$config('primaryColor')}" type="primary">{{isConnecting?'连接中':'连接'}}</u-button>
 								</view>
 							</view>
 						</view>
@@ -211,9 +211,7 @@
 								//若没有已连接设备,弹框搜索设备
 								this.isShowSearch = true
 								this.devicesList = []
-								if(this.deviceId){
-									this.closeConnect()
-								}
+								this.searchBtnTap()
 							}
 						}
 					}).catch((err)=>{
@@ -267,10 +265,9 @@
 						plus.nativeUI.toast('设备'+ res.deviceId + '已断开连接',{
 							verticalAlign:'center'
 						})
-						const lastDevice = uni.getStorageSync('vuex_lastBuleDevice')
-						if(lastDevice){
-							this.handleConnectDevice(lastDevice)
-						}
+						this.isShowSearch = true
+						this.devicesList = []
+						this.searchBtnTap()
 					}
 					_this.isConnecting = false
 			    })
@@ -286,6 +283,11 @@
 				this.isConnecting = false
 				blesdk.catchToast(err.res)
 				uni.setStorageSync('vuex_lastBuleDevice','')
+				if(err.res.code == 10012){
+					this.isShowSearch = true
+					this.devicesList = []
+					this.searchBtnTap()
+				}
 			},
 			onGetServicesSuccess(res){
 				console.log('获取服务',res)

+ 1 - 1
components/kk-printer/utils/bluetoolth.js

@@ -305,7 +305,7 @@ export function senBlData(deviceId, serviceId, characteristicId,uint8Array,laste
 export function catchToast(err) {
 	const errMsg = {
 		10000: '未初始化蓝牙模块',
-		10001: '蓝牙未打开',
+		10001: '蓝牙未打开,请打开蓝牙开关',
 		10002: '没有找到指定设备',
 		10003: '连接失败',
 		10004: '没有找到指定服务',

+ 13 - 5
pages/batchShelves/batchPrint/batchPrint.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="batchPrint-manualPrint-wrap">
+	<view class="batchPrint-manualPrint-wrap" :style="{'padding-top':type=='search'?'100rpx':'0'}">
 		<view v-if="type=='search'" class="productList-search">
 			<view class="search flex align_center">
 				<view class="input">
@@ -116,6 +116,12 @@
 					this.clearSearch()
 					return
 				}
+				
+				uni.showLoading({
+					mask: true,
+					title: "正在搜索..."
+				})
+				this.partList = []
 				// 搜索
 				for(let key in this.allList){
 					const item = this.allList[key]
@@ -123,6 +129,10 @@
 					this.partList = this.partList.concat(ret)
 				}
 				this.$refs.productList.setData(this.partList)
+				
+				setTimeout(()=>{
+					uni.hideLoading()
+				},1000)
 			},
 			clearSearch(){
 				this.partList = []
@@ -203,12 +213,10 @@
 
 <style lang="less">
 .batchPrint-manualPrint-wrap{
-	position: relative;
 	width: 100%;
 	height: 100%;
 	overflow: hidden;
 	padding-bottom: 102upx;
-	padding-top: 100upx;
 	.productList-search{
 		padding: 20rpx 30rpx;
 		background-color: #fff;
@@ -216,9 +224,8 @@
 		left: 0;
 		top: 0;
 		width: 100%;
-		box-shadow: 3px 1px 7px #eee;
 		display: flex;
-		z-index: 10000;
+		z-index: 100;
 		.search{
 			padding: 0.1rem;
 			border-radius: 50rpx;
@@ -256,6 +263,7 @@
 		display: flex;
 		align-items: center;
 		justify-content: space-between;
+		z-index: 1000;
 	}
 }
 </style>

+ 16 - 22
pages/batchShelves/batchPrint/productList.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="partList-box flex flex_column">
-		<view class="partList-title flex align_center justify_between">
+		<view class="partList-title flex align_center justify_between" v-if="partList.length">
 			<text>{{title}}</text>
 			<view class="heji">
 				共 <text>{{partList.length}}</text> 产品
@@ -23,21 +23,18 @@
 							<view class="pname pname1">
 								{{item.product.productName}}
 							</view>
-							<view class="ptxt flex align_center justify_end">
-								<view>
-								   本次上架:<text class="pnums">{{item.qty}}{{item.product&&item.product.unit}}</text>
-								</view>
-							</view>
 						</view>
 					</view>
 				</view>
 				<!-- 有复选框 -->
 				<view class="ptools flex align_center justify_between">
-					<view></view>
+					<view class="ptxt">
+					   本次上架:<text class="pnums">{{item.qty}}{{item.product&&item.product.unit}}</text>
+					</view>
 					<view class="pcurnums flex align_center">
 						<text>打印数量</text>
 						<view class="u-ninput">
-							<u-number-box color="#000" bg-color="#fff" v-model="item.printQty" :min="1"></u-number-box>
+							<u-number-box :input-height="60" color="#000" bg-color="#fff" v-model="item.printQty" :min="1"></u-number-box>
 						</view>
 					</view>
 				</view>
@@ -127,14 +124,10 @@
 		padding: 10vh 0;
 	}
 	.partList-title{
-		padding: 10rpx 20rpx;
+		padding: 15rpx 20rpx;
 		border-bottom: 0.1rpx solid #eee;
 		width: 100%;
-		position: fixed;
-		left: 0;
-		top: 0;
 		background-color: #fff;
-		z-index: 1000;
 		> text{
 			font-size: 32rpx;
 			color: #222222;
@@ -149,7 +142,6 @@
 	}
 	.partList-list{
 		flex-grow: 1;
-		padding-top: 70upx;
 	}
 	.partList-list-box{
 		padding: 10px 0;
@@ -190,21 +182,23 @@
 					font-size: 24rpx;
 					margin-right: 10rpx;
 				}
-				.ptxt{
-					font-size: 28rpx;
-					color: #999;
-					.pnums{
-						color: #222;
-						padding: 0 4upx;
-					}
-				}
 			}
 		}
 		.ptools{
 			margin-top: 20rpx;
+			.ptxt{
+				font-size: 28rpx;
+				color: #999;
+				.pnums{
+					color: #222;
+					padding: 0 4upx;
+				}
+			}
 			.pcurnums{
 				> text{
 					margin-right: 20rpx;
+					font-size: 28rpx;
+					color: #999;
 				}
 			}
 			.u-ninput{

+ 15 - 4
pages/batchShelves/cartList.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="content flex flex_column">
-		<view class="product-list flex">
+		<view class="product-list flex" v-if="placeTab.length">
 			<view class="leftTabs">
 				<view v-for="item in placeTab" :key="item" :class="curTab==item?'active':''" @click="curTab = item">{{item}}层</view>
 			</view>
@@ -29,14 +29,22 @@
 						<view></view>
 						<view class="pcurnums flex align_center">
 							<view class="u-ninput">
-								<u-number-box :index="item.id" @blur="updateNums" @minus="updateNums" @plus="updateNums" color="#000" bg-color="#fff" v-model="item.qty" :min="0"></u-number-box>
+								<u-number-box :index="item.id" :input-height="60" @blur="updateNums" @minus="updateNums" @plus="updateNums" color="#000" bg-color="#fff" v-model="item.qty" :min="0"></u-number-box>
 							</view>
 						</view>
 					</view>
 				</view>
 			</scroll-view>
 		</view>
-		<view class="footer-bar flex align_center justify_between">
+		<view class="product-list" v-else>
+			<view style="padding: 200upx 0 0;">
+				<u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="150" text="暂无货位产品,请录入" img-width="150" mode="list"></u-empty>
+			</view>
+			<view style="text-align: center;margin-top: 50upx;" v-if="!loading">
+				<u-button @click="showLayer=true" type='primary' shape="circle" size="medium">点击录入产品</u-button>
+			</view>
+		</view>
+		<view class="footer-bar flex align_center justify_between" v-if="placeTab.length">
 			<view class="heji flex align_center" @click="showPop=!showPop">
 				所有层合计款数:<text>{{totalKs}}</text>;数量:<text>{{totalNums}}</text>;
 				<u-icon name="arrow-up"></u-icon>
@@ -98,6 +106,7 @@
 		},
 		data() {
 			return {
+				loading: false,
 				showPop: false,
 				chooseModal: false,
 				showPrintModal: false,
@@ -198,7 +207,6 @@
 				}).then(res => {
 					uni.hideLoading()
 					if(res.status == 200){
-						uni.$emit("updateHw")
 						uni.navigateBack()
 					}
 				})
@@ -247,6 +255,7 @@
 					mask: true,
 					title: '正在加载...'
 				})
+				this.loading = true
 				queryMapList({ shelfSn: this.shelfSn }).then(res => {
 				  console.log(res.data)
 				  if (res.status == 200 && res.data) {
@@ -269,6 +278,7 @@
 					this.placeTab = []
 				  }
 				  uni.hideLoading()
+				  this.loading = false
 				})
 			},
 			// 获取统计数据
@@ -407,6 +417,7 @@
 					.ptools{
 						color: #666;
 						font-size: 26rpx;
+						margin-top: 20rpx;
 						.u-ninput{
 							border: 2rpx solid #eee;
 							border-radius: 50rpx;

+ 4 - 2
pages/batchShelves/searchProduct.vue

@@ -42,7 +42,7 @@
 					<view></view>
 					<view class="pcurnums flex align_center">
 						<view class="u-ninput" v-if="item.shelfCartApi">
-							<u-number-box :index="item.id" @blur="updateNums" @minus="updateNums" @plus="updateNums" color="#000" bg-color="#fff" v-model="item.shelfCartApi.qty" :min="1"></u-number-box>
+							<u-number-box :index="item.id" :input-height="60" @blur="updateNums" @minus="updateNums" @plus="updateNums" color="#000" bg-color="#fff" v-model="item.shelfCartApi.qty" :min="1"></u-number-box>
 						</view>
 						<view v-else>
 							<u-button @click="addItem(item)" plain style="height: 50rpx;line-height: 50rpx;" size="mini" shape="circle">
@@ -89,11 +89,13 @@
 				title: '按产品编码搜索——' +this.layer+'层'
 			})
 		},
-		onBackPress() {
+		onBackPress(e) {
+			console.log(e,'-----------')
 			uni.$emit("updateTempHw")
 			uni.redirectTo({
 				url: "/pages/batchShelves/cartList?shelfSn="+this.shelfSn+'&layer='+this.layer+'&shelfName='+this.shelfName+'&customerSn='+this.customerSn
 			})
+			return true
 		},
 		onNavigationBarButtonTap(e) {
 			 this.scanProduct()

+ 7 - 7
pages/common/partList.vue

@@ -10,12 +10,12 @@
 					<view class="checkbox" v-if="model == 'checkbox'">
 						<u-checkbox v-model="item.checked" :name="item.id" @change="checkChange" size="40" shape="circle"></u-checkbox>
 					</view>
-					<view class="flex align_center flex_1" @click="checkChange({name:item.id})">
-						<view class="pimgs">
+					<view class="flex align_center flex_1">
+						<view class="pimgs" @click="checkChange({name:item.id})">
 							<u-image :src="item.product&&item.product.productMsg?item.product.productMsg:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
 						</view>
 						<view class="pinfo">
-							<view class="pname">
+							<view class="pname" @click="checkChange({name:item.id})">
 								<text v-if="item.shelfPlaceCode">
 									{{item.shelfPlaceCode}}
 								</text>
@@ -66,13 +66,13 @@
 					<view class="pcurnums flex align_center" v-if="pageType=='recall'">
 						<text>实退数量</text>
 						<view class="u-ninput">
-							<u-number-box color="#000" bg-color="#fff" v-model="item.confirmQty" :min="1" :max="item.qty"></u-number-box>
+							<u-number-box color="#000" :input-height="60" bg-color="#fff" v-model="item.confirmQty" :min="1" :max="item.qty"></u-number-box>
 						</view>
 					</view>
 					<view class="pcurnums flex align_center" v-if="pageType=='manualPrint'">
 						<text>打印数量</text>
 						<view class="u-ninput">
-							<u-number-box color="#000" bg-color="#fff" v-model="item.printQty" :min="1" :max="item.confirmQty"></u-number-box>
+							<u-number-box color="#000" :input-height="60" bg-color="#fff" v-model="item.printQty" :min="1" :max="item.confirmQty"></u-number-box>
 						</view>
 					</view>
 				</view>
@@ -82,7 +82,7 @@
 					<view class="pcurnums flex align_center" v-if="pageType=='replenishmentSign'">
 						<text>入库数量</text>
 						<view class="u-ninput">
-							<u-number-box color="#000" bg-color="#fff" v-model="item.putQty" @change="numberChange" :min="0" :max="999999"></u-number-box>
+							<u-number-box color="#000" :input-height="60" bg-color="#fff" v-model="item.putQty" @change="numberChange" :min="0" :max="999999"></u-number-box>
 						</view>
 					</view>
 				</view>
@@ -265,7 +265,7 @@
 			}
 		}
 		.ptools{
-			margin-top: 20rpx;
+			margin-top: 30rpx;
 			.pcurnums{
 				> text{
 					margin-right: 20rpx;

+ 1 - 0
pages/common/printTag/printTag.vue

@@ -36,6 +36,7 @@
 </template>
 
 <script>
+	import { clzConfirm, numberToFixed } from '@/libs/tools';
 	import { shelfDetail } from '@/api/shelf'
 	import kkPrinter from '@/components/kk-printer/index.vue';
 	import {printTempl} from '@/libs/printTools.js'

+ 19 - 3
pages/replenishmentManage/manualPrint.vue

@@ -1,7 +1,6 @@
 <template>
 	<view class="replenishment-manualPrint-wrap">
 		<view class="replenishment-manualPrint-body">
-			<u-alert-tips :show="show" @close="show = false" type="warning" description="正在打印中,请勿息屏或退出应用!"></u-alert-tips>
 			<view class="part-list">
 				<!-- 补货产品 -->
 				<partList :list="partList" title="补货产品" model="checkbox" fromPage="manualPrint" ref="partList" noDataText="暂无产品" @allChecked="allCheckedCallback"></partList>
@@ -19,6 +18,7 @@
 </template>
 
 <script>
+	import { clzConfirm, numberToFixed } from '@/libs/tools';
 	import kkPrinter from '@/components/kk-printer/index.vue';
 	import { shelfReplenishDetail, shelfReplenishDetailList, shelfReplenishPrintSign } from '@/api/shelfReplenish'
 	import partList from '@/pages/common/partList.vue'
@@ -92,6 +92,10 @@
 							item.printQty = item.confirmQty ? Number(item.confirmQty) : 0
 						})
 						this.partList = res.data || []
+						this.$nextTick(()=>{
+							this.allCheckeChange({value:true})
+							this.allChecked = true
+						})
 					}else{
 						this.partList = []
 					}
@@ -135,7 +139,16 @@
 						_this.printIndex = 0
 						_this.$refs.kkprinter.onPrintSuccess()
 						_this.isParinting = false
-						_this.show = false
+						uni.hideLoading()
+						clzConfirm({
+						  title: '提示',
+						  content: '打印已经结束,是否返回上页!',
+						  success (ret) {
+							if (ret.confirm || ret.index == 0) {
+								uni.navigateBack()
+							} 
+						  }
+						})
 					}
 				});
 			},
@@ -147,7 +160,10 @@
 					 	return
 					 }
 					 this.isParinting = true
-					 this.show = true
+					 uni.showLoading({
+					 	mask: true,
+					 	title: '正在打印中,请勿息屏或退出应用!'
+					 })
 					 this.printOnce(opt,tsc,blesdk,result[this.printIndex])
 				}else{
 					this.toashMsg("请选择产品!")

+ 0 - 1
pages/shelfSetting/addShelfHw.vue

@@ -161,7 +161,6 @@
 						 _this.loading = true
 						 addPlaceAndProduct(params).then(res => {
 						   if (res.status == 200) {
-							 uni.$emit("updateHw")
 							 uni.$emit("updateHwNo",params.shelfPlaceCode)
 						     uni.navigateBack()
 						   }

+ 5 - 0
pages/shelfSetting/batchPrint.vue

@@ -43,6 +43,11 @@
 			this.$refs.productList.setData(this.partList)
 			setTimeout(()=>{
 				uni.hideLoading()
+				// 默认全选
+				if(this.partList.length){
+					this.allCheckeChange({value: true})
+					this.allChecked = true
+				}
 			},3000)
 		},
 		onLoad(option) {

+ 4 - 4
pages/shelfSetting/chooseTypeModal.vue

@@ -44,10 +44,10 @@
 			handleConfirm(){
 				const _this = this;
 				//  表单校验
-				if (!_this.form.dispatchType) {
-					uni.showToast({ icon: 'none', title: '请选择配送方式' });
-					return;
-				}
+				// if (!_this.form.dispatchType) {
+				// 	uni.showToast({ icon: 'none', title: '请选择配送方式' });
+				// 	return;
+				// }
 				this.$emit('confirm', _this.form, 0)
 			},
 			// 配送方式

+ 0 - 2
pages/shelfSetting/editShelfHw.vue

@@ -200,7 +200,6 @@
 							  	icon: "none",
 							  	title: res.message
 							  })
-							  uni.$emit("updateHw")
 							  uni.navigateBack()
 						  }
 						  _this.loading = false
@@ -235,7 +234,6 @@
 							 	icon: "none",
 							 	title: res.message
 							 })
-							 uni.$emit("updateHw")
 						     uni.navigateBack()
 						   }
 						    _this.loading = false

+ 5 - 5
pages/shelfSetting/productList.vue

@@ -15,15 +15,15 @@
 					<view class="checkbox">
 						<u-checkbox v-model="item.checked" :name="item.id" @change="checkChange" size="40" shape="circle"></u-checkbox>
 					</view>
-					<view class="flex align_center flex_1" @click="checkChange({name:item.id})">
-						<view class="pimgs">
+					<view class="flex align_center flex_1">
+						<view class="pimgs" @click="checkChange({name:item.id})">
 							<u-image :src="item.productEntity&&item.productEntity.images?item.productEntity.images:`../../static/${$config('themePath')}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
 						</view>
 						<view class="pinfo">
-							<view class="pname">
+							<view class="pname" @click="checkChange({name:item.id})">
 								<text>{{item.shelfPlaceCode}}</text>{{item.productCode}}
 							</view>
-							<view class="pname pname1">
+							<view class="pname pname1" @click="checkChange({name:item.id})">
 								{{item.productName}}
 							</view>
 							<view class="ptxt flex align_center justify_between">
@@ -41,7 +41,7 @@
 					<view class="pcurnums flex align_center">
 						<text>打印数量</text>
 						<view class="u-ninput">
-							<u-number-box color="#000" bg-color="#fff" v-model="item.printQty" :min="1"></u-number-box>
+							<u-number-box color="#000" :input-height="60" bg-color="#fff" v-model="item.printQty" :min="1"></u-number-box>
 						</view>
 					</view>
 				</view>

+ 1 - 1
pages/shelfSetting/quickProductList.vue

@@ -33,7 +33,7 @@
 					<view class="pcurnums flex align_center">
 						<text>补货数量</text>
 						<view class="u-ninput">
-							<u-number-box color="#000" bg-color="#fff" v-model="item.printQty" :min="0" :max="999999"></u-number-box>
+							<u-number-box color="#000" :input-height="60" bg-color="#fff" v-model="item.printQty" :min="0" :max="999999"></u-number-box>
 						</view>
 					</view>
 				</view>

+ 14 - 6
pages/shelfSetting/shelfSet.vue

@@ -72,7 +72,8 @@
 				shelfPlaceList: null,
 				placeTab: [],
 				curTab: '',
-				cartNotEmpty: false
+				cartNotEmpty: false,
+				isLoad: false
 			}
 		},
 		onLoad(option) {
@@ -81,6 +82,7 @@
 			this.getShelfDetal()
 			// 获取货物
 			this.getShelfPlace()
+			this.isLoad = true
 			
 			uni.$on("editCustome",(data)=>{
 				this.saveShelf(data,0)
@@ -88,10 +90,6 @@
 			uni.$on("editShelfName",(data)=>{
 				this.saveShelf(data,1)
 			})
-			uni.$on("updateHw",()=>{
-				this.placeTab = []
-				this.getShelfPlace(true)
-			})
 			
 			const win = uni.getWindowInfo()
 			this.pleft = Math.floor(win.windowWidth * 0.3)
@@ -102,12 +100,21 @@
 		onUnload() {
 			uni.$off("editCustome")
 			uni.$off("editShelfName")
-			uni.$off("updateHw")
 		},
 		onNavigationBarButtonTap(e) {
 			 this.toPlRacking()
 		},
+		onShow() {
+			if(!this.isLoad){
+				this.updateHw()
+			}
+		},
 		methods: {
+			// 刷新货位
+			updateHw(){
+				this.placeTab = []
+				this.getShelfPlace(true)
+			},
 			// 批量上架
 			toPlRacking(){
 				const url = this.cartNotEmpty ? '/pages/batchShelves/cartList' : '/pages/batchShelves/index'
@@ -297,6 +304,7 @@
 				  }
 				  // 是否有已录入的产品
 				  this.getHasCartNotEmpty()
+				  this.isLoad = false
 				})
 			},
 			tabChange(item){