瀏覽代碼

tijiaoshuju

lvhao 4 月之前
父節點
當前提交
1c5f7e3d48

+ 132 - 248
core/CoreApp/controllers/Systemfout.php

@@ -196,255 +196,70 @@ class Systemfout extends Start_Controller {
 		    {
                 $start = ($page - 1)*$perpage;
             }
-            //取得信息列表
-            $info_list = $this->fullorder->find_all($where,'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks',$order_str,$start,$perpage);
-			 //格式化数据
-            foreach ($info_list as $key=>$value)
-		    {
-				$shop = $this->shop->read($value['shop']);
-				$info_list[$key]['shop'] = $shop['shopname'];
-				if($value['waybill'] == '0')
-				{
-					$info_list[$key]['waybill'] = "";
-				}
-				$express = $this->express->read($value['express']);
-				$info_list[$key]['express'] = $express['servicename'];
-				$warehouse = $this->warehouse->read($value['type']);
-				$info_list[$key]['type'] = $warehouse['title'];
-				if($value['print'] == 1)
-				{
-					$info_list[$key]['print'] = '不可打印';
-				}
-				else if($value['print'] == 2)
-				{
-					$info_list[$key]['print'] = '未打印';
-				}
-				else if($value['print'] == 3)
-				{
-					$info_list[$key]['print'] = '已打印';
-				}
-				if($value['library'] == 1)
-				{
-					$info_list[$key]['library'] = '<em class="c">未出库</em>';
-				}
-				else if($value['library'] == 2)
-				{
-					$info_list[$key]['library'] = '<em class="c">已出库</em>';
-				}
-				else if($value['library'] == 3)
-				{
-					$info_list[$key]['library'] = '<em class="c">已退库</em>';
-				}
-				if($value['librarytime'] == '0')
-				{
-					$info_list[$key]['librarytime'] = '<em class="t"></em>';
-				}
-				else
-				{
-					$info_list[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i',$value['librarytime']).'</em>';
-				}
-				$info_list[$key]['shipremarks'] = str_replace(array('<','>'),array('&lt;','&gt;'),$value['shipremarks']);
-            }
-            
-			$info_listtt = $this->fullordertt->find_all($where,'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks',$order_str,$start,$perpage);
-			 //格式化数据
-            foreach ($info_listtt as $key=>$value) 
-		    {
-				$shop = $this->shop->read($value['shop']);
-				$info_listtt[$key]['shop'] = $shop['shopname'];
-				if($value['waybill'] == '0')
-				{
-					$info_listtt[$key]['waybill'] = "";
-				}
-				$express = $this->express->read($value['express']);
-				$info_listtt[$key]['express'] = $express['servicename'];
-				$warehouse = $this->warehouse->read($value['type']);
-				$info_listtt[$key]['type'] = $warehouse['title'];
-				if($value['print'] == 1)
-				{
-					$info_listtt[$key]['print'] = '不可打印';
-				}
-				else if($value['print'] == 2)
-				{
-					$info_listtt[$key]['print'] = '未打印';
-				}
-				else if($value['print'] == 3)
-				{
-					$info_listtt[$key]['print'] = '已打印';
-				}
-				if($value['library'] == 1)
-				{
-					$info_listtt[$key]['library'] = '<em class="c">未出库</em>';
-				}
-				else if($value['library'] == 2)
-				{
-					$info_listtt[$key]['library'] = '<em class="c">已出库</em>';
-				}
-				else if($value['library'] == 3)
-				{
-					$info_listtt[$key]['library'] = '<em class="c">已退库</em>';
-				}
-				if($value['librarytime'] == '0')
-				{
-					$info_listtt[$key]['librarytime'] = '<em class="t"></em>';
-				}
-				else
-				{
-					$info_listtt[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
-				}
-            }
-            
-            $info_listamz = $this->fullorderamz->find_all($where,'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks',$order_str,$start,$perpage);
-			 //格式化数据
-            foreach ($info_listamz as $key=>$value) 
-		    {
-				$shop = $this->shop->read($value['shop']);
-				$info_listamz[$key]['shop'] = $shop['shopname'];
-				if($value['waybill'] == '0')
-				{
-					$info_listamz[$key]['waybill'] = "";
-				}
-				$express = $this->express->read($value['express']);
-				$info_listamz[$key]['express'] = $express['servicename'];
-				$warehouse = $this->warehouse->read($value['type']);
-				$info_listamz[$key]['type'] = $warehouse['title'];
-				if($value['print'] == 1)
-				{
-					$info_listamz[$key]['print'] = '不可打印';
-				}
-				else if($value['print'] == 2)
-				{
-					$info_listamz[$key]['print'] = '未打印';
-				}
-				else if($value['print'] == 3)
-				{
-					$info_listamz[$key]['print'] = '已打印';
-				}
-				if($value['library'] == 1)
-				{
-					$info_listamz[$key]['library'] = '<em class="c">未出库</em>';
-				}
-				else if($value['library'] == 2)
-				{
-					$info_listamz[$key]['library'] = '<em class="c">已出库</em>';
-				}
-				else if($value['library'] == 3)
-				{
-					$info_listamz[$key]['library'] = '<em class="c">已退库</em>';
-				}
-				if($value['librarytime'] == '0')
-				{
-					$info_listamz[$key]['librarytime'] = '<em class="t"></em>';
-				}
-				else
-				{
-					$info_listamz[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
-				}
-            }
-            
-            
-			$info_listxw = $this->fullorderxw->find_all($where,'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks',$order_str,$start,$perpage);
-			 //格式化数据
-            foreach ($info_listxw as $key=>$value) 
-		    {
-				$shop = $this->shop->read($value['shop']);
-				$info_listxw[$key]['shop'] = $shop['shopname'];
-				if($value['waybill'] == '0')
-				{
-					$info_listxw[$key]['waybill'] = "";
-				}
-				$express = $this->express->read($value['express']);
-				$info_listxw[$key]['express'] = $express['servicename'];
-				$warehouse = $this->warehouse->read($value['type']);
-				$info_listxw[$key]['type'] = $warehouse['title'];
-				if($value['print'] == 1)
-				{
-					$info_listxw[$key]['print'] = '不可打印';
-				}
-				else if($value['print'] == 2)
-				{
-					$info_listxw[$key]['print'] = '未打印';
-				}
-				else if($value['print'] == 3)
-				{
-					$info_listxw[$key]['print'] = '已打印';
-				}
-				if($value['library'] == 1)
-				{
-					$info_listxw[$key]['library'] = '<em class="c">未出库</em>';
-				}
-				else if($value['library'] == 2)
-				{
-					$info_listxw[$key]['library'] = '<em class="c">已出库</em>';
-				}
-				else if($value['library'] == 3)
-				{
-					$info_listxw[$key]['library'] = '<em class="c">已退库</em>';
-				}
-				if($value['librarytime'] == '0')
-				{
-					$info_listxw[$key]['librarytime'] = '<em class="t"></em>';
-				}
-				else
-				{
-					$info_listxw[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
-				}
-            }
-			$info_listsmt = $this->fullordersmt->find_all($where." and mergeid = '0'",'id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks',$order_str,$start,$perpage);
-			 //格式化数据
-            foreach ($info_listsmt as $key=>$value) 
-		    {
-				$shop = $this->shop->read($value['shop']);
-				$info_listsmt[$key]['shop'] = $shop['shopname'];
-				if($value['waybill'] == '0')
-				{
-					$info_listsmt[$key]['waybill'] = "";
-				}
-				$express = $this->express->read($value['express']);
-				$info_listsmt[$key]['express'] = $express['servicename'];
-				$warehouse = $this->warehouse->read($value['type']);
-				$info_listsmt[$key]['type'] = $warehouse['title'];
-				if($value['print'] == 1)
-				{
-					$info_listsmt[$key]['print'] = '不可打印';
-				}
-				else if($value['print'] == 2)
-				{
-					$info_listsmt[$key]['print'] = '未打印';
-				}
-				else if($value['print'] == 3)
-				{
-					$info_listsmt[$key]['print'] = '已打印';
-				}
-				if($value['library'] == 1)
-				{
-					$info_listsmt[$key]['library'] = '<em class="c">未出库</em>';
-				}
-				else if($value['library'] == 2)
-				{
-					$info_listsmt[$key]['library'] = '<em class="c">已出库</em>';
-				}
-				else if($value['library'] == 3)
-				{
-					$info_listsmt[$key]['library'] = '<em class="c">已退库</em>';
-				}
-				if($value['librarytime'] == '0')
-				{
-					$info_listsmt[$key]['librarytime'] = '<em class="t"></em>';
-				}
-				else
-				{
-					$info_listsmt[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
-				}
-            }
-		    $total = $this->fullorder->find_count($where);
-			$total += $this->fullordertt->find_count($where);
-			$total += $this->fullorderamz->find_count($where);
-			$total += $this->fullorderxw->find_count($where);
-			$total += $this->fullordersmt->find_count($where);
+           
+            $dlz_num = $tt_num = $amz_num = $smt_num = $xw_num = 0;
+			$dlz_arr = $tt_arr = $amz_arr = $smt_arr = $xw_arr = [];
+
+			$dlz_jj_num = $tt_jj_num = $amz_jj_num = $smt_jj_num = $xw_jj_num = 0;
+            $dlz_jj_arr = $tt_jj_arr = $amz_jj_arr = $smt_jj_arr = $xw_jj_arr = [];
+			
+		    $shop_list = $this->shop->find_all();
+			$shop_list = array_column($shop_list,null,'id');
+			$express_list = $this->express->find_all();
+			$express_list = array_column($express_list,'null','id');
+			$warehouse_list = $this->warehouse->find_all();
+			$warehouse_list = array_column($warehouse_list,null,'id');
+
+			$filed = "id,shop,type,orderinfo,number,waybill,express,print,library,librarytime,shipremarks,is_jiaji";
+
+			$where_jj = $where." and is_jiaji = 1 ";
+			$dlz_jj_ret =$this->indexData('fullorder',$start,$perpage,$where_jj,$filed,$order_str,$shop_list,$express_list,$warehouse_list);
+			$dlz_jj_num = $dlz_jj_ret['total'];
+			$dlz_jj_arr = $dlz_jj_ret['list'];
+
+			$tt_jj_ret = $this->indexData('fullordertt',$start,$perpage,$where_jj,$filed,$order_str,$shop_list,$express_list,$warehouse_list);
+			$tt_jj_num = $tt_jj_ret['total'];
+			$tt_jj_arr = $tt_jj_ret['list'];
+
+			$amz_jj_ret = $this->indexData('fullorderamz',$start,$perpage,$where_jj,$filed,$order_str,$shop_list,$express_list,$warehouse_list);
+			$amz_jj_num = $amz_jj_ret['total'];
+			$amz_jj_arr = $amz_jj_ret['list'];
+
+			$smt_jj_ret = $this->indexData('fullordersmt',$start,$perpage,$where_jj,$filed,$order_str,$shop_list,$express_list,$warehouse_list);
+			$smt_jj_num = $smt_jj_ret['total'];
+			$smt_jj_arr = $smt_jj_ret['list'];
+
+			/******************** 非加急 *************************/
+
+			$where_no_jj = $where." and is_jiaji = 0 ";
+			$dlz_no_ret =$this->indexData('fullorder',$start,$perpage,$where_no_jj,$filed,$order_str,$shop_list,$express_list,$warehouse_list);
+			$dlz_num = $dlz_no_ret['total'];
+			$dlz_arr = $dlz_no_ret['list'];
+
+			$tt_no_ret = $this->indexData('fullordertt',$start,$perpage,$where_no_jj,$filed,$order_str,$shop_list,$express_list,$warehouse_list);
+			$tt_num = $tt_no_ret['total'];
+			$tt_arr = $tt_no_ret['list'];
+
+			$amz_no_ret = $this->indexData('fullorderamz',$start,$perpage,$where_no_jj,$filed,$order_str,$shop_list,$express_list,$warehouse_list);
+			$amz_num = $amz_no_ret['total'];
+			$amz_arr = $amz_no_ret['list'];
+
+			$smt_no_ret = $this->indexData('fullordersmt',$start,$perpage,$where_no_jj,$filed,$order_str,$shop_list,$express_list,$warehouse_list);
+			$smt_num = $smt_no_ret['total'];
+			$smt_arr = $smt_no_ret['list'];
+
+			/**************************翔文的不管**************************/
+
+			$xw_no_ret = $this->indexData('fullorderxw',$start,$perpage,$where,$filed,$order_str,$shop_list,$express_list,$warehouse_list);
+			$xw_num = $xw_no_ret['total'];
+			$xw_arr = $xw_no_ret['list'];
+
+			$total = $dlz_num + $dlz_jj_num + $tt_num + $tt_jj_num + $amz_num + $amz_jj_num + $smt_num + $smt_jj_num + $xw_num;
+
 		    $pagenum = ceil($total/$perpage);
 		    $over = $total-($start+$perpage);
-		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>(array_merge($info_list,$info_listamz,$info_listtt,$info_listxw,$info_listsmt)));
+			$rows = array_merge($dlz_jj_arr,$tt_jj_arr,$amz_jj_arr,$smt_jj_arr,$dlz_arr,$tt_arr,$amz_arr,$smt_arr,$xw_arr);
+		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>$rows);
 		    echo json_encode($rows);exit;
 		}
 		if(isset($_SESSION['api']))
@@ -457,6 +272,75 @@ class Systemfout extends Start_Controller {
 		$this->data['xw'] = $xw;
 		$this->_Template('systemfout',$this->data);
 	}
+	/**
+	 * $table_name  订单表名
+	 * $start 		偏移开始坐标
+	 * $limit   	偏移量
+	 * $where  		条件
+	 * $field		字段
+	 * $order_str   排序
+	 */
+	protected function indexData($table_name,$start,$limit,$where,$filed,$order_str,$shop_list,$express_list,$warehouse_list){	
+		$info_list = $this->$table_name->find_all($where,$filed,$order_str,$start,$limit);
+		
+		if(empty($info_list)){
+			$info_list = [];
+		}
+		//格式化数据
+		foreach ($info_list as $key=>$value) 
+		{
+			if($value['is_jiaji'] == 1){
+				$info_list[$key]['number'] = "<c style='color:red'>".$value['number']."</c>";
+			}
+			$info_list[$key]['shop'] = isset($shop_list[$value['shop']])?$shop_list[$value['shop']]['shopname']:"";
+			if($value['waybill'] == '0')
+			{
+				$info_list[$key]['waybill'] = "";
+			}
+			$info_list[$key]['express'] = isset($express_list[$value['express']])?$express_list[$value['express']]['servicename']:"";
+	
+			$info_list[$key]['type'] = isset($warehouse_list[$value['type']])?$warehouse_list[$value['type']]['title']:"";
+			if($value['print'] == 1)
+			{
+				$info_list[$key]['print'] = '不可打印';
+			}
+			else if($value['print'] == 2)
+			{
+				$info_list[$key]['print'] = '未打印';
+			}
+			else if($value['print'] == 3)
+			{
+				$info_list[$key]['print'] = '已打印';
+			}
+			if($value['library'] == 1)
+			{
+				$info_list[$key]['library'] = '<em class="c">未出库</em>';
+			}
+			else if($value['library'] == 2)
+			{
+				$info_list[$key]['library'] = '<em class="c">已出库</em>';
+			}
+			else if($value['library'] == 3)
+			{
+				$info_list[$key]['library'] = '<em class="c">已退库</em>';
+			}
+			if($value['librarytime'] == '0')
+			{
+				$info_list[$key]['librarytime'] = '<em class="t"></em>';
+			}
+			else
+			{
+				$info_list[$key]['librarytime'] = '<em class="t">'.date('Y-m-d H:i:s',$value['librarytime']).'</em>';
+			}
+			unset($info_list[$key]['is_jiaji']);
+        }
+		$total = $this->$table_name->find_count($where);
+		return [
+			'list'=>$info_list,
+			'total'=>$total,
+		];
+	}
+
 	public function _fout()
 	{
 		$post = $this->input->post(NULL, TRUE);
@@ -960,7 +844,7 @@ class Systemfout extends Start_Controller {
 				// }
 				//$this->ck->get_kc($post['state'],$vwarehouse,$vshop,$v['number'],$v['whlabel'],$v['fpdata']);
 			}
-			$this->logic_ding->sendToDing("u9小单队列监听数据".json_encode($queue_u9_list,JSON_UNESCAPED_UNICODE));
+			//$this->logic_ding->sendToDing("u9小单队列监听数据".json_encode($queue_u9_list,JSON_UNESCAPED_UNICODE));
 			//将要执行的队列数据添加进去
 			foreach($queue_u9_list as $item){
 				if($item['platform'] != 'fullorderxw'){

File diff suppressed because it is too large
+ 0 - 3219
core/CoreApp/controllers/Systemfouttest.php


File diff suppressed because it is too large
+ 0 - 2439
core/CoreApp/controllers/Systemprinttest.php


+ 0 - 133
template/erp/systemprinttest.html

@@ -1,133 +0,0 @@
-{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="print" class="select">
-<option value="2">未打印</option>
-<option value="3">已打印</option>
-</select></li>
-<li>快递公司:<select name="express" class="select">
-<option value="">请选择</option>
-{loop express(100) as $val}
-<option value="{$val['id']}">{$val['servicename']}</option>
-{/loop}</select>
-</li>
-<li>
-店铺名称:<select name="shop" class="select">
-<option value="">请选择</option>
-{loop usershop() as $val}
-<option value="{$val['id']}">{$val['shopname']}</option>
-{/loop}</select>
-</li>
-<li>
-仓库名称:<select name="type" class="select">
-<option value="">请选择</option>
-{loop $warehouse as $val}
-<option value="{$val['id']}">{$val['title']}</option>
-{/loop}</select>
-</li>
-<li>
-产品分类:<select name="ckfl" class="select">
-<option value="">请选择</option>
-{loop typeclass(37,100) as $val}
-<option value="{$val['id']}">{$val['title']}</option>
-{/loop}</select>
-</li>
-<li>
-是否现货:<select name="sfxh" class="select">
-<option value="">请选择</option>
-<option value="1">有现货</option>
-<option value="0">无现货</option>
-</select>
-</li>
-<li>搜索品名:<input value="" name="so" type="text" style="width:260px"></li>
-<li>颜色:<select name="color" class="select">
-<option value="">请选择</option>{loop typeclassyc(8) as $val}
-<option value="{$val['id']}">{$val['title']} - {$val['zh']}</option>{/loop}</select></li>
-<li>曲度:<select name="lowe" class="select">
-<option value="">请选择</option>{loop typeclassyc(15) as $val}
-<option value="{$val['id']}">{$val['title']} - {$val['zh']}</option>{/loop}</select></li>
-<li>打印时间:<input id="timetk" value="{date('Y-m-d',time()-30*24*3600)} 19:00" name="timetk" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})" readonly>
-至&nbsp;&nbsp;&nbsp;&nbsp; <input id="timetj" value="{date('Y-m-d',time())} 19:00" name="timetj" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})" readonly></li>
-<li><span>确 定</span></li>
-</ul>
-<div class="control zjcz">
-<div class="tabprint">
-快递面单:<select name="printer" class="select" style="width:220px;">
-<option value="">选择打印机</option>
-</select>
-发票:<select name="fp_printer" class="select" style="width:220px;">
-    <option value="">选择打印机</option>
-    </select>
-</div>
-<a href="javascript:void(0);" class="printing">打 印</a>
-<a href="javascript:void(0);" class="exceldy">导出Excel</a>
-</div>
-<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 = "/systemprinttest/";var fdataurl = "/systemprinttest/";
-var sysprint = 1;
-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");
-});}
-window.onload = function() { 
-    if(typeof $("select[name='printer']").length < 1) return;
-    setTimeout(function(){ wprinter.printer()},1000);
-    setTimeout(function(){
-        let h = $("select[name='printer']").html()
-        $("select[name='fp_printer']").html(h)
-    },1100)
-};
-
-</script>
-<script type="text/javascript" src="{$theme}js/laydate.js"></script>
-<script type="text/javascript" src="{$theme}js/print.js?v=20250207331"></script>
-{Template footer}