lvhao 1 день назад
Родитель
Сommit
6df5091344
2 измененных файлов с 182 добавлено и 0 удалено
  1. 104 0
      core/CoreApp/controllers/Zshitj.php
  2. 78 0
      template/erp/zshitj_xcdyld.html

+ 104 - 0
core/CoreApp/controllers/Zshitj.php

@@ -0,0 +1,104 @@
+<?php defined('BASEPATH') or exit('No direct script access allowed');
+/**
+ * 临时表获取统计
+ * erp生成临时表的统计功能
+ */
+class Zshitj extends Start_Controller
+{
+	public function __construct()
+	{
+        parent::__construct();
+    }
+    //定义方法的调用规则 获取URI第二段值
+	public function _remap($arg, $arg_array)
+	{
+		if ($arg == 'xcdyld') //
+		{
+            //获取标签出库的按条件导出的excel
+			$this->_xcdyld($arg_array);
+		} 
+	    else {
+			$this->_index();
+		}
+	}
+
+    private function _index(){
+        echo "!!!!!!!!!!!!";
+    }
+    /**
+     * 许昌仓打印超过24小时的漏单
+     */
+    private function _xcdyld($arg_array){
+        
+        if(isset($_SESSION['api']))
+		{
+			$user = $this->user->get_api($_SESSION['api']);
+			
+		    $owner_shop = explode('|',trim($user['shop'],'|'));
+			
+			
+		}
+
+        if($this->input->method() == 'post'){
+            $params = $this->input->post(NULL,true);
+            $time =time() - 24 * 60 * 60;
+            $start_time = time() - 5 * 24 * 60 * 60 ;
+            $table_name = $params['table_name'];
+
+            $waybill = $this->input->post('waybill',true);
+            $number = $this->input->post('number',true);
+            $orderinfo = $this->input->post('orderinfo',true);
+            $shop = $this->input->post('shop',true);
+            $page = $this->input->post('page',true);
+		    $perpage = $this->input->post('perpage',true);
+
+            $this->db->select("f.state,f.shop,f.dtime,f.number,f.printtime,f.print,f.library,f.type");
+            $this->db->from($table_name . " as f");
+            
+            if($waybill){
+                $this->db->where('f.waybill',$waybill);
+            }
+            if($number){
+                $this->db->where('f.number',$number);
+            }
+            if($orderinfo){
+                $this->db->where('f.orderinfo',$orderinfo);
+            }
+            if($shop){
+                $this->db->where('f.shop',$shop);
+            }else{
+                if(!empty($owner_shop)){
+                    $this->db->where_in('f.shop',$owner_shop);
+                }
+            }
+
+            $this->db->where(' f.type','13');
+            $this->db->where(' f.state','207');
+            $this->db->where(' f.print','3');
+            $this->db->where(' f.printtime >= ', $start_time );
+            $this->db->where(' f.printtime < ', $time );
+            $this->db->where(' f.library','1');
+            $this->db->where(" NOT EXISTS ( SELECT 1 FROM crowd_systemtransfer as s where s.number = f.number )", null, false);
+            $this->db->order_by('f.printtime','desc');
+
+            $list = $this->db->get()->result_array();
+            if(empty($list)){
+                $rows = array('total'=>0,'over'=>0,'pagenum'=>$page,'rows'=>([]));
+            }else{
+                $total = count($list);
+                $split_arr = array_chunk($list,$perpage);
+                $split_total = count($split_arr);
+                $over = $split_total - $page;
+                $r_list = $split_arr[$page-1];
+    
+                $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$page,'rows'=>($r_list));
+            }
+           
+		    echo json_encode($rows);exit;
+        }else{
+            $table_name = $arg_array[0];
+            $this->data['table_name'] = $table_name;
+            $this->_Template('zshitj_xcdyld', $this->data);
+        }
+    }
+}

+ 78 - 0
template/erp/zshitj_xcdyld.html

@@ -0,0 +1,78 @@
+{Template header}
+<body>
+<div class="warp">
+<div class="fixed">
+<ul class="search">
+<li>订单号:<input value="" name="orderinfo" type="text"></li>
+<li>编号:<input value="" name="number" type="text"></li>
+<li>运单号:<input value="" name="waybill" type="text"></li>
+<li>
+店铺名称:<select name="shop" class="select">
+<option value="">请选择</option>
+{loop usershop() as $val}
+<option value="{$val['id']}">{$val['shopname']}</option>
+{/loop}</select>
+</li>
+
+
+<input type="hidden" name="table_name" value="{$table_name}">
+
+<li><span>确 定</span></li>
+</ul>
+
+<table class="datatitle data" border="0" style="border-collapse:collapse;">
+<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>类型</td>
+<td>次数</td>
+<td>打印时间</td>
+<td>仓库品名</td>
+</tr>
+</table>
+</div>
+<table class="datatext data" border="0" style="border-collapse:collapse;">
+</table>
+<div class="bomf"></div>
+</div>
+<div class="print none"></div>
+<div class="ts"><p class="tsn"></p></div>
+<div class="systemwindow">
+<div>
+<p>是否确定删除所选信息?</p>
+<p><font class="button">确 定</font><font class="esc">取 消</font></p>
+</div>
+</div>
+<div class="tyrows"><div><p></p><p></p></div></div>
+<div class="list"><div><p>操作配置</p><ul class="fj"></ul><em></em></div></div>
+<span id="job" class="none"></span>
+<span id="site" class="none"></span>
+<script>
+var dataurl = "/zshitj/xcdyld";
+var fdataurl = "/zshitj/xcdyld";
+var customon = 1;
+function custom(){
+$(".data tr").each(function() {
+    $(this).find('td:eq(0)').css("width","1%");
+    $(this).find('td:eq(1)').css("width","9%");
+    $(this).find('td:eq(2)').css("width","9%");
+    $(this).find('td:eq(3)').css("width","13%");
+    $(this).find('td:eq(4)').css("width","9%");
+    $(this).find('td:eq(5)').css("width","9%");
+    $(this).find('td:eq(6)').css("width","5%");
+    $(this).find('td:eq(7)').css("width","4%");
+    $(this).find('td:eq(8)').css("width","5%");
+    $(this).find('td:eq(9)').css("width","9%");
+    $(this).find('td:eq(10)').css("width","27%");
+    $(this).find('td:eq(10)').css("font-size","12px");
+});}
+
+</script>
+<script type="text/javascript" src="{$theme}js/laydate.js"></script>
+
+{Template footer}