FormPanelController.js 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.purchase-purchaseout-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. dataUrl:basePath+'document/vendor/list',
  18. // dataUrl:'http://localhost:9480/vendor/list',
  19. dbfinds:[{
  20. from:'ve_id',to:'pi_vendid'
  21. },{
  22. from:'ve_code',to:'pi_vendcode'
  23. },{
  24. from:'ve_name',to:'pi_vendname'
  25. }],
  26. dbtpls:[{
  27. field:'ve_code',width:100
  28. },{
  29. field:'ve_name',width:100
  30. }],
  31. dbColumns:[{
  32. conditionCode:'ve_id',
  33. "text": "供应商ID",
  34. "flex": 0,
  35. "dataIndex": "ve_id",
  36. "width": 0,
  37. "xtype": "",
  38. "items": null
  39. },{
  40. conditionCode:'ve_code',
  41. "text": "供应商编号",
  42. "flex": 1,
  43. "dataIndex": "ve_code",
  44. "width": 100,
  45. "xtype": "",
  46. "items": null
  47. }, {
  48. conditionCode:'ve_name',
  49. "text": "供应商名称",
  50. "flex": 1,
  51. "dataIndex": "ve_name",
  52. "xtype": "",
  53. "items": null
  54. }, {
  55. conditionCode:'ve_type',
  56. "text": "供应商类型",
  57. "flex": 0,
  58. "dataIndex": "ve_type",
  59. "width": 200,
  60. "xtype": "",
  61. "items": null
  62. }]
  63. }) ;
  64. }
  65. },
  66. //放大镜赋值关系 以及 tpl模板
  67. 'dbfindtrigger[name=pd_prodcode]':{
  68. beforerender:function(f){
  69. Ext.apply(f,{
  70. dataUrl:basePath+'document/product/list',
  71. // dataUrl:'http://localhost:9480/product/list',
  72. dbfinds:[{
  73. from:'id',to:'pd_prodid'
  74. },{
  75. from:'pr_code',to:'pd_prodcode'
  76. },{
  77. from:'pr_detail',to:'pr_detail'
  78. },{
  79. from:'pr_unit',to:'pd_unit'
  80. }],
  81. dbtpls:[{
  82. field:'pr_code',width:100
  83. },{
  84. field:'pr_detail',width:100
  85. },{
  86. field:'pr_unit',width:100
  87. }],
  88. dbColumns:[{
  89. "text": "物料ID",
  90. "flex": 0,
  91. "dataIndex": "pr_id",
  92. "width": 0,
  93. "xtype": "",
  94. "items": null
  95. },{
  96. "text": "物料编号",
  97. "flex": 1,
  98. "dataIndex": "pr_code",
  99. "width": 100,
  100. "xtype": "",
  101. "items": null
  102. }, {
  103. "text": "物料名称",
  104. "flex": 1,
  105. "dataIndex": "pr_detail",
  106. "xtype": "",
  107. "items": null
  108. }, {
  109. "text": "物料规格",
  110. "flex": 0,
  111. "dataIndex": "pr_spec",
  112. "width": 200,
  113. "xtype": "",
  114. "items": null
  115. }, {
  116. "text": "物料单位",
  117. "flex": 0,
  118. "dataIndex": "pr_unit",
  119. "width": 200,
  120. "xtype": "",
  121. "items": null
  122. }]
  123. }) ;
  124. }
  125. },
  126. //放大镜赋值关系 以及 tpl模板
  127. 'dbfindtrigger[name=pd_whname]':{
  128. beforerender:function(f){
  129. Ext.apply(f,{
  130. dataUrl:basePath+'document/warehouse/list',
  131. // dataUrl:'http://localhost:9480/warehouse/list',
  132. dbfinds:[{
  133. from:'id',to:'pd_whid'
  134. },{
  135. from:'wh_code',to:'pd_whcode'
  136. },{
  137. from:'wh_description',to:'pd_whname'
  138. }],
  139. dbtpls:[{
  140. field:'pd_whcode',width:100
  141. },{
  142. field:'pd_whname',width:100
  143. }],
  144. dbColumns:[{
  145. "text": "仓库ID",
  146. "flex": 0,
  147. "dataIndex": "id",
  148. "width": 0,
  149. "xtype": "",
  150. "items": null
  151. },{
  152. "text": "仓库编号",
  153. "flex": 1,
  154. "dataIndex": "wh_code",
  155. "width": 100,
  156. "xtype": "",
  157. "items": null
  158. }, {
  159. "text": "仓库名称",
  160. "flex": 1,
  161. "dataIndex": "wh_description",
  162. "xtype": "",
  163. "items": null
  164. }, ]
  165. }) ;
  166. }
  167. }
  168. });
  169. },
  170. addCombo:function(){
  171. var combo=this.ownerCmp;
  172. Ext.create('Ext.window.Window',{
  173. layout:'vbox',
  174. bodyPadding: 15,
  175. width:500,
  176. items:[{
  177. fieldLabel:'实际值',
  178. xtype:'textfield'
  179. },{
  180. fieldLabel:'显示值',
  181. xtype:'textfield'
  182. }],
  183. buttons:[{
  184. text:'确认',
  185. handler:function(b){
  186. combo.setValue('ok');
  187. b.up('window').close();
  188. }
  189. }],
  190. renderTo:this.ownerCmp.ownerCt.getEl()
  191. }).show();
  192. }
  193. });