Layui 表单查询按钮与 sendConfirm 事件绑定实现
function sendConfirm() { disableBtn('#btnSearch');
var url = '../yd/ydquery';
var data = {
startDate: $('#startDate').val(),
endDate: $('#endDate').val(),
mailNumber: $('#mailNumber').val()
};
if (checkinput(data) && clickflag == false) {
clickflag = true;
$.post(url, data, null, 'json').done(function(re) {
if (re.result == 'success') {
table.reload('projectList', {
res: re
});
} else {
$('#startDate').val('');
$('#endDate').val('');
$('#mailNumber').val('');
popAlert('提示', re.msg);
}
}).fail(function(e) {
popAlert('提示', '网络错误,请重试');
}).always(function() {
enableBtn('#btnSearch');
clickflag = false;
});
}
};
$(document).ready(function() { $('#btnSearch').on('click', sendConfirm); });
AI 优化版
原文地址:https://www.cveoy.top/t/topic/qug2 著作权归作者所有。请勿转载和采集!