瀏覽代碼

提交数据

lvhao 4 月之前
父節點
當前提交
102bec81a4
共有 2 個文件被更改,包括 285 次插入0 次删除
  1. 164 0
      core/CoreApp/controllers/Whlabel.php
  2. 121 0
      template/erp/whlabel_aoutorder.html

+ 164 - 0
core/CoreApp/controllers/Whlabel.php

@@ -11,6 +11,7 @@ class Whlabel extends Start_Controller
 		$this->load->_model('Model_excel', 'excel');
 		$this->load->_model('Model_excel', 'excel');
 		$this->load->_model('Model_fullorder', 'fullorder');
 		$this->load->_model('Model_fullorder', 'fullorder');
 		$this->load->_model('Model_fullordertt', 'fullordertt');
 		$this->load->_model('Model_fullordertt', 'fullordertt');
+		$this->load->_model('Model_fullorderamz', 'fullorderamz');
 		$this->load->_model('Model_fullorder_smt', 'fullorder_smt');
 		$this->load->_model('Model_fullorder_smt', 'fullorder_smt');
 		$this->load->_model('Model_fullordersmt', 'fullordersmt');
 		$this->load->_model('Model_fullordersmt', 'fullordersmt');
 		$this->load->_model('Model_express', 'express');
 		$this->load->_model('Model_express', 'express');
@@ -92,6 +93,9 @@ class Whlabel extends Start_Controller
 		} else if ($arg == 'toutorder') //TT出库订单
 		} else if ($arg == 'toutorder') //TT出库订单
 		{
 		{
 			$this->_toutorder();
 			$this->_toutorder();
+		}else if ($arg == 'aoutorder') //amz出库订单
+		{
+			$this->_aoutorder();
 		} else if ($arg == 'retreat') //退库订单
 		} else if ($arg == 'retreat') //退库订单
 		{
 		{
 			$this->_retreat();
 			$this->_retreat();
@@ -2704,6 +2708,166 @@ class Whlabel extends Start_Controller
 		$this->_Template('whlabel_toutorder', $this->data);
 		$this->_Template('whlabel_toutorder', $this->data);
 	}
 	}
 
 
