var url = CMS_SystemConfig.VirtualDirectoryPath + "/TeacherRetail/Edit"; //var ViewUrl = CMS_SystemConfig.VirtualDirectoryPath + "/TeacherRetail/TeacherRetailDetailList"; var ViewUrl = CMS_SystemConfig.VirtualDirectoryPath + "/StockOut/StockOutDetailList"; //考虑到页面重用 var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) function reload() { $("#dgTeacherRetailList").cmsXDataTable("load", $.getDataGridParams("dgTeacherRetailList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgTeacherRetailList").cmsXDataTable("getSelections"), function (index) { d.push(this.StockOutID); }); return d; } //修改 function TeacherRetail_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + '?stockOutID=' + d + '&MNU=' + mnu; $.popupTopWindow('教材零售信息', redirectTo, 800, 550, null, null); } //保存数据 function TeacherRetail_Save() { $(document.forms[0]).submit();//提交表单 } //导出 function TeacherRetail_Export() { $("#formQuery").submit(); } //删除 function TeacherRetail_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/TeacherRetail/Delete', { stockOutIDs: d }, function (data) { if (data == "删除成功。") { $.messager.alert("系统提示", data); $("#dgTeacherRetailList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //教材零售(新增) function TeacherRetail_Add() { var redirectTo = url + '?MNU=' + mnu+ '&stockOutType=1'; $.popupTopWindow('教材零售', redirectTo, 800, 550, null, null); } //教材零售信息明细 function TeacherRetailDetailView(rowindex, rowdata) { var redirectTo = ViewUrl + '?stockOutID=' + rowdata.StockOutID + '&MNU=' + mnu; $.popupTopWindow('教材零售明细', redirectTo, 850, 550, null, null); } //提交数据、更新状态值 function TeacherRetail_Submit() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要提交的信息。"); return; } $.messager.confirm("系统提示", "您确定要提交选择的信息?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/TeacherRetail/Submit?hid_ActionsType=Submit', { stockOutIDs: d }, function (data) { if (data == "提交出库成功。") { $.messager.alert("系统提示", data); $("#dgTeacherRetailList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function QueryCourseDropdownList() { reload(); } function QuerySchoolYearDropdownList() { reload(); } function QueryLibraryDropdownList() { reload(); } function QueryPublishDropdownList() { reload(); } function QueryEndStockInTimeList() { $("#EndStockInTime").val($dp.cal.getNewDateStr()) reload(); } function QueryStartStockInTimeList() { $("#StartStockInTime").val($dp.cal.getNewDateStr()) reload(); }