Commit 6ec8f2ca by 朱继来

Merge branch 'zjl_self_refund_20190605'

parents 6913840d 310e1932
......@@ -15,6 +15,7 @@ use Excel;
use App\Model\OrderModel;
use App\Model\UserMainModel;
use App\Model\OrderActionLogModel;
use App\Model\OrderReturnModel;
// 获取订单优惠券金额
function getCoupon($order_id)
......@@ -997,7 +998,7 @@ Class OrderController extends Controller
return view('detail', $info);
}
// 退货退款
// 联营退货退款
public function refund(Request $request, $id)
{
if ($request->isMethod('post'))
......@@ -1039,6 +1040,95 @@ Class OrderController extends Controller
return view('detail', $info);
}
// 自营退货申请
public function orderReturn(Request $request, $id)
{
if ($request->isMethod('post')) {
$data['order_id'] = $id;
$data['return_info'] = $request->input('return_info');
$data['return_items_info'] = $request->input('return_items_info');
$data['operator_id'] = $request->user->userId;
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'return/returnGoods';
$temp = json_decode(curlApi($url, $data, 'POST'), true);
return array('errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']);
}
$info = $this->orderDetail($request, $id);
$this->pageHeader($request, $info, '退货申请', ["title" => '退货申请', "href" => '#']);
// 未发货明细
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['order_id'] = $id;
$url = Config('website.api_domain').'removal/getRemovalItems';
$res = json_decode(curlApi($url, $data, 'POST'), true);
if ($res['err_code'] != 0) return redirect('/prompt')->with(['message'=>'退货无法操作,原因:'.$res['err_msg'], 'url' =>$_SERVER['HTTP_REFERER'], 'jumpTime'=>3,'status'=>false]);
$info['removalItems'] = $res['data'];
return view('detail', $info);
}
// 退货申请编辑
public function orderReturnEdit(Request $request, $id)
{
if ($request->isMethod('post')) {
$data['return_id'] = $request->input('return_id');
$data['return_info'] = $request->input('return_info');
$data['return_items_info'] = $request->input('return_items_info');
$data['operator_id'] = $request->user->userId;
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'return/editReturnGoods';
$temp = json_decode(curlApi($url, $data, 'POST'), true);
return array('errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']);
}
$info = $this->orderDetail($request, $id);
$this->pageHeader($request, $info, '编辑退货申请', ["title" => '编辑退货申请', "href" => '#']);
$return_id = $request->input('return_id', '');
$redirect_url = $info['order_info']['order_goods_type'] == 1 ? '/return_list' : '/self_return_list';
if (!$return_id) return redirect($redirect_url);
$OrderReturnModel = new OrderReturnModel();
$info['return'] = $OrderReturnModel->find($return_id);
$info['returnItems'] = $OrderReturnModel->find($return_id)->hasManyReturnItems;
if (!in_array($info['return']['status'], [-2, 1])) return redirect('/prompt')->with(['message'=>'status为'.$info['return']['status'].',无法编辑退货单', 'url' =>$redirect_url, 'jumpTime'=>3,'status'=>false]);
// 补充退货明细
foreach ($info['returnItems'] as $k=>&$v) {
$map = array();
$map['order_id'] = $v['order_id'];
$map['rec_id'] = $v['rec_id'];
$map['goods_id'] = $v['goods_id'];
// 获取出库数量
$removal = DB::connection('order')->table('lie_removal_items')->where($map)->select('removal_number')->first();
$v['removal_number'] = $removal ? $removal->removal_number : 0;
// 获取已申请退货数量
$v['already_return_num'] = DB::connection('order')->table('lie_order_return_items')->where($map)->sum('return_num');
}
return view('detail', $info);
}
//订单物流信息
public function changeShipping(Request $request, $id='')
{
......@@ -1249,7 +1339,9 @@ Class OrderController extends Controller
$mobile = isset($temp['data']['order_info']['user_info']['msg_mobile']) ? $temp['data']['order_info']['user_info']['msg_mobile'] : '';
if (!$mobile) {
$mobile = isset($temp['data']['order_info']['user_info']['mobile']) ? $temp['data']['order_info']['user_info']['mobile'] : '';
// $mobile = isset($temp['data']['order_info']['user_info']['mobile']) ? $temp['data']['order_info']['user_info']['mobile'] : '';
$user = DB::connection('order')->table('lie_user_main')->where('user_id', $temp['data']['order_info']['user_id'])->select('mobile')->first();
$mobile = $user ? $user->mobile : '';
}
// 获取操作记录
......
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Model\OrderModel;
use App\Model\OrderReturnModel;
use App\Model\OrderReturnItemsModel;
use DB;
use App\Http\Page;
use App\Model\UserMainModel;
// 获取支付名称
function getPayName($order_id)
{
$payLog = DB::connection('order')
->table('lie_pay_log')
->where(['order_id' => $order_id])
->select('pay_name')
->get();
if (!empty($payLog)) {
foreach ($payLog as $v) {
$payName[] = $v->pay_name;
}
return implode(',', $payName);
}
return false;
}
// 获取物流名称
function getShippingName($shipping_id)
{
$shipping = DB::connection('order')->table('lie_shipping')->where('shipping_id', $shipping_id)->select('shipping_name')->first();
return $shipping ? $shipping->shipping_name : '';
}
class ReturnController extends Controller
{
// 页面用户、菜单信息
public function getPageInfo(Request $request)
{
$uri = '/' . $request->path();
if ($request->path() == '/') $uri = '/list';
$username = $request->user->email;
$useremail= $request->user->email;
// 菜单
$menuconfig = DB::table('config')->where('config_title', '订单系统')->first();
$menus = [];
if ($menuconfig && !($menus = json_decode($menuconfig->config_data)))
$menus = [];
$perm = new PermController;
// 用户角色
$role = $perm->getUserRole($request);
// 获取权限菜单
if ($role != 1) {
$menus = $perm->getPermMenu($menus, $request->user->userId);
}
$userPerms = $perm->getUserAllPerms($request->user->userId, $role); // 用户权限
$data = [
'header' => $request->user->header,
'uri' => $uri,
'username' => $username,
'useremail' => $useremail,
'menus' => $menus,
'userPerms' => $userPerms,
'role' => $role,
];
return $data;
}
// 联营退货列表
public function jointReturnList(Request $request)
{
$info = $this->ReturnList($request, 1);
return view('returnlist', $info);
}
// 自营退货列表
public function selfReturnList(Request $request)
{
$info = $this->returnList($request, 2);
return view('returnlist', $info);
}
// 退货申请列表
public function returnList(Request $request, $type)
{
$info = $this->getPageInfo($request);
$info['title'] = $type == 1 ? '联营退货申请列表' : '自营退货申请列表';
$map['order_sn'] = $request->input('order_sn', '');
$map['sku_name'] = $request->input('sku_name', '');
$map['order_payment_mode'] = $request->input('order_payment_mode', '');
$map['apply_status'] = $request->input('apply_status', '');
$map['time_start'] = $request->input('time_start', '');
$map['time_end'] = $request->input('time_end', '');
$map['order_goods_type'] = $type; // 类型
//获取订单列表
$url = Config('website.api_domain').'return/getReturnList';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['p'] = $request->input('p', 1); // 当前页码
$data['size'] = 10; // 当前页条数
$data['map'] = $map;
$response = json_decode(curlApi($url, $data), true);
// 分页
$page = new Page($response['data']['count'], 10);
$page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
$show = $page->show();
// 获取配送方式
$shippings = DB::connection('order')->table('lie_shipping')->get();
$ship_type = [];
foreach ($shippings as $k => $v) {
$ship_type[$v->shipping_id] = $v->shipping_name;
}
$info['shippings'] = $ship_type;
$info['condition'] = $map;
$info['list'] = $response['data']['data'];
$info['count'] = $response['data']['count'];
$info['page'] = $show;
return $info;
}
// 联营退货单导出
public function returnExport(Request $request)
{
$ReturnModel = new OrderReturnModel();
return $ReturnModel->export($request);
}
// 自营退货单导出
public function selfReturnExport(Request $request)
{
$ReturnModel = new OrderReturnModel();
return $ReturnModel->export($request);
}
// 退货详情
public function returnDetails(Request $request, $id)
{
$info = $this->getPageInfo($request);
$OrderReturnModel = new OrderReturnModel();
$info['return'] = $OrderReturnModel->find($id);
$info['returnItems'] = $OrderReturnModel->find($id)->hasManyReturnItems;
$info['returnLog'] = $OrderReturnModel->find($id)->hasManyReturnLog;
if ($info['return']['order_goods_type'] == 1) {
$title = '联营订单';
$return_url = '/return_list';
} else {
$title = '自营订单';
$return_url = '/self_return_list';
}
$info['title'] = '订单退货详情';
$info['paths'] = [["title" => $title, "href" => '#'], ["title" => '退货申请列表', "href" => $return_url], ["title" => '订单退货详情', "href" => '#']];
return view('returnDetails', $info);
}
// 退货单审核
public function returnCheck(Request $request)
{
if ($request->isMethod('post')) {
$OrderReturnModel = new OrderReturnModel();
return $OrderReturnModel->check($request);
}
}
// 退货物流信息
public function returnShipping(Request $request)
{
if ($request->isMethod('post')) {
$OrderReturnModel = new OrderReturnModel();
return $OrderReturnModel->shipping($request);
}
}
}
......@@ -122,6 +122,16 @@ Route::group(['middleware' => 'web'], function () {
Route::post('/ajax/offlinePaid', 'OrderController@offlinePaid');
Route::post('/ajax/editContract', 'OrderController@editContract');
Route::match(['get', 'post'], '/return/{id}', 'OrderController@orderReturn');
Route::get('/self_return_list', 'ReturnController@selfReturnList');
Route::get('/return_details/{id}', 'ReturnController@returnDetails');
Route::post('/ajax/returnCheck', 'ReturnController@returnCheck');
Route::post('/ajax/returnShipping', 'ReturnController@returnShipping');
Route::get('/self_return_export', 'ReturnController@selfReturnExport');
Route::match(['get', 'post'], '/return_edit/{id}', 'OrderController@orderReturnEdit');
});
// 不需要登陆态
......
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class CmsModel extends Model
{
protected $table = 'user_info';
protected $primaryKey = 'userId';
public $timestamps = false;
// 获取用户名称
public function getUserName($userId)
{
$user = $this->where(['userId' => $userId])->select('name')->first();
return $user ? $user->name : '';
}
}
\ No newline at end of file
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class OrderReturnItemsModel extends Model
{
protected $connection = 'order';
protected $table = 'lie_order_return_items';
protected $primaryKey = 'return_items_id';
public $timestamps = false;
}
\ No newline at end of file
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class OrderReturnLogModel extends Model
{
protected $connection = 'order';
protected $table = 'lie_order_return_log';
protected $primaryKey = 'return_log_id';
public $timestamps = false;
/**
* 创建退货记录
* @param [type] $return_id [退货单ID]
* @param [type] $operator_id [操作人ID]
* @param [type] $event [操作事件]
*/
public function addLog($return_id, $operator_id, $event)
{
$operator = DB::table('user_info')->where('userId', $operator_id)->select('name')->first(); // 操作人名称
$return_log['return_id'] = $return_id;
$return_log['operator_id'] = $operator_id;
$return_log['operator_name'] = $operator->name;
$return_log['event'] = $event;
$return_log['ip'] = get_client_ip(0, true);
$return_log['create_time'] = time();
return $this->insert($return_log);
}
}
\ No newline at end of file
......@@ -76,4 +76,14 @@
'test_mobile' => [
'15989573440',
],
// 退货状态
'return_status' => [
-2 => '驳回',
-1 => '取消',
1 => '待审核',
2 => '审核通过',
7 => '待收货',
10 => '已完成',
],
];
\ No newline at end of file
(function($) {
var printAreaCount = 0;
$.fn.printArea = function() {
var ele = $(this);
var idPrefix = "printArea_";
removePrintArea(idPrefix + printAreaCount);
printAreaCount++;
var iframeId = idPrefix + printAreaCount;
var iframeStyle = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;';
iframe = document.createElement('IFRAME');
$(iframe).attr({
style: iframeStyle,
id: iframeId
});
document.body.appendChild(iframe);
var doc = iframe.contentWindow.document;
$(document).find("link").filter(function() {
return $(this).attr("rel").toLowerCase() == "stylesheet";
}).each(
function() {
// 这里是在将网页中的所有css引入,即打印区域的css如果是link进来的,可以设置在网页的任何位置
doc.write('<link type="text/css" rel="stylesheet" href="' + $(this).attr("href") + '" >');
});
doc.write($(ele).prop('outerHTML')); // 将待打印元素原封不动的引入
doc.close();
var frameWindow = iframe.contentWindow;
frameWindow.close();
frameWindow.focus();
// 必须等待frame加载完成后再打印,否则可能在某些浏览器中打印不出东西。
frameWindow.onload = function() {
frameWindow.print();
};
}
var removePrintArea = function(id) {
$("iframe#" + id).remove();
};
})(jQuery);
\ No newline at end of file
......@@ -481,8 +481,13 @@
<th>采购数量</th>
<th>采购单价</th>
@elseif ($username != 'vpadmin@ichunt.com')
<th>采购数量</th>
<th>采购单价</th>
@if ($order_info['order_goods_type'] == 2)
<th>购买数量</th>
<th>购买时单价</th>
@else
<th>采购数量</th>
<th>采购单价</th>
@endif
<th>均摊后单价</th>
@else
<th>商品数量</th>
......@@ -721,9 +726,19 @@
@endif
@if ($action_name == 'refund')
<!--自营对账-->
<!--退货申请-->
@include('detail.refund')
@endif
@if ($action_name == 'orderReturn')
<!--退货申请-->
@include('detail.return')
@endif
@if ($action_name == 'orderReturnEdit')
<!--编辑退货申请-->
@include('detail.return_edit')
@endif
<!-- 人工审单时去掉操作按钮 -->
@if (!isset($_REQUEST['tags']) && $action_name != 'changeOrder' && $action_name != 'sendSales')
......@@ -792,6 +807,10 @@
@if ($order_info['status'] == 4 && in_array('self_order_express', $userPerms))
<!-- <a class="btn btn-default self_express" href="javascript:;" data-id="{{$order_info['order_id']}}">填写快递单</a> -->
@endif
@if (in_array($order_info['status'], [7, 8, 10]) && in_array('self_order_refund', $userPerms))
<a href="/return/{{$order_info['order_id']}}?tags=self" class="btn btn-info order_refund">退货申请</a>
@endif
<!-- 订单状态大于4,且处于开票状态,且存在权限 -->
@if ($order_info['status'] >= 4 && $order_invoice_info['inv_type'] > 1 && in_array('self_order_invoice_express', $userPerms))
......
<style>
.bank-input{
width: 400px !important;
}
</style>
<p style="padding-left: 5px;">退货申请</p>
<div class="tabs-box">
<div class="order-change-main">
<form id="returnForm" class="form-horizontal table-responsive">
<input type="hidden" name="return_info[order_id]" value="{{$order_info['order_id']}}">
<input type="hidden" name="return_info[order_sn]" value="{{$order_info['order_sn']}}">
<input type="hidden" name="return_info[user_id]" value="{{$order_info['user_id']}}">
<input type="hidden" class="order_goods_type" name="return_info[order_goods_type]" value="{{$order_info['order_goods_type']}}">
<input type="hidden" name="return_info[currency]" value="{{$order_info['currency']}}">
<input type="hidden" name="return_info[mobile]" value="{{isset($user_info['mobile']) ? $user_info['mobile'] : $user_mobile}}">
<input type="hidden" name="return_info[email]" value="{{isset($user_info['email']) ? $user_info['email'] : ''}}">
<input type="hidden" name="return_info[company_name]" value="{{ isset($company_info['com_name']) ? $company_info['com_name'] : '' }}">
<input type="hidden" name="return_info[pay_amount]" value="{{ $order_info['order_amount'] + $order_price_info['pay_preferential'] }}">
<input type="hidden" name="pay_id" value="{{$order_pay_log[0]['pay_id']}}">
<!-- 退货方式 -->
<table class="table table-bordered table-hover">
<tr>
<th width="20%">退货方式</th>
<td>
<label style="margin-right: 20px;"><input type="radio" class="return_way" name="return_info[return_way]" value="1">快递寄送</label>
<label><input type="radio" class="return_way" name="return_info[return_way]" value="2">自送</label>
</td>
</tr>
</table>
<!-- 退货型号 -->
<p>退货型号</p>
<table class="table table-bordered table-hover return-table">
<thead>
<!-- <th width="7%"><input type="checkbox" class="all-select" >全选</th> -->
<th width="20%">供应商</th>
<th>型号</th>
<th>出库数量</th>
<th>均摊后单价(包含支付优惠)</th>
<th>退货数量</th>
<th width="10%">小计</th>
<th>已申请数量</th>
</thead>
<tbody>
@foreach ($removalItems as $v)
<tr>
<input type="hidden" name="return_items_info[{{$v['rec_id']}}][brand_id]" value="{{ $v['brand_id'] }}">
<input type="hidden" name="return_items_info[{{$v['rec_id']}}][brand_name]" value="{{ $v['brand_name'] }}">
<td>
<input type="hidden" name="return_items_info[{{$v['rec_id']}}][supplier_id]" value="{{ $v['supplier_id'] }}">
<input type="hidden" name="return_items_info[{{$v['rec_id']}}][supplier_name]" value="{{ $v['supplier_name'] }}">
<span>{{$v['supplier_name']}}</span>
</td>
<td>
<input type="hidden" name="return_items_info[{{$v['rec_id']}}][goods_id]" value="{{ $v['goods_id'] }}">
<input type="hidden" name="return_items_info[{{$v['rec_id']}}][goods_name]" value="{{ $v['goods_name'] }}">
<span>{{$v['goods_name']}}</span>
</td>
<td>
<input type="hidden" class="removal_number" name="removal_number" value="{{ $v['removal_number'] }}">
<span>{{$v['removal_number']}}</span>
</td>
<td>
<input type="hidden" name="return_items_info[{{$v['rec_id']}}][single_price]" class="single_pre_price" value="{{ $v['single_pre_price'] }}">
<span>{{$v['single_pre_price']}}</span>
</td>
<td>
<input class="only_number int_num return_num" name="return_items_info[{{$v['rec_id']}}][return_num]" value="">
</td>
<td>
<span class="single_return_amount"></span>
</td>
<td><span>{{ $v['already_return_num'] }}</span></td>
</tr>
@endforeach
</tbody>
</table>
<hr/>
<table class="table table-bordered table-hover">
<tr>
<th width="20%">支付金额</th>
<td>
<p class="text-danger">{{$currency}}<span class="total">{{ $order_info['order_amount'] + $order_price_info['pay_preferential'] }}</span></p>
</td>
</tr>
<tr>
<th>退款总额</th>
<td>
<input type="hidden" class="return_amount" name="return_info[return_amount]" value="">
<span class="return_amount_val"></span>
</td>
</tr>
<tr>
<th>退货原因</th>
<td>
<input type="hidden" class="refund_reason" name="return_info[return_reason]" value="">
<a href="javascript:;" class="btn btn-default input-cancel-reason" data-oid="{{$order_info['order_id']}}" data-type="5">点击选择</a>
<span class="refund_reason_val"></span>
</td>
</tr>
<tr>
<th>退款账号(线下转账必填)</th>
<td><input type="text" name="return_info[bank_account]" class="bank-input bank_account" value="" placeholder="请填写银行账号"></td>
</tr>
<tr>
<th>退款银行名称(线下转账必填)</th>
<td><input type="text" name="return_info[bank_name]" class="bank-input bank_name" value="" placeholder="请填写银行名称"></td>
</tr>
<tr>
<th>退款支行名称(线下转账必填)</th>
<td><input type="text" name="return_info[bank_sub_name]" class="bank-input bank_sub_name" value="" placeholder="请填写支行名称"></td>
</tr>
<tr>
<th>开户人名称(线下转账必填)</th>
<td><input type="text" name="return_info[bank_user]" class="bank-input bank_user" value="" placeholder="请填写开户人名称"></td>
</tr>
</table>
<a class="btn btn-primary returnApply">提交申请</a>
</form>
</div>
</div>
<script>
var currency_sign = "{{$currency}}";
$.lie.refund.refund();
</script>
\ No newline at end of file
<style>
.bank-input{
width: 400px !important;
}
</style>
<p style="padding-left: 5px;">编辑退货申请</p>
<div class="tabs-box">
<div class="order-change-main">
<form id="returnForm" class="form-horizontal table-responsive">
<input type="hidden" class="return_id" name="return_id" value="{{$return['return_id']}}">
<input type="hidden" class="order_goods_type" name="order_goods_type" value="{{$return['order_goods_type']}}">
<input type="hidden" name="pay_id" value="{{$order_pay_log[0]['pay_id']}}">
<!-- 退货方式 -->
<table class="table table-bordered table-hover">
<tr>
<th width="20%">退货方式</th>
<td>
<label style="margin-right: 20px;"><input type="radio" class="return_way" name="return_info[return_way]" value="1">快递寄送</label>
<label><input type="radio" class="return_way" name="return_info[return_way]" value="2">自送</label>
</td>
</tr>
</table>
<!-- 退货型号 -->
<p>退货型号</p>
<table class="table table-bordered table-hover return-table">
<thead>
<th width="20%">供应商</th>
<th>型号</th>
<th>出库数量</th>
<th>均摊后单价</th>
<th>退货数量</th>
<th width="10%">小计</th>
<th>已申请数量</th>
</thead>
<tbody>
@foreach ($returnItems as $v)
<tr>
<td>
<span>{{$v['supplier_name']}}</span>
</td>
<td>
<span>{{$v['goods_name']}}</span>
</td>
<td>
<input type="hidden" class="removal_number" name="removal_number" value="{{ $v['removal_number'] }}">
<span>{{$v['removal_number']}}</span>
</td>
<td>
<input type="hidden" name="return_items_info[{{$v['return_items_id']}}][single_price]" class="single_pre_price" value="{{ $v['single_price'] }}">
<span>{{$v['single_price']}}</span>
</td>
<td>
<input class="only_number int_num return_num" name="return_items_info[{{$v['return_items_id']}}][return_num]" value="{{$v['return_num']}}">
</td>
<td>
<span class="single_return_amount">{{ $v['single_price'] * $v['return_num'] }}</span>
</td>
<td><span>{{ $v['already_return_num'] }}</span></td>
</tr>
@endforeach
</tbody>
</table>
<hr/>
<table class="table table-bordered table-hover">
<tr>
<th width="20%">支付金额</th>
<td>
<p class="text-danger">{{$currency}}<span class="total">{{ $return['pay_amount'] }}</span></p>
</td>
</tr>
<tr>
<th>退款总额</th>
<td>
<input type="hidden" class="return_amount" name="return_info[return_amount]" value="{{ $return['return_amount'] }}">
<span class="return_amount_val">{{ $currency.$return['return_amount'] }}</span>
</td>
</tr>
<tr>
<th>退货原因</th>
<td>
<input type="hidden" class="refund_reason" name="return_info[return_reason]" value="{{ $return['return_reason'] }}">
<a href="javascript:;" class="btn btn-default input-cancel-reason" data-oid="{{$order_info['order_id']}}" data-type="5">点击选择</a>
<span class="refund_reason_val">{{ $return['return_reason'] }}</span>
</td>
</tr>
<tr>
<th>退款账号(线下转账必填)</th>
<td><input type="text" name="return_info[bank_account]" class="bank-input bank_account" value="{{ $return['bank_account'] }}" placeholder="请填写银行账号"></td>
</tr>
<tr>
<th>退款银行名称(线下转账必填)</th>
<td><input type="text" name="return_info[bank_name]" class="bank-input bank_name" value="{{ $return['bank_name'] }}" placeholder="请填写银行名称"></td>
</tr>
<tr>
<th>退款支行名称(线下转账必填)</th>
<td><input type="text" name="return_info[bank_sub_name]" class="bank-input bank_sub_name" value="{{ $return['bank_sub_name'] }}" placeholder="请填写支行名称"></td>
</tr>
<tr>
<th>开户人名称(线下转账必填)</th>
<td><input type="text" name="return_info[bank_user]" class="bank-input bank_user" value="{{ $return['bank_user'] }}" placeholder="请填写开户人名称"></td>
</tr>
</table>
<a class="btn btn-primary returnApply">提交申请</a>
</form>
</div>
</div>
<script>
var currency_sign = "{{$currency}}";
// 选中退货方式
var return_way = "{{$return['return_way']}}";
$('.return_way[value='+return_way+']').prop('checked', true);
$.lie.refund.refund();
</script>
\ No newline at end of file
<div class="row wrapper border-bottom white-bg page-heading">
<a class="navbar-minimalize minimalize-styl-2 btn btn-primary pull-left" style="margin-left:0px;margin-top:18px;" href="#"><i class="fa fa-bars"></i> </a>
<div class="col-lg-10 side-section" style="padding-left:0px;">
<h2>{{ $title }}</h2>
<h2 style="margin-top: 20px !important; margin-bottom: 10px !important;">{{ $title }}</h2>
<ol class="breadcrumb">
@if (!empty($paths))
@for ($i = 0; $i < count($paths); $i++)
......
......@@ -8,7 +8,9 @@
<script src="/js/inspinia.min.js"></script>
<script src="/js/common.js"></script>
<script src="/js/layui/layui.js"></script>
<script src="/js/order.js?v=<?= time() ?>"></script>
<script src="/js/orderamount.js"></script>
<script src="/js/plugins/DatePicker/WdatePicker.js"></script>
<script src="/js/refund.js"></script>
<script src="/js/refund.js?v=<?= time() ?>"></script>
......@@ -8,6 +8,7 @@
@include('orderlist.css')
@include('orderlist.js')
<link href="/js/layui/css/layui.css" rel="stylesheet">
</head>
<body class="">
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单管理后台 | {{$title}}</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script>
@include('orderlist.css')
@include('orderlist.js')
<link href="/js/layui/css/layui.css" rel="stylesheet">
</head>
<body class="">
<div id="wrapper">
<!-- layouts.navigation -->
<?php $isPage = false; ?>
@include('layouts.navigation')
<div id="page-wrapper" class="gray-bg">
<div class="row">
@include('returnDetails.content')
</div>
</div>
</div>
</body>
<div class="wrapper">
@include('layouts.header')
<div class="page-content">
<div class="tabs-box table-responsive">
<div class="layui-row">
<a href="javascript:;" class="btn btn-info return-print" style="float: right; margin-right: 20px;">打印预览</a>
</div>
<div id="return-info" style="padding: 30px 10px;">
<style>
.return-content{ margin:20px auto; width: 1000px; }
.return-content label, .return-content span{ font-size: 14px; }
.return-content label { width: 140px; font-weight: 600; }
.return-content span { line-height: 38px; }
.return-items{ margin-top: 20px; }
.return-items tr.active, .return-items .return-items-first-tr th{ background: #23c6c8 !important; }
</style>
<div class="layui-row">
<h2 class="text-center">深圳猎芯科技有限公司退货单详情</h2>
</div>
<div class="layui-row">
<span style="float: right; margin-right: 20px;">退货单号:{{ $return['return_sn'] }}</span>
</div>
<!-- 退货单信息 -->
<div class="return-content">
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">订单编号:</label>
<span class="layui-text">{{ $return['order_sn'] }}</span>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">会员账号:</label>
<span class="layui-text">{{ $return['mobile'] ? $return['mobile'] : $return['email'] }}</span>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">退货申请时间:</label>
<span class="layui-text">{{ date('Y-m-d H:i:s', $return['create_time']) }}</span>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">公司名称:</label>
<span class="layui-text">{{ $return['company_name'] }}</span>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">支付金额:</label>
<span class="layui-text">{{ $return['pay_amount'] }}</span>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">支付方式:</label>
<span class="layui-text">{{ $return['mobile'] }}</span>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">退款金额:</label>
<span class="layui-text">{{ $return['return_amount'] }}</span>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">银行账号:</label>
<span class="layui-text">{{ $return['bank_account'] }}</span>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">退货原因:</label>
<span class="layui-text">{{ $return['return_reason'] }}</span>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">银行名称:</label>
<span class="layui-text">{{ $return['bank_name'] }}</span>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">退货物流:</label>
<span class="layui-text">{{ App\Http\Controllers\getShippingName($return['shipping_id']) }}</span>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">支行名称:</label>
<span class="layui-text">{{ $return['bank_sub_name'] }}</span>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">物流单号:</label>
<span class="layui-text">{{ $return['shipping_sn'] }}</span>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<label class="layui-form-label">开户人:</label>
<span class="layui-text">{{ $return['bank_user'] }}</span>
</div>
</div>
</div>
<!-- 退货单明细 -->
<div class="return-items">
<h3 style="margin-bottom: 10px;">退货型号</h3>
<table class="table table-bordered">
<tr class="return-items-first-tr">
<th width="5%">序号</th>
<th>供应商</th>
<th>型号</th>
<th>均摊后单价</th>
<th>退货数量</th>
<th>小计</th>
</tr>
@foreach ($returnItems as $k=>$v)
<tr>
<td>{{ $k + 1 }}</td>
<td>{{ $v['supplier_name'] }}</td>
<td>{{ $v['goods_name'] }}</td>
<td>{{ $v['single_price'] }}</td>
<td>{{ $v['return_num'] }}</td>
<td>{{ $v['single_price'] * $v['return_num'] }}</td>
</tr>
@endforeach
</table>
</div>
</div>
<!-- 管理员、经理、自营客服主管审核 && 待审核状态 -->
@if (in_array($role, [1, 2, 10]) && $return['status'] == 1)
<div class="text-center" style="margin-bottom: 10px;">
<button class="btn btn-info return-check" style="margin-right: 10px;" data-type="2" data-id="{{ $return['return_id'] }}">审核通过</button>
<button class="btn btn-danger return-check" data-type="-2" data-id="{{ $return['return_id'] }}">驳回</button>
</div>
@endif
</div>
<p>操作记录</p>
<div class="tabs-box table-responsive">
<table class="table table-bordered">
<tr>
<th width="15%">操作时间</th>
<th width="10%">操作人</th>
<th>操作事件</th>
</tr>
@foreach ($returnLog as $log)
<tr>
<td>{{ date('Y-m-d H:i:s', $log['create_time']) }}</td>
<td>{{ $log['operator_name'] }}</td>
<td>{{ $log['event'] }}</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
<script src="/js/jquery.PrintArea.min.js"></script>
<script>
$.lie.refund.details();
</script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单管理后台 | {{ $title }}</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script>
@include('orderlist.css')
@include('orderlist.js')
</head>
<body class="">
<div id="wrapper">
@include('layouts.navigation')
<div id="page-wrapper" class="gray-bg">
<div class="row">
@include('returnlist.content')
</div>
</div>
</div>
</body>
<div class="wrapper">
@include('layouts.header')
<div class="page-content">
<div class="tabs-box">
<div class="row-fluid search-box">
<div class="span12">
<table style="width:100%">
<tr>
<td>
<dl>
<dt>订单编号:</dt>
<dd>
<input type="text" id="order_sn" name="order_sn" value="{{$condition['order_sn']}}" placeholder="请输入订单编号">
</dd>
</dl>
@if ($condition['order_goods_type'] == 1)
<dl>
<dt>SKU名称:</dt>
<dd>
<input type="text" id="sku_name" name="sku_name" value="{{$condition['sku_name']}}" placeholder="请输入SKU名称">
</dd>
</dl>
@endif
<dl>
<dt>支付方式:</dt>
<dd>
<select id="order_payment_mode" name="order_payment_mode" class="form-control order_payment_mode selectpicker" title="全部" multiple>
@if (Config('params.order_paid_name'))
@foreach (Config('params.order_paid_name') as $k=>$v)
<option value="{{$k}}">{{$v}}</option>
@endforeach
@endif
</select>
</dd>
</dl>
<dl>
<dt>处理状态:</dt>
<dd>
<select id="apply_status" name="apply_status" class="form-control apply_status selectpicker" title="全部" multiple>
@if (Config('perms.return_status'))
@foreach (Config('perms.return_status') as $k=>$v)
<option value="{{$k}}">{{$v}}</option>
@endforeach
@endif
</select>
</dd>
</dl>
<dl>
<dt>创建日期: </dt>
<dd style="width:auto !important;">
<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="开始时间" autocomplete="off" />
</dd>
<dd style="width:auto !important;">
<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="结束时间" autocomplete="off" />
</dd>
</dl>
</td>
</tr>
</table>
<div class="text-center" style="margin-top: 10px;">
<input type="hidden" name="order_goods_type" value="{{$condition['order_goods_type']}}">
<div class="search-btn">
<button class="nbtn search_return_order">搜索</button>
<button class="nbtn export_return_order" style="margin-left: 20px; background: #23c6c8 !important;">导出</button>
</div>
</div>
</div>
</div>
</div>
<div class="row-fluid table-responsive">
<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>
</tr>
</thead>
@if (empty($list))
<tr>
<td class="text-center" colspan="9">没有查询到相关记录~</td>
</tr>
@else
<tbody>
@foreach ($list as $v)
<tr>
<td class="show-list">{{$v['create_time'] ? date('Y-m-d H:i:s', $v['create_time']) : ''}}</td>
<td class="show-list">{{ $v['return_sn'] }}</td>
<td class="show-list">{{ $v['mobile'] ? $v['mobile'] : $v['email'] }}</td>
<td class="show-list">{{$v['order_sn']}}</td>
<?php
$currencySign = $v['currency'] == 1 ? '¥' : '$';
?>
<td class="show-list">{{$currencySign.$v['return_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-confirm"><b>审核通过</b></span>';break;
case 7: echo '<span class="list-text-send"><b>待收货</b></span>';break;
case 10: echo '<span class="list-text-success"><b>已完成</b></span>';break;
}
?>
</td>
<?php $pay_name = App\Http\Controllers\getPayName($v['order_id']); ?>
<td class="show-list"><?php print_r($pay_name); ?></td>
<td class="show-list">{{$v['audit_time'] ? date('Y-m-d H:i:s', $v['audit_time']) : ''}}</td>
<td>
<div class="btn-group btn-group-xs">
<a class="btn btn-primary" href="/return_details/{{$v['return_id']}}" target="_blank">查看申请</a>
<!-- 驳回和待审核 可编辑退货单 -->
@if (in_array($v['status'], [-2, 1]))
<a class="btn btn-info" href="/return_edit/{{$v['order_id']}}?return_id={{$v['return_id']}}" target="_blank">编辑</a>
@endif
<!-- 审核通过后填写物流信息 -->
@if ($v['status'] == 2)
<a class="btn btn-success return-shipping" href="javascript:;" data-id="{{$v['return_id']}}">填写物流</a>
@endif
</div>
</td>
</tr>
@endforeach
</tbody>
@endif
</table>
</div>
<div class="row-fluid pagination">
<?php echo $page; ?>
</div>
</div>
</div>
<script>
var shippings = '{!! json_encode($shippings) !!}';
var shippings_info = eval('('+shippings+')');
var apply_status = "{{$condition['apply_status']}}";
var order_payment_mode = "{{$condition['order_payment_mode']}}";
$(".apply_status, .order_payment_mode").selectpicker({
actionsBox:true, //在下拉选项添加选中所有和取消选中的按钮
countSelectedText:"已选中{0}项",
selectedTextFormat:"count > 5",
selectAllText: '全选',
deselectAllText: '取消全选',
})
$('.apply_status').selectpicker('val', apply_status.split(',')).trigger("change");
$('.order_payment_mode').selectpicker('val', order_payment_mode.split(',')).trigger("change");
$.lie.refund.index_new();
</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