Browse Source

提交数据

lvhao 5 months ago
parent
commit
c995ad5fd0
1 changed files with 138 additions and 0 deletions
  1. 138 0
      core/CoreApp/controllers/Transfer.php

+ 138 - 0
core/CoreApp/controllers/Transfer.php

@@ -88,6 +88,9 @@ class Transfer extends Start_Controller {
 		else if($arg == 'scz'){
 			$this->_scz();
 	   }
+	   else if($arg == 'wjsrk'){
+		$this->_wjsrk();
+	   }
 	   else if($arg == 'sczexcel'){
 			$this->_sczexcel();
 	   }
@@ -2450,4 +2453,139 @@ class Transfer extends Start_Controller {
 		header( "Expires: 0" ); 
 		exit($str); 
 	}
+
+	public function _wjsrk(){
+		$post = $this->input->post(NULL, TRUE);
+	    if(isset($post['page']))  
+		{
+
+			$api = $this->input->post('api',true);
+		    $page = $this->input->post('page',true);
+		    $perpage = $this->input->post('perpage',true);
+			
+			$transfer = $this->input->post('transfer',true);
+			$transfer_ids = $this->input->post('transfer_ids',true);
+
+			$orver_flag = $this->input->post('orver_flag',true);
+			
+			$timetk = $this->input->post('timetk',true);
+			$timetj = $this->input->post('timetj',true);
+			$timetk = strtotime($timetk);
+			$timetj = strtotime($timetj);
+
+
+			$transfer_list = $this->transfer->find_all();
+			$t = $transfer_list = array_column($transfer_list, 'title', 'id');
+			$where = 'extra_status = 1  or extra_status = 2';
+			
+            //数据排序
+            $order_str = "id desc";
+            if(empty($page))
+		    {
+                $start = 0;
+		    	$perpage = 1;
+            }
+		    else
+		    {
+                $start = ($page - 1)*$perpage;
+            }
+			
+			if($transfer){
+				$where  .= " and lx = '$transfer'";
+			}else{
+			    $where .= " and lx in (".$transfer_ids.") ";
+			}
+			
+			$where  .= " and time > '$timetk' and time < '$timetj'";
+			
+			$list = $this->systemtransfer_cr->find_all($where,'*',$order_str,$start,$perpage);
+
+			$final_list = [];
+			foreach ($list as $key => $value) {
+			    
+
+				$info = $this->systemtransfer->read($value['fid']);
+				$final_list[$key]['id'] = $value['id'];
+				$final_list[$key]['number'] = isset($info['number'])?$info['number']:'';
+			
+				if($info['is_jiaji'] == 2){
+		            $final_list[$key]['is_jiaji'] = "<a href='javascript:void(0)' style='color:red'>加急</a>";
+		        }else{
+		            $final_list[$key]['is_jiaji'] = "常规";
+		        }
+			
+				$final_list[$key]['pm'] = $info['pm'];
+				$final_list[$key]['shipremarks'] = $info['shipremarks'];
+				$final_list[$key]['printtime'] = date('Y-m-d H:i:s',$info['printtime']);
+
+				$data = $this->systemtransfer_cr->find_all("fid = '".$info['id']."'");
+				
+				$info_list[$key]['time'] = "布标打印 :".date('Y-m-d H:i',$info['ctime12']).'<br>';
+				foreach ($data as $k=>$v)
+		        {
+					$type = ($v['type']==1)?'入库':'出库';
+					
+					
+					if($v['orver_flag'] == 1){
+						if($v['is_over'] == 0){
+							$info_list[$key]['time'] .= "<a href='javascript:void(0);' style='color:#90f'>".$t[$v['lx']].$type.' :'.date('Y-m-d H:i',$v['time']) ." <l style='padding-left:10px;font-weight:900;'> 即将超时 </l></a>";
+							// $info_list[$key]['time'] .= '<i style="padding:10px;color:#90f;font-weight:bold;"> 即将超时</i>'.'<br>';
+						}else{
+							$info_list[$key]['time'] .= "<a href='javascript:void(0);' style='color:#000'>".$t[$v['lx']].$type.' :'.date('Y-m-d H:i',$v['time']) ."</a>";
+						}
+					}elseif($v['orver_flag'] == 2){
+						$info_list[$key]['time'] .= "<a href='javascript:void(0);' style='color:#f33'>".$t[$v['lx']].$type.' :'.date('Y-m-d H:i',$v['time']) ." <l style='padding-left:10px;font-weight:900'> 超 时 ! </l></a>";
+					}else{
+						$info_list[$key]['time'] .= "<a  href='javascript:void(0);' style='color:#000'>".$t[$v['lx']].$type.' :'.date('Y-m-d H:i',$v['time']) ."</a>";
+					}
+					$info_list[$key]['time'] .= "<a href='javascript:void(0);' style='color:#90f'>【下道工序未及时入库】</a><br>";
+				}
+				
+				$final_list[$key]['time'] = trim($info_list[$key]['time'],'<br>');
+			}
+
+			
+			$total = $this->systemtransfer_cr->find_count($where);
+		   
+		    $pagenum = ceil($total/$perpage);
+		    $over = $total-($start+$perpage);
+		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($final_list));
+		    echo json_encode($rows);exit;
+		}
+		if(isset($_SESSION['api']))
+		{
+			$user = $this->user->get_api($_SESSION['api']);
+			$usp = $user;
+		    $pid = "";$tid="";$sid="";$wid="";
+		    $purchase = explode('|',trim($user['purchase'],'|'));
+			$transfer = explode('|',trim($user['transfer'],'|'));
+			$warehouse = explode('|',trim($user['warehouse'],'|'));
+			foreach ($purchase as $value) 
+		    {
+				$pid .= " id = ".$value." or";
+			}
+			foreach ($transfer as $value) 
+		    {
+				$tid .= " id = ".$value." or";
+			}
+			foreach ($warehouse as $value) 
+		    {
+				$wid .= " id = ".$value." or";
+			}
+		}
+		else
+		{
+			header('Location: /');exit;
+		}
+		$kx = '';$zjtab = '';
+		
+		$transfer = $this->transfer->find_all('1=1 and '.rtrim($tid,'or'));
+		
+		$this->data['transfer'] = $transfer;
+		$transfer_ids = array_column($transfer, 'id');
+		$this->data['transfer_ids'] =implode(",",$transfer_ids) ;
+		$this->data['vip'] = $user['vip'];
+		$this->data['orver_flag'] = $this->input->get('orver_flag', TRUE);
+		$this->_Template('transfer_wjrsk',$this->data);
+	}
 }