Browse Source

都能运app扫码装车

xuwenqiang1992 2 năm trước cách đây
mục cha
commit
6661fd898d

+ 21 - 21
pages.json

@@ -8,49 +8,49 @@
 	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-			"path" : "pages/login/login",
-			"style" :                                                                                    
+			"path" : "pages/index/tabbar",
+			"style" :
 			{
-				"navigationBarTitleText": "登录都能运",
-				"enablePullDownRefresh": false
+				"navigationBarTitleText": "工作台",
+				"enablePullDownRefresh": true
 			}
-			
+
 		},
 		{
-			"path" : "pages/index/tabbar",
-			"style" :                                                                                    
+			"path" : "pages/login/login",
+			"style" :
 			{
-				"navigationBarTitleText": "工作台",
-				"enablePullDownRefresh": true
+				"navigationBarTitleText": "登录都能运",
+				"enablePullDownRefresh": false
 			}
-			
+
 		},
 		{
 			"path" : "pages/feedback/scanOrderCode",
-			"style" :                                                                                    
+			"style" :
 			{
 				"navigationBarTitleText": "扫码装车",
 				"enablePullDownRefresh": false
 			}
-			
+
 		},
 		{
 			"path" : "pages/feedback/print",
-			"style" :                                                                                    
+			"style" :
 			{
 				"navigationBarTitleText": "支线交接",
 				"enablePullDownRefresh": false
 			}
-			
+
 		},
 		{
 			"path" : "pages/feedback/scancodeCar",
-			"style" :                                                                                    
+			"style" :
 			{
 				"navigationBarTitleText": "扫码装车",
 				"enablePullDownRefresh": false
 			}
-			
+
 		},
 		{
 			"path": "pages/index/index",
@@ -60,21 +60,21 @@
 		},
 		{
 			"path" : "pages/index/myTruckList",
-			"style" :                                                                                    
+			"style" :
 			{
 				"navigationBarTitleText": "我的车辆",
 				"enablePullDownRefresh": true
 			}
-			
+
 		},
 		{
 			"path" : "pages/index/addTruck",
-			"style" :                                                                                    
+			"style" :
 			{
 				"navigationBarTitleText": "新增车辆",
 				"enablePullDownRefresh": false
 			}
-			
+
 		}
 	],
 	"globalStyle": {
@@ -86,6 +86,6 @@
 	"uniIdRouter": {},
 	//底部导航
 		"tabBar":{
-			
+
 		}
 }

+ 117 - 55
pages/feedback/scancodeCar.vue

@@ -8,6 +8,7 @@
 							<u-col span="10">
 								<view class="demo-layout">
 									<view>{{item.branchLineName}}<span>{{item.shipmentPackageCount}}</span>{{item.shipmentUnit}}</view>
+                  <view>{{item.erpOrderCode}}</view>
 									<view>{{item.shipmentName}}</view>
 								</view>
 							</u-col>
@@ -131,54 +132,116 @@
 					onlyFromCamera: true,
 					scanType: ['barCode', 'qrCode'],
 					success: function(res) {
-						if (res.result.match(new RegExp("^sendOrder.*$"))) {
-							console.log(res.result)
-							let idOrder = res.result.split("-")[2];
-							console.log(idOrder)
-							console.log(_that.hitOrders)
-							if(_that.hitOrders.indexOf(idOrder)==-1){
-								_that.hitOrders.push(idOrder)
-								_that.getShipDetails(idOrder)
-							}else {
-								uni.showToast({
-									title: "此单已扫码",
-									icon: 'none'
-								})
-							}
-						}
+            console.log("res",res);
+            console.log(res.result)
+            if (res.result.indexOf('sendOrder') != -1) {
+              let idOrder = res.result.split("-")[2];
+              console.log(idOrder)
+              _that.truckUpOrder(idOrder)
+            }else if(res.result.indexOf('orderLabel') != -1){
+              let orderCode = res.result.split("-")[1];
+              console.log(orderCode)
+              _that.getShipDetails(orderCode)
+            }
+
 					}
 				})
 			},
