var tabIndex; $(document).on("click", "input[name='oa_costbudgetdtl.MaterialCode']", function () { tabIndex = $(this).closest('tr').index(); layer.open({ type: 2, title: '资源库', shadeClose: true, shade: 0.4, area: ['1120px', '580px'], content: "/Article/index" }); }); $("input[name='oa_costbudget.ManagerName']").on("click", function () { $(this).attr("id", "oa_costbudget_ManagerName_text"); var url = "/SelectMember/Index" + "?control=oa_costbudget_ManagerName"; layer.open({ type: 2, title: '组织架构', shadeClose: true, shade: 0.4, area: ['500px', '380px'], content: url }); }); setBaseInfo = function (materialCode, materialName, resourceClassificationId, resourceClassificationName, specificationModel, measurementUnit, index, measurementUnitName, resourceClassificationSupName) { var $row = $("table tr:eq(" + tabIndex + ")"); $row.find("input[field='MaterialCode']").val(materialCode); $row.find("input[field='MaterialName']").val(materialName); $row.find("input[field='Unit']").val(measurementUnitName); layer.closeAll(); }