Commit 68931965 by 朱继来

退货单导出

parent dd356d7b
......@@ -137,18 +137,18 @@ class ReturnController extends Controller
return $info;
}
// 联营退导出
// 联营退货单导出
public function returnExport(Request $request)
{
$ReturnModel = new OrderReturnModel();
return $ReturnModel->jointExport($request);
return $ReturnModel->export($request);
}
// 自营退导出
public function returnSelfExport(Request $request)
// 自营退货单导出
public function selfReturnExport(Request $request)
{
$ReturnModel = new OrderReturnModel();
return $ReturnModel->selfExport($request);
return $ReturnModel->export($request);
}
// 退货详情
......
......@@ -128,6 +128,7 @@ Route::group(['middleware' => 'web'], function () {
Route::get('/self_return_list', 'ReturnController@selfReturnList');
Route::get('/return_details/{id}', 'ReturnController@returnDetails');
Route::post('/ajax/returnCheck', 'ReturnController@returnCheck');
Route::get('/self_return_export', 'ReturnController@selfReturnExport');
});
// 不需要登陆态
......
<?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
......@@ -132,31 +132,6 @@
}
})
// // 钱包退款
// $('.wallet-refund').click(function(){
// var order_id = $(this).data('oid');
// var amount = $(this).data('amount');
// $.ajax({
// url : 'ajax/wallet_refund',
// type: 'post',
// data: {order_id: order_id, amount: amount},
// dataType: 'json',
// success: function (resp) {
// if (resp.errcode == 0) {
// window.href =
// return false;
// }
// layer.msg(resp.errmsg);
// },
// error: function (err) {
// console.log(err)
// }
// })
// })
// 自营退款列表取消申请
$('.cancel-refund').click(function() {
var rid = $(this).data('rid');
......@@ -192,6 +167,140 @@
},
index_new:function(){
$.lie.droplist($('.droplist'));
// 特殊字符编码
function specialCode(chr)
{
switch (chr) {
case '!': return '%21'; break;
case '"': return '%22'; break;
case '#': return '%23'; break;
case '$': return '%24'; break;
case '%': return '%25'; break;
case '&': return '%26'; break;
case '\'': return '%27'; break;
case '(': return '%28'; break;
case ')': return '%29'; break;
case '*': return '%2A'; break;
case '+': return '%2B'; break;
case ',': return '%2C'; break;
case '/': return '%2F'; break;
case ':': return '%3A'; break;
case ';': return '%3B'; break;
case '<': return '%3C'; break;
case '=': return '%3D'; break;
case '>': return '%3E'; break;
case '?': return '%3F'; break;
case '@': return '%40'; break;
case '[': return '%5B'; break;
case ']': return '%5D'; break;
case '\\': return '%5C'; break;
case '|': return '%7C'; break;
default: return ''; break;
}
}
// 查找特殊字符
function specialStr(str)
{
var reg = new RegExp("[!\"#$%&'()*+,/:;<=>?@\\[\\]\\|]");
var len = str.length;
var rs = '';
for (var i = 0; i < len; i++) {
var val = str.substr(i, 1);
if (reg.test(val)) {
rs = rs + specialCode(val);;
} else {
rs = rs + val;
}
}
return rs;
}
// 搜索、导出条件
function refundCommon(url) {
var order_sn = $('input[name="order_sn"]').val(),
sku_name = $('input[name="sku_name"]').val(),
apply_status = $('#apply_status').val() ? $('#apply_status').val() : '',
order_payment_mode = $('#order_payment_mode').val() ? $('#order_payment_mode').val() : '',
time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(),
order_goods_type = $('input[name="order_goods_type"]').val();
if (url == '/return_export' || url == '/self_return_export') {
if (!order_sn && !sku_name && !apply_status && !order_payment_mode && !time_start && !time_end) {
layer.msg('请选择筛选条件,再导出!');
return false;
}
}
if (!order_sn && !sku_name && !apply_status && !order_payment_mode && !time_start && !time_end) {
location.href = url;
}
var listUrl = url;
listUrl += '?order_sn=' + order_sn;
if (sku_name) {
listUrl += '&sku_name=' + specialStr(sku_name);
}
if (order_payment_mode) {
listUrl += '&order_payment_mode=' + order_payment_mode;
}
if (apply_status) {
listUrl += '&apply_status=' + apply_status;
}
if(time_start){
time_start = Date.parse(time_start) / 1000;
listUrl += '&time_start='+time_start;
}
if(time_end){
time_end = Date.parse(time_end) / 1000 + (24*60*60-1);
listUrl += '&time_end='+time_end;
}
listUrl += '&order_goods_type='+order_goods_type;
location.href = listUrl;
}
// 搜索
$('.search_return_order').click(function(){
var order_goods_type = $('input[name="order_goods_type"]').val();
if (order_goods_type == 1) {
refundCommon('/return_list');
} else {
refundCommon('/self_return_list');
}
})
// 导出订单
$('.export_return_order').click(function() {
var order_goods_type = $('input[name="order_goods_type"]').val();
if (order_goods_type == 1) {
refundCommon('/return_export');
} else {
refundCommon('/self_return_export');
}
})
},
refund:function() {
// 正整数输入框限制
$('.int_num').off().on('keyup', function(){
......
......@@ -66,8 +66,8 @@
<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>
<button class="nbtn search_return_order">搜索</button>
<button class="nbtn export_return_order" style="margin-left: 20px; background: #23c6c8 !important;">导出</button>
</div>
</div>
</div>
......@@ -160,5 +160,5 @@
$('.apply_status').selectpicker('val', apply_status.split(',')).trigger("change");
$('.order_payment_mode').selectpicker('val', order_payment_mode.split(',')).trigger("change");
$.lie.refund.index();
$.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