TurnBankDJ.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* 费用报销转银行登记
  2. */
  3. Ext.define('erp.view.core.button.TurnBankDJ',{
  4. extend : 'Ext.Button',
  5. alias : 'widget.erpTurnBankDJButton',
  6. iconCls : 'x-button-icon-submit',
  7. cls : 'x-btn-gray',
  8. text : $I18N.common.button.erpTurnBankDJButton,
  9. style : {
  10. marginLeft : '10px'
  11. },
  12. width : 140,
  13. initComponent : function() {
  14. this.callParent(arguments);
  15. },
  16. listeners: {
  17. afterrender: function(btn) {
  18. /*var status = Ext.getCmp('cr_statuscode');
  19. if(status && status.value == 'ENTERING'){
  20. btn.hide();
  21. }*/
  22. }
  23. },
  24. handler: function() {
  25. var me = this, win = Ext.getCmp('Complaint-win');
  26. if(!win) {
  27. /*var result = Ext.getCmp('cr_result'), man = Ext.getCmp('cr_dutyman'), dep = Ext.getCmp('cr_dutydepartment'),cont=Ext.getCmp('cr_content'),
  28. val1 = result ? result.value : '', val2 = man ? man.value : '', val3 = dep ? dep.value : '', val4 = cont ? cont.value : '';*/
  29. win = Ext.create('Ext.Window', {
  30. id: 'Complaint-win',
  31. title: '转 银行登记',
  32. height: 300,
  33. width: 450,
  34. items: [{
  35. margin: '3 0 0 0',
  36. xtype: 'dbfindtrigger',
  37. fieldLabel: '银行账号',
  38. name:'bank_name',
  39. value: ''
  40. }],
  41. closeAction: 'hide',
  42. buttonAlign: 'center',
  43. layout: {
  44. type: 'vbox',
  45. align: 'center'
  46. },
  47. buttons: [{
  48. text: $I18N.common.button.erpConfirmButton,
  49. cls: 'x-btn-blue',
  50. handler: function(btn) {
  51. var form = btn.ownerCt.ownerCt,
  52. a = form.down('textfield[name=bank_name]');
  53. if((a.isDirty() && !Ext.isEmpty(a.value))) {
  54. me.updateComplaint(Ext.getCmp('fc_id').value, a.value);
  55. }
  56. }
  57. }, {
  58. text: $I18N.common.button.erpCloseButton,
  59. cls: 'x-btn-blue',
  60. handler: function(btn) {
  61. btn.ownerCt.ownerCt.hide();
  62. }
  63. }]
  64. });
  65. }
  66. win.show();
  67. },
  68. updateComplaint: function(id, val1) {/*
  69. Ext.Ajax.request({
  70. url: basePath + 'scm/qc/updateComplaint.action',
  71. params: {
  72. id: id,
  73. val1: val1,
  74. val2: val2,
  75. val3: val3,
  76. val4: val4
  77. },
  78. callback: function(opt, s, r) {
  79. var rs = Ext.decode(r.responseText);
  80. if(rs.exceptionInfo) {
  81. showError(rs.exceptionInfo);
  82. } else {
  83. Ext.Msg.alert("提示","更新成功!");
  84. window.location.reload();
  85. }
  86. }
  87. });
  88. */}
  89. });