Commit e761deca by 朱继来

Merge branch 'zjl_discount_20190322' into development

parents c6111dfa 26a16eb0
...@@ -1212,7 +1212,9 @@ ...@@ -1212,7 +1212,9 @@
}); });
// 调整价格 // 调整价格
$('.order-change-table input').on('blur', function(){ $('.order-change-table input').off().on('blur', function(e){
e.preventDefault();
var table = $('.order-change-table'); var table = $('.order-change-table');
var goods_total = 0; var goods_total = 0;
var supplier = []; var supplier = [];
...@@ -1220,6 +1222,7 @@ ...@@ -1220,6 +1222,7 @@
$(table).find('tbody tr').each(function(){ $(table).find('tbody tr').each(function(){
var num = parseInt($(this).find('.num').val()) || 0; var num = parseInt($(this).find('.num').val()) || 0;
var price = parseFloat($(this).find('.price').val()) || 0; var price = parseFloat($(this).find('.price').val()) || 0;
goods_total += parseFloat(num * price); goods_total += parseFloat(num * price);
var sup = $(this).data('sup'); var sup = $(this).data('sup');
...@@ -1258,6 +1261,8 @@ ...@@ -1258,6 +1261,8 @@
// } else { // } else {
// checkPayType(total, orderPayType, 1500, 7800); // checkPayType(total, orderPayType, 1500, 7800);
// } // }
return false;
}) })
// 根据供应商调整附加费 // 根据供应商调整附加费
...@@ -1367,6 +1372,37 @@ ...@@ -1367,6 +1372,37 @@
// // } // // }
// }) // })
// 设置折扣
$('.set_goods_price').off().on('blur', function(){
var val = $(this).val();
if (!val) {
layer.msg('折扣值不能为空');
val = 1;
}
if (isNaN(parseFloat(val))) {
layer.msg('折扣值只能是数字和小数组成');
val = 1;
}
if (val <= 0 || val > 1) {
layer.msg('折扣值只能大于0且小于等于1');
val = 1;
}
var discount = parseFloat(val).toFixed(2);
$(this).val(discount);
$('.order-change-table').find('tbody tr').each(function(){
var price = $(this).find('.price').val();
var discount_price = parseFloat(price * discount).toFixed(2);
$(this).find('.price').val(discount_price);
})
$('.order-change-table input').triggerHandler('blur'); // 自动触发
})
// 选择付款时间 // 选择付款时间
$('.payTime').change(function(){ $('.payTime').change(function(){
var val = $(this).val(); var val = $(this).val();
......
...@@ -147,6 +147,18 @@ ...@@ -147,6 +147,18 @@
</tbody> </tbody>
</table> </table>
@if ($order_info['order_goods_type'] == 2)
<table class="table table-bordered table-hover">
<tr>
<th width="20%">批量调价</th>
<td>
<input type="text" class="set_goods_price" name="set_goods_price" value="1">
<span class="text-danger">(批量设置单价,默认值1,折扣范围 0 < <= 1)</span>
</td>
</tr>
</table>
@endif
<?php $extend_fee_items = json_decode($order_temp_info['extend_fee_items'], true); ?> <?php $extend_fee_items = json_decode($order_temp_info['extend_fee_items'], true); ?>
<!-- 供应商附加费 --> <!-- 供应商附加费 -->
...@@ -221,13 +233,6 @@ ...@@ -221,13 +233,6 @@
</tr> </tr>
@endif @endif
<!-- <tr>
<th>说明</th>
<td>
<textarea name="extra_fee_description" id="" cols="30" rows="5">{$detail.extra_fee_description}</textarea>
</td>
</tr> -->
<tr> <tr>
<th width="20%">订单总额</th> <th width="20%">订单总额</th>
<td> <td>
......
...@@ -559,7 +559,7 @@ ...@@ -559,7 +559,7 @@
@endif @endif
<tr> <tr>
<td>{{ isset($order_temp_info) && $order_temp_info['order_type'] == 3 && !$order_temp_info['business_type'] ? '(自营内部采购下单享95折优惠)' : '' }}订单总额:</td> <td>订单总额:</td>
<td> <td>
<span style="color:red;font-size:20px">{{$currency}} <span style="color:red;font-size:20px">{{$currency}}
<span class="amount">{{$order_info['order_amount']}}</span> <span class="amount">{{$order_info['order_amount']}}</span>
......
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