EvaluationTarget.js 3.6 KB

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