123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/ChangeApply/Edit";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新
- function reload() {
- $("#dgChangeApplyList").cmsXDataTable("load", $.getDataGridParams("dgChangeApplyList"));
- }
- //获取选中的数据All
- function validChooseAll() {
- var d = [];
- $.each($("#dgChangeApplyList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgChangeApplyList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.StudentChangeID);
- });
- return d;
- }
- //申请
- function ChangeApply_Add() {
- var d = validChoose();
- if (d.length > 0) {
- $.popupTopWindow('异动申请复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/ChangeApply/CopyAdd?studentChangeID=' + d[0] + '&MNU=' + mnu, 720, 550, null, null);
- }
- else {
- var redirectTo = url + "?MNU=" + mnu + "&isEnable=" + CMS_SystemConfig.StudentChangeIsEnabled;
- $.popupTopWindow('异动申请新增', redirectTo, 720, 550, null, null);
- }
- }
- //修改
- function ChangeApply_Edit() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统信息", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统信息", "只能选择单个记录进行修改。");
- return;
- }
- var id = validChooseAll();
- if ($.grep(id, function (v, i) { return v.ApprovalStatus != startStatusID && v.ApprovalStatus != backpointStatusID; }).length > 0) {
- $.messager.alert("系统提示", "无法对此状态的信息进行修改。");
- return;
- }
- var redirectTo = url + "?studentChangeID=" + d + "&MNU=" + mnu + "&isEnable=" + CMS_SystemConfig.StudentChangeIsEnabled;
- $.popupTopWindow('异动申请修改', redirectTo, 720, 550, null, null);
- }
- //查看明细
- function edit(rowindex, rowdata) {
- var redirectTo = url + "?studentChangeID=" + rowdata.StudentChangeID + "&MNU=" + mnu + "&type=detail";
- $.popupTopWindow('异动申请信息', redirectTo, 720, 550, null, null);
- }
- //删除
- function ChangeApply_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的信息。");
- return;
- }
- var id = validChooseAll();
- if ($.grep(id, function (v, i) { return v.ApprovalStatus != startStatusID && v.ApprovalStatus != backpointStatusID; }).length > 0) {
- $.messager.alert("系统提示", "数据有误,无法对选择的信息进行删除,请核查。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ChangeApply/Delete', { studentChangeIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgChangeApplyList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //提交
- function ChangeApply_Submit() {
- var d = validChoose().join(',');
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要提交的信息。");
- return;
- }
- var id = validChooseAll();
- if ($.grep(id, function (v, i) { return v.ApprovalStatus != startStatusID && v.ApprovalStatus != backpointStatusID; }).length > 0) {
- $.messager.alert("系统提示", "数据有误,无法对选择的信息进行提交,请核查。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要对选择的信息进行提交?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ChangeApply/ChangeApplySubmit', { studentChangeIDs: d }, function (data) {
- if (data.IsSuccess == true) {
- $.messager.alert("系统提示", data.Message);
- $("#dgChangeApplyList").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 ChangeApply_Report() {
- 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 classmajorID = $("#ClassmajorComboGrid").combogridX("getValue");
- var schoolyearID = $("#SchoolyearDropdown").combobox("getValue");
- var changeTypeID = $("#DictionaryChangeType").combobox("getValue");
- var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue");
- var approvalStatus = $("#DictionaryApprovalStatus").combobox("getValue");
- var studentChangeIDs = validChoose().join(',');
- var conditionString = GetDynamicConditionString();
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ChangeApply/ApplyReport?MNU=' + mnu;
- var studentChangeApplyReportName = $(CMS_SystemConfig.GetConfig()).find("configuration>reportServer>customReportName[name='StudentChangeApplyReport']").attr("customName");
- $.popupTopWindow('异动申请报表', redirectTo, 720, 550, null, {
- CampusID: campusID,
- CollegeID: collegeID,
- GradeID: gradeID,
- StandardID: standardID,
- EducationID: educationID,
- LearningformID: learningformID,
- LearnSystem: learnSystem,
- ClassmajorID: classmajorID,
- SchoolyearID: schoolyearID,
- ChangeTypeID: changeTypeID,
- InSchoolStatus: inSchoolStatus,
- ApprovalStatus: approvalStatus,
- StudentChangeIDs: studentChangeIDs,
- ConditionString: conditionString,
- StudentChangeApplyReportName: studentChangeApplyReportName
- });
- }
- //设置列颜色为红色
- function SetRedColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
- //Excel导出
- function ChangeApply_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));
- $("#DictionaryStandard").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 + "'})";
- $("#DictionaryStandard").combogridX("reload", eval(jsonString));
- //$("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
- $("#ClassmajorComboGrid").combogridX("reload", eval(jsonString));
- }
- else {
- $("#DictionaryStandard").combogridX("reload");
- //$("#GrademajorComboGrid").combogridX("reload");
- $("#ClassmajorComboGrid").combogridX("reload");
- }
- reload();
- }
|