|
@@ -2327,4 +2327,134 @@ class Transfer extends Start_Controller {
|
|
$this->data['transfer_ids'] =implode(",",$transfer_ids) ;
|
|
$this->data['transfer_ids'] =implode(",",$transfer_ids) ;
|
|
$this->_Template('transfer_scz',$this->data);
|
|
$this->_Template('transfer_scz',$this->data);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public function _sczexcel(){
|
|
|
|
+ $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);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $timetk = $this->input->post('timetk',true);
|
|
|
|
+ $timetj = $this->input->post('timetj',true);
|
|
|
|
+ $timetk = strtotime($timetk);
|
|
|
|
+ $timetj = strtotime($timetj);
|
|
|
|
+
|
|
|
|
+ // $transfer_list = $this->transfer->find_all('id not in (8,9,11,12,15,16)');
|
|
|
|
+ // $t = $transfer_list = array_column($transfer_list, 'title', 'id');
|
|
|
|
+ // $transfer_ids = array_keys($t);
|
|
|
|
+ if(empty($page))
|
|
|
|
+ {
|
|
|
|
+ $start = 0;
|
|
|
|
+ $perpage = 1;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ $start = ($page - 1)*$perpage;
|
|
|
|
+ }
|
|
|
|
+ $where = "time > '$timetk' and time < '$timetj'";
|
|
|
|
+ $where .= " and rk not like '%11|' ";
|
|
|
|
+ if(!empty($transfer)){
|
|
|
|
+ $where .= " and rk like '%|".$transfer."|%' ";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $order_str = "id desc";
|
|
|
|
+ //取得信息列表
|
|
|
|
+ $info_list = $this->systemtransfer->find_all($where,'id,number,is_jiaji,pm,shipremarks,printtime,time,ctime12',$order_str,$start,$perpage);
|
|
|
|
+ $transfer = $this->transfer->find_all();
|
|
|
|
+ $t = array();
|
|
|
|
+ foreach ($transfer as $v)
|
|
|
|
+ {
|
|
|
|
+ $t[$v['id']] = $v['title'];
|
|
|
|
+ $ot[$v['id']] = ($v['orvertime']>0)?$v['orvertime']*24*3600:0;
|
|
|
|
+ }
|
|
|
|
+ //格式化数据
|
|
|
|
+ foreach ($info_list as $key=>$value)
|
|
|
|
+ {
|
|
|
|
+ if($value['is_jiaji'] == 2){
|
|
|
|
+ $info_list[$key]['is_jiaji'] = "<a href='javascript:void(0)' style='color:red'>加急</a>";
|
|
|
|
+ }else{
|
|
|
|
+ $info_list[$key]['is_jiaji'] = "常规";
|
|
|
|
+ }
|
|
|
|
+ $dd = $this->systemtransfer->read($value['id']);
|
|
|
|
+ $info_list[$key]['printtime'] = date('Y-m-d H:i:s',$value['printtime']);
|
|
|
|
+ $rk = explode('|',trim($dd['rk'],'|'));
|
|
|
|
+ $rktime = explode('|',trim($dd['rktime'],'|'));
|
|
|
|
+ $ck = explode('|',trim($dd['ck'],'|'));
|
|
|
|
+ $cktime = explode('|',trim($dd['cktime'],'|'));
|
|
|
|
+ $info_list[$key]['time'] = '';
|
|
|
|
+ $data = $this->systemtransfer_cr->find_all("fid = '".$value['id']."'");
|
|
|
|
+
|
|
|
|
+ //$info_list[$key]['time'] = "订单出库 :".date('Y-m-d H:i',$value['printtime']).'<br>';
|
|
|
|
+ $info_list[$key]['time'] = "布标打印 :".date('Y-m-d H:i',$value['ctime12']).'<br>';
|
|
|
|
+ foreach ($data as $k=>$v)
|
|
|
|
+ {
|
|
|
|
+ // $type = ($v['type']==1)?'入库':'出库';
|
|
|
|
+ // $info_list[$key]['time'] .= $t[$v['lx']].$type.' :'.date('Y-m-d H:i',$v['time']).'<br>';
|
|
|
|
+
|
|
|
|
+ $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='font-weight:900;'>即将超时 </l></a>".'<br>';
|
|
|
|
+ // $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>".'<br>';
|
|
|
|
+ }
|
|
|
|
+ }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 font-weight:900'>超时! </l></a>".'<br>';
|
|
|
|
+ }elseif($v['orver_flag'] == 3){
|
|
|
|
+ $info_list[$key]['time'] .= "<a href='javascript:void(0);' style='color:#06f'>".$t[$v['lx']].$type.' :'.date('Y-m-d H:i',$v['time']) ." <l font-weight:900'>【该单已取消】 </l></a>".'<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>".'<br>';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $info_list[$key]['time'] = trim($info_list[$key]['time'],'<br>');
|
|
|
|
+ unset($info_list[$key]['ctime12']);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $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></tr>";
|
|
|
|
+ foreach ($info_list as $key=>$value)
|
|
|
|
+ {
|
|
|
|
+ if(empty($value['number'])){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ $str .= "<tr>";
|
|
|
|
+ $str .= "<td>". $value['number']. "</td>";
|
|
|
|
+ $str .= "<td>". $value['pm']. "</td>";
|
|
|
|
+ $str .= "<td>". $value['lx_name']. "</td>";
|
|
|
|
+ $str .= "<td>". $value['start_time']. "</td>";
|
|
|
|
+ $str .= "<td>". $value['end_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);
|
|
|
|
+ }
|
|
}
|
|
}
|