Commit 6a6d2739 by 朱继来

fix conflict

parents c7695240 91855c2a
......@@ -44,7 +44,7 @@ function createMenuReal($menus, $active, $level)
if (isset($menu->childs) && count($menu->childs) > 0) {
if ($ii != 0 && $level > 0)
continue;
$ret .= '<li class="active"><a><i class="'
$ret .= '<li'. $actclass .'><a><i class="'
. $menu->class . '"></i><span class="nav-label">'
. $menu->title . '</span><span class="fa arrow"></span></a>'
. '<ul class="nav ' . $subclass . ' collapse' . $actmenu . '">'
......@@ -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();
......@@ -242,15 +250,12 @@ Class OrderController extends Controller
$map['test_order'] = $request->input('test_order', '');
$map['order_pay_type'] = $request->input('order_pay_type', '');
$map['order_type_a'] = $request->input('order_type_a', '');
// $map['order_pay_status'] = $request->input('order_pay_status', '');
$map['order_source_pf'] = $request->input('order_source_pf', '');
$map['order_source_adtag'] = $request->input('order_source_adtag', '');
$map['erp_order_id'] = $request->input('erp_order_id', '');
}
$map['erp_order_id'] = $request->input('erp_order_id', '');
// 若没有'查看线下订单'权限,则仅查看线上订单
if (!in_array('check_offline_order', $info['userPerms'])) {
$map['online_order'] = 1;
$map['order_payment_mode'] = $request->input('order_payment_mode', '');
$map['order_invoice_status']= $request->input('order_invoice_status', '');
}
/* 临时添加 所有人只能查看线上订单 */
......@@ -269,11 +274,17 @@ Class OrderController extends Controller
$map['vp_time_set'] = strtotime(Config('website.vp_time_set')); // 竞调账号根据时间展示订单
}
// 获取所有的业务员 (包括经理和交易员)
// $sale_list = $this->getSales('销售');
$map['order_goods_type'] = $tid;
// 获取所有的业务员 (包括经理、交易员、客服)
$perm = new PermController;
$manager = $perm->getRoleUsers($request, '经理');
$sale_list = $perm->getRoleUsers($request, '交易员');
if ($tid == 1) {
$sale_list = $perm->getRoleUsers($request, '交易员');
} else {
$sale_list = $perm->getRoleUsers($request, '客服');
}
$sale_list = array_merge($manager, $sale_list);
......@@ -299,7 +310,7 @@ Class OrderController extends Controller
$info['count'] = $response['data']['count'];
$info['page'] = $show;
return view('orderlist', $info);
return $info;
}
// erp订单
......@@ -320,7 +331,7 @@ Class OrderController extends Controller
$map['order_source'] = $request->input('order_source', '');
}
/* 查看ERP订单 */
/* 查看ERP/JD订单 */
$map['offline_order'] = [2, 3]; // 2-ERP, 3-JD
// 非竞调账号,则查看真实数据
......@@ -362,6 +373,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='')
{
......@@ -402,7 +421,10 @@ Class OrderController extends Controller
$map['order_type_a'] = $request->input('order_type_a', '');
$map['order_source_pf'] = $request->input('order_source_pf', '');
$map['order_source_adtag'] = $request->input('order_source_adtag', '');
$map['erp_order_id'] = $request->input('erp_order_id', '');
$map['erp_order_id'] = $request->input('erp_order_id', '');
$map['order_payment_mode'] = $request->input('order_payment_mode', '');
$map['order_invoice_status'] = $request->input('order_invoice_status', '');
$map['order_goods_type'] = $request->input('order_goods_type', '');
}
// 若没有'查看线下订单'权限,则仅查看线上订单
......@@ -413,6 +435,12 @@ Class OrderController extends Controller
/* 临时添加 所有人只能查看线上订单 */
$map['online_order'] = 1;
if ($map['order_goods_type'] == 1) {
$sale_name = '推送业务员';
} else {
$sale_name = '客服';
}
// 格式
$xlsCell = array(
array('order_id', '订单ID'),
......@@ -431,29 +459,18 @@ Class OrderController extends Controller
array('shipping_status','发货状态'),
array('invoice_status', '发票状态'),
array('company_name', '供应商'),
array('sale_name', '推送业务员'),
array('sale_name', $sale_name),
);
// 非竞调账号,则查看真实数据
if ($info['username'] != 'vpadmin@ichunt.com') {
$map['is_fake'] = 0;
}
$orderIds = array();
// 型号名称
if ($map['order_type'] == 2) {
$goods = DB::connection('order')->table('lie_order_items')->where('goods_name', '=', $map['order_contain'])->select('order_id')->get();
if ($goods) {
foreach ($goods as $v) {
$orderIds[] = $v->order_id;
}
}
}
$list = DB::connection('order')
->table('lie_order_items as it')
->leftJoin('lie_order as o', 'it.order_id', '=', 'o.order_id')
->leftJoin('lie_pay_log as p', 'it.order_id', '=', 'p.order_id')
->leftJoin('lie_order_invoice as i', 'it.order_id', '=', 'i.order_id')
->leftJoin('lie_order_address as a', function($join) {
$join->on('it.order_id', '=', 'a.order_id')->where('a.address_type', '=', 1);
......@@ -463,13 +480,13 @@ Class OrderController extends Controller
})
->leftJoin('lie_user_main as u', 'it.user_id', '=', 'u.user_id')
->leftJoin('lie_user_company as c', 'it.user_id', '=', 'c.user_id')
->where(function ($query) use ($map, $orderIds) {
->where(function ($query) use ($map) {
// 查询类型
if (!empty($map['order_contain'])) {
if ($map['order_type'] == 1) { // 订单编号
$query->where('o.order_sn', '=', $map['order_contain']);
} else if ($map['order_type'] == 2) { // 型号名称
$query->whereIn('o.order_id', $orderIds);
$query->whereIn('it.goods_name', '=', $map['order_contain']);
} else { // 会员账号
if (preg_match('/@/', $map['order_contain'])) {
$query->where('u.email', '=', $map['order_contain']);
......@@ -554,7 +571,25 @@ Class OrderController extends Controller
$query->where('o.is_type', '=', $map['is_fake']);
}
})
->where(function ($query) use ($map) {
// 支付方式
if (!empty($map['order_payment_mode'])) {
switch ($map['order_payment_mode']) {
case '1': $order_payment_mode = '微信';break;
case '2': $order_payment_mode = '支付宝';break;
case '3': $order_payment_mode = '银联';break;
}
$query->where('p.pay_name', '=', $order_payment_mode);
}
})
->where(function ($query) use ($map) {
// 发票类型
if (!empty($map['order_invoice_status'])) {
$query->where('i.inv_type', '=', $map['order_invoice_status']);
}
})
->where('it.status', '<>', -1)
->where('o.order_goods_type', '=', $map['order_goods_type'])
->select('it.goods_name', 'it.goods_number', 'it.goods_price', 'it.supplier_name', 'o.order_id', 'o.order_sn', 'o.order_pay_type', 'o.create_time', 'o.status', 'o.currency', 'o.sale_id', 'i.invoice_status', 'a.consignee', 's.status as shipping_status', 'u.user_id', 'u.mobile', 'u.email', 'c.com_name')
->groupBy('it.rec_id')
->orderBy('o.create_time', 'DESC')
......@@ -562,7 +597,7 @@ Class OrderController extends Controller
if (!empty($list)) {
// 订单数据处理
$export = $this->exportList($list);
$export = $this->exportList($request, $list, $map['order_goods_type']);
$xlsName = '订单数据导出';
$xlslist = exportExcel($xlsName, $xlsCell, $export);
......@@ -591,7 +626,7 @@ Class OrderController extends Controller
* @param [type] $order [查询出的订单数据]
* @return [type] [description]
*/
public function exportList($order)
public function exportList($request, $order, $type)
{
// 订单类型
$order_type = array(
......@@ -644,8 +679,18 @@ Class OrderController extends Controller
$tmp[$i]['com_name'] = isset($val->com_name) ? $val->com_name : '';
$tmp[$i]['goods_name'] = $val->goods_name;
$tmp[$i]['goods_number'] = $val->goods_number;
$tmp[$i]['goods_price'] = $val->goods_price;
$tmp[$i]['order_amount'] = $val->goods_number * $val->goods_price;
$tmp[$i]['goods_price'] = $val->goods_price;
$express_fee = 0;
// 自营运费
if ($type == 2) {
$data = array();
$data = $this->orderDetail($request, $val->order_id);
$express_fee = $data['order_price_info']['shipping_price'];
}
$tmp[$i]['order_amount'] = $val->goods_number * $val->goods_price + $express_fee;
$tmp[$i]['currency'] = $val->currency == 1 ? 'RMB' : 'USD';
$tmp[$i]['order_type'] = $order_type[$val->order_pay_type];
$tmp[$i]['order_status'] = $order_status[$val->status];
......@@ -655,6 +700,7 @@ Class OrderController extends Controller
$tmp[$i]['company_name'] = $val->supplier_name;
$tmp[$i]['sale_name'] = isset($sales) ? $sales->name : ''; // 推送业务员
unset($sales);
$i++;
}
......@@ -666,6 +712,18 @@ Class OrderController extends Controller
{
$data = $this->orderDetail($request, $id);
if ($request->input('tags') == 'self') {
$shipping = DB::connection('order')->table('lie_shipping')->select('shipping_id', 'shipping_name')->get();
if ($shipping) {
foreach ($shipping as $v) {
$shippingInfo[$v->shipping_id] = $v->shipping_name;
}
$data['shippings'] = $shippingInfo;
}
}
return view('detail', $data);
}
......@@ -1316,6 +1374,7 @@ Class OrderController extends Controller
'order_invoice_info' => $temp['data']['order_invoice_info'],
'order_items_info' => $temp['data']['order_items_info'],
'order_address_info' => $temp['data']['order_address_info'],
'order_invoice_address_info' => $temp['data']['order_invoice_address_info'],
'order_shipping_info' => $temp['data']['order_shipping_info'],
'order_invoice_shipping_info' => $temp['data']['order_invoice_shipping_info'],
'order_pay_log' => $temp['data']['order_pay_log'],
......@@ -1327,6 +1386,108 @@ Class OrderController extends Controller
return $response;
}
// 取消订单
public function ajaxSelfCancel(Request $request)
{
if ($request->isMethod('post')) {
$order_id = $request->input('order_id');
$data['cancel_reason'] = $request->input('reason');
$data['status'] = -1;
$data['cancel_time'] = time();
$update = DB::connection('order')->table('lie_order')->where('order_id', $order_id)->update($data);
if (!$update) return ['errcode'=>-1, 'errmsg'=>'取消失败'];
// 解锁库存
// $info = $this->orderDetail($request, $order_id);
// $sku = array();
// foreach ($info['order_items_info'] as $v) {
// $sku[$v['rec_id']] = $v['goods_number'];
// }
// $res = json_decode($this->unlockSku($order_id, $sku));
// if ($res['errcode'] != 0) return ['errcode'=>-1, 'errmsg'=>'解锁库存失败'];
// return ['errcode'=>0, 'errmsg'=>'取消成功并解锁库存'];
return ['errcode'=>0, 'errmsg'=>'取消成功'];
}
}
// 填写自营订单/发票快递单
public function ajaxSelfExpress(Request $request)
{
if ($request->isMethod('post')) {
$order_id = $request->input('order_id');
$shipping_type = $request->input('type');
$data['shipping_no'] = $request->input('express_no');
$data['shipping_id'] = $request->input('shipping_id');
$data['order_shipping_type'] = 1;
$data['update_time'] = time();
$shipping = DB::connection('order')->table('lie_order_shipping')->where(['order_id'=>$order_id, 'shipping_type'=>$shipping_type])->first();
// 判断是否已存在快递信息
if ($shipping) {
$result = DB::connection('order')->table('lie_order_shipping')->where(['order_id'=>$order_id, 'shipping_type'=>$shipping_type])->update($data);
} else {
$data['order_id'] = $order_id;
$data['shipping_type'] = $shipping_type;
$data['status'] = 1;
$result = DB::connection('order')->table('lie_order_shipping')->insert($data);
}
if (!$result) return ['errcode'=>-1, 'errmsg'=>'填写快递单失败'];
// 填写快递单时锁定库存
if ($shipping_type == 1) {
// 更新订单状态
DB::connection('order')->table('lie_order')->where('order_id', $order_id)->update(['status'=>8]);
// $info = $this->orderDetail($request, $order_id);
// $sku = array();
// foreach ($info['order_items_info'] as $v) {
// $sku[$v['rec_id']] = $v['goods_number'];
// }
// $res = json_decode($this->unlockSku($order_id, $sku, true));
// if ($res['errcode'] != 0) return ['errcode'=>-1, 'errmsg'=>'锁定库存失败'];
// return ['errcode'=>0, 'errmsg'=>'填写快递单成功并锁定库存'];
}
return ['errcode'=>0, 'errmsg'=>'填写快递单成功'];
}
}
/**
* 锁定基石库存
* @return [type] [description]
*/
protected function unlockSku($order_id, $skus = array(), $reduce = false)
{
$datas = array(
'order_id' => $order_id,
'Items' => $skus,
'reduce' => $reduce,
);
$data['type'] = 'sku.unlock';
$data['data'] = urlencode(json_encode($datas));
$data['timestamp'] = time();
$res = webpower_curl(Config('website.SERVICE_DOMAIN').'/transpond/wmsapi/WebApiUnlockStock?token='.service_token($data['data'], $data['timestamp']), $data);
// $res = post_curl(STONE_DOMAIN.'/wmsapi/WebApiUnlockStock?token='.service_token($data['data'], $data['timestamp']), $data);
if (!empty($res)) {
$res = json_decode($res, true);
}
return $res;
}
/**
* 定时任务:提前一天上午10点
......
......@@ -107,7 +107,7 @@ Class OrderCountController extends Controller
/**
* 订单数统计
*/
public function count(Request $request)
public function count(Request $request, $type = 1, $view = 'count')
{
$info = $this->getPageInfo($request);
......@@ -116,19 +116,19 @@ Class OrderCountController extends Controller
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$resData = array("pf"=>1, "k1"=>$data['k1'], "k2"=>$data['k2']);
$resData = array("pf"=>1, "k1"=>$data['k1'], "k2"=>$data['k2'], 'type'=>$type);
$temp = json_decode(curlApi($url,$resData,"POST"), true);
$info['count'] = $temp['data'];
return view('count', $info);
return view($view, $info);
}
/**
* 金额统计 -- 订单列表
*/
public function amount(Request $request)
public function amount(Request $request, $type = 1, $view = 'amount')
{
$info = $this->getPageInfo($request);
......@@ -144,6 +144,7 @@ Class OrderCountController extends Controller
$map['checkTime'] = $checkTime = $request->input('checkTime', '1'); // 默认选择订单付款时间
$map['checkStatus'] = $checkStatus = $request->input('checkStatus', '1'); // 默认选择查询全部
$map['order_goods_type'] = $type;
// 竞调账号
if ($info['username'] != 'vpadmin@ichunt.com') {
......@@ -184,8 +185,18 @@ Class OrderCountController extends Controller
$info['time_start'] = $time_start;
$info['time_end'] = $time_end;
return view('amount', $info);
return view($view, $info);
}
// 自营订单统计
public function selfCount(REQUEST $request)
{
return $this->count($request, 2, 'self_count');
}
// 自营订单金额统计
public function selfAmount(REQUEST $request)
{
return $this->amount($request, 2, 'self_amount');
}
}
\ No newline at end of file
......@@ -49,7 +49,9 @@
return 2;
} else if ($department->name == '交易员') {
return 3;
} else {
} else if ($department->name == '客服') {
return 4;
}else {
return 0;
}
}
......@@ -235,7 +237,7 @@
foreach ($val as $k => $v) {
if (is_array($v)) {
foreach ($v as $k1 => $v1) {
if (preg_match('/_check/', $v1)) {
if (preg_match('/_check$/', $v1)) {
$menuData[$key][] = $k;
continue;
}
......
......@@ -132,3 +132,17 @@
return $response ? $response : curl_error($ch);
}
/**
* 接口服务时加密方式
* @param [type] $data [description]
* @param [type] $timestamp [description]
* @param [type] $key [description]
* @return [type] [description]
*/
function service_token($data, $timestamp, $key = null)
{
$key = is_null($key) ? Config('website.SERVICE_KEY') : $key;
$token = md5($data.$timestamp.$key);
return $token;
}
......@@ -58,7 +58,13 @@ Route::group(['middleware' => 'web'], function () {
Route::resource('/prompt', 'PromptController@index');
Route::get('/count', 'OrderCountController@count');
Route::get('/self_count', 'OrderCountController@selfCount');
Route::get('/amount', 'OrderCountController@amount');
Route::get('/self_amount', 'OrderCountController@selfAmount');
Route::get('/self_order', 'OrderController@selfOrder');
Route::post('/ajaxSelfCancel', 'OrderController@ajaxSelfCancel');
Route::post('/ajaxSelfExpress', 'OrderController@ajaxSelfExpress');
Route::match('post', '/ajaxDelayTime', 'OrderController@ajaxDelayTime');
......
<?php
return [
// 菜单权限
'订单管理' => [
'平台订单' => ['orderlist_check', 'export', 'check_order', 'cancel_order', 'check_account', 'order_send', 'send_invoice', 'update_address', 'update_invoice', 'check_test_order', 'check_offline_order'],
'联营订单' => [
'平台订单' => ['orderlist_check', 'export', 'cancel_order', 'check_account', 'order_send', 'update_address', 'update_invoice', 'check_test_order', 'check_order', 'download_contract',],
'ERP订单' => ['erp_order_check'],
],
'自营订单' => [
'订单列表' => ['self_order_check', 'self_order_export', 'self_order_cancel', 'self_order_express', 'self_order_invoice_express', 'self_order_update_address', 'self_order_update_invoice', 'self_check_test_order', 'self_order_download_contract'],
'快递配置' => ['self_order_express_set_check'],
],
'订单统计' => [
'联营订单统计' => ['order_count_check'],
'订单统计' => ['ordercount_check'],
'自营订单统计' => ['self_order_count_check'],
],
];
\ No newline at end of file
......@@ -22,5 +22,11 @@ return [
'check_access_api' => 'http://perm.liexin.net/api/perms/access',
// 竞调账户配置显示时间
'vp_time_set' => '2018-04-01',
'vp_time_set' => '2018-05-01',
// 基石服务地址
'SERVICE_DOMAIN' => 'http://192.168.1.100',
//中间服务秘钥
'SERVICE_KEY' => 'j9q##VRhaXBEtznIEeDiR@1Hvy0sW3wp',
];
......@@ -133,7 +133,7 @@
test_order = '';
}
location.href = '/export?order_type='+order_type+'&order_contain='+order_contain+'&time_start='+time_start+'&time_end='+time_end+'&order_pay_type='+order_pay_type+'&order_status='+order_status+'&shipping_name='+shipping_name+'&order_send='+order_send+'&order_source_pf='+order_source_pf+'&order_source_adtag='+order_source_adtag+'&erp_order_id='+erp_order_id+'&test_order='+test_order;
location.href = '/export?order_type='+order_type+'&order_contain='+order_contain+'&time_start='+time_start+'&time_end='+time_end+'&order_pay_type='+order_pay_type+'&order_status='+order_status+'&shipping_name='+shipping_name+'&order_send='+order_send+'&order_source_pf='+order_source_pf+'&order_source_adtag='+order_source_adtag+'&erp_order_id='+erp_order_id+'&test_order='+test_order+'&order_goods_type='+1;
})
// 选择查看测试订单
......@@ -258,9 +258,6 @@
if(action_type=='changeInvoice'){
self.changeInvoice();
}
if(action_type=='cancel'){
self.cancel();
}
if(action_type=='cancelPay'){
self.cancelPay();
}
......@@ -276,45 +273,11 @@
if(action_type=='changeOrder'){
self.changeOrder();
}
self.selfOrder();
$.lie.droplist($('.droplist'));
var order_sn = $('.order-save').attr('ordersn');
//商品价格修改
$('.save-goods').on('click', function(){
var param = {};
$('.change-price').each(function() {
var k = $(this).attr('name');
if(parseFloat(this.value)) {
param[k] = parseFloat(this.value);
}
});
param.order_sn = $('.order-save').attr('ordersn');
var url = sysConfig.siteUrl+'/Admin/Order/saveGoods';
$.ajax({
url:url,
data:param,
type:'post',
dataType:'json',
success: function(resp) {
if(resp.errcode) {
layer.msg(resp.errmsg);
} else {
var total = 0;
for(var k in param) {
var num = parseInt($('#goods_number_'+k).html()) || 0;
$('#'+k).html(param[k]);
var goodsTotal = (num * param[k]).toFixed(2);
$('#total_'+k).html(goodsTotal);
total += parseFloat(goodsTotal);
}
$('.amount').html(total);
$('.real-total').html(total + parseFloat($('#other_money_input').val()));
$('.change-price').val('');
layer.msg(resp.errmsg);
}
}
})
});
//附加款修改
$('#edit_other_money').on('click', function () {
......@@ -329,78 +292,6 @@
$('.real-total').html( parseFloat($('#order-total').html()) + other_money );
});
//保存订单价格
$('.order-save').on('click', function () {
var param = {};
param.extra_fee = $('#other_money_input').val();
param.extra_fee_description = $('textarea[name="desc"]').val();
param.order_amount = $('.real-total').html();
param.order_sn = order_sn;
$.ajax({
url:sysConfig.siteUrl+'/Admin/Order/saveOrderInfo',
data:param,
type:'post',
dataType:'json',
success: function(resp) {
layer.msg(resp.errmsg);
}
})
});
//保存订单状态
$('select[name="order_status"]').on('change', function() {
var param = {};
param.order_sn = order_sn;
param.order_status = $(this).val();
$.ajax({
url:sysConfig.siteUrl+'/Admin/Order/saveOrderInfo',
data:param,
type:'post',
dataType:'json',
success: function(resp) {
// if(resp.errcode){
layer.msg(resp.errmsg);
// }
}
});
});
//保存支付方式
$('select[name="pay_id"]').on('change', function() {
var param = {};
param.order_sn = order_sn;
param.pay_id = $(this).val();
$.ajax({
url:sysConfig.siteUrl+'/Admin/Order/saveOrderInfo',
data:param,
type:'post',
dataType:'json',
success: function(resp) {
layer.msg(resp.errmsg);
}
});
});
//保存支付状态
$('select[name="pay_status"]').on('change', function() {
var param = {};
param.order_sn = order_sn;
param.pay_status = $(this).val();
$.ajax({
url:sysConfig.siteUrl+'/Admin/Order/saveOrderInfo',
data:param,
type:'post',
dataType:'json',
success: function(resp) {
layer.msg(resp.errmsg);
}
});
});
// ajax提交
$('form.ajaxSubmit').on('submit', function(){
$(this).ajaxSubmit(function(resp){
......@@ -537,89 +428,6 @@
});
// 对账
$('.admin-check').click(function(){
var order = $(this).data('order');
$.ajax({
url : sysConfig.siteUrl + '/Admin/Order/checkPayAfterFirst',
type : 'post',
data : {order:order},
dataType : 'json',
success : function(resp) {
if(resp.errcode == 0){
location.reload();
return false;
} else {
layer.alert(resp.errmsg);
}
},
error : function(err) {
layer.alert('网络异常');
}
})
})
//确认收款
$('.sure-recovery').click(function(){
layer.open({
title: '平账确认',
content: '您确定已经收到款项吗?',
btn: ['确认', '取消'],
//提交事件
btn1: function () {
$.ajax({
url:sysConfig.siteUrl + '/Admin/Order/recovery',
data: {
order_sn:$('#order_sn').val(),
out_trace_no:$('input[name=out_trace_no]').val()
},
type:'post',
dataType: 'json',
success:function(resp){
if(resp.errcode == 0){
location.reload();
return false;
} else {
layer.alert(resp.errmsg);
}
},
error:function(){
layer.alert('网络异常');
}
});
},
btn2: function () {
layer.closeAll();
}
});
});
//确认退款事件
$('.refund').click(function(){
$.ajax({
url:sysConfig.siteUrl+'/Admin/Order/refund',
data:{order_sn:$('#order_sn').val()},
type:'post',
dataType:'json',
error:function(){
layer.alert('网络异常');
},
success:function(resp){
if(resp.errcode == 0){
location.href = sysConfig.siteUrl + '/Admin/Order/details/order_sn/'+$('#order_sn').val();
} else {
layer.alert(resp.errmsg || '网络异常');
}
}
});
});
},
//物流信息
......@@ -813,6 +621,7 @@
})*/
});
},
//取消订单(支付前)
cancelPay: function(){
//提交事件
......@@ -845,115 +654,6 @@
});
});
},
//取消订单
cancel: function(){
//提交事件
$('.cancel-order .submit').click(function(){
var param = {};
param.order_sn = $('#order_sn').val();
var reason = $('.cancel-order input[name="cancel_reason"]:checked').val();
if(reason == '0'){
reason = $('.cancel-order #cancel-reason').val();
if(!reason){
layer.tips('请输入取消原因', $('.cancel-order #cancel-reason'));
return false;
}
}
param.cancel_reason = reason;
$.ajax({
url:sysConfig.siteUrl + '/Admin/Order/cancel',
data:param,
type:'post',
dataType:'json',
error:function(){
layer.alert('网络异常');
},
success:function(resp){
if(resp.errcode == 0){
location.reload();
return false;
} else {
layer.alert(resp.errmsg || '异常');
}
}
});
});
},
//账期设置
account: function(){
$('.account').click(function(){
var obj=$(this);
$.ajax({
url:sysConfig.siteUrl + '/Admin/Order/account',
data:{
account:$('select[name=account]').val(),
order_sn:obj.attr('order_sn')
},
type:'post',
dataType:'json',
error:function(){
layer.alert('网络异常');
},
success:function(resp){
if(resp.errcode == 0){
layer.msg(resp.errmsg);
location.href=sysConfig.siteUrl + '/Admin/Order/details/order_sn/'+obj.attr('order_sn');
return false;
} else {
layer.alert(resp.errmsg || '异常');
}
}
});
})
},
// 推送业务员
sendSales: function() {
$('.send_sales').click(function(){
var sale_id = $('input[name=sale_id]:checked').val();
var sale_name = $('input[name=sale_id]:checked').next('span').text();
if (sale_id == null) {
layer.msg('请选择业务员!');
return false;
}
// 弹出提示
layer.open({
title: '提醒',
content: '<div>确定推送到 <i class="error">'+sale_name+'</i> 吗?</div>',
btn:['取消','确定'],
yes: function(index, layero){
layer.close(index);
},
btn2: function(index, layero){
$.ajax({
url : '/sendSales',
type: 'post',
data: $('#sendSalesForm').serialize(),
dataType: 'json',
success: function (resp) {
if(resp.errcode === 0){
layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){
location.reload();
}, 1000);
} else {
layer.alert(resp.errmsg || '网络异常');
}
},
error: function (res) {
console.log(res);
}
})
}
});
return false;
})
},
//人工审单
changeOrder: function(){
......@@ -1081,6 +781,12 @@
}
}
if ($(this).val() < 0) {
layer.msg('只能是正整数');
$(this).val('');
return false;
}
if($(this).val()>999999.9999){
$(this).val(999999.9999);
}
......@@ -1405,6 +1111,133 @@
});
})
},
// 自营操作
selfOrder: function() {
// 填写快递单
$('.self_express').click(function(){
var order_id = $(this).data('id');
inputExpress(order_id, '填写快递单号', '/ajaxSelfExpress', 1);
})
// 填写发票快递单
$('.self_invoice_express').click(function(){
var order_id = $(this).data('id');
inputExpress(order_id, '填写发票快递单', '/ajaxSelfExpress', 2);
})
/**
* [inputExpress description]
* @param {[order_id]} order_id [order_id]
* @param {[type]} title [标题]
* @param {[type]} url [url]
* @param {[type]} type [1.订单快递单 2. 发票快递单]
* @return {[type]} [description]
*/
function inputExpress(order_id, title, url, type) {
var shipping_section = '';
shipping_section += '<div class="form-group">'+
'<select name="shipping_id" class="shipping_id" style="width: 100%;margin-bottom: 20px;">'+
'<option value="">请选择快递公司</option>';
for(var i in shippings_info) {
shipping_section += '<option value="'+i+'">'+shippings_info[i]+'</option>';
}
shipping_section += '<input type="text" class="express_no" name="express_no" value="" style="width:100%;" placeholder="请填写快递单号" />'+
'</select>'+
'</div>';
layer.open({
title: title
,content: shipping_section
,btn:['取消','确定']
,yes: function(index, layero){
layer.close(index);
}
,btn2: function(index, layero){
var shipping_id = $('.shipping_id').val();
var express_no = $('.express_no').val();
if(!shipping_id){
layer.tips('请选择快递公司',$('.shipping_id'));
return false;
}
if(!express_no){
layer.tips('快递单号不能为空',$('.express_no'));
return false;
}
$.ajax({
url: url,
type: 'post',
data: {order_id:order_id, shipping_id:shipping_id, express_no:express_no, type:type},
dataType:'json',
success: function(resp) {
if(resp.errcode === 0){
layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){
location.reload();
}, 1000);
} else {
layer.alert(resp.errmsg || '网络异常');
}
},
error: function(err) {
console.log(err)
}
})
}
});
}
// 订单取消
$('.self_cancel').click(function(){
var order_id = $(this).data('id');
layer.open({
title: '取消订单'
,content: '<div><textarea name="cancelorder" id="cancelorder" cols="40" rows="5" placeholder="请填写取消订单的原因"></textarea></div>'
,btn:['取消','确定']
,yes: function(index, layero){
layer.close(index);
}
,btn2: function(index, layero){
var cancelorder = $('#cancelorder').val();
if(!cancelorder){
layer.tips('原因不能为空',$('#cancelorder'));
return false;
}
$.ajax({
url: '/ajaxSelfCancel',
type: 'post',
data: {order_id:order_id, reason:cancelorder},
dataType:'json',
success: function(resp) {
if(resp.errcode === 0){
layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){
location.reload();
}, 1000);
} else {
layer.alert(resp.errmsg || '网络异常');
}
},
error: function(err) {
console.log(err)
}
})
}
});
})
},
}
});
......
......@@ -9,11 +9,18 @@
},
bind:function(){
$('.order-amount-search').click(function(){
searchAmount('/amount');
})
$('.self-order-amount-search').click(function(){
searchAmount('/self_amount');
})
function searchAmount(url) {
var checkTime = $('#checkTime').val(),
time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(),
checkStatus = $('#checkStatus').val(),
url = '/amount';
time_start = Date.parse(time_start) / 1000;
time_end = Date.parse(time_end) / 1000;
......@@ -21,7 +28,7 @@
url = url+'?checkTime='+checkTime+'&time_start='+time_start+'&time_end='+time_end+'&checkStatus='+checkStatus;
location.href = url;
})
}
}
}
......
+(function($){
$.lie = $.lie || {version: "v1.0.0"};
$.extend($.lie, {
self:{
index:function(){
$.lie.droplist($('.droplist'));
$('.search_self_order').click(function(){
var order_type = $('#order_type').data('default'),
order_contain = $('input[name=order_contain]').val(),
time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(),
order_status = $('#order_status').data('default'),
order_send = $('#order_send').data('default'),
order_source_pf = $('#order_source_pf').data('default'),
order_payment_mode = $('#order_payment_mode').data('default'),
order_invoice_status = $('#order_invoice_status').data('default'),
order_source_adtag = $('input[name="order_source_adtag"]').val(),
test_order = $('input[name=test_order]'),
erp_order_id = $('#erp_order_id').data('default'),
listUrl = '/self_order';
listUrl += '?order_type=' + order_type;
if (order_contain) {
listUrl += '&order_contain=' + order_contain;
}
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;
}
if (order_status) {
listUrl += '&order_status=' + order_status;
}
if (order_send) {
listUrl += '&order_send=' + order_send;
}
if (order_source_pf) {
listUrl += '&order_source_pf=' + order_source_pf;
}
if (order_payment_mode) {
listUrl += '&order_payment_mode=' + order_payment_mode;
}
if (order_invoice_status) {
listUrl += '&order_invoice_status=' + order_invoice_status;
}
if (order_source_adtag) {
listUrl += '&order_source_adtag=' + order_source_adtag;
}
if (erp_order_id) {
listUrl += '&erp_order_id=' + erp_order_id;
}
if (test_order.is(':checked')) {
listUrl += '&test_order=' + 1;
}
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag && !erp_order_id && !test_order.is(':checked')) {
listUrl = '/self_order';
}
location.href = listUrl;
})
// 导出订单
$('.self_export').click(function() {
var order_type = $('#order_type').data('default'),
order_contain = $('input[name=order_contain]').val(),
time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(),
order_status = $('#order_status').data('default'),
order_send = $('#order_send').data('default'),
order_source_pf = $('#order_source_pf').data('default'),
order_payment_mode = $('#order_payment_mode').data('default'),
order_invoice_status = $('#order_invoice_status').data('default'),
order_source_adtag = $('input[name="order_source_adtag"]').val(),
test_order = $('input[name=test_order]'),
erp_order_id = $('#erp_order_id').data('default');
if (test_order.length) {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag && !erp_order_id && !test_order.is(':checked')) {
layer.msg('请选择筛选条件,再导出!');
return false;
}
} else {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_send && !order_source_pf && !order_source_adtag && !erp_order_id) {
layer.msg('请选择筛选条件,再导出!');
return false;
}
}
if(time_start){
time_start = Date.parse(time_start) / 1000;
}
if(time_end){
time_end = Date.parse(time_end) / 1000 + (24*60*60-1);
}
if (test_order.is(':checked')) {
test_order = 1;
} else {
test_order = '';
}
location.href = '/export?order_type='+order_type+'&order_contain='+order_contain+'&time_start='+time_start+'&time_end='+time_end+'&order_payment_mode='+order_payment_mode+'&order_status='+order_status+'&order_invoice_status='+order_invoice_status+'&order_send='+order_send+'&order_source_pf='+order_source_pf+'&order_source_adtag='+order_source_adtag+'&erp_order_id='+erp_order_id+'&test_order='+test_order+'&order_goods_type='+2;
})
// 选择查看测试订单
$('input[name=test_order]').click(function(){
if ($(this).is(':checked')) {
$(this).val(1);
} else {
$(this).val('');
}
})
// 切换类型时,清空输入框内容
$('.dropdown-menu>li').click(function(){
var val = $(this).data('val'); // 当前值
var def = $(this).parents('.droplist').data('default'); // 默认值
if (val != def) {
if ($(this).parents('.droplist').attr('name') == 'order_type') {
$('input[name=order_contain]').val(''); // 清空
}
$(this).parents('.droplist').data('default', val); // 赋值
}
})
// 展示列表下的内容
$('.show-list').click(function(){
var nextTr = $(this).parent('tr').next('.show-other-content');
if (nextTr.css('display') == 'none') {
$(this).parent('tr').siblings('.show-other-content').hide();
nextTr.show();
} else {
nextTr.hide();
}
})
}
}
});
})(jQuery)
\ No newline at end of file
<div class="page-content">
<ul class="nav nav-tabs">
<li><a href="{{URL('count')}}">订单数统计</a></li>
<li><a href="{{URL('count')}}">联营订单数统计</a></li>
<li class="active"><a href="javascript:;">订单金额统计</a></li>
</ul>
<div class="tabs-box">
......
<div class="page-content">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">订单状态概览</a></li>
<li class="active"><a href="javascript:;">联营订单状态概览</a></li>
<li><a href="{{URL('amount')}}">订单金额统计</a></li>
</ul>
<div class="tabs-box">
......
......@@ -66,7 +66,7 @@
<p>{{$v['goods_name']}}</p>
</td>
<td>
<input class="only_positive_nubme num" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}">
<input class="only_positive_nubme only_number num" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}">
</td>
<td>
<input class="price only_number" name="change_info[{{$v['rec_id']}}][goods_price]" data-origin="{{$v['goods_price']}}" value="{{$v['goods_price']}}">
......
<div class="page-content order-details">
<ul class="nav nav-tabs">
@if (isset($_REQUEST['tags']))
@if (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'erp')
<li><a href="{{URL('erp_order')}}">ERP订单</a></li>
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'self')
<li><a href="{{URL('self_order')}}">自营订单</a></li>
@else
<li><a href="{{URL('list')}}">平台订单</a></li>
@endif
......@@ -27,7 +29,11 @@
<th>交易状态</th>
<th>对账状态</th>
<th>支付方式</th>
<th>支付类型</th>
@if (!isset($_REQUEST['tags']))
<th>支付类型</th>
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] != 'self')
<th>支付类型</th>
@endif
<th>支付状态</th>
</tr>
......@@ -94,7 +100,28 @@
}
?>
</td>
@if (!isset($_REQUEST['tags']))
<td>
<?php
if ($order_info['order_pay_type'] == 1) {
if (!empty($order_pay_log) && $order_pay_log[0]['pay_type'] != '') {
echo '全款';
} else {
echo '--';
}
} else if ($order_info['order_pay_type'] == 2) {
if (isset($order_pay_log[1]) && $order_pay_log[1]['pay_type'] != '') {
echo '尾款';
} else if (!empty($order_pay_log) && $order_pay_log[0]['pay_type'] != '') {
echo '预付款';
} else {
echo '--';
}
}
?>
</td>
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] != 'self')
<td>
<?php
if ($order_info['order_pay_type'] == 1) {
......@@ -114,6 +141,7 @@
}
?>
</td>
@endif
<td>
<?php
......@@ -144,13 +172,17 @@
<th colspan="7" style="text-align: center; background: #f9f9f9;">
收货信息
<!-- 订单状态小于5 且 更新地址权限存在 显示按钮 -->
@if (in_array($order_info['status'], array(1, 2, 3, 4)) && in_array('update_address', $userPerms))
@if (isset($_REQUEST['tags']))
<a href="/changeShipping/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}" class="btn btn-success btn-sm changeBtn">更改收货地址</a>
@else
@if (!isset($_REQUEST['tags']))
@if (in_array($order_info['status'], array(1, 2, 3, 4)) && in_array('update_address', $userPerms))
<a href="/changeShipping/{{$order_info['order_id']}}" class="btn btn-success btn-sm changeBtn">更改收货地址</a>
@endif
@endif
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'self')
@if (in_array($order_info['status'], array(2, 4)) && in_array('self_order_update_address', $userPerms))
<a href="/changeShipping/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}" class="btn btn-success btn-sm changeBtn">更改收货地址</a>
@endif
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'erp')
<a href="/changeShipping/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}" class="btn btn-success btn-sm changeBtn">更改收货地址</a>
@endif
</th>
</tr>
<tr>
......@@ -203,12 +235,16 @@
<th colspan="3" style="text-align: center; background: #f9f9f9;">
发票信息
<!-- 发票状态小于2(已发货)且更改权限存在 显示按钮 -->
@if (in_array($order_info['status'], array(1, 2, 3, 4, 7, 8)) && $order_invoice_info['invoice_status'] < 2 && in_array('update_invoice', $userPerms))
@if (isset($_REQUEST['tags']))
<a href="/changeInvoice/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}" class="btn btn-success btn-sm changeBtn">更改发票</a>
@else
@if (!isset($_REQUEST['tags']))
@if ($order_info['status'] < 10 && $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>
@endif
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'self')
@if ($order_info['status'] < 10 && $order_invoice_info['invoice_status'] < 2 && in_array('self_order_update_invoice', $userPerms))
<a href="/changeInvoice/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}" class="btn btn-success btn-sm changeBtn">更改发票</a>
@endif
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'erp')
<a href="/changeInvoice/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}" class="btn btn-success btn-sm changeBtn">更改发票</a>
@endif
</th>
</tr>
......@@ -255,6 +291,37 @@
</td>
</tr>
</table>
<!-- 发票收货地址 -->
@if ($order_invoice_address_info)
<table class="table table-bordered">
<tr class="caption">
<th colspan="3" style="text-align: center; background: #f9f9f9;">
发票收货信息
</th>
</tr>
<tr>
<td colspan="3">
<table class="table table-bordered">
<tr>
<th>收货人</th>
<th>联系电话/手机</th>
<th>收货地址</th>
</tr>
<tr>
<td>{{$order_invoice_address_info['consignee']}}</td>
<td>{{$order_invoice_address_info['mobile']}}</td>
<td>
{{$order_invoice_address_info['province_val']}}&nbsp;&nbsp;{{$order_invoice_address_info['city_val']}}&nbsp;&nbsp;{{$order_invoice_address_info['district_val']}}&nbsp;&nbsp;{{$order_invoice_address_info['address']}}
</td>
</tr>
</table>
</td>
</tr>
</table>
@endif
@if (!empty($order_info['order_source']) && preg_match('/adtag\=/', $order_info['order_source']))
<table class="table table-bordered table-hover">
......@@ -359,17 +426,21 @@
</td>
</tr>
@endif
<!-- <tr>
<td>附加款说明:</td>
<td>
{$detail.extra_fee_description}
</td>
</tr> -->
<tr>
<td>商品总额:</td>
<td>{{$currency}}<span id="order-total" class="amount">{{$order_price_info['goods_price']}}</span></td>
</tr>
@if ($order_price_info['shipping_price'] != 0)
<tr>
<td>快递费用:</td>
<td class="edit-parent-td">
{{$currency}}<span id="other_money">{{$order_price_info['shipping_price']}}</span>
</td>
</tr>
@endif
@if ($order_price_info['discount_amount'] != 0)
<tr>
<td>优惠券:</td>
......@@ -427,46 +498,65 @@
@include('detail.check')
@endif
<!-- 查看ERP订单详情时去掉操作按钮 -->
@if (!isset($_REQUEST['tags']))
<!-- 人工审单时去掉操作按钮 -->
@if ($action_name != 'sendSales' && $action_name != 'changeOrder')
<p style="padding-left: 5px;">操作</p>
<div class="tabs-box">
<!-- 判断操作权限 -->
@if (($role == 1 || $role ==2) && $order_info['status'] == 1 && in_array('check_order', $userPerms))
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">人工审单</a>
@endif
<!-- 人工审单时去掉操作按钮 -->
@if (!isset($_REQUEST['tags']) && $action_name != 'changeOrder')
<p style="padding-left: 5px;">操作</p>
<div class="tabs-box">
<!-- 判断操作权限 -->
@if (($role == 1 || $role ==2) && $order_info['status'] == 1 && in_array('check_order', $userPerms))
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">人工审单</a>
@endif
@if (($role == 1 || $role ==2) && $order_info['status'] == 2 && in_array('adjust_price', $userPerms))
<!-- <a href="{{URL('adjustPrice', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">调价</a> -->
@endif
@if ($order_info['status'] == 2 && in_array('cancel_order', $userPerms))
<a href="{{URL('cancelPay', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">取消订单</a>
@endif
@if ($order_info['status'] == 2 && in_array('cancel_order', $userPerms))
<a href="{{URL('cancelPay', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">取消订单</a>
<!-- 预付款 管理员完成首款对账后改变'对账'按钮 -->
@if ($order_info['status'] >= 2 && in_array('check_account', $userPerms))
@if ($order_info['status'] == 3 && (!empty($order_pay_log) && $order_pay_log[0]['pay_type'] != ''))
<a href="javascript:;" data-id="{{$order_info['order_id']}}" class="btn btn-default last-check">对账</a>
@else
<a href="{{URL('checkPay', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">对账</a>
@endif
@endif
<!-- 预付款 管理员完成首款对账后改变'对账'按钮 -->
@if ($order_info['status'] >= 2 && in_array('check_account', $userPerms))
@if ($order_info['status'] == 3 && (!empty($order_pay_log) && $order_pay_log[0]['pay_type'] != ''))
<a href="javascript:;" data-id="{{$order_info['order_id']}}" class="btn btn-default last-check">对账</a>
@else
<a href="{{URL('checkPay', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">对账</a>
@endif
@endif
@if (in_array($order_info['status'], array(4, 7, 8, 10)) && in_array('order_send', $userPerms))
<!-- <a href="{{URL('send', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">订单发货</a> -->
@endif
@if ($order_info['status'] == 10 && in_array('send_invoice', $userPerms))
<a href="{{URL('invShipping', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">寄送发票</a>
@endif
</div>
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'self')
<p style="padding-left: 5px;">操作</p>
<div class="tabs-box">
<!-- 判断状态和权限 -->
@if ($order_info['status'] == 2 && in_array('self_order_cancel', $userPerms))
<a class="btn btn-default self_cancel" href="javascript:;" data-id="{{$order_info['order_id']}}" class="btn btn-default">取消订单</a>
@endif
@if (in_array($order_info['status'], array(4, 7, 8, 10)) && in_array('order_send', $userPerms))
<!-- <a href="{{URL('send', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">订单发货</a> -->
@endif
@if ($order_info['status'] == 10 && in_array('send_invoice', $userPerms))
<a href="{{URL('invShipping', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">寄送发票</a>
@endif
<!-- <a href="{:U('cancel', 'order_id='.$order_info['order_id'])}" class="btn btn-default">退货退款</a>
<a href="{:U('recovery', 'order_id='.$order_info['order_id'])}" class="btn btn-default">平账设置</a> -->
</div>
@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']}}" class="btn btn-default">填写快递单</a>
@endif
@if (in_array($order_info['status'], [4, 8]) && in_array('self_order_invoice_express', $userPerms))
<a class="btn btn-default self_invoice_express" data-id="{{$order_info['order_id']}}" href="javascript:;" class="btn btn-default">填写发票快递</a>
@endif
</div>
@if ($shippings)
<script>
var shippings = '{!! json_encode($shippings) !!}';
var shippings_info = eval('('+shippings+')');
</script>
@endif
@endif
<!-- 二期处理 -->
<!-- <p>操作记录</p>
<div class="tabs-box">
......
......@@ -275,6 +275,16 @@
<!-- 管理员和经理显示 && sale_id为空 && 订单状态为待审核 -->
@if (in_array($role, [1, 2]) && $v['status'] == 1)
<a class="btn btn-info" href="{{URL('sendSales', ['order_id'=>$v['order_id']])}}" target="_blank">推送</a>
<?php
$apiUrl = Config('website.api_domain');
$k1 = time();
$k2 = md5(md5($k1).'fh6y5t4rr351d2c3bryi');
$downLoadUrl = $apiUrl.'contract/pdfinfo?id='.$v['order_id'].'&k1='.$k1.'&k2='.$k2;
?>
@if (in_array('download_contract', $userPerms))
<a class="btn btn-info" href="{{$downLoadUrl}}">下载合同</a>
@endif
</div>
</td>
......@@ -457,4 +467,8 @@
$('.selectpicker').selectpicker('val', order_status.split(',')).trigger("change");
$.lie.order.index();
// 展开菜单
$('#side-menu').children('li').eq(1).addClass('active');
$('#side-menu').children('li').eq(1).children('ul').children('li').eq(0).addClass('active');
</script>
\ No newline at end of file
<!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('selfOrder.css')
@include('selfOrder.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">
<table style="width:100%">
<tr>
<td width="93%">
<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_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="2">待付款</li>
<li data-val="4">待发货</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['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_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>支付方式:</dt>
<dd>
<div class="droplist" data-default="{{$condition['order_payment_mode']}}" id="order_payment_mode" name="order_payment_mode">
<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_invoice_status']}}" id="order_invoice_status" name="order_invoice_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>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('self_check_test_order', $userPerms))
<dl>
<dt></dt>
<dd>
<input type="checkbox" name="test_order"> 所有订单-包括测试
</dd>
</dl>
@endif
</td>
<td width="7%">
<dl>
<dt>
<button class="nbtn btn-sm search_self_order">搜索</button>
</dt>
@if (in_array('self_order_export', $userPerms))
<dt class="order-export">
<button class="nbtn btn-sm self_export" style="background: #23c6c8 !important;">导出</button>
</dt>
@endif
</dl>
</td>
</tr>
</table>
</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">{{$v['order_sn']}}</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 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="/details/{{$v['order_id']}}?tags=self" target="_blank">详情</a>
</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">
<p class="show-title" title="{{App\Http\Controllers\getCompanyName($v['user_id'])}}">{{App\Http\Controllers\getCompanyName($v['user_id'])}}</p>
</td>
<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>
</tr>
<tr>
<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>
<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>
</div>
<script>
var test_order = "{{$condition['test_order']}}";
if (test_order) {
$('input[name=test_order]').attr('checked', true);
}
$.lie.self.index();
</script>
\ No newline at end of file
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="/css/style.css" rel="stylesheet">
<link href="/layer/skin/layer.css" rel="stylesheet">
<link href="/css/order.css" rel="stylesheet">
<link href="/css/detail.css" rel="stylesheet">
\ No newline at end of file
<script src="/js/jquery-2.2.1.js"></script>
<script src="/js/jquery.form.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/layer/layer.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/inspinia.min.js"></script>
<script src="/js/common.js"></script>
<script src="/js/self_order.js"></script>
<script src="/js/orderamount.js"></script>
<script src="/js/plugins/DatePicker/WdatePicker.js"></script>
<!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('self_amount.content')
</div>
</div>
</div>
</body>
<div class="page-content">
<ul class="nav nav-tabs">
<li><a href="{{URL('self_count')}}">自营订单数统计</a></li>
<li class="active"><a href="javascript:;">订单金额统计</a></li>
</ul>
<div class="tabs-box">
<div class="row-fluid order-amount">
<select name="checkTime" id="checkTime" style="width: 150px; margin-bottom: 0;">
<option value="1">订单付款时间</option>
<option value="2">订单创建时间</option>
</select>
<input type="text" readonly name="time_start" value="{{ !empty($time_start) ? date('Y-m-d H:i:s', $time_start) : '' }}" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
<span> - </span>
<input type="text" readonly name="time_end" value="{{ !empty($time_end) ? date('Y-m-d H:i:s', $time_end) : '' }}" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
<select name="checkStatus" id="checkStatus" style="width: 80px; margin-bottom: 0;">
<option value="1">全部</option>
<option value="2">已完成</option>
<option value="3">未完成</option>
</select>
<button class="btn btn-primary self-order-amount-search">搜索</button>
</div>
</div>
<div class="tabs-box">
<div class="row-fluid">
<table class="table table-bordered">
<tr>
<th>序号</th>
<th>订单号</th>
<th>订单付款时间</th>
<th>交易完成时间</th>
<th>订单金额</th>
</tr>
<empty name="list">
@if (empty($list))
<tr><td colspan="5">没有更多数据~</td></tr>
@else
@foreach ($list as $key => $vo)
<tr>
<td>{{$key + 1}}</td>
<td>{{$vo['order_sn']}}</td>
<td>
<?php
// 全款
if ($vo['order_pay_type'] == 1) {
echo date('Y-m-d H:i:s', $vo['pay_time']);
} else if ($vo['order_pay_type'] == 2) { // 预付款
$exp = explode(',', $vo['pay_time']);
$pay_amount = explode(',', $vo['pay_amount']);
if (count($exp) == 1) {
// 如果有两条金额记录,支付时间只有一条,则首尾款时间一致
if (count($pay_amount) == 2) {
echo date('Y-m-d H:i:s', $exp[0]).' (尾款)<br>'.date('Y-m-d H:i:s', $exp[0]).' (首款)';
} else {
if ($vo['pay_type'] == 2) {
echo date('Y-m-d H:i:s', $exp[0]).' (首款)';
} else {
echo date('Y-m-d H:i:s', $exp[0]).' (尾款)';
}
}
} else {
if ($exp[0] < $exp[1]){
echo date('Y-m-d H:i:s', $exp[1]).' (尾款)<br>'.date('Y-m-d H:i:s', $exp[0]).' (首款)';
} else {
echo date('Y-m-d H:i:s', $exp[0]).' (尾款)<br>'.date('Y-m-d H:i:s', $exp[1]).' (首款)';
}
}
}
?>
</td>
<td>
@if ($vo['finish_time'] != 0)
{{date('Y-m-d H:i:s', $vo['finish_time'])}}
@endif
</td>
<td>
<?php
if ($vo['currency'] == 1) {
$currency = '¥';
} else {
$currency = '$';
}
if ($vo['order_pay_type'] == 1) { // 全款
echo $currency.$vo['pay_amount'];
} else if ($vo['order_pay_type'] == 2) { // 预付款
$exp = explode(',', $vo['pay_amount']);
if (count($exp) == 1) {
if ($vo['pay_type'] == 2) {
echo $currency.$exp[0].' (首款)';
} else {
echo $currency.$exp[0].' (尾款)';
}
} else {
if ($exp[0] > $exp[1]) {
echo $currency.$exp[0].' (尾款)<br>'.$currency.$exp[1].' (首款)';
} else {
echo $currency.$exp[1].' (尾款)<br>'.$currency.$exp[0].' (首款)';
}
}
}
?>
</td>
</tr>
@endforeach
@endif
</table>
</div>
<div class="row-fluid pagination">
<span>
@if ($checkStatus == 1)
实收金额:¥{{isset($pay_count['rmb_pay']) ? $pay_count['rmb_pay'] : 0}} &nbsp; ${{isset($pay_count['usd_pay']) ? $pay_count['usd_pay'] : 0}}
已完成金额:¥{{!empty($pay_count['rmb_pay_finish']) ? $pay_count['rmb_pay_finish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_finish']) ? $pay_count['usd_pay_finish'] : 0}}
未完成金额:¥{{!empty($pay_count['rmb_pay_unfinish']) ? $pay_count['rmb_pay_unfinish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_unfinish']) ? $pay_count['usd_pay_unfinish'] : 0}}
@elseif ($checkStatus == 2)
实收金额:¥{{isset($pay_count['rmb_pay']) ? $pay_count['rmb_pay'] : 0}} &nbsp; ${{isset($pay_count['usd_pay']) ? $pay_count['usd_pay'] : 0}}
已完成金额:¥{{!empty($pay_count['rmb_pay_finish']) ? $pay_count['rmb_pay_finish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_finish']) ? $pay_count['usd_pay_finish'] : 0}}
@else
实收金额:¥{{isset($pay_count['rmb_pay']) ? $pay_count['rmb_pay'] : 0}} &nbsp; ${{isset($pay_count['usd_pay']) ? $pay_count['usd_pay'] : 0}}
未完成金额:¥{{!empty($pay_count['rmb_pay_unfinish']) ? $pay_count['rmb_pay_unfinish'] : 0}} &nbsp; ${{!empty($pay_count['usd_pay_unfinish']) ? $pay_count['usd_pay_unfinish'] : 0}}
@endif
</span>
<?php echo isset($page) ? $page : ''; ?>
</div>
</div>
</div>
<script>
$.lie.orderamount.index();
var checkTime = '{{$checkTime}}';
var checkStatus = '{{$checkStatus}}';
$('#checkTime').val(checkTime);
$('#checkStatus').val(checkStatus);
$('#side-menu').children('li').last().attr('class', 'active');
$('#side-menu').children('li').last().children('ul').children('li').eq(2).attr('class', 'active');
</script>
\ No newline at end of file
<!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('self_count.content')
</div>
</div>
</div>
</body>
<div class="page-content">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">自营订单状态概览</a></li>
<li><a href="{{URL('self_amount')}}">订单金额统计</a></li>
</ul>
<div class="tabs-box">
<div class="row-fluid">
<table class="table">
<tr>
<th>时间</th>
<th title = "指定时间内,新创建的订单,不考虑该订单是否有状态变化。">新创建订单数</th>
<th title = "指定时间内,客户完成了所有款项的支付,并系统对账完成的订单数量。(对应待发货状态)">已付款</th>
<th title = "指定时间内,订单完成发货,但客户还未完成收货状态的订单数量。(对应待收货状态)">待收货</th>
<th title = "指定时间内,订单已完成状态的订单数量(对应已完成状态)">已完成</th>
<th title = "指定时间内,订单已取消的订单数量(对应已取消状态) ">已取消</th>
</tr>
<tr>
<td>今日</td>
<td>{{$count['all']['today']}}</td>
<td>{{$count['paid']['today']}}</td>
<td>{{$count['send']['today']}}</td>
<td>{{$count['done']['today']}}</td>
<td>{{$count['cancel']['today']}}</td>
</tr>
<tr>
<td>近7天</td>
<td>{{$count['all']['week']}}</td>
<td>{{$count['paid']['week']}}</td>
<td>{{$count['send']['week']}}</td>
<td>{{$count['done']['week']}}</td>
<td>{{$count['cancel']['week']}}</td>
</tr>
<tr>
<td>近30天</td>
<td>{{$count['all']['month']}}</td>
<td>{{$count['paid']['month']}}</td>
<td>{{$count['send']['month']}}</td>
<td>{{$count['done']['month']}}</td>
<td>{{$count['cancel']['month']}}</td>
</tr>
</table>
</div>
</div>
</div>
<script>
$.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