瀏覽代碼

补打贴签

lilei 3 年之前
父節點
當前提交
9323e716be
共有 5 個文件被更改,包括 334 次插入7 次删除
  1. 9 0
      pages.json
  2. 98 0
      pages/common/printTag/printTag.vue
  3. 6 1
      pages/latePlay/chooseBulk.vue
  4. 221 6
      pages/latePlay/chooseProduct.vue
  5. 二進制
      static/default/icon_printer@3x.png

+ 9 - 0
pages.json

@@ -84,6 +84,15 @@
 		        "enablePullDownRefresh": false
 		        "enablePullDownRefresh": false
 		    }
 		    }
 		}
 		}
+        ,{
+            "path" : "pages/common/printTag/printTag",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "打印标签",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
     ],
 	"globalStyle": {
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTextStyle": "black",

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

@@ -0,0 +1,98 @@
+<template>
+	<view class="printTag">
+		<view class="print-nums flex flex_column align_center justify_center">
+			<view>打印数量</view>
+			<view class="uinput">
+				<u-number-box :min="1" color="#000" bg-color="#fff" size="30" :input-height="70" :input-width="100"></u-number-box>
+			</view>
+		</view>
+		<view class="shelf-info">
+			<view class="shelf-info-title">
+				<view>西安车领主常青二路数字货架</view>
+				<view><text class="pno">A02</text></view>
+			</view>
+			<view>产品编码:JO-21026E</view>
+			<view>产品名称:箭牌机油滤清器 10款进口大众途锐...</view>
+			<view>库存数量:3</view>
+		</view>
+		<view class="buttons flex align_center justify_center">
+			<view><u-button @click="cansel" shape="circle" plain>返回列表</u-button></view>
+			<view><u-button @click="print" shape="circle" :custom-style="{background:$config('primaryColor')}" type="primary">开始打印</u-button></view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				part: null
+			}
+		},
+		methods: {
+			cansel(){
+				uni.navigateBack()
+			},
+			print(){
+				
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+.printTag{
+	background-color: #fff;
+	width: 100vh;
+	padding: 50rpx 30rpx;
+	.print-nums{
+		padding: 50rpx 30rpx;
+		color: #999;
+		font-size: 32rpx;
+		> view{
+			padding: 20rpx 0;
+		}
+		.uinput{
+			border: 2rpx solid #eee;
+			border-radius: 50rpx;
+			padding: 0 20rpx;
+		}
+		/deep/ .u-icon-disabled{
+			background: #fff!important;
+		}
+		/deep/ .u-number-input{
+			margin: 0 12rpx;
+			border: 2rpx solid #eee;
+			border-top: 0;
+			border-bottom: 0;
+		}
+	}
+	.shelf-info{
+		background-color: #f8f8f8;
+		padding: 30rpx;
+		border-radius: 12rpx;
+		color: #707070;
+		.shelf-info-title{
+			font-size: 32rpx;
+			color: #222222;
+			display: flex;
+			justify-content: space-between;
+			margin-bottom: 10rpx;
+			.pno{
+				background: rgba(3, 54, 146, 0.15);
+				border-radius: 100rpx;
+				padding: 6rpx 20rpx;
+				color: #033692;
+				font-size: 24rpx;
+			}
+		}
+	}
+	.buttons{
+		padding: 50rpx 0;
+		> view{
+			width: 36%;
+			margin: 0 2%;
+		}
+	}
+}
+</style>

+ 6 - 1
pages/latePlay/chooseBulk.vue

@@ -17,7 +17,7 @@
 			class="nav-right" 
 			class="nav-right" 
 			scroll-y 
 			scroll-y 
 			@scrolltolower="onreachBottom">
 			@scrolltolower="onreachBottom">
-				<view class="nav-right-item" v-for="(item, index) in shelfList" :key="item.id">
+				<view class="nav-right-item" v-for="(item, index) in shelfList" :key="item.id" @click="viewDetail(item)">
 					<view class="item-info uni-col-10">
 					<view class="item-info uni-col-10">
 						<view class="item-name">
 						<view class="item-name">
 							<text>{{item.shelfName}}</text>
 							<text>{{item.shelfName}}</text>
@@ -122,6 +122,11 @@
 					this.status = "nomore"
 					this.status = "nomore"
 				}
 				}
 			},
 			},
+			viewDetail(item){
+				uni.navigateTo({
+					url: "/pages/latePlay/chooseProduct?id="+item.id
+				})
+			}
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 221 - 6
pages/latePlay/chooseProduct.vue

@@ -1,22 +1,237 @@
 <template>
 <template>
