Commit 51e518ea by LJM

详情

parent 18016f2c
......@@ -47,7 +47,11 @@ layui.use(['form', 'table', 'laydate'], function () {
return '<span>' + d.goods_number + '</span><input class="hide-input input-style goods_number" value="' + d.goods_number + '"/>'
}
},
{field: 'total_amount', title: '小计', width: 120},
{
field: 'total_amount', title: '小计', width: 120, templet(d) {
return '<span class="total_amount">' + d.total_amount + '</span>'
}
},
{field: 'delivery_time', title: '货期', width: 120},
{field: 'batch', title: '批次', width: 120},
{field: 'remarks', title: '客户备注', width: 120},
......@@ -163,12 +167,15 @@ layui.use(['form', 'table', 'laydate'], function () {
return this;
},
calcTotal: function (goods_price, goods_number, obj) {
$(obj).empty().text(goods_price * goods_number);
},
handleBind: function () {
//国家/地区
$(document).on('change', 'select[name="country"]', function () {
var country_name = $(this).find('option:selected').text();
var type = $(this).attr('data');
layui.form.on('select(countryChange)', function (data) {
var country_name = data.elem[data.elem.selectedIndex].text;
var type = $(data.elem).attr('data');
if (type == 1) {
//收货信息
layui.form.val('receiveInfo', {
......@@ -262,6 +269,22 @@ layui.use(['form', 'table', 'laydate'], function () {
$(data.elem).parent().parent().find('.show').hide();
});
//单价
$(document).on('input', '.goods_price', debounce(function (e) {
var goods_price = $(this).val() * 1;
var goods_number = $(this).parent().parent().parent().find('.goods_number').val() * 1;
var obj = $(this).parent().parent().parent().find('.total_amount');
IndexController.calcTotal(goods_price, goods_number, obj);
}, 800))
//数量
$(document).on('input', '.goods_number', debounce(function (e) {
var goods_number = $(this).val() * 1;
var goods_price = $(this).parent().parent().parent().find('.goods_price').val() * 1;
var obj = $(this).parent().parent().parent().find('.total_amount');
IndexController.calcTotal(goods_price, goods_number, obj);
}, 800))
//监听运费 支付手续费
$(document).on('input', '.change-num', debounce(function (e) {
var self = $(this);
......
......@@ -224,7 +224,7 @@
<div class="layui-form-mid mid-width">{{$info['receiveInfo']['country_name']}}</div>
<div class="show" style="display: none;width: 158px;">
<input type="hidden" name="country_name" value="">
<select data="1" name="country" style="height: 30px;border: 1px solid #eee;background: transparent;width: 100%;">
<select data="1" name="country" lay-filter="countryChange" style="height: 30px;border: 1px solid #eee;background: transparent;width: 100%;">
<option value="">请选择国家</option>
@foreach(\App\Models\Country::getCountryMap() as $cid=>$cname)
<option data="{{$cname}}" value="{{$cid}}">{{$cname}}</option>
......@@ -333,7 +333,7 @@
<div class="layui-form-mid mid-width">{{$info['billingInfo']['country_name']}}</div>
<div class="show" style="display: none;width: 158px;">
<input type="hidden" name="country_name" value="">
<select data="2" name="country" style="height: 30px;border: 1px solid #eee;background: transparent;width: 100%;">
<select data="2" name="country" lay-filter="countryChange" style="height: 30px;border: 1px solid #eee;background: transparent;width: 100%;">
<option value="">请选择国家</option>
@foreach(\App\Models\Country::getCountryMap() as $cid=>$cname)
<option data="{{$cname}}" value="{{$cid}}">{{$cname}}</option>
......
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