Commit e54aa5b2 by 朱继来

调整售后

parent 036e0ae6
......@@ -388,6 +388,7 @@ class WebController extends Controller
$perm = new PermController;
$data['sale_list'] = $perm->getUserByDepartmentId(Config('perm_args.sales_department_id')); // 获取所有的销售
$data['role'] = $perm->getUserRole($request);
return view('web', $data);
}
......
......@@ -31,7 +31,7 @@ class OrderServiceItemsModel extends Model
foreach ($data as &$v) {
$v['amount'] = number_format($v['adjust_number'] * $v['adjust_price'], 2);
$v['refund_amount'] = number_format($v['goods_number'] * $v['goods_price'], 2);
$v['refund_amount'] = number_format($v['goods_number'] * $v['single_pre_price'], 2);
}
return $data;
......
......@@ -106,7 +106,9 @@
return false;
}
var goods_number = parseInt($(this).parents('tr').find('.origin-goods-number').html()); // 订单数量
var goods_price = parseFloat($(this).parents('tr').find('.origin-goods-price').html()); // 原订单单价
var goods_number = parseInt($(this).parents('tr').find('.origin-goods-number').html()); // 原订单数量
var origin_amount = goods_price * goods_number; // 商品可退金额
if (val > goods_number) {
layer.msg('不能超过订单数量');
......@@ -114,6 +116,15 @@
return false;
}
var adjust_price = $(this).parents('tr').find('.adjust_price').val();
var adjust_amount = adjust_price * val;
if (adjust_amount > origin_amount) {
layer.msg('不能超过该条商品可退金额');
$(this).val('');
return false;
}
})
// 单价输入校验
......@@ -154,6 +165,20 @@
$(this).val('');
return false;
}
var goods_price = parseFloat($(this).parents('tr').find('.origin-goods-price').html()); // 原订单单价
var goods_number = parseInt($(this).parents('tr').find('.origin-goods-number').html()); // 原订单数量
var origin_amount = goods_price * goods_number; // 商品可退金额
var adjust_number = $(this).parents('tr').find('.adjust_number').val();
var adjust_amount = adjust_number * val;
if (adjust_amount > origin_amount) {
layer.msg('不能超过该条商品可退金额');
$(this).val('');
return false;
}
})
......
......@@ -124,8 +124,10 @@
<a class="btn btn-xs btn-outline btn-success" lay-event="submit">提交</a>
<a class="btn btn-xs btn-outline btn-danger" lay-event="cancel">取消</a>
@{{# } else if (d.service_status == 2) { }}
<?php if (in_array($role, [1, 2])) { ?>
<a class="btn btn-xs btn-outline btn-success" lay-event="audit">审核</a>
<a class="btn btn-xs btn-outline btn-danger" lay-event="cancel">取消</a>
<?php } ?>
@{{# } else if (d.service_status == 3 && d.refund_status != 3) { }}
<a class="btn btn-xs btn-outline btn-success" lay-event="confirm">确认退款</a>
@{{# } }}
......
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