1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-07-20 04:23:01 +08:00

fix #550 form reset error

This commit is contained in:
Yu 2021-12-21 15:58:36 +08:00
parent 6917f23b0c
commit 4ab3cb83b5
3 changed files with 21 additions and 1 deletions

View File

@ -104,6 +104,15 @@ script.
loadURL('/res/dic.html?id=' + $(this).val() + "&name=city&attr=lay-ignore&style=width:85px;", '#city');
})
$('.layui-form').on('reset', function(){
var province = $('#province').attr('old');
var city = $('#city').attr('old');
loadURL('/res/dic.html?id=' + province + "&name=city&attr=lay-ignore&style=width:85px;", '#city',function(){
$('#city').val(city);
});
});
layui.use('form', function () {
var form = layui.form();
form.render(); //更新全部

View File

@ -97,6 +97,17 @@ script.
$('#entcustomer_province').change(function () {
loadURL('/res/dic.html?id=' + $(this).val() + "&name=entcustomer.city&attr=lay-ignore&style=width:85px;", '#entcustomer_city');
})
$('.layui-form').on('reset', function(){
var province = $('#entcustomer_province').attr('old');
var city = $('#entcustomer_city').attr('old');
loadURL('/res/dic.html?id=' + province + "&name=entcustomer.city&attr=lay-ignore&style=width:85px;", '#entcustomer_city',function(){
$('#entcustomer_city').val(city);
});
});
layui.use('form', function () {
var form = layui.form();
form.render(); //更新全部

View File

@ -3,7 +3,7 @@ mixin dicSelect(dicList, name, value, attr, style)
attr.style = style;
var id = name.replace('.', '_')
input(type="hidden", name=name + ".text", id=id + "_text")
select(id=id, name=name, onChange="$('#" + id + "_text').val($(this).find('option:selected').text())")&attributes(attr)
select(id=id, name=name, old=value, onChange="$('#" + id + "_text').val($(this).find('option:selected').text())")&attributes(attr)
option(value="") 请选择...
if dicList
for dic in dicList