Print.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.common.Print', {
  3. extend: 'Ext.app.Controller',
  4. views:[
  5. 'common.print.Viewport','common.print.Form','core.trigger.DbfindTrigger','core.form.FtField',
  6. 'core.trigger.MultiDbfindTrigger','core.trigger.AddDbfindTrigger','core.form.MonthDateField','core.trigger.MasterTrigger',
  7. 'core.form.FtFindField','core.form.ConDateField','core.form.MultiField','core.form.ConMonthDateField'
  8. ],
  9. init:function(){
  10. this.control({
  11. 'erpPrintFormPanel button[name=confirm]': {
  12. click: function(btn){
  13. //...检查dbFind出来的单据是否满足打印条件
  14. //...交付打印
  15. }
  16. },
  17. 'monthdatefield': {
  18. afterrender: function(f) {
  19. var type = '';
  20. if(f.name == 'cd_yearmonth') {
  21. type = 'MONTH-T';
  22. }
  23. /*if(f.name == 'vo_yearmonth') {
  24. type = 'MONTH-A';
  25. }
  26. if(f.name == 'cm_yearmonth') {
  27. type = 'MONTH-A';
  28. }*/
  29. if(type != '') {
  30. this.getCurrentMonth(f, type);
  31. }
  32. }
  33. }
  34. });
  35. },
  36. getCurrentMonth: function(f, type) {
  37. Ext.Ajax.request({
  38. url: basePath + 'fa/getMonth.action',
  39. params: {
  40. type: type
  41. },
  42. callback: function(opt, s, r) {
  43. var rs = Ext.decode(r.responseText);
  44. if(rs.data) {
  45. f.setValue(rs.data.PD_DETNO);
  46. }
  47. }
  48. });
  49. }
  50. });