Sfoglia il codice sorgente

补货出库 - 手动打印

chenrui 3 anni fa
parent
commit
dff5a3e31a

+ 8 - 0
api/shelfReplenish.js

@@ -52,4 +52,12 @@ export const shelfReplenishPutStock = (params) => {
     data: params,
     data: params,
     method: 'post'
     method: 'post'
   })
   })
+}
+//  补货单 打印贴签
+export const shelfReplenishPrintSign = (params) => {
+  return axios.request({
+    url: 'shelfReplenish/detail/printSign',
+    data: params,
+    method: 'post'
+  })
 }
 }

+ 8 - 0
pages.json

@@ -102,6 +102,14 @@
 				"enablePullDownRefresh": false
 				"enablePullDownRefresh": false
 			}
 			}
 		},
 		},
+		{
+			"path" : "pages/replenishmentManage/manualPrint",
+			"style" :
+			{
+				"navigationBarTitleText": "手动打印",
+				"enablePullDownRefresh": false
+			}
+		},
 		{
 		{
 			"path" : "pages/replenishmentManage/signWarehousing",
 			"path" : "pages/replenishmentManage/signWarehousing",
 			"style" :
 			"style" :

+ 12 - 4
pages/common/partList.vue

@@ -13,14 +13,14 @@
 							<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>
 							<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>
 						<view class="pinfo">
 						<view class="pinfo">
-							<view class="pname" v-if="pageType=='replenishmentSign'||pageType=='replenishmentOut'||pageType=='replenishmentDetail'||pageType=='replenishmentDetailc'">{{item.product&&item.product.name?item.product.name:'--'}}</view>
+							<view class="pname" v-if="pageType=='replenishmentSign'||pageType=='replenishmentOut'||pageType=='manualPrint'||pageType=='replenishmentDetail'||pageType=='replenishmentDetailc'">{{item.product&&item.product.name?item.product.name:'--'}}</view>
 							<view class="pname" v-else>{{item.productName}}</view>
 							<view class="pname" v-else>{{item.productName}}</view>
 							<view class="ptxt flex align_center justify_between">
 							<view class="ptxt flex align_center justify_between">
 								<view>
 								<view>
-									<text class="pcode" v-if="pageType=='replenishmentSign'||pageType=='replenishmentOut'||pageType=='replenishmentDetail'||pageType=='replenishmentDetailc'">{{item.product&&item.product.code?item.product.code:'--'}}</text>
+									<text class="pcode" v-if="pageType=='replenishmentSign'||pageType=='replenishmentOut'||pageType=='manualPrint'||pageType=='replenishmentDetail'||pageType=='replenishmentDetailc'">{{item.product&&item.product.code?item.product.code:'--'}}</text>
 									<text class="pcode" v-else>{{item.productCode}}</text>
 									<text class="pcode" v-else>{{item.productCode}}</text>
 								</view>
 								</view>
-								<view v-if="pageType=='replenishmentSign'">
+								<view v-if="pageType=='replenishmentSign'||pageType=='manualPrint'">
 									实发数量:<text class="pnums">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}{{item.product&&item.product.unit?item.product.unit:'--'}}</text>
 									实发数量:<text class="pnums">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}{{item.product&&item.product.unit?item.product.unit:'--'}}</text>
 								</view>
 								</view>
 								<view v-if="pageType=='replenishmentOut'">
 								<view v-if="pageType=='replenishmentOut'">
@@ -57,6 +57,12 @@
 							<u-number-box color="#000" bg-color="#fff" v-model="item.quitQty" :min="1" :max="item.qty"></u-number-box>
 							<u-number-box color="#000" bg-color="#fff" v-model="item.quitQty" :min="1" :max="item.qty"></u-number-box>
 						</view>
 						</view>
 					</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>
+						</view>
+					</view>
 				</view>
 				</view>
 				<!-- 无复选框 -->
 				<!-- 无复选框 -->
 				<view v-if="model == 'view'" class="ptools flex align_center justify_between">
 				<view v-if="model == 'view'" class="ptools flex align_center justify_between">
