12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //获取选中的列表数据(All)
- function validChoose() {
- var d = [];
- $.each($("#dgDegreeConditionList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //获取列表数据(列表中的所有行数据)
- function validChooseID() {
- var d = [];
- $.each($("#dgDegreeConditionList").cmsXDataTable("getRows"), function (index) {
- d.push(this.DegreeConditionID);
- });
- return d;
- }
- //保存
- function DegreeConditionPackage_Save() {
- var d = validChooseID();
- if (d == "") {
- $.messager.alert("系统提示", "请添加学位条件。");
- return
- }
- $(document.forms[0]).submit();
- }
- //添加页面(学位条件添加)
- function DegreeConditionAdd() {
- var degreeConditionPackageID = document.getElementById("DegreeConditionPackageID").value;
- $.popupTopWindow('学位条件添加', CMS_SystemConfig.VirtualDirectoryPath
- + '/DegreeConditionPackage/DegreeConditionList?DegreeConditionPackageID='
- + degreeConditionPackageID + '&FromMNU=' + mnu, 600, 420, AddDegreeCondition_Confirm);
- }
- //加载选中的信息(学位条件)
- function AddDegreeCondition_Confirm(DegreeConditionList) {
- if (DegreeConditionList == undefined || DegreeConditionList.length < 1) {
- return;
- }
- var DegreeConditionViewList = $("#dgDegreeConditionList").cmsXDataTable("getRows");
- $.each(DegreeConditionList, function (index, value) {
- if ($.grep(DegreeConditionViewList, function (row, index) {
- return value.DegreeConditionID == row.DegreeConditionID;
- }).length == 0) {
- DegreeConditionViewList.push({
- DegreeConditionID: value.DegreeConditionID,
- OrderNo: value.OrderNo,
- Title: value.Title,
- IsEnable: value.IsEnable
- });
- }
- });
- $("#dgDegreeConditionList").cmsXDataTable("loadData", {
- rows: DegreeConditionViewList,
- total: DegreeConditionViewList.length
- });
- }
- //删除(学位条件删除)
- function DegreeConditionDelete() {
- var d = validChoose();
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的信息。");
- return;
- }
- var degreeConditionViewList = $("#dgDegreeConditionList").cmsXDataTable("getRows");
- var i, j;
- var len = degreeConditionViewList.length;
- for (i = len - 1; i >= 0; i--) {
- for (j = 0; j < d.length; j++) {
- if (degreeConditionViewList[i].DegreeConditionID == d[j].DegreeConditionID) {
- degreeConditionViewList.splice(i, 1);
- break;
- }
- }
- }
- $("#dgDegreeConditionList").cmsXDataTable("loadData", {
- rows: degreeConditionViewList,
- total: degreeConditionViewList.length
- });
- }
|