Pārlūkot izejas kodu

添加退库记录的信息

lvhao 4 stundas atpakaļ
vecāks
revīzija
4e66922402

+ 514 - 0
core/CoreApp/controllers/Outerrors.php

@@ -0,0 +1,514 @@
+<?php defined('BASEPATH') OR exit('No direct script access allowed');
+header("Access-Control-Allow-Origin: *");
+class Outerrors extends  Start_Controller{
+	public function __construct(){
+		parent::__construct();
+		$this->load->library('session');
+        $this->load->_model('Model_outerrors','outerrors');
+        $this->load->_model("Model_logic_order","logic_order");
+        $this->load->_model("Model_check",'check');
+        $this->load->_model("Model_express","express");
+		$this->load->_model("Model_warehouse","warehouse");
+        $this->load->_model('Model_whlabel','whlabel');
+        $this->load->_model("Model_logic_express","logic_express");
+        $this->load->_model("Model_ck",'ck');
+        $this->load->_model("Model_shop","shop");
+		$this->load->_model('Model_specialstock','specialstock');
+        $this->load->_model('Model_fullorder','fullorder');
+		$this->load->_model('Model_fullordersmt','fullordersmt');
+		$this->load->_model('Model_fullordertt','fullordertt');
+		$this->load->_model('Model_fullorderamz','fullorderamz');
+        $this->load->_model('Model_dhl','dhl');
+		$this->load->_model('Model_dhlhz','dhlhz');
+        $this->load->_model('Model_typeclass','typeclass');
+	}
+	//定义方法的调用规则 获取URI第二段值
+    public function _remap($arg,$arg_array)
+    {
+		if($arg == 'scan')//出库页
+        {
+            $this->_scan();
+        }
+        else if($arg == 'operate')//出库列表页
+        {
+            $this->_operate();
+        }
+        else if($arg == 'excel'){
+            $this->_excel();
+        }
+		else
+		{
+			 $this->_index();
+		}
+    }
+
+	private function _index()
+	{
+        if($this->input->method() === 'post'){
+            $page = $this->input->post('page',true);
+		    $perpage = $this->input->post('perpage',true);
+			$number = $this->input->post('number',true);
+			$timetk = $this->input->post('timetk',true);
+			$timetj = $this->input->post('timetj',true);
+			$timetk = strtotime($timetk);
+			$timetj = strtotime($timetj);
+            $where = "";
+            if($number){
+                $where .= " number = '$number' ";
+            }
+            if(empty($where)){
+                $where  = "  scan_time > '$timetk' and scan_time  < '$timetj'  ";
+            }else{
+                $where  .= " and scan_time > '$timetk' and scan_time  < '$timetj'  ";
+            }
+            //数据排序
+            $order_str = " id desc";
+            if(empty($page))
+		    {
+                $start = 0;
+		    	$perpage = 1;
+            }
+		    else
+		    {
+                $start = ($page - 1)*$perpage;
+            }
+            $list = $this->outerrors->find_all($where,"*",$order_str,$start,$perpage);
+            $info_list = [];
+            foreach($list as $k => $v){
+                $str = "";
+                if(empty($v['dy_status'])){
+                    $str .= "<p ><b style='font-size:18px !important' data-id='".$v['id']."' data-type='1' onclick='dycz(this)'>店员操作</b></p>";
+                }
+                if(!empty($v['dy_status']) && empty($v['ck_status'])){
+                    $str .= "<p><b  style='font-size:18px  !important;background-color: #FFC125;color: #000;' data-id='".$v['id']."' data-type='2' onclick='dycz(this)'>仓库操作</b></p>";
+                }
+                $info_list[] = [
+                   'id' => $v['id'],
+                   'scan_time' => date('Y-m-d H:i:s',$v['scan_time']),
+                   'number' => $v['number'],
+                   'dy_status'=>empty($v['dy_status'])?'':$v['dy_operate'],
+                   'ck_status' => empty($v['ck_status'])?'':$v['ck_operate'],
+                   'remark'=>empty($v['remark'])?'':$v['remark'],
+                   'opreate'=>$str
+                ];
+            }
+            
+            $total = $this->outerrors->find_count($where);
+		    $pagenum = ceil($total/$perpage);
+		    $over = $total-($start+$perpage);
+		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
+		    echo json_encode($rows);exit;
+        }
+    
+        $this->_Template('outerrors',$this->data);
+    }
+
+    private function _operate(){
+        if($this->input->method() === 'post'){
+            $id = $this->input->post('id',true);
+            $type = $this->input->post('operate_type',true);
+            $remark = $this->input->post('operate_remark',true);
+            if($type == 1){
+                $arr = [
+                    'dy_status'=>1,
+                    'dy_operate'=>$remark,
+                    'dy_time'=>time(),
+                ];
+            }else if($type == 2){
+                $arr = [
+                    'ck_status'=>1,
+                    'ck_operate'=>$remark,
+                    'ck_time'=>time(),
+                ];
+            }else{
+                echo json_encode(['code'=>-1,'msg'=>'执行类型异常']);exit;
+            }
+
+            if($this->outerrors->save($arr,$id)){
+                echo json_encode(['code'=>1,'msg'=>'操作成功']);exit;
+            }else{
+                echo json_encode(['code'=>-1,'msg'=>'操作失败']);exit;
+            }
+        }
+        echo json_encode(['code'=>-1,'msg'=>'参数异常']);exit;
+    }
+
+    //excel 下载
+    private function _excel(){
+        if($this->input->method() === 'get'){
+            $excel = $this->input->get('excel',true);
+            if($excel == 2){
+                $number = $this->input->get('number',true);
+                $timetk = $this->input->get('timetk',true);
+                $timetj = $this->input->get('timetj',true);
+                $timetk = strtotime($timetk);
+                $timetj = strtotime($timetj);
+                $where = "";
+                if($number){
+                    $where .= " number = '$number' ";
+                }
+                if(empty($where)){
+                    $where  = "  scan_time > '$timetk' and scan_time  < '$timetj'  ";
+                }else{
+                    $where  .= " and scan_time > '$timetk' and scan_time  < '$timetj'  ";
+                }
+               
+                $list = $this->outerrors->find_all($where,"*");
+                $info_list = [];
+                foreach($list as $k => $v){
+                   
+                    $info_list[] = [
+                       'id' => $v['id'],
+                       'number' => $v['number'],
+                       'dy_operate'=>$v['dy_operate'],
+                       'ck_operate' => $v['ck_operate'],
+                       'remark'=>empty($v['remark'])?'':$v['remark'],
+                       'scan_time' => date('Y-m-d H:i:s',$v['scan_time']),
+                       'dy_time'=>empty($v['dy_time'])?'':date('Y-m-d H:i:s',$v['dy_time']),
+                       'ck_time'=>empty($v['ck_time'])?'':date('Y-m-d H:i:s',$v['ck_time']),
+                    ];
+                }
+                $filename = date("Y-m-d")."扫不出库记录.xls";
+                $str = "<html xmlns:x=\"urn:schemas-microsoft-com:office:excel\">
+                <head>
+                <!--[if gte mso 9]><xml>
+                <x:ExcelWorkbook>
+                <x:ExcelWorksheets>
+                <x:ExcelWorksheet>
+                <x:Name>EXCEL</x:Name>
+                <x:WorksheetOptions>
+                <x:Print>
+                <x:ValidPrinterInfo />
+                </x:Print>
+                </x:WorksheetOptions>
+                </x:ExcelWorksheet>
+                </x:ExcelWorksheets>
+                </x:ExcelWorkbook>
+                </xml>
+                <![endif]-->
+                </head><body>";
+                $str .= "<table border=1 style='font-family: Microsoft Yahei;font-size: 13px;'>"; 
+                $str .= "<tr><td>订单编码</td><td>店员操作</td><td>仓库操作</td><td>不能出库原因</td><td>扫描时间</td><td>店员操作时间</td><td>仓库操作时间</td></tr>";
+                foreach ($info_list as $key=>$value) 
+                { 
+                    
+                    $str .= "<tr>";
+                    $str .= "<td>". $value['number']. "</td>";
+                    $str .= "<td>". $value['dy_operate']. "</td>";
+                    $str .= "<td>". $value['ck_operate']. "</td>";
+                    $str .= "<td>". $value['remark']. "</td>";
+                    $str .= "<td>". $value['scan_time']. "</td>";
+                    $str .= "<td>". $value['dy_time']. "</td>";
+                    $str .= "<td>". $value['ck_time']. "</td>";
+                    $str .= "</tr>";
+                }
+                $str .= "</table></body></html>"; 
+                header( "Content-Type: application/vnd.ms-excel; name='excel'" ); 
+                header( "Content-type: application/octet-stream" ); 
+                header( "Content-Disposition: attachment; filename=".$filename ); 
+                header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" ); 
+                header( "Pragma: no-cache" ); 
+                header( "Expires: 0" ); 
+                exit($str); 
+                
+                
+            }
+        }
+    }
+
+    //扫描未出库的单子
+    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;
+            }
+
+            $info = $this->logic_order->getInfo("waybill = '$waybill'");
+            $outtype = 1;
+            if(empty($info)){
+                $info = $this->logic_order->getInfo("oldwaybill like '%/".$waybill."%'");
+            }
+            if(empty($info)){
+                $outtype = 2;
+                $info = $this->logic_order->getInfo("number = '$waybill'");
+            }
+            if(empty($info)){
+                echo json_encode(['code'=>-1,'msg'=>'未发现和 '.$waybill.' 关联的订单信息']);exit;
+            }
+
+            $r = $this->_outerrorinfo($info,$weight,$outtype);
+
+            if($r['success']){
+                echo json_encode(['code'=>-1,'msg'=>$r['msg']]);exit;
+            }
+
+            $arr = [
+                'number'=>$info['number'],
+                'waybill'=>$waybill,//扫描单号
+                'plat'=>$info['lv_platform'],
+                'shop'=>$info['shop'],
+                'remark'=>$r['msg'],
+                'scan_time'=>time(),
+            ];
+            if($this->outerrors->insert($arr)){
+                echo json_encode(['code'=>1,'msg'=>'扫描成功']);exit;
+            }else{
+                echo json_encode(['code'=>-1,'msg'=>'操作失败']);exit;
+            }
+        }
+        $this->_Template('outerrors_scan',$this->data);
+    }
+
+    //出库错误的原因返回
+    private function _outerrorinfo($info,$weight,$outtype){
+			$time = time();
+			if(!isset($weight))//测试没问题后可以删
+			{
+				$weight = '';
+			}
+			
+            $y = $info;
+            $fullorder_name = $y['lv_platform'];
+
+
+			if($y['mergeid'] == '1')
+			{
+				$y = $this->$fullorder_name->read($y['merge']);
+			}
+
+			// 66  云途(欧洲)  67  云途(欧洲)-带保险    如果是欧洲云途 需要检擦出库时间是否超过15天
+			if(in_array($y['express'],[66,67,82])){
+				if((time() - $y['printtime']) >= (14*24*3600)){
+                    return array('msg'=>'运单超时!请联系梦体处理!','success'=>false);
+					//echo json_encode(array('msg'=>'运单超时!请联系梦体处理!','success'=>false));exit;
+				}
+			}
+
+			// 78 dpd英国 和 79dpd欧盟
+			if(in_array($y['express'],[78,79,84])){
+				$r = $this->check->checkOverdue($y['name'],$y['number'],$y['address']);
+				if(!$r){
+                    return array('msg'=>'同一个客户3天内发货超过2包,不可出库!请联系店员做申报信息修改!'.$y['name']."-".$y['number']."-".$r*1,'success'=>false);
+					//echo json_encode(array('msg'=>'同一个客户3天内发货超过2包,不可出库!请联系店员做申报信息修改!'.$y['name']."-".$y['number']."-".$r*1,'success'=>false));exit;
+				}
+			}
+			
+			$express = $this->express->read($y['express']);
+			if($y['state'] == 216 && $fullorder_name == 'fullordersmt')
+			{
+				$y['librarynot'] = '客户已取消!';
+			}
+			if($y['print'] != 3 || $y['libraryconfirm'] == 1 || $y['state'] == 214 || $y['state'] == 217 || $y['state'] == 283 || $y['state'] == 206 || $y['state'] == 205 || $y['state'] == 204 || $y['state'] == 210 || $y['state'] == 211 || $y['state'] == 212 || ($y['state'] == 216 && $fullorder_name == 'fullordersmt'))//独立站216先关了
+			{
+                return array('msg'=>'禁止出库!'.$y['librarynot'],'success'=>false);
+				//echo json_encode(array('msg'=>'禁止出库!'.$y['librarynot'],'success'=>false));exit;
+			}
+			if($y['library'] > 1)
+			{
+                return array('msg'=>'此数据 '.date('Y-m-d H:i:s',$y['librarytime']).' 已操作出库','success'=>false);
+				// echo json_encode(array('msg'=>'此数据 '.date('Y-m-d H:i:s',$y['librarytime']).' 已操作','success'=>false));exit;
+			}
+			if($express['out'] != 3)
+			{
+				if($express['out'] != $outtype)
+				{
+					$smlx = ($express['out']=='1')?'运单':'发货单';
+                    return array('msg'=>'扫描类型错误!此单需要扫描'.$smlx,'success'=>false);
+					//echo json_encode(array('msg'=>'扫描类型错误!此单需要扫描'.$smlx,'success'=>false));exit;
+				}
+			}
+			if($y['type'] != 7 && $y['waybill'] != '' && $y['printtype'] == '1')
+			{
+				$r = $this->logic_express->ydCheckById($y['waybill'],$y['express']);
+				if(!$r){
+                    return array('msg'=>'出库物流和系统不匹配,请联系梦体解决'.$y['express'],'success'=>false);
+					//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)//杭州店铺除外
+			{
+				//echo json_encode(array('yd'=>1,'id'=>$y['id'],'express'=>$y['express'],'name'=>$fullorder_name,'success'=>true));exit;
+			}
+			if((time() - $y['printtime']) > (6*24*3600) && $y['express'] == '3' && $y['type'] != 6)//杭州店铺除外
+			{
+				//echo json_encode(array('yd'=>1,'id'=>$y['id'],'express'=>$y['express'],'name'=>$fullorder_name,'success'=>true));exit;
+                return array('msg'=>'此运单过期无法出库,请联系成会处理!','success'=>false);
+			}
+			if((time() - $y['printtime']) > (7*24*3600) && $y['express'] == '37' && $y['type'] != 6)//杭州店铺除外
+			{
+				//echo json_encode(array('yd'=>1,'id'=>$y['id'],'express'=>$y['express'],'name'=>$fullorder_name,'success'=>true));exit;
+			}
+			
+			$this->db->trans_begin();
+			$warehouse = $this->warehouse->read($y['type']);
+			$bdck = $warehouse['bdck'];
+			if($warehouse['zd'] == '1')
+			{
+				if($warehouse['bdck'] == '')
+				{
+					$this->db->trans_rollback();
+                    return array('msg'=>'仓库设置错误!','success'=>false);
+				}
+				$wh = $this->_fout_db($y,$warehouse,$bdck);
+				if($wh['fh'] == 2)
+				{
+					$kcyz = $this->ck->get_kc($y['state'],$warehouse,$y['shop'],$y['number'],$y['whlabel'],$y['fpdata']);	
+					if($kcyz['t'] == '0')
+			    	{
+						if($kcyz['fpdata'] != '')
+						{
+				    	$x['whlabel'] = $kcyz['whlabel'];
+				    	$x['fpdata'] = $kcyz['fpdata'];
+						$y['whlabel'] = $x['whlabel'];
+						$this->$fullorder_name->save($x,$y['id']);
+						}
+			   		}
+					$wh = $this->_fout_db($y,$warehouse,$bdck);
+					if($wh['fh'] == 2)
+					{
+						$this->db->trans_rollback();
+                        return array('msg'=>'库存占用量与实际出库量不符!','success'=>false);
+					}
+				}
+				foreach ($wh['sj'] as $v)
+		        {
+					$this->$bdck->save(array('state'=>1,'cktype'=>1,'orderinfo'=>$y['orderinfo'],'waybill'=>$y['waybill'],'outk'=>$time,'time'=>$time),$v['id']);
+				}
+				
+			}
+			
+			$shop = $this->shop->read($y['shop']);
+			if($express['printcode'] == "DHLUSA" && $y['waybill'] != '')
+			{
+				$type = $this->typeclass->read($shop['type']);
+				$y['shoptype'] = $type['title'];
+				$y['weight'] = $weight;
+				$d = $this->dhl->get_data_9610($y);
+				if($d != 1)
+				{
+					$this->db->trans_rollback();
+                    return array('msg'=>'9610失败,'.$d,'success'=>false);
+				}
+			}
+			if($fullorder_name == 'fullordersmt')
+			{
+				$stt = ($y['waybill']!='')?209:$y['state'];
+				$post = array('library'=>2,'state'=>$stt,'librarytime'=>$time,'weight'=>$weight,'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);
+			}
+			else
+			{
+				$post = array('library'=>2,'librarytime'=>$time,'weight'=>$weight,'dbapi'=>0);
+			}
+			
+			if($outtype == 2 && $y['printnumber'] > 1)
+			{
+				$p = json_encode($post);
+				$this->db->trans_rollback();
+                return array('msg'=>'该单共打印过'.$y['printnumber'].'次,请注意核对当前发货单是否是最新发货单!','outnumber'=>$y['id'],'post'=>$p,'fullorder_name'=>$fullorder_name,'success'=>false);
+			}
+
+            $this->db->trans_rollback();
+            return array('msg'=>'此单允许出库 !!!','success'=>true);
+			//$this->$fullorder_name->save($post,$y['id']);
+    }
+
+    private function _fout_db($y,$warehouse,$bdck)//对比占单是否正确
+	{
+	
+		$wh = $this->$bdck->find_all("zd = '".$y['number']."' and warehouse = '".$y['type']."' and (state = '0' or state = '9')");
+		$cpsl = 0;
+		$pp = explode('|',trim($y['whlabel'],'|'));
+		foreach ($pp as $va)
+		{
+			$num = explode('-',$va);
+			if(isset($num[2]))
+			{
+			    if(stripos($num[2],$warehouse['hz']) !== false)
+			    {
+				    $cpsl += $num[1];
+			    }
+			}
+		}
+		if(count($wh) == $cpsl)
+		{
+		    return array('fh'=>1,'sj'=>$wh);
+		}
+		else
+		{
+			return array('fh'=>2);
+		}
+	}
+}

+ 11 - 0
core/CoreApp/models/Model_outerrors.php

@@ -0,0 +1,11 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
+class Model_outerrors extends Lin_Model 
+{
+	function __construct(){
+        parent::__construct();
+        $this->load->database();
+        $this->table = 'outerrors';
+        $this->load_table('outerrors');
+    }
+    
+}  

+ 175 - 0
template/erp/outerrors.html

@@ -0,0 +1,175 @@
+{Template header}
+
+<style>
+    .btn {
+        display: inline-block;
+        padding: 6px 12px;
+        margin-bottom: 0;
+        font-size: 14px;
+        font-weight: 400;
+        line-height: 1.42857143;
+        text-align: center;
+        white-space: nowrap;
+        vertical-align: middle;
+        -ms-touch-action: manipulation;
+        touch-action: manipulation;
+        cursor: pointer;
+        -webkit-user-select: none;
+        -moz-user-select: none;
+        -ms-user-select: none;
+        user-select: none;
+        background-image: none;
+        border: 1px solid transparent;
+        border-radius: 4px;
+    }
+    .btn-success {
+        color: #fff !important;
+        background-color: #5cb85c !important;
+        border-color: #4cae4c;
+    }
+    .btn-info {
+        color: #fff;
+        background-color: #5bc0de;
+        border-color: #46b8da;
+    }
+    .btn-xs {
+        padding: 1px 5px;
+        font-size: 12px;
+        line-height: 1.5;
+        border-radius: 3px;
+    }
+</style>
+<body>
+<div class="warp">
+<div class="fixed">
+<div class="numberprint">
+<ul class="searchtop" style="text-align: center;padding: 10px 0;" style="font-size: 18px;">
+    <ul class="searchtop" style="text-align: center;padding: 10px 0;">
+        <li><a href="/outerrors/scan/" style="height: 56px;line-height: 56px;padding: 0 88px;font-size: 26px;color: #fff;background-color: #2084db;float: left;margin-right: 50px;border-radius: 5px;display: block;cursor: pointer;">扫描禁止出库单</a></li>
+      
+
+</div>
+<ul class="search">
+<li>订单编号:<input value="" name="number" type="text"></li>
+<li>扫描时间:<input id="timetk"  value="{date('Y-m-d',time()-14*24*3600)} 0:00" name="timetk" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})">
+至&nbsp;&nbsp;&nbsp;&nbsp; <input id="timetj" value="{date('Y-m-d',time()+24*3600)} 0:00" name="timetj" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"></li>
+<li><span>确 定</span></li>
+
+
+<li>
+    <font class="cona lv_cpkxz">EXCEL下载</font>
+</li>
+
+
+</ul>
+<table class="datatitle data" border="0" style="border-collapse:collapse;">
+<tr>
+<td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
+<td>日期</td>
+<td>编号</td>
+<td>店员处理</td>
+<td>仓库处理</td>
+<td>情况备注</td>
+<td>操作</td>
+</tr>
+</table>
+</div>
+<table class="datatext data" border="0" style="border-collapse:collapse;">
+</table>
+<div class="bomf"></div>
+</div>
+<div class="print none"></div>
+<div class="ts"><p class="tsn"></p></div>
+<div class="systemwindow">
+<div>
+<p></p>
+<p><font class="button">确 定</font><font class="esc">取 消</font></p>
+</div>
+</div>
+<div class="boundtj">
+<div>
+<p></p>
+<p></p>
+</div>
+</div>
+<div class="tyrows"><div><p></p><p></p></div></div>
+<audio id="music_d">
+<source src="{$theme}music/d.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_c">
+<source src="{$theme}music/c.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print">
+<source src="{$theme}music/print.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print_error">
+<source src="{$theme}music/print_error.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print_ok">
+<source src="{$theme}music/print_ok.mp3" type="audio/mpeg">
+</audio>
+<script>
+var sysprint = 1;var transfer = 1;
+var dataurl = "/outerrors/";
+var customon = 1;
+
+
+function dycz(that){
+    $(".boundtj div p:eq(0)").html('<textarea name="operate_remark" rows="6" cols="50" style="border:1px solid #ccc;border-radius:5px;" placeholder="请输入处理意见"></textarea> <input type="hidden" name="operate_type" value="'+$(that).data('type')+'" /><input type="hidden" name="id" value="'+$(that).data('id')+'" />');
+    $(".boundtj div p:eq(1)").html("<font class='obaddgo'>确 定</font><font class='esc'>取 消</font>");
+    $(".boundtj").show();
+
+}
+$(".boundtj").on('click', ".obaddgo", function() {
+    let obj = {
+        id:$(".boundtj input[name='id']").val(),
+        operate_type:$(".boundtj input[name='operate_type']").val(),
+        operate_remark:$(".boundtj textarea[name='operate_remark']").val()
+    };
+    $.ajax({
+        url: dataurl+"operate/",
+        data: obj,
+        type: "POST",
+        dataType: "json",
+        success: function(c) {
+            console.log(c);
+            if (c && c.code) {
+                searchspan(1);
+                $(".boundtj p").html("");
+                $(".boundtj").hide();
+                
+            } else {
+                $(".ts p").html(c.msg);
+                $(".ts").show();
+                setTimeout('$(".ts").fadeOut()', 1000);
+            }
+        }
+    });
+});
+
+$(".boundtj").on('click', ".esc", function() {
+    $(".boundtj p").html("");
+    $(".boundtj").hide();
+});
+
+$(".lv_cpkxz").on('click', function() {
+  let f = "";
+  let number = $("input[name='number']").val();
+  let timetk = $("input[name='timetk']").val();
+  let timetj = $("input[name='timetj']").val();
+  if(number){
+    f += "number="+number+"&";
+  }
+  if(timetk){
+    f += "timetk="+timetk+"&";
+  }
+  if(timetj){
+    f += "timetj="+timetj+"&";
+  }
+  f += "excel=2" 
+  window.location.href = dataurl+"excel/?"+f;
+});
+
+</script>
+<script type="text/javascript" src="{$theme}js/laydate.js"></script>
+{Template footer}

