FormPanelController.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. Ext.define('make.view.sale.saleForecast.FormPanelController', {
  2. extend: 'saas.view.sale.sale.FormPanelController',
  3. alias: 'controller.sale-saleforecast-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'multidbfindtrigger[name=sd_prodcode]': {
  9. beforerender: function (f) {
  10. Ext.apply(f, {
  11. defaultCondition:"pr_statuscode='ENABLE' and pr_manutype in('MAKE','OSMAKE')",
  12. dbfinds: [{
  13. from: 'pr_code', to: 'sd_prodcode'
  14. }, {
  15. from: 'pr_saleprice', to: 'sd_lastprice'
  16. }, {
  17. from: 'pr_detail', to: 'pr_detail'
  18. }, {
  19. from: 'pr_spec', to: 'pr_spec'
  20. },{
  21. from: 'pr_brand', to: 'pr_brand'
  22. },{
  23. from: 'pr_orispeccode', to: 'pr_orispeccode'
  24. },{
  25. from: 'pr_unit', to: 'pr_unit'
  26. }, {
  27. from: 'id', to: 'sd_prodid', ignore: true
  28. }],
  29. });
  30. }
  31. },
  32. 'multidbfindtrigger[name=pr_detail]': {
  33. beforerender: function (f) {
  34. Ext.apply(f, {
  35. defaultCondition:"pr_statuscode='ENABLE' and pr_manutype in('MAKE','OSMAKE')",
  36. dbfinds: [{
  37. from: 'pr_code', to: 'sd_prodcode'
  38. }, {
  39. from: 'pr_saleprice', to: 'sd_lastprice'
  40. }, {
  41. from: 'pr_detail', to: 'pr_detail'
  42. }, {
  43. from: 'pr_spec', to: 'pr_spec'
  44. },{
  45. from: 'pr_brand', to: 'pr_brand'
  46. },{
  47. from: 'pr_orispeccode', to: 'pr_orispeccode'
  48. },{
  49. from: 'pr_unit', to: 'pr_unit'
  50. }, {
  51. from: 'id', to: 'sd_prodid', ignore: true
  52. }],
  53. });
  54. }
  55. },
  56. 'dbfindtrigger[name=sd_custname]': {
  57. beforerender: function (f) {
  58. Ext.apply(f, {
  59. dbfinds: [{
  60. from: 'cu_code', to: 'sd_custcode'
  61. }, {
  62. from: 'cu_name', to: 'sd_custname'
  63. }, {
  64. from: 'id', to: 'sd_custid', ignore: true
  65. }],
  66. });
  67. }
  68. }
  69. });
  70. },
  71. turnMake: function () {
  72. var me = this,
  73. form = me.getView(),
  74. id = form.getForm().findField(form._idField);
  75. me.turnMakeDialog = form.add({
  76. xtype: 'sale-saleforecast-turnmakewin',
  77. _parent:form,
  78. _id : id.value,
  79. width:'70%',
  80. height:'65%'
  81. });
  82. me.turnMakeDialog.show();
  83. } ,
  84. });