Commit 4454e9ae by 孙龙

Merge branch 'master' of http://119.23.72.7/zhujilai/Order

parents 37d2ba9e 7db14ae4
Showing with 1062 additions and 150 deletions
......@@ -309,7 +309,12 @@ Class AddOrderController extends Controller
{
if ($request->isMethod('post')) {
$url = Config('website.search-skuid');
$data['id'] = $request->input('sku_id');
$data['id'] = $request->input('sku_id');
$user_id = $request->input('user_id', 0);
if ($user_id) {
$data['uid'] = $user_id;
}
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
......@@ -870,6 +875,7 @@ Class AddOrderController extends Controller
{
if ($request->isMethod('post')) {
$add_type = $request->input('add_type', ''); // 新增类型
$goods_type = $request->input('goods_type', 1); // 商品类型
if ($add_type) {
$data['add_goods_name'] = $request->input('add_goods_name', '');
......@@ -891,11 +897,20 @@ Class AddOrderController extends Controller
$data['add_type'] = $add_type;
$data['operator_id'] = $request->user->userId;
$url = Config('website.order_api_domain').'/order/addgoods';
if ($goods_type == 1 && !$add_type) {
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'/order/jointaddgoods';
$res = json_decode(curlApi($url, $data, 'post'), true);
$response = json_decode(curlApi($url, $data, 'post'), true);
return ['errcode' => $res['err_code'], 'errmsg' => $res['err_msg'], 'data' => $res['data']];
}
$url = Config('website.order_api_domain').'/order/addgoods';
$res = json_decode(curlApi($url, $data, 'post'), true);
return ['errcode' => $response['errcode'], 'errmsg' => $response['errmsg']];
return ['errcode' => $res['errcode'], 'errmsg' => $res['errmsg']];
}
}
......
......@@ -493,6 +493,15 @@ Class OrderController extends Controller
$perm = new PermController;
$sale_list = $perm->getUserByDepartmentId(Config('perm_args.sales_department_id')); // 获取所有的销售
if ($tid == 1) {
$info['buyers'] = $perm->getUserByCondition('', 39); // 获取采购员, ID - 39
$all_sales = $perm->getUserByDepartmentId(Config('perm_args.sales_department_id'), 0); // 获取所有在职的销售
$info['cc_sales'] = $all_sales ? array_merge($info['buyers'], $all_sales) : $info['buyers'];
} else {
$admin = (object) array('userId' => 1000, 'name' => 'admin', 'status' => 0);
array_unshift($sale_list, $admin);
}
//获取订单列表
$url = Config('website.api_domain').'order/getAllOrder';
......@@ -679,7 +688,7 @@ Class OrderController extends Controller
public function templateData(Request $request, $id, $view_id)
{
$info = $this->orderDetail($request, $id);
$this->pageHeader($request, $info, '订单详情');
if ($info['order_info']['order_goods_type'] == 2 && in_array($info['order_info']['order_type'], [1, 3])) { // 平台自营订单
......@@ -772,19 +781,14 @@ Class OrderController extends Controller
}
} else {
$perm = new PermController;
$info['buyers'] = $perm->getRoleUsers($request, '采购员');
// $info['buyers'] = $perm->getRoleUsers($request, '采购员');
$info['buyers'] = $perm->getUserByDepartmentId(8, 0); // 采购部
}
// 账期订单跳转到详情页
if ($info['order_info']['status'] == 4) {
return redirect('/details/'.$id);
}
// 待审核才可以
if(!in_array($info['order_info']['status'], [-1, 1, 2])){
$redirect = $info['order_info']['order_goods_type'] == 1 ? '/list' : '/self_order';
return redirect('/prompt')->with(['message'=>"该订单不符合人工审单条件~【status:{$info['order_info']['status']}】",'url' =>$redirect, 'jumpTime'=>3,'status'=>false]);
// 非待审核、待付款则跳转到列表页
if(!in_array($info['order_info']['status'], [1, 2])){
$redirect_url = $info['order_info']['order_goods_type'] == 1 ? '/list' : '/self_order';
return redirect($redirect_url);
}
$data['k1'] = time();
......@@ -796,28 +800,23 @@ Class OrderController extends Controller
$info['api_dgk_config'] = $res['data']['data'];
$info['api_dgk_config_one'] = array_keys($res['data']['data']); // 一级分类
return view('detail', $info);
return view('changeOrder', $info);
}
//删除单个商品操作
public function ajaxdeletegoods(Request $request)
{
$collert = $request->input();
$collert = $request->input();
$operator_id = $request->user->userId;
if(!$request->isMethod('post') || !$collert['rec_id']){
return array('errcode'=>1, 'errmsg'=>'错误操作');
}
if(!$request->isMethod('post') || !$collert['rec_id']) return array('errcode'=>1, 'errmsg'=>'错误操作');
if(!$collert['reason']){
errorLog(Error::E_NOT_EXISTS, '请填写删除原因');
return array('errcode'=>Error::E_NOT_EXISTS,'errmsg'=>'请填写删除原因');
}
if(!$collert['reason']) return array('errcode'=>Error::E_NOT_EXISTS,'errmsg'=>'请填写删除原因');
$url = Config('website.api_domain').'order/deleteGoods';
$check['k1'] = time();
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
$check['k1'] = time();
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
$resData = array(
"reason"=>$collert['reason'],
......@@ -848,9 +847,7 @@ Class OrderController extends Controller
$pay_time_limit = $payTime == 'other' ? $payTimeOther : $payTime;
} else {
$pay_time_limit = $request->input('pay_time_limit');
}
$url = Config('website.api_domain').'order/changeOrder';
}
$check['k1'] = time();
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
......@@ -888,6 +885,21 @@ Class OrderController extends Controller
"product_use_classone_sn" => $request->input('product_use_classone_sn', ''), // 终端客户信息 一级分类
"product_use_classtwo_sn" => $request->input('product_use_classtwo_sn', ''), // 终端客户信息 二级分类
];
$is_temp_save = $request->input('is_temp_save', '');
if ($is_temp_save) { // 临时保存接口
$resData['payTime'] = $payTime;
$resData['payTimeOther'] = $payTimeOther;
$url = Config('website.api_domain').'order/tempSaveOrder';
} else {
$auditor_role = $request->input('auditor_role', 1); // 当前操作人角色
$resData['status'] = $auditor_role == 3 ? 1 : 2; // 角色为‘查看自己’时,状态为待审核,否则为待付款
$url = Config('website.api_domain').'order/changeOrder';
}
// dd(curlApi($url, $resData, "POST"));
$temp = json_decode(curlApi($url, $resData, "POST"), true);
......@@ -895,6 +907,40 @@ Class OrderController extends Controller
}
}
// 主管审核
public function ajaxAuditPass(Request $request)
{
if ($request->isMethod('post')) {
$data['order_id'] = $request->input('order_id', '');
$data['operator_id'] = $request->user->userId;
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'order/managerAudit';
$temp = json_decode(curlApi($url, $data, "POST"), true);
return array('errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']);
}
}
// 反审
public function ajaxReAudit(Request $request)
{
if ($request->isMethod('post')) {
$data['order_id'] = $request->input('order_id', '');
$data['operator_id'] = $request->user->userId;
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'order/reAudit';
$temp = json_decode(curlApi($url, $data, "POST"), true);
return array('errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']);
}
}
// 驳回调价信息
public function ajaxRejected(Request $request)
{
......@@ -1482,13 +1528,13 @@ Class OrderController extends Controller
$temp = json_decode(curlApi($url, $userData, "POST"), true);
// 消息通知
$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) {
// $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 : '';
}
// if (!$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 : '';
// }
// 获取操作记录
$actionLog = DB::connection('order')->table('lie_order_action_log')->where('order_id', $id)->orderBy('create_time', 'DESC')->orderBy('log_id', 'DESC')->get();
......@@ -1497,7 +1543,7 @@ Class OrderController extends Controller
$erpPayLog = DB::connection('order')->table('lie_erp_pay_log')->where('order_id', $id)->orderBy('create_time', 'DESC')->orderBy('log_id', 'DESC')->get();
$response = [
'user_mobile' => $mobile,
// 'user_mobile' => $mobile,
'order_info' => $temp['data']['order_info'],
'user_info' => $temp['data']['order_info']['user_info'],
'company_info' => $temp['data']['order_info']['company_info'],
......
......@@ -42,7 +42,9 @@ Route::group(['middleware' => 'web'], function () {
Route::get('/change/{id}', 'OrderController@changeOrder');
Route::match(['get', 'post'], '/sendSales/{id?}', 'OrderController@sendSales');
Route::post('/ajaxdeletegoods', 'OrderController@ajaxdeletegoods');
Route::post('/ajaxSaveChange', 'OrderController@ajaxSaveChange');
Route::post('/ajaxSaveChange', 'OrderController@ajaxSaveChange');
Route::post('/ajaxAuditPass', 'OrderController@ajaxAuditPass');
Route::post('/ajaxReAudit', 'OrderController@ajaxReAudit');
Route::get('/check/{id}', 'OrderController@check');
Route::match(['get', 'post'], '/applyAdjust/{id}', 'OrderController@applyAdjust');
Route::match(['get', 'post'], '/send/{id}', 'OrderController@send');
......
......@@ -251,7 +251,8 @@
// 获取SKU信息
$('.get-sku').click(function() {
var sku_id = $(this).siblings('.search-sku').val();
var sku_id = $(this).siblings('.search-sku').val();
var user_id = $('.user_id').val() || 0;
if (!sku_id) {
layer.msg('请输入SKU_ID');
......@@ -266,7 +267,7 @@
$.ajax({
url: '/ajax/getSku',
type: 'post',
data: {sku_id : sku_id.trim()},
data: {sku_id : sku_id.trim(), user_id: user_id},
dataType: 'json',
success: function (resp) { console.log(resp)
if (resp.errcode != 0) {
......@@ -680,7 +681,7 @@
var supplier_id = $(this).data('sup_id');
var supplier_name = $(this).data('sup_name');
if (supplier_id == '7' || supplier_name.toLowerCase() == 'digikey') {
if (supplier_id == '7' || supplier_name.toString().toLowerCase() == 'digikey') {
is_dgk = true;
}
})
......
+(function($){
$.lie = $.lie || {version: "v1.0.0"};
$.extend($.lie, {
audit: {
index:function() {
// 主管审核
$('.manager-audit').click(function() {
var order_id = $(this).data('id');
// 弹出提示
layer.open({
area: ['360px'],
title: '提示信息',
content: '确定审核通过该订单吗?',
btn:['确定', '取消'],
yes: function(index, layero){
$.ajax({
url : '/ajaxAuditPass',
type: 'post',
data: {order_id: order_id},
dataType: 'json',
success: function (resp) {
if(resp.errcode === 0){
layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){
location.reload();
}, 1000);
} else {
layer.alert(resp.errmsg || '网络异常', function() {
location.reload();
});
}
},
error: function (res) {
console.log(res);
}
})
layer.msg('提交中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
},
btn2: function(index, layero){
layer.close(index);
}
});
})
// 反审
$('.re-audit').click(function() {
var order_id = $(this).data('id');
// 弹出提示
layer.open({
area: ['360px'],
title: '提示信息',
content: '确定再次审核该订单吗?',
btn:['确定', '取消'],
yes: function(index, layero){
$.ajax({
url : '/ajaxReAudit',
type: 'post',
data: {order_id: order_id},
dataType: 'json',
success: function (resp) {
if(resp.errcode === 0){
layer.msg(resp.errmsg || '操作成功');
window.open('/change/' + order_id, '_blank')
return false;
}
layer.alert(resp.errmsg || '网络异常');
return false;
},
error: function (res) {
console.log(res);
}
})
layer.msg('提交中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
},
btn2: function(index, layero){
layer.close(index);
}
});
})
},
}
})
})(jQuery)
\ No newline at end of file
+(function($){
$.lie = $.lie || {version: "v1.0.0"};
$.extend($.lie, {
send_mail: {
index:function() {
// 发送邮件
$(document).on('click','.send_mail', function(data){
var order_id = $(this).data('id');
var cc_sales_count = cc_sales.length;
var html = '';
for (var i = 0; i < cc_sales_count; i++) {
html += '<option value="'+cc_sales[i].userId+'">'+cc_sales[i].name+'</option>';
}
var content = '<div class="form-group">\
<label class="col-sm-4 control-label">是否有额外的抄送人员?</label>\
<div class="col-sm-8">\
<select id="cc_email" name="cc_email" class="form-control cc_email selectpicker" data-live-search="true" data-size="7" title="全部" multiple>\
'+html+'\
</select>\
</div>\
</div>\
<p style="padding-top: 50px;"><i class="error"> * </i>若无额外抄送人,直接点击‘确认’按钮即可</p>';
layer.open({
area: ['600px', '200px'],
title:'邮件抄送',
content: content,
btn:['确认', '取消'],
//提交事件
btn1:function(){
var cc_email = $('#cc_email').val();
$.ajax({
url: '/send_mail',
data: {id: order_id, cc_email: cc_email},
type:'post',
dataType: 'json',
success:function(resp){
if(resp.errcode == 0){
layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){
location.reload();
}, 1000);
return false;
} else {
layer.alert(resp.errmsg || '网络异常');
}
},
error:function(){
layer.alert('网络异常');
}
});
},
btn2:function(index){
layer.close(index);
}
});
$(".cc_email").selectpicker({
actionsBox:true, //在下拉选项添加选中所有和取消选中的按钮
countSelectedText:"已选中{0}项",
selectedTextFormat:"count > 5",
selectAllText: '全选',
deselectAllText: '取消全选',
})
$('.layui-layer-content').css('overflow', 'visible');
})
},
}
})
})(jQuery)
\ No newline at end of file
+(function($){
$.lie = $.lie || {version: "v1.0.0"};
$.extend($.lie, {
track: {
orderTrack:function() {
// 查看订单明细跟踪
$('.list-item-table').off().delegate('.order-track', 'click', function () {
var rid = $(this).data('rid');
$.ajax({
url : '/ajax/getOrderItemsTrack',
type: 'post',
data: {rec_id : rid},
success: function(resp) {
if (resp.errcode == 0) {
var data = resp.data;
var content = '<table class="table">\
<tr>\
<th width="30%">时间</th>\
<th>说明</th>\
<th width="13%">负责人</th>\
</tr>';
for (var i = 0; i < data.length; i++) {
content += '<tr><td>'+data[i].create_time+'</td><td>'+data[i].track_content+',数量:'+data[i].track_num+'</td><td>'+data[i].create_name+'</td></tr>';
}
content += '</table>';
layer.open({
title: '订单明细跟踪',
area: ['600px', '400px'],
content: content,
btn: [],
})
} else {
layer.alert(resp.errmsg || '网络异常');
}
},
error: function(err) {
console.log(err);
}
})
})
},
}
})
})(jQuery)
\ No newline at end of file
......@@ -9,6 +9,8 @@
@include('orderlist.css')
@include('orderlist.js')
<script src="/js/orderamount.js"></script>
</head>
<body class="">
......
<!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('detail.css')
@include('changeOrder.js')
</head>
<body class="">
<div id="wrapper">
<!-- layouts.navigation -->
@include('layouts.navigation')
<div id="page-wrapper" class="gray-bg">
<div class="row">
@include('changeOrder.content')
</div>
</div>
</div>
</body>
<div class="tabs-box adjusted_order" style="display: none;">
<div class="order-change-main">
<form id="adjustedOrderForm" class="form-horizontal table-responsive">
<input type="hidden" name="order_id" value="{{$order_info['order_id']}}">
<input type="hidden" name="sale_id" value="{{$order_info['sale_id']}}">
<input type="hidden" name="extra_fee" value="{{$order_temp_info['extra_fee']}}">
<input type="hidden" name="freight_fee" value="{{$order_temp_info['freight_fee']}}">
<input type="hidden" name="goods_amount" value="{{$order_temp_info['goods_amount']}}">
<input type="hidden" name="deposit_amount" value="{{$order_temp_info['deposit_amount']}}">
<input type="hidden" name="order_pay_type" value="{{$order_temp_info['order_pay_type']}}">
<input type="hidden" name="pay_time_limit" value="{{$order_temp_info['pay_time_limit']}}">
<input type="hidden" name="cancel_reason" value="{{isset($order_info['cancle_reason']) ? $order_info['cancle_reason'] : ''}}">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>型号</th>
<th>调整数量</th>
<th>调整单价</th>
</tr>
</thead>
<tbody>
@if (isset($order_temp_info['change_info']))
@foreach ($order_temp_info['change_info'] as $k => $v)
<tr>
<td>
<input type="hidden" name="change_info[{{$k}}][goods_name]" value="{{$v['goods_name']}}">
<p>{{$v['goods_name']}}</p>
</td>
<td>
<input type="hidden" name="change_info[{{$k}}][goods_number]" value="{{$v['goods_number']}}">
<p>{{$v['goods_number']}}</p>
</td>
<td>
<input type="hidden" name="change_info[{{$k}}][goods_price]" value="{{$v['goods_price']}}">
<p>{{$v['goods_price']}}</p>
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
<hr>
<table class="table table-bordered table-hover">
<tr>
<th width="20%">订单类型:</th>
<td>
@if ($order_temp_info['order_pay_type'] == 1)
全款
@elseif ($order_temp_info['order_pay_type'] == 2)
预付款
@else
账期
@endif
</td>
</tr>
<tr>
<th>商品总额:</th>
<td>{{$order_temp_info['goods_amount']}}</td>
</tr>
<tr>
<th>优惠金额:</th>
<td>{{$order_price_info['discount_amount']}}</td>
</tr>
<tr>
<th>附加费:</th>
<td>{{$order_temp_info['extra_fee']}}</td>
</tr>
<tr>
<th>运费:</th>
<td>{{$order_temp_info['freight_fee']}}</td>
</tr>
<?php $order_amount_temp = $order_temp_info['goods_amount'] + $order_price_info['discount_amount'] + $order_temp_info['extra_fee'] + $order_temp_info['freight_fee']; ?>
<tr>
<th>订单总额:</th>
<td>{{$order_amount_temp}}</td>
</tr>
@if ($order_info['order_goods_type'] == 2)
<tr>
<th>支付优惠:</th>
<td>{{$order_price_info['pay_preferential'] ? $order_price_info['pay_preferential'] : 0}}</td>
</tr>
<tr>
<th>实际支付金额:</th>
<td>{{$order_amount_temp + $order_price_info['pay_preferential']}}</td>
</tr>
@endif
@if ($order_temp_info['order_pay_type'] == 2)
<tr>
<th>定金:</th>
<td>{{$order_temp_info['deposit_amount']}}</td>
</tr>
@endif
<tr>
<th>付款时间:</th>
<td>{{$order_temp_info['pay_time_limit'].'天'}}</td>
</tr>
</table>
</form>
</div>
</div>
<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="/js/bootstrap-select.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/plugins/DatePicker/WdatePicker.js"></script>
<script src="/js/common.js"></script>
<script src="/js/change_order.js?v=<?= time() ?>"></script>
<script src="/js/goods.js?v=<?= time() ?>"></script>
<style>
#temp-save-info { display: none; }
#tempSaveForm { padding: 15px; }
</style>
<div id="temp-save-info">
<div class="order-change-main">
<form id="tempSaveForm" class="form-horizontal table-responsive">
@if ($order_temp_info['temp_save_info']['customer_cn'])
<table class="table table-bordered table-hover">
<tr class="caption">
<th colspan="4" style="text-align: center; background: #f9f9f9;">终端客户信息</th>
</tr>
<tr>
<th>客户名称(中文)</th>
<th>客户名称(英文)</th>
<th>客户类型</th>
<th>产品用途</th>
</tr>
<tr>
<td><?= $order_temp_info['temp_save_info']['customer_cn'] ?></td>
<td><?= $order_temp_info['temp_save_info']['customer_en'] ?></td>
<td><?= Config('params.end_user_type')[$order_temp_info['temp_save_info']['customer_type']] ?></td>
<td><?= $order_temp_info['temp_save_info']['product_use'] ?></td>
</tr>
</table>
@endif
<table class="table table-bordered table-hover">
<thead>
<tr>
<th width="40%">型号</th>
<th>调整数量</th>
<th>调整单价</th>
<th width="20%">状态</th>
</tr>
</thead>
<tbody>
@if (isset($order_temp_info['temp_save_info']['change_info']))
@foreach ($order_temp_info['temp_save_info']['change_info'] as $k => $v)
<tr>
<td>{{$v['goods_name']}}</td>
<td>{{$v['goods_number']}}</td>
<td>{{$v['goods_price']}}</td>
<td>
<?= $v['status'] == 1 ? '正常' : '<i style="color: red;">已取消</i>' ?>
@if (isset($v['is_add']))
<i style="color: green;">(新增)</i>
@endif
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
<hr>
<table class="table table-bordered table-hover">
<tr>
<th width="20%">订单类型:</th>
<td>
@if ($order_temp_info['temp_save_info']['order_pay_type'] == 1)
全款
@elseif ($order_temp_info['temp_save_info']['order_pay_type'] == 2)
预付款
@else
账期
@endif
</td>
</tr>
<tr>
<th>商品总额:</th>
<td>{{$order_temp_info['temp_save_info']['goods_amount']}}</td>
</tr>
<tr>
<th>优惠金额:</th>
<td>{{$order_price_info['discount_amount']}}</td>
</tr>
<tr>
<th>附加费:</th>
<td>{{$order_temp_info['temp_save_info']['extra_fee']}}</td>
</tr>
<tr>
<th>运费:</th>
<td>{{$order_temp_info['temp_save_info']['freight_fee']}}</td>
</tr>
<?php $order_amount_temp = $order_temp_info['temp_save_info']['goods_amount'] + $order_price_info['discount_amount'] + $order_temp_info['temp_save_info']['extra_fee'] + $order_temp_info['temp_save_info']['freight_fee']; ?>
<tr>
<th>订单总额:</th>
<td>{{$order_amount_temp}}</td>
</tr>
@if ($order_info['order_goods_type'] == 2)
<tr>
<th>支付优惠:</th>
<td>{{$order_price_info['pay_preferential'] ? $order_price_info['pay_preferential'] : 0}}</td>
</tr>
<tr>
<th>实际支付金额:</th>
<td>{{$order_amount_temp + $order_price_info['pay_preferential']}}</td>
</tr>
@endif
@if ($order_temp_info['temp_save_info']['order_pay_type'] == 2)
<tr>
<th>定金:</th>
<td>{{$order_temp_info['temp_save_info']['deposit_amount']}}</td>
</tr>
@endif
<tr>
<th>付款时间:</th>
<td>{{$order_temp_info['temp_save_info']['pay_time_limit'].'天'}}</td>
</tr>
<tr>
<th>客服备注:</th>
<td>{{ $order_temp_info['temp_save_info']['kefu_remark'] }}</td>
</tr>
</table>
</form>
</div>
</div>
<script>
var temp_save_info = '{!! json_encode($order_temp_info["temp_save_info"]) !!}';
temp_save_info = eval('('+temp_save_info+')');
console.log(temp_save_info)
</script>
......@@ -8,8 +8,8 @@
{{ Autograph() }}
@include('orderlist.css')
@include('orderlist.js')
@include('detail.css')
@include('detail.js')
</head>
<body class="">
......
<p style="margin-left: 5px;">取消订单</p>
<div class="tabs-box cancelPay-order">
<?php
switch($order_info['status']) {
case 2:
echo '<table class="table">
<tr>
<td width="10%">取消订单原因:</td>
<td>
<textarea name="" id="cancel-reason" class="form-control" placeholder="请输入取消原因"></textarea>
</td>
</tr>
<tr><td colspan="20"><a class="btn btn-primary submit">提交</a></td></tr>
</table>';
break;
case -1:
echo '已取消';
break;
}
?>
</div>
\ No newline at end of file
......@@ -18,7 +18,6 @@
<input type="hidden" name="goods_amount" value="{{$order_price_info['goods_price']}}">
<input type="hidden" name="order_amount" value="{{$order_info['order_amount']}}">
<input type="hidden" name="cancel_reason" value="{{isset($order_info['cancle_reason']) ? $order_info['cancle_reason'] : ''}}">
<input type="hidden" name="user_mobile" value="{{$user_mobile}}">
<input type="hidden" name="check_failed" value="">
<input type="hidden" name="check_failed_info" value="">
<input type="hidden" name="change_pay_type" value="">
......@@ -568,7 +567,7 @@
@include('detail.addGoodsNoSkuid')
<script>
var is_manager = "{{ in_array($role, [1, 2]) ? true : false }}";
var is_manager = "{{ in_array($role, [1, 2, 5]) ? true : false }}";
var isNewClient = "{{isset($isNewClient) ? $isNewClient : 0}}";
// var order_amount = "{{$order_info['order_amount']}}";
......
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/bootstrap-select.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
<p>操作记录</p>
<div class="tabs-box table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>操作时间</th>
<th>操作人</th>
<th>操作事件</th>
</tr>
</thead>
<tbody>
<?php foreach ($actionLog as $k=>$v) { ?>
<?php if ($k < 4) { ?>
<tr>
<td width="15%"><?= date('Y-m-d H:i:s', $v->create_time) ?></td>
<td width="10%"><?= App\Http\Controllers\getOperatorName($v->operator_id, $v->operator_type) ?></td>
<td><?= $v->event ?></td>
</tr>
<?php } else { ?>
<tr class="other-infos">
<td width="15%"><?= date('Y-m-d H:i:s', $v->create_time) ?></td>
<td width="10%"><?= App\Http\Controllers\getOperatorName($v->operator_id, $v->operator_type) ?></td>
<td><?= $v->event ?></td>
</tr>
<?php } ?>
<?php if ($k >= 4 && $k == count($actionLog)-1) { ?>
<tr>
<td colspan="3" class="text-center click-down"><i class="fa fa-angle-double-down">点击展开</i></td>
<td colspan="3" class="text-center click-up"><i class="fa fa-angle-double-up">点击收起</i></td>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
</div>
\ No newline at end of file
<div style="width: 100%; height: 40px;">
<h3 style="float: left; width: 100px;">收货信息</h3>
<?php
// <!-- 订单状态小于5 且 更新地址权限存在 显示按钮 -->
if (!$tags) {
if (in_array($order_info['status'], array(1, 2, 3, 4)) && in_array('update_address', $userPerms)) {
echo '<a href="/changeShipping/'.$order_info['order_id'].'" class="btn btn-success btn-sm changeBtn">更改收货地址</a>';
}
} elseif (isset($tags) && $tags == 'self') {
if (in_array($order_info['status'], array(1, 2, 4)) && in_array('self_order_update_address', $userPerms)) {
echo '<a href="/changeShipping/'.$order_info['order_id'].'?tags='.$tags.'" class="btn btn-success btn-sm changeBtn">更改收货地址</a>';
}
}
?>
</div>
<div class="table-responsive">
<table class="table table-bordered text-nowrap">
<tr>
<th width="15%">收货人</th>
<th width="18%">联系电话/手机</th>
<th width="15%">配送方式</th>
<?php if ($order_info['order_shipping_type'] == 2) { ?>
<th>自提地址</th>
<?php } else { ?>
<th>收货地址</th>
<?php } ?>
</tr>
<tr>
<td><?= $order_address_info['consignee'] ?></td>
<td><?= $order_address_info['mobile'] ?></td>
<?php if ($order_info['order_shipping_type'] == 2) { ?>
<td>客户自提</td>
<td><?= $order_address_info['address'] ?></td>
<?php } else { ?>
<td>快递送货</td>
<td>
<?= $order_address_info['province_val'] ?>&nbsp;&nbsp;<?= $order_address_info['city_val'] ?>&nbsp;&nbsp;<?= $order_address_info['district_val'] ?>&nbsp;&nbsp;<?= $order_address_info['address'] ?>
</td>
<?php } ?>
</tr>
</table>
</div>
<div style="width: 100%; height: 40px;">
<h3>基本资料</h3>
</div>
<table class="table table-bordered order-express">
<tr>
<!-- @if ($order_info['order_type_extend'])
<th>订单类型</th>
@endif
@if ($order_info['order_goods_type'] == 2)
<th>销售类型</th>
@endif
@if ($order_temp_info['business_type'])
<th>业务类型</th>
@endif
@if ($order_info['order_pay_type'] == 2)
<th>预付款</th>
<th>尾款</th>
@endif -->
<th width="5%">订单编号</th>
<th>订单状态</th>
<th>用户账号</th>
<th>支付方式</th>
<th>支付状态</th>
<th>支付类型</th>
<th>发货状态</th>
<th>物流单号</th>
<th>京东订单编号</th>
<th width="8%">自动确认收货时间</th>
</tr>
<tr>
<td>{{ $order_info['order_sn'] }}</td>
<td>{{ $order_temp_info['is_manager_audit'] ? '待主管审核' : Config('params.order_status')[$order_info['status']] }}</td>
<td>{{ $user_info['mobile'] ? $user_info['mobile'] : $user_info['email'] }}</td>
<td>
<?php
if ($order_info['order_pay_type'] == 2) { // 预付款
if (isset($order_pay_log[1]) && $order_pay_log[1]['pay_name'] != '') {
echo $order_pay_log[1]['pay_name'];
} else if (!empty($order_pay_log) && $order_pay_log[0]['pay_name'] != '') {
echo $order_pay_log[0]['pay_name'];
} else {
echo '--';
}
} else {
if (!empty($order_pay_log) && $order_pay_log[0]['pay_name'] != '') {
echo $order_pay_log[0]['pay_name'];
} else {
echo '--';
}
}
?>
</td>
<td>
<?php
if ($order_info['order_pay_type'] == 2) {
if (isset($order_pay_log[1]) && $order_pay_log[1]['is_paid'] != '') {
echo $order_pay_log[1]['is_paid'] == 1 ? '尾款已支付' : '未支付';
} else if (!empty($order_pay_log) && $order_pay_log[0]['is_paid'] != '') {
echo $order_pay_log[0]['is_paid'] == 1 ? '首款已支付' : '未支付';
} else {
echo '--';
}
} else {
if (!empty($order_pay_log) && $order_pay_log[0]['is_paid'] != '') {
echo $order_pay_log[0]['is_paid'] == 1 ? '已支付' : '未支付';
} else {
echo '--';
}
}
?>
</td>
<td>
<?php
if ($order_info['order_pay_type'] == 1) {
if (!empty($order_pay_log)) {
echo '全款';
} else {
echo '--';
}
} else if ($order_info['order_pay_type'] == 2) {
if (isset($order_pay_log[1])) {
echo '尾款';
} else if (!empty($order_pay_log)) {
echo '预付款';
} else {
echo '--';
}
} else if ($order_info['order_pay_type'] == 3) {
if (!empty($order_pay_log)) {
echo '账期';
} else {
echo '--';
}
}
?>
</td>
<td>
<?php
if ($order_shipping_info) {
switch ($order_shipping_info['status']) {
case -1: echo '未配送'; break;
case 1: echo '配送中'; break;
case 2: echo '已签'; break;
default: echo '未知'; break;
}
} else {
echo '未发货';
}
?>
</td>
<td>{{ $order_shipping_info ? $order_shipping_info['shipping_no'] : '无' }}</td>
<td>{{ $order_temp_info['jd_order_id'] }}</td>
<td>7天</td>
<!--
@if ($order_info['order_type_extend'])
<td>
<?php
switch ($order_info['order_type_extend']) {
case 1: echo '团购订单'; break;
}
?>
</td>
@endif
@if ($order_info['order_goods_type'] == 2)
<td>{{ $order_info['sale_type'] == 1 ? '现卖' : '预售' }}</td>
@endif
@if ($order_temp_info['business_type'])
<td>{{ Config('params.business_type')[$order_temp_info['business_type']] }}</td>
@endif
@if ($order_info['order_pay_type'] == 2)
<td>{{$currency.$order_info['advance_amount']}}</td>
<td>
{{$currency.number_format($order_info['order_amount'] - $order_info['advance_amount'], 2, '.', '')}}
</td>
@endif
<td>{{ $order_info['pay_time'] ? date('Y-m-d H:i:s', $order_info['pay_time']) : '' }}</td> -->
</tr>
</table>
\ No newline at end of file
<p>ERP支付记录</p>
<div class="tabs-box table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>创建时间</th>
<th>收款单号</th>
<th>收款金额</th>
<th>收款时间</th>
<th>支付状态</th>
<th>取消支付时间</th>
</tr>
</thead>
<tbody>
<?php foreach ($erpPayLog as $k=>$v) { ?>
<?php if ($k < 4) { ?>
<tr>
<td width="15%"><?= date('Y-m-d H:i:s', $v->create_time) ?></td>
<td width="10%"><?= $v->receipt_sn ?></td>
<td width="10%"><?= $v->receipt_amount ?></td>
<td width="10%"><?= date('Y-m-d H:i:s', $v->receipt_time) ?></td>
<td><?= $v->status == 1 ? '已支付' : '已取消' ?></td>
<td><?= $v->cancel_time ? date('Y-m-d H:i:s', $v->cancel_time) : '' ?></td>
</tr>
<?php } else { ?>
<tr class="other-infos">
<td width="15%"><?= date('Y-m-d H:i:s', $v->create_time) ?></td>
<td width="10%"><?= $v->receipt_sn ?></td>
<td width="10%"><?= $v->receipt_amount ?></td>
<td width="10%"><?= date('Y-m-d H:i:s', $v->receipt_time) ?></td>
<td><?= $v->status == 1 ? '已支付' : '已取消' ?></td>
<td><?= $v->cancel_time ? date('Y-m-d H:i:s', $v->cancel_time) : '' ?></td>
</tr>
<?php } ?>
<?php if ($k >= 4 && $k == count($erpPayLog)-1) { ?>
<tr>
<td colspan="6" class="text-center click-down"><i class="fa fa-angle-double-down">点击展开</i></td>
<td colspan="6" class="text-center click-up"><i class="fa fa-angle-double-up">点击收起</i></td>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
</div>
\ No newline at end of file
<div style="width: 100%; height: 40px;">
<h3 style="float: left; width: 100px;">发票收货信息</h3>
</div>
<div class="table-responsive">
<table class="table table-bordered text-nowrap">
<tr>
<th width="15%">收票人</th>
<th width="18%">联系电话/手机</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>
</div>
\ No newline at end of file
<p>物流信息</p>
<div class="tabs-box table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th width="15%">物流时间</th>
<th>物流信息</th>
</tr>
</thead>
<tbody>
<?php if (!empty($order_shipping_info['info'])) { ?>
<?php $shippings_info = json_decode($order_shipping_info['info'], true); ?>
<?php foreach ($shippings_info as $k=>$v) { ?>
<?php if ($k < 4) { ?>
<tr>
<td><?= $v['AcceptTime'] ?></td>
<td><?= $v['AcceptStation'] ?></td>
</tr>
<?php } else { ?>
<tr class="other-infos">
<td><?= $v['AcceptTime'] ?></td>
<td><?= $v['AcceptStation'] ?></td>
</tr>
<?php } ?>
<?php if ($k >= 4 && $k == count($shippings_info)-1) { ?>
<tr>
<td colspan="2" class="text-center click-down"><i class="fa fa-angle-double-down">点击展开</i></td>
<td colspan="2" class="text-center click-up"><i class="fa fa-angle-double-up">点击收起</i></td>
</tr>
<?php } ?>
<?php } ?>
<?php } else { ?>
<?php foreach ($order_shipping_inside as $k=>$v) { ?>
<?php if ($k < 4) { ?>
<tr>
<td><?= date('Y-m-d H:i:s', $v['create_time']) ?></td>
<td><?= $v['info'] ?></td>
</tr>
<?php } else { ?>
<tr class="other-infos">
<td><?= date('Y-m-d H:i:s', $v['create_time']) ?></td>
<td><?= $v['info'] ?></td>
</tr>
<?php } ?>
<?php if ($k >= 4 && $k == count($order_shipping_inside)-1) { ?>
<tr>
<td colspan="2" class="text-center click-down"><i class="fa fa-angle-double-down">点击展开</i></td>
<td colspan="2" class="text-center click-up"><i class="fa fa-angle-double-up">点击收起</i></td>
</tr>
<?php } ?>
<?php } ?>
<?php } ?>
</tbody>
</table>
</div>
\ 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="/js/bootstrap-select.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/plugins/DatePicker/WdatePicker.js"></script>
<script src="/js/common.js"></script>
<script src="/js/md5.js"></script>
<script src="/js/layui/layui.js"></script>
<script src="/js/details.js?v=<?= time() ?>"></script>
<script src="/js/order_audit.js"></script>
<script src="/js/order_track.js"></script>
<script src="/js/order_cancel.js"></script>
<script src="/js/order_send_email.js"></script>
<script src="/js/refund.js?v=<?= time() ?>"></script>
<p style="margin-left: 5px;">订单发货</p>
<div class="tabs-box send">
<table class="table">
<input type="hidden" id="order_id" value="{{$order_info['order_id']}}">
</table>
<table class="table">
<?php
$html = '';
if ($order_info['order_shipping_type'] == 1) {
switch ($order_shipping_info['status']) {
case 1:
echo '<tr>配送中,物流单号为'.$order_shipping_info['shipping_no'].',配送方式为&nbsp;'.$ship_type[$order_shipping_info['shipping_id']].'</tr>';
break;
case 2:
echo '<tr>已签,订单完成</tr>';
break;
default:
// if (count($order_items_info) > 0) {
// foreach ($order_items_info as $k => $item) {
// $html .= '<tr>
// <td>
// <label>型号名:</label>
// <span>'.$item['goods_name'].'</span>
// </td>';
$html .= '<tr>
<td>
<label>选择快递:</label>
<select class="batch-shipping-code">';
foreach ($shippings as $v) {
$html .= '<option value="'.$v->shipping_id.'">'.$v->shipping_name.'</option>';
}
$html .= '</select>
</td>
<td>
<label>填写单号:</label>
<input type="text" class="batch-shipping-no" value="'.$order_shipping_info['shipping_no'].'" />
</td>
<td><a class="btn btn-default batch-send">确认发货</a></td>
</tr>';
// }
// }
echo $html;
break;
}
} else {
echo '<tr>
<td>线下自提</td>
</tr>';
}
?>
</table>
</div>
\ No newline at end of file
......@@ -289,17 +289,21 @@
</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;
}
if ($order_extend->is_manager_audit) {
echo '<span class="list-text-checking"><b>待主管审核</b></span>';
} else {
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"> {{ Config('params.order_pay_type')[$v['order_pay_type']] }} </td>
......@@ -325,11 +329,24 @@
<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" style="width: 240px;">
<div class="btn-group btn-group-xs" style="width: 260px;">
<a class="btn btn-primary" href="{{URL('details', ['order_id'=>$v['order_id']])}}" target="_blank">详情</a>
@if (in_array('check_order', $userPerms) && in_array($v['status'], [1, 2, 3]))
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$v['order_id']])}}" target="_blank">人工审单</a>
@if (in_array('check_order', $userPerms) && $v['sale_id'])
@if ($v['status'] == 1)
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$v['order_id']])}}" target="_blank">人工审单</a>
@elseif ($v['status'] == 2 && in_array($role, [1, 2]))
<a class="btn btn-success re-audit" data-id="{{$v['order_id']}}">反审</a>
@endif
@endif
<!-- 主管审核 -->
@if ($order_extend->is_manager_audit && in_array($role, [1, 2]) && $v['status'] == 1)
<a class="btn btn-danger manager-audit" data-id="{{$v['order_id']}}">主管审核</a>
@endif
@if (!empty($order_extend->erp_sn))
<a class="btn btn-primary send_mail" data-id="{{ $v['order_id'] }}">发送邮件</a>
@endif
<!-- 管理员和经理或有推送权限显示 -->
......@@ -411,6 +428,7 @@
var erp_order_id = "{{$condition['erp_order_id']}}";
var is_new_order = "{{$condition['is_new_order']}}";
var manager = "{{$role}}";
var cc_sales = eval('{!! isset($cc_sales) ? json_encode($cc_sales) : '' !!}'); // 抄送人集合
if (test_order) {
$('input[name=test_order]').attr('checked', true);
......@@ -436,6 +454,10 @@
$('#is_new_order').selectpicker('val', is_new_order);
$.lie.order.index();
$.lie.track.orderTrack();
$.lie.cancel.cancelorder();
$.lie.audit.index();
$.lie.send_mail.index();
// 展开菜单
$('#side-menu').children('li').eq(1).addClass('active');
......
......@@ -6,13 +6,14 @@
<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/plugins/DatePicker/WdatePicker.js"></script>
<script src="/js/common.js"></script>
<script src="/js/md5.js"></script>
<script src="/js/layui/layui.js"></script>
<script src="/js/order.js?v=<?= time() ?>"></script>
<script src="/js/orderamount.js"></script>
<script src="/js/plugins/DatePicker/WdatePicker.js"></script>
<script src="/js/refund.js?v=<?= time() ?>"></script>
<script src="/js/goods.js?v=<?= time() ?>"></script>
<script src="/js/list.js?v=<?= time() ?>"></script>
<script src="/js/order_audit.js"></script>
<script src="/js/order_track.js"></script>
<script src="/js/order_cancel.js"></script>
<script src="/js/order_send_email.js"></script>
......@@ -376,7 +376,7 @@
<div class="btn-group btn-group-xs" style="width: 240px;">
<a class="btn btn-primary" href="/details/{{$v['order_id']}}?tags=self" target="_blank">详情</a>
@if (in_array('self_check_order', $userPerms) && in_array($v['status'], [1, 2]))
@if (in_array('self_check_order', $userPerms) && in_array($v['status'], [1, 2]) && $v['sale_id'])
<a class="btn btn-success" href="/change/{{$v['order_id']}}?tags=self" target="_blank">人工审单</a>
@endif
......@@ -479,4 +479,6 @@
$('.business_type').selectpicker('val', business_type.split(',')).trigger("change");
$.lie.order.index();
$.lie.track.orderTrack();
$.lie.cancel.cancelorder();
</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