chenrui 3 rokov pred
rodič
commit
ba91d8bcfe

+ 15 - 13
pages/common/printTag/printTag.vue

@@ -42,34 +42,36 @@
 		onLoad(options) {
 			const _this = this
 			_this.fromPage = options.page
-			_this.infoData = options.data ? JSON.parse(options.data) : {}
-				console.log(_this.infoData)
+			_this.infoData = options.data ? JSON.parse(options.data) : {},
+			_this.printNum = _this.fromPage == 'smdy' ? _this.infoData.confirmQty : _this.infoData.qty
+			console.log(_this.infoData)
+			var myDate = new Date()
 			if(_this.fromPage == 'bdtq'){
 				_this.printInfo = {
-					dealerName: '剪冠汽配西安长ab路店123汽配西安长青二路',
+					dealerName: _this.$store.state.vuex_userData.orgName,
 					shelfName: _this.infoData.shelfName || '',
 					productCode: _this.infoData.productEntity&&_this.infoData.productEntity.code || '',
 					productName: _this.infoData.productEntity&&_this.infoData.productEntity.productName || '',
 					shelfPlaceCode: _this.infoData.shelfPlaceCode || '',
-					currentInven: 3,
-					printDate: '2021-12-21 15:30',
-					printUser: '张三',
-					barCode: 'dealerSn=1033242&shelfSn=342326735950757888&productCode=RPF2340&shelfPlaceCode=A01&shelfPlaceSn=123213'
+					currentInven: _this.printNum,
+					printDate: myDate.toLocaleDateString() +' '+myDate.getHours() +':'+myDate.getMinutes() +':'+myDate.getSeconds(),
+					printUser: _this.$store.state.vuex_userData.username,
+					barCode: `dealerSn=${_this.$store.state.vuex_userData.orgSn}&shelfSn=${_this.infoData.shelfSn}&productCode=${_this.infoData.productEntity&&_this.infoData.productEntity.code}&shelfPlaceCode=${_this.infoData.shelfPlaceCode}&shelfPlaceSn=${_this.infoData.shelfPlaceSn}`
 				}
 			}else if(_this.fromPage == 'smdy'){
 				_this.printInfo = {
-					dealerName: '剪冠汽配西安长ab路店123汽配西安长青二路',
+					dealerName: _this.$store.state.vuex_userData.orgName,
 					shelfName: _this.infoData.shelfName || '',
 					productCode: _this.infoData.productCode || '',
 					productName: _this.infoData.productName || '',
 					shelfPlaceCode: _this.infoData.shelfPlaceCode || '',
-					currentInven: 3,
-					printDate: '2021-12-21 15:30',
-					printUser: '张三',
-					barCode: 'dealerSn=1033242&shelfSn=342326735950757888&productCode=RPF2340&shelfPlaceCode=A01&shelfPlaceSn=123213'
+					currentInven: _this.printNum,
+					printDate: myDate.toLocaleDateString() +' '+myDate.getHours() +':'+myDate.getMinutes() +':'+myDate.getSeconds(),
+					printUser: _this.$store.state.vuex_userData.username,
+					barCode: `dealerSn=${_this.$store.state.vuex_userData.orgSn}&shelfSn=${_this.infoData.shelfSn}&productSn=${_this.infoData.productSn}&productCode=${_this.infoData.productCode}&shelfPlaceCode=${_this.infoData.shelfPlaceCode}&shelfPlaceSn=${_this.infoData.shelfPlaceSn}&replenishBillDetailSn=${_this.infoData.replenishBillDetailSn}`
 				}
 			}
-			_this.printNum = _this.fromPage == 'smdy' ? _this.infoData.confirmQty : _this.infoData.qty
+			console.log('printInfo-----------',_this.printInfo)
 		},
 		onUnload() {
 			this.$refs.kkprinter.closeConnect()

+ 5 - 1
pages/replenishmentManage/scanCodePrint.vue

@@ -64,14 +64,18 @@
 					productQrCode: qrCode,
 					replenishBillSn: this.replenishBillSn
 				}).then(res => {
+					console.log(res)
 					if(res.status == 200){
 						let params = {
 							shelfName: res.data&&res.data[0]&&res.data[0].shelf&&res.data[0].shelf.shelfName,
 							productName: res.data&&res.data[0]&&res.data[0].product&&res.data[0].product.name,
 							productCode: res.data&&res.data[0]&&res.data[0].product&&res.data[0].product.code,
+							productSn: res.data&&res.data[0]&&res.data[0].product&&res.data[0].product.productSn,
 							confirmQty: res.data&&res.data[0]&&res.data[0].confirmQty,
 							shelfSn: res.data&&res.data[0]&&res.data[0].shelfSn,
-							shelfSn: res.data&&res.data[0]&&res.data[0].shelfSn
+							replenishBillDetailSn: res.data&&res.data[0]&&res.data[0].replenishBillDetailSn,
+							shelfPlaceCode: res.data&&res.data[0]&&res.data[0].shelfPlaceCode,
+							shelfPlaceSn: res.data&&res.data[0]&&res.data[0].shelfPlaceSn
 						}
 						uni.navigateTo({ url: "/pages/common/printTag/printTag?page=smdy&data="+JSON.stringify(params) })
 					}else{