123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/NewStudentEnter/Edit";
- var mnu = "";
- //url个性化配置
- var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='NewStudentEnterEdit']");
- if (customerUrl.attr("value")) {
- url = CMS_SystemConfig.VirtualDirectoryPath + customerUrl.attr("value");
- }
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新
- function reload() {
- $("#dgNewStudentEnterList").cmsXDataTable("load", $.getDataGridParams("dgNewStudentEnterList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgNewStudentEnterList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.NewStudentID);
- });
- return d;
- }
- //获取选中的状态
- function validChooseStatus() {
- var d = [];
- $.each($("#dgNewStudentEnterList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.RecordStatus);
- });
- return d;
- }
- //查看
- function detail(rowindex, rowdata) {
- var redirectTo = url + "?newNewStudentID=" + rowdata.NewStudentID + "&MNU=" + mnu + "&type=detail";
- $.popupTopWindow('录取名单信息', redirectTo, 650, 550, null, null);
- }
- //新增
- function NewStudentEnter_Add() {
- var d = validChoose();
- if (d.length > 0) {
- $.popupTopWindow('录取名单复制新增', url + '?newNewStudentID=' + d[0] + '&MNU=' + mnu + '&type=copyAdd', 650, 550, null, null);
- } else {
- var redirectTo = url + "?MNU=" + mnu + "&type=add";
- $.popupTopWindow('录取名单新增', redirectTo, 650, 550, null, null);
- }
- }
- //修改
- function NewStudentEnter_Edit() {
- var d = validChoose();
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- var r = validChooseStatus();
- if (r[0] == submitted) {
- $.messager.alert("系统提示", "无法对已提交状态的信息进行修改。");
- return;
- }
- var redirectTo = url + "?newNewStudentID=" + d + "&MNU=" + mnu + "&type=edit";
- $.popupTopWindow('录取名单修改', redirectTo, 650, 550, null, null);
- }
- //批量修改
- SystemBatchModifyControl.OnSubmit = function () {
- var status = validChooseStatus().join(',');
- for (var i = 0; i < status.split(',').length; i++) {
- if (status.split(',')[i] == submitted) {
- $.messager.alert("系统提示", "无法对已提交状态的信息进行修改。");
- return false;
- }
- }
- }
- //删除
- function NewStudentEnter_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的信息。");
- return;
- }
- var r = validChooseStatus();
- if ($.grep(r, function (v, i) { return v == submitted; }).length > 0) {
- $.messager.alert("系统提示", "无法对已提交状态的信息进行删除。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/Delete', { newStudentIDs: d }, function (data) {
- if (data.IsSuccess = true) {
- $.messager.alert("系统提示", data.Message);
- $("#dgNewStudentEnterList").cmsXDataTable('load');
- }
- else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //删除照片
- function NewStudentEnter_PicDelete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除照片的信息。");
- return;
- }
- var r = validChooseStatus();
- if ($.grep(r, function (v, i) { return v == submitted; }).length > 0) {
- $.messager.alert("系统提示", "无法对已提交状态的信息进行删除照片。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除选择的信息对应的照片?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/PicDelete', { newStudentIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgNewStudentEnterList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //取消分配(未分配)
- function NewStudentEnter_CancelAssignCollege() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要取消分配的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要对选择的信息取消分配?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/CancelAssignCollege', { newStudentIDs: d }, function (data) {
- if (data.IsSuccess = true) {
- $.messager.alert("系统提示", data.Message);
- $("#dgNewStudentEnterList").cmsXDataTable('load');
- }
- else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //导入照片
- function NewStudentEnter_PicImport() {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/PicImport?MNU=' + mnu;
- $.popupTopWindow('导入照片', redirectTo, 420, 300, reload);
- }
- //导入标识
- function NewStudentEnter_DoubtImport() {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/DoubtImport?MNU=' + mnu;
- $.popupTopWindow('导入标识', redirectTo, 420, 300, reload);
- }
- //标识名单
- function NewStudentEnter_DoubtList() {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/NewStudentEnter/DoubtList" + "?MNU=" + mnu;;
- $.popupTopWindow('标识名单信息', redirectTo, 950, 540, reload);
- }
- //初始化(班级信息、学号)
- function NewStudentEnter_Init() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要初始化的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要对选择的信息初始化?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/Init', { newStudentIDs: d }, function (data) {
- if (data.IsSuccess = true) {
- $.messager.alert("系统提示", data.Message);
- $("#dgNewStudentEnterList").cmsXDataTable('load');
- }
- else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //生成学号
- function NewStudentEnter_AssignClass() {
- var d = validChoose();
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要生成学号的信息。");
- return;
- }
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/NewStudentEnter/AssignClass?MNU=" + mnu;
- $.popupTopWindow('生成学号', redirectTo, 750, 325, reload, d);
- }
- //自动生成学号
- function NewStudentEnter_AutoAssignClass() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要自动生成学号的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要对选择的信息自动生成学号?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/AutoAssignClass', { newStudentIDs: d }, function (data) {
- if (data.IsSuccess = true) {
- $.messager.alert("系统提示", data.Message);
- $("#dgNewStudentEnterList").cmsXDataTable('load');
- }
- else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //获取列表字段查询对应比较符
- function GetDynamicConditionString() {
- var conditionString = "";
- var attribute = eval('(' + $("[name='Attribute']").val() + ')').Value;
- var condition = $("[name='Condition']").val();
- var value = $.trim($("[name='Condition']").parent().parent().next().find("[name^=" + attribute + "]").val());
- if (document.getElementsByName(attribute + "_QueryDictionaryDropDownList")[0] != null) {
- if (value == "-1") {
- conditionString = "";
- } else {
- conditionString = "WHERE " + attribute + "=" + value;
- }
- } else {
- if (value != "") {
- if (condition == "左") {
- conditionString = "WHERE " + attribute + " LIKE '" + value + "%'";
- } else if (condition == "右") {
- conditionString = "WHERE " + attribute + " LIKE '%" + value + "'";
- } else if (condition == "中") {
- conditionString = "WHERE " + attribute + " LIKE '%" + value + "%'";
- } else {
- conditionString = "WHERE " + attribute + condition + "'" + value + "'";
- }
- } else {
- conditionString = "";
- }
- }
- return conditionString;
- }
- //录取通知书打印
- function NewStudentEnter_AdmissionLetter() {
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var collegeID = $("#CollegeDropdown").combogridX("getValue");
- var gradeID = $("#DictionaryGrade").combogridX("getValue"); //combobox
- var standardID = $("#DictionaryStandard").combogridX("getValue");
- var educationID = $("#DictionaryEducation").combogridX("getValue");
- var learningformID = $("#DictionaryLearningform").combogridX("getValue");
- var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
- var grademajorID = $("#GrademajorComboGrid").combogridX("getValue");
- var classmajorID = $("#ClassmajorComboGrid").combogridX("getValue");
- var isDoubt = $("#DictionaryGeneralPurpose").combobox("getValue");
- var isStudentNo = $("#DictionaryGeneralExist").combobox("getValue");
- var recordStatus = $("#DictionaryNewStudentEnterStatus").combobox("getValue");
- var newStudentIDs = validChoose().join(',');
- var conditionString = GetDynamicConditionString();
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/AdmissionLetterReport?MNU=' + mnu;
- $.popupTopWindow('录取通知书打印', redirectTo, 720, 550, null, {
- CampusID: campusID,
- CollegeID: collegeID,
- GradeID: gradeID,
- StandardID: standardID,
- EducationID: educationID,
- LearningformID: learningformID,
- LearnSystem: learnSystem,
- GrademajorID: grademajorID,
- ClassmajorID: classmajorID,
- IsDoubt: isDoubt,
- IsStudentNo: isStudentNo,
- RecordStatus: recordStatus,
- NewStudentIDs: newStudentIDs,
- ConditionString: conditionString
- });
- }
- //提交
- function NewStudentEnter_Submit() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要提交的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要提交选择的信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/Submit', { newStudentIDs: d }, function (data) {
- if (data.IsSuccess = true) {
- $.messager.alert("系统提示", data.Message);
- $("#dgNewStudentEnterList").cmsXDataTable('load');
- }
- else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //设置列颜色为红色
- function SetRedColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
- //设置相应的行字体颜色为红色
- function SetRowGrid(rowIndex, rowData) {
- if (rowData.IsDoubt == true) {
- return "color: red;";
- } else {
- return "";
- }
- }
- //设置相应的行背景颜色
- function SetRowBackgroundGrid(rowIndex, rowData) {
- if (rowData.IsDoubt == true) {
- return "background-color: yellow;";
- } else {
- return "";
- }
- }
- //Excel导出
- function NewStudentEnter_Export() {
- $("#formQuery").submit();
- }
- //联动查询
- function queryCampus(data) {
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
- $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- queryClass();
- }
- function queryCollege(data) {
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var collegeID = $("#CollegeDropdown").combogridX("getValue");
- var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
- jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
- $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- queryClass();
- }
- function queryGrade(data) {
- queryClass();
- }
- function queryStandard(data) {
- queryClass();
- }
- function queryLearnSystem(data) {
- queryClass();
- }
- function queryGrademajor(data) {
- queryClass();
- }
- function queryClass() {
- var jsonString = "";
- var parameterString = "";
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var collegeID = $("#CollegeDropdown").combogridX("getValue");
- var gradeID = $("#DictionaryGrade").combogridX("getValue");
- var standardID = $("#DictionaryStandard").combogridX("getValue");
- var educationID = $("#DictionaryEducation").combogridX("getValue");
- var learningformID = $("#DictionaryLearningform").combogridX("getValue");
- var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
- //年级专业
- var grademajorID = $("#GrademajorComboGrid").combogridX("getValue");
- if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
- if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
- if (gradeID != nonSelect) parameterString += "DictionaryGrade|*|" + gradeID + "|@|";
- if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
- if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
- if (learningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningformID + "|@|";
- if (learnSystem != nonSelect) parameterString += "DictionaryLearnSystem|*|" + learnSystem + "|@|";
- //年级专业
- if (grademajorID != nonSelect) parameterString += "GrademajorComboGrid|*|" + grademajorID + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
- $("#ClassmajorComboGrid").combogridX("reload", eval(jsonString));
- }
- else {
- $("#GrademajorComboGrid").combogridX("reload");
- $("#ClassmajorComboGrid").combogridX("reload");
- }
- reload();
- }
|