Browse Source

bug 修复

lilei 2 years ago
parent
commit
da603c8aca
1 changed files with 8 additions and 7 deletions
  1. 8 7
      pages/index/index.vue

+ 8 - 7
pages/index/index.vue

@@ -366,17 +366,18 @@
 				// 扫描
 				if(index == 0){
 					uni.scanCode({
-						success: function (res) {
-							console.log(res);
+						success: function (ret) {
+							console.log(ret);
 							const params = {
-								codeType: res.scanType == 'QR_CODE' ? 0 : 1,
+								codeType: ret.scanType == 'QR_CODE' ? 0 : 1,
 							}
+							const billSource = ret.scanType == 'QR_CODE' ? 'qr_code': 'bar_code'
 							// 二维码
-							if(res.scanType == 'QR_CODE'){
-								const ret = res.result.split("&")
+							if(ret.scanType == 'QR_CODE'){
+								const ret = ret.result.split("&")
 								params.productSn = ret[2] // 产品编码sn
 							}else{
-								params.qrCode = res.result
+								params.qrCode = ret.result
 							}
 							uni.showLoading({
 								title: "正在查询产品..."
@@ -385,7 +386,7 @@
 							getProductfindByScanCode(params).then(res => {
 								if(res.status == 200 && res.data){
 									if(res.data.currentInven){
-										const params = Object.assign({shelfSn: shelfSn, billSource: res.scanType == 'QR_CODE' ? 'qr_code': 'bar_code'},res.data)
+										const params = Object.assign({shelfSn: shelfSn, billSource: billSource},res.data)
 										_this.$store.state.vuex_tempData = params
 										uni.navigateTo({
 											url: '/pages/queryByCode/confirmQh'