Browse Source

xwh修改单个订单下架页面增加运单功能和取消库位号扫描

xwh 4 years ago
parent
commit
74c9fc1faa
2 changed files with 27 additions and 21 deletions
  1. 3 3
      html/out/outShelf.html
  2. 24 18
      js/out/singleOutShelf.js

+ 3 - 3
html/out/outShelf.html

@@ -45,7 +45,7 @@
 			<form class="mui-input-group">
 				<div class="mui-input-row">
 					<label>出库单号</label>
-					<input type="text" class="mui-input-clear" placeholder="扫描出库单号" id="outOrderNo">
+					<input type="text" class="mui-input-clear" placeholder="扫描出库单号或跟踪单号(运单号)" id="outOrderNo">
 					<input type="text" id="outOrderId" style="display: none;">
 				</div>
 				
@@ -100,10 +100,10 @@
 					<input type="text" placeholder="" readonly="readonly" id="customerCode" class="readonlyInput">
 				</div>
 				
-				<div class="mui-input-row">
+			<!-- 	<div class="mui-input-row">
 					<label>下架库位</label>
 					<input type="text" class="mui-input-clear" placeholder="扫描库位条码" id="locationCode">
-				</div>
+				</div> -->
 				
 				<div class="mui-input-row">
 					<label>商品条码</label>

+ 24 - 18
js/out/singleOutShelf.js

@@ -50,15 +50,15 @@ $(function(){
         submitOutOrderNo();
     });
 	
-    //库位号回车
-    $('#locationCode').keyup(function (event) {
-    	if (event.keyCode != "13") {return false;}
-    	$("#locationCode").val(trimStr($("#locationCode").val()));
-    	//播放扫描声音
-    	playSound('../raw/scan.wav');
+    // //库位号回车
+    // $('#locationCode').keyup(function (event) {
+    // 	if (event.keyCode != "13") {return false;}
+    // 	$("#locationCode").val(trimStr($("#locationCode").val()));
+    // 	//播放扫描声音
+    // 	playSound('../raw/scan.wav');
     	
-    	$('#barcode').focus();
-    });
+    // 	$('#barcode').focus();
+    // });
     
     //条码回车
     $('#barcode').keyup(function (event) {
@@ -88,6 +88,7 @@ function submitOutOrderNo(){
    appRequest.opType = OP_TYPE_MENU.OUT_SHELF_1;
    appRequest.msg = outOrderNo;//msg是消息内容主体
    console.log("请求后台提交出库单")
+   console.log($appRequestUrl)
    $.ajax({
         type: 'POST',
         url: $appRequestUrl,
@@ -111,9 +112,11 @@ function submitOutOrderNo(){
         	$("#statusName").text(outOrder.statusName);
         	$("#shipwayName").text(outOrder.shipwayName);
 			     
+			// 清空输入框
+			nextBarcode();
 			refreshItems();     
         	//进入下架操作
-        	$("#locationCode").focus();
+        	$("#barcode").focus();
         },
         error: function () {
         	playSound('../raw/error.wav');
@@ -203,12 +206,12 @@ function submitBarcode(){
 	var outOrderNo = $('#outOrderNo').val();
 	var outOrderId=$("#outOrderId").val();
 	var barcode= $('#barcode').val();
-	var locationCode=$('#locationCode').val();
+	// var locationCode=$('#locationCode').val();
 	
 	var formData={};
 	formData.outOrderNo=outOrderNo;
 	formData.outOrderId=outOrderId;
-	formData.locationCode=locationCode;
+	// formData.locationCode=locationCode;
 	formData.barcode=barcode;
 
    	var appRequest = $appRequest;//复制请求封装对象
@@ -286,7 +289,7 @@ function submitOutShelf(){
 	var outOrderId=$("#outOrderId").val();
 	var outOrderNo = $('#outOrderNo').val();
 	var allocationId=$('#allocationId').val();
-	var locationCode=$('#locationCode').val();
+	// var locationCode=$('#locationCode').val();
 	
 	//如果是扫描增加数量,条码输入框是空的,从展示条码取
 	var barcode= $('#barcode').val();
@@ -297,8 +300,8 @@ function submitOutShelf(){
 	console.log("2")
 	var productQty=$("#productQty").val();
 	
-	if(outOrderId == '' || locationCode == '' || barcode == ''){
-		mui.alert("货位号,商品条码,订单号 为必填项", '警告'); 
+	if(outOrderId == ''  || barcode == ''){
+		mui.alert("商品条码,订单号 为必填项", '警告'); 
 		
 		isSubmintIng = false;
 		return;
@@ -309,7 +312,7 @@ function submitOutShelf(){
 	formData.outOrderNo=outOrderNo;
 	formData.quantity=productQty;
 	formData.allocationId=allocationId;
-	formData.locationCode=locationCode;
+	// formData.locationCode=locationCode;
 	formData.barcode=barcode;
 		
 	var appRequest = $appRequest;//复制请求封装对象
@@ -325,12 +328,13 @@ function submitOutShelf(){
         contentType: "application/json; charset=utf-8",
         data: JSON.stringify(appRequest),
         success: function (appResponse) {
+			console.log(appResponse)
         	isSubmintIng = false;
         	nwaiting.close(); 
         	
         	if(!appResponse.success){
         		playSound('../raw/error.wav');
-        		mui.alert(appResponse.msg, '警告', function() {  setFocus('locationCode');  }); 
+        		mui.alert(appResponse.msg, '警告', function() {  setFocus('barcode');  }); 
     			return;
     		}
         	
@@ -345,11 +349,13 @@ function submitOutShelf(){
         	if(appResponse.extend == '1'){//该库位未下架完成
         		//下一个条码
         		nextBarcode();
+				refreshItems();
         		return;
         	}     
         	if(appResponse.extend == '2'){//该库位已下架完成
         		//下一个库位
-        		nextLocation();
+        		nextBarcode();
+				refreshItems();
         		return;
         	}
     		//整单完成. 下一个出库单
@@ -384,7 +390,7 @@ function cleanAll(){
 	$("#warehouseCode").val("");
 	$("#customerCode").val("");
 	
-	$("#locationCode").val("");
+	// $("#locationCode").val("");
 	$("#barcode").val("");
 	$("#allocationId").val("");
 	$("#batchNo").val("");