@@ -98,7 +104,7 @@
 				type: String,
 				type: String,
 				default: 'checkbox'
 				default: 'checkbox'
 			},
 			},
-			// 那个功能页面调用,展示不同的字段,recall: 调回单,replenishmentSign:补货签收,replenishmentOut:补货出库,replenishmentDetail:补货详情-已完成,replenishmentDetailc:补货详情-已取消
+			// 那个功能页面调用,展示不同的字段,recall: 调回单,replenishmentSign:补货签收,replenishmentOut:补货出库,manualPrint:手动打印,replenishmentDetail:补货详情-已完成,replenishmentDetailc:补货详情-已取消
 			fromPage: {
 			fromPage: {
 				type: String,
 				type: String,
 				default: ''
 				default: ''
@@ -113,6 +119,8 @@
 						this.totalNums = this.totalNums + item.putQty
 						this.totalNums = this.totalNums + item.putQty
 					}else if(_this.pageType=='replenishmentOut'){  // 补货出库
 					}else if(_this.pageType=='replenishmentOut'){  // 补货出库
 						this.totalNums = this.totalNums + item.confirmQty
 						this.totalNums = this.totalNums + item.confirmQty
+					}else if(_this.pageType=='manualPrint'){  // 补货-手动打印
+						this.totalNums = this.totalNums + item.confirmQty
 					}else if(_this.pageType=='replenishmentDetail'){  // 补货详情-已完成
 					}else if(_this.pageType=='replenishmentDetail'){  // 补货详情-已完成
 						this.totalNums = this.totalNums + item.putQty
 						this.totalNums = this.totalNums + item.putQty
 					}else if(_this.pageType=='replenishmentDetailc'){  // 补货详情-已取消
 					}else if(_this.pageType=='replenishmentDetailc'){  // 补货详情-已取消

+ 7 - 1
pages/replenishmentManage/confirm.vue

@@ -38,7 +38,7 @@
 				customStyle: {
 				customStyle: {
 					borderRadius:'100rpx',
 					borderRadius:'100rpx',
 					fontSize:'30rpx',
 					fontSize:'30rpx',
-					background: '#0485F6'
+					background: this.$config('primaryColor')
 				},
 				},
 				confirmQty: 0,  // 实发数量之和
 				confirmQty: 0,  // 实发数量之和
 				totalQty: 0,  // 应发数量之和
 				totalQty: 0,  // 应发数量之和
@@ -49,6 +49,12 @@
 				paramsData: null
 				paramsData: null
 			}
 			}
 		},
 		},
+		onReady() {
+			uni.setNavigationBarColor({
+				frontColor: '#ffffff',
+				backgroundColor: this.$config('primaryColor')
+			})
+		},
 		onLoad(options){
 		onLoad(options){
 			this.theme = getApp().globalData.theme
 			this.theme = getApp().globalData.theme
 			this.replenishBillSn = options.sn
 			this.replenishBillSn = options.sn

+ 1 - 1
pages/replenishmentManage/detail.vue

@@ -46,7 +46,7 @@
 				customStyle: {
 				customStyle: {
 					borderRadius:'100rpx',
 					borderRadius:'100rpx',
 					fontSize:'30rpx',
 					fontSize:'30rpx',
-					background: '#0485F6'
+					background: this.$config('primaryColor')
 				},
 				},
 				pageType: ''
 				pageType: ''
 			}
 			}

+ 135 - 0
pages/replenishmentManage/manualPrint.vue