+ 116 - 0
template/erp/outerrors_scan.html

@@ -0,0 +1,116 @@
+{Template header}
+<body>
+<div class="warp">
+<div class="fixed">
+<div class="numberprint">
+
+<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>
+</div>
+</div>
+</div>
+<div class="print none"></div>
+<div class="ts"><p class="tsn"></p></div>
+<div class="systemwindow">
+<div>
+<p style="font-size: 50px;color: #F00;line-height: 50px;"></p>
+<p><font class="button">确 定</font><font class="esc">取 消</font></p>
+</div>
+</div>
+<div class="boundtj">
+<div>
+<p></p>
+<p><font class="button">确 定</font><font class="esc">取 消</font></p>
+</div>
+</div>
+<div class="tyrows"><div><p></p><p></p></div></div>
+<audio id="music_d">
+<source src="{$theme}music/d.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_c">
+<source src="{$theme}music/c.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print">
+<source src="{$theme}music/print.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print_error">
+<source src="{$theme}music/print_error.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print_ok">
+<source src="{$theme}music/print_ok.mp3" type="audio/mpeg">
+</audio>
+<script>
+var sysprint = 1;var transfer = 1;
+var dataurl = "/outerrors/scan/";
+
+$(document).ready(function() {
+    $("#transferout").focus();
+});
+
+
+$(document).keyup(function(event) {
+    if (event.keyCode == 13) {
+		// $("#music_d")[0].play();
+        // $(".systemwindow div p:eq(0)").html($("input[name='transferout']").val());
+        // $(".systemwindow div p:eq(1)").html("可以不用点 '关闭' 连续扫码<br><font class='asd'>关 闭</font>");
+        // $(".systemwindow").show();
+        // $("#transferout").val("");
+        // $("#transferout").focus();
+        let  waybill = $("input[name='transferout']").val()
+        let  weight = $("#weight").val()
+        tjdata(waybill,weight)
+	}
+})
+function tjdata(waybill,weight){
+    layx.load('loadId','请求中');
+    $.post(dataurl, {waybill: waybill,weight:weight}, function(data) {
+        layx.destroy('loadId');
+        if(data.code == -1){
+            dqerr_show(data.msg)
+        }else{
+            $("#music_d")[0].play();
+            $("#transferout").val("");
+            $("#transferout").focus();
+        }
+    },'json')
+}
+
+function dqerr_show(msg){
+    $("#music_c")[0].play();
+    $(".systemwindow div p:eq(0)").html(msg);
+    $(".systemwindow div p:eq(1)").html("可以不用点 '关闭' 连续扫码<br><font class='asd'>关 闭</font>");
+    $(".systemwindow").show();
+    $("#transferout").val("");
+    $("#transferout").focus();
+}
+$(".systemwindow").on('click',".asd",function() {
+$(".systemwindow").hide();
+        $("#transferout").val("");
+        $("#transferout").focus();
+});
+</script>
+<script type="text/javascript" src="{$theme}js/laydate.js"></script>
+{Template footer}