EvaluationNorm.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationNorm/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgEvaluationNormList").cmsXDataTable("load", $.getDataGridParams("dgEvaluationNormList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgEvaluationNormList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.EvaluationNormID);
  16. });
  17. return d;
  18. }
  19. //查看
  20. function edit(rowindex, rowdata) {
  21. var redirectTo = url + "?evaluationNormID=" + rowdata.EvaluationNormID + "&MNU=" + mnu + "&type=detail";
  22. $.popupTopWindow('评分标准信息', redirectTo, 750, 500, null, null);
  23. }
  24. //新增
  25. function EvaluationNorm_Add() {
  26. var d = validChoose();
  27. if (d.length > 0) {
  28. $.popupTopWindow('评分标准复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationNorm/CopyAdd?evaluationNormID=' + d[0] + '&MNU=' + mnu, 750, 500, null, null);
  29. }
  30. else {
  31. var redirectTo = url + "?MNU=" + mnu;
  32. $.popupTopWindow('评分标准新增', redirectTo, 750, 500, null, null);
  33. }
  34. }
  35. //修改
  36. function EvaluationNorm_Edit() {
  37. var d = validChoose();
  38. if (d.length == 0) {
  39. $.messager.alert("系统信息", "请选择您要修改的信息。");
  40. return;
  41. }
  42. if (d.length > 1) {
  43. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  44. return;
  45. }
  46. var redirectTo = url + "?evaluationNormID=" + d + "&MNU=" + mnu + "&type=edit";
  47. $.popupTopWindow('评分标准修改', redirectTo, 750, 500, null, null);
  48. }
  49. //删除
  50. function EvaluationNorm_Delete() {
  51. var d = validChoose().join(',');
  52. if (d == "") {
  53. $.messager.alert("系统提示", "请选择您要删除的信息。");
  54. return;
  55. }
  56. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  57. if (r) {
  58. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationNorm/Delete', { evaluationNormIDs: d }, function (data) {
  59. if (data.IsSuccess) {
  60. $.messager.alert("系统提示", data.Message);
  61. $("#dgEvaluationNormList").cmsXDataTable('load');
  62. } else {
  63. $.messager.alert("系统提示", data.Message);
  64. }
  65. });
  66. }
  67. });
  68. }
  69. //设置列颜色为红色
  70. function SetRedColumn(index, row, value) {
  71. return " <span style=\"color: red;\">" + value + "</span>";
  72. }
  73. //导出Excel
  74. function EvaluationNorm_Export() {
  75. $("#formQuery").submit();
  76. }