Whlabelstockup.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. <?php defined('BASEPATH') OR exit('No direct script access allowed');
  2. class whlabelstockup extends Start_Controller {
  3. public function __construct(){
  4. parent::__construct();
  5. $this->load->library('session');
  6. $this->load->_model('Model_whlabel_stockup','whlabel_stockup');
  7. $this->load->_model('Model_whlabel','whlabel');
  8. $this->load->_model('Model_whlabeltransport','whlabeltransport');
  9. $this->load->_model('Model_classid','classid');
  10. $this->load->_model('Model_whlabel_qh','whlabel_qh');
  11. $this->load->_model('Model_typeclass','typeclass');
  12. $this->load->_model('Model_whlabel_type','whlabel_type');
  13. $this->load->_model('Model_whlabel_bh','whlabel_bh');
  14. $this->load->_model('Model_shop','shop');
  15. $this->load->_model('Model_purchase','purchase');
  16. $this->load->_model('Model_apiyy','apiyy');
  17. $this->load->_model('Model_excel','excel');
  18. $this->load->_model('Model_whlabel_bh_transfer','whlabel_bh_transfer');
  19. }
  20. //定义方法的调用规则 获取URI第二段值
  21. public function _remap($arg,$arg_array)
  22. {
  23. if($arg == 'count')
  24. {
  25. $this->_count();
  26. }
  27. else if($arg == 'xd')
  28. {
  29. $this->_xd($arg_array);
  30. }
  31. else if($arg == 'excel')
  32. {
  33. $this->_excel();
  34. }
  35. else
  36. {
  37. $this->_index();
  38. }
  39. }
  40. //管理
  41. public function _index()
  42. {
  43. $wt = array();
  44. $whlabel_type = $this->whlabel_type->find_all();
  45. foreach ($whlabel_type as $v)
  46. {
  47. $wt[$v['id']] = $v['title'];
  48. }
  49. $post = $this->input->post(NULL, TRUE);
  50. if(isset($post['page']))
  51. {
  52. $page = $this->input->post('page',true);
  53. $perpage = $this->input->post('perpage',true);
  54. $sku = $this->input->post('sku',true);
  55. $jm = $this->input->post('jm',true);
  56. $text = $this->input->post('text',true);
  57. $type = $this->input->post('type',true);
  58. $repair = $this->input->post('repair',true);
  59. $stockup = $this->input->post('stockup',true);
  60. $outbound = $this->input->post('outbound',true);
  61. $lacecolor = $this->input->post('lacecolor',true);
  62. $category = $this->input->post('category',true);
  63. $size = $this->input->post('size',true);
  64. $grade = $this->input->post('grade',true);
  65. $color = $this->input->post('color',true);
  66. $lowe = $this->input->post('lowe',true);
  67. $lacetype = $this->input->post('lacetype',true);
  68. $haircap = $this->input->post('haircap',true);
  69. $density = $this->input->post('density',true);
  70. $where = "1=1";
  71. if($lacecolor)
  72. {
  73. $where .= " and features like '%-$lacecolor-%'";
  74. }
  75. if($lacetype)
  76. {
  77. $where .= " and features like '%-$lacetype-%'";
  78. }
  79. if($category)
  80. {
  81. $where .= " and features like '%-$category-%'";
  82. }
  83. if($size)
  84. {
  85. $where .= " and features like '%-$size-%'";
  86. }
  87. if($grade)
  88. {
  89. $where .= " and features like '%-$grade-%'";
  90. }
  91. if($color)
  92. {
  93. $where .= " and features like '%-$color-%'";
  94. }
  95. if($lowe)
  96. {
  97. $where .= " and features like '%-$lowe-%'";
  98. }
  99. if($haircap)
  100. {
  101. $where .= " and features like '%-$haircap-%'";
  102. }
  103. if($density)
  104. {
  105. $where .= " and features like '%-$density-%'";
  106. }
  107. if($sku)
  108. {
  109. $where .= " and sku like '%$sku%'";
  110. }
  111. if($jm)
  112. {
  113. $where .= " and jm = '$jm'";
  114. }
  115. if($text)
  116. {
  117. $where .= " and text = '$text'";
  118. }
  119. if($type)
  120. {
  121. $where .= " and type = '$type'";
  122. }
  123. if($repair != '')
  124. {
  125. $where .= " and repair = '$repair'";
  126. }
  127. if($stockup != '')
  128. {
  129. $where .= " and stockup = '$stockup'";
  130. }
  131. if($outbound != '')
  132. {
  133. $where .= " and outbound = '$outbound'";
  134. }
  135. //数据排序
  136. $order_str = "repair desc";//备货预警从大到小
  137. if(empty($page))
  138. {
  139. $start = 0;
  140. $perpage = 1;
  141. }
  142. else
  143. {
  144. $start = ($page - 1)*$perpage;
  145. }
  146. //取得信息列表
  147. $info_list = $this->whlabel_stockup->find_all($where,'id,sku,jm,us,uszt,cs,xc,type,st,seven,thirty,availableday,lackday,zd,repair,stockup,outbound,bhnum',$order_str,$start,$perpage);
  148. foreach ($info_list as $key=>$value)
  149. {
  150. $data = $this->whlabel_stockup->read($value['id']);
  151. $bh = $this->whlabel_bh->find_all("sku = '".$data['bhsku']."' and features = '".$data['features']."' and time > '".(time()-7*24*3600)."'");
  152. $info_list[$key]['sku'] = '<p>'.$value['sku'].'</p>';
  153. foreach ($bh as $v)
  154. {
  155. $printnum = $this->whlabel_bh_transfer->get_number($v['number']);
  156. if(isset($printnum['ctime11']) && $printnum['ctime11'] > 0)
  157. {
  158. continue;
  159. }
  160. $info_list[$key]['sku'] .= '<p style="color: #2084db;">'.date('Y-m-d',$v['time']).' 备货数量:'.$v['bhnum'].' 未入库</p>';
  161. }
  162. if($value['repair'] == 0)
  163. {
  164. $info_list[$key]['repair'] = '/';
  165. }
  166. else
  167. {
  168. $info_list[$key]['repair'] = '补货';
  169. }
  170. if($value['stockup'] == 0)
  171. {
  172. $info_list[$key]['stockup'] = '/';
  173. }
  174. else
  175. {
  176. $info_list[$key]['stockup'] = '备货';
  177. }
  178. if($value['outbound'] == 0)
  179. {
  180. $info_list[$key]['outbound'] = '正常';
  181. }
  182. else
  183. {
  184. $info_list[$key]['outbound'] = '异常';
  185. }
  186. if(isset($wt[$value['type']]))
  187. {
  188. $info_list[$key]['type'] = $wt[$value['type']];
  189. }
  190. else
  191. {
  192. $info_list[$key]['type'] = '未设置';
  193. }
  194. $info_list[$key]['cs'] = $value['us']+$value['uszt'];
  195. $info_list[$key]['bhnum'] = '<p><input value="'.$value['bhnum'].'" name="xd" type="text" style="width:80%;margin:0 10%;padding:5px 0;border: 1px #ccc solid;font-size: 13px;text-align: center;color: #333;border-radius: 5px;"></p><p><b id="xf'.$key.'" class="xd">下单</b></p>';
  196. }
  197. $total = $this->whlabel_stockup->find_count($where);
  198. $pagenum = ceil($total/$perpage);
  199. $over = $total-($start+$perpage);
  200. $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
  201. echo json_encode($rows);exit;
  202. }
  203. $this->_Template('whlabelstockup',$this->data);
  204. }
  205. public function _count()
  206. {
  207. $c = array();
  208. $time = time();
  209. $typeclass = array();
  210. $tc = $this->typeclass->find_all();
  211. foreach ($tc as $v)
  212. {
  213. $typeclass[$v['id']] = $v;
  214. }
  215. $classid = $this->classid->sku();
  216. $info_list = $this->whlabel->find_pc('warehouse=5','sku,purchase,features','*','id asc');
  217. $this->db->truncate('whlabel_stockup');
  218. $this->db->trans_begin();
  219. $asd = 0;
  220. foreach ($info_list as $key=>$value)
  221. {
  222. $features = str_replace(array('-163-','-164-','-165-','-166-'),'-',$value['features']);
  223. $features = explode('-',trim($features,'-'));
  224. $pm = $classid;
  225. $jm = $classid;
  226. $bhsku = array();
  227. $bmpx = array(13=>'',16=>'',18=>'',25=>'',26=>'',41=>'');
  228. foreach($features as $k=>$v)
  229. {
  230. if(isset($typeclass[$v]) && isset($bmpx[$typeclass[$v]['classid']]))
  231. {
  232. if($typeclass[$v]['bm'] != '')
  233. {
  234. $bmpx[$typeclass[$v]['classid']] = $typeclass[$v]['bm'];
  235. }
  236. }
  237. if($v != 0)
  238. {
  239. if($k != 'size')
  240. { if(empty($typeclass[$v]['title'])){
  241. $title .= $typeclass[$v]['title']." ";
  242. }else{
  243. $title .= $typeclass[$v]['title']." ";
  244. }
  245. }
  246. $bhsku[$typeclass[$v]['classid']] = $typeclass[$v]['bqsku'];
  247. if(!isset($typeclass[$v]))
  248. {
  249. continue;
  250. }
  251. if(isset($pm[$typeclass[$v]['classid']]))
  252. {
  253. if(stripos($typeclass[$v]['zh'],'|') !== false)
  254. {
  255. $tz = explode('|',$typeclass[$v]['zh']);
  256. $pm[$typeclass[$v]['classid']] = $tz[0];
  257. }
  258. else
  259. {
  260. $pm[$typeclass[$v]['classid']] = $typeclass[$v]['zh'];
  261. }
  262. }
  263. if(isset($jm[$typeclass[$v]['classid']]))
  264. {
  265. $jm[$typeclass[$v]['classid']] = $typeclass[$v]['jm'];
  266. }
  267. }
  268. }
  269. $jm = array_filter($jm);
  270. $zh = implode(" ",$pm);
  271. $zh = str_replace('自然色 ','',trim($zh,' '));
  272. $zh = str_replace(array(' ',' ',' ',' ',' ',' ',' '),' ',$zh);
  273. $zh = preg_replace("/\r\n|\r|\n/",'',$zh);//中文
  274. $bhsku = array_filter($bhsku);//去除空值
  275. $post['bhsku'] = implode("-",$bhsku);
  276. $post['bm'] = '03'.implode("",$bmpx);
  277. $post['features'] = $value['features'];
  278. $post['title'] = $value['title'];
  279. $post['sku'] = $value['sku'];
  280. $post['jm'] = implode("-",$jm);//简码
  281. $post['zh'] = $zh;
  282. $post['us'] = $this->whlabel->find_count('state = 0 and warehouse = 5 and sku = "'.$value['sku'].'" and features = "'.$value['features'].'"');//美仓库存
  283. $post['xc'] = $this->whlabel->find_count('state = 0 and warehouse = 13 and features = "'.$value['features'].'"');//许昌库存
  284. $qh = $this->whlabel_qh->get_data($value['features'],date('Ym',$time));
  285. if(isset($qh['num']))
  286. {
  287. if($post['us']+$post['xc'] < 1 && $qh['gxtime'] < date('Ymd',$time))
  288. {
  289. $this->whlabel_qh->save(array("num"=>$qh['num']+1,"gxtime"=>date('Ymd',$time)),$qh['id']);
  290. $qh['num'] += 1;
  291. }
  292. }
  293. else
  294. {
  295. $this->whlabel_qh->insert(array("sku"=>$value['sku'],"features"=>$value['features'],"num"=>0,"gtime"=>date('Ym',$time),"gxtime"=>date('Ymd',$time)));
  296. $qh['num'] = 0;
  297. }
  298. $zt = $this->whlabeltransport->find_all('sku = "'.$value['sku'].'" and warehouse = 5 and features = "'.$value['features'].'" and cz = "0"');
  299. $post['uszt'] = array_sum(array_column($zt,'num'));//在途库存
  300. $post['type'] = $value['type'];//等级类型
  301. //$post['text'] = $value['text'];//备注
  302. $post['seven'] = $this->whlabel->find_count('sku = "'.$value['sku'].'" and features = "'.$value['features'].'" and outk > "'.($time-7*24*3600).'" and outk < "'.$time.'"');//7天出库
  303. $post['st'] = $this->whlabel->find_count('sku = "'.$value['sku'].'" and features = "'.$value['features'].'" and outk > "'.($time-14*24*3600).'" and outk < "'.($time-7*24*3600).'"');//前7天出库
  304. $post['thirty'] = $this->whlabel->find_count('sku = "'.$value['sku'].'" and features = "'.$value['features'].'" and outk > "'.($time-30*24*3600).'" and outk < "'.$time.'"');//30天出库
  305. $post['zd'] = $this->whlabel->find_count('sku = "'.$value['sku'].'" and state = 0 and zd != "" and features = "'.$value['features'].'"');//占单数量
  306. if($post['thirty'] > 0 && 30-$qh['num'] > 0)
  307. {
  308. $post['availableday'] = sprintf("%01.1f",($post['uszt']+$post['us']-$post['zd'])/($post['thirty']/(30-$qh['num'])));//预计可用天数
  309. }
  310. else
  311. {
  312. $post['availableday'] = sprintf("%01.1f",($post['uszt']-$post['zd']));
  313. }
  314. $post['lackday'] = $qh['num'];//本月缺货天数
  315. $post['repair'] = '0';//是否需要补货
  316. if($value['type'] > 0 && $value['type'] < 5 && $post['availableday'] < 40)
  317. {
  318. $post['repair'] = '1';//补货
  319. }
  320. $post['stockup'] = '0';
  321. if(($post['uszt']+$post['xc']) < $post['thirty'])
  322. {
  323. $post['stockup'] = '1';//备货
  324. }
  325. $post['outbound'] = '0';//正常
  326. if($post['seven'] > 0)
  327. {
  328. if($post['seven'] >= $post['seven']*2)
  329. {
  330. $post['outbound'] = '1';//异常
  331. }
  332. }
  333. $bhnum = $post['thirty']/30*40-($post['uszt']+$post['us']-$post['zd']);// 30天出库/30天*40天-(在途+美仓-占单)
  334. if($bhnum > 0)
  335. {
  336. $post['bhnum'] = $bhnum;
  337. }
  338. else
  339. {
  340. $post['bhnum'] = 0;
  341. }
  342. $asd++;
  343. $this->whlabel_stockup->insert($post);
  344. }
  345. if ($this->db->trans_status() === FALSE)
  346. {
  347. $this->db->trans_rollback();
  348. }
  349. else
  350. {
  351. $this->db->trans_commit();
  352. }
  353. echo $asd;
  354. }
  355. public function _xd($arg_array)
  356. {
  357. $tc = $this->typeclass->find_all();
  358. $typeclass = array();
  359. foreach ($tc as $v)
  360. {
  361. $tcjm[$v['id']] = array($v['jm'],$v['classid']);
  362. $typeclass[$v['id']] = array('zh'=>$v['zh'],'classid'=>$v['classid'],'bm'=>$v['bm'],'title'=>$v['title'],'jm'=>$v['jm'],'bqsku'=>$v['bqsku']);
  363. }
  364. $post = $this->input->post(NULL, TRUE);
  365. if(isset($post['bhid']))
  366. {
  367. $id = $this->input->post('bhid',true);
  368. $data = $this->whlabel_stockup->read($id);
  369. $jm = $data['jm'];
  370. $sku = $data['bhsku'];
  371. $pm = $data['zh'];
  372. $title = $data['title'];
  373. $post['bm'] = $data['bm'];
  374. $post['features'] = $data['features'];
  375. $post['num'] = $this->input->post('num',true);
  376. $ztime = $this->input->post('ztime',true);
  377. $post['ztime'] = strtotime($ztime);
  378. $post['jm'] = $jm;
  379. $post['sku'] = $sku;
  380. $post['pm'] = $pm;
  381. $post['title'] = $title;
  382. if($ztime)
  383. {
  384. $post['ztime'] = strtotime($ztime);
  385. }
  386. $time = time();
  387. $post['time'] = $time;//操作时间
  388. $post['printnum'] = $time;
  389. $post['type'] = 0;
  390. $post['number'] = date('YmdHis',time()).rand(100,999);
  391. //传输料号开始
  392. $lc = 0;
  393. $lh = $this->apiyy->get_cjlp(array('jm'=>$post['jm'],'title'=>$post['title'],'zh'=>$post['pm'],'bm'=>$post['bm']));
  394. if(isset($lh['Data'][0]))
  395. {
  396. if($lh['Data'][0]['m_isSucess'] != 1)
  397. {
  398. if($lh['Data'][0]['m_errorMsg'] != '料号 已存在,请重新输入!')
  399. {
  400. echo json_encode(array('msg'=>$lh['Data'][0]['m_errorMsg'],'bm'=>$post['bm'],'jm'=>$post['jm'],'success'=>false));exit;
  401. }
  402. }
  403. }
  404. else
  405. {
  406. echo json_encode(array('msg'=>'料号错误','cs'=>json_encode($lh),'success'=>false));exit;
  407. }
  408. if($this->whlabel_bh->insert($post))
  409. {
  410. echo json_encode(array('msg'=>'添加成功','success'=>true));exit;
  411. }
  412. else
  413. {
  414. echo json_encode(array('msg'=>'添加失败,请重试','success'=>false));exit;
  415. }
  416. }
  417. $w = $this->shop->find_all("yyid != ''");
  418. $this->data['yyck'] = $w;
  419. $whlabelstockup = $this->whlabel_stockup->read($arg_array[0]);
  420. $this->data['whlabelstockup'] = $whlabelstockup ;
  421. $this->data['num'] = $arg_array[1];
  422. $purchase = $this->purchase->find_all("yyid != ''");
  423. $this->data['purchase'] = $purchase;
  424. $this->_Template('whlabelstockup_xd',$this->data);
  425. }
  426. public function _excel()
  427. {
  428. $user = $this->user->get_api($_SESSION['api']);
  429. if($user)
  430. {
  431. $fgshop = "";$sid = "";
  432. $user = explode('|',trim($user['shop'],'|'));
  433. foreach ($user as $value)
  434. {
  435. $fgshop .= " shop = ".$value." or";
  436. $sid .= " id = ".$value." or";
  437. }
  438. }
  439. $post = $this->input->get(NULL, TRUE);
  440. if(isset($post['a']))
  441. {
  442. $sku = $this->input->get('sku',true);
  443. $jm = $this->input->get('jm',true);
  444. $text = $this->input->get('text',true);
  445. $type = $this->input->get('type',true);
  446. $repair = $this->input->get('repair',true);
  447. $stockup = $this->input->get('stockup',true);
  448. $outbound = $this->input->get('outbound',true);
  449. $lacecolor = $this->input->get('lacecolor',true);
  450. $category = $this->input->get('category',true);
  451. $size = $this->input->get('size',true);
  452. $grade = $this->input->get('grade',true);
  453. $color = $this->input->get('color',true);
  454. $lowe = $this->input->get('lowe',true);
  455. $lacetype = $this->input->get('lacetype',true);
  456. $haircap = $this->input->get('haircap',true);
  457. $density = $this->input->get('density',true);
  458. $where = "1=1";
  459. if($lacecolor)
  460. {
  461. $where .= " and features like '%-$lacecolor-%'";
  462. }
  463. if($lacetype)
  464. {
  465. $where .= " and features like '%-$lacetype-%'";
  466. }
  467. if($category)
  468. {
  469. $where .= " and features like '%-$category-%'";
  470. }
  471. if($size)
  472. {
  473. $where .= " and features like '%-$size-%'";
  474. }
  475. if($grade)
  476. {
  477. $where .= " and features like '%-$grade-%'";
  478. }
  479. if($color)
  480. {
  481. $where .= " and features like '%-$color-%'";
  482. }
  483. if($lowe)
  484. {
  485. $where .= " and features like '%-$lowe-%'";
  486. }
  487. if($haircap)
  488. {
  489. $where .= " and features like '%-$haircap-%'";
  490. }
  491. if($density)
  492. {
  493. $where .= " and features like '%-$density-%'";
  494. }
  495. if($sku)
  496. {
  497. $where .= " and sku = '$sku'";
  498. }
  499. if($jm)
  500. {
  501. $where .= " and jm = '$jm'";
  502. }
  503. if($text)
  504. {
  505. $where .= " and text = '$text'";
  506. }
  507. if($type)
  508. {
  509. $where .= " and type = '$type'";
  510. }
  511. if($repair != '')
  512. {
  513. $where .= " and repair = '$repair'";
  514. }
  515. if($stockup != '')
  516. {
  517. $where .= " and stockup = '$stockup'";
  518. }
  519. if($outbound != '')
  520. {
  521. $where .= " and outbound = '$outbound'";
  522. }
  523. //数据排序
  524. $order_str = "repair desc";//备货预警从大到小
  525. $dowid = $this->input->get('a');
  526. $wid = "";
  527. if($dowid != "")
  528. {
  529. $id_arr = explode(',',rtrim($dowid,','));
  530. $wid .= " id = 0 or";
  531. foreach ($id_arr as $v)
  532. {
  533. $wid .= " id = '$v' or";
  534. }
  535. $wid = " and (".rtrim($wid,'or').")";
  536. }
  537. $info_list = $this->whlabel_stockup->find_all($where.$wid,'id,sku,jm,us,uszt,cs,xc,type,st,seven,thirty,availableday,lackday,zd,repair,stockup,outbound,bhnum',$order_str);
  538. foreach ($info_list as $key=>$value)
  539. {
  540. $data = $this->whlabel_stockup->read($value['id']);
  541. $bh = $this->whlabel_bh->find_all("sku = '".$data['bhsku']."' and features = '".$data['features']."' and time > '".(time()-7*24*3600)."'");
  542. $info_list[$key]['sku'] = '<p>'.$value['sku'].'</p>';
  543. foreach ($bh as $v)
  544. {
  545. $info_list[$key]['sku'] .= '<p style="color: #2084db;">'.date('Y-m-d',$v['time']).' 备货数量:'.$v['bhnum'].'</p>';
  546. }
  547. if($value['repair'] == 0)
  548. {
  549. $info_list[$key]['repair'] = '/';
  550. }
  551. else
  552. {
  553. $info_list[$key]['repair'] = '补货';
  554. }
  555. if($value['stockup'] == 0)
  556. {
  557. $info_list[$key]['stockup'] = '/';
  558. }
  559. else
  560. {
  561. $info_list[$key]['stockup'] = '备货';
  562. }
  563. if($value['outbound'] == 0)
  564. {
  565. $info_list[$key]['outbound'] = '正常';
  566. }
  567. else
  568. {
  569. $info_list[$key]['outbound'] = '异常';
  570. }
  571. if(isset($wt[$value['type']]))
  572. {
  573. $info_list[$key]['type'] = $wt[$value['type']];
  574. }
  575. else
  576. {
  577. $info_list[$key]['type'] = '未设置';
  578. }
  579. $info_list[$key]['cs'] = $value['us']+$value['uszt'];
  580. unset($info_list[$key]['id']);
  581. }
  582. }
  583. $title = '预警及备货'.date('Y-m-d H:i',time());
  584. $titlename = "<table border=1>
  585. <tr>
  586. <td>SKU</td>
  587. <td>用友料号</td>
  588. <td>美仓库存</td>
  589. <td>在途</td>
  590. <td>美仓库存+在途</td>
  591. <td>许昌库存</td>
  592. <td>等级</td>
  593. <td>前周出库</td>
  594. <td>近7天出库</td>
  595. <td>近30天出库</td>
  596. <td>预计可用天数</td>
  597. <td>本月缺货</td>
  598. <td>占单数量</td>
  599. <td>补货预警</td>
  600. <td>备货提醒</td>
  601. <td>出库异常</td>
  602. <td>需要备货</td>
  603. </tr>
  604. </table>";
  605. $filename = $title.".xls";
  606. $tail = "\n";
  607. $this->excel->get_fz2($info_list,$titlename,$filename,$tail);
  608. }
  609. }