WorktimeAdjustment.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. function WorktimeAdjustment_Add() {
  7. $.popupTopWindow('工作量调整', CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeAdjustment/Edit?MNU=' + mnu, 600, 300);
  8. }
  9. function WorktimeAdjustment_Update() {
  10. var d = validChoose();
  11. if (d.length == 0) {
  12. $.messager.alert("系统信息", "请选择您要修改的工作量调整记录。");
  13. return;
  14. }
  15. if (d.length > 1) {
  16. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  17. return;
  18. }
  19. $.popupTopWindow('工作量调整', CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeAdjustment/Edit?MNU=' + mnu + "&WorktimeAdjustmentID=" + d[0], 600, 300);
  20. }
  21. //删除
  22. function WorktimeAdjustment_Delete() {
  23. var d = validChoose();
  24. if (d.length == 0) {
  25. $.messager.alert("系统提示", "请选择您要删除的工作量调整记录。");
  26. return;
  27. }
  28. $.messager.confirm("系统提示", "您确定要删除该工作量调整记录?", function (r) {
  29. if (r) {
  30. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeAdjustment/Delete', { worktimeAdjustmentIDs: d.join(',') }, function (data) {
  31. if (data.IsSuccess) {
  32. $.messager.alert("系统提示", "删除成功!");
  33. $("#dgWorktimeAdjustmentList").cmsXDataTable('load');
  34. } else {
  35. $.messager.alert("系统提示", data.Message);
  36. }
  37. });
  38. }
  39. });
  40. }
  41. function WorktimeAdjustment_GenerateChargeAgainst() {
  42. $.popupTopWindow('生成被冲学时', CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeAdjustment/GenerateChargeAgainst?MNU=' + mnu, 400, 200);
  43. }
  44. function reload() {
  45. $("#dgWorktimeAdjustmentList").cmsXDataTable("load", $.getDataGridParams("dgWorktimeAdjustmentList"));
  46. }
  47. //获取选中的数据
  48. function validChoose() {
  49. var d = [];
  50. $.each($("#dgWorktimeAdjustmentList").cmsXDataTable("getSelections"), function (index) {
  51. d.push(this.WorktimeAdjustmentID);
  52. });
  53. return d;
  54. }
  55. function WorktimeAdjustment_Excel() {
  56. $(document.forms[0]).submit();
  57. }