Browse Source

bug 修复

lilei 2 years ago
parent
commit
ae87d477a0

+ 1 - 1
App.vue

@@ -5,7 +5,7 @@
 			token: '',
 			changeOrg:'',
 			version: '', // 当前版本号
-			buildType: 'dev', // 打包环境对应类型,pro 生产 uat 预发布 dev 本地开发
+			buildType: 'uat', // 打包环境对应类型,pro 生产 uat 预发布 dev 本地开发
 			envTips: '', // 环境文字提示
 			theme: 'default', // 主题,default
 			isIphoneXup: false //是否iphonex以及以上的版本

+ 0 - 1
libs/axios.js

@@ -27,7 +27,6 @@ const request = (opts, hasToken) => {
 	let promise = new Promise(function(resolve, reject) {
 		uni.request(DefaultOpts).then(
 			(res) => {
-				console.log(res,'----------')
 				// 是否超时已跳转
 				let loginTimeOut = uni.getStorageSync('loginTimeOut');
 				if(res[0]&&res[0].errMsg.indexOf('request:fail')>=0){

+ 6 - 6
libs/printTools.js

@@ -92,13 +92,13 @@ export const printTempl = function(tsc,data){
 	// 数字货架名称文字
 	top = top+10
 	rightTop = top
-	top = textFormat(command,data.shelfName,leftMaxFnums,left,top,lightHeight,"left",1)
-	// 产品编码
-	top = top+10
-	top = textFormat(command,data.productCode,leftMaxFnums,left,top,lightHeight,"left",1)
+	// top = textFormat(command,data.shelfName,leftMaxFnums,left,top,lightHeight,"left",1)
+	// 产品编码 + 产品名称
+	// top = top+10
+	top = textFormat(command,data.shelfName +'/'+ data.productCode + '/' + data.productName,leftMaxFnums,left,top,lightHeight,"left",1)
 	// 产品名称
-	top = top+6
-	top = textFormat(command,data.productName,leftMaxFnums,left,top,lightHeight,"left",1)
+	// top = top+6
+	// top = textFormat(command,data.productName,leftMaxFnums,left,top,lightHeight,"left",1)
 	// 打印人打印时间
 	top = top+10
 	top = textFormat(command,data.printDate+' '+data.printUser,leftMaxFnums,left,top,lightHeight,"left",1)

+ 8 - 7
pages/common/printTag/printTag.vue

@@ -8,9 +8,9 @@
 			</view>
 		</view>
 		<view class="print-radio" v-if="fromPage == 'bdtq'">
-			<u-radio-group v-model="printNum" @change="qtyChange">
-				<u-radio :name="infoData.qty">按当前库存打印</u-radio>
-				<u-radio :name="infoData.maxQty">按最大库容打印</u-radio>
+			<u-radio-group v-model="numType" @change="qtyChange">
+				<u-radio :name="1">按当前库存打印</u-radio>
+				<u-radio :name="2">按最大库容打印</u-radio>
 			</u-radio-group>
 		</view>
 		<view class="shelf-info">
@@ -50,14 +50,15 @@
 				infoData: null,
 				fromPage: '',
 				printInfo: null,
-				printNum: 0,
-				isParinting: false
+				printNum: 1,
+				isParinting: false,
+				numType: 1
 			}
 		},
 		onLoad(options) {
 			const _this = this
 			_this.fromPage = options.page
-			_this.infoData = options.data ? JSON.parse(options.data) : {},
+			_this.infoData = options.data ? JSON.parse(options.data) : {};
 			_this.printNum = _this.fromPage == 'smdy' ? _this.infoData.confirmQty : _this.infoData.qty
 			_this.printNum = _this.printNum||1
 			console.log(_this.infoData)
@@ -93,7 +94,7 @@
 		},
 		methods: {
 			qtyChange(v){
-				this.printNum = v
+				this.printNum = v == '1' ? this.infoData.qty : this.infoData.maxQty
 			},
 			cancel(){
 				if(this.fromPage == 'bdtq'){  // 补打贴签

+ 47 - 26
pages/latePlay/chooseProduct.vue

@@ -6,7 +6,10 @@
 				<view class="shelfName flex">
 					<view>{{shelfInfo.shelfName}}</view>
 				</view>
-				<view class="btns" @click="showTab = true">筛选<u-icon size="20" name="arrow-down"></u-icon></view>
+				<view class="btns" @click="showTab = true">
+					筛选:({{curTab!='all'?(curTab+'层'):'全部'}})
+					<u-icon size="20" name="arrow-down"></u-icon>
+				</view>
 			</view>
 			<view class="search flex align_center">
 				<view class="input">
@@ -27,7 +30,7 @@
 			</view>
 		</view>
 		<view class="moreShelfPart-body">
-			<scroll-view class="nav-right" scroll-y>
+			<scroll-view class="nav-right" scroll-y @scrolltolower="onreachBottom">
 				<view class="partList-list-box" v-for="item in partList" :key="item.id">
 					<view class="product flex align_center">
 						<view class="flex align_center flex_1">
@@ -67,13 +70,10 @@
 			<view class="tabBox flex flex_column">
 				<view class="tabs">
 					<view class="flex">
-						<view :class="item==curTab?'active':''" v-for="item in placeTab" :key="item" @click="curTab=curTab==item?'':item">{{item}}层</view>
+						<view :class="curTab=='all'?'active':''" @click="tabChange('all')">全部层</view>
+						<view :class="item==curTab?'active':'all'" v-for="item in placeTab" :key="item" @click="tabChange(item)">{{item}}层</view>
 					</view>
 				</view>
-				<view class="btns">
-					<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" @click="handleClear">重置</u-button>
-					<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="clearSearch">查询</u-button>
-				</view>
 			</view>
 		</u-popup>
 	</view>
@@ -87,8 +87,9 @@
 				queryWord: '',
 				isGobleSearch: false,
 				partList: [],
+				allList: [],
 				pageNo:1,
-				pageSize: 10,
+				pageSize: 15,
 				total: 0, // 列表总数
 				noDataText: '暂无数据',
 				status: 'loading',
@@ -100,7 +101,7 @@
 				theme: '',
 				showTab: false,
 				placeTab: [],
-				curTab: '',
+				curTab: 'all',
 				customBtnStyle: {  //  自定义按钮样式
 					borderColor: this.$config('primaryColor'),
 					backgroundColor: this.$config('primaryColor'),
@@ -119,11 +120,19 @@
 		},
 		// 批量打印
 		onNavigationBarButtonTap(e) {
-			const data = Object.assign(this.shelfInfo, {list:this.partList.filter(item => item.qty)})
-			console.log(data)
-			if(data.list.length){
+			if(this.curTab=='all'){
+				uni.showToast({
+					icon: 'none',
+					title: '请先筛选层,按层批量打印!',
+					duration: 5000
+				})
+				return
+			}
+			const list = this.allList.filter(item => item.qty>0)
+			this.$store.state.vuex_tempPrintList = list
+			if(this.shelfInfo&&list.length){
 				uni.navigateTo({
-					url: "/pages/shelfSetting/batchPrint?page=bdtq&data="+encodeURIComponent(JSON.stringify(data)) 
+					url: "/pages/shelfSetting/batchPrint?page=bdtq&data="+encodeURIComponent(JSON.stringify(this.shelfInfo)) 
 				})
 			}else{
 				uni.showToast({
@@ -141,7 +150,7 @@
 						this.placeTab.push(a)
 					}
 					if(!flag){
-					  this.curTab = ''
+					  this.curTab = 'all'
 					}
 				  } else {
 				    this.placeTab = []
@@ -149,8 +158,8 @@
 				})
 			},
 			handleClear(){
-				this.curTab = ''
-				this.clearSearch()
+				this.curTab = 'all'
+				this.changeSearch()
 			},
 			// -------------------
 			clearSearch(){
@@ -159,9 +168,15 @@
 			},
 			changeSearch(v){
 				this.pageNo = 1
+				this.allList = []
 				this.partList = []
 				this.getpartList()
 			},
+			tabChange(item){
+				this.curTab=item
+				this.showTab = false
+				this.changeSearch()
+			},
 			// 搜索配件
 			searchPart(){
 				this.getpartList()
@@ -172,24 +187,21 @@
 				let params = {
 					shelfSn: this.shelfInfo.shelfSn,
 					queryWord: this.queryWord,
-					shelfPlaceCodeHead: this.curTab
+					shelfPlaceCodeHead: this.curTab == 'all' ? '' : this.curTab
 				}
 				_this.status = 'loading'
 				queryShelfProductList(params).then(res => {
 					uni.hideLoading()
 					if(res.status == 200){
 						let list = res.data
-						console.log(list)
 						if (list && list.length){
-							// 分页 拼接数据
-							if (_this.pageNo != 1) {
-								_this.partList = _this.partList ? _this.partList.concat(list) : list
-							} else {
-								_this.partList = list
-							}
+							_this.allList = list
+							_this.partList = list.slice(0,this.pageSize)
+							_this.total = _this.allList.length
 							_this.status = 'nomore'
 						} else {
-							_this.partList = list || []
+							_this.allList = []
+							_this.partList = []
 							_this.status = 'loadmore'
 						}
 						_this.noDataText = '没有搜索到产品'
@@ -202,6 +214,15 @@
 					this.showTab = false
 				})
 			},
+			// 加载更多
+			onreachBottom () {
+				if(this.partList.length < this.total ){
+					this.pageNo = this.pageNo + 1
+					this.partList = this.allList.slice(0,this.pageSize*this.pageNo)
+				}else{
+					this.status = "nomore"
+				}
+			},
 			print(data){
 				uni.navigateTo({ url: "/pages/common/printTag/printTag?page=bdtq&data="+JSON.stringify(data)})
 			},
@@ -299,7 +320,7 @@
 					}
 				}
 				.btns{
-					width:100rpx;
+					width:200rpx;
 					text-align: right;
 					font-size: 28rpx;
 					color: #0485F6;

+ 14 - 4
pages/shelfSetting/batchPrint.vue

@@ -11,6 +11,9 @@
 			<view>
 				<u-checkbox size="40" @change="allCheckeChange" v-model="allChecked" shape="circle">{{allChecked?'取消全选':'全选'}}</u-checkbox>
 			</view>
+			<view>
+				共 {{partList.length}}产品
+			</view>
 			<view>
 				<kk-printer ref="kkprinter" defaultText="开始打印" @startPrint="startPrint"></kk-printer>
 			</view>
@@ -35,19 +38,25 @@
 			}
 		},
 		onReady() {
-			uni.setNavigationBarColor({
-				frontColor: '#ffffff',
-				backgroundColor: this.$config('primaryColor')
+			uni.showLoading({
+				title: '正在加载...'
 			})
 			this.$refs.productList.setData(this.partList)
+			setTimeout(()=>{
+				uni.hideLoading()
+			},3000)
 		},
 		onLoad(option) {
 			this.basicInfoData = JSON.parse(decodeURIComponent(option.data));
-			this.partList = this.basicInfoData.list
+			this.partList = this.$store.state.vuex_tempPrintList
 			// 保持屏幕常亮
 			uni.setKeepScreenOn({
 				keepScreenOn: true
 			});
+			uni.setNavigationBarColor({
+				frontColor: '#ffffff',
+				backgroundColor: this.$config('primaryColor')
+			})
 		},
 		onUnload() {
 			// this.$refs.kkprinter.closeConnect()
@@ -56,6 +65,7 @@
 			uni.setKeepScreenOn({
 				keepScreenOn: false
 			});
+			this.$store.state.vuex_tempPrintList = []
 		},
 		onBackPress(event){
 			if(event.from == 'backbutton'){

+ 2 - 2
pages/shelfSetting/bindProduct.vue

@@ -68,7 +68,7 @@
 				this.productList = []
 				this.getProductList()
 			},
-			// 获取数字货架列表
+			// 获取产品列表
 			getProductList(){
 				if(this.queryWord == ''){
 					this.pageNo = 1
@@ -101,7 +101,7 @@
 							_this.productList = list || []
 							this.total = 0
 							_this.status = 'nomore'
-							_this.noDataText = '没有查询到相关货架'
+							_this.noDataText = '没有查询到相关产品'
 						}
 					}else{
 						_this.status = 'nomore'

+ 2 - 1
pages/shelfSetting/productList.vue

@@ -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="0" :max="item.maxQty"></u-number-box>
+							<u-number-box color="#000" bg-color="#fff" v-model="item.printQty" :min="1" :max="item.maxQty"></u-number-box>
 						</view>
 					</view>
 				</view>
@@ -95,6 +95,7 @@
 				this.partList.map(item => {
 					item.printQty = v == 1 ? item.maxQty : item.qty
 				})
+				this.partList.splice()
 			},
 			// 全选
 			allSelect(val){

+ 1 - 0
store/index.js

@@ -110,6 +110,7 @@ const store = new Vuex.Store({
 		vuex_paymentTypeList: [], // 收款方式
 		vuex_storeAuthState: [], // 门店审核状态
 		vuex_shelfSettleType: [], // 门店审核结算方式
+		vuex_tempPrintList:[], // 临时打印数据
 	},
 	mutations: {
 		$uStore(state, payload) {