|
@@ -134,6 +134,9 @@ class Whlabel_bh extends Start_Controller {
|
|
|
else if($arg == "cj_transfer_scanout_excel"){
|
|
|
$this->_cj_transfer_scanout_excel();
|
|
|
}
|
|
|
+ else if($arg == "cj_transfer_scanout_xzlog"){
|
|
|
+ $this->_cj_transfer_scanout_xzlog();
|
|
|
+ }
|
|
|
else if($arg == 'excelwchz'){
|
|
|
$this->_excelwchz();
|
|
|
}
|
|
@@ -3067,4 +3070,67 @@ class Whlabel_bh extends Start_Controller {
|
|
|
header( "Expires: 0" );
|
|
|
exit($str);
|
|
|
}
|
|
|
+
|
|
|
+ public function _cj_transfer_scanout_xzlog(){
|
|
|
+ $ktime = $this->input->get('timetk',true);
|
|
|
+ $jtime = $this->input->get('timetj',true);
|
|
|
+ $ktime = strtotime($ktime);
|
|
|
+ $jtime = strtotime($jtime);
|
|
|
+ $tid = $this->input->get('tid',true);
|
|
|
+
|
|
|
+ $transfer_info = $this->transfer->read($tid);
|
|
|
+
|
|
|
+ $where = " time >= ".$ktime." and time <= ".$jtime." and lx = ".$tid." and type = 2 ";
|
|
|
+ $list = $this->whlabel_bh_transfer_cr->find_all($where,"*","id asc");
|
|
|
+ $final_list = [];
|
|
|
+ foreach($list as $k=>$v){
|
|
|
+ $final_list[] = [
|
|
|
+ 'id'=>$v['id'],
|
|
|
+ 'fid'=>$v['fid'],
|
|
|
+ 'lx'=>$transfer_info['title'],
|
|
|
+ 'type'=>($v['type'] == 1)?"入库":"出库",
|
|
|
+ 'time'=>date("Y~m~d H:i:s",$v['time']),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $filename = date("Ymd",$ktime)."~".date("Ymd",$jtime).$transfer_info['title']."扫出库日志记录.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>ID</td><td>流转条码ID</td><td>部门</td><td>类型</td><td>扫出时间</td></tr>";
|
|
|
+ foreach ($final_list as $key=>$value)
|
|
|
+ {
|
|
|
+ $str .= "<tr>";
|
|
|
+ $str .= "<td>". $value['id']. "</td>";
|
|
|
+ $str .= "<td>". $value['fid']. "</td>";
|
|
|
+ $str .= "<td>". $value['lx']. "</td>";
|
|
|
+ $str .= "<td>". $value['type']. "</td>";
|
|
|
+ $str .= "<td>". $value['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);
|
|
|
+ }
|
|
|
}
|