123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
-
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentsOrder/CreatePlan";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //新增
- function Students_Add() {
- var redirectTo = url + '?MNU=' + mnu;
- $.popupTopWindow('待征订计划', redirectTo, 380, 200, null, null);
- }
- function reload() {
- $("#dgStudentsOrderList").cmsXDataTable("load", $.getDataGridParams("dgStudentsOrderList"));
- }
- //获取选中的数据
- function validChooseID() {
- var d = [];
- $.each($("#dgStudentsOrderList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.SpecialtyPlanID);
- });
- return d;
- }
- function validData() {
- var d = [];
- $.each($("#dgStudentsOrderList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //获取征订状态
- function validIsOrdered() {
- var d = [];
- $.each($("#dgStudentsOrderList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.IsOrdered);
- });
- return d;
- }
- //删除
- function Students_Delete() {
- var d = validChooseID().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的征订信息!");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除该征订信息?", function (r) {
- if (r) {
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StudentsOrder/Delete', { specialtyPlanIDs: d }, function (data) {
- if (data == "删除成功") {
- $.messager.alert("系统提示", "删除成功!");
- $("#dgStudentsOrderList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data);
- }
- });
- }
- });
- }
- //确认征订
- function Students_Submit() {
- var d = validChooseID().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要确认的征订信息!");
- return;
- }
- var dataobject = validData();
- //去掉学生人数不为0的不给征订的判断
- // for (var i = 0; i < dataobject.length; i++) {
- // if (dataobject[i].ClassNum <= 0) {
- // $.messager.alert("系统提示", "学生人数为0,不能提交该信息!");
- // return;
- // }
- // }
- $.messager.confirm("系统提示", "您确定您要确认该征订信息?", function (r) {
- if (r) {
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StudentsOrder/ComfirmOrder', { specialtyPlanIDs: d }, function (data) {
- if (data == "征订成功") {
- $.messager.alert("系统提示", "征订成功!");
- $("#dgStudentsOrderList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data);
- }
- });
- }
- });
- }
- //征订计划生成
- function Students_Create() {
- var schoolyearIDStr = $("#SchoolyearDropdown").combobox("getValue");
- if (schoolyearIDStr == "-1") {
- $.messager.alert("系统提示", "请选择要生成计划的学年学期!");
- return;
- }
- $.messager.confirm("系统提示", "您确定要生成征订计划?", function (r) {
- if (r) {
- $(document.forms[0]).submit(); //提交表单
- }
- });
- }
- //获取选中的课程ID
- function validChooseCoursematerialID() {
- var d = [];
- $.each($("#dgStudentsOrderList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.CoursematerialID);
- });
- return d;
- }
- //获取选中的专业计划ID
- function validChooseSpecialtyPlanID() {
- var d = [];
- $.each($("#dgStudentsOrderList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.SpecialtyPlanID);
- });
- return d;
- }
- //指定教材
- function Students_Update() {
- var d = validChooseID().join(',');
- var sp = validChooseSpecialtyPlanID().join(',');
- var f = validIsOrdered();
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要指定教材的征订信息!");
- return;
- }
- var coursematerialIDArray = validChooseCoursematerialID();
- for (var i = 0; i < coursematerialIDArray.length; i++) {
- if (coursematerialIDArray[0] != coursematerialIDArray[i]) {
- $.messager.alert("系统提示", "由于选择指定教材的课程不同,无法进行操作,请重新选择!");
- return;
- }
- }
- paramsModel = {
- StudentsOrderIDs: d,
- CoursematerialID: coursematerialIDArray[0],
- SpecialtyPlanID: sp
- }
- $.popupTopWindow('指定教材', CMS_SystemConfig.VirtualDirectoryPath + '/StudentsOrder/EditTeachingMaterialPool?MNU=' + mnu + '&IsOrdered=' + f, 800, 600, null, paramsModel);
- }
- function Students_Export() {
- $("#ExcelType").val(1);//普通导出
- $("#formQuery").submit();
- }
- //获取选中的数据
- function validChooseobj() {
- var d = [];
- $.each($("#dgStudentsOrderList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //获取选中的数据总库
- function validChooseTmp() {
- var d = [];
- $.each($("#dgStudentsOrderList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.SpecialtyPlanID);
- });
- return d;
- }
- function validChoose() {
- var d = [];
- $.each($("#dgStudentsOrderList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.SpecialtyPlanID);
- });
- return d;
- }
- //预加设置
- function Students_AddNum() {
- var d = validChoose().join(',');
- var tmps = validChooseTmp().join(',');
- //var years = validChooseYear().join(',');
- var c = validChooseobj();
- var orderJsonStr = JSON.stringify(c);
- if (d.length == "") {
- $.messager.alert("系统提示", "请选择要预加设置的信息!");
- return;
- }
- $.popupTopWindow('预加数量设置', CMS_SystemConfig.VirtualDirectoryPath + '/StudentsOrder/BatchSetPreAddedValue?MNU=' + mnu, 380, 150, null, orderJsonStr);
- }
- //预订汇总导出
- function Students_Aggregate_Export() {
- $("#ExcelType").val(2);//预订汇总导出
- $("#formQuery").submit();
- }
- //设置征订数量
- function Students_Change() {
- var d = validChoose().join(',');
- var c = validChooseobj();
- var orderJsonStr = JSON.stringify(c);
- if (d.length == "") {
- $.messager.alert("系统提示", "请选择要征订设置的信息!");
- return;
- }
- $.popupTopWindow('征订数量设置', CMS_SystemConfig.VirtualDirectoryPath + '/StudentsOrder/ChangeOrderQty?MNU=' + mnu, 380, 150, null, orderJsonStr);
- }
- function QueryCampusComboGridList() {
- var campusID = $("#CampusDropdown").combogridX("getValue");
- if (campusID != nonSelect) {
- var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
- $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- }
- reload();
- }
- function QueryCollegeComboGridList() {
- var jsonString = "";
- var parameterString = "";
- var collegeID = $("#CollegeDropdown").combogridX("getValue");
- var schoolYearID = $("#DictionarySchoolyear").combobox("getValue");
- if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
- if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#ComboGridGrademajor").combogridX("reload", eval(jsonString));
- } else {
- $("#ComboGridGrademajor").combogridX("reload");
- }
- reload();
- }
- function QuerySchoolyearDictionaryList(data) {
- var jsonString = "";
- var parameterString = "";
- var collegeID = $("#CollegeDropdown").combogridX("getValue");
- var schoolYearID = $("#DictionarySchoolyear").combobox("getValue");
- if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
- if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#ComboGridGrademajor").combogridX("reload", eval(jsonString));
- } else {
- $("#ComboGridGrademajor").combogridX("reload");
- }
- reload();
- }
- function QuerySchoolyearDropdownList(data) {
- reload();
- }
- function QueryComboGridList(data) {
- reload();
- }
- function QueryHandleModeDictionaryDropDown(data) {
- reload();
- }
- function QuerySchoolyearDropdownList(data) {
- reload();
- }
- function QueryCampusDropdownList(data) {
- $("#CollegeDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/College/CollegeDropdownListBanid?campusID=" + data.Value + "");
- reload();
- }
- function QueryCollegeDropdownList(data) {
- $("#DepartmentDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/Department/DepartmentDropdownListBanid?collegeID=" + data.Value + "");
- reload();
- }
- function QueryYearsDropdownList(data) {
- reload();
- }
- function QueryStandardDropdownList(data) {
- reload();
- }
- function QueryCourseDropdownList(data) {
- reload();
- }
- function QueryCourseTypeDropdownList(data) {
- reload();
- }
- function QueryOrderedDropdownList(data) {
- reload();
- }
|