EvaluationTable.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationTable/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgEvaluationTableList").cmsXDataTable("load", $.getDataGridParams("dgEvaluationTableList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgEvaluationTableList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.EvaluationTableID);
  16. });
  17. return d;
  18. }
  19. //查看
  20. function edit(rowindex, rowdata) {
  21. var redirectTo = url + "?evaluationTableID=" + rowdata.EvaluationTableID + "&MNU=" + mnu + "&type=detail";
  22. $.popupTopWindow('评价表名信息', redirectTo, 680, 320, null, null);
  23. }
  24. //评价表对应的指标明细
  25. function editTarget(rowindex, rowdata) {
  26. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationTable/TargetList?evaluationTableID=" + rowdata.EvaluationTableID + "&MNU=" + mnu;
  27. $.popupTopWindow('评价指标明细', redirectTo, 850, 500, null, null);
  28. }
  29. //评价表对应的项目明细
  30. function editProject(rowindex, rowdata) {
  31. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationTable/ProjectList?evaluationTableID=" + rowdata.EvaluationTableID + "&MNU=" + mnu;
  32. $.popupTopWindow('评价项目明细', redirectTo, 850, 500, null, null);
  33. }
  34. //新增
  35. function EvaluationTable_Add() {
  36. var d = validChoose();
  37. if (d.length > 0) {
  38. $.popupTopWindow('评价表名复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationTable/CopyAdd?evaluationTableID=' + d[0] + '&MNU=' + mnu, 680, 320, null, null);
  39. }
  40. else {
  41. var redirectTo = url + "?MNU=" + mnu;
  42. $.popupTopWindow('评价表名新增', redirectTo, 680, 320, null, null);
  43. }
  44. }
  45. //修改
  46. function EvaluationTable_Edit() {
  47. var d = validChoose();
  48. if (d.length == 0) {
  49. $.messager.alert("系统信息", "请选择您要修改的信息。");
  50. return;
  51. }
  52. if (d.length > 1) {
  53. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  54. return;
  55. }
  56. var redirectTo = url + "?evaluationTableID=" + d + "&MNU=" + mnu + "&type=edit";
  57. $.popupTopWindow('评价表名修改', redirectTo, 680, 320, null, null);
  58. }
  59. //删除
  60. function EvaluationTable_Delete() {
  61. var d = validChoose().join(',');
  62. if (d == "") {
  63. $.messager.alert("系统提示", "请选择您要删除的信息。");
  64. return;
  65. }
  66. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  67. if (r) {
  68. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationTable/Delete', { evaluationTableIDs: d }, function (data) {
  69. if (data.IsSuccess) {
  70. $.messager.alert("系统提示", data.Message);
  71. $("#dgEvaluationTableList").cmsXDataTable('load');
  72. } else {
  73. $.messager.alert("系统提示", data.Message);
  74. }
  75. });
  76. }
  77. });
  78. }
  79. //设置列颜色为红色
  80. function SetRedColumn(index, row, value) {
  81. return " <span style=\"color: red;\">" + value + "</span>";
  82. }
  83. //设置相应的行颜色为红色
  84. function SetRedGrid(rowIndex, rowData) {
  85. if (rowData.IsEnabled != true) {
  86. return "color: red;";
  87. }
  88. else {
  89. return "";
  90. }
  91. }
  92. //导出Excel
  93. function EvaluationTable_Export() {
  94. $("#formQuery").submit();
  95. }