Commit 3e1a45a1 by 朱继来

temp

parent 88781ef6
......@@ -276,6 +276,15 @@ function getOrderAddress($order_id)
return $order->consignee;
}
// 获取渠道名称
function getSupplierName($key)
{
$redis = Redis::connection('read');
$supp_info = json_decode($redis->hget('supp_info_', $key), true);
return $supp_info['supplier_name'];
}
Class OrderController extends Controller
{
// 首页
......@@ -1052,7 +1061,8 @@ Class OrderController extends Controller
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
$client_source = $request->input('client_source') == 1 ? $request->input('input-other-source') : $request->input('client_source');
echo '<pre>';
print_r(json_encode($request->input('change_extend_fee', '')));die;
$resData = [
"user_id" => $request->input('user_id', ''),
"cancel_reason" => $request->input('cancel_reason', ''),
......@@ -1066,14 +1076,15 @@ Class OrderController extends Controller
"change_info" => $request->input('change_info', ''),
"pay_time_limit" => $pay_time_limit,
"check_failed" => $request->input('check_failed', ''),
"check_failed_info" => $request->input('check_failed_info', ''),
"change_pay_type" => $request->input('change_pay_type', ''),
"check_failed_info" => $request->input('check_failed_info', ''),
"change_pay_type" => $request->input('change_pay_type', ''),
"order_id" => $order_id,
'operator_id' => $request->user->userId,
"pf" => 1,
"k1" => $check['k1'],
"k2" => $check['k2'],
"client_source" => $client_source,
"change_extend_fee" => $request->input('change_extend_fee', ''),
];
$temp = json_decode(curlApi($url, $resData, "POST"), true);
......
......@@ -34,10 +34,10 @@
width: 100%;
}
.order-details .change-table th {
width: 30%;
/*width: 30%;*/
}
.order-details .change-table td {
width: 70%;
/*width: 70%;*/
}
/* 审核 */
......
......@@ -1021,9 +1021,12 @@
var price = parseFloat($(this).find('.price').val()) || 0;
goods_total += parseFloat(num * price);
});
var fee = parseFloat($('input[name="extra_fee"]').val());
goods_total = goods_total.toFixed(2);
var fee = parseFloat($('input[name="extra_fee"]').val());
var total = parseFloat(goods_total + fee).toFixed(2);
goods_total = goods_total.toFixed(2);
$('.goods_total').html(goods_total);
$('input[name="goods_amount"]').val(goods_total);
$('input[name="order_amount"]').val(total);
......@@ -1040,6 +1043,26 @@
// }
})
// 根据供应商调整附加费
$('.extend-fee-table input').on('blur', function(){
var table = $('.extend-fee-table');
var goods_total = parseFloat($('.goods_total').text());
var extend_fee_total = 0;
$(table).find('tbody tr').each(function(){
var extend_fee = parseInt($(this).find('.adjust_extend_fee').val()) || 0;
extend_fee_total += extend_fee;
});
var total = parseFloat(goods_total + extend_fee_total).toFixed(2);
$('.extra_fee').html(extend_fee_total);
$('input[name="extra_fee"]').val(extend_fee_total);
$('input[name="order_amount"]').val(total);
$('.total').html(total);
})
// 定金调整
// $('.advance').on('blur',function(){
// if($(this).val()<($('.total').html()*0.2)){
......@@ -1105,27 +1128,27 @@
});
// 附加费
$('input[name="extra_fee"]').on('blur', function(){
var fee = parseFloat($(this).val());
var goods_total = parseFloat($('.goods_total').html());
if (isNaN(fee)) {
fee = 0.0000;
}
var total = parseFloat(goods_total + fee).toFixed(2);
$('input[name="goods_amount"]').val(goods_total);
$('input[name="order_amount"]').val(total);
$('.total').html(total);
$('.advance').val((total*0.3).toFixed(2));
// $('input[name="extra_fee"]').on('blur', function(){
// var fee = parseFloat($(this).val());
// var goods_total = parseFloat($('.goods_total').html());
// if (isNaN(fee)) {
// fee = 0.0000;
// }
// var total = parseFloat(goods_total + fee).toFixed(2);
// $('input[name="goods_amount"]').val(goods_total);
// $('input[name="order_amount"]').val(total);
// $('.total').html(total);
// $('.advance').val((total*0.3).toFixed(2));
// 价格调整后,付款类型显示或隐藏
// var orderPayType = $('input[name=order_pay_type]').val();
// // 价格调整后,付款类型显示或隐藏
// // var orderPayType = $('input[name=order_pay_type]').val();
// if (currency == 1) { // 人民币
// checkPayType(total, orderPayType, 10000, 49999);
// } else {
// checkPayType(total, orderPayType, 1500, 7800);
// }
})
// // if (currency == 1) { // 人民币
// // checkPayType(total, orderPayType, 10000, 49999);
// // } else {
// // checkPayType(total, orderPayType, 1500, 7800);
// // }
// })
// 选择付款时间
$('.payTime').change(function(){
......
......@@ -79,8 +79,9 @@
<hr/>
<!-- 调价 -->
<p>调价</p>
<table class="table table-bordered table-hover order-change-table change-table">
<table class="table table-bordered table-hover order-change-table">
<thead>
<th width="20%">供应商</th>
<th>型号</th>
<th>调整数量</th>
<th>调整单价</th>
......@@ -90,6 +91,9 @@
@foreach ($order_items_info as $v)
<tr>
<td>
<p>{{$v['supplier_name']}}</p>
</td>
<td>
<input type="hidden" name="change_info[{{$v['rec_id']}}][goods_name]" value="{{$v['goods_name']}}">
<p>{{$v['goods_name']}}</p>
</td>
......@@ -103,18 +107,65 @@
@endforeach
</tbody>
</table>
@if ($order_temp_info['extend_fee_items'])
<hr/>
<p>附加费设置</p>
<table class="table table-bordered table-hover extend-fee-table">
<thead>
<th>供应商</th>
<th>商品金额</th>
<th>调整附加费</th>
</thead>
<tbody>
<?php $extend_fee_items = json_decode($order_temp_info['extend_fee_items'], true); ?>
@foreach ($extend_fee_items as $k => $v)
<tr>
<td>
@if (strpos($k, '.') !== false)
<p>
<?php
$sid = explode('.', $k)[1];
echo App\Http\Controllers\getSupplierName($sid);
?>
</p>
@else
<p>{{$v['supplier_name']}}</p>
@endif
<input type="hidden" name="change_extend_fee[{{$k}}][supplier_name]" value="{{$v['supplier_name']}}">
</td>
<td>
<input type="hidden" name="change_extend_fee[{{$k}}][amount]" value="{{$v['amount']}}">
<p>{{$v['amount']}}</p>
</td>
<td>
<input class="adjust_extend_fee only_number" name="change_extend_fee[{{$k}}][extend_fee]" value="{{$v['extend_fee']}}">
</td>
<input type="hidden" name="change_extend_fee[{{$k}}][count]" value="{{$v['count']}}">
<input type="hidden" name="change_extend_fee[{{$k}}][ladder_max]" value="{{$v['ladder_max']}}">
</tr>
@endforeach
</tbody>
</table>
@endif
<hr/>
<p>附加费设置</p>
<table class="table table-bordered table-hover change-table">
<table class="table table-bordered table-hover">
<tr>
<th>商品总金额</th>
<th width="20%">商品总金额</th>
<td><p class="text-danger">{{$currency}}<span class="goods_total">{{$order_price_info['goods_price']}}</span></p></td>
</tr>
<tr>
<th>附加费金额</th>
<td><input type="text" name="extra_fee" autocomplete="off" value="{{$order_price_info['ext_price']}}" class="only_number"></td>
<th width="20%">附加费金额</th>
<td>
<p class="text-danger">{{$currency}}<span class="extra_fee">{{$order_price_info['ext_price'] ? $order_price_info['ext_price'] : 0}}</span></p>
<input type="hidden" name="extra_fee" autocomplete="off" value="{{$order_price_info['ext_price']}}">
</td>
<!-- <td><input type="text" name="extra_fee" autocomplete="off" value="{{$order_price_info['ext_price']}}" class="only_number"></td> -->
</tr>
<!-- <tr>
......@@ -125,7 +176,7 @@
</tr> -->
<tr>
<th>订单总额</th>
<th width="20%">订单总额</th>
<td>
<p class="text-danger">{{$currency}}<span class="total">{{$order_info['order_amount']}}</span></p>
</td>
......@@ -135,9 +186,9 @@
<div class="show-advance-pay">
<hr/>
<p>定金调整</p>
<table class="table table-bordered table-hover change-table">
<table class="table table-bordered table-hover">
<tr>
<th>定金金额</th>
<th width="20%">定金金额</th>
<td>
<p class="text-danger">{{$currency}}
<?php
......@@ -156,9 +207,9 @@
</div>
<p>付款时间</p>
<table class="table table-bordered table-hover change-table">
<table class="table table-bordered table-hover">
<tr>
<th>选择付款时间</th>
<th width="20%">选择付款时间</th>
<td>
<select name="payTime" class="payTime">
<option value="">请选择</option>
......
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