Zhangling.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.pm.bom.Zhangling', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views:[
  7. 'pm.bom.Zhangling','core.form.Panel', 'core.trigger.DbfindTrigger',
  8. 'core.button.Print','core.button.Zhangling','core.button.Close'
  9. ],
  10. init:function(){
  11. this.control({
  12. 'erpCloseButton': {
  13. click: function(btn){
  14. this.FormUtil.beforeClose(this);
  15. }
  16. },
  17. 'erpZhanglingButton': {
  18. click: function(btn) {
  19. var form = btn.ownerCt.ownerCt,
  20. todate = Ext.getCmp('ba_date').value;
  21. form.setLoading(true);
  22. Ext.Ajax.request({
  23. url: basePath + 'pm/bom/Zhangling.action',
  24. params: {
  25. todate: todate
  26. },
  27. timeout: 120000,
  28. callback: function(opt, s, r) {
  29. form.setLoading(false);
  30. var rs = Ext.decode(r.responseText);
  31. if(rs.success) {
  32. alert('计算完成!');
  33. }
  34. }
  35. });
  36. //}
  37. }
  38. },
  39. 'erpPrintButton': {
  40. click:function(btn){
  41. var reportName = "BOMCostView",
  42. id = Ext.getCmp('bo_id').value,
  43. condition = '{BOM.bo_id}=' + id;
  44. console.log(condition);
  45. this.FormUtil.onwindowsPrint(id, reportName, condition);
  46. }
  47. }
  48. });
  49. }
  50. });