|
@@ -220,17 +220,65 @@ class Systemfoutfz extends Start_Controller {
|
|
|
print_r($list);
|
|
|
die;
|
|
|
|
|
|
- $final_list = [];
|
|
|
+ // $final_list = [];
|
|
|
// foreach(){
|
|
|
|
|
|
// }
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ //生成excel
|
|
|
+ $filename = '订单出库-'.date('Ymd',time());
|
|
|
+ $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><td>料品</td></tr>";
|
|
|
+ foreach ($info_list as $key=>$value)
|
|
|
+ {
|
|
|
+
|
|
|
+ $tmp_list = explode(";",$value['fpdata']);
|
|
|
+ if(isset($tmp_list[0])){
|
|
|
+ foreach($tmp_list as $k=>$v){
|
|
|
+ $tmp_detail = explode("|",$v);
|
|
|
+ $str .= "<tr>";
|
|
|
+ $str .= "<td>". $value['number']. "</td>";
|
|
|
+ $str .= "<td>". $value['librarytime']. "</td>";
|
|
|
+ $str .= "<td>". $value['shipremarks']. "</td>";
|
|
|
+ $str .= "<td>". $tmp_detail[2]. "</td>";
|
|
|
+ $str .= "<td>". $tmp_detail[1]. "</td>";
|
|
|
+ $str .= "<td>". $value['state']. "</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);
|
|
|
|
|
|
- $title = '订单出库-'.date('Ymd',time());
|
|
|
- $titlename = "<table border=1>".$t."<td>条数</td><td>料品</td><td>品名</td></table>";
|
|
|
- $tail = "\n";
|
|
|
- $filename = $title.".xls";
|
|
|
- $this->excel->get_fz2(array_merge($info_list,$info_listtt,$info_listamz,$info_listxw,$info_listsmt),$titlename,$filename,$tail);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -285,15 +333,17 @@ class Systemfoutfz extends Start_Controller {
|
|
|
$info_list[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
|
|
|
}
|
|
|
$dbapi = explode(';',trim($value['fpdata'],';'));
|
|
|
- $tmp_jm = "";
|
|
|
- $tmp_zh = "";
|
|
|
+ $trans_list = [];
|
|
|
foreach ($dbapi as $va)
|
|
|
{
|
|
|
+
|
|
|
$pm = $classid;
|
|
|
$jm = $classid;
|
|
|
$bmpx = array(13=>'',16=>'',18=>'',25=>'',26=>'',41=>'');
|
|
|
$features = str_replace(array('-163-','-164-','-165-','-166-'),'-',$va);
|
|
|
$ts = explode('|',trim($features,'|'));
|
|
|
+ var_dump($ts);
|
|
|
+ die;
|
|
|
if(stripos($ts[0],',') !== false)
|
|
|
{
|
|
|
$ft = explode(',',$ts[0]);
|
|
@@ -357,16 +407,23 @@ class Systemfoutfz extends Start_Controller {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ $trans_list[] = [
|
|
|
+ 'jm',
|
|
|
+ 'pm',
|
|
|
+ 'ts'
|
|
|
+ ];
|
|
|
$jm = array_filter($jm);//去除空值
|
|
|
- $jm = implode("-",$jm);
|
|
|
- $tmp_jm .= $jm.";";
|
|
|
- $pm = array_filter($pm);//去除空值
|
|
|
- $zh = implode(" ",$pm);
|
|
|
- $zh = preg_replace("/\r\n|\r|\n/",'',trim($zh,' '));
|
|
|
- $tmp_zh .= $zh.";";
|
|
|
+ // $jm = implode("-",$jm);
|
|
|
+ // $tmp_jm .= $jm.";";
|
|
|
+ // $pm = array_filter($pm);//去除空值
|
|
|
+ // $zh = implode(" ",$pm);
|
|
|
+ // $zh = preg_replace("/\r\n|\r|\n/",'',trim($zh,' '));
|
|
|
+ // $tmp_zh .= $zh.";";
|
|
|
}
|
|
|
- $info_list[$key]['jm'] = trim($tmp_jm,';');
|
|
|
- $info_list[$key]['zh'] = trim($tmp_zh,';');
|
|
|
+ $info_list[$key]['trans_list'] = trim($tmp_jm,';');
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return $info_list;
|