-			getShipDetails(idOrder) {
+      truckUpOrder(idOrder){
+        let _that = this;
+        let parms = {
+          idOrder: idOrder
+        }
+        request.httpPost("/dnyDriver/truckUpScanSendOrder", parms, true).then(res => {
+          if(res.httpCode==200){
+            var datas = res.data.inputItemList;
+            for (let i = 0; i < datas.length; i++) {
+              var items = datas[i]
+              var itemData = {
+                'branchLineName':items.branchLineName,
+                'shipmentName':items.shipmentName,
+                'shipmentPackageCount':items.shipmentPackageCount,
+                'erpOrderCode':items.erpOrderCode,
+                'shipmentUnit':items.shipmentUnit,
+                'id':items.id
+              }
+              if(!_that.breedTaskList.find(x => x.id === items.id)){
+                _that.totalUnit+=items.shipmentPackageCount
+                _that.breedTaskList.push(itemData)
+              }else {
+                uni.showToast({
+                  title: "此单已扫码",
+                  icon: 'none'
+                })
+              }
+
+            }
+
+            if(res.data.inputString){
+              uni.showToast({
+                title: res.data.inputString,
+                icon: 'none',
+                mask: true,
+                duration: 4000,
+              })
+            }
+          }else {
+            uni.showToast({
+              title: res.msg,
+              icon: 'none',
+              mask: true,
+              duration: 4000,
+            })
+          }
+        })
+      },
+			getShipDetails(orderCode) {
 				let _that = this;
 				let parms = {
-					idOrder: idOrder
+          orderCode: orderCode
 				}
-				console.log(parms);
-				request.httpPost("/dnyDriver/scanOrderCode", parms, true).then(res => {
-					console.log(res);
-					if (res.httpCode == 200) {
-						console.log(res.data);
-						var datas = res.data;
-						var itemData = {
-							'branchLineName':datas.branchLineName,
-							'shipmentName':datas.shipmentName,
-							'shipmentPackageCount':datas.shipmentPackageCount,
-							'shipmentUnit':datas.shipmentUnit,
-							'id':datas.id
-						}
-						_that.totalUnit+=datas.shipmentPackageCount
-						_that.breedTaskList.push(itemData)
-						console.log(_that.breedTaskList);
-					}else {
-						if(_that.hitOrders.length>0){
-							_that.hitOrders.pop()
-						}else {
-							_that.hitOrders = [];
-						}
-						
-						_that.$refs.uNotify.warning(res.msg)
-					}
+				request.httpPost("/dnyDriver/truckUpScanERPOrder", parms, true).then(res => {
+          if(res.httpCode==200){
+            var datas = res.data.inputItemList;
+            for (let i = 0; i < datas.length; i++) {
+              var items = datas[i]
+              var itemData = {
+                'branchLineName':items.branchLineName,
+                'shipmentName':items.shipmentName,
+                'shipmentPackageCount':items.shipmentPackageCount,
+                'shipmentUnit':items.shipmentUnit,
+                'erpOrderCode':items.erpOrderCode,
+                'id':items.id
+              }
+              if(!_that.breedTaskList.find(x => x.id === items.id)){
+                _that.totalUnit+=items.shipmentPackageCount
+                _that.breedTaskList.push(itemData)
+              }else {
+                uni.showToast({
+                  title: "此单已扫码",
+                  icon: 'none'
+                })
+              }
+
+            }
+
+            if(res.data.inputString){
+              uni.showToast({
+                title: res.data.inputString,
+                icon: 'none',
+                mask: true,
+                duration: 4000,
+              })
+            }
+          }else {
+            uni.showToast({
+              title: res.msg,
+              icon: 'none',
+              mask: true,
+              duration: 4000,
+            })
+          }
+
 				});
 			},
 			parseBreedTaskStatus(task) {
@@ -201,13 +264,13 @@
 			viewBreedTaskMore(task) {
 				task.showMore = !task.showMore
 			},
-			
+
 			deleteBtn(index){
 				this.totalUnit = this.totalUnit-this.breedTaskList[index].shipmentPackageCount
 				this.breedTaskList.splice(index, 1)
 				this.hitOrders.splice(index, 1)
-				
-				
+
+
 			},
 			feedBackPopupClose() {
 				this.feedBackPopupShow = false;
@@ -275,19 +338,19 @@
 	.demo-layout{
 		font-size: 36rpx;
 	}
-/deep/ .uni-card .uni-card__header{
-	border-bottom: none !important;
-}
+	/deep/ .uni-card .uni-card__header{
+		border-bottom: none !important;
+	}
 	/deep/ .uni-list-item__container {
 		padding: 0rpx;
 	}
-		/deep/ .fab{
-			.uniui-plusempty:before {
-				//content: "\e67b";
-				content: '\e654' !important;
-			}
+	/deep/ .fab{
+		.uniui-plusempty:before {
+			//content: "\e67b";
+			content: '\e654' !important;
 		}
-		.card-actions {
+	}
+	.card-actions {
 		display: flex;
 		flex-direction: row;
 		justify-content: space-around;
@@ -380,7 +443,6 @@
 				}
 			}
 		}
-
 		>view:last-child {
 			background: #FFD202;
 		}

+ 9 - 28
pages/index/tabbar.vue

@@ -2,7 +2,8 @@
 	<view>
 		<workTable ref="workTableRef" v-if="pageCurrent=='workTable'"></workTable>
 		<me v-if="pageCurrent=='me'"></me>
-		
+    <me v-if="pageCurrent=='order'"></me>
+
 		<view class="box">
 			<view class="cu-bar tabbar bg-white shadow foot">
 				<view class="action" @click="navChange" data-cur="order">
@@ -19,12 +20,12 @@
 					</view>
 					<view :class="pageCurrent=='workTable'?'color_main':'text-gray'">工作台</view>
 				</view>
-				
+
 <!-- 				<view @click="navChange" class="action text-gray add-action" data-cur="workTable">
 					<image class="logo_btn" mode="widthFix" src="../../static/logo.png"></image>
 					<view :class="pageCurrent=='workTable'?'color_main':'text-gray'">工作台</view>
 				</view> -->
-				
+
 				<view class="action" @click="navChange" data-cur="me">
 					<view class='cuIcon-cu-image'>
 						<view class="cu-tag badge">
@@ -42,7 +43,7 @@
 </template>
 
 <script>
-	import order from "./order.vue"; //消息
+	import order from "./order.vue"; //配送列表
 	import workTable from "./workTable.vue"; //工作台
 	import me from "./me.vue"; //个人中心
 	export default {
@@ -56,33 +57,13 @@
 				pageCurrent: 'workTable'
 			}
 		},
-		mounted() {
-			
-		},
 		methods: {
-			
+
 			navChange: function(e) {
-				console.log(e.currentTarget.dataset.cur);
 				this.pageCurrent = e.currentTarget.dataset.cur;
 			}
 		},
-		onLoad: function (options) {
-			//uni.startPullDownRefresh();
-			setTimeout(function () {
-					console.log('start pulldown');
-			}, 1500);
-			// uni.startPullDownRefresh();
-		},
-		onPullDownRefresh() {
-			// console.log('refresh');
-			// if (this.pageCurrent == 'workTable') {				
-			// 	this.$refs['workTableRef'].pullDownRefresh();
-			// 	setTimeout(function () {
-			// 		uni.stopPullDownRefresh();
-			// 	}, 1000);
-			// }
-		}
-		
+
 	}
 </script>
 
@@ -94,7 +75,7 @@
 	.box view.cu-bar {
 		margin-top: 20upx;
 	}
-	
+
 	.logo_btn{
 		width: 38*2rpx;
 		height: 38*2rpx;
@@ -108,7 +89,7 @@
 		margin: auto;
 		padding: 0;
 	}
-	
+
 	.cu-bar.tabbar .action.add-action {
 	    padding-top: 56rpx !important;
 	}

+ 0 - 2
pages/login/login.vue

@@ -58,8 +58,6 @@
 					"supplierId":1
 				}
 				request.httpPost("/dnyDriver/login", userData, false).then(res => {
-					console.log(res);
-
 					if (res.httpCode == 200) {
 						uni.setStorageSync("erpToken", res.data.accessToken);
 						uni.reLaunch({

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 2 - 2
unpackage/dist/dev/app-plus/app-config-service.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 675 - 663
unpackage/dist/dev/app-plus/app-service.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 563 - 555
unpackage/dist/dev/app-plus/app-view.js