EvaluationNeed.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationNeed/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgEvaluationNeedList").cmsXDataTable("load", $.getDataGridParams("dgEvaluationNeedList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgEvaluationNeedList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.EvaluationNeedID);
  16. });
  17. return d;
  18. }
  19. //查看
  20. function edit(rowindex, rowdata) {
  21. var redirectTo = url + "?evaluationNeedID=" + rowdata.EvaluationNeedID + "&MNU=" + mnu + "&type=detail";
  22. $.popupTopWindow('评价需知信息', redirectTo, 720, 350, null, null);
  23. }
  24. //新增
  25. function EvaluationNeed_Add() {
  26. var d = validChoose();
  27. if (d.length > 0) {
  28. $.popupTopWindow('评价需知复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationNeed/CopyAdd?evaluationNeedID=' + d[0] + '&MNU=' + mnu, 720, 350, null, null);
  29. }
  30. else {
  31. var redirectTo = url + "?MNU=" + mnu;
  32. $.popupTopWindow('评价需知新增', redirectTo, 720, 350, null, null);
  33. }
  34. }
  35. //修改
  36. function EvaluationNeed_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 + "?evaluationNeedID=" + d + "&MNU=" + mnu + "&type=edit";
  47. $.popupTopWindow('评价需知修改', redirectTo, 720, 350, null, null);
  48. }
  49. //删除
  50. function EvaluationNeed_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 + '/EvaluationNeed/Delete', { evaluationNeedIDs: d }, function (data) {
  59. if (data.IsSuccess) {
  60. $.messager.alert("系统提示", data.Message);
  61. $("#dgEvaluationNeedList").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. //设置相应的行颜色为红色
  74. function SetRedGrid(rowIndex, rowData) {
  75. if (rowData.IsEnabled != true) {
  76. return "color: red;";
  77. }
  78. else {
  79. return "";
  80. }
  81. }
  82. //导出Excel
  83. function EvaluationNeed_Export() {
  84. $("#formQuery").submit();
  85. }