+	//tt出库
+	public function _aoutorder()
+	{
+		if (isset($_SESSION['api'])) {
+			$user = $this->user->get_api($_SESSION['api']);
+			$usp = $user;
+			$fgshop = "";
+			$sid = "";
+			$user = explode('|', trim($user['shop'], '|'));
+			foreach ($user as $value) {
+				$fgshop .= " shop = " . $value . " or";
+				$sid .= " id = " . $value . " or";
+			}
+		} else {
+			echo "请重新登录";
+		}
+		$post = $this->input->post(NULL, TRUE);
+		if (isset($post['page'])) {
+			$page = $this->input->post('page', true);
+			$perpage = $this->input->post('perpage', true);
+			$warehouse = $this->input->post('warehouse', true);
+			$xztime = $this->input->post('xztime', true);
+			$timetk = $this->input->post('timetkk', true);
+			$timetj = $this->input->post('timetjj', true);
+			$shop = $this->input->post('shop', true);
+			$source = $this->input->post('source', true);
+			$orderinfo = $this->input->post('orderinfo', true);
+			$number = $this->input->post('number', true);
+			$sfxh = $this->input->post('sfxh', true);
+			$express = $this->input->post('express', true);
+			$waybill = $this->input->post('waybill', true);
+			$library = $this->input->post('library', true);
+			$country = $this->input->post('country', true);
+			$so = $this->input->post('so', true);
+			$libraryconfirm = $this->input->post('libraryconfirm', true);
+			$print = $this->input->post('print', true);
+			$state = $this->input->post('state', true);
+			$orderurl = $this->input->post('orderurl', true);
+			$timetk = strtotime($timetk);
+			$timetj = strtotime($timetj);
+			/**
+			$sj = $this->input->post('sj',true);
+			if($sj)
+			{
+				$sj = $this->input->post('sj',true);
+			}
+			else
+			{
+				$sj = "fullorder";
+			}
+			 **/
+			$sj = "fullorderamz";
+			$where = "1=1";
+			if ($warehouse) {
+				$where  .= " and type = '$warehouse'";
+			}
+			if ($timetk && $timetj) {
+				$where .= " and " . $xztime . " > '$timetk' and " . $xztime . " < '$timetj'";
+			}
+			if ($orderinfo) {
+				$where  .= " and orderinfo = '$orderinfo'";
+			}
+			if ($number) {
+				$where  .= " and number = '$number'";
+			}
+			if ($express) {
+				$where  .= " and express = '$express'";
+			}
+			if ($waybill) {
+				$where  .= " and waybill = '$waybill'";
+			}
+			if ($library) {
+				$where  .= " and library = '$library'";
+			}
+			if ($print) {
+				$where  .= " and print = '$print'";
+			}
+			if ($libraryconfirm) {
+				$where .= " and libraryconfirm = '$libraryconfirm'";
+			}
+			if ($state) {
+				$where .= " and state = '$state'";
+			}
+			if ($shop) {
+				$where .= " and shop = '$shop'";
+			}
+			if ($country) {
+				$where .= " and country = '$country'";
+			}
+			if ($sfxh != '') {
+				$where .= " and sfxh = '$sfxh'";
+			}
+			if ($so) {
+				$where  .= " and shipremarks like '%$so%'";
+			}
+			if ($source) {
+				if ($source == '2d') {
+					$where  .= " and source >= '2'";
+				} else {
+					$where  .= " and source = '$source'";
+				}
+			}
+			if (isset($_SESSION['api'])) {
+				foreach ($user as $value) {
+					$fgshop .= " shop = " . $value . " or";
+				}
+				$where .= " and (" . rtrim($fgshop, 'or') . ")";
+			}
+			if ($orderurl) {
+				$url = $this->orderurl->read($orderurl);
+				$where  .= " and link like '%" . $url['url'] . "%'";
+			}
+			//数据排序
+			$order_str = "librarytime desc";
+			if (empty($page)) {
+				$start = 0;
+				$perpage = 1;
+			} else {
+				$start = ($page - 1) * $perpage;
+			}
+			//取得信息列表
+			$info_list = $this->$sj->find_all($where, 'id,shop,type,orderinfo,number,waybill,express,librarytime', $order_str, $start, $perpage);
+			//格式化数据
+			foreach ($info_list as $key => $value) {
+				$shop = $this->shop->read($value['shop']);
+				$info_list[$key]['shop'] = $shop['shopname'];
+				$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['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>';
+				}
+			}
+			$total = $this->$sj->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->data['express'] = $this->express->find_all();
+		$wlshop = $this->shop->find_all('1=1 and ' . rtrim($sid, 'or'));
+		$this->data['wlshop'] = $wlshop;
+		$user = $this->user->get_api($_SESSION['api']);
+		$powerid = $this->power->read($user['power']);
+		$powertext = explode('|', trim($powerid['excelid'], '|'));
+		$pid = '';
+		foreach ($powertext as $v) {
+			$pid .= " id = " . $v . " or";
+		}
+		$fullorderexcel = $this->fullorderexcel->find_all("type = '100009' and (" . rtrim($pid, 'or') . ")", '*', 'idorder desc'); //导出模板
+		$this->data['fullorderexcel'] = $fullorderexcel;
+		$orderurl = $this->orderurl->find_all(rtrim($fgshop, 'or'));
+		$this->data['orderurl'] = $orderurl;
+		$this->_Template('whlabel_aoutorder', $this->data);
+	}
+
 	//速卖通出库订单
 	//速卖通出库订单
 	public function _soutorder()
 	public function _soutorder()
 	{
 	{

+ 121 - 0
template/erp/whlabel_aoutorder.html

@@ -0,0 +1,121 @@
+{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>搜索品名:<input value="" name="so" type="text" ></li>
+<li>
+订单类型:<select name="source" class="select" style="width:90px">
+<option value="">请选择</option>
+<option value="1">线下订单</option>
+<option value="2d">店内订单</option>
+</select>
+</li>
+<li>订单状态:<select name="state" class="select">
+<option value="">请选择</option>
+{loop typeclass(29,2) as $val}
+<option value="{$val['id']}">{$val['spare']}</option>
+{/loop}
+<option value="283">null</option>
+</select>
+</li>
+<li>
+发货仓库:<select name="warehouse" class="select">
+<option value="">请选择</option>
+{loop warehouse(100) as $val}
+<option value="{$val['id']}">{$val['title']}</option>
+{/loop}</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="print" class="select">
+<option value="">请选择</option>
+<option value="1">不可打印</option>
+<option value="2">未打印</option>
+<option value="3">已打印</option>
+</select></li>
+<li>出库状态:<select name="library" class="select">
+<option value="">请选择</option>
+<option value="2">已出库</option>
+<option value="1">未出库</option>
+<option value="3">已退库</option>
+</select></li>
+<li>出库确认:<select name="libraryconfirm" class="select">
+<option value="0">请选择</option>
+<option value="2">允许出库</option>
+<option value="1">不允许出库</option>
+</select></li>
+<li>是否现货:<select name="sfxh" class="select">
+<option value="">请选择</option>
+<option value="1">现货</option>
+<option value="0">非现货</option>
+</select></li>
+<li>收货国家:<select name="country" class="select">
+<option value="">请选择</option>
+{loop country(500) as $val}
+<option value="{$val['id']}">{$val['name']}</option>
+{/loop}</select></li>
+<li>产品链接:<select name="orderurl" class="select">
+<option value="">请选择</option>
+{loop $orderurl as $val}
+<option value="{$val['id']}">{$val['url']}</option>
+{/loop}</select></li>
+<li>选择时间条件:<select name="xztime" class="select">
+<option value="librarytime">出库时间</option>
+<option value="printtime">打印时间</option>
+<option value="reviewtime">审核时间</option>
+<option value="dtime">订单时间</option>
+<option value="retreattime">退库时间</option>
+</select></li>
+<li><input id="timetk"  value="{date('Y-m-d',time()-24*3600)} 17:00" name="timetkk" type="text" onclick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})">
+至&nbsp;&nbsp;&nbsp;&nbsp; <input id="timetj" value="{date('Y-m-d',time())} 17:00" name="timetjj" type="text" onclick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"></li>
+<li><span>确 定</span></li> 
+</ul>
+<div class="control">
+<select name="fexcel" class="dcmb">
+<option value="">选择导出模板</option>
+{loop $fullorderexcel as $val}
+<option value="{$val['id']}">{$val['title']}</option>
+{/loop}</select>
+</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>
+</tr>
+</table>
+</div>
+<table class="datatext data" border="0" style="border-collapse:collapse;">
+</table>
+<div class="bomf"></div>
+</div>
+<script>
+var dataurl = "/whlabel/aoutorder/";var fdataurl = "/whlabel/";var excel = "/fullorderexcel/excel/";
+var customon = 1;
+function custom(){
+$(".data tr").each(function() {
+$(this).find('td:eq(5)').css("width","9%");
+$(this).find('td:eq(9)').css("width","6%");
+$(this).find('td:eq(15)').css("width","6%");
+$(this).find('td:eq(17)').css("width","95px");
+});}
+</script>
+<script type="text/javascript" src="{$theme}js/laydate.js"></script>
+{Template footer}