FormPanelController.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. Ext.define('saas.view.sale.saleout.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.sale-saleout-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=pu_vendcode]':{
  15. beforerender:function(f){
  16. Ext.apply(f,{
  17. dataUrl:'http://192.168.0.181:8570/api/document/vendor/getVendorsByCondition',
  18. dbfinds:[{
  19. from:'ve_code',to:'pu_vendcode'
  20. },{
  21. from:'ve_name',to:'pu_vendname'
  22. }],
  23. dbtpls:[{
  24. field:'ve_code',width:100
  25. },{
  26. field:'ve_name',width:100
  27. }],
  28. dbColumns:[{
  29. conditionCode:'ve_id',
  30. "text": "供应商ID",
  31. "flex": 0,
  32. "dataIndex": "ve_id",
  33. "width": 0,
  34. "xtype": "",
  35. "items": null
  36. },{
  37. conditionCode:'ve_code',
  38. "text": "供应商编号",
  39. "flex": 1,
  40. "dataIndex": "ve_code",
  41. "width": 100,
  42. "xtype": "",
  43. "items": null
  44. }, {
  45. conditionCode:'ve_name',
  46. "text": "供应商名称",
  47. "flex": 1,
  48. "dataIndex": "ve_name",
  49. "xtype": "",
  50. "items": null
  51. }, {
  52. conditionCode:'ve_type',
  53. "text": "供应商类型",
  54. "flex": 0,
  55. "dataIndex": "ve_type",
  56. "width": 200,
  57. "xtype": "",
  58. "items": null
  59. }]
  60. }) ;
  61. }
  62. },
  63. //放大镜赋值关系 以及 tpl模板
  64. 'dbfindtrigger[name=pd_prodcode]':{
  65. beforerender:function(f){
  66. Ext.apply(f,{
  67. conditionCode:'pr_code',
  68. dataUrl:'http://192.168.0.181:8570/api/document/product/getProductsByCondition',
  69. dbfinds:[{
  70. from:'pr_code',to:'pd_prodcode',
  71. from:'pr_unit',to:'pd_unit'
  72. }],
  73. dbtpls:[{
  74. field:'pr_code',width:100
  75. },{
  76. field:'pr_detail',width:100
  77. },{
  78. field:'pr_unit',width:100
  79. }],
  80. dbColumns:[{
  81. "text": "物料ID",
  82. "flex": 0,
  83. "dataIndex": "pr_id",
  84. "width": 0,
  85. "xtype": "",
  86. "items": null
  87. },{
  88. "text": "物料编号",
  89. "flex": 1,
  90. "dataIndex": "pr_code",
  91. "width": 100,
  92. "xtype": "",
  93. "items": null
  94. }, {
  95. "text": "物料名称",
  96. "flex": 1,
  97. "dataIndex": "pr_detail",
  98. "xtype": "",
  99. "items": null
  100. }, {
  101. "text": "物料规格",
  102. "flex": 0,
  103. "dataIndex": "pr_spec",
  104. "width": 200,
  105. "xtype": "",
  106. "items": null
  107. }, {
  108. "text": "物料单位",
  109. "flex": 0,
  110. "dataIndex": "pr_unit",
  111. "width": 200,
  112. "xtype": "",
  113. "items": null
  114. }]
  115. }) ;
  116. }
  117. }
  118. });
  119. },
  120. addCombo:function(){
  121. var combo=this.ownerCmp;
  122. Ext.create('Ext.window.Window',{
  123. layout:'vbox',
  124. bodyPadding: 15,
  125. width:500,
  126. items:[{
  127. fieldLabel:'实际值',
  128. xtype:'textfield'
  129. },{
  130. fieldLabel:'显示值',
  131. xtype:'textfield'
  132. }],
  133. buttons:[{
  134. text:'确认',
  135. handler:function(b){
  136. combo.setValue('ok');
  137. b.up('window').close();
  138. }
  139. }],
  140. renderTo:this.ownerCmp.ownerCt.getEl()
  141. }).show();
  142. }
  143. });