FormPanelController.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.stock-appropriationinout-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. /**放大镜新增demo*/
  8. "field[name=combo]":{
  9. beforerender:function(f){
  10. f.addHandler=me.addCombo;
  11. }
  12. },
  13. //放大镜赋值关系 以及 tpl模板
  14. 'dbfindtrigger[name=pi_vendname]':{
  15. beforerender:function(f){
  16. Ext.apply(f,{
  17. //赋值
  18. dbfinds:[{
  19. from:'id',to:'pi_vendid',ignore:true
  20. },{
  21. from:'ve_code',to:'pi_vendcode'
  22. },{
  23. from:'ve_name',to:'pi_vendname'
  24. }],
  25. }) ;
  26. }
  27. },
  28. //放大镜赋值关系 以及 tpl模板
  29. 'dbfindtrigger[name=pi_custname]': {
  30. beforerender: function (f) {
  31. Ext.apply(f, {
  32. dbfinds: [{
  33. from: 'id',to: 'pi_custid',ignore:true
  34. }, {
  35. from: 'cu_code',to: 'pi_custcode'
  36. }, {
  37. from: 'cu_name',to: 'pi_custname'
  38. }],
  39. });
  40. }
  41. },
  42. //放大镜赋值关系 以及 tpl模板
  43. 'multidbfindtrigger[name=pd_prodcode]': {
  44. beforerender: function (f) {
  45. Ext.apply(f, {
  46. dbfinds: [{
  47. from: 'id',
  48. to: 'pd_prodid',ignore:true
  49. }, {
  50. from: 'pr_code',
  51. to: 'pd_prodcode'
  52. }, {
  53. from: 'pr_detail',
  54. to: 'pr_detail'
  55. }, {
  56. from: 'pr_spec',
  57. to: 'pr_spec'
  58. },{
  59. from: 'pr_brand', to: 'pr_brand'
  60. },{
  61. from: 'pr_orispeccode', to: 'pr_orispeccode'
  62. },{
  63. from: 'pr_unit', to: 'pr_unit'
  64. }, {
  65. from:'pr_whid',to:'pd_whid'
  66. },{
  67. from:'pr_whcode',to:'pd_whcode'
  68. },{
  69. from:'pr_whname',to:'pd_whname'
  70. },{
  71. from:'pr_purcprice',to:'pd_orderprice'
  72. }],
  73. });
  74. }
  75. },
  76. //放大镜赋值关系 以及 tpl模板
  77. 'dbfindtrigger[name=pd_whname]':{
  78. beforerender:function(f){
  79. Ext.apply(f,{
  80. dbfinds:[{
  81. from:'id',to:'pd_whid',ignore:true
  82. },{
  83. from:'wh_code',to:'pd_whcode'
  84. },{
  85. from:'wh_description',to:'pd_whname'
  86. }],
  87. }) ;
  88. }
  89. },
  90. //放大镜赋值关系 以及 tpl模板
  91. 'dbfindtrigger[name=pd_inwhname]':{
  92. beforerender:function(f){
  93. Ext.apply(f,{
  94. dbfinds:[{
  95. from:'id',to:'pd_inwhid',ignore:true
  96. },{
  97. from:'wh_code',to:'pd_inwhcode'
  98. },{
  99. from:'wh_description',to:'pd_inwhname'
  100. }],
  101. }) ;
  102. }
  103. }
  104. });
  105. },
  106. addCombo:function(){
  107. var combo=this.ownerCmp;
  108. Ext.create('Ext.window.Window',{
  109. layout:'vbox',
  110. bodyPadding: 15,
  111. width:500,
  112. items:[{
  113. fieldLabel:'实际值',
  114. xtype:'textfield'
  115. },{
  116. fieldLabel:'显示值',
  117. xtype:'textfield'
  118. }],
  119. buttons:[{
  120. text:'确认',
  121. handler:function(b){
  122. combo.setValue('ok');
  123. b.up('window').close();
  124. }
  125. }],
  126. renderTo:this.ownerCmp.ownerCt.getEl()
  127. }).show();
  128. }
  129. });