-	<view>
-		
+	<view class="moreShelfPart flex flex_column">
+		<view class="moreShelfPart-search">
+			<u-search
+			placeholder="请输入货位号/产品编码/产品名称搜索" 
+			v-model="queryWord" 
+			:show-action="isGobleSearch" 
+			@focus="isGobleSearch=true" 
+			@custom="searchPart" 
+			@search="searchPart" 
+			@clear="searchPart"
+			:action-style="{'color': '#fff', 'font-size': '24upx', 'background-color': '#57a3f3', 'border-radius': '6upx', 'padding': '12upx 0'}">
+			</u-search>
+			<view class="p-title">
+				<text></text>
+				西安车领主常青二路数字货架
+			</view>
+		</view>
+		<view class="moreShelfPart-body">
+			<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">
+							<view class="pimgs">
+								<u-image width="128" height="128" border-radius="10"></u-image>
+							</view>
+							<view class="pinfo">
+								<view class="pname">
+									箭牌机油滤清器10款进口大众途锐 5.0L V10 TDI
+								</view>
+								<view class="ptxt flex align_center justify_between">
+									<view>
+										<text class="pcode">JB-11066A</text>
+									</view>
+									<view>
+									  库存数量:<text class="pnums">3个</text>
+									</view>
+								</view>
+							</view>
+						</view>
+					</view>
+					<view class="ptools flex align_center justify_between">
+						<view></view>
+						<view class="print" @click="print(item)">
+							<u-image :src="`/static/${$config('themePath')}/icon_printer@3x.png`" width="48" height="48"></u-image>
+						</view>
+					</view>
+				</view>
+				<view v-if="partList&&partList.length==0">
+					<u-empty v-if="status!='loading'" :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="240" :text="noDataText" mode="list" :margin-top="50"></u-empty>
+				</view>
+				<view style="padding: 20upx;" v-if="total>pageSize || status=='loading'">
+					<u-loadmore :status="status" />
+				</view>
+			</scroll-view>
+		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import { getShelfList } from '@/api/shelf'
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				
+				queryWord: '',
+				isGobleSearch: false,
+				partList: [],
+				pageNo:1,
+				pageSize: 10,
+				total: 0, // 列表总数
+				noDataText: '暂无货架',
+				status: 'loading',
+				vinstatus: 'loading'
 			}
 			}
 		},
 		},
+		onLoad(opts) {
+			this.getpartList()
+		},
 		methods: {
 		methods: {
-			
+			clearSearch(){
+				this.queryWord = ''
+				this.pageNo = 1
+				this.partList = []
+			},
+			// 搜索配件
+			searchPart(){
+				if(this.queryWord != ''){
+					this.clearSearch()
+					this.getpartList()
+				}
+			},
+			// 获取数字货架列表
+			getpartList(){
+				const _this = this
+				let params = {
+				    pageNo: this.pageNo,
+				    pageSize: this.pageSize,
+					queryWord: this.queryWord
+				}
+				_this.status = 'loading'
+				getShelfList(params).then(res => {
+					uni.hideLoading()
+					if(res.status == 200){
+						let list = res.data.list
+						if (list && list.length){
+							// 分页 拼接数据
+							if (_this.pageNo != 1) {
+								_this.partList = _this.partList ? _this.partList.concat(list) : list
+							} else {
+								_this.partList = list
+							}
+							this.total = res.data.count
+							if (_this.partList.length == res.data.count) {
+								_this.status = 'nomore'
+							} else {
+								_this.status = 'loadmore'
+							}
+						} else {
+							_this.partList = list || []
+							this.total = 0
+							_this.status = 'nomore'
+						}
+						_this.noDataText = '暂无配件'
+					}else{
+						_this.status = 'loadmore'
+						_this.partList = []
+						_this.total = 0
+						_this.noDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
+					}
+				})
+			},
+			// 加载更多
+			onreachBottom () {
+				if(this.partList.length < this.total ){
+					if(this.isGobleSearch&&this.queryWord==''){
+						return
+					}
+					this.pageNo++
+					this.getpartList()
+				}else{
+					this.status = "nomore"
+				}
+			},
+			print(item){
+				uni.navigateTo({
+					url: "/pages/common/printTag/printTag?id="+item.id
+				})
+			}
 		}
 		}
 	}
 	}
 </script>
 </script>
 
 
-<style>
-
+<style lang="less">
+	.moreShelfPart{
+		width: 100%;
+		height: 100vh;
+		.moreShelfPart-search{
+			padding: 20rpx 20rpx 0;
+			background-color: #FFFFFF;
+			border-bottom: 2rpx solid #f5f5f5;
+		}
+		.p-title{
+			padding: 20rpx;
+			display: flex;
+			align-items: center;
+			color: #222;
+			font-size: 32rpx;
+			text{
+				display: block;
+				height: 32rpx;
+				width: 6rpx;
+				background: #0485F6;
+				margin-right: 10rpx;
+				border-radius: 10rpx;
+			}
+		}
+		.moreShelfPart-body{
+			flex-grow: 1;
+			background-color: #fff;
+		}
+		.nav-right{
+			padding: 0 30upx;
+			height: calc(100vh - 180rpx);
+			box-sizing: border-box;
+			
+			.partList-list-box{
+				padding: 10px 0;
+				border-bottom: 2rpx solid #f5f5f5;
+				&:last-child{
+					border:0;
+				}
+				.product{
+					flex-grow: 1;
+					.checkbox{
+						width: 60rpx;
+					}
+					.pinfo{
+						flex-grow: 1;
+						padding-left: 20rpx;
+						.pname{
+							font-size: 32rpx;
+							color: #191919;
+							font-weight: bold;
+							margin-bottom: 10rpx;
+						}
+						.pno{
+							background-color: rgba(3, 54, 146, 0.15);
+							border-radius: 50rpx;
+							padding: 0 20rpx;
+							color: #033692;
+							font-size: 24rpx;
+							margin-right: 10rpx;
+						}
+						.ptxt{
+							font-size: 28rpx;
+							color: #999;
+							.pnums{
+								color: #222;
+							}
+						}
+					}
+				}
+				.ptools{
+					margin-top: 20rpx;
+					.pcurnums{
+						> text{
+							margin-right: 20rpx;
+						}
+					}
+				}
+			}
+		}
+	}
 </style>
 </style>

二進制
static/default/icon_printer@3x.png