Commit b0d17eed by 朱继来

添加自营订单

parent c9daff4a
......@@ -226,6 +226,14 @@ Class OrderController extends Controller
// 订单列表
public function orderList(Request $request)
{
$info = $this->getOrderInfo($request, 1);
return view('orderlist', $info);
}
// 获取页面及订单信息 tid为订单类型:1.联营 2. 自营
public function getOrderInfo($request, $tid)
{
$info = $this->getPageInfo($request);
$map = array();
......@@ -269,6 +277,8 @@ Class OrderController extends Controller
$map['vp_time_set'] = strtotime(Config('website.vp_time_set')); // 竞调账号根据时间展示订单
}
$map['order_goods_type'] = $tid;
// 获取所有的业务员 (包括经理和交易员)
// $sale_list = $this->getSales('销售');
$perm = new PermController;
......@@ -299,7 +309,7 @@ Class OrderController extends Controller
$info['count'] = $response['data']['count'];
$info['page'] = $show;
return view('orderlist', $info);
return $info;
}
// erp订单
......@@ -362,6 +372,14 @@ Class OrderController extends Controller
return view('erpOrder', $info);
}
// 自营订单
public function selfOrder(Request $request)
{
$info = $this->getOrderInfo($request, 2);
return view('selfOrder', $info);
}
// 获取对应部门人员
public function getSales($title='')
{
......
......@@ -59,7 +59,7 @@ Route::group(['middleware' => 'web'], function () {
Route::get('/count', 'OrderCountController@count');
Route::get('/amount', 'OrderCountController@amount');
Route::get('/self_order', 'OrderCountController@selfOrder');
Route::get('/self_order', 'OrderController@selfOrder');
});
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单管理后台 | 订单列表</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script>
@include('orderlist.css')
@include('orderlist.js')
</head>
<body class="">
<div id="wrapper">
<!-- layouts.navigation -->
@include('layouts.navigation')
<div id="page-wrapper" class="gray-bg">
<div class="row">
@include('selfOrder.content')
</div>
</div>
</div>
</body>
<div class="wrapper wrapper-content">
<div class="page-content">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">平台订单</a></li>
</ul>
<div class="tabs-box">
<div class="row-fluid search-box">
<div class="span12">
<!-- <form action="{{URL('list')}}" method="get"> -->
<dl>
<dt>查询类型:</dt>
<dd style="width:auto !important;">
<div class="droplist" data-default="{{$condition['order_type']}}" id="order_type" name="order_type">
<ul class="dropdown-menu">
<li class="order_type_tab active" data-val="">会员账号</li>
<li class="order_type_tab" data-val="1">订单编号</li>
<li class="order_type_tab" data-val="2">型号名称</li>
</ul>
</div>
</dd>
<dd><input type="text" name="order_contain" value="{{$condition['order_contain']}}" placeholder="请输入内容"></dd>
</dl>
<dl>
<dt>创建日期: </dt>
<dd>
<input type="text" name="time_start" value="{{ !empty($condition['time_start']) ? date('Y/m/d', $condition['time_start']) : '' }}" class="Wdate " onfocus="WdatePicker({dateFmt:'yyyy/MM/dd'})" placeholder="开始时间"/>
</dd>
<dd>
<input type="text" name="time_end" value="{{ !empty($condition['time_end']) ? date('Y/m/d', $condition['time_end']) : '' }}" class="Wdate " onfocus="WdatePicker({dateFmt:'yyyy/MM/dd'})" placeholder="结束时间"/>
</dd>
</dl>
<!-- <dl>
<dt>订单类型:</dt>
<dd>
<div class="droplist" data-default="{{$condition['order_type_a']}}" id="order_type_a" name="order_type_a" >
<ul class="dropdown-menu">
<li data-val="" class="active">全部</li>
<li data-val="1">网站</li>
<li data-val="2">ERP</li>
</ul>
</div>
</dd>
</dl> -->
<dl>
<dt>付款类型:</dt>
<dd>
<div class="droplist" data-default="{{$condition['order_pay_type']}}" id="order_pay_type" name="order_pay_type" >
<ul class="dropdown-menu">
<li data-val="" class="active">全部</li>
<li data-val="1">全款</li>
<li data-val="2">预付款</li>
<!-- <li data-val="3">账期付款</li> -->
</ul>
</div>
</dd>
</dl>
<dl>
<dt>订单状态:</dt>
<dd>
<div class="droplist" data-default="{{$condition['order_status']}}" id="order_status" name="order_status">
<ul class="dropdown-menu">
<li data-val="" class="active">全部</li>
<li data-val="-1">已取消</li>
<li data-val="1">待审核</li>
<li data-val="2">待付款</li>
<li data-val="3">待付尾款</li>
<li data-val="4">待发货</li>
<li data-val="7">部分发货</li>
<li data-val="8">待收货</li>
<li data-val="10">交易成功</li>
</ul>
</div>
</dd>
</dl>
<dl>
<dt>配送方式:</dt>
<dd>
<div class="droplist" data-default="{{$condition['shipping_name']}}" id="shipping_name" name="shipping_name" >
<ul class="dropdown-menu">
<li data-val="" class="active">全部</li>
<li data-val="1">快递配送</li>
<li data-val="2">自提</li>
</ul>
</div>
</dd>
</dl>
<dl>
<dt>推送业务员:</dt>
<dd>
<div class="droplist" data-default="{{$condition['order_send']}}" id="order_send" name="order_send" >
<ul class="dropdown-menu">
<li data-val="" class="active">全部</li>
@foreach ($sale_list as $v)
<li data-val="{{$v->userId}}">{{$v->name}}</li>
@endforeach
</ul>
</div>
</dd>
</dl>
<!-- <dl>
<dt>支付状态:</dt>
<dd>
<div class="droplist" data-default="{$condition['order_pay_status']}" id="order_pay_status" name="order_pay_status" >
<ul class="dropdown-menu">
<li data-val="" class="active">全部</li>
<li data-val="1">已支付</li>
<li data-val="2">已付定金</li>
<li data-val="3">未支付</li>
</ul>
</div>
</dd>
</dl> -->
<dl>
<dt>订单来源:</dt>
<dd>
<div class="droplist" data-default="{{$condition['order_source_pf']}}" id="order_source_pf" name="order_source_pf">
<ul class="dropdown-menu">
<li data-val="" class="active">全部</li>
<li data-val="1">PC端</li>
<li data-val="2">移动端</li>
</ul>
</div>
</dd>
</dl>
<dl>
<dt>adtag来源:</dt>
<dd>
<input type="text" name="order_source_adtag" value="{{$condition['order_source_adtag']}}" placeholder="请输入内容">
</dd>
</dl>
<dl>
<dt>同步状态:</dt>
<dd>
<div class="droplist" data-default="{{$condition['erp_order_id']}}" id="erp_order_id" name="erp_order_id">
<ul class="dropdown-menu">
<li data-val="" class="active">全部</li>
<li data-val="1">已同步</li>
</ul>
</div>
</dd>
</dl>
@if (in_array('check_test_order', $userPerms))
<dl>
<dt></dt>
<dd>
<input type="checkbox" name="test_order"> 所有订单-包括测试
</dd>
</dl>
@endif
<dl>
<dt>
<button type="submit" class="nbtn searchOrder">搜索</button>
</dt>
</dl>
<!-- </form> -->
@if (in_array('export', $userPerms))
<div class="order-export">
<a href="javascript:;" class="btn btn-primary exportExcel">导出Excel</a>
</div>
@endif
</div>
</div>
</div>
<div class="row-fluid">
<table class="table table-hover">
<thead>
<tr>
<th class="pl30">会员账号</th>
<th class="pl30">应付金额</th>
<th class="pl30">订单状态</th>
<th class="pl30">订单类型</th>
<th class="pl30">支付方式</th>
<th class="pl30">推送业务员</th>
<th class="pl30">发货状态</th>
<th class="pl30">同步状态</th>
<th class="pl30">下单时间</th>
<th class="pl30">操作</th>
</tr>
</thead>
@if (empty($list))
<tr>
<td colspan="10">没有查询到相关记录~</td>
</tr>
@else
<tbody>
@foreach ($list as $v)
<tr>
<td class="show-list">{{$v['mobile'] ? $v['mobile'] : $v['email']}}</td>
<td class="show-list">
<?php
$currencySign = $v['currency'] == 1 ? '¥' : '$';
echo $currencySign.$v['order_amount'];
?>
</td>
<td class="show-list">
<?php
switch ($v['status']) {
case -2: echo '<span class="list-text-no-check"><b>审核未通过</b></span>';break;
case -1: echo '<span class="list-text-cancel"><b>已取消</b></span>';break;
case 1: echo '<span class="list-text-checking"><b>待审核</b></span>';break;
case 2: echo '<span class="list-text-pay"><b>待付款</b></span>';break;
case 3: echo '<span class="list-text-last-pay"><b>待付尾款</b></span>';break;
case 4: echo '<span class="list-text-send"><b>待发货</b></span>';break;
case 7: echo '<span class="list-text-send"><b>部分发货</b></span>';break;
case 8: echo '<span class="list-text-confirm"><b>待收货</b></span>';break;
case 10: echo '<span class="list-text-success"><b>交易成功</b></span>';break;
}
?>
</td>
<td class="show-list">
<?php
switch ($v['order_pay_type']) {
case 1: echo "全款";break;
case 2: echo "预付款";break;
case 3: echo "账期";break;
}
?>
</td>
<td class="show-list"><?php print_r(App\Http\Controllers\getPayName($v['order_id'])); ?></td>
<td class="show-list">
<?php
foreach ($sale_list as $val) {
if ($val->userId == $v['sale_id']) {
echo $val->name;
}
}
?>
</td>
<td class="show-list" class="show-list">
<?php
$shipping = App\Http\Controllers\getShipping($v['order_id']);
$shippingStatus = '';
$shippingNo = '';
if ($shipping) {
foreach ($shipping as $s) {
switch ($s->status) {
case 0:
case 1: $shippingStatus .= '已配送, '; break;
case 2: $shippingStatus .= '已签收, '; break;
default: $shippingStatus .= '未配送, '; break;
}
$shippingNo .= $s->shipping_no ? $s->shipping_no.', ' : '';
}
$shippingStatus = substr($shippingStatus, 0, -2);
}
echo $shippingStatus;
?>
</td>
<td class="show-list">
<?php
if (in_array($v['status'], [-1, 1, 2])) {
echo '不需同步';
} else {
echo $v['erp_order_id'] ? '<span class="list-text-success"><b>已同步</b></span>' : '<span class="list-text-checking"><b>未同步</b></span>';
}
?>
</td>
<td class="show-list">{{$username != 'vpadmin@ichunt.com' ? date('Y-m-d H:i:s', $v['create_time']) : date('Y-m-d', $v['create_time'])}}</td>
<td>
<div class="btn-group btn-group-xs">
<a class="btn btn-primary" href="{{URL('details', ['order_id'=>$v['order_id']])}}" target="_blank">详情</a>
<!-- 管理员和经理显示 $role = 1 || 2 -->
@if (in_array('check_order', $userPerms))
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$v['order_id']])}}" target="_blank">人工审单</a>
@endif
</div>
</td>
</tr>
<!-- 点击展示内容 -->
<tr class="show-other-content">
<td colspan="10">
<table class="table table-hover table-bordered">
<tr>
<td class="table-list-title">订单编号</td>
<td class="table-list-content">{{$v['order_sn']}}</td>
<td class="table-list-title">公司名称</td>
<td class="table-list-content">
<p class="show-title" title="{{App\Http\Controllers\getCompanyName($v['user_id'])}}">{{App\Http\Controllers\getCompanyName($v['user_id'])}}</p>
</td>
</tr>
@if ($v['order_pay_type'] == 2)
<tr>
<td class="table-list-title">预付款</td>
<td class="table-list-content">{{$currencySign.$v['advance_amount']}}</td>
<td class="table-list-title">尾款</td>
<td class="table-list-content">{{$currencySign.number_format($v['order_amount'] - $v['advance_amount'], 2, '.', '')}}</td>
</tr>
@endif
<tr>
<td class="table-list-title">支付时间</td>
<td class="table-list-content">
<?php
if ($v['order_pay_time'] != 0) {
if ($username != 'vpadmin@ichunt.com') {
echo date('Y-m-d H:i:s', $v['order_pay_time']);
} else {
echo date('Y-m-d', $v['order_pay_time']);
}
} else {
if ($v['advance_pay_time'] != 0) {
if ($username != 'vpadmin@ichunt.com') {
echo date('Y-m-d H:i:s', $v['advance_pay_time']);
} else {
echo date('Y-m-d', $v['advance_pay_time']);
}
} else {
echo '';
}
}
?>
</td>
<td class="table-list-title">发票状态</td>
<td class="table-list-content">
<?php
$invoice_status = App\Http\Controllers\getInvoiceStatus($v['order_id']);
if ($invoice_status) {
switch ($invoice_status) {
case -1: echo "待确认";break;
case 1: echo "已开票";break;
case 2: echo "已发货";break;
case 3: echo "已签收";break;
}
} else {
echo '';
}
?>
</td>
</tr>
<tr>
<td class="table-list-title">配送方式</td>
<td class="table-list-content">
@if ($v['order_shipping_type'] == '1')
快递配送
@else
自提
@endif
</td>
<td class="table-list-title">优惠金额</td>
<td class="table-list-content"><?php echo App\Http\Controllers\getCoupon($v['order_id']); ?></td>
</tr>
<tr>
<td class="table-list-title">快递单号</td>
<td class="table-list-content">{{$shippingNo ? substr($shippingNo, 0, -2) : ''}}</td>
<td class="table-list-title">Adtag或其它</td>
<td class="table-list-content">
<p class="show-title" title="{{$v['order_source']}}">{{$v['order_source']}}</p>
</td>
</tr>
</table>
</td>
</tr>
@endforeach
</tbody>
@endif
</table>
</div>
<div class="row-fluid pagination">
<span>
共{{$count ? $count : 0}}单,
应付金额 ¥{{$pay_count['rmb_count'] ? $pay_count['rmb_count'] : 0}}, ${{$pay_count['usd_count'] ? $pay_count['usd_count'] : 0}},
实收金额 ¥{{$pay_count['rmb_pay'] ? $pay_count['rmb_pay'] : 0}},
${{$pay_count['usd_pay'] ? $pay_count['usd_pay'] : 0}}
</span>
<?php echo $page; ?>
</div>
<div class="hide" id="sale-container">
<div class="sales">
<table class="table">
<tr>
<td>终端</td>
<td>
<table>
<tr>
<label><input type="radio" name="UserID" value="ZJF">郑家锋</label>
<label><input type="radio" name="UserID" value="LZY">李智勇</label>
<label><input type="radio" name="UserID" value="HXJ">黄小洁</label>
<label><input type="radio" name="UserID" value="PXB">潘小兵</label>
<label><input type="radio" name="UserID" value="LCW">赖朝武</label>
</tr>
</table>
<table>
<tr>
<label><input type="radio" name="UserID" value="XQ">肖琼</label>
<label><input type="radio" name="UserID" value="YYQ">杨永清</label>
<label><input type="radio" name="UserID" value="PW">彭伟</label>
<label><input type="radio" name="UserID" value="WHB">王海波</label>
<label><input type="radio" name="UserID" value="FAD">费安冬</label>
</tr>
</table>
<table>
<tr>
<label><input type="radio" name="UserID" value="HWQ">胡伟泉</label>
<label><input type="radio" name="UserID" value="CWB">陈文斌</label>
</tr>
</table>
</td>
</tr>
<tr>
<td>代购组</td>
<td>
<table>
<tr>
<label><input type="radio" name="UserID" value="ZXZ">朱小忠</label>
<label><input type="radio" name="UserID" value="HQM">韩琴妹</label>
<label><input type="radio" name="UserID" value="WXX">翁晓旋</label>
<label><input type="radio" name="UserID" value="LW">刘威</label>
</tr>
</table>
</td>
</tr>
<tr>
<td>电销组</td>
<td>
<table>
<tr>
<label><input type="radio" name="UserID" value="HCJ">何翠娟</label>
<label><input type="radio" name="UserID" value="WZH">吴志华</label>
<label><input type="radio" name="UserID" value="LDP">卢冬平</label>
<label><input type="radio" name="UserID" value="GW">高伟</label>
<label><input type="radio" name="UserID" value="HYQ">胡雁群</label>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<script>
var test_order = "{{$condition['test_order']}}";
if (test_order) {
$('input[name=test_order]').attr('checked', true);
}
$.lie.order.index();
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment