Commit 26a16eb0 by 朱继来

添加批量调价

parent 7ba2d9a1
......@@ -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 goods_total = 0;
var supplier = [];
......@@ -1220,6 +1222,7 @@
$(table).find('tbody tr').each(function(){
var num = parseInt($(this).find('.num').val()) || 0;
var price = parseFloat($(this).find('.price').val()) || 0;
goods_total += parseFloat(num * price);
var sup = $(this).data('sup');
......@@ -1243,7 +1246,7 @@
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);
......@@ -1258,6 +1261,8 @@
// } else {
// checkPayType(total, orderPayType, 1500, 7800);
// }
return false;
})
// 根据供应商调整附加费
......@@ -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(){
var val = $(this).val();
......
......@@ -147,6 +147,18 @@
</tbody>
</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); ?>
<!-- 供应商附加费 -->
......@@ -221,13 +233,6 @@
</tr>
@endif
<!-- <tr>
<th>说明</th>
<td>
<textarea name="extra_fee_description" id="" cols="30" rows="5">{$detail.extra_fee_description}</textarea>
</td>
</tr> -->
<tr>
<th width="20%">订单总额</th>
<td>
......
......@@ -559,7 +559,7 @@
@endif
<tr>
<td>{{ isset($order_temp_info) && $order_temp_info['order_type'] == 3 && !$order_temp_info['business_type'] ? '(自营内部采购下单享95折优惠)' : '' }}订单总额:</td>
<td>订单总额:</td>
<td>
<span style="color:red;font-size:20px">{{$currency}}
<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