Commit 6478932a by LJM

bug

parent e20b8e73
Showing with 20 additions and 2 deletions
...@@ -80,7 +80,7 @@ layui.use(['form', 'table', 'laydate'], function () { ...@@ -80,7 +80,7 @@ layui.use(['form', 'table', 'laydate'], function () {
}, },
{ {
field: 'return_amount', title: translation.return_amount, width: 120, templet(d) { field: 'return_amount', title: translation.return_amount, width: 120, templet(d) {
return '<span>' + d.return_amount + '</span><input class="hide-input input-style return_amount" value="' + d.return_amount + '"/>' return '<span class="return_amount">' + d.return_amount + '</span>'
} }
} }
]], ]],
...@@ -172,7 +172,8 @@ layui.use(['form', 'table', 'laydate'], function () { ...@@ -172,7 +172,8 @@ layui.use(['form', 'table', 'laydate'], function () {
return this; return this;
}, },
calcTotal: function (goods_price, goods_number, obj) { calcTotal: function (goods_price, goods_number, obj) {
$(obj).empty().text(goods_price * goods_number); var num = (goods_price * goods_number).toFixed(2)
$(obj).empty().text(num);
}, },
handleBind: function () { handleBind: function () {
...@@ -290,6 +291,23 @@ layui.use(['form', 'table', 'laydate'], function () { ...@@ -290,6 +291,23 @@ layui.use(['form', 'table', 'laydate'], function () {
IndexController.calcTotal(goods_price, goods_number, obj); IndexController.calcTotal(goods_price, goods_number, obj);
}, 800)) }, 800))
//售后单价
$(document).on('input', '.return_goods_price', debounce(function (e) {
var goods_price = $(this).val() * 1;
var goods_number = $(this).parent().parent().parent().find('.return_goods_number').val() * 1;
var obj = $(this).parent().parent().parent().find('.return_amount');
IndexController.calcTotal(goods_price, goods_number, obj);
}, 800))
//售后数量
$(document).on('input', '.return_goods_number', debounce(function (e) {
var goods_number = $(this).val() * 1;
var goods_price = $(this).parent().parent().parent().find('.return_goods_price').val() * 1;
var obj = $(this).parent().parent().parent().find('.return_amount');
IndexController.calcTotal(goods_price, goods_number, obj);
}, 800))
//监听运费 支付手续费 //监听运费 支付手续费
$(document).on('input', '.change-num', debounce(function (e) { $(document).on('input', '.change-num', debounce(function (e) {
var self = $(this); var self = $(this);
......
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