AllThrowNotify.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Ext.define('erp.view.core.button.AllThrowNotify',{
  2. extend: 'Ext.Button',
  3. alias: 'widget.erpAllThrowNotifyButton',
  4. iconCls: 'x-button-icon-save',
  5. cls: 'x-btn-gray-1',
  6. text: $I18N.common.button.erpAllThrowButton,
  7. style: {
  8. marginLeft: '10px'
  9. },
  10. width:90,
  11. initComponent : function(){
  12. this.callParent(arguments);
  13. },
  14. handler: function(btn){
  15. var form =Ext.getCmp('dealform');
  16. var grid = Ext.getCmp('batchDealGridPanel');
  17. var condition=form.getCondition(grid);
  18. condition=condition!=""?condition + " AND "+getUrlParam("urlcondition"):getUrlParam("urlcondition");
  19. var main = parent.Ext.getCmp("content-panel");
  20. main.getActiveTab().setLoading(true);
  21. Ext.Ajax.request({
  22. url : basePath + 'pm/wcplan/throwpurchasenotify.action',
  23. params: {
  24. condition:condition
  25. },
  26. method : 'post',
  27. timeout: 6000000,
  28. callback : function(options,success,response){
  29. main.getActiveTab().setLoading(false);
  30. var localJson = new Ext.decode(response.responseText);
  31. if(localJson.exceptionInfo){
  32. var str = localJson.exceptionInfo;
  33. if(str.trim().substr(0, 12) == 'AFTERSUCCESS'){
  34. str = str.replace('AFTERSUCCESS', '');
  35. grid.multiselected = new Array();
  36. Ext.getCmp('dealform').onQuery();
  37. }
  38. showError(str);return;
  39. }
  40. if(localJson.success){
  41. if(localJson.log){
  42. showMessage("提示", localJson.log);
  43. }
  44. Ext.Msg.alert("提示", "处理成功!", function(){
  45. grid.multiselected = new Array();
  46. Ext.getCmp('dealform').onQuery();
  47. });
  48. }
  49. }
  50. });
  51. }
  52. });