lvhao há 23 horas atrás
pai
commit
b505ddf8d2

+ 113 - 0
core/CoreApp/controllers/Whlabel_bh.php

@@ -116,6 +116,9 @@ class Whlabel_bh extends Start_Controller {
 		else if($arg == 'transfer_detail'){
 			$this->_transfer_detail($arg_array);
 		}
+		else if($arg == 'cj_transfer_log'){
+			$this->_cj_transfer_log();
+		}
 		else
 		{
 			 $this->_index();
@@ -2160,4 +2163,114 @@ class Whlabel_bh extends Start_Controller {
 		$this->data['final_list'] = $final_list;
 		$this->_Template('whlabel_bh_transfer_detail',$this->data);
 	}
+
+
+	public function _cj_transfer_log(){
+		$post = $this->input->post(NULL, TRUE);
+		if(!empty($post)){
+			$orderinfo = $this->input->post('orderinfo',true);
+			$tid = $this->input->post('tid',true);
+			$page = $this->input->post('page',true);
+		    $perpage = $this->input->post('perpage',true);
+			$timetk = $this->input->post('timetk',true);
+			$timetj = $this->input->post('timetj',true);
+			$timetk = strtotime($timetk);
+			$timetj = strtotime($timetj);
+			$where = " rk like '%|".$tid."|%' ";
+			if($timetk && $timetj)
+            {
+                $where .= " and time > '$timetk' and time < '$timetj'";
+            }
+			if($orderinfo){
+				$number_list  = $this->whlabel_bh->find_all(" orderinfo = '$orderinfo'","orderinfo,number");
+				$numbers = array_column($number_list,'number');
+				$where.= " and number in (".implode(",",$numbers).") ";
+			}
+			if(empty($page))
+		    {
+                $start = 0;
+		    	$perpage = 20;
+            }
+		    else
+		    {
+                $start = ($page - 1)*$perpage;
+            }
+			
+			
+			$list = $this->whlabel_bh_transfer->find_pc($where,'number',"id,number,orderinfo,pm",'id desc',$start,$perpage);
+			
+
+			$count = $this->whlabel_bh_transfer->find_all($where,'COUNT(DISTINCT number) as total');
+			$total = $count[0]['total'];
+			$pagenum = ceil($total/$perpage);
+			$over = $total-($start+$perpage);
+
+			$final_list = [];
+			foreach($list as $k=>$v){
+
+				$yjs = $wck = $yck = 0;
+				$log_list = $this->whlabel_bh_transfer_cr->find_all("lx = ".$tid." and type = 1 and  number = ".$v['number']);
+				
+				foreach($log_list as $kk=>$vv){
+					$yjs += 1;
+					if($vv['is_over'] == 0){
+						$wck += 1;
+					}
+					if($vv['is_over'] == 1){
+						$yck += 1;
+					}
+				}
+				$final_list[$k]['id'] = $v['id'];
+				$final_list[$k]['orderinfo'] = $v['orderinfo'];
+				$final_list[$k]['number'] = $v['number'];
+				$final_list[$k]['pm'] = $v['pm'];
+				$final_list[$k]['yjs'] = $yjs;
+				$final_list[$k]['wck'] = $wck;
+				$final_list[$k]['yck'] = $yck;
+
+			}
+
+
+			$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;
+			
+			
+			$transfer = explode('|',trim($user['transfer'],'|'));
+			
+			
+			if(empty($transfer)){
+				exit("您的账号没有赋予车间权限");
+			}
+			// if(count($transfer) > 1){
+			// 	exit("您的账号只能分配一个车间,多车间系统无法处理");
+			// }
+			$tid = $transfer[0];
+			
+		}
+		else
+		{
+			header('Location: /');exit;
+		}
+		$transfer = $this->transfer->read($tid);
+		$this->data['transfer'] = $transfer;
+		
+
+
+		$start_time = strtotime(date('Y-m-d')) -  14* 24 * 60 * 60;
+		$end_time = strtotime(date('Y-m-d')) + 24 * 60 * 60;
+		
+	
+		$wwcsl = $this->whlabel_bh_transfer_cr->find_count(" lx = ".$tid." and type = 1 and is_over = 0 and time >= ".$start_time." and time <= ".$end_time);
+
+		$this->data['wwcsl'] = $wwcsl;
+
+		$this->_Template('whlabel_bh_cj_transfer_log',$this->data);
+
+	}
 }

+ 69 - 0
template/erp/whlabel_bh_cj_transfer_log.html

@@ -0,0 +1,69 @@
+{Template header}
+<body>
+<div class="warp">
+<div class="fixed">
+<ul class="search">
+<li>订单号:<input value="" name="orderinfo" 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>
+    <input type="hidden" name="tid" value="{$transfer['id']}">
+<li><span>确 定</span></li>
+<li style="margin-right: 30px;">
+    <font class="cona " style="color:#fff;background-color: #f33;">未完成({$wwcsl})</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="tyrows tyrowscc"><div><p></p><p></p></div></div>
+<div class="list"><div><p>操作配置</p><ul class="fj"></ul><em></em></div></div>
+<span id="job" class="none"></span>
+<span id="site" class="none"></span>
+<script>
+var dataurl = "/whlabel_bh/cj_transfer_log";var fdataurl = "/whlabel_bh/cj_transfer_log";
+var sysprint = 1;
+var customon = 1;
+function custom(){
+$(".data tr").each(function() {
+$(this).find('td:eq(0)').css("width","1%");
+$(this).find('td:eq(1)').css("width","5%");
+$(this).find('td:eq(2)').css("width","5%");
+$(this).find('td:eq(3)').css("width","15%");
+$(this).find('td:eq(4)').css("width","5%");
+$(this).find('td:eq(5)').css("width","5%");
+$(this).find('td:eq(6)').css("width","5%");
+$(this).find('td:eq(7)').css("width","5%");
+
+
+});}
+window.onload = function() { 
+if(typeof $("select[name='printer']").length < 1) return;
+setTimeout(function(){ wprinter.printer()},1000);};
+</script>
+<script type="text/javascript" src="{$theme}js/laydate.js"></script>
+
+{Template footer}