EvaluationProject.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationProject/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgEvaluationProjectList").cmsXDataTable("load", $.getDataGridParams("dgEvaluationProjectList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgEvaluationProjectList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.EvaluationProjectID);
  16. });
  17. return d;
  18. }
  19. //查看
  20. function edit(rowindex, rowdata) {
  21. var redirectTo = url + "?EvaluationProjectID=" + rowdata.EvaluationProjectID + "&MNU=" + mnu + "&type=detail";
  22. $.popupTopWindow('评价项目信息', redirectTo, 720, 400, null, null);
  23. }
  24. //新增
  25. function EvaluationProject_Add() {
  26. var d = validChoose();
  27. if (d.length > 0) {
  28. $.popupTopWindow('评价项目复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationProject/CopyAdd?EvaluationProjectID=' + d[0] + '&MNU=' + mnu, 720, 400, null, null);
  29. }
  30. else {
  31. var redirectTo = url + "?MNU=" + mnu;
  32. $.popupTopWindow('评价项目新增', redirectTo, 720, 400, null, null);
  33. }
  34. }
  35. //修改
  36. function EvaluationProject_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 + "?EvaluationProjectID=" + d + "&MNU=" + mnu + "&type=edit";
  47. $.popupTopWindow('评价项目修改', redirectTo, 720, 400, null, null);
  48. }
  49. //删除
  50. function EvaluationProject_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 + '/EvaluationProject/Delete', { EvaluationProjectIDs: d }, function (data) {
  59. if (data.IsSuccess) {
  60. $.messager.alert("系统提示", data.Message);
  61. $("#dgEvaluationProjectList").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 EvaluationProject_Export() {
  75. $("#formQuery").submit();
  76. }
  77. //联动
  78. function queryEvaluationParticipateType() {
  79. var evaluationParticipateTypeID = $("#EvaluationParticipateTypeDropdown").combogridX("getValue");
  80. var jsonString = "({'QueryParamsDatas':'EvaluationParticipateTypeDropdown|*|" + evaluationParticipateTypeID + "|@|'})";
  81. $("#EvaluationTableDropdown").combogridX("reload", eval(jsonString));
  82. $("#EvaluationTargetDropdown").combogridX("reload", eval(jsonString));
  83. reload();
  84. }
  85. function queryEvaluationType() {
  86. var evaluationIntTypeID = $("#EvaluationTypeDropdown").combogridX("getValue");
  87. var jsonString = "({'QueryParamsDatas':'EvaluationTypeDropdown|*|" + evaluationIntTypeID + "|@|'})";
  88. $("#EvaluationTableDropdown").combogridX("reload", eval(jsonString));
  89. $("#EvaluationTargetDropdown").combogridX("reload", eval(jsonString));
  90. reload();
  91. }
  92. function queryEvaluationTable() {
  93. var evaluationTableID = $("#EvaluationTableDropdown").combogridX("getValue");
  94. var jsonString = "({'QueryParamsDatas':'EvaluationTableDropdown|*|" + evaluationTableID + "|@|'})";
  95. $("#EvaluationTargetDropdown").combogridX("reload", eval(jsonString));
  96. reload();
  97. }