lvhao 3 часов назад
Родитель
Сommit
884fbc0f8d
2 измененных файлов с 10 добавлено и 103 удалено
  1. 7 80
      core/CoreApp/controllers/Outerrors.php
  2. 3 23
      template/erp/outerrors_scan.html

+ 7 - 80
core/CoreApp/controllers/Outerrors.php

@@ -243,17 +243,10 @@ class Outerrors extends  Start_Controller{
     private function _scan(){
         if($this->input->method() === 'post'){
             $waybill = $this->input->post('waybill',true);
-            $weight = $this->input->post('weight',true);
             if(empty($waybill)){
                 echo json_encode(['code'=>-1,'msg'=>'快递单号不能为空']);exit;
             }
-            if(empty($weight)){
-                echo json_encode(['code'=>-1,'msg'=>'重量不能为空']);exit;
-            }
             $waybill = trim($waybill);
-            $weight = trim($weight);
-
-            
             if(substr($waybill,0,3) == '788' && substr($waybill,-4,4) == '0430')//Fedex联邦
 			{
 				$waybill = substr($waybill,0,12);
@@ -280,7 +273,6 @@ class Outerrors extends  Start_Controller{
 
             $this->logic_ding->sendToDing("扫描未出库单子的数据".json_encode([
                 'waybill' => $waybill,
-                'weight' => $weight,
             ],JSON_UNESCAPED_UNICODE));
             $info = $this->logic_order->getInfo("waybill = '$waybill'");
             $outtype = 1;
@@ -317,7 +309,7 @@ class Outerrors extends  Start_Controller{
                 echo json_encode(['code'=>-1,'msg'=>''.$waybill.' 的相关信息已录入,记录单号为:'.$r_info['number']]);exit;
             }
 
-            $r = $this->_outerrorinfo($info,$weight,$outtype);
+            $r = $this->_outerrorinfo($info,$outtype);
 
             if($r['success']){
                 echo json_encode(['code'=>-1,'msg'=>$r['msg']]);exit;
@@ -341,13 +333,8 @@ class Outerrors extends  Start_Controller{
     }
 
     //出库错误的原因返回
-    private function _outerrorinfo($info,$weight,$outtype){
+    private function _outerrorinfo($info,$outtype){
 			$time = time();
-			if(!isset($weight))//测试没问题后可以删
-			{
-				$weight = '';
-			}
-			
             $y = $info;
             $fullorder_name = $y['lv_platform'];
 
@@ -406,71 +393,12 @@ class Outerrors extends  Start_Controller{
 					//echo json_encode(array('msg'=>'出库物流和系统不匹配,请联系梦体解决'.$y['express'],'success'=>false));exit;
 				}
 			}
-			if(stripos($weight,',') !== false){
-               $tmp_arr = explode(",",$weight);
-                $weight = end($tmp_arr);
-                
-                $numweight = (float)$weight;
-                $weight = $numweight."kg";
-            }
-			$numweight = str_replace('kg','',$weight);
-            
-            //根据要求 USPS-USA  2  FEDEX-US2 63 USPS-US2 64  这三个快递方式除外的所有快递都需要称重再发货  或者说是【国内发货】的都需要称重
-            //还有翔文仓库的 不执行
-            //源代码是 
-          	//所有快递必须称重		
-        	//所有快递必须称重	翔文除外
-            
-        	
-        	//$this->logic_ding->sendToDing("检测订单".$y['number']."称重".$numweight."快递公司".$y['express']."-".$weight."[".$numweight."]");
-			if(!in_array($y['express'],[2,8,39,43,44,45,47,48,49,55,61,63,64,65,74,81,83,85])){
-				if($weight == '' || $numweight < '0.1' || !is_numeric($numweight))
-				{
-                    return array('msg'=>'此单需要称重!','success'=>false);
-					//echo json_encode(array('msg'=>'此单需要称重!','success'=>false));exit;
-				}
-				$yzweight = explode('.',$numweight);
-				if($yzweight[0] == '')
-				{
-                    return array('msg'=>'重量错误,请重新称重!','success'=>false);
-					//echo json_encode(array('msg'=>'重量错误,请重新称重!','success'=>false));exit;
-				}
-				if(empty($numweight)){
-                    return array('msg'=>'此单需要称重2!','success'=>false);
-				    //echo json_encode(array('msg'=>'此单需要称重2!','success'=>false));exit;
-				}
-				
-			}	
-			
+
+		
 			$express_info = $this->express->read($y['express']);
 			if(empty($express_info)){
                 return array('msg'=>'快递信息异常,请联系技术!','success'=>false);
 			}
-    		$weight_limit = $express_info['weight_limit']*1;
-	        if($weight_limit  > 0   && $y['type'] != 5){
-                
-    				$yzweight = explode('.',$numweight);
-    				if($yzweight[0] == '')
-    				{
-                        return array('msg'=>'重量错误,请重新称重!','success'=>false);
-    				}
-                    if($numweight < ($y['jweight']/1000)){
-                        return array('msg'=>'重量小于净重,请重新称重!','success'=>false);
-        			}
-    				//Fedex(杭州),UPS,DHL官方-美国 需要判断实际重量和净重差 其他快递不需要
-    				if(in_array($y['express'],[3,24,42])){
-    				   	//规定实际重量不允许超过 净重为1kg
-        				if($numweight -($y['jweight']/1000) > 1 )
-        				{
-                            return array('msg'=>'称重重量和净重相差过大,请找成会处理!','success'=>false);
-        				}
-    				}
-    			
-    				if($weight_limit < $numweight){
-                        return array('msg'=>$express['servicename'].'大于'.$weight_limit.'公斤需要拆包!','success'=>false);
-    				}
-            }
-			
 			
 			if(((time() - $y['printtime']) > (15*24*3600) || $y['printtime'] < 1590211800) && $y['express'] == '24' && $y['type'] != 6)//杭州店铺除外
 			{
@@ -529,7 +457,6 @@ class Outerrors extends  Start_Controller{
 			{
 				$type = $this->typeclass->read($shop['type']);
 				$y['shoptype'] = $type['title'];
-				$y['weight'] = $weight;
 				$d = $this->dhl->get_data_9610($y);
 				if($d != 1)
 				{
@@ -540,16 +467,16 @@ class Outerrors extends  Start_Controller{
 			if($fullorder_name == 'fullordersmt')
 			{
 				$stt = ($y['waybill']!='')?209:$y['state'];
-				$post = array('library'=>2,'state'=>$stt,'librarytime'=>$time,'weight'=>$weight,'dbapi'=>0);
+				$post = array('library'=>2,'state'=>$stt,'librarytime'=>$time,'dbapi'=>0);
 			}
 			else if(($fullorder_name == 'fullordertt' || $fullorder_name == 'fullorderxw' || $fullorder_name == 'fullorder' || $fullorder_name = 'fullorderamz') && $y['source'] == 1)
 			{
 
-				$post = array('library'=>2,'state'=>216,'librarytime'=>$time,'weight'=>$weight,'dbapi'=>0);
+				$post = array('library'=>2,'state'=>216,'librarytime'=>$time,'dbapi'=>0);
 			}
 			else
 			{
-				$post = array('library'=>2,'librarytime'=>$time,'weight'=>$weight,'dbapi'=>0);
+				$post = array('library'=>2,'librarytime'=>$time,'dbapi'=>0);
 			}
 			
 			if($outtype == 2 && $y['printnumber'] > 1)

+ 3 - 23
template/erp/outerrors_scan.html

@@ -6,26 +6,7 @@
 
 <ul class="searchtop search" style="text-align: center;padding: 10px 0;margin-top:80px;">
    <li style="width: 100%; text-align: center;color:#F00;font-size: 20px;line-height: 30px;font-weight: bold;">不能出库订单扫描 </li> 
-   <li style="font-size: 18px;font-weight: bold;">
-        称重端口:<select name="com" class="select" >
-        <option value="COM3">COM3</option>
-        <option value="COM4">COM4</option>
-        <option value="COM1">COM1</option>
-        <option value="COM2">COM2</option>
-        <option value="COM5">COM5</option>
-        <option value="COM6">COM6</option>
-        <option value="COM7">COM7</option>
-        <option value="COM8">COM8</option>
-        <option value="COM9">COM9</option>
-        <option value="COM10">COM10</option>
-        <option value="COM11">COM11</option>
-        </select>
-    </li>
    
-    <li  style="font-size: 18px;font-weight: bold;">
-        电子秤称重:<input name="weight" id="weight" type="text" value="" readonly>
-    </li>
-   <br/>
     <li style="height: 56px;line-height: 56px;"><input value="" name="transferout" id="transferout" placeholder="点此处扫码" type="text" style="width:650px;height: 50px;line-height: 50px;"></li>
     
 </ul>
@@ -80,13 +61,12 @@ $(document).keyup(function(event) {
         // $("#transferout").val("");
         // $("#transferout").focus();
         let  waybill = $("input[name='transferout']").val()
-        let  weight = $("#weight").val()
-        tjdata(waybill,weight)
+        tjdata(waybill)
 	}
 })
-function tjdata(waybill,weight){
+function tjdata(waybill){
     layx.load('loadId','请求中');
-    $.post(dataurl, {waybill: waybill,weight:weight}, function(data) {
+    $.post(dataurl, {waybill: waybill}, function(data) {
         layx.destroy('loadId');
         if(data.code == -1){
             dqerr_show(data.msg)