@@ -0,0 +1,135 @@
+<template>
+	<view class="replenishment-manualPrint-wrap">
+		<view class="replenishment-manualPrint-body">
+			<view class="part-list">
+				<!-- 补货产品 -->
+				<partList :list="partList" title="补货产品" model="checkbox" fromPage="manualPrint" ref="partList" noDataText="暂无产品" @allChecked="allCheckedCallback"></partList>
+			</view>
+		</view>
+		<view class="replenishment-manualPrint-footer">
+			<view>
+				<u-checkbox size="40" @change="allCheckeChange" v-model="allChecked" shape="circle">{{allChecked?'取消全选':'全选'}}</u-checkbox>
+			</view>
+			<view>
+				<u-button @click="handleSubmit" shape="circle" :custom-style="{background:$config('primaryColor')}" type="primary">开始打印</u-button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { shelfReplenishDetail, shelfReplenishDetailList, shelfReplenishPrintSign } from '@/api/shelfReplenish'
+	import partList from '@/pages/common/partList.vue'
+	export default {
+		components: { partList },
+		data() {
+			return {
+				replenishBillSn: '',
+				basicInfoData:null,
+				partList: [],
+				allChecked: false,
+			}
+		},
+		onReady() {
+			uni.setNavigationBarColor({
+				frontColor: '#ffffff',
+				backgroundColor: this.$config('primaryColor')
+			})
+		},
+		onLoad(option) {
+			this.replenishBillSn = option.replenishBillSn
+			this.getDetail()
+			this.getPartList()
+		},
+		methods: {
+			// 查询详情
+			getDetail(){
+				shelfReplenishDetail({ sn: this.replenishBillSn }).then(res => {
+					if(res.status == 200){
+						this.basicInfoData = res.data || null
+					}else{
+						this.basicInfoData = null
+					}
+				})
+			},
+			// 查询列表
+			getPartList(){
+				const _this = this
+				shelfReplenishDetailList({ replenishBillSn: this.replenishBillSn }).then(res => {
+					if(res.status == 200 && res.data){
+						res.data.map(item =>{
+							item.confirmQty = item.confirmQty ? Number(item.confirmQty) : 0
+							item.printQty = item.confirmQty ? Number(item.confirmQty) : 0
+						})
+						this.partList = res.data || []
+					}else{
+						this.partList = []
+					}
+				})
+			},
+			// 开始打印
+			handleSubmit(){
+				const result =this.$refs.partList.getAllChecked()
+				if(result.length){
+					const arr = []
+					result.map((item, index) => {
+					  if (item.printQty || item.printQty == 0) {
+					    arr.push({ productSn: item.productSn, printQty: item.printQty })
+					  }
+					})
+					const params = {
+					  replenishBillSn: this.replenishBillSn,
+					  detailList: arr
+					}
+					shelfReplenishPrintSign(params).then(res => {
+						if(res.status == 200){
+							uni.$emit("refreshBL")
+							uni.navigateBack()
+						}
+						this.toashMsg(res.message)
+					})
+				}else{
+					this.toashMsg("请选择产品!")
+				}
+			},
+			// 全选
+			allCheckeChange(e){
+				this.$refs.partList.allSelect(e.value)
+			},
+			allCheckedCallback(val){
+				this.allChecked = val
+			},
+		}
+	}
+</script>
+
+<style lang="less">
+.replenishment-manualPrint-wrap{
+	position: relative;
+	width: 100%;
+	height: 100%;
+	overflow: hidden;
+	padding-bottom: 102upx;
+	.replenishment-manualPrint-body{
+		> view{
+			padding: 10rpx 25rpx;
+			background-color: #fff;
+			margin-bottom: 20rpx;
+			border-radius: 25rpx;
+			box-shadow: 2rpx 3rpx 5rpx #eee;
+		}
+	}
+	.replenishment-manualPrint-footer{
+		padding: 10upx 32upx 12upx;
+		background-color: #fff;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		width: 100%;
+		box-shadow: 3px 1px 7px #eee;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+	}
+}
+</style>

+ 18 - 9
pages/replenishmentManage/outWarehousing.vue

@@ -23,20 +23,20 @@
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="replenishment-outWarehousing-footer">
 		<view class="replenishment-outWarehousing-footer">
-			<u-button class="button" @click="confirmModal=true" :custom-style="customDefalutStyle" hover-class="none" shape="circle">打印标签</u-button>
-			<u-button class="button" @click="confirmModal=true" type="success" :custom-style="customStyle" hover-class="none" shape="circle">发货出库</u-button>
+			<u-button class="button" @click="printModal=true" :custom-style="customDefalutStyle" hover-class="none" shape="circle">打印标签</u-button>
+			<u-button class="button" @click="" type="success" :custom-style="customStyle" hover-class="none" shape="circle">发货出库</u-button>
 		</view>
 		</view>
-		<!-- 确认弹框 -->
-		<common-modal :openModal="confirmModal" content="确认信息无误并进行出库吗?" confirmText="确认出库" @confirm="modalConfirm" @close="confirmModal=false" />
+		<!-- 打印贴签 -->
+		<print-sticker-modal :openModal="printModal" @confirm="modalPrint" @close="printModal=false" />
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
-	import commonModal from '@/pages/common/commonModal.vue'
+	import printStickerModal from './printStickerModal.vue'
 	import { shelfReplenishDetail, shelfReplenishDetailList, shelfReplenishPutStock } from '@/api/shelfReplenish'
 	import { shelfReplenishDetail, shelfReplenishDetailList, shelfReplenishPutStock } from '@/api/shelfReplenish'
 	import partList from '@/pages/common/partList.vue'
 	import partList from '@/pages/common/partList.vue'
 	export default {
 	export default {
-		components: { partList, commonModal },
+		components: { partList, printStickerModal },
 		data() {
 		data() {
 			return {
 			return {
 				replenishBillSn: '',
 				replenishBillSn: '',
@@ -45,15 +45,15 @@
 				customStyle: {
 				customStyle: {
 					borderRadius:'100rpx',
 					borderRadius:'100rpx',
 					fontSize:'30rpx',
 					fontSize:'30rpx',
-					background: '#0485F6'
+					background: this.$config('primaryColor')
 				},
 				},
 				customDefalutStyle: {
 				customDefalutStyle: {
 					borderRadius:'100rpx',
 					borderRadius:'100rpx',
 					fontSize:'30rpx',
 					fontSize:'30rpx',
-					color: '#0485F6',
+					color: this.$config('primaryColor'),
 					background: '#fff'
 					background: '#fff'
 				},
 				},
-				confirmModal: false
+				printModal: false
 			}
 			}
 		},
 		},
 		onReady() {
 		onReady() {
@@ -111,6 +111,15 @@
 					}
 					}
 					this.toashMsg(res.message)
 					this.toashMsg(res.message)
 				})
 				})
