//联动批次 function cgopSchoolYearSelect(data) { var SchoolyearID = $("#SchoolYearCode").combogridX("getValue"); //$("#ExaminationBatchID").combogridX("setValue", "-1"); $('#ProjectName').val(""); $('#ExaminationType').val(""); var jsonString = "({'QueryParamsDatas':'SchoolyearID|*|" + SchoolyearID + "|@|'})"; $("#ExaminationBatchID").combogridX("reload", eval(jsonString)); } function cgopBatchSelect(data) { var ExaminationBatchID = $("#ExaminationBatchID").combogridX("getValue"); //$("#ExaminationTypeID").combogridX("setValue", "-1"); //$("#ExaminationBatchProjectID").combogridX("setValue", "-1"); var jsonString = "({'QueryParamsDatas':'ExaminationBatchID|*|" + ExaminationBatchID + "|@|'})"; $("#ExaminationTypeID").combogridX("reload", eval(jsonString)); } function cgopExamTypeSelect(data) { var ExaminationTypeID = $("#ExaminationTypeID").combogridX("getValue"); //$("#ExaminationBatchProjectID").combogridX("setValue", "-1"); var ExaminationBatchID = $("#ExaminationBatchID").combogridX("getValue"); var jsonString = "({'QueryParamsDatas':'ExaminationTypeID|*|" + ExaminationTypeID + "|@|ExaminationBatchID|*|" + ExaminationBatchID + "|@|'})"; $("#ExaminationProjectID").combogridX("reload", eval(jsonString)); } function cgopBatchProjectSelect(data) { var ExaminationProjectID = $("#ExaminationProjectID").combogridX("getValue"); var ExaminationBatchID = $("#ExaminationBatchID").combogridX("getValue"); //$("#ExaminationProjectFeeID").combogridX("setValue", "-1"); var jsonString = "({'QueryParamsDatas':'cgExaminationProject|*|" + ExaminationProjectID + "|@|cgExaminationBatch|*|" + ExaminationBatchID + "|@|'})"; $("#ExaminationProjectFeeID").combogridX("reload", eval(jsonString)); } function Save() { $(document.forms[0]).submit(); } function Add() { var mnu = $.SystemGeneral.getUrlParam("MNU"); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExamProjectControl/Select' + '?MNU=' + mnu + "&key=StandardID"; $.popupTopWindow('选择标准专业', redirectTo, 600, 400, function (data) { if (data == null || data.length == 0) return; Add_Confirm(data); }, null); } function Add_Confirm(studentList) { if (!studentList) return; var studentViewList = $("#dgStandardList").cmsXDataTable("getRows"); var addedStudentViewList = $.map( $.grep(studentList, function (x) { return $.grep(studentViewList, function (y) { return y.StandardID == x.StandardID; }).length == 0; }), function (x) { return { CollegeCode: x.CollegeCode, CollegeID: x.CollegeID, SchoolyearID: x.SchoolyearID, StandardCode: x.StandardCode, StandardName: x.StandardName, StandardID: x.StandardID, CollegeName: x.CollegeName }; }); var addedStudentIDs = $.map(addedStudentViewList, function (x) { return x.StandardID; }).join(','); var newStudentViewList = addedStudentViewList.concat(studentViewList); $("#dgStandardList").cmsXDataTable("loadData", { rows: newStudentViewList, total: newStudentViewList.length }); } function validChooseUser() { var d = []; $.each($("#dgStandardList").cmsXDataTable("getSelections"), function (index) { d.push(this.StandardID); }); return d; } function Delete() { var selectrows = $("#dgStandardList").cmsXDataTable("getSelections"); if (selectrows.length == "") { $.messager.alert("系统信息", "请选择您要删除的信息。"); return; } var studentViewList = $("#dgStandardList").cmsXDataTable("getRows"); var i, j; var len = studentViewList.length; for (i = len - 1; i >= 0; i--) { for (j = 0; j < selectrows.length; j++) { if (studentViewList[i].StandardID == selectrows[j].StandardID && studentViewList[i].SchoolyearID == selectrows[j].SchoolyearID && studentViewList[i].CollegeID == selectrows[j].CollegeID) { studentViewList.splice(i, 1); break; } } } $("#dgStandardList").cmsXDataTable("loadData", { rows: studentViewList, total: studentViewList.length }); }