lvhao 18 小時之前
父節點
當前提交
88f3c23d4b
共有 2 個文件被更改,包括 73 次插入9 次删除
  1. 65 1
      core/CoreApp/controllers/Whlabelfz.php
  2. 8 8
      template/erp/whlabelfz_bqpl.html

+ 65 - 1
core/CoreApp/controllers/Whlabelfz.php

@@ -516,7 +516,57 @@ class Whlabelfz extends Start_Controller
 
 	private function _bqplindex(){
 		if($this->input->method() == 'post'){
-			$rows = array('total'=>0,'over'=>1,'pagenum'=>1,'rows'=>([]));
+			$page = $this->input->post('page',true);
+		    $perpage = $this->input->post('perpage',true);
+			$title = $this->input->post('title',true);
+			$sku = $this->input->post('sku',true);
+			$timetk = $this->input->post('timetk',true);
+			$timetj = $this->input->post('timetj',true);
+			$timetk = strtotime($timetk);
+			$timetj = strtotime($timetj);
+			$status = $this->input->post('status',true);
+
+			if($timetk && $timetj)
+            {
+                $where  = " time  > '$timetk' and time < '$timetj'";
+            }
+			if($title){
+				$where  .= " and title like '%$title%'";
+			}
+			if($sku){
+				$where  .= " and sku like '%$sku%'";
+			}
+			if($status > -1){
+				$where  .= " and status = '$status'";
+			}
+            //数据排序
+            $order_str = "id asc";
+            if(empty($page))
+		    {
+                $start = 0;
+		    	$perpage = 1;
+            }
+		    else
+		    {
+                $start = ($page - 1)*$perpage;
+            }
+			$purchase_list = $this->purchase->find_all("1 = 1","id,title");
+			$purchase_list = array_column($purchase_list,'title','id');
+			
+            //取得信息列表
+            $info_list = $this->whlabellabelprint->find_all($where,'id,purchase,sku,title,warehouse,details,dynum,status,time,print_time',$order_str,$start,$perpage);
+			foreach ($info_list as $key=>$value) 
+		    {
+				$info_list[$key]['purchase'] = isset($purchase_list[$value['purchase']])?$purchase_list[$value['purchase']]:'';
+				$info_list[$key]['warehouse'] = $this->_getWarehouseById($value['warehouse']);
+				$info_list[$key]['time'] = date('Y-m-d H:i:s', $value['time']);
+				$info_list[$key]['status'] = empty($value['status'])?'未打印':'已打印';
+				$info_list[$key]['print_time'] = empty($value['print_time'])? '': date('Y-m-d H:i:s', $value['print_time']);
+		    }
+		    $total = $this->whlabellabelprint->find_count($where);
+		    $pagenum = ceil($total/$perpage);
+		    $over = $total-($start+$perpage);
+		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
 		    echo json_encode($rows);exit;
 		}
 		$this->_Template('whlabelfz_bqpl', $this->data);
@@ -557,6 +607,20 @@ class Whlabelfz extends Start_Controller
 			return 13;
 		}
 	}
+
+	private function _getWarehouseById($str){
+		if($str == 12){
+			return '特殊库存仓';
+		}elseif($str == 5){
+			return '美国店';
+		}elseif($str == 16){
+			return '定制头套仓';
+		}elseif($str == 34){
+			return 'TikTok仓';
+		}else{
+			return '许昌仓';
+		}
+	}
 	private function _bqpladd(){
 		$params = $this->input->post('data',true);
 		$params = json_decode($params,true);

+ 8 - 8
template/erp/whlabelfz_bqpl.html

@@ -6,6 +6,7 @@
                 <li>SKU:<input value="" name="sku" type="text"></li>
                 <li>货品名字:<input value="" name="title" type="text"></li>
                 <li>状态:<select name="status" class="select">
+                        <option value="-1">请选择</option>
                         <option value="0">未打印</option>
                         <option value="1">已打印</option>
                     </select></li>
@@ -29,16 +30,15 @@
                 <tr>
                     <td><label onClick="swapCheck()"><input name="checkbox" type="checkbox"
                                 class="regular-checkbox"></label></td>
-                    <td>店铺名称</td>
-                    <td>订单号</td>
-                    <td>编号</td>
-                    <td>快递公司</td>
-                    <td>运单号</td>
+                    <td>供应商</td>
+                    <td>SKU</td>
+                    <td>名称</td>
+                    <td>仓库</td>
+                    <td>存储位置</td>
+                    <td>打印数量</td>
                     <td>状态</td>
-                    <td>类型</td>
-                    <td>次数</td>
+                    <td>导入时间</td>
                     <td>打印时间</td>
-                    <td>仓库品名</td>
                 </tr>
             </table>
         </div>