+			},
+			// 打印贴签 confirm
+			modalPrint(type){
+				this.printModal = false
+				if(type == 'manual'){  // 手动打印
+					uni.navigateTo({ url: "/pages/replenishmentManage/manualPrint" })
+				}else if(type == 'scan'){  // 扫码打印
+					
+				}
 			}
 			}
 		}
 		}
 	}
 	}

+ 149 - 0
pages/replenishmentManage/printStickerModal.vue

@@ -0,0 +1,149 @@
+<template>
+	<u-mask class="commonModal" :show="isShow" :mask-click-able="false">
+		<view class="modal-con">
+			<view class="modal-title">打印贴签</view>
+			<view class="modal-main">
+				<u-radio-group v-model="printType">
+					<u-radio name="manual">
+						<view class="print-con">
+							<u-image class="item-pic" src="../../static/default/icon_print_manual.png" width="80" height="80"></u-image>
+							<view class="print-main">
+								<text class="print-type">手动打印</text>
+								<text class="print-exp">在产品列表中自行选择需要打印贴签的产品</text>
+							</view>
+						</view>
+					</u-radio>
+					<u-radio name="scan">
+						<view class="print-con">
+							<u-image class="item-pic" src="../../static/default/icon_print_code.png" width="80" height="80"></u-image>
+							<view class="print-main">
+								<text class="print-type">扫码打印</text>
+								<text class="print-exp">扫描产品条形码进行打印</text>
+							</view>
+						</view>
+					</u-radio>
+				</u-radio-group>
+			</view>
+			<view class="modal-footer">
+				<view class="button-cancel" @click="isShow=false">取消</view>
+				<view class="button-confirm" @click="handleConfirm">确定</view>
+			</view>
+		</view>
+	</u-mask>
+</template>
+
+<script>
+	export default {
+		props: {
+			openModal: { //  弹框显示状态
+				type: Boolean,
+				default: false
+			}
+		},
+		data() {
+			return {
+				isShow: this.openModal, //  是否打开弹框
+				printType: 'manual'
+			}
+		},
+		methods: {
+			// 确认
+			handleConfirm(){
+				this.$emit('confirm', this.printType)
+			}
+		},
+		watch: {
+			//  父页面传过来的弹框状态
+			openModal (newValue, oldValue) {
+				this.isShow = newValue
+			},
+			//  重定义的弹框状态
+			isShow (newValue, oldValue) {
+			  if (!newValue) {
+			    this.$emit('close')
+			  }
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.commonModal{
+		width: 100%;
+		height: 100%;
+		position: absolute;
+		left: 0;
+		top: 0;
+		.modal-con{
+			width: 78%;
+			margin: 50% auto 0;
+			background-color: #fff;
+			border-radius: 24upx;
+			.modal-title{
+				text-align: center;
+				font-size: 30upx;
+				color: #000;
+				padding: 30upx 30upx 0;
+			}
+			.modal-main{
+				margin: 20upx 0 30upx;
+				/deep/ .u-radio{
+					width: 94%!important;
+					flex-direction: row-reverse;
+					justify-content: space-between;
+					margin: 0 3%;
+				}
+				/deep/ .u-radio__icon-wrap{
+					flex-shrink: 0;
+				}
+				/deep/ .u-radio__label{
+					flex-grow: 1;
+					border-bottom: 2upx dashed #E5E5E5;
+					padding: 3% 0;
+				}
+				.print-con{
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+					.item-pic{
+						flex-shrink: 0;
+						margin-right: 20upx;
+					}
+					.print-main{
+						flex-grow: 1;
+						.print-type{
+							display: block;
+							font-size: 30upx;
+							color: #222;
+						}
+						.print-exp{
+							display: block;
+							font-size: 26upx;
+							color: #666E75;
+							line-height: 40upx;
+						}
+					}
+				}
+			}
+			.modal-footer{
+				font-size: 30upx;
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				text-align: center;
+				border-top: 1upx solid #E5E5E5;
+				.button-cancel{
+					color: #999;
+					border-right: 1upx solid #E5E5E5;
+					flex-grow: 1;
+					padding: 20upx 0;
+				}
+				.button-confirm{
+					color: #2A86F4;
+					flex-grow: 1;
+					padding: 20upx 0;
+				}
+			}
+		}
+	}
+</style>

+ 6 - 0
pages/replenishmentManage/replenishmentList.vue

@@ -84,6 +84,12 @@
 				action:'swiperChange', // 操作类型,上划分页,或左右滑动
 				action:'swiperChange', // 操作类型,上划分页,或左右滑动
 			}
 			}
 		},
 		},
+		onReady() {
+			uni.setNavigationBarColor({
+				frontColor: '#ffffff',
+				backgroundColor: this.$config('primaryColor')
+			})
+		},
 		onLoad() {
 		onLoad() {
 			// 监听整改完成后刷新事件
 			// 监听整改完成后刷新事件
 			uni.$on('refreshBL',this.getRow)
 			uni.$on('refreshBL',this.getRow)

+ 1 - 1
pages/replenishmentManage/signWarehousing.vue

@@ -46,7 +46,7 @@
 				customStyle: {
 				customStyle: {
 					borderRadius:'100rpx',
 					borderRadius:'100rpx',
 					fontSize:'30rpx',
 					fontSize:'30rpx',
-					background: '#0485F6'
+					background: this.$config('primaryColor')
 				},
 				},
 				confirmModal: false
 				confirmModal: false
 			}
 			}

BIN
static/default/icon_print_code.png


BIN
static/default/icon_print_manual.png