|
@@ -136,6 +136,9 @@ class Whlabel_bh extends Start_Controller {
|
|
}
|
|
}
|
|
else if($arg == 'edit_jgtime'){
|
|
else if($arg == 'edit_jgtime'){
|
|
$this->_edit_jgtime();
|
|
$this->_edit_jgtime();
|
|
|
|
+ }else if($arg == 'excelcpkhz'){
|
|
|
|
+ $this->_excelcpkhz();
|
|
|
|
+
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -2810,4 +2813,104 @@ class Whlabel_bh extends Start_Controller {
|
|
exit($str);
|
|
exit($str);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public function _excelcpkhz(){
|
|
|
|
+ // $classid = $this->classid->sku();
|
|
|
|
+ // $pm = $classid;
|
|
|
|
+ // $typeclass = array();
|
|
|
|
+ // $tc = $this->typeclass->find_all();
|
|
|
|
+ // foreach ($tc as $v)
|
|
|
|
+ // {
|
|
|
|
+ // $typeclass[$v['id']] = $v;
|
|
|
|
+ // }
|
|
|
|
+ // $prc = array();
|
|
|
|
+ // $purchase = $this->purchase->find_all();
|
|
|
|
+ // foreach($purchase as $k=>$v)
|
|
|
|
+ // {
|
|
|
|
+ // $prc[$v['id']] = $v['title'];
|
|
|
|
+ // }
|
|
|
|
+ if(isset($_GET['fexcel']))
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $transfer = $this->input->get('transfer',true);
|
|
|
|
+ $ktime = $this->input->get('timetk',true);
|
|
|
|
+ $jtime = $this->input->get('timetj',true);
|
|
|
|
+ $ktime = strtotime($ktime);
|
|
|
|
+ $jtime = strtotime($jtime);
|
|
|
|
+ $where = " time >= ".$ktime." and time <= ".$jtime." and lx = " .$transfer." and type = 1 " ;$gj = "";$ck = "";
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $list = array();
|
|
|
|
+ $rows = $this->whlabel_bh_transfer_cr->find_all($where,'*');
|
|
|
|
+ foreach($rows as $k=>$v){
|
|
|
|
+ if(!isset($list['fid'])){
|
|
|
|
+ $list[$v['fid']] = [
|
|
|
|
+ 'fid'=>$v['fid'],
|
|
|
|
+ 'time'=>date("Y-m-d H:i:s",$v['time'])
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $fid_list = array_column($list,'fid');
|
|
|
|
+ $tmp_list = $this->whlabel_bh_transfer->find_all(" id in (".implode(",",$fid_list).") ","id,wbid,orderinfo,jm,pm,time,label","id asc");
|
|
|
|
+ $tmp_list = array_column($tmp_list,null,'id');
|
|
|
|
+ foreach($list as $k=>$v){
|
|
|
|
+ if(isset($tmp_list[$k])){
|
|
|
|
+ $list[$v['fid']]['wbid'] = $tmp_list[$k]['wbid'];
|
|
|
|
+ $list[$v['fid']]['orderinfo'] = $tmp_list[$k]['orderinfo'];
|
|
|
|
+ $list[$v['fid']]['jm'] = $tmp_list[$k]['jm'];
|
|
|
|
+ $list[$v['fid']]['pm'] = $tmp_list[$k]['pm'];
|
|
|
|
+ $list[$v['fid']]['sl'] = 1;
|
|
|
|
+ $list[$v['fid']]['label'] = $tmp_list[$k]['label'];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $filename = date("YmdHi",$ktime)."~".date("YmdHi",$jtime)."工厂成品库扫入库汇总.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><td>数量</td><td>扫描时间</td><td>扫描条码</td></tr>";
|
|
|
|
+ foreach ($list as $key=>$value)
|
|
|
|
+ {
|
|
|
|
+ $str .= "<tr>";
|
|
|
|
+ $str .= "<td>". $key. "</td>";
|
|
|
|
+ $str .= "<td>". $value['wbid']. "</td>";
|
|
|
|
+ $str .= "<td>". $value['orderinfo']. "</td>";
|
|
|
|
+ $str .= "<td>". $value['jm']. "</td>";
|
|
|
|
+ $str .= "<td>". $value['pm']. "</td>";
|
|
|
|
+ $str .= "<td>". $value['sl']. "</td>";
|
|
|
|
+ $str .= "<td>".$value['time']."</td>";
|
|
|
|
+ $str .= "<td>`".$value['label']."</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);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|