Commit 0e9773fb by 朱继来

fix

parent 18446595
......@@ -329,6 +329,24 @@ Class AddOrderController extends Controller
}
}
// 切换销售类型
public function switchSaleType(Request $request)
{
if ($request->isMethod('post')) {
$data['sale_type'] = $request->input('sale_type');
$data['cart_ids'] = $request->input('cart_ids');
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'cart/switchSaleType';
$response = json_decode(curlApi($url, $data), true);
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg']];
}
}
// 获取购物车列表
public function cartList(Request $request)
{
......@@ -423,6 +441,52 @@ Class AddOrderController extends Controller
}
}
// 检查期货库存
public function checkStock(Request $request)
{
if ($request->isMethod('post')) {
$cart_info = json_decode($request->input('cart_info', ''), true);
$sale_type = $request->input('sale_type', 1);
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'goods/detail';
$warning_arr = array();
foreach ($cart_info as $k=>$v) {
$data['id'] = $v['gid'];
$response = json_decode(curlApi($url, $data), true);
if ($sale_type == 1) {
// 现货订单--判断下单数量是否大于库存,若大于则弹出提示信息
if ($v['num'] > $response['data']['goods_number']) {
$temp['goods_name'] = $response['data']['goods_name']; // 型号
$temp['stock'] = $response['data']['goods_number']; // 可用库存
$warning_arr[] = $temp;
$errmsg = '库存不足,建议设置为期货类型';
}
} else {
// 期货订单--判断下单数量是否小于库存,若小于则弹出提示信息
if ($v['num'] < $response['data']['goods_number']) {
$temp['goods_name'] = $response['data']['goods_name']; // 型号
$temp['stock'] = $response['data']['goods_number']; // 可用库存
$warning_arr[] = $temp;
$errmsg = '您提交的数量有实际库存,建议直接购买现货';
}
}
}
if (!empty($warning_arr)) {
return ['errcode' => -1, 'errmsg' => $errmsg, 'data'=>json_encode($warning_arr)];
}
return ['errcode' => 0, 'errmsg' => ''];
}
}
// 提交订单
public function create(Request $request)
{
......@@ -442,10 +506,11 @@ Class AddOrderController extends Controller
$data['user_coupon_id'] = $request->input('user_coupon_id');
}
$data['sale_type'] = $request->input('sale_type', ''); // 自营线上选择销售类型
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
// $url = Config('website.api_domain').'order/createByOrderSystem';
$url = Config('website.api_domain').'order/create';
$response = json_decode(curlApi($url, $data), true);
......
......@@ -287,6 +287,23 @@ function getSupplierName($key)
return $supp_info;
}
// 获取自营库存
function getSelfStock($goods_id)
{
if (!$goods_id) return '商品ID不存在';
$url = Config('website.self-stock-url');
$data['sku_id'] = $goods_id;
$response = json_decode(curlApi($url, $data, 'POST'), true);
if ($response['errcode'] == 0) {
return $response['data']['stock'];
} else {
return '未找SKU信息';
}
}
Class OrderController extends Controller
{
// 首页
......@@ -386,6 +403,7 @@ Class OrderController extends Controller
$map['time_start'] = $request->input('time_start', '');
$map['time_end'] = $request->input('time_end', '');
$map['order_status'] = $request->input('order_status', '');
$map['sale_type'] = $request->input('sale_type', '');
$map['shipping_name'] = $request->input('shipping_name', '');
$map['order_send'] = $request->input('order_send', '');
$map['test_order'] = $request->input('test_order', '');
......@@ -606,21 +624,21 @@ Class OrderController extends Controller
// 详情页
public function templateData(Request $request, $id, $view_id)
{
$data = $this->orderDetail($request, $id);
$info = $this->orderDetail($request, $id);
if ($data['order_info']['order_goods_type'] == 2 && in_array($data['order_info']['order_type'], [1, 3])) { // 平台自营订单
if ($info['order_info']['order_goods_type'] == 2 && in_array($info['order_info']['order_type'], [1, 3])) { // 平台自营订单
if ($request->input('tags') != 'self') {
return redirect('self_order'); // URL重定向
} else {
$this->selfOtherData($data, $id);
$this->selfOtherData($info, $id);
}
}
return view($view_id, $data);
return view($view_id, $info);
}
// 详情页自营其他数据
public function selfOtherData(&$data, $order_id)
public function selfOtherData(&$info, $order_id)
{
$shipping = DB::connection('order')->table('lie_shipping')->select('shipping_id', 'shipping_name')->get();
......@@ -629,14 +647,12 @@ Class OrderController extends Controller
$shippingInfo[$v->shipping_id] = $v->shipping_name;
}
$data['shippings'] = $shippingInfo;
$info['shippings'] = $shippingInfo;
}
$extend = DB::connection('order')->table('lie_order_extend')->where(['order_id' => $order_id, 'order_type' => 3])->first();
$data['extend'] = $extend ? $extend : '';
$extend = DB::connection('order')->table('lie_order_extend')->where(['order_id' => $order_id, 'order_type' => 3])->first(); // 自营线下订单
return $data;
$info['extend'] = $extend ? $extend : '';
}
// 外部引用
......@@ -650,6 +666,14 @@ Class OrderController extends Controller
{
$info = $this->orderDetail($request, $id);
if ($info['order_info']['order_goods_type'] == 2 && in_array($info['order_info']['order_type'], [1, 3])) { // 平台自营订单
if ($request->input('tags') != 'self') {
return redirect('self_order'); // URL重定向
} else {
$this->selfOtherData($info, $id);
}
}
// 账期订单跳转到详情页
if ($info['order_info']['status'] == 4) {
return redirect('/details/'.$id);
......@@ -862,35 +886,29 @@ Class OrderController extends Controller
return redirect('/prompt')->with(['message'=>"该订单无法再进行调价操作",'url' =>'/details/'.$id, 'jumpTime'=>3,'status'=>false]);
}
$data['confirm_time'] = 0;
$data['pay_time'] = 0;
$data['status'] = 1;
// $data['sale_id'] = 0; // 再次调价调整sale_id
$url = Config('website.api_domain').'order/applyAdjust';
$update = DB::connection('order')->table('lie_order')->where('order_id', $id)->update($data);
$check['k1'] = time();
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
if (!$update) {
errorLog(Error::E_UPDATE_FAILED, '调价操作更新数据失败');
return redirect('/prompt')->with(['message'=>"调价操作更新数据失败!",'url' =>'/details/'.$id, 'jumpTime'=>3,'status'=>false]);
}
$resData = array("order_id"=>$id, "pf"=>1, "k1"=>$check['k1'], "k2"=>$check['k2'], "operator_id" => $request->user->userId);
$extend = DB::connection('order')->table('lie_order_extend')->where(['order_id' => $id])->first();
$temp = json_decode(curlApi($url, $resData, "POST"), true);
if ($extend) {
// 调价失败临时表状态更改
DB::connection('order')->table('lie_order_extend')->where(['order_id' => $id])->update(['status' => 0]);
}
// url 标签
$tags = $request->input('tags', '');
// 操作记录
$log['order_id'] = $id;
$log['operator_id'] = $request->user->userId;
$log['operator_type'] = 2;
$log['event'] = '再次调价';
$log['ip'] = get_client_ip();
$log['create_time'] = time();
DB::connection('order')->table('lie_order_action_log')->insert($log);
if ($tags) {
$param = '?tags='.$tags;
} else {
$param = '';
}
return redirect('/change/'.$id);
if ($temp['err_code'] == 0) {
return redirect('/change/'.$id.$param);
} else {
return redirect('/prompt')->with(['message'=>$temp['err_msg'],'url' =>'/details/'.$id.$param, 'jumpTime'=>3,'status'=>false]);
}
}
// 填写订单取消原因
......
......@@ -10,7 +10,7 @@
],
'自营订单' => [
'订单列表' => ['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_check_pay'],
'订单列表' => ['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_check_pay', 'self_check_order'],
'快递配置' => ['self_order_express_set_check'],
......@@ -25,4 +25,7 @@
'自营订单统计' => ['self_order_count_check'],
],
'账期管理' => [
'申请列表' => ['order_account_apply_check'],
],
];
\ No newline at end of file
......@@ -65,4 +65,7 @@ return [
// 新增自营线上订单付款地址
'pay_online_url' => 'http://www.liexin.com/v3/pay/online?id=',
// 获取自营商品库存
'self-stock-url' => 'http://footstone.liexin.net/webapi/goods_details?sku_id=',
];
......@@ -480,6 +480,39 @@
loading.confirm(user_id, address_id, cart_ids, coupon_id, goods_type); // 确认订单信息
})
// 切换销售类型
$('#sale_type').change(function() {
var coupon_id = $('.user_coupon_id').val();
var address_id = $('.address_id').val();
var user_id = $('.user_id').val();
var sale_type = $(this).val();
var cart_ids = [];
$('.shop-table tbody').find('tr').each(function() {
var cid = $(this).data('cid');
cart_ids.push(cid);
})
if (cart_ids.length > 0) {
$.ajax({
type: "POST",
url: '/ajax/switchSaleType',
data: {sale_type: sale_type, cart_ids: cart_ids},
dataType: "json",
success: function(resp){
if (resp.errcode == 0) {
layer.msg(resp.errmsg);
loading.lists(user_id, goods_type, is_online); // 加载购物车列表
return false;
}
layer.msg(resp.errmsg);
},
})
}
})
// 提交订单
$('.submit-order').click(function() {
var address_id = $('input[name=address_id]').val();
......@@ -500,6 +533,7 @@
})
if (cart_ids.length > 0) {
var submit = true;
var datax = {
uid: user_id,
sale_id: sale_id,
......@@ -531,6 +565,51 @@
datax.user_coupon_id = user_coupon_id;
}
// 自营线上
if (type == 2) {
var sale_type = $('#sale_type').val();
var cart_info = [];
$('.shop-table tbody tr').each(function() {
var gid = $(this).find('.goods_id').text();
var num = $(this).find('.goods_num').val();
cart_info.push({'gid':gid, 'num':num});
})
$.ajax({
type: "POST",
url: '/ajax/checkStock',
data: {cart_info: JSON.stringify(cart_info), sale_type: sale_type},
dataType: "json",
async: false,
success: function(resp){
if (resp.errcode == -1) {
var data = eval(resp.data);
var content = '<p>'+resp.errmsg+'</p>';
submit = false;
for (var i = 0; i < data.length; i++) {
content += '<p><span>'+(i+1)+'、</span>'+data[i]['goods_name']+',可用库存:'+data[i]['stock']+'</p>';
}
// 弹出提示
layer.open({
area: ['500px', '300px'],
title: '提示信息',
content: content,
btn: [],
});
return false;
}
},
})
}
if (submit) {
$.ajax({
type: "POST",
url: '/ajax/create',
......@@ -547,6 +626,7 @@
layer.alert(resp.errmsg);
},
})
}
} else {
layer.msg('请先添加商品');
}
......@@ -576,7 +656,7 @@
// 购物车列表
for (var i = 0; i < len; i++) {
html += '<tr data-cid="'+list[i].cart_id+'">'+
'<td>'+list[i].goods_id+'</td>'+
'<td class="goods_id">'+list[i].goods_id+'</td>'+
'<td>'+list[i].goods_name+'</td>'+
'<td>'+list[i].brand_name+'</td>'+
'<td><input type="text" class="goods_num" name="goods_num" value="'+list[i].goods_number+'"></td>'+
......@@ -593,6 +673,8 @@
$('.shop-lists').show();
$('.shop-table tbody').empty().append(html);
$('#sale_type').val(list[0].sale_type); // 自营线上订单选择销售类型
var address_id = $('.address_id').val();
self.confirm(user_id, address_id, cart_ids, user_coupon_id, goods_type, is_online); // 确认订单信息
}
......
......@@ -1084,7 +1084,7 @@
$(this).find('.sup_amount_val').text(supplier[sup]);
})
var fee = parseFloat($('input[name="extra_fee"]').val());
var fee = $('input[name="extra_fee"]').val() ? parseFloat($('input[name="extra_fee"]').val()) : 0;
var total = parseFloat(goods_total + fee).toFixed(2);
goods_total = goods_total.toFixed(2);
......@@ -1228,13 +1228,15 @@
var is_newClient = $('input[name=is_newClient]:checked').val();
var client_source = $('input[name=client_source]:checked').val();
var order_status = $('input[name=order_status]:checked').val();
var pay_type = $('input[name=order_pay_type]:checked').val(); // 订单类型
var pay_type = $('input[name=order_pay_type]:checked').val(); // 订单付款类型
var reason = $('input[name=reason]:checked').val();
var payTime = $('.payTime').val();
var payTimeOther = $('.payTimeOther').val();
var sale_id = $('input[name=sale_id]').val();
var order_goods_type = $('input[name=order_goods_type]').val();
if (sale_id == 0) {
// 联营订单需要先指派业务员
if (order_goods_type == 1 && sale_id == 0) {
layer.alert('请先将订单推送给业务员', function(){
location.href = '/sendSales/'+$('input[name=order_id]').val();
});
......@@ -1326,11 +1328,6 @@
}
}
var currencySign = currency == 1 ? '¥' : '$';
var goods_amount = currencySign+$('input[name=goods_amount]').val();
var order_amount = currencySign+$('input[name=order_amount]').val();
var extra_fee = $('input[name=extra_fee]').val() == '' ? '' : currencySign+$('input[name=extra_fee]').val();
if (!is_manager) {
// 设置默认值false
$('input[name=check_failed]').val(0);
......@@ -1359,10 +1356,21 @@
}
}
var currencySign = currency == 1 ? '¥' : '$';
var goods_amount = currencySign+$('input[name=goods_amount]').val();
var order_amount = currencySign+$('input[name=order_amount]').val();
if (order_goods_type == 1) {
var extra_fee = $('input[name=extra_fee]').val() ? currencySign+'0' : currencySign+$('input[name=extra_fee]').val();
var content = '<div><p class="error">请核对订单金额,谨慎操作!</p><div><p>商品总金额:'+goods_amount+'</p><p>附加费金额:'+extra_fee+'</p><p>订单总金额:<span class="error">'+order_amount+'</span></p></div></div>';
} else {
var content = '<div><p class="error">请核对订单金额,谨慎操作!</p><div><p>商品总金额:'+goods_amount+'</p><p>订单总金额:<span class="error">'+order_amount+'</span></p></div></div>';
}
// 弹出提示
layer.open({
title: '提醒',
content: '<div><p class="error">请核对订单金额,谨慎操作!</p><div><p>商品总金额:'+goods_amount+'</p><p>附加费金额:'+extra_fee+'</p><p>订单总金额:<span class="error">'+order_amount+'</span></p></div></div>',
content: content,
btn:['取消','确定'],
yes: function(index, layero){
layer.close(index);
......
......@@ -12,6 +12,7 @@
time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(),
order_status = $('#order_status').data('default'),
sale_type = $('#sale_type').data('default'),
// order_send = $('#order_send').data('default'),
order_source_pf = $('#order_source_pf').data('default'),
order_payment_mode = $('#order_payment_mode').data('default'),
......@@ -44,6 +45,10 @@
listUrl += '&order_status=' + order_status;
}
if (sale_type) {
listUrl += '&sale_type=' + sale_type;
}
// if (order_send) {
// listUrl += '&order_send=' + order_send;
// }
......@@ -76,7 +81,7 @@
listUrl += '&test_order=' + 1;
}
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_source_pf && !order_source_adtag && !order_source_ptag && (is_new === '') && !test_order.is(':checked')) {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !sale_type && !order_invoice_status && !order_source_pf && !order_source_adtag && !order_source_ptag && (is_new === '') && !test_order.is(':checked')) {
listUrl = '/self_order';
}
......@@ -90,6 +95,7 @@
time_start = $('input[name="time_start"]').val(),
time_end = $('input[name="time_end"]').val(),
order_status = $('#order_status').data('default'),
sale_type = $('#sale_type').data('default'),
// order_send = $('#order_send').data('default'),
order_source_pf = $('#order_source_pf').data('default'),
order_payment_mode = $('#order_payment_mode').data('default'),
......@@ -99,12 +105,12 @@
test_order = $('input[name=test_order]');
if (test_order.length) {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !order_invoice_status && !order_source_pf && !order_source_adtag && !order_source_ptag && !test_order.is(':checked')) {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !sale_type && !order_invoice_status && !order_source_pf && !order_source_adtag && !order_source_ptag && !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_source_pf && !order_source_adtag && !order_source_ptag) {
if (!order_contain && !time_start && !time_end && !order_payment_mode && !order_status && !sale_type && !order_invoice_status && !order_source_pf && !order_source_adtag && !order_source_ptag) {
layer.msg('请选择筛选条件,再导出!');
return false;
}
......@@ -124,7 +130,7 @@
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_source_pf='+order_source_pf+'&order_source_adtag='+order_source_adtag+'&order_source_ptag='+order_source_ptag+'&test_order='+test_order+'&order_goods_type='+2;
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+'&sale_type='+sale_type+'&order_invoice_status='+order_invoice_status+'&order_source_pf='+order_source_pf+'&order_source_adtag='+order_source_adtag+'&order_source_ptag='+order_source_ptag+'&test_order='+test_order+'&order_goods_type='+2;
})
// 选择查看测试订单
......
......@@ -355,13 +355,23 @@
<div class="ibox-content">
<div class="row">
<p class="con-title"><span style="margin-top: 5px;">订单类型:</span></p>
<p class="con-val">
<select name="sale_type" id="sale_type">
<option value="1" selectd>自营现货</option>
<option value="2">自营期货</option>
</select>
</p>
</div>
<div class="row">
<p class="con-title"><span>商品总额:</span></p>
<p class="con-val goods_amount_val"></p>
</div>
<div class="row">
<input type="hidden" class="user_coupon_id" name="user_coupon_id" value="">
<p class="con-title"><span>选择优惠券:</span></p>
<p class="con-title"><span style="margin-top: 5px;">选择优惠券:</span></p>
<p class="con-val">
<select name="user_coupon" id="user_coupon">
<option value="">请选择</option>
......
......@@ -381,7 +381,7 @@
<div class="row">
<input type="hidden" class="user_coupon_id" name="user_coupon_id" value="">
<p class="con-title"><span>选择优惠券:</span></p>
<p class="con-title"><span style="margin-top: 5px;">选择优惠券:</span></p>
<p class="con-val">
<select name="user_coupon" id="user_coupon">
<option value="">请选择</option>
......
......@@ -6,6 +6,7 @@
<input type="hidden" name="order_sn" value="{{$order_info['order_sn']}}">
<input type="hidden" name="user_id" value="{{$order_info['user_id']}}">
<input type="hidden" name="order_id" value="{{$order_info['order_id']}}">
<input type="hidden" name="order_goods_type" value="{{$order_info['order_goods_type']}}">
<input type="hidden" name="sale_id" value="{{$order_info['sale_id']}}">
<input type="hidden" name="goods_amount" value="{{$order_price_info['goods_price']}}">
<input type="hidden" name="order_amount" value="{{$order_info['order_amount']}}">
......@@ -49,7 +50,10 @@
<td class="check-select">
<label><input class="order_all_pay" type="radio" name="order_pay_type" value="1">全额付款</label>
<label><input class="order_advance_pay" type="radio" name="order_pay_type" value="2">预付首款</label>
<!-- 销售类型为现卖时展示 -->
@if ($order_info['sale_type'] == 1)
<label><input class="order_account_period" type="radio" name="order_pay_type" value="3">账期</label>
@endif
</td>
</tr>
<tr>
......@@ -86,6 +90,11 @@
<th>型号</th>
<th>调整数量</th>
<th>调整单价</th>
<!-- 销售类型为预售时展示 -->
@if ($order_info['sale_type'] == 2)
<th>交期时间/天</th>
<th>锁定库存</th>
@endif
</thead>
<tbody>
......@@ -105,6 +114,19 @@
<span>{{$currency}}</span>
<input class="price only_number" name="change_info[{{$v['rec_id']}}][goods_price]" data-origin="{{$v['original_price']}}" value="{{$v['goods_price']}}">
</td>
<!-- 销售类型为预售时展示 -->
@if ($order_info['sale_type'] == 2)
<td>
<input type="text" class="only_number" name="change_info[{{$v['rec_id']}}][delivery_time]" value="" placeholder="请填写天数">
</td>
<td>
<label>
<input type="checkbox" name="change_info[{{$v['rec_id']}}][is_lock]" value="{{$v['goods_id']}}">
<span>锁定库存,可用库存:<b class="text-danger">{{ App\Http\Controllers\getSelfStock($v['goods_id']) }}</b></span>
</label>
</td>
@endif
</tr>
@endforeach
</tbody>
......@@ -112,6 +134,7 @@
<?php $extend_fee_items = json_decode($order_temp_info['extend_fee_items'], true); ?>
<!-- 供应商附加费 -->
@if ($extend_fee_items)
<hr/>
<p>附加费设置</p>
......@@ -165,6 +188,8 @@
<td><p class="text-danger">{{$currency}}<span class="goods_total">{{$order_price_info['goods_price']}}</span></p></td>
</tr>
<!-- 销售类型为现卖时展示 -->
@if ($order_info['sale_type'] == 1)
<tr>
<th width="20%">附加费金额</th>
<td>
......@@ -173,6 +198,7 @@
</td>
<!-- <td><input type="text" name="extra_fee" autocomplete="off" value="{{$order_price_info['ext_price']}}" class="only_number"></td> -->
</tr>
@endif
<!-- <tr>
<th>说明</th>
......@@ -216,11 +242,15 @@
<p>付款时间</p>
<table class="table table-bordered table-hover change-table">
<tr>
<th>选择付款时间</th>
<th width="20%">选择付款时间</th>
<td>
<select name="payTime" class="payTime">
<option value="">请选择</option>
<option value="1">1天</option>
<!-- 预售订单默认2天 -->
@if ($order_info['sale_type'] == 2)
<option value="2" selected>2天</option>
@endif
<option value="3">3天</option>
<option value="7">7天</option>
<option value="15">15天</option>
......@@ -252,8 +282,16 @@
@endif
</p>
<?php
if ($order_info['order_goods_type'] == 2) {
$adjustPriceUrl = "/adjustPrice/".$order_info['order_id']."?tags=self";
} else {
$adjustPriceUrl = "/adjustPrice/".$order_info['order_id'];
}
?>
@if ($order_info['adjust_count'] < 2)
<a class="btn btn-default" href="{{URL('adjustPrice', ['order_id'=>$order_info['order_id']])}}">再次调价</a><span class="warn-tip">每笔订单仅有一次“再次调价”机会</span>
<a class="btn btn-default" href="{{$adjustPriceUrl}}">再次调价</a><span class="warn-tip">每笔订单仅有一次“再次调价”机会</span>
@endif
</div>
......
......@@ -581,7 +581,7 @@
<div class="tabs-box">
<!-- 判断操作权限 -->
@if ($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>
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$order_info['order_id']])}}">人工审单</a>
@endif
@if ($order_info['status'] == 2 && in_array('cancel_order', $userPerms))
......@@ -607,16 +607,21 @@
@endif
</div>
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'self')
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'self' && $action_name != 'changeOrder')
<p style="padding-left: 5px;">操作</p>
<div class="tabs-box">
<!-- 判断状态和权限 -->
@if ($order_info['status'] == 1 && in_array('add_offline_audit', $userPerms))
<a class="btn btn-success self-check" data-id="{{$order_info['order_id']}}" class="btn btn-default">审单</a>
<a class="btn btn-success self-check" data-id="{{$order_info['order_id']}}">内部订单审核</a>
@endif
<!-- 预售订单审单 -->
@if ($order_info['status'] == 1 && $order_info['sale_type'] == 2 && in_array('self_check_order', $userPerms))
<a class="btn btn-success" href="/change/{{$order_info['order_id']}}?tags=self">人工审单</a>
@endif
@if (in_array($order_info['status'], [2, 3, 4]) && !$extend && 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>
<a class="btn btn-default self_cancel" href="javascript:;" data-id="{{$order_info['order_id']}}">取消订单</a>
@endif
@if ($order_info['status'] == 2 && in_array('self_check_pay', $userPerms))
......@@ -624,12 +629,12 @@
@endif
@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>
<a class="btn btn-default self_express" href="javascript:;" data-id="{{$order_info['order_id']}}">填写快递单</a>
@endif
<!-- 订单状态大于4,且处于开票状态,且存在权限 -->
@if ($order_info['status'] >= 4 && $order_invoice_info['inv_type'] > 1 && 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>
<a class="btn btn-default self_invoice_express" data-id="{{$order_info['order_id']}}" href="javascript:;">填写发票快递</a>
@endif
</div>
......
......@@ -49,6 +49,21 @@
</div>
</dd>
</dl>
<dl>
<dt>销售类型:</dt>
<dd style="width: 115px;">
<div class="droplist" data-default="{{$condition['sale_type']}}" id="sale_type" name="sale_type">
<ul class="dropdown-menu">
<li data-val="" class="active">全部</li>
<li data-val="1">现卖</li>
<li data-val="2">预售</li>
</ul>
</div>
</dd>
</dl>
<dl>
<!-- <dl>
<dt>客服:</dt>
<dd style="width: 115px;">
......@@ -168,6 +183,7 @@
<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>
......@@ -208,6 +224,7 @@
}
?>
</td>
<td>{{$v['sale_type'] == 1 ? '现卖' : '预售'}}</td>
<td class="show-list"><?php print_r(App\Http\Controllers\getPayName($v['order_id'])); ?></td>
......@@ -244,6 +261,10 @@
<div class="btn-group btn-group-xs">
<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, 3]) && $v['sale_type'] == 2)
<a class="btn btn-success" href="/change/{{$v['order_id']}}?tags=self" target="_blank">人工审单</a>
@endif
@if (in_array('self_order_download_contract', $userPerms))
<a class="btn btn-default download-contract" data-id="{{$v['order_id']}}" href="javascript:;">下载合同</a>
@endif
......
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