|
|
@@ -202,6 +202,8 @@ class Whlabel extends Start_Controller
|
|
|
$this->_whlabelexcelzhjs();
|
|
|
}else if($arg == 'dccrtypejs'){
|
|
|
$this->_dccrtypejs();
|
|
|
+ }else if($arg == 'errorexceljs'){
|
|
|
+ $this->_errorexceljs();
|
|
|
}else if($arg == "w_t_cs"){
|
|
|
$this->_w_t_cs(); //首页
|
|
|
}else {
|
|
|
@@ -9081,4 +9083,72 @@ class Whlabel extends Start_Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function _errorexceljs()
|
|
|
+ {
|
|
|
+ $post = $this->input->post(NULL, TRUE);
|
|
|
+ if (isset($_GET['page'])) {
|
|
|
+ $page = $this->input->get('page', true);
|
|
|
+ $perpage = $this->input->get('perpage', true);
|
|
|
+ $sku = $this->input->get('sku', true);
|
|
|
+ $warehouse = $this->input->get('warehouse', true);
|
|
|
+ $ktime = $this->input->get('ktime', true);
|
|
|
+ $jtime = $this->input->get('jtime', true);
|
|
|
+ $ktime = strtotime($ktime);
|
|
|
+ $jtime = strtotime($jtime);
|
|
|
+ $where = "sku != 'Preset'";
|
|
|
+ $gj = '';
|
|
|
+ if ($sku) {
|
|
|
+ $where .= " and sku like '%$sku%'";
|
|
|
+ } else {
|
|
|
+ if ($ktime && $jtime) {
|
|
|
+ $gj = " and time > '$ktime' and time < '$jtime'";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($warehouse) {
|
|
|
+ $where .= " and warehouse = '$warehouse'";
|
|
|
+ }
|
|
|
+ //数据排序
|
|
|
+ $order_str = "id desc";
|
|
|
+ if (empty($page)) {
|
|
|
+ $start = 0;
|
|
|
+ $perpage = 1;
|
|
|
+ } else {
|
|
|
+ $start = ($page - 1) * $perpage;
|
|
|
+ }
|
|
|
+ //取得信息列表
|
|
|
+ $rows = array();
|
|
|
+ $list = array();
|
|
|
+ $info_list = $this->whlabel->find_pc($where, 'warehouse,features,sku', '*');
|
|
|
+ foreach ($info_list as $value) {
|
|
|
+ $warehouse = $this->warehouse->read($value['warehouse']);
|
|
|
+ $c = $this->whlabel->find_count('sku = "' . $value['sku'] . '" and state = "0" and warehouse = "' . $value['warehouse'] . '"');
|
|
|
+ $number = $value['number'];
|
|
|
+ $ftime = time() - 15 * 24 * 3600;
|
|
|
+ if ($c < 1) {
|
|
|
+ $list[] = array('warehouse' => $warehouse['title'], 'sku' => $value['sku'], 'title' => $value['title'], 'c' => $c);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ $title = "0库存汇总";
|
|
|
+
|
|
|
+ $first_row = ["仓库","SKU","产品","当前库存"];
|
|
|
+
|
|
|
+ $cols = [
|
|
|
+ ["wch"=>"15"],["wch"=>"30"],["wch"=>"30"],["wch"=>"15"],
|
|
|
+ ];
|
|
|
+ $final_list= [];
|
|
|
+ foreach($list as $key => $value){
|
|
|
+ $final_list[] = array_values($value) ;
|
|
|
+ }
|
|
|
+ if(empty($final_list)){
|
|
|
+ exit(json_encode(array('code' => 0, 'msg' => '无符合条件数据')));
|
|
|
+ }
|
|
|
+ array_unshift($final_list, $first_row);
|
|
|
+
|
|
|
+ $merges = [];
|
|
|
+ exit(json_encode(array('code' => 1,'msg'=>"获取成功",'data'=>['merges'=>$merges, 'data' => $final_list,'title'=>$title,'cols' => $cols])));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|