9b64b64eec14b120d6f02530fe071b682c9f1b62.svn-base 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. shr.defineClass("shr.compensation.CmpPersonHasDynamicListExt", shr.compensation.CmpPersonHasDynamicList, {
  2. isSum : false,
  3. isSchemeItems : false,
  4. initalizeDOM : function () {
  5. var it = this;
  6. //this.initCustomSetting();
  7. shr.compensation.CmpPersonHasDynamicListExt.superClass.initalizeDOM.call(this);
  8. // this.initBreadcrumb();
  9. },
  10. /**
  11. * 直接添加需要核算员工名单
  12. */
  13. immediateAddPersonAction : function(){
  14. var it = this;
  15. var confirmMessage ="是否将已有核算员工清空后(已锁定或已审核除外)添加";
  16. it.showDelConfirm(confirmMessage, function(){
  17. it.immediateAddPersonExe(1);
  18. },function(){it.immediateAddPersonExe(0)});
  19. },
  20. immediateAddPersonExe : function(isDel){
  21. var it = this;
  22. var param = {isDel:isDel,cmpschemeid:it.cmpschemeid};
  23. it.remoteCall({
  24. type : "post",
  25. showBlock : true,
  26. method : "immediateAddPerson",
  27. param : param,
  28. success : function(res){
  29. shr.showInfo({
  30. message : res.message,
  31. hideAfter : 5
  32. });
  33. it.queryGrid(true);
  34. }
  35. });
  36. },
  37. // 添加args支持确认的时候的参数传递 格式如[a, b, c] 数组形式
  38. showDelConfirm: function(message, action, cancel, args) {
  39. shr.msgHideAll();
  40. shr.startMask();
  41. var msg = _top.Messenger().post({
  42. message: message,
  43. hideAfter: null,
  44. showCloseButton: true,
  45. close: function(){
  46. shr.stopMask();
  47. },
  48. actions: {
  49. retry: {
  50. label: "是",
  51. auto: false,
  52. delay: 0,
  53. showCloseButton: true,
  54. action: function() {
  55. shr.msgHideAll();
  56. shr.stopMask();
  57. if (action && $.isFunction(action)) {
  58. if(args){
  59. action.apply(this,args);
  60. }else{
  61. action.apply(this);
  62. }
  63. }
  64. }
  65. },
  66. cancel: {
  67. label: "否",
  68. action: function() {
  69. shr.msgHideAll();
  70. shr.stopMask();
  71. if (cancel && $.isFunction(cancel)) {
  72. if(args){
  73. cancel.apply(this,args);
  74. }else{
  75. cancel.apply(this);
  76. }
  77. } else {
  78. return msg.cancel();
  79. }
  80. }
  81. }
  82. }
  83. });
  84. return msg;
  85. },
  86. });