ProjectRecordList.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ProjectRecord/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. function reload() {
  8. $("#dgProjectRecordList").cmsXDataTable("load", $.getDataGridParams("dgProjectRecordList"));
  9. }
  10. //获取选中的数据
  11. function validChoose() {
  12. var d = [];
  13. $.each($("#dgProjectRecordList").cmsXDataTable("getSelections"), function (index) {
  14. d.push(this.ProjectRecordID);
  15. });
  16. return d;
  17. }
  18. function ProjectRecord_Add() {
  19. var redirectTo = url + "?MNU=" + mnu;
  20. $.popupTopWindow('督导项目新增', redirectTo, 1000, 700, null, null);
  21. }
  22. function show(rowIndex, rowData) {
  23. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ProjectRecord/Edit?projectRecordID=" + rowData.ProjectRecordID + "&isShow=1&MNU=" + mnu;
  24. $.popupTopWindow('督导项目', redirectTo, 1000, 700, null, null);
  25. }
  26. function ProjectRecord_Edit() {
  27. var d = validChoose();
  28. var id = validChoose().join(',');
  29. if (d.length == 0) {
  30. $.messager.alert("系统提示", "请选择您要修改的信息。");
  31. return;
  32. }
  33. else if (d.length > 1) {
  34. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  35. return;
  36. }
  37. var redirectTo = url + "?projectRecordID=" + d + "&MNU=" + mnu;
  38. $.popupTopWindow('督导项目修改', redirectTo, 1000, 700, null, null);
  39. }
  40. function startDateChanged(dp) {
  41. $("#StartDate").val($dp.cal.getNewDateStr());
  42. reload();
  43. }
  44. function endDateChanged(dp) {
  45. $("#EndDate").val($dp.cal.getNewDateStr());
  46. reload();
  47. }
  48. function ProjectRecord_Delete() {
  49. var d = validChoose().join(',');
  50. if (d == "") {
  51. $.messager.alert("系统提示", "请选择您要删除的信息。");
  52. return;
  53. }
  54. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  55. if (r) {
  56. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ProjectRecord/Delete', { projectRecordIDs: d }, function (data) {
  57. if (data.IsSuccess) {
  58. $.messager.alert("系统提示", "删除成功!");
  59. $("#dgProjectRecordList").cmsXDataTable('load');
  60. } else {
  61. $.messager.alert("系统提示", data.Message);
  62. }
  63. });
  64. }
  65. });
  66. }
  67. function ProjectRecord_Export() {
  68. var d = validChoose().join(',');
  69. $("[name='SelectedID']").val(d);
  70. $("#formQuery").submit();
  71. }