Showing
1 changed file
with
18 additions
and
1 deletions
@@ -934,7 +934,24 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | @@ -934,7 +934,24 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | ||
934 | clone.find("select.policyparam").html(options); | 934 | clone.find("select.policyparam").html(options); |
935 | clone.find("select.condition").html(conditionoptions); | 935 | clone.find("select.condition").html(conditionoptions); |
936 | clone.find("input[type=tel]").val(''); | 936 | clone.find("input[type=tel]").val(''); |
937 | - $(`#${id}`).after(clone).after(cond); | 937 | + //获取最后一个添加的id |
938 | + var doms = $(`div[id^=${id}][id$='condition'][id!=${id}]`); | ||
939 | + var lastid =''; | ||
940 | + console.log(doms); | ||
941 | + if($(doms)&&$(doms).length>0) { | ||
942 | + | ||
943 | + | ||
944 | + $(doms).each(function (i, v) { | ||
945 | + var $domId = $(v).attr("id"); | ||
946 | + var trimdomid = $domId.substring(0,$domId.length-10) | ||
947 | + if (trimdomid > lastid) { | ||
948 | + lastid = trimdomid; | ||
949 | + } | ||
950 | + }); | ||
951 | + }else { | ||
952 | + lastid = id; | ||
953 | + } | ||
954 | + $(`#${lastid}`).after(clone).after(cond); | ||
938 | form.render(); | 955 | form.render(); |
939 | //渲染新增事件 | 956 | //渲染新增事件 |
940 | $("i.policy-input-add").off("click").on("click",function (){ | 957 | $("i.policy-input-add").off("click").on("click",function (){ |
-
Please register or login to post a comment