WorktimeRate.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. function WorktimeRate_Add() {
  7. var d = validChoose();
  8. var windowDiv;
  9. if (d.length == 0) {
  10. windowDiv = $.popupTopWindow('工作量系数', CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeRate/Edit?MNU=' + mnu, 600, 210);
  11. } else {
  12. windowDiv = $.popupTopWindow('工作量系数', CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeRate/Edit?SourceID=' + d[0] + '&MNU=' + mnu, 600, 210);
  13. }
  14. windowDiv.panel({
  15. onBeforeClose: function () {
  16. //windowDiv.dialog("close");
  17. reload();
  18. }
  19. });
  20. }
  21. function WorktimeRate_Update() {
  22. var d = validChoose();
  23. if (d.length == 0) {
  24. $.messager.alert("系统信息", "请选择您要修改的工作量系数。");
  25. return;
  26. }
  27. if (d.length > 1) {
  28. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  29. return;
  30. }
  31. $.popupTopWindow('工作量系数', CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeRate/Edit?MNU=' + mnu + "&WorktimeRateID=" + d[0], 600, 210);
  32. }
  33. //删除
  34. function WorktimeRate_Delete() {
  35. var d = validChoose();
  36. if (d.length == 0) {
  37. $.messager.alert("系统提示", "请选择您要删除的工作量系数。");
  38. return;
  39. }
  40. $.messager.confirm("系统提示", "您确定要删除该工作量系数?", function (r) {
  41. if (r) {
  42. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeRate/Delete', { worktimeRateIDs: d.join(',') }, function (data) {
  43. if (data.IsSuccess) {
  44. $.messager.alert("系统提示", "删除成功!");
  45. $("#dgWorktimeRateList").cmsXDataTable('load');
  46. } else {
  47. $.messager.alert("系统提示", data.Message);
  48. }
  49. });
  50. }
  51. });
  52. }
  53. function reload() {
  54. $("#dgWorktimeRateList").cmsXDataTable("load", $.getDataGridParams("dgWorktimeRateList"));
  55. }
  56. //获取选中的数据
  57. function validChoose() {
  58. var d = [];
  59. $.each($("#dgWorktimeRateList").cmsXDataTable("getSelections"), function (index) {
  60. d.push(this.WorktimeRateID);
  61. });
  62. return d;
  63. }