123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSubject/Edit";
- var mnu;
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- });
- function ExaminationSubject_Export() {
- $(document.forms[0]).submit();
- }
- function ExaminationSubject_Add() {
- redirectTo = url + "?MNU=" + mnu;
- $.popupTopWindow("考试科目新增", redirectTo, 810, 350, null, null);
- }
- function reload() {
- $("#dgExaminationSubjectList").cmsXDataTable("load", $.getDataGridParams("dgExaminationSubjectList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgExaminationSubjectList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.ExaminationSubjectID);
- });
- return d;
- }
- function validChooseName() {
- var d = [];
- $.each($("#dgExaminationSubjectList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.Name);
- });
- return d;
- }
- function validChooseExaminationTypeID() {
- var d = [];
- $.each($("#dgExaminationSubjectList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.ExaminationTypeID);
- });
- return d;
- }
- function validChooseExaminationFormID() {
- var d = [];
- $.each($("#dgExaminationSubjectList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.ExaminationFormID);
- });
- return d;
- }
- function validChooseSchoolyearID() {
- var d = [];
- $.each($("#dgExaminationSubjectList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.SchoolyearID);
- });
- return d;
- }
- //批量修改执行前触发事件
- SystemBatchModifyControl.OnSubmit = function (a) {
- if (document.getElementById("ExaminationTypeIDDropdownList_div").style.display != "none") {
- var examinationFormID = validChooseExaminationFormID();
- var examinationFormIDs = validChooseExaminationFormID().join(",");
- var schoolyearIDs = validChooseSchoolyearID().join(",");
- var names = validChooseName().join(",");
- var examinationTypeIDs = "";
- for (var i = 0; i < examinationFormID.length; i++) {
- examinationTypeIDs += $("#ExaminationTypeID_DropdownList").combobox("getValue") + ",";
- }
- examinationTypeIDs = examinationTypeIDs.substr(0, examinationTypeIDs.length - 1);
- var bool = true;
- $.ajax({ url: CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSubject/Validation?examinationTypeIDs=' + examinationTypeIDs + '&examinationFormIDs=' + examinationFormIDs + '&schoolyearIDs=' + schoolyearIDs + '&names=' + encodeURI(names),
- type: "post", dataType: "json", async: false,
- success: function (data) {
- if (data.IsSuccess != true) {
- $.messager.alert("系统提示", data.Message);
- bool = false;
- }
- }
- });
- if (bool != true)
- return false;
- }
- else if (document.getElementById("ExaminationFormIDDictionaryDropDownList_div").style.display != "none") {
- var examinationFormID = validChooseExaminationFormID();
- var examinationTypeIDs = validChooseExaminationTypeID().join(",");
- var schoolyearIDs = validChooseSchoolyearID().join(",");
- var names = validChooseName().join(",");
- var examinationFormIDs = "";
- for (var i = 0; i < examinationFormID.length; i++) {
- examinationFormIDs += $("#ExaminationFormID_DictionaryDropDownList").combobox("getValue") + ",";
- }
- examinationFormIDs = examinationFormIDs.substr(0, examinationFormIDs.length - 1);
- var bool = true;
- $.ajax({ url: CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSubject/Validation?examinationTypeIDs=' + examinationTypeIDs + '&examinationFormIDs=' + examinationFormIDs + '&schoolyearIDs=' + schoolyearIDs + '&names=' + encodeURI(names),
- type: "post", dataType: "json", async: false,
- success: function (data) {
- if (data.IsSuccess != true) {
- $.messager.alert("系统提示", data.Message);
- bool = false;
- }
- }
- });
- if (bool != true)
- return false;
- }
- else if (document.getElementById("SchoolyearIDDropdownList_div").style.display != "none") {
- var examinationFormID = validChooseExaminationFormID();
- var examinationTypeIDs = validChooseExaminationTypeID().join(",");
- var examinationFormIDs = validChooseExaminationFormID().join(",");
- var names = validChooseName().join(",");
- var schoolyearIDs = "";
- for (var i = 0; i < examinationFormID.length; i++) {
- schoolyearIDs += $("#SchoolyearID_DropdownList").combobox("getValue") + ",";
- }
- schoolyearIDs = schoolyearIDs.substr(0, schoolyearIDs.length - 1);
- var bool = true;
- $.ajax({ url: CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSubject/Validation?examinationTypeIDs=' + examinationTypeIDs + '&examinationFormIDs=' + examinationFormIDs + '&schoolyearIDs=' + schoolyearIDs + '&names=' + encodeURI(names),
- type: "post", dataType: "json", async: false,
- success: function (data) {
- if (data.IsSuccess != true) {
- $.messager.alert("系统提示", data.Message);
- bool = false;
- }
- }
- });
- if (bool != true)
- return false;
- }
- }
- //点击列表更新
- function edit(rowindex, rowdata) {
- redirectTo = url + "?ExaminationSubjectID=" + rowdata.ExaminationSubjectID + "&MNU=" + mnu + "&isView=1";
- $.popupTopWindow("考试科目新增", redirectTo, 810, 350, null, null);
- }
- //修改按钮
- function ExaminationSubject_Update() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要修改的考试科目。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- redirectTo = url + "?ExaminationSubjectID=" + d + "&MNU=" + mnu;
- $.popupTopWindow("考试科目新增", redirectTo, 810, 350, null, null);
- }
- //删除
- function ExaminationSubject_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的考试科目。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除该考试科目?", function (r) {
- if (r) {
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSubject/Delete', { examinationSubjectIDs: d }, function (data) {
- if (data == "删除成功") {
- $.messager.alert("系统提示", "删除成功!");
- $("#dgExaminationSubjectList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data);
- }
- });
- }
- });
- }
|