Commit c465c8a1 by 朱继来

退货申请

parent df38f740
...@@ -982,7 +982,7 @@ Class OrderController extends Controller ...@@ -982,7 +982,7 @@ Class OrderController extends Controller
return view('detail', $info); return view('detail', $info);
} }
// 退货退款 // 联营退货退款
public function refund(Request $request, $id) public function refund(Request $request, $id)
{ {
if ($request->isMethod('post')) if ($request->isMethod('post'))
...@@ -1024,6 +1024,45 @@ Class OrderController extends Controller ...@@ -1024,6 +1024,45 @@ Class OrderController extends Controller
return view('detail', $info); 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 changeShipping(Request $request, $id='') public function changeShipping(Request $request, $id='')
{ {
...@@ -1234,7 +1273,9 @@ Class OrderController extends Controller ...@@ -1234,7 +1273,9 @@ Class OrderController extends Controller
$mobile = isset($temp['data']['order_info']['user_info']['msg_mobile']) ? $temp['data']['order_info']['user_info']['msg_mobile'] : ''; $mobile = isset($temp['data']['order_info']['user_info']['msg_mobile']) ? $temp['data']['order_info']['user_info']['msg_mobile'] : '';
if (!$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 : '';
} }
// 获取操作记录 // 获取操作记录
...@@ -1244,6 +1285,7 @@ Class OrderController extends Controller ...@@ -1244,6 +1285,7 @@ Class OrderController extends Controller
'user_mobile' => $mobile, 'user_mobile' => $mobile,
'order_info' => $temp['data']['order_info'], 'order_info' => $temp['data']['order_info'],
'user_info' => $temp['data']['order_info']['user_info'], 'user_info' => $temp['data']['order_info']['user_info'],
'company_info' => $temp['data']['order_info']['company_info'],
'order_invoice_info' => $temp['data']['order_invoice_info'], 'order_invoice_info' => $temp['data']['order_invoice_info'],
'order_items_info' => $temp['data']['order_items_info'], 'order_items_info' => $temp['data']['order_items_info'],
'order_address_info' => $temp['data']['order_address_info'], 'order_address_info' => $temp['data']['order_address_info'],
......
...@@ -88,6 +88,8 @@ ...@@ -88,6 +88,8 @@
return 8; return 8;
} else if ($department->name == '财务') { } else if ($department->name == '财务') {
return 9; return 9;
} else if ($department->name == '自营客服主管') {
return 10;
} else { } else {
return 0; return 0;
} }
......
<?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();
$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->jointExport($request);
}
// 自营退款导出
public function returnSelfExport(Request $request)
{
$ReturnModel = new OrderReturnModel();
return $ReturnModel->selfExport($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);
}
}
...@@ -122,6 +122,11 @@ Route::group(['middleware' => 'web'], function () { ...@@ -122,6 +122,11 @@ Route::group(['middleware' => 'web'], function () {
Route::post('/ajax/offlinePaid', 'OrderController@offlinePaid'); Route::post('/ajax/offlinePaid', 'OrderController@offlinePaid');
Route::post('/ajax/editContract', 'OrderController@editContract'); 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');
}); });
// 不需要登陆态 // 不需要登陆态
......
<?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;
}
\ No newline at end of file
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Redis;
use Request;
use Excel;
use DB;
class OrderReturnModel extends Model
{
protected $connection = 'order';
protected $table = 'lie_order_return';
protected $primaryKey = 'return_id';
public $timestamps = false;
// 获取退货单明细
public function hasManyReturnItems()
{
return $this->hasMany('App\Model\OrderReturnItemsModel', 'return_id', 'return_id');
}
// 获取退货单记录
public function hasManyReturnLog()
{
return $this->hasMany('App\Model\OrderReturnLogModel', 'return_id', 'return_id');
}
// 联营订单导出
public function jointExport($request)
{
set_time_limit(0);
ini_set('memory_limit', '512M');
$map = array();
// 页面参数
$map['order_sn'] = $request->input('order_sn', '');
$map['sku_name'] = $request->input('sku_name', '');
$map['time_start'] = $request->input('time_start', '');
$map['time_end'] = $request->input('time_end', '');
$map['apply_status'] = $request->input('apply_status', '');
$map['order_payment_mode'] = $request->input('order_payment_mode', '');
$list = $this->from('lie_order_refund_items as it')
->leftJoin('lie_order_refund as r', function($join) {
$join->on('it.refund_id', '=', 'r.refund_id')->where('r.refund_type', '=', 2)->where('r.order_goods_type', '=', 1);
})
->leftJoin('lie_pay_log as p', 'r.order_id', '=', 'p.order_id')
->leftJoin('lie_user_main as u', 'r.user_id', '=', 'u.user_id')
->where(function ($query) use ($map) {
// 订单编号
if (!empty($map['order_sn'])) {
$query->where('r.order_sn', '=', $map['order_sn']);
}
})
->where(function ($query) use ($map) {
// sku名称
if (!empty($map['sku_name'])) {
$query->where('it.sku_name', '=', $map['sku_name']);
}
})
->where(function ($query) use ($map) {
// 创建时间
if (!empty($map['time_start']) && !empty($map['time_end'])) {
$query->whereBetween('r.create_time', [$map['time_start'], $map['time_end']]);
} else if (!empty($map['time_start'])) {
$query->where('r.create_time', '>', $map['time_start']);
} else if (!empty($map['time_end'])) {
$query->where('r.create_time', '<', $map['time_end']);
}
})
->where(function ($query) use ($map) {
// 订单状态
if (!empty($map['apply_status'])) {
$query->whereIn('r.status', explode(',', $map['apply_status']));
}
})
->where(function ($query) use ($map) {
// 支付方式
if (!empty($map['order_payment_mode'])) {
$pay_name = explode(',', $map['order_payment_mode']);
$order_payment_mode = [];
foreach ($pay_name as $v) {
switch ($v) {
case '1': $order_payment_mode[] = '微信支付';break;
case '2': $order_payment_mode[] = '支付宝';break;
case '3': $order_payment_mode[] = '银联支付(B2B)';break;
case '4': $order_payment_mode[] = '银联支付(B2C)';break;
case '5': $order_payment_mode[] = '账期支付';break;
case '6': $order_payment_mode[] = '京东支付';break;
case '7': $order_payment_mode[] = '交通银行';break;
case '8': $order_payment_mode[] = '恒生银行';break;
case '9': $order_payment_mode[] = '钱包支付';break;
}
}
$query->whereIn('p.pay_name', $order_payment_mode);
}
})
->select('it.refund_rec_id', 'it.refund_id', 'it.rec_id', 'it.goods_id', 'it.goods_name', 'it.brand_id', 'it.brand_name', 'it.supplier_id', 'it.supplier_name', 'it.sku_name', 'it.goods_price', 'it.single_pre_price', 'it.refund_num', 'r.order_id', 'r.order_sn', 'r.order_goods_type', 'r.currency', 'r.pay_amount', 'r.price_fall', 'r.create_uid', 'r.status', 'r.refund_reason', 'r.create_time', 'r.refund_time', 'u.mobile', 'u.email')
->groupBy('it.refund_rec_id')
->orderBy('r.create_time', 'DESC')
->get()
->toArray();
if (!empty($list)) {
// 订单数据处理
$cellData = $this->exportList($list);
// 标题
$headerCell = ['订单ID', '订单编号', '会员账号', '商品型号', '制造商', '供应商', '币种', '退货数量', '原始单价', '均摊后单价', '小计', '退货总额', '手动差价', '实际退货总额', '退货原因', '后台操作人', '创建时间', '退货处理状态', '退货处理时间'];
array_unshift($cellData, $headerCell);
$fileName = '联营退货订单导出'.date('_YmdHis');
Excel::create($fileName, function($excel) use ($cellData){
$excel->sheet('退货订单导出', function($sheet) use ($cellData){
$sheet->rows($cellData);
});
})->export('xls');
} else {
return redirect('/prompt')->with(['message'=>"数据为空无法导出!",'url'=>$_SERVER['HTTP_REFERER'], 'jumpTime'=>3,'status'=>false]);
}
}
/**
* 导出数据处理
* @param [type] $order [查询出的订单数据]
* @return [type] [description]
*/
public function exportList($order)
{
// 订单类型
$apply_status = array(
'-1' => '已拒绝',
'1' => '待处理',
'10' => '已处理',
);
$tmp = array();
for ($i = 0; $i < count($order); $i++) {
// 推送人
if ($order[$i]['create_uid']) {
$sales = DB::table('user_info')->where(['userId' => $order[$i]['create_uid']])->select('name')->first();
}
$tmp[$i]['order_id'] = $order[$i]['order_id'];
$tmp[$i]['order_sn'] = "\t".$order[$i]['order_sn']."\t";
$tmp[$i]['user_account'] = $order[$i]['mobile'] ? $order[$i]['mobile'] : $order[$i]['email'];
// 自营商品名称换成商品型号
$tmp[$i]['goods_name'] = $order[$i]['order_goods_type'] == 1 ? $order[$i]['goods_name'] : $this->getGoodsName($order[$i]['goods_id']);
$tmp[$i]['brand_name'] = $order[$i]['brand_name'];
$tmp[$i]['supplier_name'] = $order[$i]['supplier_name'];
$tmp[$i]['currency'] = $order[$i]['currency'] == 1 ? 'RMB' : 'USD';
$tmp[$i]['refund_num'] = $order[$i]['refund_num'];
$tmp[$i]['goods_price'] = $order[$i]['goods_price'];
$tmp[$i]['single_pre_price'] = $order[$i]['single_pre_price'];
$tmp[$i]['goods_amount'] = $order[$i]['refund_num'] * $order[$i]['single_pre_price'];
if ($i > 0 && $tmp[$i]['order_id'] == $tmp[$i-1]['order_id']) {
$tmp[$i]['pay_amount'] = $order[$i]['pay_amount'];
$tmp[$i]['price_fall'] = $order[$i]['price_fall'];
$tmp[$i]['final_amount'] = $order[$i]['pay_amount'] - $order[$i]['price_fall'];
} else {
$tmp[$i]['pay_amount'] = '';
$tmp[$i]['price_fall'] = '';
$tmp[$i]['final_amount'] = '';
}
$tmp[$i]['refund_reason'] = $order[$i]['refund_reason'];
$tmp[$i]['sale_name'] = isset($sales) ? $sales->name : ''; // 推送业务员
$tmp[$i]['create_time'] = date('Y-m-d H:i:s', $order[$i]['create_time']);
$tmp[$i]['status'] = $apply_status[$order[$i]['status']];
$tmp[$i]['refund_time'] = $order[$i]['refund_time'] ? date('Y-m-d H:i:s', $order[$i]['refund_time']) : '';
unset($sales);
}
return $tmp;
}
// 获取自营商品型号
public function getGoodsName($goods_id)
{
$goods_info = json_decode(Redis::hget('Self_SelfGoods', $goods_id), true);
return $goods_info['goods_name'];
}
// 自营订单导出
public function selfExport($request)
{
set_time_limit(0);
ini_set('memory_limit', '512M');
$map = array();
// 页面参数
$map['order_sn'] = $request->input('order_sn', '');
$map['time_start'] = $request->input('time_start', '');
$map['time_end'] = $request->input('time_end', '');
$map['apply_status'] = $request->input('apply_status', '');
$map['order_payment_mode'] = $request->input('order_payment_mode', '');
$list = $this->from('lie_order_refund as r')
->leftJoin('lie_pay_log as p', 'r.order_id', '=', 'p.order_id')
->leftJoin('lie_user_main as u', 'r.user_id', '=', 'u.user_id')
->where('r.refund_type', '=', 1)
->where('r.order_goods_type', '=', 2)
->where(function ($query) use ($map) {
// 订单编号
if (!empty($map['order_sn'])) {
$query->where('r.order_sn', '=', $map['order_sn']);
}
})
->where(function ($query) use ($map) {
// 创建时间
if (!empty($map['time_start']) && !empty($map['time_end'])) {
$query->whereBetween('r.create_time', [$map['time_start'], $map['time_end']]);
} else if (!empty($map['time_start'])) {
$query->where('r.create_time', '>', $map['time_start']);
} else if (!empty($map['time_end'])) {
$query->where('r.create_time', '<', $map['time_end']);
}
})
->where(function ($query) use ($map) {
// 订单状态
if (!empty($map['apply_status'])) {
$query->whereIn('r.status', explode(',', $map['apply_status']));
}
})
->where(function ($query) use ($map) {
// 支付方式
if (!empty($map['order_payment_mode'])) {
$pay_name = explode(',', $map['order_payment_mode']);
$order_payment_mode = [];
foreach ($pay_name as $v) {
switch ($v) {
case '1': $order_payment_mode[] = '微信支付';break;
case '2': $order_payment_mode[] = '支付宝';break;
case '3': $order_payment_mode[] = '银联支付(B2B)';break;
case '4': $order_payment_mode[] = '银联支付(B2C)';break;
case '5': $order_payment_mode[] = '账期支付';break;
case '6': $order_payment_mode[] = '京东支付';break;
case '7': $order_payment_mode[] = '交通银行';break;
case '8': $order_payment_mode[] = '恒生银行';break;
case '9': $order_payment_mode[] = '钱包支付';break;
}
}
$query->whereIn('p.pay_name', $order_payment_mode);
}
})
->select('r.order_id', 'r.order_sn', 'r.order_goods_type', 'r.currency', 'r.pay_amount', 'r.price_fall', 'r.create_uid', 'r.status', 'r.refund_reason', 'r.create_time', 'r.refund_time', 'u.mobile', 'u.email')
->orderBy('r.create_time', 'DESC')
->get()
->toArray();
if (!empty($list)) {
// 订单数据处理
$cellData = $this->selfExportList($list);
// 标题
$headerCell = ['订单ID', '订单编号', '会员账号', '退货原因', '后台操作人', '创建时间', '退货处理状态', '退货处理时间'];
array_unshift($cellData, $headerCell);
$fileName = '自营退货订单导出'.date('_YmdHis');
Excel::create($fileName, function($excel) use ($cellData){
$excel->sheet('退货订单导出', function($sheet) use ($cellData){
$sheet->rows($cellData);
});
})->export('xls');
} else {
return redirect('/prompt')->with(['message'=>"数据为空无法导出!",'url'=>$_SERVER['HTTP_REFERER'], 'jumpTime'=>3,'status'=>false]);
}
}
/**
* 导出数据处理
* @param [type] $order [查询出的订单数据]
* @return [type] [description]
*/
public function selfExportList($order)
{
// 订单类型
$apply_status = array(
'-1' => '已拒绝',
'1' => '待处理',
'10' => '已处理',
);
$tmp = array();
for ($i = 0; $i < count($order); $i++) {
// 推送人
if ($order[$i]['create_uid']) {
$sales = DB::table('user_info')->where(['userId' => $order[$i]['create_uid']])->select('name')->first();
}
$tmp[$i]['order_id'] = $order[$i]['order_id'];
$tmp[$i]['order_sn'] = "\t".$order[$i]['order_sn']."\t";
$tmp[$i]['user_account'] = $order[$i]['mobile'] ? $order[$i]['mobile'] : $order[$i]['email'];
$tmp[$i]['refund_reason'] = $order[$i]['refund_reason'];
$tmp[$i]['sale_name'] = isset($sales) ? $sales->name : ''; // 推送业务员
$tmp[$i]['create_time'] = date('Y-m-d H:i:s', $order[$i]['create_time']);
$tmp[$i]['status'] = $apply_status[$order[$i]['status']];
$tmp[$i]['refund_time'] = $order[$i]['refund_time'] ? date('Y-m-d H:i:s', $order[$i]['refund_time']) : '';
unset($sales);
}
return $tmp;
}
}
\ No newline at end of file
...@@ -76,4 +76,14 @@ ...@@ -76,4 +76,14 @@
'test_mobile' => [ 'test_mobile' => [
'15989573440', '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
...@@ -190,7 +190,191 @@ ...@@ -190,7 +190,191 @@
}) })
}) })
},
refund:function() {
// 正整数输入框限制
$('.int_num').off().on('keyup', function(){
var val = $(this).val();
if(!val) return false;
if (!(/^[1-9]\d*$/g.test(val))) {
layer.msg('只能是正整数');
$(this).val('');
}
if($(this).val().length > 9){
$(this).val($(this).val().slice(0, 9));
}
});
// 填写退货数量
$('.return_num').keyup(function() {
var removal_number = parseInt($(this).parents('tr').find('.removal_number').val()); // 出库数量
var single_pre_price = parseFloat($(this).parents('tr').find('.single_pre_price').val()); // 均摊单价
var val = $(this).val(); // 退货数量
if (val > removal_number) {
layer.msg('不能超过出库数量');
$(this).val('');
}
// 退款小计
var single_amount = parseFloat(single_pre_price * val).toFixed(4);
$(this).parents('tr').find('.single_return_amount').text(currency_sign + single_amount);
// 退款总额
var return_total = 0;
$('.return-table').find('tbody tr').each(function(){
var num = parseInt($(this).find('.return_num').val()) || 0;
var price = parseFloat($(this).find('.single_pre_price').val()) || 0;
return_total += parseFloat(num * price);
});
return_total = return_total.toFixed(2);
$('.return_amount').val(return_total);
$('.return_amount_val').text(currency_sign + return_total);
})
// 提交表单
$('.returnApply').click(function() {
var return_way = $('.return_way:checked').val();
var goods_count = 0; // 商品数量
var return_eq_true = []; // 退货数量与出库数量相等
var return_empty = []; // 退货数量为空
// 判断是否选择退货方式
if (return_way == null) {
layer.msg('请选择退货方式');
return false;
}
// 表单退货数量
$('.return-table').find('tbody tr').each(function(){
var num = parseInt($(this).find('.return_num').val());
var removal_number = parseInt($(this).find('.removal_number').val());
// 为空标记
if (!num) return_empty.push(0);
// 数量等于出库数量标记
if (num == removal_number) return_eq_true.push(1);
goods_count++;
});
if (return_empty.length == goods_count) {
layer.msg('请填写退货数量');
return false;
}
if (return_eq_true.length == goods_count) {
layer.msg('不能选择全部退货数量,请检查数量');
return false;
}
var order_id = $('input[name=order_id]').val();
var refund_reason = $('.refund_reason').val();
if (!refund_reason) {
layer.msg('请选择退货原因');
return false;
}
var pay_id = $('input[name=pay_id]').val();
// 若为线下转账,则银行信息必填
if (pay_id == 0) {
var bank_account = $('.bank_account').val();
var bank_name = $('.bank_name').val();
var bank_sub_name = $('.bank_sub_name').val();
var bank_user = $('.bank_user').val();
if(!bank_account || !bank_name || !bank_sub_name || !bank_user) {
layer.msg('订单为线下转账,银行信息必填');
return false;
}
}
var order_goods_type = $('.order_goods_type').val();
if (order_goods_type == 1) {
var url = '/return_list';
} else {
var url = '/self_return_list';
}
layer.open({
title: '提示信息',
content: '确认提交退货申请?',
btn: ['确认', '取消'],
yes: function(index, layero){
$.ajax({
url : '/return/' + order_id,
type: 'post',
data: $('#returnForm').serialize(),
dataType: 'json',
success: function (resp) {
if(resp.errcode === 0){
layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){
location.href = url; // 退货列表
}, 1000);
} else {
layer.alert(resp.errmsg || '网络异常');
}
},
error: function (res) {
console.log(res);
}
})
},
btn2: function(index, layero){
layer.close(index);
}
});
})
},
details:function() {
// 打印退货单
$('.return-print').click(function() {
console.log(11)
$('#return-info').printArea();
})
// 审核通过 / 驳回
$('.return-check').click(function() {
var return_id = $(this).data('id');
var type = $(this).data('type');
var title = '';
var content = '';
if (type == 1) { // 审核通过
title = '审核退货单';
content = '确定审核通过吗?';
} else {
title = '驳回退货单';
content = '<div><textarea name="refuse_reason" id="refuse_reason" cols="30" rows="10"></textarea></div>';
}
layer.open({
title: title,
content: content,
btns: ['确定', '取消'],
yes: function() {
}
})
})
} }
} }
}); });
})(jQuery) })(jQuery)
\ No newline at end of file
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
@if(in_array($order_info['status'], [1, 2, 3, 4]) && $order_invoice_info['invoice_status'] < 2 && in_array('update_invoice', $userPerms)) @if(in_array($order_info['status'], [1, 2, 3, 4]) && $order_invoice_info['invoice_status'] < 2 && in_array('update_invoice', $userPerms))
<a href="/changeInvoice/{{$order_info['order_id']}}" class="btn btn-success btn-sm changeBtn">更改发票</a> <a href="/changeInvoice/{{$order_info['order_id']}}" class="btn btn-success btn-sm changeBtn">更改发票</a>
@endif @endif
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'self' && !$extend) @elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'self' && (isset($entend) && !$extend))
<?php <?php
if ($order_info['status'] > 3) { // 已付款请求财务接口判断是否能修改发票 if ($order_info['status'] > 3) { // 已付款请求财务接口判断是否能修改发票
$isChangeInvoice = App\Http\Controllers\isChangeInvoice($order_info['order_sn']); $isChangeInvoice = App\Http\Controllers\isChangeInvoice($order_info['order_sn']);
...@@ -450,8 +450,13 @@ ...@@ -450,8 +450,13 @@
<th>采购数量</th> <th>采购数量</th>
<th>采购单价</th> <th>采购单价</th>
@elseif ($username != 'vpadmin@ichunt.com') @elseif ($username != 'vpadmin@ichunt.com')
<th>采购数量</th> @if ($order_info['order_goods_type'] == 2)
<th>采购单价</th> <th>购买数量</th>
<th>购买时单价</th>
@else
<th>采购数量</th>
<th>采购单价</th>
@endif
<th>均摊后单价</th> <th>均摊后单价</th>
@else @else
<th>商品数量</th> <th>商品数量</th>
...@@ -690,9 +695,14 @@ ...@@ -690,9 +695,14 @@
@endif @endif
@if ($action_name == 'refund') @if ($action_name == 'refund')
<!--自营对账--> <!--退货申请-->
@include('detail.refund') @include('detail.refund')
@endif @endif
@if ($action_name == 'orderReturn')
<!--退货申请-->
@include('detail.return')
@endif
<!-- 人工审单时去掉操作按钮 --> <!-- 人工审单时去掉操作按钮 -->
@if (!isset($_REQUEST['tags']) && $action_name != 'changeOrder' && $action_name != 'sendSales') @if (!isset($_REQUEST['tags']) && $action_name != 'changeOrder' && $action_name != 'sendSales')
...@@ -761,6 +771,10 @@ ...@@ -761,6 +771,10 @@
@if ($order_info['status'] == 4 && in_array('self_order_express', $userPerms)) @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> --> <!-- <a class="btn btn-default self_express" href="javascript:;" data-id="{{$order_info['order_id']}}">填写快递单</a> -->
@endif @endif
@if (in_array($order_info['status'], [7, 8]) && in_array('self_order_refund', $userPerms))
<a href="/return/{{$order_info['order_id']}}?tags=self" class="btn btn-info order_refund">退货申请</a>
@endif
<!-- 订单状态大于4,且处于开票状态,且存在权限 --> <!-- 订单状态大于4,且处于开票状态,且存在权限 -->
@if ($order_info['status'] >= 4 && $order_invoice_info['inv_type'] > 1 && in_array('self_order_invoice_express', $userPerms)) @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="{{$user_info['mobile'] ? $user_info['mobile'] : $user_mobile}}">
<input type="hidden" name="return_info[email]" value="{{$user_info['email']}}">
<input type="hidden" name="return_info[company_name]" value="{{ $company_info ? $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['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
<div class="row wrapper border-bottom white-bg page-heading"> <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> <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;"> <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"> <ol class="breadcrumb">
@if (!empty($paths)) @if (!empty($paths))
@for ($i = 0; $i < count($paths); $i++) @for ($i = 0; $i < count($paths); $i++)
......
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
<script src="/js/inspinia.min.js"></script> <script src="/js/inspinia.min.js"></script>
<script src="/js/common.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/order.js?v=<?= time() ?>"></script>
<script src="/js/orderamount.js"></script> <script src="/js/orderamount.js"></script>
<script src="/js/plugins/DatePicker/WdatePicker.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 @@ ...@@ -8,6 +8,7 @@
@include('orderlist.css') @include('orderlist.css')
@include('orderlist.js') @include('orderlist.js')
<link href="/js/layui/css/layui.css" rel="stylesheet">
</head> </head>
<body class=""> <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_cancel'] }}</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]))
<div class="text-center" style="margin-bottom: 10px;">
<button class="btn btn-info return-check" style="margin-right: 10px;" data-type="1" data-id="{{ $return['return_id'] }}">审核通过</button>
<button class="btn btn-danger return-check" data-type="-1" 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_refund_order">搜索</button>
<button class="nbtn refund_order_export" 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['pay_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
</div>
</td>
</tr>
@endforeach
</tbody>
@endif
</table>
</div>
<div class="row-fluid pagination">
<?php echo $page; ?>
</div>
</div>
</div>
<script>
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();
</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