var url = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationProject/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgEvaluationProjectList").cmsXDataTable("load", $.getDataGridParams("dgEvaluationProjectList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgEvaluationProjectList").cmsXDataTable("getSelections"), function (index) { d.push(this.EvaluationProjectID); }); return d; } //查看 function edit(rowindex, rowdata) { var redirectTo = url + "?EvaluationProjectID=" + rowdata.EvaluationProjectID + "&MNU=" + mnu + "&type=detail"; $.popupTopWindow('评价项目信息', redirectTo, 720, 400, null, null); } //新增 function EvaluationProject_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('评价项目复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationProject/CopyAdd?EvaluationProjectID=' + d[0] + '&MNU=' + mnu, 720, 400, null, null); } else { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('评价项目新增', redirectTo, 720, 400, null, null); } } //修改 function EvaluationProject_Edit() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?EvaluationProjectID=" + d + "&MNU=" + mnu + "&type=edit"; $.popupTopWindow('评价项目修改', redirectTo, 720, 400, null, null); } //删除 function EvaluationProject_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationProject/Delete', { EvaluationProjectIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", data.Message); $("#dgEvaluationProjectList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data.Message); } }); } }); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //导出Excel function EvaluationProject_Export() { $("#formQuery").submit(); } //联动 function queryEvaluationParticipateType() { var evaluationParticipateTypeID = $("#EvaluationParticipateTypeDropdown").combogridX("getValue"); var jsonString = "({'QueryParamsDatas':'EvaluationParticipateTypeDropdown|*|" + evaluationParticipateTypeID + "|@|'})"; $("#EvaluationTableDropdown").combogridX("reload", eval(jsonString)); $("#EvaluationTargetDropdown").combogridX("reload", eval(jsonString)); reload(); } function queryEvaluationType() { var evaluationIntTypeID = $("#EvaluationTypeDropdown").combogridX("getValue"); var jsonString = "({'QueryParamsDatas':'EvaluationTypeDropdown|*|" + evaluationIntTypeID + "|@|'})"; $("#EvaluationTableDropdown").combogridX("reload", eval(jsonString)); $("#EvaluationTargetDropdown").combogridX("reload", eval(jsonString)); reload(); } function queryEvaluationTable() { var evaluationTableID = $("#EvaluationTableDropdown").combogridX("getValue"); var jsonString = "({'QueryParamsDatas':'EvaluationTableDropdown|*|" + evaluationTableID + "|@|'})"; $("#EvaluationTargetDropdown").combogridX("reload", eval(jsonString)); reload(); }