FormController.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. Ext.define('saas.view.test.order.FormController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.test-order-formcontroller',
  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.253.41:9480/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. dbSearchFields:[{
  29. xtype : "textfield",
  30. name : "ve_name",
  31. conditionExpression:"ve_name like '{0}%'",
  32. fieldLabel : "供应商名称",
  33. allowBlank : true,
  34. columnWidth : 0.25
  35. }],
  36. dbColumns:[{
  37. conditionCode:'ve_id',
  38. "text": "供应商ID",
  39. "flex": 0,
  40. "dataIndex": "ve_id",
  41. "width": 0,
  42. "xtype": "",
  43. "items": null
  44. },{
  45. conditionCode:'ve_code',
  46. "text": "供应商编号",
  47. "flex": 1,
  48. "dataIndex": "ve_code",
  49. "width": 100,
  50. "xtype": "",
  51. "items": null
  52. }, {
  53. conditionCode:'ve_name',
  54. "text": "供应商名称",
  55. "flex": 1,
  56. "dataIndex": "ve_name",
  57. "xtype": "",
  58. "items": null
  59. }, {
  60. conditionCode:'ve_type',
  61. "text": "供应商类型",
  62. "flex": 0,
  63. "dataIndex": "ve_type",
  64. "width": 200,
  65. "xtype": "",
  66. "items": null
  67. }]
  68. }) ;
  69. }
  70. },
  71. //放大镜赋值关系 以及 tpl模板
  72. 'dbfindtrigger[name=pd_prodcode]':{
  73. beforerender:function(f){
  74. Ext.apply(f,{
  75. dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
  76. dbfinds:[{
  77. from:'pr_code',to:'pd_prodcode'
  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. dbSearchFields:[{
  87. emptyText:'输入物料编号或物料名称',
  88. xtype : "textfield",
  89. name : "search",
  90. conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
  91. allowBlank : true,
  92. columnWidth : 0.25
  93. }],
  94. dbColumns:[{
  95. "text": "物料ID",
  96. "flex": 0,
  97. "dataIndex": "pr_id",
  98. "width": 0,
  99. "xtype": "",
  100. "items": null
  101. },{
  102. "text": "物料编号",
  103. "flex": 1,
  104. "dataIndex": "pr_code",
  105. "width": 100,
  106. "xtype": "",
  107. "items": null
  108. }, {
  109. "text": "物料名称",
  110. "flex": 1,
  111. "dataIndex": "pr_detail",
  112. "xtype": "",
  113. "items": null
  114. }, {
  115. "text": "物料规格",
  116. "flex": 0,
  117. "dataIndex": "pr_spec",
  118. "width": 200,
  119. "xtype": "",
  120. "items": null
  121. }]
  122. }) ;
  123. }
  124. },
  125. //放大镜赋值关系 以及 tpl模板
  126. 'multidbfindtrigger[name=pd_prodcode]':{
  127. beforerender:function(f){
  128. Ext.apply(f,{
  129. dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
  130. dbfinds:[{
  131. from:'pr_code',to:'pd_prodcode'
  132. },{
  133. from:'pr_unit',to:'pd_unit'
  134. }],
  135. dbtpls:[{
  136. field:'pr_code',width:100
  137. },{
  138. field:'pr_detail',width:100
  139. }],
  140. dbSearchFields:[{
  141. emptyText:'输入物料编号或物料名称',
  142. xtype : "textfield",
  143. name : "search",
  144. conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
  145. allowBlank : true,
  146. columnWidth : 0.25
  147. }],
  148. dbColumns:[{
  149. "text": "物料ID",
  150. "flex": 0,
  151. "dataIndex": "pr_id",
  152. "width": 0,
  153. "xtype": "",
  154. "items": null
  155. },{
  156. "text": "物料编号",
  157. "flex": 1,
  158. "dataIndex": "pr_code",
  159. "width": 100,
  160. "xtype": "",
  161. "items": null
  162. }, {
  163. "text": "物料名称",
  164. "flex": 1,
  165. "dataIndex": "pr_detail",
  166. "xtype": "",
  167. "items": null
  168. }, {
  169. "text": "物料规格",
  170. "flex": 0,
  171. "dataIndex": "pr_spec",
  172. "width": 200,
  173. "xtype": "",
  174. "items": null
  175. }]
  176. }) ;
  177. }
  178. }
  179. });
  180. },
  181. addCombo:function(){
  182. var combo=this.ownerCmp;
  183. Ext.create('Ext.window.Window',{
  184. layout:'vbox',
  185. bodyPadding: 15,
  186. width:500,
  187. items:[{
  188. fieldLabel:'实际值',
  189. xtype:'textfield'
  190. },{
  191. fieldLabel:'显示值',
  192. xtype:'textfield'
  193. }],
  194. buttons:[{
  195. text:'确认',
  196. handler:function(b){
  197. combo.setValue('ok');
  198. b.up('window').close();
  199. }
  200. }],
  201. renderTo:this.ownerCmp.ownerCt.getEl()
  202. }).show();
  203. }
  204. });