AgreeAllToPrice.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * 批量处理按钮
  3. */
  4. Ext.define('erp.view.core.button.AgreeAllToPrice',{
  5. extend: 'Ext.Button',
  6. alias: 'widget.erpAgreeAllToPriceButton',
  7. text: $I18N.common.button.erpAgreeAllToPriceButton,
  8. iconCls: 'x-button-icon-check',
  9. cls: 'x-btn-gray',
  10. id: 'erpAgreeAllToPriceButton',
  11. initComponent : function(){
  12. this.callParent(arguments);
  13. },
  14. width: 110,
  15. handler : function(btn) {
  16. var grid = btn.up('grid'), record = grid.store.first(), id = null;
  17. if(record && (id = record.get('id_inid')) > 0) {
  18. grid.setLoading(true);
  19. Ext.Ajax.request({
  20. url : basePath + btn.url,
  21. params: {
  22. caller: caller,
  23. id: id
  24. },
  25. method : 'post',
  26. callback : function(options,success,response){
  27. grid.setLoading(false);
  28. var localJson = new Ext.decode(response.responseText);
  29. if(localJson.exceptionInfo){
  30. showError(localJson.exceptionInfo);
  31. return "";
  32. }
  33. if(localJson.success){
  34. Ext.Msg.alert("提示", "处理成功!", function(){
  35. window.location.reload();
  36. });
  37. }
  38. }
  39. });
  40. }
  41. }
  42. });