var url = CMS_SystemConfig.VirtualDirectoryPath + "/TeachersOrder/Add"; var EditUrl = CMS_SystemConfig.VirtualDirectoryPath + "/TeachersOrder/Edit"; var ViewUrl = CMS_SystemConfig.VirtualDirectoryPath + "/TeachersOrder/DetailList"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //新增 function TeachersOrder_Add() { var redirectTo = url + '?MNU=' + mnu; $.popupTopWindow('征订申请', redirectTo, 850, 600, null, null); } function reload() { $("#dgTeachersOrderList").cmsXDataTable("load", $.getDataGridParams("dgTeachersOrderList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgTeachersOrderList").cmsXDataTable("getSelections"), function (index) { d.push(this.TeachersOrderID); }); return d; } //获取选中的数据ID、多个 function validChooseID() { $("#hid_ApprovalStatusName").val(""); var d = []; var s = []; $.each($("#dgTeachersOrderList").cmsXDataTable("getSelections"), function (index) { d.push(this.TeachersOrderID); s.push(this.ApprovalStatusName); }); $("#hid_ApprovalStatusName").val(s.join(',')); return d; } //点击查看审核流程步骤 function TeachersOrderDetail(rowindex, rowdata) { var redirectTo = ViewUrl + '?TeachersOrderID=' + rowdata.TeachersOrderID + '&MNU=' + mnu; $.popupTopWindow('教师征订明细', redirectTo, 800, 600, null, null); } //修改按钮 function TeachersOrder_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的教材信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = EditUrl + '?TeachersOrderID=' + d + '&MNU=' + mnu; $.popupTopWindow('教师征订信息', redirectTo, 750, 330, null, null); } //提交申请 function TeachersOrder_Submit() { var d = validChooseID().join(','); var state = $("#hid_ApprovalStatusName").val(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要提交申请征订信息。"); return; } for (var i = 0; i < state.split(',').length; i++) { if (state.split(',')[i] != "") { //取消申请或者结束流程 if (state.split(',')[i] == "已通过") { $.messager.alert("系统提示", "抱歉,您提交申请中存已存审批状态为“已通过”的申请单,请重新选择提交!"); return; } } } $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/TeachersOrder/SubmitTeachersOrder', { TeachersOrderIDs: d }, function (data) { if (data == "成功") { $.messager.alert("系统提示", "征订申请提交成功!"); $("#dgTeachersOrderList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } //删除 function TeachersOrder_Delete() { var d = validChooseID().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的征订信息!"); return; } $.messager.confirm("系统提示", "您确定要删除该征订信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/TeachersOrder/Delete', { TeachersOrderIDs: d }, function (data) { if (data == "删除成功") { $.messager.alert("系统提示", "删除成功!"); $("#dgTeachersOrderList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function TeachersOrder_Export() { $("#ExcelType").val(1);//普通导出 $("#formQuery").submit(); } //教师征订汇总导出 function TeachersOrder_Aggregate_Export() { $("#ExcelType").val(2);//预订汇总导出 $("#formQuery").submit(); } function QueryPublishDropdownList(data) { reload(); } function QueryCourseDropdownList(data) { reload(); } function QuerySchoolYearDropdownList(data) { reload(); } function QueryCollegeDropdownList(data) { reload(); } function QueryStatusDropdownList(data) { reload(); }