var url = CMS_SystemConfig.VirtualDirectoryPath + "/StockInSet/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgStockInSetList").cmsXDataTable("load", $.getDataGridParams("dgStockInSetList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgStockInSetList").cmsXDataTable("getSelections"), function (index) { d.push(this.SupplierDiscountSetID); }); return d; } //新增 function StockInSet_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('供应商折扣率复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/StockInSet/CopyAdd?supplierDiscountSetID=' + d[0] + '&MNU=' + mnu, 650, 245, null, null); } else { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('供应商折扣率新增', redirectTo, 650, 245, null, null); } } //修改 function StockInSet_Edit() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统信息", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?supplierDiscountSetID=" + d + "&MNU=" + mnu; $.popupTopWindow('供应商折扣率修改', redirectTo, 650, 245, null, null); } //删除 function StockInSet_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StockInSet/Delete', { supplierDiscountSetIDs: d }, function (data) { if (data == "删除成功。") { $.messager.alert("系统提示", data); $("#dgStockInSetList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function StockInSet_Export() { var d = validChoose().join(',') if (d != "") { document.getElementById("SupplierDiscountSetID").value = d; } else { document.getElementById("SupplierDiscountSetID").value = ""; } $("#formQuery").submit(); }