//监听订单下拉框
form.on('select(orderId)', function (data) {
var orderId = data.value;
$("#equipId").html("");
if(!isNull(orderId)){
Comm.ajaxPost('${ctx}/***/*****/manage/list/equipList', {orderId: orderId}, function (res) {
if (res.success) {
//选择订单后交付日期重新渲染
$("#operTime").remove();
$("#openDate").html('<input type="text" class="layui-input" name="operTime" id="operTime" autocomplete="off"/>');
var dateInfo = res.data.deliveryTime.substring(0,10);
laydate.render({
elem: '#operTime', //指定元素
type: 'date',
max: dateInfo
});
$("#equipId").empty();
$("#equipId").append("<option value=''>请选择设备</option>");
$.each(res.data.equipList, function(idx, obj) {
$("#equipId").append("<option value="+obj.equipId+">"+obj.equipName+"</option>");
});
form.render('select');
}
});
}else {
$("#equipId").append("<option value=''>请选择设备</option>");
}
form.render('select');
});
重新设置laydate中最大值max
最新推荐文章于 2024-10-14 14:52:56 发布
本文介绍了一个基于layui框架的订单系统中,如何通过监听订单下拉框选择事件,实现设备列表和交付日期的动态更新。具体实现包括使用ajax获取设备列表,清空并填充设备下拉框选项,以及重新渲染交付日期输入框,限制最大输入日期为订单的交付时间。
2068

被折叠的 条评论
为什么被折叠?



