Commit a837031e by 朱继来

Merge branch 'zjl_freight_20190627'

parents be468ee8 f86c1dc7
......@@ -761,7 +761,8 @@ Class OrderController extends Controller
"k2" => $check['k2'],
"client_source" => $client_source,
"change_extend_fee" => $request->input('change_extend_fee', ''),
"kefu_remark" => $request->input('kefu_remark', ''),
"kefu_remark" => $request->input('kefu_remark', ''), // 客服备注
"freight_fee" => $request->input('freight_fee', 0), // 运费
];
$temp = json_decode(curlApi($url, $resData, "POST"), true);
......
......@@ -1359,8 +1359,9 @@
$(this).find('.sup_amount_val').text(supplier[sup]);
})
var fee = $('input[name="extra_fee"]').val() ? parseFloat($('input[name="extra_fee"]').val()) : 0;
var total = parseFloat(goods_total + fee).toFixed(2);
var extra_fee = $('input[name="extra_fee"]').val() ? parseFloat($('input[name="extra_fee"]').val()) : 0;
var freight_fee = $('input[name="freight_fee"]').val() ? parseFloat($('input[name="freight_fee"]').val()) : 0; // 运费
var total = parseFloat(goods_total + freight_fee + extra_fee).toFixed(2);
goods_total = goods_total.toFixed(2);
......@@ -1386,6 +1387,7 @@
$('.extend-fee-table input').on('blur', function(){
var table = $('.extend-fee-table');
var goods_total = parseFloat($('.goods_total').text());
var freight_fee = $('input[name="freight_fee"]').val() ? parseFloat($('input[name="freight_fee"]').val()) : 0; // 运费
var extend_fee_total = 0;
$(table).find('tbody tr').each(function(){
......@@ -1394,7 +1396,7 @@
extend_fee_total += extend_fee;
});
var total = parseFloat(goods_total + extend_fee_total).toFixed(2);
var total = parseFloat(goods_total + freight_fee + extend_fee_total).toFixed(2);
$('.extra_fee').html(extend_fee_total);
$('input[name="extra_fee"]').val(extend_fee_total);
......@@ -1402,6 +1404,20 @@
$('.total').html(total);
})
// 调整运费
$('.freight_fee').on('blur', function() {
var freight_fee = parseFloat($(this).val());
if (!freight_fee) freight_fee = 0;
$(this).val(freight_fee);
var goods_total = parseFloat($('.goods_total').text());
var total = parseFloat(goods_total + freight_fee).toFixed(2);
$('.total').html(total);
})
// 定金调整
// $('.advance').on('blur',function(){
// if($(this).val()<($('.total').html()*0.2)){
......@@ -1544,20 +1560,20 @@
// 提交表单
$('.checkOrder').click(function(){
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 reason = $('input[name=reason]:checked').val();
var payTime = $('.payTime').val();
var payTimeOther = $('.payTimeOther').val();
var sale_id = $('input[name=sale_id]').val();
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 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();
var order_id = $('input[name=order_id]').val();
var order_id = $('input[name=order_id]').val();
// 联营订单需要先指派业务员
if (order_goods_type == 1 && sale_id == 0) {
layer.alert('请先将订单推送给业务员', function(){
layer.alert('请先将订单推送给客服', function(){
location.href = '/sendSales/'+order_id;
});
return false;
......@@ -1649,21 +1665,35 @@
}
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>';
var goods_amount = parseFloat($('.goods_total').text());
var order_amount = parseFloat($('.total').text());
var extra_fee = $('input[name=extra_fee]').val() ? $('input[name=extra_fee]').val() : 0;
var freight_fee = $('input[name=freight_fee]').val() ? $('input[name=freight_fee]').val() : 0;
var last_paid = parseFloat(order_amount + parseFloat(pay_preferential)).toFixed(2); // 实际支付金额
var content = '<div class="submit-check">'+
'<p class="error">请核对订单金额,谨慎操作!</p>'+
'<p><label>商品总金额:</label>'+currencySign + goods_amount+'</p>'+
'<p><label>优惠金额:</label>'+discount_amount+'</p>'+
'<p><label>附加费金额:</label>'+extra_fee+'</p>'+
'<p><label>运费金额:</label>'+freight_fee+'</p>'+
'<p><label>订单总金额:</label><span class="error">'+currencySign + order_amount+'</span></p>';
if (order_goods_type == 1) {
content += '</div>';
var url = '/details/'+order_id;
} else {
var content = '<div><p class="error">请核对订单金额,谨慎操作!</p><div><p>商品总金额:'+goods_amount+'</p><p>订单总金额:<span class="error">'+order_amount+'</span></p></div></div>';
content += '<p><label>支付优惠:</label>'+pay_preferential+'</p>'+
'<p><label>实际支付金额:</label><span class="error">'+currencySign + last_paid +'</span></p>'+
'</div>';
var url = '/details/'+order_id+'?tags=self';
}
// 弹出提示
layer.open({
title: '提醒',
area: ['360px'],
title: '提示信息',
content: content,
btn:['确定', '取消'],
yes: function(index, layero){
......
<style>
.submit-check { margin: 0 auto; width: 200px; }
/* 提交审核弹框label */
.submit-check label { display: inline-block; width: 120px; text-align: right;}
</style>
<p style="padding-left: 5px;">人工审单</p>
<div class="tabs-box">
<div class="order-change-main">
......@@ -125,7 +132,7 @@
<textarea name="kefu_remark" id="kefu_remark" class="form-control" placeholder="客服备注信息" style="resize: none;">{{$order_temp_info['kefu_remark']}}</textarea>
@if ($order_info['order_goods_type'] == 2)
<table class="table table-bordered table-hover">
<table class="table table-bordered table-hover" style="margin-top:10px;">
<tr>
<th width="20%">批量调价</th>
<td>
......@@ -199,14 +206,23 @@
</tr>
<!-- 销售类型为现卖时展示 -->
@if ($order_info['sale_type'] == 1)
@if ($order_info['sale_type'] == 1 && $order_price_info['ext_price'])
<tr>
<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'] ? $order_price_info['ext_price'] : 0}}">
</td>
<!-- <td><input type="text" name="extra_fee" autocomplete="off" value="{{$order_price_info['ext_price']}}" class="only_number"></td> -->
</tr>
@endif
@if ($order_info['order_goods_type'] == 2)
<tr>
<th>运费</th>
<td>
<span>{{$currency}}</span>
<input class="only_number freight_fee" type="text" name="freight_fee" value="{{ $order_price_info['shipping_price'] ? $order_price_info['shipping_price'] : 0 }}">
</td>
</tr>
@endif
......@@ -358,6 +374,7 @@
<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']}}">
......@@ -397,12 +414,14 @@
<hr>
<table class="table table-bordered table-hover">
<tr>
<th>订单类型:</th>
<th width="20%">订单类型:</th>
<td>
@if ($order_temp_info['order_pay_type'] == 1)
全款
@else
@elseif ($order_temp_info['order_pay_type'] == 2)
预付款
@else
账期
@endif
</td>
</tr>
......@@ -413,26 +432,44 @@
</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_price_info['discount_amount']}}</td>
<th>运费</th>
<td>{{$order_temp_info['freight_fee']}}</td>
</tr>
@if ($order_temp_info['order_pay_type'] == 2)
<?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_temp_info['deposit_amount']}}</td>
<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['goods_amount'] + $order_temp_info['extra_fee'] + $order_price_info['discount_amount']}}</td>
<th>定金</th>
<td>{{$order_temp_info['deposit_amount']}}</td>
</tr>
@endif
<tr>
<th>付款时间:</th>
......@@ -445,12 +482,14 @@
@endif
<script>
var is_manager = "{{ $role == 1 || $role == 2 || $role == 10 ? true : false }}";
var isNewClient = "{{isset($isNewClient) ? $isNewClient : 0}}";
var order_amount = "{{$order_info['order_amount']}}";
var currency = "{{$order_info['currency']}}";
var order_pay_type = "{{$order_info['order_pay_type']}}";
var is_manager = "{{ $role == 1 || $role == 2 || $role == 10 ? true : false }}";
var isNewClient = "{{isset($isNewClient) ? $isNewClient : 0}}";
// var order_amount = "{{$order_info['order_amount']}}";
var currency = "{{$order_info['currency']}}"; // 币种
var order_pay_type = "{{$order_info['order_pay_type']}}"; // 付款类型
var discount_amount = "{{ $order_price_info['discount_amount'] ? $order_price_info['discount_amount'] : 0 }}"; // 优惠券金额
var pay_preferential = "{{ $order_price_info['pay_preferential'] ? $order_price_info['pay_preferential'] : 0 }}"; // 支付优惠(钱包)
var rest_time = "{{$order_info['pay_time'] ? $order_info['pay_time'] - time() : NULL}}";
......
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